HYDRA_development_version
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hmdctaskset.cc
Go to the documentation of this file.
1 #include "hades.h"
2 #include "hdetector.h"
3 #include "hspectrometer.h"
4 #include "hmdctaskset.h"
5 #include "htask.h"
6 #include "htaskset.h"
7 #include "hdebug.h"
8 #include "haddef.h"
9 #include "hmdccalibrater1.h"
10 #include "hmdcdigitizer.h"
11 #include "hmdctrackdset.h"
12 #include "hmdcdedx2maker.h"
13 #include "hmdcvertexfind.h"
14 #include "hreconstructor.h"
15 #include "hmdcsetup.h"
16 #include "hmdctimecut.h"
17 #include "hruntimedb.h"
18 #include "hrun.h"
19 #include "hdatasource.h"
20 #include "hlocation.h"
21 #include "hmessagemgr.h"
22 
23 #include "TBrowser.h"
24 #include "TROOT.h"
25 #include "TClass.h"
26 
27 #include <stdlib.h>
28 
29 //#include <iostream>
30 //#include <iomanip>
31 using namespace std;
32 
33 //*-- Author : Dan Magestro
34 //*--modified : Jochen Markert
35 
36 //_HADES_CLASS_DESCRIPTION
37 ///////////////////////////////////////////////////////////////////////////////
38 // HMdcTaskSet
39 //
40 // This HTaskSet contains the tasks for the Mdc detector
41 //
42 // HMdcTaskSet::make("selectionstring","optionstring");
43 //
44 // SELECTION : if selectionstring="rtdb" HMdcTaskSet is initialized
45 // via RuntimeDb. If this flag is set, all input from the
46 // optionstring will be ignored.
47 // ----------------------------------------------------------------
48 //
49 //
50 // OPTIONS :
51 // ----------------------------------------------------------------
52 // All settings are initialized to default values. The options set in the
53 // optionstring will override the defaults for the specified parameters.
54 // If selectionstring is set to "rtdb", all values in optionstring will be
55 // ignored.
56 //
57 // real (default),simulation
58 // or merge -- real data, simulation data or embedding
59 // dubna (default) or santiago -- selects hit finder
60 //
61 // Maximum data level
62 // raw -- only unpacker
63 // cal1 -- up to calibrater1
64 // cal2 -- up to calibrater2
65 // hit (default) -- up to hit finder
66 // fit -- up to track fitter
67 //
68 // HMdcCalibrater1:
69 // NoStartAndNoCal -- do not use start,
70 // do not use calibration
71 // NoStartAndCal -- do not use start,
72 // use calibration
73 // StartAndCal (default) -- use start,
74 // use calibration
75 // NoTimeCuts -- do not use time cuts
76 // TimeCuts (default) -- use time cuts
77 //
78 // DUBNA TRACKER:
79 // MagnetOn (default) -- Magnetic field
80 // MagnetOff -- Magnetic field off
81 // CombinedClusters (default) -- Cluster search in
82 // combined chambers
83 // ChamberClusters -- Cluster search in
84 // individual chambers
85 // MixedClusters -- Cluster search in
86 // combined chambers and after it
87 // in individual chambers
88 // ----------------------------------------------------------------
89 //
90 //
91 // IDEAL MDC TRACKING :
92 // ----------------------------------------------------------------
93 // In DST macro :
94 // Bool_t idealTracking = kTRUE;
95 // Bool_t fillParallel = kFALSE;
96 // kTRUE will fill HMdcHitSim,HMdcSegSim and HMdcTrkCand to ideal categories
97 //
98 // After HMdcTaskSet *mdcTaskSet = new HMdcTaskSet(); add:
99 // if(idealTracking) mdcTaskSet->useIdealTracking(fillParallel); // must be before mdcTaskSet->make(...)
100 //
101 // For changing ideal tracking parameters (see HMdcIdealTracking.h/cc files) you can get
102 // the pointer of HMdcIdealTracking object by function MdcTrackDSet::getMdcIdealTracking().
103 // It must be after
104 // HTask *mdcTasks = mdcTaskSet->make(..)
105 // ...
106 // if(idealTracking) {
107 // HMdcTrackDSet::getMdcIdealTracking()->set...
108 // }
109 // ----------------------------------------------------------------
110 //
111 // Note: Thanks to TString, options can be separated and written any way
112 // you want, such as
113 //
114 // HMdcTaskSet::make("","MagnetOFF,NOstartandNOcal")
115 // HMdcTaskSet::make("","ChamberClusters & STARTandCAL")
116 //
117 // For testing a pointer for the MdcDigitizer can be retrieved to set the options from the macro:
118 // mdcdigi=(HMdcDigitizer*)mdcTasks->HMdcTaskSet::getDigitizer();
119 //
120 // In the same way a pointer to MdcCalibrater1() can be retrieved:
121 // calibrater1=(HMdcCalibrater1*)mdcTasks->HMdcTaskSet::getCalibrater1();
122 //
123 // A pointer to MdcDeDx2Maker() can be retrieved:
124 // mdcdedxmaker=(HMdcDeDx2Maker*)mdcTasks->HMdcTaskSet::getDeDx2Maker();
125 //
126 // Full control over all parameters can be gained by retrieving
127 // the pointer to the internal setup object(example):
128 //
129 // create taskset HMdcTaskSet *mymdctasks = new HMdcTaskSet();
130 // Int_t testLayers[6][4]={{5,6,6,6},{6,6,6,6},{6,6,6,6},{6,6,6,6},{6,6,6,6},{6,6,6,6}};
131 // Int_t testLevel[4]={10,50,10,30};
132 //
133 // get pointer to setup HMdcSetup* mysetup=mymdctasks->getMdcSetup();
134 // set values mysetup->getMdcTrackFinderSet()->setNLayers(&testLayers[0][0]);
135 // ... mysetup->getMdcTrackFinderSet()->setNLevel (&testLevel[0]);
136 // ... mysetup->getMdc12FitSet() ->setMdc12FitSet(1,1,1,kTRUE,kFALSE);
137 // ...
138 // return pointer to
139 // Taskset HTaskSet *mdcTasks = mymdctasks->make("","");
140 // For the setup objects of the other tasks it works in the same way, the description can be
141 // found in HMdcSetup.
142 //
143 // BEGIN_HTML<b><font color="maroon">For more information, see <a target="_top" href="http://webdb.gsi.de:8010/pls/hades_webdbs/hanal.hal_posting_query.show_posting_text?p_id=436">this analysis logbook entry<a>.</font></b> END_HTML
144 //
145 ///////////////////////////////////////////////////////////////////////////////
146 
147 
148 // set counters to 0
149 Int_t HMdcTaskSet::ilevel =0;
151 Int_t HMdcTaskSet::icalibrater =0;
152 Int_t HMdcTaskSet::itimecuts =0;
153 Int_t HMdcTaskSet::itracker =0;
154 Int_t HMdcTaskSet::imagnet =0;
156 
157 // define default values of all arguments
161 
162 Int_t HMdcTaskSet::tracker =1;
164 Bool_t HMdcTaskSet::isCoilOff =kFALSE;
165 Int_t HMdcTaskSet::nLevel[4] ={10,50,10,30};
166 Int_t HMdcTaskSet::nLayers[6][4] ={{6,6,6,6},{6,6,6,6},{6,6,6,6},{6,6,6,6},{6,6,6,6},{6,6,6,6}};
167 Int_t HMdcTaskSet::mdcForSeg1 =1;
168 Int_t HMdcTaskSet::mdcForSeg2 =3;
169 Bool_t HMdcTaskSet::fitNTuple =kFALSE;
170 Bool_t HMdcTaskSet::fitPrint =kFALSE;
171 Int_t HMdcTaskSet::fitAuthor =1;
172 Int_t HMdcTaskSet::fitVersion =1;
173 Int_t HMdcTaskSet::fitIndep =0;
175 
180 Int_t HMdcTaskSet::rtdbinput =0;
181 Bool_t HMdcTaskSet::isCreated =kFALSE;
182 
191 
192 
193 HMdcTaskSet::HMdcTaskSet(const Text_t name[],const Text_t title[]) : HTaskSet(name,title) {
194  // Constructor
195  setDefaults();
196  isCreated=kTRUE;
197 }
199  // Default constructor
200  setDefaults();
201  isCreated=kTRUE;
202 }
204  // Destructor.
205  if(mdcsetuplocal) delete mdcsetuplocal;
206 }
208 {
209  if(mdcsetuplocal) delete mdcsetuplocal;
211 }
213 {
220 }
222 {
223  // define default values of all arguments
224 
225  mdcsetuplocal=new HMdcSetup("setuplocal","setuplocal");
226  getSets();
232 
234  digisetlocal->setNtupleDigi (kFALSE);
235  digisetlocal->setUseTofDigi (kTRUE);
236  digisetlocal->setUseErrorDigi (kTRUE);
243  digisetlocal->setNoiseLevelDigi (0,0,0,0);
244  digisetlocal->setNoiseRangeDigi (0,0,0,0,0,0,0,0);
246  digisetlocal->setOffsetsDigi (0,0,0,0);
248  digisetlocal->setCellEffDigi (88,88,88,88);
249 
250  idealTracking = kFALSE;
251  fillParallel = kFALSE;
252 
253  if(!mdcsetuplocal->check()) exit(1);
254  versionDeDx=1;
255 }
257 {
258  // gets the pointer to setup container,
259  // init the container with the actual runId (or RefId),
260  // copies the setup object to the local setup object and
261  // retrieves the pointer to the sub setup objects.
262 
263  HRuntimeDb *rtdb=gHades->getRuntimeDb();
264 
265  // get runid from data source/compare if a refId has been
266  // used
267  HDataSource* source=gHades->getDataSource();
268  Int_t refId=source->getCurrentRefId();
269  Int_t runId=source->getCurrentRunId();
270  Int_t myId=-99;
271 
272  if(runId==refId || refId<0)
273  {
274  myId=runId;
275  }
276  else
277  {
278  myId=refId;
279  }
280 
281  // get pointer to HMdcSetup
282  mdcsetup=(HMdcSetup*)rtdb->getContainer("MdcSetup");
283  if(!mdcsetup)
284  {
285  Error("HMdcTaskSet:make()","RETRIEVED 0 POINTER FOR HMDCSETUP!");
286  exit(1);
287  }
288  else
289  { // init HMdcSetup for the runId if the pointer is not 0
290  // this is needed because the container should be available
291  // before the TaskSet is created
292  rtdbinput=1;
293  rtdb->initContainers(myId);
294  mdcsetup->setStatic();
295  if(!mdcsetup->check())
296  { // check if init was correct
297 
298  rtdbinput=0;
299  mdcsetup->printParam();
300  Error("HMdcTaskSet:getSetupContainer()","HMDCSETUP NOT INITIALIZED CORRECTLY!");
301  exit(1);
302  }
303 
304  if(rtdbinput==1)
305  {
306  copySetup();
307  getSets();
308  }
309  }
310 }
311 HTask* HMdcTaskSet::make(const Char_t *select,const Option_t *option) {
312  // Returns a pointer to the Mdc task.
313  // The task is created according to the specified options in Option_t *option
314  // and select. If no option is specified default values will be used. If select
315  // specifies rtdb the parameters will be used from runtimedb container HMdcSetup
316  // and the parameters in option will be ignored.
317  if(!isCreated) {setDefaults();}
318 
319  HTaskSet *tasks = new HTaskSet("Mdc","List of Mdc tasks");
320  TString sel = select;
321  sel.ToLower();
322  TString opt=option;
323  if((sel.CompareTo("rtdb"))==0)
324  {
325  getSetupContainer(); // gets setupcontainer, copy, get sets
326  }
327  else
328  { // if no rtdb input was specified
329  parseArguments(opt);
330  }
331 
332  //create the taskset
333 
334  //######################### REAL/ EMBEDDING ###################################
335 
336  // check global Hades flag for embedding mode
337  if(gHades->getEmbeddingMode()!=0)
338  {
340  }
341 
343  { // real data or merge
345  {
346  //-----------------------------------------------------------------
347  // configure MDC task
348  // for embedding :
349  // -- create HMdcTimeCut standalone, set IsUsed=kFALSE
350  // -- common mode has to be switched from exp to merge
351  // This will switch the task list to run calibrater1
352  // before digitizer and the digitizer into embedding mode
353  // -- switch off time cuts in calibrater1
354  // -- select the wanted embedding mode for digitizer
355  //-----------------------------------------------------------------
356  // Mdc time cuts will not be performed by Calibrater1 but by
357  // trackfinder. Efficiency will be different, because the embedded
358  // drift cells have to struggle against noise! If the container exists
359  // and the flag Isused is set false, the track finder will use
360  // time cuts.
361 
364 
365  HRuntimeDb *rtdb=gHades->getRuntimeDb();
366 
367  HDataSource* source=gHades->getDataSource();
368  Int_t refId=source->getCurrentRefId();
369  Int_t runId=source->getCurrentRunId();
370  Int_t myId=-99;
371 
372  if(runId==refId || refId<0) {myId=runId;}
373  else {myId=refId;}
374 
375  HMdcTimeCut* timecut=(HMdcTimeCut*)rtdb->getContainer("MdcTimeCut");
376  rtdb->initContainers(myId);
377  timecut->setIsUsed(kFALSE);
378  }
380  { // cal1 and higher
381  calibrater1=new HMdcCalibrater1("mdc.cal1","Cal1");
383  tasks->add(calibrater1);
384  }
385  }
387  {
388  //######################### SIMULATION / EMBEDDING ###################################
389 
391  { // cal1sim and higher
392  mdcdigi=(HMdcDigitizer*)new HMdcDigitizer("mdc.digi","Mdc digitizer");
394  tasks->add(mdcdigi);
395  }
396  }
397  //######################### DUBNA TRACKER ###################################
398 
400  { // dubna tracker / hit and higher
401  if(idealTracking) // ideal tracking
402  { // ideal tracking
403  tasks->add( HMdcTrackDSet::hMdcIdealTracking("mdc.idealTr","mdc.idealTr",fillParallel) );
404  }
405  if(!idealTracking || fillParallel) {
407  { // trackfinder and higher
409  tasks->add( HMdcTrackDSet::hMdcTrackFinder("mdc.hitf","mdc.hitf") );
410  }
412  { // trackfinder
414  tasks->add( HMdcTrackDSet::hMdcClusterToHit("mdc.c2h","mdc.c2h") );
415  }
417  { // fitter
419  tasks->add( HMdcTrackDSet::hMdc12Fit("mdc.12fit","mdc.12fit") );
420  }
422  { // trackfinder and higher
423  if(versionDeDx==1){
424  dedx2maker=new HMdcDeDx2Maker("mdcdedx","mdcdedx");
425  tasks->add(dedx2maker);
426  }
427  }
428  }
429  }
430  //################################ VERTEX FINDER #########################################
432  { // trackfinder and higher
433 
434  vertexfinder = new HMdcVertexFind("vertexfinder","vertexfinder",HMdcVertexFind::kSegments,kTRUE);
435  tasks->add(vertexfinder);
436  }
437 
438  // print the setup status to the screen
439  printStatus();
440 
441  return tasks;
442 }
444 {
445  // The option string is searched for known arguments and
446  // the internal variables of the task are defined according
447  // to the arguments. Not set options will be defined by the
448  // default values.
449  // If the string is empty default values will be used.
450  // If unknown arguments are found error messages will be displayed
451  // and the program will be exited.
452  // If two arguments for the same type of option are found an error
453  // message will show up and the program is exited too.
454 
455  // switch maximum data level
456  TString sraw ="raw";
457  TString scal1 ="cal1";
458  TString scal2 ="cal2";
459  TString shit ="hit";
460  TString sfit ="fit";
461 
462  // switch between real data or simulation
463  TString ssimulation ="simulation";
464  TString sreal ="real";
465  TString smerge ="merge";
466 
467  // Calibrater1 options
468  TString snostartandnocal ="nostartandnocal";
469  TString snostartandcal ="nostartandcal";
470  TString sstartandcal ="startandcal";
471  TString stimecuts ="timecuts";
472  TString snotimecuts ="notimecuts";
473 
474  // switch trackers
475  TString sdubna ="dubna";
476  TString ssantiago ="santiago";
477 
478  // Dubna tracker options
479  TString smagnetoff ="magnetoff";
480  TString smagneton ="magneton";
481 
482  TString scombinedclusters="combinedclusters";
483  TString schamberclusters ="chamberclusters";
484  TString smixedclusters ="mixedclusters";
485  TString s2=s1;
486  s1.ToLower();
487  s1.ReplaceAll(" ","");
488  Ssiz_t len=s1.Length();
489  if(len!=0)
490  {
491  TObjArray* myarguments = s1.Tokenize(",");
492  TObjString *stemp;
493  TString argument;
494 
495  ilevel=0;
497  icalibrater=0;
498  icalibrater=0;
499  itimecuts=0;
500  itracker=0;
501  imagnet=0;
502  itrackermode=0;
503 
504  TIterator* myiter=myarguments->MakeIterator();
505 
506  // iterate over the lis of arguments and compare the
507  // to known key words.
508  while ((stemp=(TObjString*)myiter->Next())!= 0) {
509  argument=stemp->GetString();
510  if(argument.CompareTo(sraw)==0)
511  {
512  ilevel++;
513  if(ilevel>1)
514  {
515  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for analysis level:RAW!");
516  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: ",s2.Data());
517  printOptions();
518  exit(1);
519  }
521  }
522  else if(argument.CompareTo(scal1)==0)
523  {
524  ilevel++;
525  if(ilevel>1)
526  {
527  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for analysis level:CAL1!");
528  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
529  printOptions();
530  exit(1);
531  }
533  }
534  else if(argument.CompareTo(scal2)==0)
535  {
536  ilevel++;
537  if(ilevel>1)
538  {
539  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for analysis level:CAL2!");
540  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
541  printOptions();
542  exit(1);
543  }
545  }
546  else if(argument.CompareTo(shit)==0)
547  {
548  ilevel++;
549  if(ilevel>1)
550  {
551  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for analysis level:HIT!");
552  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
553  printOptions();
554  exit(1);
555  }
557  }
558  else if(argument.CompareTo(sfit)==0)
559  {
560  ilevel++;
561  if(ilevel>1)
562  {
563  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for analysis level:FIT!");
564  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
565  printOptions();
566  exit(1);
567  }
569  }
570  else if(argument.CompareTo(ssimulation)==0)
571  {
573  if(irealorsimulation>1)
574  {
575  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for data type!:SIMULATION");
576  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
577  printOptions();
578  exit(1);
579  }
581  }
582  else if(argument.CompareTo(sreal)==0)
583  {
585  if(irealorsimulation>1)
586  {
587  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for data type:REAL!");
588  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: ",s2.Data());
589  printOptions();
590  exit(1);
591  }
593  }
594  else if(argument.CompareTo(smerge)==0)
595  {
597  if(irealorsimulation>1)
598  {
599  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for data type:REAL!");
600  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: ",s2.Data());
601  printOptions();
602  exit(1);
603  }
605  }
606  else if(argument.CompareTo(snostartandnocal)==0)
607  {
608  icalibrater++;
609  if(icalibrater>1)
610  {
611  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for calibrater option:NoStartAndNoCal!");
612  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
613  printOptions();
614  exit(1);
615  }
617  }
618  else if(argument.CompareTo(snostartandcal)==0)
619  {
620  icalibrater++;
621  if(icalibrater>1)
622  {
623  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for calibrater option:NoStartAndCal!");
624  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
625  printOptions();
626  exit(1);
627  }
629  }
630  else if(argument.CompareTo(sstartandcal)==0)
631  {
632  icalibrater++;
633  if(icalibrater>1)
634  {
635  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for calibrater option:StartAndCal!");
636  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
637  printOptions();
638  exit(1);
639  }
641  }
642  else if(argument.CompareTo(snotimecuts)==0)
643  {
644  itimecuts++;
645  if(itimecuts>1)
646  {
647  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for time cuts:NoTimeCuts!");
648  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
649  printOptions();
650  exit(1);
651  }
653  }
654  else if(argument.CompareTo(stimecuts)==0)
655  {
656  itimecuts++;
657  if(itimecuts>1)
658  {
659  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for time cuts:TimeCuts!");
660  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
661  printOptions();
662  exit(1);
663  }
665  }
666  else if(argument.CompareTo(sdubna)==0)
667  {
668  itracker++;
669  if(itracker>1)
670  {
671  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for tracker type:DUBNA!");
672  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
673  printOptions();
674  exit(1);
675  }
677  }
678  else if(argument.CompareTo(ssantiago)==0)
679  {
680  itracker++;
681  if(itracker>1)
682  {
683  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for tracker type:SANTIAGO!");
684  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
685  printOptions();
686  exit(1);
687  }
689  }
690  else if(argument.CompareTo(smagnetoff)==0)
691  {
692  imagnet++;
693  if(imagnet>1)
694  {
695  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for magnet status:MagnetOff!");
696  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
697  printOptions();
698  exit(1);
699  }
701  }
702  else if(argument.CompareTo(smagneton)==0)
703  {
704  imagnet++;
705  if(imagnet>1)
706  {
707  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for magnet status:MagnetOn!");
708  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
709  printOptions();
710  exit(1);
711  }
713  }
714  else if(argument.CompareTo(scombinedclusters)==0)
715  {
716  itrackermode++;
717  if(itrackermode>1)
718  {
719  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for tracker mode:CombinedChamberClusters!");
720  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
721  printOptions();
722  exit(1);
723  }
725  }
726  else if(argument.CompareTo(schamberclusters)==0)
727  {
728  itrackermode++;
729  if(itrackermode>1)
730  {
731  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for tracker mode:ChamberClusters!");
732  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
733  printOptions();
734  exit(1);
735  }
737  }
738  else if(argument.CompareTo(smixedclusters)==0)
739  {
740  itrackermode++;
741  if(itrackermode>1)
742  {
743  ERROR_msg(HMessageMgr::DET_MDC,"overlap with other argument for tracker mode:MixedClusters!");
744  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
745  printOptions();
746  exit(1);
747  }
749  }
750  else
751  {
752  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"unknown argument %s !",argument.Data());
753  gHades->getMsg()->error(10,HMessageMgr::DET_MDC,GetName(),"INPUT OPTIONSTRING: %s",s2.Data());
754  printOptions();
755  exit(1);
756  }
757 
758  }
759  delete myiter;
760  myarguments ->Delete();
761  delete myarguments;
762  }
763 }
765 {
766  // Prints the options of HMdcTaskSet
767  SEPERATOR_msg("#",60);
768  INFO_msg(10,HMessageMgr::DET_MDC,"SELECTION : rtdb -- init from HMdcSetup");
769  INFO_msg(10,HMessageMgr::DET_MDC," no selection -- init from OptionString");
770  SEPERATOR_msg("-",60);
771  INFO_msg(10,HMessageMgr::DET_MDC," OPTIONS :");
772  SEPERATOR_msg("-",60);
773  INFO_msg(10,HMessageMgr::DET_MDC,"real (default) or simulation -- real data or simulation data");
774  INFO_msg(10,HMessageMgr::DET_MDC,"dubna (default) or santiago -- selects hit finder");
775  SEPERATOR_msg("-",60);
776  INFO_msg(10,HMessageMgr::DET_MDC,"Maximum data level");
777  INFO_msg(10,HMessageMgr::DET_MDC," raw -- only unpacker");
778  INFO_msg(10,HMessageMgr::DET_MDC," cal1 -- up to calibrater1");
779  INFO_msg(10,HMessageMgr::DET_MDC," cal2 -- up to calibrater2");
780  INFO_msg(10,HMessageMgr::DET_MDC," hit (default) -- up to hit finder");
781  INFO_msg(10,HMessageMgr::DET_MDC," fit -- up to track fitter");
782  INFO_msg(10,HMessageMgr::DET_MDC,"HMdcCalibrater1:");
783  INFO_msg(10,HMessageMgr::DET_MDC," NoStartAndNoCal -- do not use start,");
784  INFO_msg(10,HMessageMgr::DET_MDC," do not use calibration");
785  INFO_msg(10,HMessageMgr::DET_MDC," NoStartAndCal -- do not use start,");
786  INFO_msg(10,HMessageMgr::DET_MDC," use calibration");
787  INFO_msg(10,HMessageMgr::DET_MDC," StartAndCal (default) -- use start,");
788  INFO_msg(10,HMessageMgr::DET_MDC," use calibration");
789  INFO_msg(10,HMessageMgr::DET_MDC," NoTimeCuts -- do not use time cuts");
790  INFO_msg(10,HMessageMgr::DET_MDC," TimeCuts (default) -- use time cuts");
791  INFO_msg(10,HMessageMgr::DET_MDC," DUBNA TRACKER:");
792  INFO_msg(10,HMessageMgr::DET_MDC," MagnetOn (default) -- Magnetic field");
793  INFO_msg(10,HMessageMgr::DET_MDC," MagnetOff -- Magnetic field off");
794  INFO_msg(10,HMessageMgr::DET_MDC," CombinedClusters (default) -- Cluster search in");
795  INFO_msg(10,HMessageMgr::DET_MDC," combined chambers");
796  INFO_msg(10,HMessageMgr::DET_MDC," ChamberClusters -- Cluster search in");
797  INFO_msg(10,HMessageMgr::DET_MDC," individual chambers");
798  INFO_msg(10,HMessageMgr::DET_MDC," MixedClusters -- Cluster search in");
799  INFO_msg(10,HMessageMgr::DET_MDC," comb.+indiv. chambers");
800  SEPERATOR_msg("#",60);
801 }
803 {
804  // Returns a pointer to the HMdcDigitizer.
805  // If the pointer is 0 an error message will be displayed
806  // and the program will be exited.
807 
808  if(mdcdigi!=0)
809  {
810  return mdcdigi;
811  }
812  else
813  {
814  Error("HMdcTaskSet:getDigitzer():"
815  ,"\n POINTER TO MDCDIGITIZER IS ZERO! \n DON'T CALL THIS FUNCTION WHEN RUNNING WITH REAL DATA!");
816  exit(1);
817  }
818 }
820 {
821  // Returns a pointer to the HMdcCalibrater1.
822  // If the pointer is 0 an error message will be displayed
823  // and the program will be exited.
824 
825  if(calibrater1!=0)
826  {
827  return calibrater1;
828  }
829  else
830  {
831  Error("HMdcTaskSet:getCalibrater1():"
832  ,"\n POINTER TO MDCCALIBRATER1 IS ZERO! \n DON'T CALL THIS FUNCTION WHEN RUNNING WITH SIM DATA!");
833  exit(1);
834  }
835 }
837 {
838  // Returns a pointer to the HMdcDeDx2Maker.
839  // If the pointer is 0 an error message will be displayed
840  // and the program will be exited.
841 
842  if(dedx2maker!=0)
843  {
844  return dedx2maker;
845  }
846  else
847  {
848  Error("HMdcTaskSet:getDeDx2Maker():"
849  ,"\n POINTER TO MDCDEDX2MAKER IS ZERO! \n YOU NEED TO RUN IN FIT MODE!");
850  exit(1);
851  }
852 }
854 {
855  if(mdcsetuplocal!=0)
856  {
857  return mdcsetuplocal;
858  }
859  else
860  {
861  Error("HMdcTaskSet:getMdcSetup():"
862  ,"\n POINTER TO MDCSETUP IS ZERO!");
863  exit(1);
864  }
865 }
867 {
868  if(vertexfinder!=0)
869  {
870  return vertexfinder;
871  }
872  else
873  {
874  Error("HMdcTaskSet:getMdcVertexFinder():"
875  ,"\n POINTER TO MDCVERTEXFIND IS ZERO!");
876  exit(1);
877  }
878 }
880 {
881  // Prints the status of the configuration of
882  // HMdcTaskSet.
883 
884  printOptions();
885  SEPERATOR_msg("#",60);
886  INFO_msg(10,HMessageMgr::DET_MDC,"ACTUAL CONFIGURATION :");
889  if(mdcdigi) mdcdigi ->printStatus();
890  HMdcTrackDSet::printStatus();//pointer checked inside function
892  SEPERATOR_msg("#",60);
893 }
894 
895 
void setupMdcDigitizer(HMdcDigitizer *)
Definition: hmdcsetup.cc:461
void setDefaults()
Definition: hmdctaskset.cc:221
HMdcCommonSetup * getMdcCommonSet()
Definition: hmdcsetup.h:403
Int_t getAnalysisLevel()
Definition: hmdcsetup.h:365
static Bool_t isCreated
Definition: hmdctaskset.h:75
Int_t getEmbeddingMode()
Definition: hades.h:98
static HReconstructor * hMdcClusterToHit(const Char_t *name, const Char_t *title)
void printStatus()
Definition: hmdctaskset.cc:879
void setUseErrorDigi(Bool_t err)
Definition: hmdcsetup.h:44
static Int_t rtdbinput
Definition: hmdctaskset.h:76
void setOffsetsDigi(Float_t o0, Float_t o1, Float_t o2, Float_t o3)
Definition: hmdcsetup.h:60
static Int_t tracker
Definition: hmdctaskset.h:37
static Bool_t isCoilOff
Definition: hmdctaskset.h:38
void setNoiseRangeDigi(Int_t rLo0, Int_t rLo1, Int_t rLo2, Int_t rLo3, Int_t rHi0, Int_t rHi1, Int_t rHi2, Int_t rHi3)
Definition: hmdcsetup.h:74
HMdcSetup * getMdcSetup()
Definition: hmdctaskset.cc:853
void setNoiseOffDigi(Int_t noiseoff)
Definition: hmdcsetup.h:50
void copySetup()
Definition: hmdctaskset.cc:207
void setUseTofDigi(Bool_t tof)
Definition: hmdcsetup.h:43
void setIsUsed(Bool_t flag)
Definition: hmdctimecut.h:150
static HMdcCommonSetup * commonsetlocal
Definition: hmdctaskset.h:73
HTaskSet(void)
Definition: htaskset.cc:42
void setTracker(Int_t track)
Definition: hmdcsetup.h:357
void setTimeCutFlagCal1(Int_t cut)
Definition: hmdcsetup.h:172
HDataSource * getDataSource(void) const
Definition: hades.h:124
static Int_t nLayers[6][4]
Definition: hmdctaskset.h:40
void setMdcClusterToHitSet(Int_t mdcseg1, Int_t mdcseg2)
Definition: hmdcsetup.h:274
Bool_t fillParallel
Definition: hmdctaskset.h:64
Int_t getTracker()
Definition: hmdcsetup.h:366
HRuntimeDb * getRuntimeDb(void)
Definition: hades.h:111
void setCellEffDigi(Float_t e0, Float_t e1, Float_t e2, Float_t e3)
Definition: hmdcsetup.h:67
void setTdcModeDigi(Int_t mode)
Definition: hmdcsetup.h:41
void setTypeClustFinder(Int_t type)
Definition: hmdcsetup.h:207
HMdcClusterToHitSetup * getMdcClusterToHitSet()
Definition: hmdcsetup.h:401
static HMdc12FitSetup * fittersetlocal
Definition: hmdctaskset.h:72
static HReconstructor * hMdcTrackFinder(const Char_t *name, const Char_t *title)
void setMdcCalibrater1Set(Int_t flag, Int_t cut)
Definition: hmdcsetup.h:173
void setNoiseModeDigi(Int_t noise)
Definition: hmdcsetup.h:49
void setUseTimeCutsDigi(Bool_t stat)
Definition: hmdcsetup.h:47
HMdcCalibrater1Setup * getMdcCalibrater1Set()
Definition: hmdcsetup.h:399
static Int_t imagnet
Definition: hmdctaskset.h:30
ClassImp(HDbColumn) HDbColumn
Definition: hdbcolumn.cc:18
void setUseWireStatDigi(Bool_t stat)
Definition: hmdcsetup.h:46
static HReconstructor * hMdcIdealTracking(const Char_t *name, const Char_t *title, Bool_t fillParallel=kFALSE)
void setOffsetsOffDigi(Int_t offsetsoff)
Definition: hmdcsetup.h:51
void setupMdcCalibrater1(HMdcCalibrater1 *, Int_t merge=0)
Definition: hmdcsetup.cc:544
static Int_t mdcForSeg1
Definition: hmdctaskset.h:42
static Int_t ilevel
Definition: hmdctaskset.h:25
static HMdcSetup * mdcsetup
Definition: hmdctaskset.h:66
void setIsSimulation(Int_t sim)
Definition: hmdcsetup.h:355
static HReconstructor * hMdc12Fit(const Char_t *name, const Char_t *title)
void setModeFlagCal1(Int_t flag)
Definition: hmdcsetup.h:171
Bool_t idealTracking
0: no dedx, 1=dedx
Definition: hmdctaskset.h:63
Bool_t initContainers(Int_t runId, Int_t refId=-1, const Text_t *fileName="")
Definition: hruntimedb.cc:347
void setNoiseLevelDigi(Float_t l0, Float_t l1, Float_t l2, Float_t l3)
Definition: hmdcsetup.h:53
#define ERROR_msg(det, text)
Definition: hmessagemgr.h:36
static HMdcClusterToHitSetup * clustertohitsetlocal
Definition: hmdctaskset.h:71
void printParam(void)
Definition: hmdcsetup.cc:190
static HMdcDeDx2Maker * dedx2maker
Definition: hmdctaskset.h:60
static HMdcTrackFinderSetup * trackfindersetlocal
Definition: hmdctaskset.h:70
static Int_t irealorsimulation
Definition: hmdctaskset.h:26
static Int_t mdcForSeg2
Definition: hmdctaskset.h:46
void setMdc12FitSet(Int_t author, Int_t vers, Int_t indep, Bool_t tuple, Bool_t print)
Definition: hmdcsetup.h:314
~HMdcTaskSet(void)
Definition: hmdctaskset.cc:203
void setMdcCommonSet(Int_t sim, Int_t level, Int_t track)
Definition: hmdcsetup.h:358
HMdc12FitSetup * getMdc12FitSet()
Definition: hmdcsetup.h:402
Hades * gHades
Definition: hades.cc:1213
#define INFO_msg(level, det, text)
Definition: hmessagemgr.h:54
void error(Char_t level, Int_t det, const Char_t *className, const Char_t *text)
Definition: hmessagemgr.cc:425
HMdcDeDx2Maker * getDeDx2Maker()
Definition: hmdctaskset.cc:836
static Bool_t fitNTuple
Definition: hmdctaskset.h:52
void setNtupleDigi(Bool_t ntuple)
Definition: hmdcsetup.h:42
HParSet * getContainer(const Text_t *)
Definition: hruntimedb.cc:124
Int_t getIsSimulation()
Definition: hmdcsetup.h:364
void getSets()
Definition: hmdctaskset.cc:212
void setAnalysisLevel(Int_t level)
Definition: hmdcsetup.h:356
void setupMdcTrackFinder()
Definition: hmdcsetup.cc:671
void parseArguments(TString)
Definition: hmdctaskset.cc:443
void getSetupContainer()
Definition: hmdctaskset.cc:256
static Int_t nLevel[4]
Definition: hmdctaskset.h:41
static HMdcCalibrater1Setup * calibrater1setlocal
Definition: hmdctaskset.h:68
Bool_t add(HTask *)
Definition: htaskset.cc:82
void setStatic(Bool_t flag=kTRUE)
Definition: hparset.h:38
static Int_t fitAuthor
Definition: hmdctaskset.h:51
static HMdcVertexFind * vertexfinder
Definition: hmdctaskset.h:74
void setupMdc12Fit()
Definition: hmdcsetup.cc:838
void printOptions()
Definition: hmdctaskset.cc:764
Definition: htask.h:14
void setMdcTrackFinderSet(Bool_t field, Int_t type, Int_t *myLayers, Int_t *L)
Definition: hmdcsetup.h:224
HMdcCalibrater1 * getCalibrater1()
Definition: hmdctaskset.cc:819
#define SEPERATOR_msg(sep, num)
Definition: hmessagemgr.h:63
static Int_t itimecuts
Definition: hmdctaskset.h:28
void setCellEffOffDigi(Int_t effoff)
Definition: hmdcsetup.h:52
HTask * make(const Char_t *select="", const Option_t *option="")
Definition: hmdctaskset.cc:311
void printParam(void)
Definition: hmdcsetup.cc:902
static Int_t itracker
Definition: hmdctaskset.h:29
static Bool_t fitPrint
Definition: hmdctaskset.h:53
static Int_t isSimulation
Definition: hmdctaskset.h:56
static Int_t fitIndep
Definition: hmdctaskset.h:55
void setUseWireOffsetDigi(Bool_t off)
Definition: hmdcsetup.h:45
static Int_t fitVersion
Definition: hmdctaskset.h:54
HMdcTaskSet(void)
Definition: hmdctaskset.cc:198
static Int_t analysisLevel
Definition: hmdctaskset.h:33
HMdcVertexFind * getMdcVertexFinder()
Definition: hmdctaskset.cc:866
void setEmbeddingModeDigi(Int_t mode)
Definition: hmdcsetup.h:48
HMdcDigitizerSetup * getMdcDigitizerSet()
Definition: hmdcsetup.h:398
static Int_t typeClustFinder
Definition: hmdctaskset.h:39
static Int_t cal1TimeCutFlag
Definition: hmdctaskset.h:34
HMdcTrackFinderSetup * getMdcTrackFinderSet()
Definition: hmdcsetup.h:400
Int_t versionDeDx
Definition: hmdctaskset.h:61
static HMdcDigitizer * mdcdigi
Definition: hmdctaskset.h:58
static Int_t icalibrater
Definition: hmdctaskset.h:27
HMdcDigitizer * getDigitizer()
Definition: hmdctaskset.cc:802
Bool_t check()
Definition: hmdcsetup.cc:178
HMessageMgr * getMsg(void)
Definition: hades.h:113
static HMdcSetup * mdcsetuplocal
Definition: hmdctaskset.h:67
static HMdcCalibrater1 * calibrater1
Definition: hmdctaskset.h:59
static HMdcDigitizerSetup * digisetlocal
Definition: hmdctaskset.h:69
void setIsCoilOff(Bool_t field)
Definition: hmdcsetup.h:206
static void printStatus(void)
static Int_t cal1ModeFlag
Definition: hmdctaskset.h:35
static Int_t itrackermode
Definition: hmdctaskset.h:31