140 return (arm * 2 + stationBinOrder[stn] + 1);
149 int getPixPlane(
int id) {
return ((
id >> 16) & 0x7); }
163 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
164 rpStatusWord(ps.getUntrackedParameter<unsigned
int>(
"RPStatusWord", 0x8008)) {
171 vector<string> disabledPlanePlotsVec =
176 for (
auto s : disabledPlanePlotsVec) {
178 if (
count(
s.begin(),
s.end(),
'_') != 3)
179 throw cms::Exception(
"RPixPlaneCombinatoryTracking") <<
"Invalid string in turnOffPlanePlots: " <<
s;
181 vector<string> armStationRpPlane;
183 while ((
pos =
s.find(
'_')) != string::npos) {
184 armStationRpPlane.push_back(
s.substr(0,
pos));
187 armStationRpPlane.push_back(
s);
189 int arm = stoi(armStationRpPlane.at(0));
190 int station = stoi(armStationRpPlane.at(1));
191 int rp = stoi(armStationRpPlane.at(2));
192 int plane = stoi(armStationRpPlane.at(3));
197 <<
"Shutting off plots for: Arm " << arm <<
" Station " <<
station <<
" Rp " << rp <<
" Plane " << plane;
200 throw cms::Exception(
"RPixPlaneCombinatoryTracking") <<
"Invalid string in turnOffPlanePlots: " <<
s;
230 rpSts = (rpSts >> 1);
238 for (
int ind = 0; ind < 2 * 3 *
NRPotsMAX; ind++)
249 ibooker.setCurrentFolder(
"CTPPS/TrackingPixel");
251 string armTitleShort, stnTitleShort;
253 TAxis *yah1st =
nullptr;
254 TAxis *xaRPact =
nullptr;
255 TAxis *xah1trk =
nullptr;
257 hBX = ibooker.book1D(
"events per BX",
"ctpps_pixel;Event.BX", 4002, -1.5, 4000. + 0.5);
258 hBXshort = ibooker.book1D(
"events per BX(short)",
"ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
260 string str1st =
"Pixel planes activity";
264 h1st->SetOption(
"colz");
265 yah1st = h1st->GetYaxis();
267 string str2 =
"Pixel RP active";
275 str2 =
"Pixel Local Tracks";
284 for (
int arm = 0; arm < 2; arm++) {
291 ibooker.setCurrentFolder(
sd);
297 string stnd, stnTitle;
303 ibooker.setCurrentFolder(stnd);
310 string rpBinName = armTitleShort +
"_" + stnTitleShort +
"_" + rpTitle;
313 xah1trk->SetBinLabel(
getRPglobalBin(arm, stn), rpBinName.c_str());
314 xaRPact->SetBinLabel(
getRPglobalBin(arm, stn), rpBinName.c_str());
324 ibooker.setCurrentFolder(rpd);
326 const float x0Maximum = 70.;
327 const float y0Maximum = 15.;
328 string st =
"track intercept point";
329 string st2 =
": " + stnTitle;
331 st, st + st2 +
";x0;y0",
int(x0Maximum) * 2, 0., x0Maximum,
int(y0Maximum) * 4, -y0Maximum, y0Maximum);
334 st =
"number of tracks per event";
336 rpTitle +
";number of tracks",
345 hRPotActivPlanes[indexP] = ibooker.bookProfile(
"number of fired planes per event",
346 rpTitle +
";nPlanes;Probability",
355 hp2HitsMultROC_LS[indexP] = ibooker.bookProfile2D(
"ROCs hits multiplicity per event vs LS",
356 rpTitle +
";LumiSection;Plane#___ROC#",
364 ROCSizeInX *ROCSizeInY,
371 sprintf(
s,
"plane%d_0",
p);
374 sprintf(
s,
" %d_%d",
p,
r);
380 string st3 =
";PlaneIndex(=pixelPot*PlaneMAX + plane)";
382 st =
"hit multiplicity in planes";
387 st =
"cluster size in planes";
389 st + st2 + st3 +
";Cluster size",
398 st =
"number of hits per track";
399 htrackHits[indexP] = ibooker.bookProfile(st, rpTitle +
";number of hits", 5, 1.5, 6.5, -0.1, 1.1,
"");
402 h2HitsMultROC[indexP] = ibooker.bookProfile2D(
"ROCs hits multiplicity per event",
403 rpTitle +
";plane # ;ROC #",
411 ROCSizeInX * ROCSizeInY,
416 ibooker.setCurrentFolder(rpd +
"/latency");
418 ibooker.book1D(
"5 fired planes per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
421 ibooker.book1D(
"4 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
423 hRPotActivBXall[indexP] = ibooker.book1D(
"hits per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
425 int nbins = defaultDetSizeInX / pixBinW;
430 sprintf(
s,
"plane_%d",
p);
431 string pd = rpd +
"/" +
string(
s);
432 ibooker.setCurrentFolder(pd);
433 string st1 =
": " + rpTitle +
"_" +
string(
s);
435 st =
"adc average value";
436 hp2xyADC[indexP][
p] = ibooker.bookProfile2D(
437 st, st1 +
";pix col;pix row",
nbins, 0, defaultDetSizeInX,
nbins, 0, defaultDetSizeInX, 0., 512.,
"");
441 st =
"hits position";
442 h2xyHits[indexP][
p] = ibooker.book2DD(st,
443 st1 +
";pix col;pix row",
452 st =
"hits multiplicity";
458 st =
"plane efficiency";
460 st, st1 +
";x0;y0",
mapXbins,
mapXmin,
mapXmax,
mapYbins,
mapYmin,
mapYmax, 0, 1,
"");
476 int lumiId =
event.getLuminosityBlock().id().luminosityBlock();
484 RPactivity[rp] = RPdigiSize[rp] = pixRPTracks[rp] = 0;
512 for (
const auto &ds_tr : *pixTrack) {
513 int idet =
getDet(ds_tr.id);
516 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_tr.id" << ds_tr.id;
520 int arm = theId.
arm() & 0x1;
522 int rpot = theId.
rp() & 0x7;
526 ++pixRPTracks[rpInd];
536 float x0 = dit->x0();
537 float y0 = dit->y0();
552 std::map<int, int> numberOfPointPerPlaneEff;
553 for (
const auto &ds_frh : fittedHits) {
558 if (frh_it != ds_frh.begin())
560 LogPrint(
"CTPPSPixelDQMSource") <<
"More than one FittedRecHit found in plane " << plane;
561 if (frh_it->isRealHit())
564 numberOfPointPerPlaneEff[
p]++;
570 for (
auto planeAndHitsOnOthers : numberOfPointPerPlaneEff) {
572 <<
"For plane " << planeAndHitsOnOthers.first <<
", " << planeAndHitsOnOthers.second
573 <<
" hits on other planes were found" << endl;
576 for (
const auto &ds_frh : fittedHits) {
582 float frhX0 = frh_it->globalCoordinates().x() + frh_it->xResidual();
583 float frhY0 = frh_it->globalCoordinates().y() + frh_it->yResidual();
584 if (numberOfPointPerPlaneEff[plane] >= 3) {
585 if (frh_it->isRealHit())
602 LogPrint(
"CTPPSPixelDQMSource") <<
"No valid data in Event " <<
nEvents;
605 for (
const auto &ds_digi : *pixDigi) {
606 int idet =
getDet(ds_digi.id);
609 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_digi.id" << ds_digi.id;
617 int arm = theId.
arm() & 0x1;
619 int rpot = theId.
rp() & 0x7;
621 RPactivity[rpInd] = 1;
632 int nh = ds_digi.data.size();
642 int row = dit->row();
643 int col = dit->column();
644 int adc = dit->adc();
655 if (trocId >= 0 && trocId <
NROCsMAX) {
666 for (
const auto &ds : *pixClus) {
669 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: cluster.id" << ds.id;
675 int arm = theId.
arm() & 0x1;
677 int rpot = theId.
rp() & 0x7;
682 for (
const auto &
p : ds) {
683 int clusize =
p.size();
692 bool allRPactivity =
false;
694 if (RPactivity[rp] > 0)
695 allRPactivity =
true;
696 for (
int arm = 0; arm < 2; arm++) {
710 int ntr = pixRPTracks[
index];