FEDRA emulsion software from the OPERA Collaboration
ShowRecHelper.cpp File Reference
This graph shows which files directly or indirectly include this file:

Functions

void CheckInputParameters ()
 
void CheckInputParametersNEW ()
 
void InitCutParameters ()
 
void PrintHelp ()
 
void PrintPresetList ()
 
void PrintShowerObjectArray (TObjArray *segarray)
 
void PrintValues_CommandLine ()
 
void RewriteSegmentPIDs (EdbPVRec *gAli)
 
void RewriteSegmentPIDs_BGPID_To_SGPID (EdbPVRec *gAli)
 
void RewriteSegmentPIDs_SGPID_To_BGPID (EdbPVRec *gAli)
 

Function Documentation

◆ CheckInputParameters()

void CheckInputParameters ( )
88{
89 if (cmd_BTPA>4 ) {
90 cout << "CheckInputParameters: cmd_BTPA>4 not supported. Here it has no effect but please check your nput!"<<endl;
91 cout << "CheckInputParameters: WHAT TO DO HERE ???"<<endl;
92 }
93 if (cmd_BGTP>43) {
94 cout << "CheckInputParameters: cmd_BGTP>43 not supported. Here it has no effect but pleas check your input!"<<endl;
95 cout << "CheckInputParameters: WHAT TO DO HERE ???"<<endl;
96 }
97 if (cmd_ALTP>8) {
98 cout << "CheckInputParameters:WARNING : cmd_ALTP>8 " << endl;
99// cout << "CheckInputParameters: cmd_ALTP>8 not supported. Please check your input!"<<endl;
100// cout << "CheckInputParameters: WHAT TO DO HERE ???"<<endl;
101 }
102
103 if (cmd_FP<1) {
104 cout << "CheckInputParameters: cmd_FP<1. Set cmd_FP=1;"<<endl;
105 cmd_FP=1;
106 }
107 if (cmd_LP>57) {
108 cout << "CheckInputParameters: cmd_LP>57. Set cmd_LP=57;"<<endl;
109 cmd_LP=57;
110 }
111 if (cmd_MP<cmd_FP) {
112 cout << "CheckInputParameters: cmd_MP<cmd_FP. Set cmd_MP=cmd_FP;"<<endl;
114 cout << "CheckInputParameters: New value: cmd_MP = "<< cmd_MP << endl;
115 }
116 if (cmd_FP>cmd_LP) {
117 cout << "CheckInputParameters: cmd_FP>cmd_LP. Set cmd_FP=1;"<<endl;
118 cmd_FP=1;
119 cout << "CheckInputParameters: New value: cmd_FP = "<< cmd_FP << endl;
120 }
121 if (cmd_MP>cmd_LP) {
122 cout << "CheckInputParameters: cmd_MP>cmd_LP. Set cmd_MP=cmd_LP;"<<endl;
124 cout << "CheckInputParameters: New value: cmd_MP = "<< cmd_MP << endl;
125 }
126
127 if (cmd_MCFL<0) {
128 cout << "CheckInputParameters: cmd_MCFL<0. Absolute Number will be taken;"<<endl;
129 }
130
131 if (cmd_gEDBDEBUGLEVEL>5) {
132 cout << "CheckInputParameters: cmd_gEDBDEBUGLEVEL>5 not supported. Here it has no effect but pleas check your input!"<<endl;
133 }
134 return;
135}
Int_t cmd_BTPA
Definition: ShowRec.h:9
Int_t cmd_ALTP
Definition: ShowRec.h:11
Int_t cmd_BGTP
Definition: ShowRec.h:10
Int_t cmd_gEDBDEBUGLEVEL
Definition: ShowRec.h:32
Int_t cmd_FP
Definition: ShowRec.h:15
Int_t cmd_MCFL
Definition: ShowRec.h:21
Int_t cmd_MP
Definition: ShowRec.h:17
Int_t cmd_LP
Definition: ShowRec.h:16

◆ CheckInputParametersNEW()

void CheckInputParametersNEW ( )
139{
140 Log(2, "ShowRec.cpp", "--- void CheckInputParametersNEW() ---");
141 Log(2, "ShowRec.cpp", "--- Assuming data object has been now read in ---");
142
143 cout << "GLOBAL_gAli at memory " << GLOBAL_gAli << endl;
144 cout << "GLOBAL_gAli->Npatterns() " << GLOBAL_gAli->Npatterns() << endl;
145
146 Int_t NPatterns = GLOBAL_gAli->Npatterns();
147
148 if (cmd_FP<1) {
149 cout << "CheckInputParameters: cmd_FP<1. Set cmd_FP=1;"<<endl;
150 cmd_FP=1;
151 }
152 if (cmd_LP>NPatterns) {
153 cout << "CheckInputParameters: cmd_LP>NPatterns. Set cmd_LP to "<< NPatterns << endl;
154 cmd_LP=NPatterns;
155 }
156 if (cmd_MP<cmd_FP) {
157 cout << "CheckInputParameters: cmd_MP<cmd_FP. Set cmd_MP=cmd_FP;"<<endl;
159 cout << "CheckInputParameters: New value: cmd_MP = "<< cmd_MP << endl;
160 }
161 if (cmd_FP>cmd_LP) {
162 cout << "CheckInputParameters: cmd_FP>cmd_LP. Set cmd_FP=1;"<<endl;
163 cmd_FP=1;
164 cout << "CheckInputParameters: New value: cmd_FP = "<< cmd_FP << endl;
165 }
166 if (cmd_MP>cmd_LP) {
167 cout << "CheckInputParameters: cmd_MP>cmd_LP. Set cmd_MP=cmd_LP;"<<endl;
169 cout << "CheckInputParameters: New value: cmd_MP = "<< cmd_MP << endl;
170 }
171
172 if (cmd_NP>NPatterns) {
173 cout << "CheckInputParameters: cmd_NP>NPatterns. Set cmd_NP to "<< NPatterns << endl;
174 cmd_NP=NPatterns;
175 }
176
177 return;
178}
bool Log(int level, const char *location, const char *fmt,...)
Definition: EdbLog.cxx:75
EdbPVRec * GLOBAL_gAli
Definition: ShowRec.h:73
Int_t cmd_NP
Definition: ShowRec.h:18
Int_t Npatterns() const
Definition: EdbPattern.h:366

◆ InitCutParameters()

void InitCutParameters ( )
184{
185 Log(2, "ShowRec.cpp", "--- void InitCutParameters() ---");
186 // Following the convention:
187 // -FP -LP -MP -NP
188 // -PADI -BTPA -BGTP -ALTP
189 // -LT -MC
190 STREAM_ShowRecEff << setw(10) << "#PADI";
191 STREAM_ShowRecEff << setw(10) << "BTPA";
192 STREAM_ShowRecEff << setw(10) << "BGTP";
193 STREAM_ShowRecEff << setw(10) << "ALTP";
194 STREAM_ShowRecEff << setw(10) << "FP";
195 STREAM_ShowRecEff << setw(10) << "MP";
196 STREAM_ShowRecEff << setw(10) << "LP";
197 STREAM_ShowRecEff << setw(10) << "NP";
198
199 STREAM_ShowRecEff << setw(10) << "LT";
200 STREAM_ShowRecEff << setw(10) << "MC";
201
202 STREAM_ShowRecEff << setw(14) << "PARASETNR";
203 STREAM_ShowRecEff << setw(14) << "INBTSHOWERNR";
204
205 STREAM_ShowRecEff << setw(10) << "EvtBT_E";
206 STREAM_ShowRecEff << setw(14) << "EvtBT_TT";
207 STREAM_ShowRecEff << setw(14) << "EvtBT_Flag";
208 STREAM_ShowRecEff << setw(10) << "EvtBT_MC";
209
210 STREAM_ShowRecEff << setw(10) << "InBT_E";
211 STREAM_ShowRecEff << setw(14) << "InBT_TT";
212 STREAM_ShowRecEff << setw(14) << "InBT_Flag";
213 STREAM_ShowRecEff << setw(10) << "InBT_MC";
214
215 STREAM_ShowRecEff << setw(10) << "NBT";
216 STREAM_ShowRecEff << setw(10) << "NBTallMC";
217 STREAM_ShowRecEff << setw(10) << "NBTeMC";
218 STREAM_ShowRecEff << setw(10) << "purall";
219 STREAM_ShowRecEff << setw(10) << "pure";
220
221 STREAM_ShowRecEff << setw(10) << "effall";
222 STREAM_ShowRecEff << setw(10) << "effe";
223 STREAM_ShowRecEff << setw(10) << "trckdens";
224 STREAM_ShowRecEff << endl;
225 return;
226}
ofstream STREAM_ShowRecEff
Definition: ShowRec.h:59

◆ PrintHelp()

void PrintHelp ( )
3 {
4 Log(2, "ShowRec.cpp", "--- PrintHelp() ---");
5 Log(2, "ShowRec.cpp", "--- PrintHelp()...done. ---");
6 return;
7}

◆ PrintPresetList()

void PrintPresetList ( )
11 {
12 cout << "void PrintPresetList() " << endl;
13 cout << " -PRESET0 " << endl;
14 cout << " -PRESET1 " << endl;
15 cout << " -PRESET2 " << endl;
16 return;
17}

◆ PrintShowerObjectArray()

void PrintShowerObjectArray ( TObjArray *  segarray)
66{
67 Log(3, "ShowRec.cpp", "--- Bool_t PrintShowerObjectArray() ---");
68
69 if (gEDBDEBUGLEVEL>2) cout << "--- -----------------------------------------"<<endl;
70 Int_t nent=segarray->GetEntries();
71 if (gEDBDEBUGLEVEL>2) cout << "--- segarray->GetEntries: " << nent << endl;
72 EdbSegP* s;
73 if (gEDBDEBUGLEVEL>2) printf("Entry X Y Z TX TY W Chi2 MCEvt PID P Flag\n");
74 for (int i=0; i<nent; i++) {
75 s=(EdbSegP*)segarray->At(i);
76 if (gEDBDEBUGLEVEL>2) printf("%8d %14.3f %14.3f %14.3f %7.4f %7.4f %7.4f %7.4f %8d %8d %6.2f %6d\n", i, s->X(), s->Y(), s->Z(), s->TX(), s->TY(),s->W(),s->Chi2(),s->MCEvt(), s->PID(), s->P(), s->Flag());
77 }
78 if (gEDBDEBUGLEVEL>2) cout << "--- -----------------------------------------"<<endl;
79 Log(3, "ShowRec.cpp", "--- Bool_t PrintShowerObjectArray() done.");
80 return;
81}
Definition: EdbSegP.h:21
s
Definition: check_shower.C:55
gEDBDEBUGLEVEL
Definition: energy.C:7

◆ PrintValues_CommandLine()

void PrintValues_CommandLine ( )
21 {
22
23 Log(2, "ShowRec.cpp", "--- void PrintValues_CommandLine() ---");
24
25 cout << "-----------------------------------------------"<<endl;
26 cout << "--- " << setw(10) << "SWITCH" << setw(10) << "VALUE" << setw(40) << "DESCRIPTION" << endl;
27
28 cout << "--- " << setw(10) << " -FP" << setw(10) << cmd_FP << setw(40) << "FirstPlate" << endl;
29 cout << "--- " << setw(10) << " -LP" << setw(10) << cmd_LP << setw(40) << "LastPlate" << endl;
30 cout << "--- " << setw(10) << " -MP" << setw(10) << cmd_MP << setw(40) << "MiddlePlate" << endl;
31 cout << "--- " << setw(10) << " -NP" << setw(10) << cmd_NP << setw(40) << "NumberofPlates" << endl;
32
33 cout << "--- " << setw(10) << " -LT" << setw(10) << cmd_LT << setw(40) << "use LinkedTracks.root" << endl;
34 cout << "--- " << setw(10) << " -MC" << setw(10) << cmd_MC << setw(40) << "use only MC Events for InBT" << endl;
35 cout << "--- " << setw(10) << " -MCFL" << setw(10) << cmd_MCFL << setw(40) << "use only MC Flag" << endl;
36 cout << "--- " << setw(10) << " -HPLZ" << setw(10) << cmd_HPLZ << setw(40) << "use highest P() or lowest Z() MC-InBTs" << endl;
37 cout << "--- " << setw(10) << " -ALI" << setw(10) << cmd_ALI << setw(40) << "source of patterns volume" << endl;
38
39 cout << "--- " << setw(10) << " -MCMIX" << setw(10) << cmd_MCMIX << setw(40) << "use MCMIX DANGEROUS !!! Be Careful !!!" << endl;
40 cout << "--- " << setw(10) << " -EXTHETA" << setw(10) << cmd_EXTHETA << setw(40) << "Extract Subpattern with " << endl;
41 cout << "--- " << setw(10) << " " << setw(10) << cmd_EXTHETA << setw(40) << "Delta Theta Cut on Initiator BT angle " << endl;
42 cout << "--- " << setw(10) << " -VTX" << setw(10) << cmd_vtx << setw(40) << "For InBT: Cut to IP for MC vertex " << endl;
43 cout << "--- " << setw(10) << " -PADI" << setw(10) << cmd_PADI << setw(40) << "ParentDirectory" << endl;
44 cout << "--- " << setw(10) << " -BTPA" << setw(10) << cmd_BTPA << setw(40) << "BasetrackParametrisation" << endl;
45 cout << "--- " << setw(10) << " -BGTP" << setw(10) << cmd_BGTP << setw(40) << "BackgroundType" << endl;
46 cout << "--- " << setw(10) << " -ALTP" << setw(10) << cmd_ALTP << setw(40) << "AlgorithmType" << endl;
47 cout << "--- " << setw(10) << " -PASTART" << setw(10) << cmd_PASTART << setw(40) << "ParametersetStart" << endl;
48 cout << "--- " << setw(10) << " -PAEND" << setw(10) << cmd_PAEND << setw(40) << "ParameterSetEnd" << endl;
49 cout << "--- " << setw(10) << " -CUTTP" << setw(10) << cmd_CUTTP << setw(40) << "Algo Cuttype" << endl;
50 cout << "--- " << setw(10) << " -CLEAN" << setw(10) << cmd_CLEAN << setw(40) << "InputData BG Cleaning" << endl;
51
52 cout << "--- " << setw(10) << " -FILETP" << setw(10) << cmd_FILETP << setw(40) << "FILE Type tag" << endl;
53 cout << "--- " << setw(10) << " -GBMC" << setw(10) << cmd_GBMC << setw(40) << "Global MC Evt type tag " << endl;
54 cout << "--- " << setw(10) << " -DEBUG" << setw(10) << cmd_gEDBDEBUGLEVEL << setw(40) << "DEBUGLEVEL" << endl;
55 cout << "--- " << setw(10) << " -OUT" << setw(10) << cmd_OUTPUTLEVEL << setw(40) << "OUTPUTLEVEL" << endl;
56 cout << "--- " << setw(10) << " -STOP" << setw(10) << cmd_STOPLEVEL << setw(40) << "STOPLEVEL" << endl;
57
58
59 cout << "-----------------------------------------------"<<endl<<endl;
60 return;
61}
Int_t cmd_PADI
Definition: ShowRec.h:8
Int_t cmd_OUTPUTLEVEL
Definition: ShowRec.h:33
Int_t cmd_CLEAN
Definition: ShowRec.h:26
Int_t cmd_PAEND
Definition: ShowRec.h:13
Int_t cmd_PASTART
Definition: ShowRec.h:12
Int_t cmd_vtx
Definition: ShowRec.h:25
Int_t cmd_LT
Definition: ShowRec.h:19
Int_t cmd_CUTTP
Definition: ShowRec.h:14
Int_t cmd_FILETP
Definition: ShowRec.h:27
Int_t cmd_MCMIX
Definition: ShowRec.h:24
Int_t cmd_ALI
Definition: ShowRec.h:23
Int_t cmd_STOPLEVEL
Definition: ShowRec.h:34
Int_t cmd_EXTHETA
Definition: ShowRec.h:29
Int_t cmd_MC
Definition: ShowRec.h:20
Int_t cmd_GBMC
Definition: ShowRec.h:28
Int_t cmd_HPLZ
Definition: ShowRec.h:26

◆ RewriteSegmentPIDs()

void RewriteSegmentPIDs ( EdbPVRec gAli)
384{
385 Log(3, "ShowRec.cpp", "--- void RewriteSegmentPIDs() ---");
386
387 // This becomes necessary since when you have simaulation by ORFEO
388 // and real measured tackground, they may have different PID() and the function
389 // TransformEdbPVRec() will eventually not wor anymore since it relies on PIDs of
390 // the Initiator BaseTracks, so if you start from BG Basetracks, this may crash:
391 Bool_t eSGPID_To_BGPID=kFALSE;
392 Bool_t eBGPID_To_SGPID=kTRUE;
393
394 if (eSGPID_To_BGPID) RewriteSegmentPIDs_SGPID_To_BGPID(gAli);
395 if (eBGPID_To_SGPID) RewriteSegmentPIDs_BGPID_To_SGPID(gAli);
396 return;
397}
void RewriteSegmentPIDs_SGPID_To_BGPID(EdbPVRec *gAli)
Definition: ShowRecHelper.cpp:232
void RewriteSegmentPIDs_BGPID_To_SGPID(EdbPVRec *gAli)
Definition: ShowRecHelper.cpp:242
EdbPVRec * gAli
Definition: check_vertex.C:14

◆ RewriteSegmentPIDs_BGPID_To_SGPID()

void RewriteSegmentPIDs_BGPID_To_SGPID ( EdbPVRec gAli)

NEED TO WRITE BG PID TO GALI PIDS IF THERE ARE NO SG BT THERE !!! STILL IN EXPERIMENTAL PHASE !!!

243{
246
247 // This function is inteded if you have mixture of Simulation and Data, some
248 // of the values are not equally filled, and here the affected PID are made
249 // same.
250
251 // If during the read in procedure (via lnk.lst lnk.def the segments are automatically
252 // assigned new values, then this is not necessary!
253
254 /*
255 EdbPatternsVolume with 11 patterns
256 id= 0 pid= 0 x:y:z = 0.000 0.000 13000.025 n= 1001
257 id= 1 pid= 1 x:y:z = 0.000 0.000 11700.037 n= 994
258 id= 2 pid= 2 x:y:z = 0.000 0.000 10399.992 n= 983
259 id= 3 pid= 3 x:y:z = 0.000 0.000 9100.037 n= 1039
260 id= 4 pid= 4 x:y:z = 0.000 0.000 7800.044 n= 532
261 id= 5 pid= 5 x:y:z = 0.000 0.000 6500.041 n= 964
262 id= 6 pid= 6 x:y:z = 0.000 0.000 5200.023 n= 904
263 id= 7 pid= 7 x:y:z = 0.000 0.000 3900.070 n= 823
264 id= 8 pid= 8 x:y:z = 0.000 0.000 2600.014 n= 782
265 id= 9 pid= 9 x:y:z = 0.000 0.000 1300.052 n= 783
266 id= 10 pid= 10 x:y:z = 0.000 0.000 0.000 n= 681
267
268 There should be PID(firstplate) always 1
269 There should be PID(lastplate) always npatters-1
270
271 There is a difference between the pid of the EdbPatternsVolume and the PID() of
272 the segment couples,
273 but at the point where the EdbPatternsVolume is read in, the information on the
274 PID() of s.ePID is overwritten.
275 Example: Basetracks of 01.cp.root have s.ePID==1 for Sim Basetracks
276 after reading in, here they have pid= 10
277
278 For our simulated data this has alrady written in at reconstruction level:
279 segments of 01_001.cp.root have PID()==1 (z==0)
280 segments of 56_001.cp.root have PID()==56 (Z==71200)
281 segments of 57_001.cp.root have PID()==57 (Z==72500) [but pl 57 not existing in simulation]
282 But for data from BG scannings this is arbitrarily (mostly zero)
283 So we set this automatically here:
284 */
285
286
287 // return;
288 Log(2, "ShowRec.cpp", "--- void RewriteSegmentPIDs_BGPID_To_SGPID() --- returning, because no good implementation for this function yet........");
289 return;
290
291 Int_t npat = gAli->Npatterns();
292 Int_t nseg =0;
293 Int_t nominal_PID_SG=1234567890;
294 Int_t nominal_PID_gALI=1234567890;
295
296 EdbSegP* testseg=0;
297
298 cout << "==============DEBUG====================="<<endl;
299
300 gAli->GetPattern(0)->GetSegment(0)->Print();
301
303
304
305 // return;
306
307 gAli->Print();
308
309
310 // for (Int_t i=0; i<npat; ++i){
311 for (Int_t i=0; i<npat; ++i) {
312 nseg=gAli->GetPattern(i)->N();
313
314
315 cout << "gAli->GetPattern(i)->PID= " << gAli->GetPattern(i)->PID() << endl;
316 nominal_PID_gALI=gAli->GetPattern(i)->PID();
317
318 cout << "this is for MCEV>0" << endl;
319
320 for (Int_t ii=0; ii<nseg; ++ii) {
321 testseg=(EdbSegP*)gAli->GetPattern(i)->GetSegment(ii);
322 if (testseg->MCEvt()<0) continue;
323 cout << "PID of (MC) testseg = " << testseg->PID()<< endl;
324 // testseg->Print();
325 break;
326 }
327
328 cout << "this is for MCEV<0" << endl;
329
330 for (Int_t ii=0; ii<nseg; ++ii) {
331 testseg=(EdbSegP*)gAli->GetPattern(i)->GetSegment(ii);
332 if (testseg->MCEvt()>0) continue;
333 cout << "PID of (MC) testseg = " << testseg->PID()<< endl;
334 // testseg->Print();
335 break;
336 }
337
338 /*
340 // for (Int_t ii=0; ii<nseg; ++ii){
341 Bool_t found_SG_BT=kFALSE;
342 Int_t ii=0;
343 while (found_SG_BT==kFALSE) {
344 testseg=(EdbSegP*)gAli->GetPattern(i)->GetSegment(ii);
345 if (testseg->MCEvt()<0) continue;
346 cout << "PID of (MC) testseg = " << testseg->PID()<< endl;
347 testseg->Print();
348 ++ii;
349 found_SG_BT=kTRUE;
350 }
351
352 Bool_t found_BG_BT=kFALSE;
353 ii=0;
354 while (found_BG_BT==kFALSE) {
355 testseg=(EdbSegP*)gAli->GetPattern(i)->GetSegment(ii);
356 if (testseg->MCEvt()>0) continue;
357 cout << "PID of (MC) testseg = " << testseg->PID()<< endl;
358 testseg->Print();
359 ++ii;
360 found_BG_BT=kTRUE;
361 }
362 */
363
364
365 /*
366 nominal_PID_SG=i+1; /// THIS DEPENDS STRONGLY ON THE STRUCTURE OF gALI OBJECT !!!!
367 cout << "void RewriteSegmentPIDs_BGPID_To_SGPID() nominal_PID_SG = " << nominal_PID_SG << " set CHECK CAREFULLY. EXPERIMENTAL HELP FUNCTION PHASE!!" << endl;
368 cout << "gAli->GetPattern(i)->PID() " << gAli->GetPattern(i)->PID() << " " << nominal_PID_SG << endl;
369 cout << "gAli->GetPattern(i)->Z() " << gAli->GetPattern(i)->Z() << " " << nominal_PID_SG << endl;
370 for (Int_t ii=0; ii<nseg; ++ii){
371 if (gAli->GetPattern(i)->GetSegment(ii)->MCEvt()<0) gAli->GetPattern(i)->GetSegment(ii)->SetPID(i+1);
372 // gAli->GetPattern(i)->GetSegment(ii)->Print();
373 }
374
375 */
376 }
377 return;
378}
Int_t npat
Definition: Xi2HatStartScript.C:33
int PID() const
Definition: EdbPattern.h:320
void Print() const
Definition: EdbPattern.cxx:1693
EdbPattern * GetPattern(int id) const
Definition: EdbPattern.cxx:1721
void Print(Option_t *opt="") const
Definition: EdbSegP.cxx:379
Int_t PID() const
Definition: EdbSegP.h:148
Int_t MCEvt() const
Definition: EdbSegP.h:145
Int_t N() const
Definition: EdbPattern.h:86
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66

◆ RewriteSegmentPIDs_SGPID_To_BGPID()

void RewriteSegmentPIDs_SGPID_To_BGPID ( EdbPVRec gAli)
233{
234 Log(3, "ShowRec.cpp", "--- void RewriteSegmentPIDs_SGPID_To_BGPID() ---");
235 return;
236}