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#",
366 ROCSizeInX *ROCSizeInY,
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 #",
413 ROCSizeInX * ROCSizeInY,
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);
431 int nbins = defaultDetSizeInX / pixBinW;
436 sprintf(
s,
"plane_%d",
p);
437 string pd = rpd +
"/" +
string(
s);
439 string st1 =
": " + rpTitle +
"_" +
string(
s);
441 st =
"adc average value";
443 st, st1 +
";pix col;pix row",
nbins, 0, defaultDetSizeInX,
nbins, 0, defaultDetSizeInX, 0., 512.,
"");
447 st =
"hits position";
449 st1 +
";pix col;pix row",
458 st =
"hits multiplicity";
464 st =
"plane efficiency";
466 st, st1 +
";x0;y0",
mapXbins,
mapXmin,
mapXmax,
mapYbins,
mapYmin,
mapYmax, 0, 1,
"");
482 int lumiId =
event.getLuminosityBlock().id().luminosityBlock();
490 RPactivity[rp] = RPdigiSize[rp] = pixRPTracks[rp] = 0;
518 for (
const auto &ds_tr : *pixTrack) {
519 int idet =
getDet(ds_tr.id);
522 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_tr.id" << ds_tr.id;
526 int arm = theId.
arm() & 0x1;
528 int rpot = theId.
rp() & 0x7;
532 ++pixRPTracks[rpInd];
542 float x0 = dit->x0();
543 float y0 = dit->y0();
558 std::map<int, int> numberOfPointPerPlaneEff;
559 for (
const auto &ds_frh : fittedHits) {
564 if (frh_it != ds_frh.begin())
566 LogPrint(
"CTPPSPixelDQMSource") <<
"More than one FittedRecHit found in plane " << plane;
567 if (frh_it->isRealHit())
570 numberOfPointPerPlaneEff[
p]++;
576 for (
auto planeAndHitsOnOthers : numberOfPointPerPlaneEff) {
578 <<
"For plane " << planeAndHitsOnOthers.first <<
", " << planeAndHitsOnOthers.second
579 <<
" hits on other planes were found" << endl;
582 for (
const auto &ds_frh : fittedHits) {
588 float frhX0 = frh_it->globalCoordinates().x() + frh_it->xResidual();
589 float frhY0 = frh_it->globalCoordinates().y() + frh_it->yResidual();
590 if (numberOfPointPerPlaneEff[plane] >= 3) {
591 if (frh_it->isRealHit())
608 LogPrint(
"CTPPSPixelDQMSource") <<
"No valid data in Event " <<
nEvents;
611 for (
const auto &ds_digi : *pixDigi) {
612 int idet =
getDet(ds_digi.id);
615 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_digi.id" << ds_digi.id;
623 int arm = theId.
arm() & 0x1;
625 int rpot = theId.
rp() & 0x7;
627 RPactivity[rpInd] = 1;
638 int nh = ds_digi.data.size();
648 int row = dit->row();
649 int col = dit->column();
650 int adc = dit->adc();
661 if (trocId >= 0 && trocId <
NROCsMAX) {
672 for (
const auto &ds : *pixClus) {
675 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: cluster.id" << ds.id;
681 int arm = theId.
arm() & 0x1;
683 int rpot = theId.
rp() & 0x7;
688 for (
const auto &
p : ds) {
689 int clusize =
p.size();
698 bool allRPactivity =
false;
700 if (RPactivity[rp] > 0)
701 allRPactivity =
true;
716 int ntr = pixRPTracks[
index];
744 planesFiredAtROC[
r] = 0;
749 ++planesFiredAtROC[
r];
758 if (
max < planesFiredAtROC[
r])
759 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
T getParameter(std::string const &) const
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)
#define DEFINE_FWK_MODULE(type)
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
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]
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