WARNING ... Somehow the calculation of "STEP" is not correct, when having data ordered patterns, it might go the wrong direction. Better use GetPatternNext(..,+1) to be sure to get the next pattern with increasing Z positions. To be checked: does it work also on Simulated ORFEO data? To be checked: does it work also on the testbeam data?
1217{
1218 Log(2,
"EdbShowAlg_OI::Execute()",
"DOING MAIN SHOWER RECONSTRUCTION HERE");
1219
1223
1224 Bool_t StillToLoop=kTRUE;
1225 Int_t ActualPID;
1226 Int_t newActualPID;
1227 Int_t STEP=-1;
1228 Int_t NLoopedPattern=0;
1229
1230 Int_t newZ_next_ascending_Z=0;
1231 Int_t newPID_next_ascending_Z=0;
1232
1233
1242
1243
1244 if (
gEDBDEBUGLEVEL>2) cout <<
"EdbShowAlg_OI::Execute--- STEP for patternloop direction = " << STEP << endl;
1245
1246
1247
1248 if (
gEDBDEBUGLEVEL>2) cout <<
"EdbShowAlg_OI::Execute Loop over InBTs:" << endl;
1249
1250
1251
1252
1253
1255
1256
1257 if (
gEDBDEBUGLEVEL==2)
if ((i%100)==0) cout <<
eInBTArrayN <<
" Initiator Basetracks (InBT) in total, still to do: " << Form(
"%06d",i) <<
"\r\r\r\r\r\r" << flush;
1258
1259
1260
1261
1262
1263
1264
1266
1267
1270 Float_t
X0=InBT->
X();
1271 Float_t Y0=InBT->
Y();
1272
1273
1274
1275
1276 RecoShower -> AddSegment(InBT);
1277 if (
gEDBDEBUGLEVEL>4) cout <<
"Segment (InBT) " << Segment <<
" was added to RecoShower." << endl;
1278
1279
1282
1283
1284
1285
1286
1287 ActualPID= InBT->
PID() ;
1288 newActualPID= InBT->
PID() ;
1289
1290 while (StillToLoop) {
1291 if (
gEDBDEBUGLEVEL>3) cout <<
"EdbShowAlg_OI::Execute--- --- Doing patterloop " << ActualPID <<
" for patterns Z position=" <<
eAli_Sub->
GetPattern(ActualPID)->
Z() << endl;
1292
1293 for (Int_t btloop_cnt=0; btloop_cnt<
eAli_Sub->
GetPattern(ActualPID)->GetN(); ++btloop_cnt) {
1294
1297
1298
1299 if ( Segment->
MCEvt() > 0 )
if ( Segment->
MCEvt()!=InBT->
MCEvt() )
continue;
1300 if ( Abs(Segment->
X()-
X0) > 7000 )
continue;
1301 if ( Abs(Segment->
Y()-Y0) > 7000 )
continue;
1302
1305
1306
1307
1308
1309
1310
1311
1312
1313 if ( Segment->
Compare(InBT) == 0) {
1314
1315
1316
1317
1318 ;
1319 }
1320 else {
1321 RecoShower -> AddSegment(Segment);
1322 }
1323 if (
gEDBDEBUGLEVEL>4) cout <<
"Segment " << Segment <<
" was added at &Segment : " << &Segment << endl;
1324
1325 }
1326
1327
1328 if (
gEDBDEBUGLEVEL>3) cout <<
"EdbShowAlg_OI::Execute--- --- ActualPID= " << ActualPID <<
" at Z= " <<
eAli_Sub->
GetPattern(ActualPID)->
Z() <<
" done. Reconstructed shower has up to now: " << RecoShower->
N() <<
" Segments." << endl;
1329
1330
1331
1334
1335
1336
1337
1338 if (
NULL == newPat_next_ascending_Z ) {
1340 cout << "newPat_next_ascending_Z is NULL pointer ! So it is nonexisting! (possibly last plate); " << endl;
1341 cout << "EdbShowAlg_OI::Execute--- ---Stop Loop since: newPat_next_ascending_Z is NULL pointer "<<endl;
1342 }
1343 StillToLoop=kFALSE;
1344 }
1345 else {
1346 newZ_next_ascending_Z = newPat_next_ascending_Z->
Z();
1347 newPID_next_ascending_Z = newPat_next_ascending_Z->
PID();
1348 }
1349
1350
1351
1352
1353
1354
1355
1357 newActualPID=newPID_next_ascending_Z;
1358 ++NLoopedPattern;
1359
1361 cout << "EdbShowAlg_OI::Execute--- --- newActualPID= " << newActualPID << endl;
1362 cout <<
"EdbShowAlg_OI::Execute--- --- newActualZ= " <<
eAli_Sub->
GetPattern(newActualPID)->
Z() << endl;
1363 cout << "EdbShowAlg_OI::Execute--- --- NLoopedPattern= " << NLoopedPattern << endl;
1364 cout <<
"EdbShowAlg_OI::Execute--- --- eNumberPlate_eAliPID= " <<
eNumberPlate_eAliPID << endl;
1365 cout << "EdbShowAlg_OI::Execute--- --- StillToLoop= " << StillToLoop << endl;
1366 cout <<
"EdbShowAlg_OI::Execute--- --- We have to decide, if to loop on for the next pattern... (out of the " <<
eAli_Sub->
Npatterns() <<
" patterns)." << endl;
1367 }
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384 if (newActualPID<0)
1385 { StillToLoop=kFALSE;
1386
1387 }
1389 StillToLoop=kFALSE;
1390
1391 }
1392
1393
1396
1397 ActualPID=newActualPID;
1398 }
1399
1400
1401
1402
1404
1405
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419 if (RecoShower->
N()>1) {
1421 }
1422 else {
1423
1424
1425 Log(3,
"EdbShowAlg_OI::Execute()",
"InBT # %d RecoShower->N()<=1: Dont add shower to RecoShowerArray. Delete this shower for memory safing.");
1426 delete RecoShower;
1428 }
1429
1430
1431
1432
1433 StillToLoop=kTRUE;
1434 NLoopedPattern=0;
1435 }
1436
1437
1438
1439
1440
1441
1443
1444
1445
1446
1447
1448 cout << "================================================================================="<<endl;
1450 cout << "================================================================================="<<endl;
1451
1455
1456 Log(2,
"EdbShowAlg_OI::Execute()",
"DOING MAIN SHOWER RECONSTRUCTION HERE...done.");
1457 return;
1458}
brick X0
Definition: RecDispMC.C:112
Definition: EdbPattern.h:273
int PID() const
Definition: EdbPattern.h:320
Int_t Npatterns() const
Definition: EdbPattern.h:366
void Print() const
Definition: EdbPattern.cxx:1693
EdbPattern * GetPattern(int id) const
Definition: EdbPattern.cxx:1721
EdbPattern * GetPatternNext(float z, int dir) const
Definition: EdbPattern.cxx:1857
Float_t X() const
Definition: EdbSegP.h:173
Int_t Compare(const TObject *obj) const
Definition: EdbSegP.cxx:420
Float_t Y() const
Definition: EdbSegP.h:174
void PrintNice() const
Definition: EdbSegP.cxx:392
Int_t PID() const
Definition: EdbSegP.h:148
Int_t MCEvt() const
Definition: EdbSegP.h:145
Float_t Z() const
Definition: EdbPattern.h:84
EdbSegP * GetSegment(int i) const
Definition: EdbPattern.h:66
Bool_t FindPrecedingBTs(EdbSegP *s, EdbSegP *InBT, EdbPVRec *gAli, EdbShowerP *shower)
Definition: EdbShowAlg.cxx:1479
void UpdateShowerIDs()
Definition: EdbShowAlg.cxx:479
void Transform_eAli(EdbSegP *InitiatorBT, Float_t ExtractSize)
Definition: EdbShowAlg.cxx:107
void AddRecoShowerArray(EdbShowerP *shower)
Definition: EdbShowAlg.h:120
Bool_t IsInConeTube(EdbSegP *sTest, EdbSegP *sStart, Double_t CylinderRadius, Double_t ConeAngle)
Definition: EdbShowAlg.cxx:248
TObjArray * eRecoShowerArray
Definition: EdbShowAlg.h:70
Int_t eFirstPlate_eAliPID
Definition: EdbShowAlg.h:65
Int_t eLastPlate_eAliPID
Definition: EdbShowAlg.h:66
Int_t eInBTArrayN
Definition: EdbShowAlg.h:63
TObjArray * eInBTArray
Definition: EdbShowAlg.h:62
Int_t eNumberPlate_eAliPID
Definition: EdbShowAlg.h:68
Int_t eRecoShowerArrayN
Definition: EdbShowAlg.h:71
EdbPVRec * eAli_Sub
Definition: EdbShowAlg.h:74
void UpdateShowerMetaData()
Definition: EdbShowAlg.cxx:492
Int_t eActualAlgParametersetNr
Definition: EdbShowAlg.h:54
Definition: EdbShowerP.h:28
Int_t N() const
Definition: EdbShowerP.h:412
void PrintNice()
Definition: EdbShowerP.cxx:2339
void PrintSegments()
Definition: EdbShowerP.cxx:2367
void PrintBasics()
Definition: EdbShowerP.cxx:2360
void Update()
Definition: EdbShowerP.cxx:975
gEDBDEBUGLEVEL
Definition: energy.C:7
#define NULL
Definition: nidaqmx.h:84