60 TDirectory* oldDir = gDirectory;
68 std::string tag[2] = {
"OUT",
"IN"};
69 std::string title[2] = {
"[Outside Active Veto Window]",
"[Inside Active Veto Window]"};
74 std::string histoName =
"EventsWithAborts";
75 std::string histoTitle =
"Events With at Least one Abort";
76 m_nEventsWithAbort[0] =
new TH1F(TString::Format(
"%s_%s", histoName.c_str(), tag[0].c_str()),
77 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
86 m_nEventsWithAbort[1]->SetName(TString::Format(
"%s_%s", histoName.c_str(), tag[1].c_str()));
87 m_nEventsWithAbort[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
91 histoName =
"TrkAbortReason";
92 histoTitle =
"Tracking Abort Reason";
94 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
110 histoName =
"SVDL3UOcc";
111 histoTitle =
"SVD L3 u-side ZS5 Occupancy (%)";
114 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
115 90, 0, 100.0 / 1536.0 * 90);
121 m_svdL3uZS5Occupancy[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
124 histoName =
"SVDL3UOccVXDTF2aborts";
125 histoTitle =
"SVD L3 u-side ZS5 Occupancy (%) when VXDTF2 Aborts";
128 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
129 180, 0, 100.0 / 1536.0 * 180);
138 histoName =
"SVDL3UOccToSVDCKFaborts";
139 histoTitle =
"SVD L3 u-side ZS5 Occupancy (%) when toSVDCKF Aborts";
142 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
143 180, 0, 100.0 / 1536.0 * 180);
152 histoName =
"nCDCExtraHits";
153 histoTitle =
"Number of CDC Extra Hits";
155 m_nCDCExtraHits[0] =
new TH1F(TString::Format(
"%s_%s", histoName.c_str(), tag[0].c_str()),
156 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
162 m_nCDCExtraHits[1]->SetName(TString::Format(
"%s_%s", histoName.c_str(), tag[1].c_str()));
163 m_nCDCExtraHits[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
166 histoName =
"svdL3VTime";
167 histoTitle =
"Layer3 v-side Cluster Time Distribution";
169 m_svdTime[0] =
new TH1F(TString::Format(
"%s_%s", histoName.c_str(), tag[0].c_str()),
170 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
172 m_svdTime[0]->GetXaxis()->SetTitle(
"cluster time (ns)");
173 m_svdTime[0]->GetYaxis()->SetTitle(
"Number of Clusters");
176 m_svdTime[1]->SetName(TString::Format(
"%s_%s", histoName.c_str(), tag[1].c_str()));
177 m_svdTime[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
180 histoName =
"averages";
181 histoTitle =
"Averages from SVD and CDC";
184 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
195 m_integratedAverages[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
198 histoName =
"nCDCExtraHitsSL";
199 histoTitle =
"Number of CDC Extra Hits in SL";
200 for (
int sl = 0; sl < 9; sl++) {
202 m_nCDCExtraHitsSL[0][sl] =
new TH1F(TString::Format(
"%s%d_%s", histoName.c_str(), sl, tag[0].c_str()),
203 TString::Format(
"%s%d %s", histoTitle.c_str(), sl, title[0].c_str()),
204 201, -1000 / 200 / 2, 1000 + 1000 / 200 / 2);
209 m_nCDCExtraHitsSL[1][sl]->SetName(TString::Format(
"%s%d_%s", histoName.c_str(), sl, tag[1].c_str()));
210 m_nCDCExtraHitsSL[1][sl]->SetTitle(TString::Format(
"%s%d %s", histoTitle.c_str(), sl, title[1].c_str()));
214 histoName =
"fCDCExtraHitsPostCleanSL";
215 histoTitle =
"Fraction of CDC Extra Hits Post Cleaning in SL";
216 for (
int sl = 0; sl < 9; sl++) {
219 TString::Format(
"%s%d %s", histoTitle.c_str(), sl, title[0].c_str()),
230 histoName =
"nCDCHitsSL";
231 histoTitle =
"Average Number of CDC Hits per Track in SL";
232 for (
int sl = 0; sl < 9; sl++) {
234 m_nCDCHitsSL[0][sl] =
new TH1F(TString::Format(
"%s%d_%s", histoName.c_str(), sl, tag[0].c_str()),
235 TString::Format(
"%s%d %s", histoTitle.c_str(), sl, title[0].c_str()),
237 m_nCDCHitsSL[0][sl]->GetXaxis()->SetTitle(
"average nCDCHits per track");
238 m_nCDCHitsSL[0][sl]->GetYaxis()->SetTitle(
"Number of Events");
241 m_nCDCHitsSL[1][sl]->SetName(TString::Format(
"%s%d_%s", histoName.c_str(), sl, tag[1].c_str()));
242 m_nCDCHitsSL[1][sl]->SetTitle(TString::Format(
"%s%d %s", histoTitle.c_str(), sl, title[1].c_str()));
246 histoName =
"noCDCHitsInSL";
247 histoTitle =
"No Signal CDC Hits in SL";
249 m_noCDCHitsInSL[0] =
new TH1F(TString::Format(
"%s_%s", histoName.c_str(), tag[0].c_str()),
250 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
256 m_noCDCHitsInSL[1]->SetName(TString::Format(
"%s_%s", histoName.c_str(), tag[1].c_str()));
257 m_noCDCHitsInSL[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
331 }
catch (
const std::exception&) {
357 float nStripsL3UZS5 = 0;
358 float nStripsL3VZS5 = 0;
359 float nStripsL4UZS5 = 0;
360 float nStripsL4VZS5 = 0;
362 const VxdID& sensorID = hit.getSensorID();
364 const float noise =
m_NoiseCal.getNoise(sensorID, hit.isUStrip(), hit.getCellID());
365 const float cutMinSignal = std::round(5 * noise);
367 if (hit.passesZS(1, cutMinSignal)) {
369 if (hit.isUStrip()) nStripsL3UZS5++;
370 else nStripsL3VZS5++;
371 }
else if (hit.isUStrip()) nStripsL4UZS5++;
372 else nStripsL4VZS5++;
378 const VxdID& sensorID = hit.getSensorID();
380 if (hit.isUCluster())
continue;
382 m_svdTime[index]->Fill(hit.getClsTime());
386 double tmp_L3uZS5occupancy = (double)nStripsL3UZS5 /
m_nStripsL3U * 100;
387 double L3uZS5occupancy = std::min(tmp_L3uZS5occupancy, (
double)100.0 / 1536.0 * 90);
389 double L3uZS5occupancy_abort = std::min(tmp_L3uZS5occupancy, (
double)100.0 / 1536.0 * 180);
401 int nTracks =
m_tracks.getEntries();
403 int nCDCHitsInner = 0;
404 int nCDCHitsOuter = 0;
405 int nTotalCDCHits[9] = {0};
406 int nTakenCDCHits[9] = {0};
407 int nBgCDCHits[9] = {0};
410 int wireHitAmount = wireHitVector.size();
411 for (
int hitID = 0; hitID < wireHitAmount; ++hitID) {
412 const auto& wireHit = wireHitVector[hitID];
413 int sl = wireHit.getISuperLayer();
414 if (sl == 0) nCDCHitsInner++;
415 else nCDCHitsOuter++;
417 nTotalCDCHits[sl] += 1;
418 if (wireHit->hasTakenFlag()) nTakenCDCHits[sl] += 1;
419 if (wireHit->hasBackgroundFlag()) nBgCDCHits[sl] += 1;
422 for (
int sl = 0; sl < 9; sl++) {
424 float nSignalCDCHits = nTakenCDCHits[sl] - nBgCDCHits[sl];
425 int nCDCExtraHits = nTotalCDCHits[sl] - nSignalCDCHits;
426 int nCDCExtraHitsPostClean = nCDCExtraHits - nBgCDCHits[sl];
427 if (nTracks > 0) nSignalCDCHits = nSignalCDCHits / nTracks;
433 float)nCDCExtraHitsPostClean / nCDCExtraHits);