147 static constexpr
int stationBinOrder[
NStationMAX] = {0, 4, 1};
148 return (
arm * 2 + stationBinOrder[stn] + 1);
171 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
172 rpStatusWord(ps.getUntrackedParameter<unsigned
int>(
"RPStatusWord", 0x8008)) {
180 vector<string> disabledPlanePlotsVec =
185 for (
auto s : disabledPlanePlotsVec) {
187 if (
count(
s.begin(),
s.end(),
'_') != 3)
188 throw cms::Exception(
"RPixPlaneCombinatoryTracking") <<
"Invalid string in turnOffPlanePlots: " <<
s;
190 vector<string> armStationRpPlane;
192 while ((
pos =
s.find(
'_')) != string::npos) {
193 armStationRpPlane.push_back(
s.substr(0,
pos));
196 armStationRpPlane.push_back(
s);
198 int arm = stoi(armStationRpPlane.at(0));
199 int station = stoi(armStationRpPlane.at(1));
200 int rp = stoi(armStationRpPlane.at(2));
201 int plane = stoi(armStationRpPlane.at(3));
206 <<
"Shutting off plots for: Arm " <<
arm <<
" Station " <<
station <<
" Rp " << rp <<
" Plane " << plane;
209 throw cms::Exception(
"RPixPlaneCombinatoryTracking") <<
"Invalid string in turnOffPlanePlots: " <<
s;
239 rpSts = (rpSts >> 1);
247 for (
int ind = 0; ind < 2 * 3 *
NRPotsMAX; ind++)
260 string armTitleShort, stnTitleShort;
262 TAxis *yah1st =
nullptr;
263 TAxis *xaRPact =
nullptr;
264 TAxis *xah1trk =
nullptr;
266 hBX = ibooker.
book1D(
"events per BX",
"ctpps_pixel;Event.BX", 4002, -1.5, 4000. + 0.5);
267 hBXshort = ibooker.
book1D(
"events per BX(short)",
"ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
269 string str1st =
"Pixel planes activity";
273 h1st->SetOption(
"colz");
274 yah1st = h1st->GetYaxis();
276 string str2 =
"Pixel RP active";
284 str2 =
"Pixel Local Tracks";
292 const float minErrCode = 25.;
300 "Event number mismatch",
301 "Invalid/no FED header",
302 "Invalid/no FED trailer",
304 "Conversion: inv. channel",
305 "Conversion: inv. ROC number",
306 "Conversion: inv. pixel address",
311 "Errors in Unidentified Det;;fed",
318 for (
unsigned int iBin = 1; iBin <=
errCodeSize; iBin++)
337 string stnd, stnTitle;
350 string rpBinName = armTitleShort +
"_" + stnTitleShort +
"_" + rpTitle;
366 const float x0Maximum = 70.;
367 const float y0Maximum = 15.;
368 string st =
"track intercept point";
369 string st2 =
": " + stnTitle;
371 st, st + st2 +
";x0;y0",
int(x0Maximum) * 2, 0., x0Maximum,
int(y0Maximum) * 4, -y0Maximum, y0Maximum);
375 st + st2 +
";;plane",
382 for (
unsigned int iBin = 1; iBin <=
errCodeSize; iBin++)
386 st =
"number of tracks per event";
388 rpTitle +
";number of tracks",
398 rpTitle +
";nPlanes;Probability",
408 rpTitle +
";LumiSection;Plane#___ROC#",
423 sprintf(
s,
"plane%d_0",
p);
426 sprintf(
s,
" %d_%d",
p,
r);
432 string st3 =
";PlaneIndex(=pixelPot*PlaneMAX + plane)";
434 st =
"hit multiplicity in planes";
439 st =
"cluster size in planes";
441 st + st2 + st3 +
";Cluster size",
450 st =
"number of hits per track";
451 htrackHits[indexP] = ibooker.
bookProfile(st, rpTitle +
";number of hits", 5, 1.5, 6.5, -0.1, 1.1,
"");
455 rpTitle +
";plane # ;ROC #",
470 ibooker.
book1D(
"5 fired planes per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
473 ibooker.
book1D(
"4 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
475 ibooker.
book1D(
"3 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
477 ibooker.
book1D(
"2 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
479 hRPotActivBXall[indexP] = ibooker.
book1D(
"hits per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
486 sprintf(
s,
"plane_%d",
p);
487 string pd = rpd +
"/" +
string(
s);
489 string st1 =
": " + rpTitle +
"_" +
string(
s);
491 st =
"adc average value";
493 st1 +
";pix col;pix row",
506 st =
"hits position";
508 st1 +
";pix col;pix row",
517 st =
"hits multiplicity";
523 st =
"plane efficiency";
525 st, st1 +
";x0;y0",
mapXbins,
mapXmin,
mapXmax,
mapYbins,
mapYmin,
mapYmax, 0, 1,
"");
541 int lumiId =
event.getLuminosityBlock().id().luminosityBlock();
549 RPactivity[rp] = RPdigiSize[rp] = pixRPTracks[rp] = 0;
580 for (
const auto &ds_tr : *pixTrack) {
581 int idet =
getDet(ds_tr.id);
584 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_tr.id" << ds_tr.id;
588 int arm = theId.
arm() & 0x1;
590 int rpot = theId.
rp() & 0x7;
594 ++pixRPTracks[rpInd];
604 float x0 = dit->x0();
605 float y0 = dit->y0();
620 std::map<int, int> numberOfPointPerPlaneEff;
621 for (
const auto &ds_frh : fittedHits) {
626 if (frh_it != ds_frh.begin())
628 LogPrint(
"CTPPSPixelDQMSource") <<
"More than one FittedRecHit found in plane " << plane;
629 if (frh_it->isRealHit())
632 numberOfPointPerPlaneEff[
p]++;
638 for (
auto planeAndHitsOnOthers : numberOfPointPerPlaneEff) {
640 <<
"For plane " << planeAndHitsOnOthers.first <<
", " << planeAndHitsOnOthers.second
641 <<
" hits on other planes were found" << endl;
644 for (
const auto &ds_frh : fittedHits) {
650 float frhX0 = frh_it->globalCoordinates().x() + frh_it->xResidual();
651 float frhY0 = frh_it->globalCoordinates().y() + frh_it->yResidual();
652 if (numberOfPointPerPlaneEff[plane] >= 3) {
653 if (frh_it->isRealHit())
670 LogPrint(
"CTPPSPixelDQMSource") <<
"No valid data in Event " <<
nEvents;
673 for (
const auto &ds_digi : *pixDigi) {
674 int idet =
getDet(ds_digi.id);
677 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_digi.id" << ds_digi.id;
685 int arm = theId.
arm() & 0x1;
687 int rpot = theId.
rp() & 0x7;
689 RPactivity[rpInd] = 1;
700 int nh = ds_digi.data.size();
710 int row = dit->row();
711 int col = dit->column();
712 int adc = dit->adc();
723 if (trocId >= 0 && trocId <
NROCsMAX) {
734 for (
const auto &ds_error : *pixError) {
735 int idet =
getDet(ds_error.id);
745 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_error.id" << ds_error.id;
751 int arm = theId.
arm() & 0x1;
753 int rpot = theId.
rp() & 0x7;
755 RPactivity[rpInd] = 1;
771 for (
const auto &ds : *pixClus) {
774 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: cluster.id" << ds.id;
780 int arm = theId.
arm() & 0x1;
782 int rpot = theId.
rp() & 0x7;
787 for (
const auto &
p : ds) {
788 int clusize =
p.size();
797 bool allRPactivity =
false;
799 if (RPactivity[rp] > 0)
800 allRPactivity =
true;
815 int ntr = pixRPTracks[
index];
843 planesFiredAtROC[
r] = 0;
848 ++planesFiredAtROC[
r];
857 if (
max < planesFiredAtROC[
r])
858 max = planesFiredAtROC[
r];
int StationStatus[StationIDMAX]
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDataError > > tokenError
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)
static constexpr int errCodeSize
MonitorElement * h2ErrorCode
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
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
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
MonitorElement * h2ErrorCodeRP[RPotsTotalNumber]
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