62 std::shared_ptr<CbmTrdRadiator> radiator)
82 , fModuleClusterMapIt()
85 , fModuleAveragePointsMap()
86 , fModuleAveragePointsMapIt()
87 , fModuleTrackableMap2()
88 , fModuleTrackableMap2It()
89 , fModuleTrackableMap()
90 , fModuleTrackableMapIt()
91 , fModuleClusterSizeMap()
92 , fModuleClusterSizeMapIt()
95 , fModuleTracklengthMap()
96 , fModuleTracklengthMapIt()
97 , fModuleMultiPointMap()
98 , fModuleMultiPointMapIt()
100 , fModuleDeltaEMapIt()
102 , fModuleGhostMapIt()
105 , fModuleEfficiencyMap()
106 , fModuleEfficiencyMapIt()
107 , fTriggerThreshold(triggerThreshold)
114 , fTrianglePads(false)
116 , fStsTrdPoints(NULL)
117 , fStsMuchPoints(NULL)
118 , fStsTofPoints(NULL)
119 , fStsTrdPointsTrackable(NULL)
120 , fTrdPointsPerMcTrack_PID(NULL)
121 , fTrdPointsPerMcTrack_PT(NULL)
122 , fTrdPointsPerMcTrack_P(NULL)
123 , fTrdTrackCrossedRadiator(NULL)
124 , fMultiHitSamePadPerMcTrack(NULL)
125 , fMultiHitSamePadPerMcTrack_angle(NULL)
126 , fMultiHitSamePadPerMcTrack_zBirth(NULL)
127 , fMultiHitSamePadPerMcTrack_PID(NULL)
128 , fMultiHitSamePadPerMcTrack_motherPID(NULL)
129 , fMultiHitSamePadPerMcTrack_motherzBirth(NULL)
130 , fMultiHitAdjacentPadPerMcTrack(NULL)
131 , fMultiHitAdjacentPadPerMcTrack_angle(NULL)
132 , fMultiHitAdjacentPadPerMcTrack_zBirth(NULL)
133 , fMultiHitAdjacentPadPerMcTrack_PID(NULL)
134 , fMultiHitAdjacentPadPerMcTrack_motherzBirth(NULL)
135 , fMultiHitAdjacentPadPerMcTrack_motherPID(NULL)
136 , fDistanceMcToHit(NULL)
137 , fDistanceMcToHitAll(NULL)
138 , fPositionResolutionShort(NULL)
139 , fPositionResolutionLong(NULL)
146 , fdEdxPionGhost(NULL)
147 , fdEdxElectronMc(NULL)
148 , fdEdxElectronHit(NULL)
149 , fdEdxElectronGhost(NULL)
151 , fPointsPerDigi(NULL)
152 , fDigiPerCluster(NULL)
153 , fClusterPerHit(NULL)
154 , fMultiPointssVsR(NULL)
155 , fGhostPointsVsR(NULL)
156 , fMultiHitsVsR(NULL)
158 , fLostPointVsR(NULL)
159 , fHitToPointEfficiencyVsR(NULL)
160 , fMultiHitsVsAlpha(NULL)
161 , fGhostHitVsAlpha(NULL)
162 , fLostPointVsAlpha(NULL)
163 , fHitToPointEfficiencyVsAlpha(NULL)
166 , fRadiator(radiator)
337 FairRootManager* ioman = FairRootManager::Instance();
338 fMCTracks = (TClonesArray*) ioman->GetObject(
"MCTrack");
340 cout <<
"-W CbmTrdQa::Init: No MCTrack array!" << endl;
341 cout <<
" Task will be inactive" << endl;
345 fPoints = (TClonesArray*) ioman->GetObject(
"TrdPoint");
347 cout <<
"-W CbmTrdQa::Init: No TrdPoint array!" << endl;
348 cout <<
" Task will be inactive" << endl;
355 fClusters = (TClonesArray*) ioman->GetObject(
"TrdCluster");
357 cout <<
"-W CbmTrdQa::Init: No TrdCluster array!" << endl;
358 cout <<
" Task will be inactive" << endl;
362 fHits = (TClonesArray*) ioman->GetObject(
"TrdHit");
364 cout <<
"-W CbmTrdQa::Init: No TrdHits array!" << endl;
365 cout <<
" Task will be inactive" << endl;
371 fLayerDummy =
new TH2I(
"LayerDummy",
"", 1, -600, 600, 1, -500, 500);
387 fStsTrdPoints =
new TH2F(
"fStsTrdPoints",
"fStsTrdPoints", 12, -0.5, 11.5, 21, -0.5, 20.5);
393 fStsMuchPoints =
new TH2F(
"fStsMuchPoints",
"fStsMuchPoints", 12, -0.5, 11.5, 21, -0.5, 20.5);
399 fStsTofPoints =
new TH2F(
"fStsTofPoints",
"fStsTofPoints", 12, -0.5, 11.5, 21, -0.5, 20.5);
406 for (Int_t iStsPoints = 0; iStsPoints < 11; iStsPoints++) {
407 name.Form(
"_%02iStsPoints", iStsPoints);
410 new TH2F(
"fMuchTrdPoints" + name,
"fMuchTrdPoints" + name, 12, -0.5, 11.5, 21, -0.5, 20.5);
417 new TH2F(
"fMuchTofPoints" + name,
"fMuchTofPoints" + name, 12, -0.5, 11.5, 21, -0.5, 20.5);
424 new TH2F(
"fTrdTofPoints" + name,
"fTrdTofPoints" + name, 12, -0.5, 11.5, 21, -0.5, 20.5);
431 fStsTrdPointsTrackable =
new TH2F(
"fStsTrdPointsTrackable",
"fStsTrdPointsTrackable", 12, -0.5, 11.5, 21, -0.5, 20.5);
439 new TH2F(
"fTrdPointsPerMcTrack_PID",
"fTrdPointsPerMcTrack_PID", 12, -0.5, 11.5, 49, 0.5, 49.5);
443 for (Int_t bin = 1; bin <= 49; bin++) {
446 fTrdPointsPerMcTrack_PT =
new TH2F(
"fTrdPointsPerMcTrack_PT",
"fTrdPointsPerMcTrack_PT", 12, -0.5, 11.5, 30, 0, 3);
451 fTrdPointsPerMcTrack_P =
new TH2F(
"fTrdPointsPerMcTrack_P",
"fTrdPointsPerMcTrack_P", 12, -0.5, 11.5, 100, 0, 10);
457 new TH2F(
"fTrdTrackCrossedRadiator",
"fTrdTrackCrossedRadiator", 12, -0.5, 11.5, 15, -3.5, 11.5);
463 fDistanceMcToHit =
new TH1I(
"DistanceMcToHit",
"DistanceMcToHit", 1500, 0, 150);
473 fdEdxPionMc =
new TH1F(
"dEdxPionMc",
"dEdxPionMc", 250, 0, 30.0e-6);
479 fdEdxPionHit =
new TH1F(
"dEdxPionHit",
"dEdxPionHit", 250, 0, 30.0e-6);
485 fdEdxPionGhost =
new TH1F(
"dEdxPionGhost",
"dEdxPionGhost", 250, 0, 30.0e-6);
491 fdEdxElectronMc =
new TH1F(
"dEdxElectronMc",
"dEdxElectronMc", 250, 0, 30.0e-6);
497 fdEdxElectronHit =
new TH1F(
"dEdxElectronHit",
"dEdxElectronHit", 250, 0, 30.0e-6);
503 fdEdxElectronGhost =
new TH1F(
"dEdxElectronGhost",
"dEdxElectronGhost", 250, 0, 30.0e-6);
509 fdEdxPoint =
new TH1F(
"dEdxPoint",
"dEdxPoint", 1.0e3, 0, 30.0e-6);
513 fdEdxDigi =
new TH1F(
"dEdxDigi",
"dEdxDigi", 1.0e3, 0, 30.0e-6);
517 fdEdxCluster =
new TH1F(
"dEdxCluster",
"dEdxCluster", 1.0e3, 0, 30.0e-6);
521 fdEdxHit =
new TH1F(
"dEdxHit",
"dEdxHit", 1.0e3, 0, 30.0e-6);
523 fdEdxHit->SetXTitle(
"dE/dx Hit [GeV]");
525 fMultiHitsVsR =
new TProfile(
"MultiHitVsR",
"MultiHitVsR", 785, 0, 785);
528 fMultiHitsVsR->SetYTitle(
"hits per point on same pad/ all points per module [%]");
532 fGhostHitVsR =
new TProfile(
"GhostHitVsR",
"GhostHitVsR", 785, 0, 785);
535 fGhostHitVsR->SetYTitle(
"left over hits / all points per module [%]");
539 fLostPointVsR =
new TProfile(
"LostPointVsR",
"LostPointVsR", 785, 0, 785);
542 fLostPointVsR->SetYTitle(
"left over points / all points per module [%]");
554 new TProfile(
"MultiHitsVsAlpha",
"MultiHitsVsAlpha", TMath::Pi() / 3. * 100, 0, TMath::Pi() / 3. * 1000);
557 fMultiHitsVsAlpha->SetYTitle(
"hits per point on same pad/ all points per module [%]");
562 new TProfile(
"GhostHitVsAlpha",
"GhostHitVsAlpha", TMath::Pi() / 3. * 100, 0, TMath::Pi() / 3. * 1000);
570 new TProfile(
"LostPointVsAlpha",
"LostPointVsAlpha", TMath::Pi() / 3. * 100, 0, TMath::Pi() / 3. * 1000);
578 TMath::Pi() / 3. * 100, 0, TMath::Pi() / 3. * 1000);
593 fClusterSize =
new TH1I(
"fClusterSize",
"fClusterSize", 21, -0.5, 20.5);
597 fPointsPerDigi =
new TH1I(
"fPointsPerDigi",
"fPointsPerDigi", 101, -0.5, 100.5);
601 fDigiPerCluster =
new TH1I(
"fDigiPerCluster",
"fDigiPerCluster", 101, -0.5, 100.5);
605 fClusterPerHit =
new TH1I(
"fClusterPerHit",
"fClusterPerHit", 101, -0.5, 100.5);
609 fPRF_1D =
new TProfile(
"fPRF_1D",
"fPRF_1D", 30, -1.5, 1.5);
610 fPRF_2D =
new TH2I(
"fPRF_2D",
"fPRF_2D", 30, -1.5, 1.5, 10, 0, 1);
616 new TH1I(
"fMultiHitSamePadPerMcTrack_angle",
"fMultiHitSamePadPerMcTrack_angle", 3600, 0, 360);
621 10000, -50, 1000, 10000, -50, 1000);
627 new TH2I(
"fMultiHitSamePadPerMcTrack_PID",
"fMultiHitSamePadPerMcTrack_PID", 49, 0.5, 49.5, 49, 0.5, 49.5);
629 for (Int_t bin = 1; bin <= 49; bin++) {
639 new TH2I(
"fMultiHitSamePadPerMcTrack_motherzBirth",
"fMultiHitSamePadPerMcTrack_motherzBirth", 10000, -50, 1000,
646 "fMultiHitSamePadPerMcTrack_motherPID", 49, 0.5, 49.5, 49, 0.5, 49.5);
648 for (Int_t bin = 1; bin <= 49; bin++) {
659 new TH1I(
"fMultiHitAdjacentPadPerMcTrack",
"fMultiHitAdjacentPadPerMcTrack", 21, -0.5, 20.5);
664 new TH1I(
"fMultiHitAdjacentPadPerMcTrack_angle",
"fMultiHitAdjacentPadPerMcTrack_angle", 3600, 0, 360);
669 new TH2I(
"fMultiHitAdjacentPadPerMcTrack_zBirth",
"fMultiHitAdjacentPadPerMcTrack_zBirth", 10000, -50, 1000, 10000,
676 new TH2I(
"fMultiHitAdjacentPadPerMcTrack_PID",
"fMultiHitAdjacentPadPerMcTrack_PID", 49, 0.5, 49.5, 49, 0.5, 49.5);
678 for (Int_t bin = 1; bin <= 49; bin++) {
688 new TH2I(
"fMultiHitAdjacentPadPerMcTrack_motherzBirth",
"fMultiHitAdjacentPadPerMcTrack_motherzBirth", 10000, -50,
689 1000, 10000, -50, 1000);
695 new TH2I(
"fMultiHitAdjacentPadPerMcTrack_motherPID",
"fMultiHitAdjacentPadPerMcTrack_motherPID", 49, 0.5, 49.5, 49,
698 for (Int_t bin = 1; bin <= 49; bin++) {
736 Bool_t samePadMerge =
false;
740 cout << endl <<
"==================CbmTrdQa===================" << endl;
741 Int_t nEntries(0), iTrack(-1), mother_iTrack(-1), moduleAddress(-1), Station(-1), Layer(-1), combiId(-1),
755 std::map<Int_t, Int_t> deltaEMap;
756 std::map<Int_t, Int_t> TrackableMap;
757 std::map<Int_t, std::map<Int_t, Int_t>> doubleHitSinglePadMap;
758 std::map<Int_t, Int_t> channelAddressMap;
759 std::map<Int_t, Int_t> McTrackDoubleHitMap;
760 std::map<Int_t, Int_t> neighbourChannelAddressMap;
761 std::map<Int_t, Int_t> McTrackNeighbourHitMap;
764 nEntries =
fPoints->GetEntriesFast();
765 printf(
"%02i Points\n", nEntries);
767 std::map<Int_t, Int_t> hasBeenUsedTrack;
768 for (Int_t iPoint = 0; iPoint < nEntries; iPoint++) {
771 moduleAddress = point->GetDetectorID();
777 combiId = 10 * Station + Layer;
778 iTrack = point->GetTrackID();
786 title.Form(
"G%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
787 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
789 fModuleGhostMap[moduleAddress]->SetXTitle(
"left over points / all points [%]");
791 title.Form(
"L%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
792 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
793 fModuleLostMap[moduleAddress] =
new TH1I(title, title, 200, 0, 200);
794 fModuleLostMap[moduleAddress]->SetXTitle(
"left over hits / all points [%]");
796 title.Form(
"E%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
797 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
801 title.Form(
"M%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
802 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
806 title.Form(
"D%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
807 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
811 title.Form(
"TL%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
812 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
816 title.Form(
"dE%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
817 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
818 fModuledEdxMap[moduleAddress] =
new TH1I(title, title, 200, 0, 50);
821 title.Form(
"CS%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
822 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
826 title.Form(
"TA%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
827 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
831 title.Form(
"TA2%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
832 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
836 title.Form(
"AP%i_S%i_L%i_(%.2f, %.2f, %.2f)", moduleAddress, Station, Layer, fModuleGeo->
GetX(),
837 fModuleGeo->
GetY(), fModuleGeo->
GetZ());
842 deltaEMap[moduleAddress] = 0;
843 TrackableMap[moduleAddress] = 0;
849 gGeoManager->FindNode(p_global[0], p_global[1], p_global[2]);
850 if (!TString(gGeoManager->GetPath()).Contains(
"gas")) {
851 cout << gGeoManager->GetPath() << endl;
854 iTrack = point->GetTrackID();
858 if (hasBeenUsedTrack.find(iTrack) != hasBeenUsedTrack.end()) {
861 if (
fRadiator->LatticeHit(point)) hasBeenUsedTrack[iTrack] -= 1;
879 if (Int_t(trackLength / 1.0 + 0.9) < 1) {
880 deltaEMap[moduleAddress] += 1;
883 if (nStsPoints >= 5) TrackableMap[moduleAddress] += 1;
886 Int_t sectorId(0), columnId(0), rowId(0);
887 fModuleInfo->
GetPadInfo(point, sectorId, columnId, rowId);
892 if (channelAddressMap.find(channelAddress) == channelAddressMap.end()) {
893 channelAddressMap[channelAddress] = 0;
894 neighbourChannelAddressMap[channelAddress] = 0;
896 channelAddressMap[channelAddress] += 1;
899 if (McTrackDoubleHitMap.find(point->GetTrackID()) == McTrackDoubleHitMap.end()) {
900 McTrackDoubleHitMap[point->GetTrackID()] = 0;
901 McTrackNeighbourHitMap[point->GetTrackID()] = 0;
903 if (channelAddressMap[channelAddress] > 1) {
904 McTrackDoubleHitMap[point->GetTrackID()] += 1;
907 Int_t neighbourRow(-1), neighbourColumn(-1), neighbourSector(-1), neighbourChannelAddress(0);
909 for (Int_t r = -1; r <= 1; r++) {
910 for (Int_t c = -1; c <= 1; c++) {
911 if (r == 0 && c == 0)
continue;
912 if (r != 0 && c != 0)
continue;
913 if (rowId < fModuleInfo->GetNofRowsInSector(sectorId) - 1 && rowId > 0) {
914 neighbourSector = sectorId;
915 neighbourRow = rowId + r;
917 else if (rowId + r < 0 && sectorId > 0) {
918 neighbourSector = sectorId - 1;
922 && sectorId < fModuleInfo->GetNofSectors() - 1) {
923 neighbourSector = sectorId + 1;
926 if (columnId + c >= 0 && columnId + c <= fModuleInfo->GetNofColumnsInSector(sectorId) - 1)
927 neighbourColumn = columnId + c;
929 if (neighbourSector > -1 && neighbourRow > -1 && neighbourColumn > -1) {
932 neighbourSector, neighbourRow, neighbourColumn);
933 if (channelAddressMap.find(neighbourChannelAddress) != channelAddressMap.end()) {
935 neighbourChannelAddressMap[channelAddress] += 1;
936 neighbourChannelAddressMap[neighbourChannelAddress] += 1;
940 McTrackNeighbourHitMap[point->GetTrackID()] += 1;
946 Double_t ELoss = point->GetEnergyLoss();
955 title.Form(
"Station%i_Layer%i", Station, Layer);
956 fLayerMap[combiId] =
new TCanvas(title, title, 1200, 1000);
960 for (std::map<Int_t, Int_t>::iterator it = hasBeenUsedTrack.begin(); it != hasBeenUsedTrack.end(); it++) {
971 printf(
"%i Digis \n", nEntries);
972 for (Int_t iDigi = 0; iDigi < nEntries; iDigi++) {
980 combiId = 10 * Station + Layer;
986 title.Form(
"Station%i_Layer%i", Station, Layer);
987 fLayerMap[combiId] =
new TCanvas(title, title, 1200, 1000);
996 printf(
"%i\n", nEntries);
997 for (Int_t iCluster = 0; iCluster < nEntries; iCluster++) {
1004 for (Int_t iDigi = 0; iDigi < cluster->
GetNofDigis(); iDigi++) {
1014 for (Int_t i = 0; i < cluster->
GetNofDigis(); i++) {
1035 nEntries =
fHits->GetEntriesFast();
1036 printf(
"%i Hits\n", nEntries);
1037 for (Int_t iHit = 0; iHit < nEntries; iHit++) {
1043 combiId = 10 * Station + Layer;
1049 title.Form(
"Station%i_Layer%i", Station, Layer);
1050 fLayerMap[combiId] =
new TCanvas(title, title, 1200, 1000);
1056 for (std::map<Int_t, Int_t>::iterator McTrackDoubleHitMapIt =
1057 McTrackDoubleHitMap.begin();
1058 McTrackDoubleHitMapIt != McTrackDoubleHitMap.end(); McTrackDoubleHitMapIt++) {
1062 for (std::map<Int_t, Int_t>::iterator McTrackNeighbourHitMapIt = McTrackNeighbourHitMap.begin();
1063 McTrackNeighbourHitMapIt != McTrackNeighbourHitMap.end(); McTrackNeighbourHitMapIt++) {
1067 std::map<Int_t, Int_t> notMultiPointTRDPoints;
1075 std::map<Int_t, Int_t> hasBeenUsed;
1082 fModuleDeltaEMap[moduleAddress]->Fill(100. * deltaEMap[moduleAddress] / allPoints);
1088 Double_t multiHitCounterModule = 0;
1089 Double_t r =
sqrt(fModuleGeo->
GetX() * fModuleGeo->
GetX()
1090 + fModuleGeo->
GetY() * fModuleGeo->
GetY());
1091 Double_t alpha = atan(r / fModuleGeo->
GetZ()) * 1000.;
1099 iTrack = point->GetTrackID();
1104 if (mother_iTrack >= 0)
1107 track_mother = NULL;
1108 if (notMultiPointTRDPoints.find(iTrack) == notMultiPointTRDPoints.end()) {
1115 if (nStsPoint < 11) {
1137 gGeoManager->FindNode(p_global[0], p_global[1], p_global[2]);
1139 Double_t p_local[3] = {0.0};
1140 gGeoManager->MasterToLocal(p_global, p_local);
1144 Int_t xPpad(0), yPpad(0),
1147 fModuleInfo->
GetPadInfo(p_local, pSectorId, xPpad, yPpad);
1150 for (Int_t jPoint = 0; jPoint < iPoint; jPoint++) {
1152 Int_t jTrack = point2->GetTrackID();
1155 if (mother_jTrack >= 0)
1158 track2_mother = NULL;
1159 if (notMultiPointTRDPoints.find(jTrack) == notMultiPointTRDPoints.end()) {
1166 if (nStsPoint < 11) {
1178 Double_t p_global2[3] = {0.5 * (point2->
GetXOut() + point2->
GetXIn()),
1182 gGeoManager->FindNode(p_global2[0], p_global2[1], p_global2[2]);
1184 Double_t p_local2[3] = {0.0};
1185 gGeoManager->MasterToLocal(p_global2, p_local2);
1186 Int_t xPpad2(0), yPpad2(0),
1189 fModuleInfo->
GetPadInfo(p_local2, pSectorId2, xPpad2, yPpad2);
1190 yPpad2 = fModuleInfo->
GetModuleRow(pSectorId2, yPpad2);
1192 if ((xPpad2 == xPpad) && (yPpad2 == yPpad)) {
1199 if (NULL != track_mother && NULL != track2_mother) {
1206 multiHitCounterModule++;
1207 if (notMultiPointTRDPoints.find(iTrack) != notMultiPointTRDPoints.end())
1208 if (notMultiPointTRDPoints[iTrack] > 0) notMultiPointTRDPoints[iTrack]--;
1212 multiHitCounterModule++;
1213 if (notMultiPointTRDPoints.find(jTrack) != notMultiPointTRDPoints.end())
1214 if (notMultiPointTRDPoints[jTrack] > 0) notMultiPointTRDPoints[jTrack]--;
1217 else if ((fabs(xPpad - xPpad2) <= 1 && fabs(yPpad - yPpad2) <= 1)) {
1218 if ((xPpad2 == xPpad) || (yPpad2 == yPpad)) {
1223 if (NULL != track_mother && NULL != track2_mother) {
1231 multiHitCounterModule++;
1235 multiHitCounterModule++;
1246 Double_t xPPadSize(fModuleInfo->
GetPadSizeX(pSectorId)),
1249 if (point->GetEnergyLoss() > 0.0) {
1250 if (Pdg_code == 211 || Pdg_code == -211)
fdEdxPionMc->Fill(point->GetEnergyLoss());
1251 if (Pdg_code == 11 || Pdg_code == -11)
fdEdxElectronMc->Fill(point->GetEnergyLoss());
1253 Double_t minimumDistance =
sqrt(xPPadSize * xPPadSize + yPPadSize * yPPadSize);
1254 Double_t xDiviation(0), yDiviation(0);
1255 Int_t minDHitId = -1;
1256 Double_t mergedELoss = 0.0;
1257 Double_t hitELoss = 0.0;
1259 for (Int_t iHit = 0; iHit < Int_t(
fModuleHitMap[moduleAddress].
size()); iHit++) {
1261 Double_t h_global[3] = {hit->
GetX(), hit->
GetY(), hit->
GetZ()};
1262 gGeoManager->FindNode(h_global[0], h_global[1], h_global[2]);
1264 Double_t h_local[3] = {0.0};
1265 gGeoManager->MasterToLocal(h_global, h_local);
1268 Int_t xHpad(0), yHpad(0),
1270 fModuleInfo->
GetPadInfo(h_local, hSectorId, xHpad, yHpad);
1278 Double_t distance =
sqrt((p_local[0] - h_local[0]) * (p_local[0] - h_local[0])
1279 + (p_local[1] - h_local[1]) * (p_local[1] - h_local[1]));
1282 if (distance < minimumDistance
1287 minimumDistance = distance;
1289 xDiviation = p_local[0] - h_local[0];
1290 yDiviation = p_local[1] - h_local[1];
1302 if (minDHitId > -1) {
1309 if (Pdg_code == 211 || Pdg_code == -211)
1311 if (Pdg_code == 11 || Pdg_code == -11)
fdEdxElectronHit->Fill(mergedELoss);
1314 if (Pdg_code == 211 || Pdg_code == -211)
1332 fMultiHitsVsAlpha->Fill(alpha, 100. * multiHitCounterModule / Float_t(allPoints));
1333 fMultiHitsVsR->Fill(r, 100. * multiHitCounterModule / Float_t(allPoints));
1340 / Float_t(allPoints));
1346 / Float_t(allPoints));
1348 / Float_t(allPoints));
1350 / Float_t(allPoints));
1352 fModuleMultiPointMap[moduleAddress]->Fill(100. * (Float_t(multiHitCounterModule)) / Float_t(allPoints));
1355 for (std::map<Int_t, Int_t>::iterator notMultiPointTRDPointsIt = notMultiPointTRDPoints.begin();
1356 notMultiPointTRDPointsIt != notMultiPointTRDPoints.end(); notMultiPointTRDPointsIt++) {
1361 Double_t rtime = timer.RealTime();
1362 Double_t ctime = timer.CpuTime();
1364 printf(
"\n\n******************** Reading Test **********************\n");
1365 printf(
" RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime);
1366 printf(
"*********************************************************\n\n");
1805 TFile* oldFile = gFile;
1806 TString origpath = gDirectory->GetPath();
1807 printf(
"\n%s\n", origpath.Data());
1809 TString newpath = origpath;
1810 newpath.ReplaceAll(
"eds",
"trd_qa");
1811 newpath.ReplaceAll(
":/",
"");
1812 TFile* tempFile =
new TFile(newpath,
"recreate");
1814 TString title(
""), name(
"");
1815 TPaveText* text = NULL;
1817 std::vector<Int_t> fColors;
1818 std::vector<Double_t> fZLevel;
1819 Double_t fmax(20), fmin(0);
1820 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
1821 fColors.push_back(TColor::GetColorPalette(i));
1823 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
1827 if (!gDirectory->Cd(
"TrdQa")) gDirectory->mkdir(
"TrdQa");
1828 gDirectory->Cd(
"TrdQa");
1844 Int_t combiId = 10 * Station + Layer;
1848 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
1854 text->SetFillStyle(1001);
1855 text->SetLineColor(1);
1858 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
1862 text->SetFillColor(fColors[j]);
1863 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
1865 if (fColors[j] < 65) text->SetTextColor(kWhite);
1866 title.Form(
"%.1f#pm%.1f", value, valueE);
1867 text->AddText(title);
1872 std::vector<Int_t> fColors;
1873 std::vector<Double_t> fZLevel;
1874 Double_t fmax(20), fmin(0);
1875 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
1876 fColors.push_back(TColor::GetColorPalette(i));
1878 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
1881 if (!gDirectory->Cd(
"Ghost")) gDirectory->mkdir(
"Ghost");
1882 gDirectory->Cd(
"Ghost");
1884 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
1885 title.Form(
"pics/TrdQaGhost_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
1889 title.ReplaceAll(
"pdf",
"png");
1895 gDirectory->Cd(
"..");
1904 Int_t combiId = 10 * Station + Layer;
1908 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
1914 text->SetFillStyle(1001);
1915 text->SetLineColor(1);
1917 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
1921 text->SetFillColor(fColors[j]);
1922 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
1924 if (fColors[j] < 65) text->SetTextColor(kWhite);
1925 title.Form(
"%.1f#pm%.1f", value, valueE);
1926 text->AddText(title);
1933 if (!gDirectory->Cd(
"Lost")) gDirectory->mkdir(
"Lost");
1934 gDirectory->Cd(
"Lost");
1937 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
1938 title.Form(
"pics/TrdQaLost_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
1942 title.ReplaceAll(
"pdf",
"png");
1948 gDirectory->Cd(
"..");
1950 std::vector<Int_t> fColors;
1951 std::vector<Double_t> fZLevel;
1952 Double_t fmax(100), fmin(0);
1953 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
1954 fColors.push_back(TColor::GetColorPalette(i));
1956 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
1969 Int_t combiId = 10 * Station + Layer;
1973 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
1979 text->SetFillStyle(1001);
1980 text->SetLineColor(1);
1982 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
1987 text->SetFillColor(fColors[j]);
1988 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
1990 if (fColors[j] < 65) text->SetTextColor(kWhite);
1992 title.Form(
"%.1f#pm%.1f", value, valueE);
1993 text->AddText(title);
1999 if (!gDirectory->Cd(
"Efficiency")) gDirectory->mkdir(
"Efficiency");
2000 gDirectory->Cd(
"Efficiency");
2003 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
2004 title.Form(
"pics/TrdQaEfficiency_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
2008 title.ReplaceAll(
"pdf",
"png");
2015 gDirectory->Cd(
"..");
2019 std::vector<Int_t> fColors;
2020 std::vector<Double_t> fZLevel;
2021 Double_t fmax(20), fmin(0);
2022 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2023 fColors.push_back(TColor::GetColorPalette(i));
2025 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
2039 Int_t combiId = 10 * Station + Layer;
2043 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2049 text->SetFillStyle(1001);
2050 text->SetLineColor(1);
2052 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2056 text->SetFillColor(fColors[j]);
2057 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2059 if (fColors[j] < 65) text->SetTextColor(kWhite);
2061 title.Form(
"%.1f#pm%.1f", value, valueE);
2062 text->AddText(title);
2068 if (!gDirectory->Cd(
"MultiPoint")) gDirectory->mkdir(
"MultiPoint");
2069 gDirectory->Cd(
"MultiPoint");
2072 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
2073 title.Form(
"pics/TrdQaMultiPoint_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
2077 title.ReplaceAll(
"pdf",
"png");
2084 gDirectory->Cd(
"..");
2088 std::vector<Int_t> fColors;
2089 std::vector<Double_t> fZLevel;
2090 Double_t fmax(10), fmin(0);
2091 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2092 fColors.push_back(TColor::GetColorPalette(i));
2094 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
2105 Int_t combiId = 10 * Station + Layer;
2109 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2115 text->SetFillStyle(1001);
2116 text->SetLineColor(1);
2118 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2122 text->SetFillColor(fColors[j]);
2123 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2125 if (fColors[j] < 65) text->SetTextColor(kWhite);
2127 title.Form(
"%.1f#pm%.1f", value, valueE);
2128 text->AddText(title);
2134 if (!gDirectory->Cd(
"dEdx")) gDirectory->mkdir(
"dEdx");
2135 gDirectory->Cd(
"dEdx");
2138 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
2139 title.Form(
"pics/TrdQadEdx_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
2143 title.ReplaceAll(
"pdf",
"png");
2149 gDirectory->Cd(
"..");
2153 std::vector<Int_t> fColors;
2154 std::vector<Double_t> fZLevel;
2155 Double_t fmax(2), fmin(0);
2156 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2157 fColors.push_back(TColor::GetColorPalette(i));
2159 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
2173 Int_t combiId = 10 * Station + Layer;
2177 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2183 text->SetFillStyle(1001);
2184 text->SetLineColor(1);
2186 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2190 text->SetFillColor(fColors[j]);
2191 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2193 if (fColors[j] < 65) text->SetTextColor(kWhite);
2195 title.Form(
"%.1f#pm%.1f", value, valueE);
2196 text->AddText(title);
2202 if (!gDirectory->Cd(
"Tracklength")) gDirectory->mkdir(
"Tracklength");
2203 gDirectory->Cd(
"Tracklength");
2206 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
2207 title.Form(
"pics/TrdQaTracklength_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
2211 title.ReplaceAll(
"pdf",
"png");
2218 gDirectory->Cd(
"..");
2222 std::vector<Int_t> fColors;
2223 std::vector<Double_t> fZLevel;
2224 Double_t fmax(1), fmin(0);
2225 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2226 fColors.push_back(TColor::GetColorPalette(i));
2228 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
2241 Int_t combiId = 10 * Station + Layer;
2245 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2251 text->SetFillStyle(1001);
2252 text->SetLineColor(1);
2254 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2258 text->SetFillColor(fColors[j]);
2259 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2261 if (fColors[j] < 65) text->SetTextColor(kWhite);
2263 title.Form(
"%.1f#pm%.1f", value, valueE);
2264 text->AddText(title);
2270 if (!gDirectory->Cd(
"DeltaE")) gDirectory->mkdir(
"DeltaE");
2271 gDirectory->Cd(
"DeltaE");
2274 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
2275 title.Form(
"pics/TrdQaDeltaE_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
2279 title.ReplaceAll(
"pdf",
"png");
2286 gDirectory->Cd(
"..");
2290 std::vector<Int_t> fColors;
2291 std::vector<Double_t> fZLevel;
2292 Double_t fmax(15), fmin(0);
2293 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2294 fColors.push_back(TColor::GetColorPalette(i));
2296 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
2310 Int_t combiId = 10 * Station + Layer;
2314 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2320 text->SetFillStyle(1001);
2321 text->SetLineColor(1);
2323 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2327 text->SetFillColor(fColors[j]);
2328 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2330 if (fColors[j] < 65) text->SetTextColor(kWhite);
2332 title.Form(
"%.1f#pm%.1f", value, valueE);
2333 text->AddText(title);
2340 if (!gDirectory->Cd(
"ClusterSize")) gDirectory->mkdir(
"ClusterSize");
2341 gDirectory->Cd(
"ClusterSize");
2344 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
2345 title.Form(
"pics/TrdQaClusterSize_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
2349 title.ReplaceAll(
"pdf",
"png");
2356 gDirectory->Cd(
"..");
2360 std::vector<Int_t> fColors;
2361 std::vector<Double_t> fZLevel;
2362 Double_t fmax(100), fmin(0);
2363 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2364 fColors.push_back(TColor::GetColorPalette(i));
2366 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
2379 Int_t combiId = 10 * Station + Layer;
2383 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2389 text->SetFillStyle(1001);
2390 text->SetLineColor(1);
2392 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2396 text->SetFillColor(fColors[j]);
2397 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2399 if (fColors[j] < 65) text->SetTextColor(kWhite);
2401 title.Form(
"%.1f#pm%.1f", value, valueE);
2402 text->AddText(title);
2408 if (!gDirectory->Cd(
"TrackableRatio")) gDirectory->mkdir(
"TrackableRatio");
2409 gDirectory->Cd(
"TrackableRatio");
2412 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
2413 title.Form(
"pics/TrdQaTrackableRatio_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
2417 title.ReplaceAll(
"pdf",
"png");
2424 gDirectory->Cd(
"..");
2428 std::vector<Int_t> fColors;
2429 std::vector<Double_t> fZLevel;
2430 Double_t fmax(50), fmin(0);
2431 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2432 fColors.push_back(TColor::GetColorPalette(i));
2434 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
2448 Int_t combiId = 10 * Station + Layer;
2452 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2458 text->SetFillStyle(1001);
2459 text->SetLineColor(1);
2461 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2465 text->SetFillColor(fColors[j]);
2466 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2468 if (fColors[j] < 65) text->SetTextColor(kWhite);
2470 title.Form(
"%.1f#pm%.1f", value, valueE);
2471 text->AddText(title);
2477 if (!gDirectory->Cd(
"Trackable")) gDirectory->mkdir(
"Trackable");
2478 gDirectory->Cd(
"Trackable");
2481 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
2482 title.Form(
"pics/TrdQaTrackable_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
2486 title.ReplaceAll(
"pdf",
"png");
2493 gDirectory->Cd(
"..");
2496 std::vector<Int_t> fColors;
2497 std::vector<Double_t> fZLevel;
2498 Double_t fmax(100), fmin(0);
2499 for (Int_t i = 0; i < TColor::GetNumberOfColors(); i++) {
2500 fColors.push_back(TColor::GetColorPalette(i));
2502 fZLevel.push_back(fmin + (fmax / TColor::GetNumberOfColors() * i));
2516 Int_t combiId = 10 * Station + Layer;
2520 fLayerDummy->GetZaxis()->SetRangeUser(fmin, fmax);
2526 text->SetFillStyle(1001);
2527 text->SetLineColor(1);
2529 while ((value > fZLevel[j]) && (j < (Int_t) fZLevel.size())) {
2533 text->SetFillColor(fColors[j]);
2534 if (j >= (Int_t) fZLevel.size()) text->SetFillColor(2);
2536 if (fColors[j] < 65) text->SetTextColor(kWhite);
2538 title.Form(
"%.1f#pm%.1f", value, valueE);
2539 text->AddText(title);
2545 if (!gDirectory->Cd(
"Trackable")) gDirectory->mkdir(
"Trackable");
2546 gDirectory->Cd(
"Trackable");
2549 fLayerMapIt->second->Write(
"", TObject::kOverwrite);
2550 title.Form(
"pics/TrdQaAveragePoints_S%i_L%i_%s%s.pdf",
fLayerMapIt->first / 10,
2554 title.ReplaceAll(
"pdf",
"png");
2561 gDirectory->Cd(
"..");
2562 gDirectory->Cd(
"..");
2568 gDirectory->Cd(origpath);