190 static constexpr
int stationBinOrder[
NStationMAX] = {0, 4, 1};
191 return (
arm * 2 + stationBinOrder[stn] + 1);
214 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
216 rpStatusWord(ps.getUntrackedParameter<unsigned
int>(
"RPStatusWord", 0x8008)) {
225 vector<string> disabledPlanePlotsVec =
229 for (
auto s : disabledPlanePlotsVec) {
231 if (
count(
s.begin(),
s.end(),
'_') != 3)
232 throw cms::Exception(
"RPixPlaneCombinatoryTracking") <<
"Invalid string in turnOffPlanePlots: " <<
s;
234 vector<string> armStationRpPlane;
236 while ((
pos =
s.find(
'_')) != string::npos) {
237 armStationRpPlane.push_back(
s.substr(0,
pos));
240 armStationRpPlane.push_back(
s);
242 int arm = stoi(armStationRpPlane.at(0));
243 int station = stoi(armStationRpPlane.at(1));
244 int rp = stoi(armStationRpPlane.at(2));
245 int plane = stoi(armStationRpPlane.at(3));
250 <<
"Shutting off plots for: Arm " <<
arm <<
" Station " <<
station <<
" Rp " << rp <<
" Plane " << plane;
253 throw cms::Exception(
"RPixPlaneCombinatoryTracking") <<
"Invalid string in turnOffPlanePlots: " <<
s;
283 rpSts = (rpSts >> 1);
291 for (
int ind = 0; ind < 2 * 3 *
NRPotsMAX; ind++)
304 string armTitleShort, stnTitleShort;
306 TAxis *yah1st =
nullptr;
307 TAxis *xaRPact =
nullptr;
308 TAxis *xah1trk =
nullptr;
310 hBX = ibooker.
book1D(
"events per BX",
"ctpps_pixel;Event.BX", 4002, -1.5, 4000. + 0.5);
311 hBXshort = ibooker.
book1D(
"events per BX(short)",
"ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
313 string str1st =
"Pixel planes activity";
317 h1st->SetOption(
"colz");
318 yah1st = h1st->GetYaxis();
320 string str2 =
"Pixel RP active";
328 str2 =
"Pixel Local Tracks";
336 const float minErrCode = 25.;
344 "Event number mismatch",
345 "Invalid/no FED header",
346 "Invalid/no FED trailer",
348 "Conversion: inv. channel",
349 "Conversion: inv. ROC number",
350 "Conversion: inv. pixel address",
355 const string tbmMessage[8] = {
"Stack full ",
357 "Clear trigger counter",
359 "Synch trigger error",
364 const string tbmType[5] = {
365 "All bits 0",
"bit 8 : Overflow",
"bit 9 : PKAM",
"bit 10 : Auto Reset",
"bit 11 : Number of ROC Error"};
368 "Errors in Unidentified Det;;fed",
375 for (
unsigned int iBin = 1; iBin <=
errCodeSize; iBin++)
381 ibooker.
book2D(
"TBM Message Unid Det",
"TBM Message Unid Det;;fed", 8, -0.5, 7.5, 2, 1461.5, 1463.5);
382 for (
unsigned int iBin = 1; iBin <= 8; iBin++)
387 ibooker.
book2D(
"TBM Type in Unid Det",
"TBM Type in Unid Det;;fed", 5, -0.5, 4.5, 2, 1461.5, 1463.5);
388 for (
unsigned int iBin = 1; iBin <= 5; iBin++)
392 h2FullType = ibooker.
book2D(
"Full FIFO",
"Full FIFO;;fed", 7, 0.5, 7.5, 2, 1461.5, 1463.5);
402 "Errors in FED" + s_fed +
";;channel",
409 for (
unsigned int iBin = 1; iBin <=
errCodeSize; iBin++)
414 "TBM Message in FED" + s_fed,
"TBM Message in FED" + s_fed +
";;channel", 8, -0.5, 7.5, 37, -0.5, 36.5);
415 for (
unsigned int iBin = 1; iBin <= 8; iBin++)
420 "TBM Type in FED" + s_fed,
"TBM Type in FED" + s_fed +
";;channel", 5, -0.5, 4.5, 37, -0.5, 36.5);
421 for (
unsigned int iBin = 1; iBin <= 5; iBin++)
422 h2TBMTypeFED[iFed]->setBinLabel(iBin, tbmType[iBin - 1]);
439 string stnd, stnTitle;
452 string rpBinName = armTitleShort +
"_" + stnTitleShort +
"_" + rpTitle;
468 const float x0Maximum = 70.;
469 const float y0Maximum = 15.;
470 string st =
"track intercept point";
471 string st2 =
": " + stnTitle;
473 st, st + st2 +
";x0;y0",
int(x0Maximum) * 2, 0., x0Maximum,
int(y0Maximum) * 4, -y0Maximum, y0Maximum);
477 st + st2 +
";;plane",
484 for (
unsigned int iBin = 1; iBin <=
errCodeSize; iBin++)
488 h2TBMMessageRP[indexP] = ibooker.
book2D(
"TBM Message",
"TBM Message;;plane", 8, -0.5, 7.5, 6, -0.5, 5.5);
489 for (
unsigned int iBin = 1; iBin <= 8; iBin++)
493 h2TBMTypeRP[indexP] = ibooker.
book2D(
"TBM Type",
"TBM Type;;plane", 5, -0.5, 4.5, 6, -0.5, 5.5);
494 for (
unsigned int iBin = 1; iBin <= 5; iBin++)
495 h2TBMTypeRP[indexP]->setBinLabel(iBin, tbmType[iBin - 1]);
498 st =
"number of tracks per event";
500 rpTitle +
";number of tracks",
510 rpTitle +
";nPlanes;Probability",
520 rpTitle +
";LumiSection;Plane#___ROC#",
535 sprintf(
s,
"plane%d_0",
p);
538 sprintf(
s,
" %d_%d",
p,
r);
545 "Hits per plane per BX - random triggers", rpTitle +
";Event.BX;Plane", 4002, -1.5, 4000. + 0.5, 6, 0, 6);
548 string st3 =
";PlaneIndex(=pixelPot*PlaneMAX + plane)";
550 st =
"hit multiplicity in planes";
555 st =
"cluster size in planes";
557 st + st2 + st3 +
";Cluster size",
566 st =
"number of hits per track";
567 htrackHits[indexP] = ibooker.
bookProfile(st, rpTitle +
";number of hits", 5, 1.5, 6.5, -0.1, 1.1,
"");
571 rpTitle +
";plane # ;ROC #",
586 ibooker.
book1D(
"5 fired planes per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
589 ibooker.
book1D(
"4 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
591 ibooker.
book1D(
"3 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
593 ibooker.
book1D(
"2 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
595 hRPotActivBXall[indexP] = ibooker.
book1D(
"hits per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
602 sprintf(
s,
"plane_%d",
p);
603 string pd = rpd +
"/" +
string(
s);
605 string st1 =
": " + rpTitle +
"_" +
string(
s);
607 st =
"adc average value";
609 st1 +
";pix col;pix row",
622 st =
"hits position";
624 st1 +
";pix col;pix row",
633 st =
"hits multiplicity";
639 st =
"plane efficiency";
641 st, st1 +
";x0;y0",
mapXbins,
mapXmin,
mapXmax,
mapYbins,
mapYmin,
mapYmax, 0, 1,
"");
657 int lumiId =
event.getLuminosityBlock().id().luminosityBlock();
665 RPactivity[rp] = RPdigiSize[rp] = pixRPTracks[rp] = 0;
699 for (
const auto &ds_tr : *pixTrack) {
700 int idet =
getDet(ds_tr.id);
703 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_tr.id" << ds_tr.id;
707 int arm = theId.
arm() & 0x1;
709 int rpot = theId.
rp() & 0x7;
713 ++pixRPTracks[rpInd];
723 float x0 = dit->x0();
724 float y0 = dit->y0();
739 std::map<int, int> numberOfPointPerPlaneEff;
740 for (
const auto &ds_frh : fittedHits) {
745 if (frh_it != ds_frh.begin())
747 LogPrint(
"CTPPSPixelDQMSource") <<
"More than one FittedRecHit found in plane " << plane;
748 if (frh_it->isRealHit())
751 numberOfPointPerPlaneEff[
p]++;
757 for (
auto planeAndHitsOnOthers : numberOfPointPerPlaneEff) {
759 <<
"For plane " << planeAndHitsOnOthers.first <<
", " << planeAndHitsOnOthers.second
760 <<
" hits on other planes were found" << endl;
763 for (
const auto &ds_frh : fittedHits) {
769 float frhX0 = frh_it->globalCoordinates().x() + frh_it->xResidual();
770 float frhY0 = frh_it->globalCoordinates().y() + frh_it->yResidual();
771 if (numberOfPointPerPlaneEff[plane] >= 3) {
772 if (frh_it->isRealHit())
789 LogPrint(
"CTPPSPixelDQMSource") <<
"No valid data in Event " <<
nEvents;
792 for (
const auto &ds_digi : *pixDigi) {
793 int idet =
getDet(ds_digi.id);
796 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_digi.id" << ds_digi.id;
804 int arm = theId.
arm() & 0x1;
806 int rpot = theId.
rp() & 0x7;
808 RPactivity[rpInd] = 1;
819 int nh = ds_digi.data.size();
829 int row = dit->row();
830 int col = dit->column();
831 int adc = dit->adc();
842 if (trocId >= 0 && trocId <
NROCsMAX) {
853 for (
const auto &ds_error : *pixError) {
854 int idet =
getDet(ds_error.id);
862 if (dit->errorType() == 32 || dit->errorType() == 33 || dit->errorType() == 34) {
863 long long errorWord = dit->errorWord64();
866 uint32_t errorWord = dit->errorWord32();
869 bool fillFED =
false;
874 if (dit->errorType() == 28) {
876 uint32_t errorWord = dit->errorWord32();
913 if (dit->errorType() == 30) {
914 uint32_t errorWord = dit->errorWord32();
963 int stateMach_bits = 4;
964 int stateMach_shift = 8;
965 uint32_t stateMach_mask = ~(~uint32_t(0) << stateMach_bits);
966 uint32_t stateMach = (errorWord >> stateMach_shift) & stateMach_mask;
967 if (stateMach == 0) {
1000 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_error.id" << ds_error.id;
1006 int arm = theId.
arm() & 0x1;
1008 int rpot = theId.
rp() & 0x7;
1010 RPactivity[rpInd] = 1;
1021 if (dit->errorType() == 32 || dit->errorType() == 33 || dit->errorType() == 34) {
1022 long long errorWord = dit->errorWord64();
1025 uint32_t errorWord = dit->errorWord32();
1028 bool fillFED =
false;
1032 if (dit->errorType() == 28) {
1034 uint32_t errorWord = dit->errorWord32();
1072 if (dit->errorType() == 30) {
1073 uint32_t errorWord = dit->errorWord32();
1122 int stateMach_bits = 4;
1123 int stateMach_shift = 8;
1124 uint32_t stateMach_mask = ~(~uint32_t(0) << stateMach_bits);
1125 uint32_t stateMach = (errorWord >> stateMach_shift) & stateMach_mask;
1126 if (stateMach == 0) {
1163 for (
const auto &ds : *pixClus) {
1164 int idet =
getDet(ds.id);
1166 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: cluster.id" << ds.id;
1172 int arm = theId.
arm() & 0x1;
1174 int rpot = theId.
rp() & 0x7;
1179 for (
const auto &
p : ds) {
1180 int clusize =
p.size();
1189 bool allRPactivity =
false;
1191 if (RPactivity[rp] > 0)
1192 allRPactivity =
true;
1195 for (
int rp = 0; rp <
NRPotsMAX; rp++) {
1207 int ntr = pixRPTracks[
index];
1245 planesFiredAtROC[
r] = 0;
1250 ++planesFiredAtROC[
r];
1259 if (
max < planesFiredAtROC[
r])
1260 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)
static constexpr int DB2_shift
static constexpr int LINK_bits
MonitorElement * htrackMult[RPotsTotalNumber]
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
MonitorElement * h2trackXY0[RPotsTotalNumber]
MonitorElement * hpixLTrack
std::string randomHLTPath
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
std::string to_string(const V &value)
static constexpr int NPlaneBins
static constexpr int DB3_shift
MonitorElement * h2TBMMessageFED[2]
static constexpr uint32_t DataBit_mask
static constexpr int DataBit_bits
CTPPSPixelIndices thePixIndices
MonitorElement * h2HitsVsBXRandoms[RPotsTotalNumber]
static constexpr int RPotsTotalNumber
static constexpr int mapXbins
static constexpr float mapYmax
static constexpr int DCOL_shift
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * h2TBMMessageUnidDet
MonitorElement * htrackHits[RPotsTotalNumber]
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenTrack
virtual TH2F * getTH2F() const
static constexpr int DB6_shift
MonitorElement * h2TBMTypeUnidDet
static constexpr int ROC_bits
int prIndex(int rp, int plane)
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
static constexpr int ROC_shift
int RPindexValid[RPotsTotalNumber]
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * h2Efficiency[RPotsTotalNumber][NplaneMAX]
MonitorElement * hROCadc[RPotsTotalNumber *NplaneMAX][NROCsMAX]
static constexpr int minFedNumber
CTPPSPixelDQMSource(const edm::ParameterSet &ps)
static constexpr int ADC_bits
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 * hRPotActivBX[RPotsTotalNumber]
MonitorElement * h2ErrorCodeFED[2]
static constexpr int NLocalTracksMAX
static constexpr int PXID_shift
#define DEFINE_FWK_MODULE(type)
static constexpr int numberOfFeds
static constexpr int DB0_shift
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]
static constexpr int DB7_shift
MonitorElement * h2xyROCHits[RPotsTotalNumber *NplaneMAX][NROCsMAX]
static const char *const trigNames[]
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 uint32_t DCOL_mask
static constexpr int DB5_shift
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
static constexpr uint32_t LINK_mask
static constexpr int PXID_bits
static constexpr uint32_t PXID_mask
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 constexpr int DB1_shift
MonitorElement * h2FullType
static const int kDetOffset
MonitorElement * h2ErrorCodeUnidDet
static constexpr int NArms
MonitorElement * h2TBMTypeFED[2]
MonitorElement * h2AllPlanesActive
static constexpr int RPn_first
virtual TProfile2D * getTProfile2D() const
static constexpr int DB4_shift
int getRPglobalBin(int arm, int stn)
int HitsMultROC[RPotsTotalNumber *NplaneMAX][NROCsMAX]
MonitorElement * h2TBMMessageRP[RPotsTotalNumber]
static constexpr uint32_t ADC_mask
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]
static constexpr int LINK_shift
int RPstatus[StationIDMAX][RPotsIDMAX]
static constexpr int ADC_shift
MonitorElement * hBXshort
static constexpr uint32_t ROC_mask
bool isPlanePlotsTurnedOff[NArms][NStationMAX][NRPotsMAX][NplaneMAX]
MonitorElement * h2HitsMultipl[NArms][NStationMAX]
uint16_t *__restrict__ uint16_t const *__restrict__ adc
MonitorElement * h2TBMTypeRP[RPotsTotalNumber]
edm::EDGetTokenT< edm::TriggerResults > tokenTrigResults
static constexpr float mapYmin
static constexpr int DCOL_bits
virtual TH2D * getTH2D() const