189 static constexpr
int stationBinOrder[
NStationMAX] = {0, 4, 1};
190 return (
arm * 2 + stationBinOrder[stn] + 1);
213 :
verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
215 rpStatusWord(ps.getUntrackedParameter<unsigned
int>(
"RPStatusWord", 0x8008)) {
224 vector<string> disabledPlanePlotsVec =
228 for (
auto s : disabledPlanePlotsVec) {
230 if (
count(
s.begin(),
s.end(),
'_') != 3)
231 throw cms::Exception(
"RPixPlaneCombinatoryTracking") <<
"Invalid string in turnOffPlanePlots: " <<
s;
233 vector<string> armStationRpPlane;
235 while ((
pos =
s.find(
'_')) != string::npos) {
236 armStationRpPlane.push_back(
s.substr(0,
pos));
239 armStationRpPlane.push_back(
s);
241 int arm = stoi(armStationRpPlane.at(0));
242 int station = stoi(armStationRpPlane.at(1));
243 int rp = stoi(armStationRpPlane.at(2));
244 int plane = stoi(armStationRpPlane.at(3));
249 <<
"Shutting off plots for: Arm " <<
arm <<
" Station " <<
station <<
" Rp " << rp <<
" Plane " << plane;
252 throw cms::Exception(
"RPixPlaneCombinatoryTracking") <<
"Invalid string in turnOffPlanePlots: " <<
s;
282 rpSts = (rpSts >> 1);
290 for (
int ind = 0; ind < 2 * 3 *
NRPotsMAX; ind++)
303 string armTitleShort, stnTitleShort;
305 TAxis *yah1st =
nullptr;
306 TAxis *xaRPact =
nullptr;
307 TAxis *xah1trk =
nullptr;
309 hBX = ibooker.
book1D(
"events per BX",
"ctpps_pixel;Event.BX", 4002, -1.5, 4000. + 0.5);
310 hBXshort = ibooker.
book1D(
"events per BX(short)",
"ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
312 string str1st =
"Pixel planes activity";
316 h1st->SetOption(
"colz");
317 yah1st = h1st->GetYaxis();
319 string str2 =
"Pixel RP active";
327 str2 =
"Pixel Local Tracks";
335 const float minErrCode = 25.;
343 "Event number mismatch",
344 "Invalid/no FED header",
345 "Invalid/no FED trailer",
347 "Conversion: inv. channel",
348 "Conversion: inv. ROC number",
349 "Conversion: inv. pixel address",
354 const string tbmMessage[8] = {
"Stack full ",
356 "Clear trigger counter",
358 "Synch trigger error",
363 const string tbmType[5] = {
364 "All bits 0",
"bit 8 : Overflow",
"bit 9 : PKAM",
"bit 10 : Auto Reset",
"bit 11 : Number of ROC Error"};
367 "Errors in Unidentified Det;;fed",
374 for (
unsigned int iBin = 1; iBin <=
errCodeSize; iBin++)
380 ibooker.
book2D(
"TBM Message Unid Det",
"TBM Message Unid Det;;fed", 8, -0.5, 7.5, 2, 1461.5, 1463.5);
381 for (
unsigned int iBin = 1; iBin <= 8; iBin++)
386 ibooker.
book2D(
"TBM Type in Unid Det",
"TBM Type in Unid Det;;fed", 5, -0.5, 4.5, 2, 1461.5, 1463.5);
387 for (
unsigned int iBin = 1; iBin <= 5; iBin++)
391 h2FullType = ibooker.
book2D(
"Full FIFO",
"Full FIFO;;fed", 7, 0.5, 7.5, 2, 1461.5, 1463.5);
401 "Errors in FED" + s_fed +
";;channel",
408 for (
unsigned int iBin = 1; iBin <=
errCodeSize; iBin++)
413 "TBM Message in FED" + s_fed,
"TBM Message in FED" + s_fed +
";;channel", 8, -0.5, 7.5, 37, -0.5, 36.5);
414 for (
unsigned int iBin = 1; iBin <= 8; iBin++)
419 "TBM Type in FED" + s_fed,
"TBM Type in FED" + s_fed +
";;channel", 5, -0.5, 4.5, 37, -0.5, 36.5);
420 for (
unsigned int iBin = 1; iBin <= 5; iBin++)
421 h2TBMTypeFED[iFed]->setBinLabel(iBin, tbmType[iBin - 1]);
438 string stnd, stnTitle;
451 string rpBinName = armTitleShort +
"_" + stnTitleShort +
"_" + rpTitle;
467 const float x0Maximum = 70.;
468 const float y0Maximum = 15.;
469 string st =
"track intercept point";
470 string st2 =
": " + stnTitle;
472 st, st + st2 +
";x0;y0",
int(x0Maximum) * 2, 0., x0Maximum,
int(y0Maximum) * 4, -y0Maximum, y0Maximum);
476 st + st2 +
";;plane",
483 for (
unsigned int iBin = 1; iBin <=
errCodeSize; iBin++)
487 h2TBMMessageRP[indexP] = ibooker.
book2D(
"TBM Message",
"TBM Message;;plane", 8, -0.5, 7.5, 6, -0.5, 5.5);
488 for (
unsigned int iBin = 1; iBin <= 8; iBin++)
492 h2TBMTypeRP[indexP] = ibooker.
book2D(
"TBM Type",
"TBM Type;;plane", 5, -0.5, 4.5, 6, -0.5, 5.5);
493 for (
unsigned int iBin = 1; iBin <= 5; iBin++)
494 h2TBMTypeRP[indexP]->setBinLabel(iBin, tbmType[iBin - 1]);
497 st =
"number of tracks per event";
499 rpTitle +
";number of tracks",
509 rpTitle +
";nPlanes;Probability",
519 rpTitle +
";LumiSection;Plane#___ROC#",
534 sprintf(
s,
"plane%d_0",
p);
537 sprintf(
s,
" %d_%d",
p,
r);
544 "Hits per plane per BX - random triggers", rpTitle +
";Event.BX;Plane", 4002, -1.5, 4000. + 0.5, 6, 0, 6);
547 string st3 =
";PlaneIndex(=pixelPot*PlaneMAX + plane)";
549 st =
"hit multiplicity in planes";
554 st =
"cluster size in planes";
556 st + st2 + st3 +
";Cluster size",
565 st =
"number of hits per track";
566 htrackHits[indexP] = ibooker.
bookProfile(st, rpTitle +
";number of hits", 5, 1.5, 6.5, -0.1, 1.1,
"");
570 rpTitle +
";plane # ;ROC #",
585 ibooker.
book1D(
"5 fired planes per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
588 ibooker.
book1D(
"4 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
590 ibooker.
book1D(
"3 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
592 ibooker.
book1D(
"2 fired ROCs per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
594 hRPotActivBXall[indexP] = ibooker.
book1D(
"hits per BX", rpTitle +
";Event.BX", 4002, -1.5, 4000. + 0.5);
601 sprintf(
s,
"plane_%d",
p);
602 string pd = rpd +
"/" +
string(
s);
604 string st1 =
": " + rpTitle +
"_" +
string(
s);
606 st =
"adc average value";
608 st1 +
";pix col;pix row",
621 st =
"hits position";
623 st1 +
";pix col;pix row",
632 st =
"hits multiplicity";
638 st =
"plane efficiency";
640 st, st1 +
";x0;y0",
mapXbins,
mapXmin,
mapXmax,
mapYbins,
mapYmin,
mapYmax, 0, 1,
"");
656 int lumiId =
event.getLuminosityBlock().id().luminosityBlock();
664 RPactivity[rp] = RPdigiSize[rp] = pixRPTracks[rp] = 0;
698 for (
const auto &ds_tr : *pixTrack) {
699 int idet =
getDet(ds_tr.id);
702 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_tr.id" << ds_tr.id;
706 int arm = theId.
arm() & 0x1;
708 int rpot = theId.
rp() & 0x7;
712 ++pixRPTracks[rpInd];
722 float x0 = dit->x0();
723 float y0 = dit->y0();
738 std::map<int, int> numberOfPointPerPlaneEff;
739 for (
const auto &ds_frh : fittedHits) {
744 if (frh_it != ds_frh.begin())
746 LogPrint(
"CTPPSPixelDQMSource") <<
"More than one FittedRecHit found in plane " << plane;
747 if (frh_it->isRealHit())
750 numberOfPointPerPlaneEff[
p]++;
756 for (
auto planeAndHitsOnOthers : numberOfPointPerPlaneEff) {
758 <<
"For plane " << planeAndHitsOnOthers.first <<
", " << planeAndHitsOnOthers.second
759 <<
" hits on other planes were found" << endl;
762 for (
const auto &ds_frh : fittedHits) {
768 float frhX0 = frh_it->globalCoordinates().x() + frh_it->xResidual();
769 float frhY0 = frh_it->globalCoordinates().y() + frh_it->yResidual();
770 if (numberOfPointPerPlaneEff[plane] >= 3) {
771 if (frh_it->isRealHit())
788 LogPrint(
"CTPPSPixelDQMSource") <<
"No valid data in Event " <<
nEvents;
791 for (
const auto &ds_digi : *pixDigi) {
792 int idet =
getDet(ds_digi.id);
795 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_digi.id" << ds_digi.id;
803 int arm = theId.
arm() & 0x1;
805 int rpot = theId.
rp() & 0x7;
807 RPactivity[rpInd] = 1;
818 int nh = ds_digi.data.size();
828 int row = dit->row();
829 int col = dit->column();
830 int adc = dit->adc();
841 if (trocId >= 0 && trocId <
NROCsMAX) {
852 for (
const auto &ds_error : *pixError) {
853 int idet =
getDet(ds_error.id);
861 if (dit->errorType() == 32 || dit->errorType() == 33 || dit->errorType() == 34) {
862 long long errorWord = dit->errorWord64();
865 uint32_t errorWord = dit->errorWord32();
868 bool fillFED =
false;
873 if (dit->errorType() == 28) {
875 uint32_t errorWord = dit->errorWord32();
912 if (dit->errorType() == 30) {
913 uint32_t errorWord = dit->errorWord32();
962 int stateMach_bits = 4;
963 int stateMach_shift = 8;
964 uint32_t stateMach_mask = ~(~uint32_t(0) << stateMach_bits);
965 uint32_t stateMach = (errorWord >> stateMach_shift) & stateMach_mask;
966 if (stateMach == 0) {
999 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_error.id" << ds_error.id;
1005 int arm = theId.
arm() & 0x1;
1007 int rpot = theId.
rp() & 0x7;
1009 RPactivity[rpInd] = 1;
1020 if (dit->errorType() == 32 || dit->errorType() == 33 || dit->errorType() == 34) {
1021 long long errorWord = dit->errorWord64();
1024 uint32_t errorWord = dit->errorWord32();
1027 bool fillFED =
false;
1031 if (dit->errorType() == 28) {
1033 uint32_t errorWord = dit->errorWord32();
1071 if (dit->errorType() == 30) {
1072 uint32_t errorWord = dit->errorWord32();
1121 int stateMach_bits = 4;
1122 int stateMach_shift = 8;
1123 uint32_t stateMach_mask = ~(~uint32_t(0) << stateMach_bits);
1124 uint32_t stateMach = (errorWord >> stateMach_shift) & stateMach_mask;
1125 if (stateMach == 0) {
1162 for (
const auto &ds : *pixClus) {
1163 int idet =
getDet(ds.id);
1165 LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: cluster.id" << ds.id;
1171 int arm = theId.
arm() & 0x1;
1173 int rpot = theId.
rp() & 0x7;
1178 for (
const auto &
p : ds) {
1179 int clusize =
p.size();
1188 bool allRPactivity =
false;
1190 if (RPactivity[rp] > 0)
1191 allRPactivity =
true;
1194 for (
int rp = 0; rp <
NRPotsMAX; rp++) {
1206 int ntr = pixRPTracks[
index];
1244 planesFiredAtROC[
r] = 0;
1249 ++planesFiredAtROC[
r];
1258 if (
max < planesFiredAtROC[
r])
1259 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