HYDRA_development_version
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hrich700taskset.cc
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // $Id: $
4 //
5 //*-- Author : Dan Magestro
6 //*-- Revised : Martin Jurkovic <martin.jurkovic@ph.tum.de> 2010
7 //
8 //_HADES_CLASS_DESCRIPTION
9 //////////////////////////////////////////////////////////////////////////////
10 //
11 // HRich700TaskSet
12 //
13 // This HTaskSet contains the task sets for the Rich detector.
14 // It can be distinguished between "real" and "simulation" task set by
15 // passing the corresponding string to the first argument of the make()
16 // function. Embedding is automatically recognized by return value of
17 // gHades->getEmbeddingMode(). For embedding ONLY the "real" task set
18 // has to be selected, otherwise the program will finish with an error.
19 //
20 // To control the operation of the RICH tasks, HRich700TaskSet has following
21 // switches with preset default values:
22 // - inoiseOn = kTRUE;
23 // - iSkipEvent = kFALSE;
24 //
25 // The simulation of noise in HRichDigitizer behaves in pure
26 // simulation differently as compared to the embedding modus.
27 // * pure simulation: simulation of both correlated and random noise is ON
28 // * embedding: only simulation of correlated noise is ON
29 //
30 // Default values can be changed by passing corresponding strings
31 // to the second argument of make() function. For more details,
32 // please read the documentation for this function below.
33 //
34 // BEGIN_HTML For more information, see
35 // <a target="_top" href="http://webdb.gsi.de/pls/hades_webdbs/hanal.hal_posting_query.show_posting_text?p_id=436">
36 // this analysis logbook entry<a>. END_HTML
37 //
38 //////////////////////////////////////////////////////////////////////////////
39 
40 
41 #include "TObjString.h"
42 
43 #include "hades.h"
44 #include "hrich700taskset.h"
45 #include "hrich700digitizer.h"
46 #include "hrich700calibrater.h"
48 
49 using namespace std;
50 
52 
53 
55  : HTaskSet()
56 {
57  // Default constructor
58  fNoRingFinder = kFALSE;
59  fNoCalibrater = kFALSE;
60 
61 }
62 
63 HRich700TaskSet::HRich700TaskSet(const Text_t name[], const Text_t title[])
64  : HTaskSet(name, title)
65 {
66  // Constructor
67  fNoRingFinder = kFALSE;
68  fNoCalibrater = kFALSE;
69 }
70 
72 {
73  // Destructor.
74 }
75 
76 
77 HTask*
78 HRich700TaskSet::make(const Char_t *select, const Option_t *option)
79 {
80 // Returns a pointer to the Rich task or taskset specified by 'select'.
81 // There are two possibilities to be passed:
82 // - "real" for real data analysis and embedding
83 // - "simulation" for simulation only
84 //
85 // Following options can be passed to the HRich700TaskSet to control the
86 // behavior of the RICH analysis and simulation:
87 // NORINGFINDER - HRich700RingFinderHough will be disabled
88 // NOCALIBRATER - HRich700calibrater will be disabled
89 //
90 
91  HTaskSet* tasks = new HTaskSet("Rich", "List of Rich tasks");
92  TString sel = select;
93  TString opt = option;
94 
95  parseArguments(opt);
96 
97  sel.ToLower();
98  if (0 == sel.CompareTo("simulation") &&
99  0 != gHades->getEmbeddingMode()) {
100  Error("make", "embeddingMode > 0 in simulation NOT ALLOWED!");
101  return NULL;
102  }
103 
104  if (0 == sel.CompareTo("real")) // real + embedding
105  {
106  if(!fNoCalibrater){
107  tasks->add(new HRich700Calibrater("rich.calibrater", "Rich Calibrater"));
108  }
109  if( 0 != gHades->getEmbeddingMode()){ // embedding
110  tasks->add(new HRich700Digitizer("rich.digi", "Rich digitizer"));
111  }
112  }
113 
114  if (0 == sel.CompareTo("simulation"))
115  {
116  tasks->add(new HRich700Digitizer("rich.digi", "Rich digitizer"));
117  }
118 
119  if(!fNoRingFinder)// hit finder is the same in all cases
120  {
121  tasks->add(new HRich700RingFinderHough("rich.ringfinder", "Rich ring finder"));
122  }
123 
124  return tasks;
125 }
126 
128 {
129 
130  s1.ToLower();
131  s1.ReplaceAll(" ", "");
132 
133 
134  if (0 != s1.Length()) {
135 
136  // iterate over the list of arguments and compare it
137  // to the known key words.
138 
139  TObjArray* myarguments = s1.Tokenize(",");
140  TIterator* myiter = NULL;
141  TObjString* stemp = NULL;
142  TString argument;
143 
144  myiter = myarguments->MakeIterator();
145  myiter->Reset();
146  while (0 != (stemp = static_cast<TObjString*>(myiter->Next()))) {
147  argument = stemp->GetString();
148  Info("parseArguments()","option: %s", argument.Data() );
149  if (0 == argument.CompareTo("noringfinder")) {
150  fNoRingFinder = kTRUE;
151  }
152  else if (0 == argument.CompareTo("nocalibrater")) {
153  fNoCalibrater = kTRUE;
154  } else {
155  Error("parseArguments","Unknown Option %s found!",argument.Data());
156  }
157  }
158  delete myiter;
159  myiter = NULL;
160 
161  myarguments->Delete();
162  delete myarguments;
163 
164  }
165 }
Int_t getEmbeddingMode()
Definition: hades.h:98
HTaskSet(void)
Definition: htaskset.cc:42
ClassImp(HRich700TaskSet) HRich700TaskSet
Hades * gHades
Definition: hades.cc:1213
HTask * make(const Char_t *select="", const Option_t *option="")
Bool_t add(HTask *)
Definition: htaskset.cc:82
Definition: htask.h:14
void parseArguments(TString s1)