15 #include "FairLogger.h"
19 #include "TClonesArray.h"
20 #include "TDatabasePDG.h"
22 #include "TGeoBoolNode.h"
23 #include "TGeoCompositeShape.h"
24 #include "TGeoManager.h"
30 #include <mach/mach_time.h>
32 #define CLOCK_REALTIME 0
33 #define CLOCK_MONOTONIC 0
34 inline int clock_gettime(
int clk_id,
struct timespec* t) {
35 mach_timebase_info_data_t timebase;
36 mach_timebase_info(&timebase);
38 time = mach_absolute_time();
40 ((double) time * (
double) timebase.numer) / ((
double) timebase.denom);
42 ((double) time * (
double) timebase.numer) / ((
double) timebase.denom * 1e9);
44 t->tv_nsec = nseconds;
64 static map<Int_t, DebugTrack2> debugTracks2;
65 static int nofOverXR = 0;
66 static int nofOverYR = 0;
67 static int nofOverTR = 0;
69 static int nofOverXL = 0;
70 static int nofOverYL = 0;
71 static int nofOverTL = 0;
73 static int nofFoundR = 0;
74 static int nofNotFoundR = 0;
76 vector<vector<LxTBMLFinder::TrackDataHolder>>*
gMCTracks = 0;
98 : fStationNumber(stationNumber)
109 , fHandleMPoint(*this)
110 , fHandleRPoint(*this)
111 , fHandleLPoint(*this) {
113 new (&fLayers[
i])
LxTbLayer(nofxb, nofyb, noftb);
125 fHandleMPoint.Init();
126 fHandleRPoint.Init();
127 fHandleLPoint.Init();
137 fLayers[
i].SetMinT(
v);
147 : station(parent), c(0), deltaZr(0), scatXRL(0) {}
162 scaltype trajLenR =
sqrt(1 + txR * txR + tyR * tyR) * deltaZr;
163 timetype pTr = point.
t + 1.e9 * trajLenR / c;
168 list<LxTbBinnedPoint*>
points;
186 bool isSignal =
false;
189 for (list<LxTbBinnedPoint::PointDesc>::const_iterator
i =
194 const vector<vector<LxTBMLFinder::TrackDataHolder>>&
mcTracks =
199 for (list<LxTbBinnedPoint*>::iterator j =
208 for (list<LxTbBinnedPoint*>::iterator k = debug.points.begin();
209 k != debug.points.end();
213 if (a == b) found =
true;
227 cout <<
"Debug2: Point: (" << point.
x <<
", " << point.
y <<
", "
228 << point.
t <<
")" << endl;
263 : station(parent), c(0), deltaZl(0), scatXLL(0), mPoint(0) {}
276 scaltype pXl = mPoint->
x + txL * deltaZl;
277 scaltype pYl = mPoint->
y + tyL * deltaZl;
278 scaltype trajLenL =
sqrt(1 + txL * txL + tyL * tyL) * deltaZl;
308 , deltaZ(parent.fLayers[2].z - parent.fLayers[0].z)
317 mPoint->
triplets.push_back(triplet);
323 void Reconstruct() { IterateLayer<HandleMPoint>(fLayers[1], fHandleMPoint); }
327 FindGeoChild(TGeoNode* node,
const char* name, list<TGeoNode*>& results) {
328 Int_t nofChildren = node->GetNdaughters();
330 for (Int_t
i = 0;
i < nofChildren; ++
i) {
331 TGeoNode* child = node->GetDaughter(
i);
332 TString childName(child->GetName());
334 if (childName.Contains(name, TString::kIgnoreCase))
335 results.push_back(child);
356 , fHandleLastPoint(*this) {
364 gMuonMass = TDatabasePDG::Instance()->GetParticle(13)->Mass();
365 gElectronMass = TDatabasePDG::Instance()->GetParticle(11)->Mass();
395 station.
qs[0] = {q0XSq * L * L / 3, q0XSq * L / 2, q0XSq * L / 2, q0XSq};
396 station.
qs[1] = {q0YSq * L * L / 3, q0YSq * L / 2, q0YSq * L / 2, q0YSq};
404 Ls[
i] = fStations[
i].fAbsorber.zCoord - Ls[
i - 1];
415 for (
int i = 1;
i <= n; ++
i) {
418 for (
int j = 0; j <
i; ++j)
439 fHandleRPoint.Init();
446 fStations[
i].Clear();
451 fStations[
i].SetMinT(
v);
455 Double_t localCoords[3] = {0., 0., 0.};
456 Double_t globalCoords[3];
457 TGeoNavigator* pNavigator = gGeoManager->GetCurrentNavigator();
458 gGeoManager->cd(
"/cave_1");
459 list<TGeoNode*> detectors;
460 FindGeoChild(gGeoManager->GetCurrentNode(),
"much", detectors);
462 for (list<TGeoNode*>::iterator
i = detectors.begin();
i != detectors.end();
464 TGeoNode* detector = *
i;
465 pNavigator->CdDown(detector);
466 list<TGeoNode*> stations;
468 int stationNumber = 0;
470 for (list<TGeoNode*>::iterator j = stations.begin(); j != stations.end();
472 TGeoNode* station = *j;
473 pNavigator->CdDown(station);
474 list<TGeoNode*> layers;
478 for (list<TGeoNode*>::iterator k = layers.begin(); k != layers.end();
480 TGeoNode* layer = *k;
481 pNavigator->CdDown(layer);
482 gGeoManager->LocalToMaster(localCoords, globalCoords);
484 fStations[stationNumber].
fLayers[layerNumber].
z = globalCoords[2];
485 fStations[stationNumber].
fLayers[layerNumber].
minX = 0;
486 fStations[stationNumber].
fLayers[layerNumber].
maxX = 0;
488 fStations[stationNumber].
fLayers[layerNumber].
minY = 0;
489 fStations[stationNumber].
fLayers[layerNumber].
maxY = 0;
492 list<TGeoNode*> actives;
495 for (list<TGeoNode*>::iterator l = actives.begin();
498 TGeoNode* active = *l;
499 pNavigator->CdDown(active);
500 TGeoCompositeShape* cs =
dynamic_cast<TGeoCompositeShape*
>(
501 active->GetVolume()->GetShape());
502 TGeoBoolNode* bn = cs->GetBoolNode();
503 TGeoTrap* trap =
dynamic_cast<TGeoTrap*
>(bn->GetLeftShape());
506 Double_t* xy = trap->GetVertices();
508 for (
int m = 0;
m < 4; ++
m) {
509 Double_t localActiveCoords[3] = {xy[2 *
m], xy[2 *
m + 1], 0.};
510 Double_t globalActiveCoords[3];
511 gGeoManager->LocalToMaster(localActiveCoords,
514 if (fStations[stationNumber].fLayers[layerNumber].minY
515 > globalActiveCoords[1])
516 fStations[stationNumber].
fLayers[layerNumber].
minY =
517 globalActiveCoords[1];
519 if (fStations[stationNumber].fLayers[layerNumber].maxY
520 < globalActiveCoords[1])
521 fStations[stationNumber].
fLayers[layerNumber].
maxY =
522 globalActiveCoords[1];
524 if (fStations[stationNumber].fLayers[layerNumber].minX
525 > globalActiveCoords[0])
526 fStations[stationNumber].
fLayers[layerNumber].
minX =
527 globalActiveCoords[0];
529 if (fStations[stationNumber].fLayers[layerNumber].maxX
530 < globalActiveCoords[0])
531 fStations[stationNumber].
fLayers[layerNumber].
maxX =
532 globalActiveCoords[0];
547 int nofStations = stationNumber;
549 list<TGeoNode*> absorbers;
551 int absorberNumber = 0;
553 for (list<TGeoNode*>::iterator j = absorbers.begin();
554 j != absorbers.end();
556 TGeoNode* absorber = *j;
557 pNavigator->CdDown(absorber);
558 TGeoVolume* absVol = gGeoManager->GetCurrentVolume();
559 const TGeoBBox* absShape =
560 static_cast<const TGeoBBox*
>(absVol->GetShape());
562 if (absorberNumber < nofStations) {
563 gGeoManager->LocalToMaster(localCoords, globalCoords);
565 globalCoords[2] - absShape->GetDZ();
566 fStations[absorberNumber].
fAbsorber.
width = 2 * absShape->GetDZ();
568 absVol->GetMaterial()->GetRadLen();
570 absVol->GetMaterial()->GetDensity();
571 fStations[absorberNumber].
fAbsorber.
Z = absVol->GetMaterial()->GetZ();
572 fStations[absorberNumber].
fAbsorber.
A = absVol->GetMaterial()->GetA();
594 for (list<LxTbBinnedTriplet*>::iterator
i = point.
triplets.begin();
601 sqrt(1 + triplet->
tx * triplet->
tx + triplet->
ty * triplet->
ty)
607 handleLPoint.rTriplet = triplet;
612 + triplet->
dtx * triplet->
dtx * deltaZ * deltaZ),
616 + triplet->
dty * triplet->
dty * deltaZ * deltaZ),
684 : layer.
z - station.
fLayers[layerNumber + 1].
z;
685 scaltype deltaZSq = deltaZ * deltaZ;
688 param.
coord += prevParam.
tg * deltaZ;
692 param.
C11 += prevParam.
C12 * deltaZ + prevParam.
C21 * deltaZ
693 + prevParam.
C22 * deltaZSq + Q.
Q11;
694 param.
C12 += prevParam.
C22 * deltaZ + Q.
Q12;
695 param.
C21 += prevParam.
C22 * deltaZ + Q.
Q21;
698 param.
C11 += prevParam.
C12 * deltaZ + prevParam.
C21 * deltaZ
699 + prevParam.
C22 * deltaZSq;
700 param.
C12 += prevParam.
C22 * deltaZ;
701 param.
C21 += prevParam.
C22 * deltaZ;
708 param.
coord += Kcoord * dzeta;
709 param.
tg += Ktg * dzeta;
710 param.
C21 -= param.
C11 * Ktg;
711 param.
C22 -= param.
C12 * Ktg;
712 param.
C11 *= 1.0 - Kcoord;
713 param.
C12 *= 1.0 - Kcoord;
714 chi2 += dzeta * S * dzeta;
730 KFAddPointCoord(prevParam.
yParams,
750 param = KFAddPoint(param,
m, V, level,
i);
759 list<LxTBMLFinder::Chain>& chains,
762 trackCandidatePoints[level][0] = triplet->
lPoint;
763 trackCandidatePoints[level][2] = triplet->
rPoint;
764 kfParams = KFAddTriplet(kfParams, trackCandidatePoints, level);
770 for (list<LxTbBinnedPoint*>::iterator
i = triplet->
neighbours.begin();
773 HandlePoint(*
i, trackCandidatePoints, chains, level - 1, kfParams);
780 list<LxTBMLFinder::Chain>& chains,
783 trackCandidatePoints[level][1] = point;
785 for (list<LxTbBinnedTriplet*>::iterator
i = point->
triplets.begin();
789 HandleTriplet(triplet, trackCandidatePoints, chains, level, kfParams);
795 list<LxTBMLFinder::Chain> chains;
796 KFParams kfParams = {{0, 0, 1.0, 0, 0, 1.0}, {0, 0, 1.0, 0, 0, 1.0}, 0};
797 HandlePoint(&point, trackCandidatePoints, chains,
LAST_STATION, kfParams);
801 for (list<LxTBMLFinder::Chain>::const_iterator
i = chains.begin();
806 if (0 == bestChain || chain.
chi2 < chi2) {
822 cout <<
"Point Point Point!!!" << endl;
824 for (list<LxTbBinnedTriplet*>::iterator
i = point.
triplets.begin();
827 cout <<
"Triplet Triplet Triplet!!!" << endl;
841 cout <<
"Points and triplets dump for the station #:" <<
i << endl;
853 fHandleRPoint.
lLayer = &lLayer;
854 fHandleRPoint.
deltaZ = lLayer.
z - rLayer.
z;
872 , fNofTBins(fIsEvByEv ? 5 : 1000)
889 FairRootManager* ioman = FairRootManager::Instance();
891 if (0 == ioman) LOG(fatal) <<
"No FairRootManager";
893 int nofEventsInFile = ioman->CheckMaxEventNo();
900 pReconstructor->
Init();
902 fMuchPixelHits =
static_cast<TClonesArray*
>(ioman->GetObject(
"MuchPixelHit"));
908 fMuchClusters =
static_cast<TClonesArray*
>(ioman->GetObject(
"MuchCluster"));
910 static_cast<TClonesArray*
>(ioman->GetObject(
"MuchDigiMatch"));
915 fMCTracks.push_back(vector<TrackDataHolder>());
917 if (0 >= evSize)
continue;
919 vector<TrackDataHolder>& evTracks =
fMCTracks.back();
923 for (
int j = 0; j < evSize; ++j) {
940 evTracks.back().isSignal =
true;
941 evTracks.back().isPos = mcTrack->
GetPdgCode() == -13;
963 if (0 >= evSize)
continue;
966 vector<PointDataHolder>& evPoints =
fMuchPoints.back();
968 for (
int j = 0; j < evSize; ++j) {
976 muchPt.
trackId = pMuchPt->GetTrackID();
982 evPoints.push_back(muchPt);
988 for (vector<vector<TrackDataHolder>>::iterator
i =
fMCTracks.begin();
991 vector<TrackDataHolder>& evTracks = *
i;
993 for (vector<TrackDataHolder>::iterator j = evTracks.begin();
1016 sprintf(buf,
"deltaXRHisto_%d",
i);
1017 deltaXRHisto[
i] =
new TH1F(buf, buf, 300, -15., 15.);
1018 sprintf(buf,
"deltaYRHisto_%d",
i);
1019 deltaYRHisto[
i] =
new TH1F(buf, buf, 300, -15., 15.);
1020 sprintf(buf,
"deltaTRHisto_%d",
i);
1021 deltaTRHisto[
i] =
new TH1F(buf, buf, 300, -15., 15.);
1023 sprintf(buf,
"deltaXLHisto_%d",
i);
1024 deltaXLHisto[
i] =
new TH1F(buf, buf, 300, -15., 15.);
1025 sprintf(buf,
"deltaYLHisto_%d",
i);
1026 deltaYLHisto[
i] =
new TH1F(buf, buf, 300, -15., 15.);
1027 sprintf(buf,
"deltaTLHisto_%d",
i);
1028 deltaTLHisto[
i] =
new TH1F(buf, buf, 300, -15., 15.);
1048 #endif //LXTB_EMU_TS
1135 debugTracks2.clear();
1138 pReconstructor->
Clear();
1155 point.
isTrd =
false;
1165 #endif //LXTB_EMU_TS
1168 for (Int_t j = 0; j < nDigis; ++j) {
1173 for (Int_t k = 0; k < nMCs; ++k) {
1177 const FairMCPoint* pMCPt =
static_cast<const FairMCPoint*
>(
1179 Int_t trackId = pMCPt->GetTrackID();
1181 point.
mcRefs.push_back(ptDesc);
1182 Double_t deltaT =
fMuchPoints[eventId][pointId].t;
1184 deltaT += gRandom->Gaus(0, 4);
1186 #endif //LXTB_EMU_TS
1195 avTErr = TMath::Sqrt(avTErr);
1198 #endif //LXTB_EMU_TS
1224 int lastYBin = (pReconstructor->
fStations[stationNumber]
1231 int lastXBin = pReconstructor->
fStations[stationNumber]
1234 int last_timebin = pReconstructor->
fStations[stationNumber]
1244 else if (tInd > last_timebin)
1245 tInd = last_timebin;
1250 int yInd = (
y - minY) / binSizeY;
1254 else if (yInd > lastYBin)
1258 int xInd = (
x - minX) / binSizeX;
1262 else if (xInd > lastXBin)
1266 xBin.
points.push_back(point);
1273 if (0 == layerNumber)
1275 else if (1 == layerNumber)
1277 else if (2 == layerNumber)
1280 #endif //LXTB_EMU_TS
1288 map<Int_t, DebugTrack> debugTracks;
1297 for (
int l = 0; l < layer.
nofYXBins; ++l) {
1303 for (std::list<LxTbBinnedPoint>::iterator n = xBin.
points.begin();
1308 for (list<LxTbBinnedPoint::PointDesc>::const_iterator o =
1329 clock_gettime(CLOCK_REALTIME, &ts);
1330 long beginTime = ts.tv_sec * 1000000000 + ts.tv_nsec;
1334 clock_gettime(CLOCK_REALTIME, &ts);
1335 long endTime = ts.tv_sec * 1000000000 + ts.tv_nsec;
1340 static int nofTriplesFound[
NOF_STATIONS] = {0, 0, 0, 0};
1348 Triplet(Int_t l, Int_t
m, Int_t r) : left(l), middle(
m), right(r) {}
1352 bool operator()(
const Triplet& a,
const Triplet& b)
const {
1353 if (a.left < b.left)
1355 else if (a.middle < b.middle)
1357 else if (a.right < b.right)
1367 explicit Debug(vector<TrackDataHolder>&
mcTracks) : stationNumber(-1) {
1368 for (vector<TrackDataHolder>::const_iterator
i =
mcTracks.begin();
1379 triplets[j][trip] =
false;
1385 if (!point.
use)
return;
1387 for (list<LxTbBinnedTriplet*>::const_iterator
i = point.
triplets.begin();
1392 for (list<LxTbBinnedPoint::PointDesc>::const_iterator j =
1396 Int_t mId = j->pointId;
1398 for (list<LxTbBinnedPoint::PointDesc>::const_iterator k =
1402 Int_t rId = k->pointId;
1404 for (list<LxTbBinnedPoint::PointDesc>::const_iterator l =
1408 Int_t lId = l->pointId;
1409 Triplet mcTrip(lId, mId, rId);
1410 map<Triplet, bool, TrLess>::iterator iter =
1411 triplets[stationNumber].find(mcTrip);
1413 if (iter != triplets[stationNumber].end()) iter->second =
true;
1476 for (map<Int_t, DebugTrack2>::const_iterator
i = debugTracks2.begin();
1477 i != debugTracks2.end();
1479 const DebugTrack2& dt =
i->second;
1487 for (list<LxTbBinnedPoint*>::const_iterator k = dt.points[j][1].begin();
1488 k != dt.points[j][1].end();
1495 scaltype trajLenR =
sqrt(1 + rTx * rTx + rTy * rTy) * deltaZr;
1499 for (list<LxTbBinnedPoint*>::const_iterator l = dt.points[j][2].begin();
1500 l != dt.points[j][2].end();
1507 + mPt->
dx * mPt->
dx + rPt->
dx * rPt->
dx);
1511 + mPt->
dy * mPt->
dy + rPt->
dy * rPt->
dy);
1514 deltaXRHisto[j]->Fill(rPt->
x - rX);
1515 deltaYRHisto[j]->Fill(rPt->
y - rY);
1516 deltaTRHisto[j]->Fill(rPt->
t - rT);
1519 if (abs(rPt->
x - rX) > wXr) ++nofOverXR;
1521 if (abs(rPt->
y - rY) > wYr) ++nofOverYR;
1523 if (abs(rPt->
t - rT) > wTr) ++nofOverTR;
1526 for (list<LxTbBinnedPoint*>::const_iterator
m =
1527 dt.points[j][0].begin();
1528 m != dt.points[j][0].end();
1535 + mPt->
dx * mPt->
dx + rPt->
dx * rPt->
dx
1536 + lPt->
dx * lPt->
dx);
1550 scaltype trajLenL =
sqrt(1 + lTx * lTx + lTy * lTy) * deltaZl;
1555 deltaXLHisto[j]->Fill(lPt->
x - lX);
1556 deltaYLHisto[j]->Fill(lPt->
y - lY);
1557 deltaTLHisto[j]->Fill(lPt->
t - lT);
1560 if (abs(lPt->
x - lX) > wXl) ++nofOverXL;
1562 if (abs(lPt->
y - lY) > wYl) ++nofOverYL;
1564 if (abs(lPt->
t - lT) > wTl) ++nofOverTL;
1572 cout <<
"nofOverXR = " << nofOverXR << endl;
1573 cout <<
"nofOverYR = " << nofOverYR << endl;
1574 cout <<
"nofOverTR = " << nofOverTR << endl;
1576 cout <<
"nofOverXL = " << nofOverXL << endl;
1577 cout <<
"nofOverYL = " << nofOverYL << endl;
1578 cout <<
"nofOverTL = " << nofOverTL << endl;
1580 cout <<
"nofFoundR = " << nofFoundR << endl;
1581 cout <<
"nofNotFoundR = " << nofNotFoundR << endl;
1584 debug.stationNumber =
i;
1587 nofTriplesAll[
i] += debug.triplets[
i].size();
1589 for (map<Debug::Triplet, bool, Debug::TrLess>::const_iterator j =
1590 debug.triplets[
i].begin();
1591 j != debug.triplets[
i].end();
1593 if (j->second) ++nofTriplesFound[
i];
1596 double foundPerc = 100 * nofTriplesFound[
i];
1597 foundPerc /= nofTriplesAll[
i];
1598 cout <<
"For station #:" <<
i <<
" found triplets: " << foundPerc <<
" ( "
1599 << nofTriplesFound[
i] <<
" / " << nofTriplesAll[
i] <<
" )" << endl;
1604 <<
" reconstructed: " << pReconstructor->
recoTracks.size() <<
" tracks"
1607 static int nofSignals = 0;
1608 static int nofRecoSignals = 0;
1609 bool hasPos =
false;
1610 bool hasNeg =
false;
1612 for (vector<TrackDataHolder>::const_iterator
i =
1626 if (hasPos && hasNeg) ++nofSignals;
1628 bool hasPos2 =
false;
1629 bool hasNeg2 =
false;
1631 for (list<Chain*>::const_iterator
i = pReconstructor->
recoTracks.begin();
1646 if (hasPos2 && hasNeg2) {
1649 if (hasNeg && hasPos) ++nofRecoSignals;
1653 cout <<
"The triggering efficiency: "
1654 << (0 == nofSignals ? 100 : 100 * nofRecoSignals / nofSignals) <<
" % ( "
1655 << nofRecoSignals <<
" / " << nofSignals <<
" )" << endl;
1671 if (
x.eventId <
y.eventId)
return true;
1673 return x.trackId <
y.trackId;
1678 TFile* curFile = TFile::CurrentFile();
1679 TString histoName = histo->GetName();
1680 histoName +=
".root";
1681 TFile fh(histoName.Data(),
"RECREATE");
1685 TFile::CurrentFile() = curFile;
1692 for (list<LxTbBinnedPoint>::iterator
i =
ts_points.begin();
1699 bool isTrd = point.
isTrd;
1701 scaltype minY = (isTrd ? fFinder->trdStation.minY
1702 : fFinder->stations[stationNumber].minY);
1703 scaltype binSizeY = (isTrd ? fFinder->trdStation.binSizeY
1704 : fFinder->stations[stationNumber].binSizeY);
1705 int lastYBin = (isTrd ? fFinder->trdStation.lastYBin
1706 : fFinder->stations[stationNumber].lastYBin);
1707 scaltype minX = (isTrd ? fFinder->trdStation.minX
1708 : fFinder->stations[stationNumber].minX);
1709 scaltype binSizeX = (isTrd ? fFinder->trdStation.binSizeX
1710 : fFinder->stations[stationNumber].binSizeX);
1711 int lastXBin = (isTrd ? fFinder->trdStation.lastXBin
1712 : fFinder->stations[stationNumber].lastXBin);
1718 else if (tInd > last_timebin)
1719 tInd = last_timebin;
1722 (isTrd ? fFinder->trdStation.tyxBinsArr[stationNumber][tInd]
1723 : fFinder->stations[stationNumber].tyxBins[tInd]);
1724 int yInd = (point.
y - minY) / binSizeY;
1728 else if (yInd > lastYBin)
1732 int xInd = (point.
x - minX) / binSizeX;
1736 else if (xInd > lastXBin)
1740 xBin.
points.push_back(point);
1750 fDetector->SetTSBegin(0);
1753 fFinder->Reconstruct();
1769 for (
int i = 0;
i < fFinder->nofTrackBins; ++
i) {
1770 list<LxTbBinnedFinder::Chain*>& recoTracksBin = fFinder->recoTracks[
i];
1772 for (list<LxTbBinnedFinder::Chain*>::const_iterator j =
1773 recoTracksBin.begin();
1774 j != recoTracksBin.end();
1780 fFinder->triggerTimes_trd0_sign0_dist0);
1782 fFinder->triggerTimes_trd0_sign0_dist1);
1784 fFinder->triggerTimes_trd0_sign1_dist0);
1786 fFinder->triggerTimes_trd0_sign1_dist1);
1788 fFinder->triggerTimes_trd1_sign0_dist0);
1790 fFinder->triggerTimes_trd1_sign0_dist1);
1792 fFinder->triggerTimes_trd1_sign1_dist0);
1794 fFinder->triggerTimes_trd1_sign1_dist1);
1795 #endif //LXTB_EMU_TS
1796 cout <<
"LxTbBinnedFinder::Reconstruct() full duration was: " <<
fullDuration
1800 cout <<
"LxTbBinnedFinder::Reconstruct() the number of found tracks: "
1801 << nofRecoTracks << endl;
1804 static int nofSignalTracks = 0;
1805 static int nofRecoSignalTracks = 0;
1808 for (vector<vector<TrackDataHolder>>::iterator
i =
fMCTracks.begin();
1811 vector<TrackDataHolder>& evTracks = *
i;
1813 for (vector<TrackDataHolder>::iterator j = evTracks.begin();
1814 j != evTracks.end();
1822 int nofMatchPoints = 0;
1824 for (list<Chain*>::const_iterator k =
recoTracks.begin();
1827 const Chain* chain = *k;
1831 bool pointsMatched =
false;
1833 for (list<LxTbBinnedPoint::PointDesc>::const_iterator n =
1837 if (n->eventId == eventN && n->pointId == track.
pointInds[l][
m]) {
1838 pointsMatched =
true;
1843 if (pointsMatched) ++nofMatchPoints;
1849 ++nofRecoSignalTracks;
1858 0 == nofSignalTracks ? 100 : 100.0 * nofRecoSignalTracks / nofSignalTracks;
1859 cout <<
"Reconstruction efficiency is: " << eff <<
"% [ "
1860 << nofRecoSignalTracks <<
" / " << nofSignalTracks <<
" ]" << endl;
1862 int nofRightRecoTracks = 0;
1864 for (list<Chain*>::const_iterator
i =
recoTracks.begin();
1868 map<RecoTrackData, int, RTDLess> nofTracks;
1874 for (list<LxTbBinnedPoint::PointDesc>::const_iterator l =
1879 map<RecoTrackData, int, RTDLess>::iterator nofTIter =
1882 if (nofTIter != nofTracks.end())
1883 nofTIter->second |= stMask;
1885 nofTracks[st] = stMask;
1892 for (map<RecoTrackData, int, RTDLess>::const_iterator j = nofTracks.begin();
1893 j != nofTracks.end();
1899 if (j->second & (1 << k *
NOF_LAYERS + l)) ++nofp;
1903 if (nofp > nofPoints) nofPoints = nofp;
1910 0 ==
recoTracks.size() ? 100 : 100.0 * nofRightRecoTracks / nofRecoTracks;
1911 cout <<
"Non ghosts are: " << eff <<
"% [ " << nofRightRecoTracks <<
" / "
1912 << nofRecoTracks <<
" ]" << endl;
1918 ofstream nofEventsFile(
"nof_events.txt", ios_base::out | ios_base::trunc);
1921 ofstream nofTriggeringsFile(
"nof_triggerings.txt",
1922 ios_base::out | ios_base::trunc);