141 static constexpr
int stationBinOrder[
NStationMAX] = {0, 4, 1};
142 return (
arm * 2 + stationBinOrder[stn] + 1);
165 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
166 rpStatusWord(ps.getUntrackedParameter<unsigned
int>(
"RPStatusWord", 0x8008)) {
173 vector<string> disabledPlanePlotsVec =
178 for (
auto s : disabledPlanePlotsVec) {
180 if (
count(
s.begin(),
s.end(),
'_') != 3)
181 throw cms::Exception(
"RPixPlaneCombinatoryTracking") <<
"Invalid string in turnOffPlanePlots: " <<
s;
183 vector<string> armStationRpPlane;
185 while ((
pos =
s.find(
'_')) != string::npos) {
186 armStationRpPlane.push_back(
s.substr(0,
pos));
189 armStationRpPlane.push_back(
s);
191 int arm = stoi(armStationRpPlane.at(0));
192 int station = stoi(armStationRpPlane.at(1));
193 int rp = stoi(armStationRpPlane.at(2));
194 int plane = stoi(armStationRpPlane.at(3));
199 <<
"Shutting off plots for: Arm " <<
arm <<
" Station " <<
station <<
" Rp " << rp <<
" Plane " << plane;
202 throw cms::Exception(
"RPixPlaneCombinatoryTracking") <<
"Invalid string in turnOffPlanePlots: " <<
s;
232 rpSts = (rpSts >> 1);
240 for (
int ind = 0; ind < 2 * 3 *
NRPotsMAX; ind++)
253 string armTitleShort, stnTitleShort;
255 TAxis *yah1st =
nullptr;
256 TAxis *xaRPact =
nullptr;
257 TAxis *xah1trk =
nullptr;
259 hBX = ibooker.
book1D(
"events per BX",
"ctpps_pixel;Event.BX", 4002, -1.5, 4000. + 0.5);
260 hBXshort = ibooker.
book1D(
"events per BX(short)",
"ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
262 string str1st =
"Pixel planes activity";
266 h1st->SetOption(
"colz");
267 yah1st = h1st->GetYaxis();
269 string str2 =
"Pixel RP active";
277 str2 =
"Pixel Local Tracks";
299 string stnd, stnTitle;
312 string rpBinName = armTitleShort +
"_" + stnTitleShort +
"_" + rpTitle;
328 const float x0Maximum = 70.;
329 const float y0Maximum = 15.;
330 string st =
"track intercept point";
331 string st2 =
": " + stnTitle;
333 st, st + st2 +
";x0;y0",
int(x0Maximum) * 2, 0., x0Maximum,
int(y0Maximum) * 4, -y0Maximum, y0Maximum);
336 st =
"number of tracks per event";
338 rpTitle +
";number of tracks",
348 rpTitle +
";nPlanes;Probability",
358 rpTitle +
";LumiSection;Plane#___ROC#",
373 sprintf(
s,
"plane%d_0",
p);
376 sprintf(
s,
" %d_%d",
p,
r);
382 string st3 =
";PlaneIndex(=pixelPot*PlaneMAX + plane)";
384 st =
"hit multiplicity in planes";
389 st =
"cluster size in planes";
391 st + st2 + st3 +
";Cluster size",
400 st =
"number of hits per track";
401 htrackHits[indexP] = ibooker.
bookProfile(st, rpTitle +
";number of hits", 5, 1.5, 6.5, -0.1, 1.1,
"");
405 rpTitle +
";plane # ;ROC #",
420 ibooker.
book1D(
"5 fired planes per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
423 ibooker.
book1D(
"4 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
425 ibooker.
book1D(
"3 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
427 ibooker.
book1D(
"2 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
429 hRPotActivBXall[indexP] = ibooker.
book1D(
"hits per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
436 sprintf(
s,
"plane_%d",
p);
437 string pd = rpd +
"/" +
string(
s);
439 string st1 =
": " + rpTitle +
"_" +
string(
s);
441 st =
"adc average value";
443 st1 +
";pix col;pix row",
456 st =
"hits position";
458 st1 +
";pix col;pix row",
467 st =
"hits multiplicity";
473 st =
"plane efficiency";
475 st, st1 +
";x0;y0",
mapXbins,
mapXmin,
mapXmax,
mapYbins,
mapYmin,
mapYmax, 0, 1,
"");
491 int lumiId =
event.getLuminosityBlock().id().luminosityBlock();
499 RPactivity[rp] = RPdigiSize[rp] = pixRPTracks[rp] = 0;
527 for (
const auto &ds_tr : *pixTrack) {
528 int idet =
getDet(ds_tr.id);
531 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_tr.id" << ds_tr.id;
535 int arm = theId.
arm() & 0x1;
537 int rpot = theId.
rp() & 0x7;
541 ++pixRPTracks[rpInd];
551 float x0 = dit->x0();
552 float y0 = dit->y0();
567 std::map<int, int> numberOfPointPerPlaneEff;
568 for (
const auto &ds_frh : fittedHits) {
573 if (frh_it != ds_frh.begin())
575 LogPrint(
"CTPPSPixelDQMSource") <<
"More than one FittedRecHit found in plane " << plane;
576 if (frh_it->isRealHit())
579 numberOfPointPerPlaneEff[
p]++;
585 for (
auto planeAndHitsOnOthers : numberOfPointPerPlaneEff) {
587 <<
"For plane " << planeAndHitsOnOthers.first <<
", " << planeAndHitsOnOthers.second
588 <<
" hits on other planes were found" << endl;
591 for (
const auto &ds_frh : fittedHits) {
597 float frhX0 = frh_it->globalCoordinates().x() + frh_it->xResidual();
598 float frhY0 = frh_it->globalCoordinates().y() + frh_it->yResidual();
599 if (numberOfPointPerPlaneEff[plane] >= 3) {
600 if (frh_it->isRealHit())
617 LogPrint(
"CTPPSPixelDQMSource") <<
"No valid data in Event " <<
nEvents;
620 for (
const auto &ds_digi : *pixDigi) {
621 int idet =
getDet(ds_digi.id);
624 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_digi.id" << ds_digi.id;
632 int arm = theId.
arm() & 0x1;
634 int rpot = theId.
rp() & 0x7;
636 RPactivity[rpInd] = 1;
647 int nh = ds_digi.data.size();
657 int row = dit->row();
658 int col = dit->column();
659 int adc = dit->adc();
670 if (trocId >= 0 && trocId <
NROCsMAX) {
681 for (
const auto &ds : *pixClus) {
684 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: cluster.id" << ds.id;
690 int arm = theId.
arm() & 0x1;
692 int rpot = theId.
rp() & 0x7;
697 for (
const auto &
p : ds) {
698 int clusize =
p.size();
707 bool allRPactivity =
false;
709 if (RPactivity[rp] > 0)
710 allRPactivity =
true;
725 int ntr = pixRPTracks[
index];
753 planesFiredAtROC[
r] = 0;
758 ++planesFiredAtROC[
r];
767 if (
max < planesFiredAtROC[
r])
768 max = planesFiredAtROC[
r];
int StationStatus[StationIDMAX]
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
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())
virtual TProfile * getTProfile() const
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)
MonitorElement * htrackMult[RPotsTotalNumber]
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
MonitorElement * h2trackXY0[RPotsTotalNumber]
MonitorElement * hpixLTrack
static constexpr int NRPotBinsInStation
MonitorElement * hRPotActivBXroc_3[RPotsTotalNumber]
static constexpr int RPn_last
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
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * htrackHits[RPotsTotalNumber]
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenTrack
virtual TH2F * getTH2F() 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
#define DEFINE_FWK_MODULE(type)
static constexpr int ClusterSizeMax
int transformToROC(const int col, const int row, int &rocId, int &colROC, int &rowROC) const
int getRPindex(int arm, int station, int rp)
Log< level::Warning, true > LogPrint
MonitorElement * hRPotActivBXroc_2[RPotsTotalNumber]
MonitorElement * hRPotActivBXroc[RPotsTotalNumber]
MonitorElement * h2xyROCHits[RPotsTotalNumber *NplaneMAX][NROCsMAX]
unsigned int rpStatusWord
MonitorElement * hRPotActivBXall[RPotsTotalNumber]
constexpr int defaultDetSizeInX
static constexpr int NRPglobalBins
static constexpr int StationIDMAX
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
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.
static const int kDetOffset
static constexpr int NArms
MonitorElement * h2AllPlanesActive
static constexpr int RPn_first
virtual TProfile2D * getTProfile2D() const
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
virtual TH2D * getTH2D() const