117 if (arm < 0 || station < 0 || rp < 0)
139 static constexpr
int stationBinOrder[
NStationMAX] = {0, 4, 1};
140 return (arm * 2 + stationBinOrder[stn] + 1);
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++)
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++) {
297 string stnd, stnTitle;
310 string rpBinName = armTitleShort +
"_" + stnTitleShort +
"_" + rpTitle;
313 xah1trk->SetBinLabel(
getRPglobalBin(arm, stn), rpBinName.c_str());
314 xaRPact->SetBinLabel(
getRPglobalBin(arm, stn), rpBinName.c_str());
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",
346 rpTitle +
";nPlanes;Probability",
356 rpTitle +
";LumiSection;Plane#___ROC#",
364 ROCSizeInX *ROCSizeInY,
371 sprintf(s,
"plane%d_0",
p);
372 yahp2->SetBinLabel(
p * NplaneMAX + 1, s);
374 sprintf(s,
" %d_%d",
p,
r);
375 yahp2->SetBinLabel(
p * NplaneMAX +
r + 1, s);
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,
"");
403 rpTitle +
";plane # ;ROC #",
411 ROCSizeInX * ROCSizeInY,
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);
433 string st1 =
": " + rpTitle +
"_" +
string(s);
435 st =
"adc average value";
437 st, st1 +
";pix col;pix row", nbins, 0, defaultDetSizeInX, nbins, 0, defaultDetSizeInX, 0., 512.,
"");
441 st =
"hits position";
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;
492 for (
int ind = 0; ind < RPotsTotalNumber *
NplaneMAX; ind++) {
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];
738 planesFiredAtROC[
r] = 0;
743 ++planesFiredAtROC[
r];
752 if (max < planesFiredAtROC[
r])
753 max = planesFiredAtROC[
r];
int StationStatus[StationIDMAX]
virtual TH2D * getTH2D() const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * hHitsMult[RPotsTotalNumber][NplaneMAX]
int HitsMultPlane[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2xyADC[RPotsTotalNumber][NplaneMAX]
MonitorElement * hpRPactive
MonitorElement * hp2HitsMultROC_LS[RPotsTotalNumber]
static constexpr int ClusMultMAX
static constexpr int mapYbins
virtual TH2F * getTH2F() const
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCluster
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
MonitorElement * h2CluSize[NArms][NStationMAX]
static constexpr int ADCMax
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
static constexpr int RPotsIDMAX
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
MonitorElement * htrackMult[RPotsTotalNumber]
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
MonitorElement * h2trackXY0[RPotsTotalNumber]
MonitorElement * hpixLTrack
static constexpr int NRPotBinsInStation
static constexpr int RPn_last
int bunchCrossing() const
static constexpr int hitMultMAX
static constexpr int dimension
static constexpr int NRPotsMAX
static constexpr int NPlaneBins
CTPPSPixelIndices thePixIndices
static constexpr int RPotsTotalNumber
static constexpr int mapXbins
static constexpr float mapYmax
MonitorElement * htrackHits[RPotsTotalNumber]
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenTrack
CTPPSDetId stationId() const
int prIndex(int rp, int plane)
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
int RPindexValid[RPotsTotalNumber]
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * h2Efficiency[RPotsTotalNumber][NplaneMAX]
MonitorElement * hROCadc[RPotsTotalNumber *NplaneMAX][NROCsMAX]
CTPPSPixelDQMSource(const edm::ParameterSet &ps)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * hRPotActivBX[RPotsTotalNumber]
static constexpr int NLocalTracksMAX
static constexpr int ClusterSizeMax
void armName(std::string &name, NameFlag flag=nFull) const
int getRPindex(int arm, int station, int rp)
virtual TProfile2D * getTProfile2D() const
Log< level::Warning, true > LogPrint
MonitorElement * hRPotActivBXroc[RPotsTotalNumber]
MonitorElement * h2xyROCHits[RPotsTotalNumber *NplaneMAX][NROCsMAX]
void setStation(uint32_t station)
unsigned int rpStatusWord
MonitorElement * hRPotActivBXall[RPotsTotalNumber]
static constexpr int NRPglobalBins
static constexpr int StationIDMAX
virtual TProfile * getTProfile() const
static constexpr int NStationMAX
static constexpr int NROCsMAX
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
~CTPPSPixelDQMSource() override
T getParameter(std::string const &) const
MonitorElement * book2DD(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Base class for CTPPS detector IDs.
int transformToROC(const int col, const int row, int &rocId, int &colROC, int &rowROC) const
static const int kDetOffset
static constexpr int NArms
MonitorElement * h2AllPlanesActive
static constexpr int RPn_first
int getRPglobalBin(int arm, int stn)
int HitsMultROC[RPotsTotalNumber *NplaneMAX][NROCsMAX]
static constexpr int NplaneMAX
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
int getRPInStationBin(int rp)
collection_type::const_iterator const_iterator
int getPlaneIndex(int arm, int station, int rp, int plane)
MonitorElement * h2xyHits[RPotsTotalNumber][NplaneMAX]
MonitorElement * hRPotActivPlanes[RPotsTotalNumber]
int RPstatus[StationIDMAX][RPotsIDMAX]
MonitorElement * hBXshort
bool isPlanePlotsTurnedOff[NArms][NStationMAX][NRPotsMAX][NplaneMAX]
MonitorElement * h2HitsMultipl[NArms][NStationMAX]
uint16_t *__restrict__ uint16_t const *__restrict__ adc
static constexpr float mapYmin