CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CTPPSPixelDQMSource Class Reference
Inheritance diagram for CTPPSPixelDQMSource:

Public Member Functions

 CTPPSPixelDQMSource (const edm::ParameterSet &ps)
 
 ~CTPPSPixelDQMSource () override
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 

Private Member Functions

int getDet (int id)
 
int getPixPlane (int id)
 
int getPlaneIndex (int arm, int station, int rp, int plane)
 
int getRPglobalBin (int arm, int stn)
 
int getRPindex (int arm, int station, int rp)
 
int getRPInStationBin (int rp)
 
int prIndex (int rp, int plane)
 

Private Attributes

MonitorElementh2AllPlanesActive
 
MonitorElementh2CluSize [NArms][NStationMAX]
 
MonitorElementh2Efficiency [RPotsTotalNumber][NplaneMAX]
 
MonitorElementh2ErrorCode
 
MonitorElementh2ErrorCodeRP [RPotsTotalNumber]
 
MonitorElementh2HitsMultipl [NArms][NStationMAX]
 
MonitorElementh2HitsMultROC [RPotsTotalNumber]
 
MonitorElementh2trackXY0 [RPotsTotalNumber]
 
MonitorElementh2xyHits [RPotsTotalNumber][NplaneMAX]
 
MonitorElementh2xyROCHits [RPotsTotalNumber *NplaneMAX][NROCsMAX]
 
MonitorElementhBX
 
MonitorElementhBXshort
 
MonitorElementhHitsMult [RPotsTotalNumber][NplaneMAX]
 
int HitsMultPlane [RPotsTotalNumber][NplaneMAX]
 
int HitsMultROC [RPotsTotalNumber *NplaneMAX][NROCsMAX]
 
MonitorElementhp2HitsMultROC_LS [RPotsTotalNumber]
 
MonitorElementhp2xyADC [RPotsTotalNumber][NplaneMAX]
 
MonitorElementhpixLTrack
 
MonitorElementhpRPactive
 
MonitorElementhROCadc [RPotsTotalNumber *NplaneMAX][NROCsMAX]
 
MonitorElementhRPotActivBX [RPotsTotalNumber]
 
MonitorElementhRPotActivBXall [RPotsTotalNumber]
 
MonitorElementhRPotActivBXroc [RPotsTotalNumber]
 
MonitorElementhRPotActivBXroc_2 [RPotsTotalNumber]
 
MonitorElementhRPotActivBXroc_3 [RPotsTotalNumber]
 
MonitorElementhRPotActivPlanes [RPotsTotalNumber]
 
MonitorElementhtrackHits [RPotsTotalNumber]
 
MonitorElementhtrackMult [RPotsTotalNumber]
 
const int IndexNotValid = 0
 
bool isPlanePlotsTurnedOff [NArms][NStationMAX][NRPotsMAX][NplaneMAX] = {}
 
const float mapXmax = 30. * TMath::Cos(18.4 / 180. * TMath::Pi())
 
const float mapXmin = 0. * TMath::Cos(18.4 / 180. * TMath::Pi())
 
long int nEvents = 0
 
bool offlinePlots = true
 
bool onlinePlots = true
 
int RPindexValid [RPotsTotalNumber]
 
int RPstatus [StationIDMAX][RPotsIDMAX]
 
unsigned int rpStatusWord = 0x8008
 
int StationStatus [StationIDMAX]
 
CTPPSPixelIndices thePixIndices
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCluster
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDataError > > tokenError
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenTrack
 
int TrackFitDimension = 4
 
unsigned int verbosity
 
float x0_MAX
 
float x0_MIN
 
float y0_MAX
 
float y0_MIN
 

Static Private Attributes

static constexpr int ADCMax = 256
 
static constexpr int ClusMultMAX = 10
 
static constexpr int ClusterSizeMax = 9
 
static constexpr int errCodeSize = 15
 
static constexpr int hitMultMAX = 50
 
static constexpr int mapXbins = 200
 
static constexpr int mapYbins = 240
 
static constexpr float mapYmax = 8.
 
static constexpr float mapYmin = -16.
 
static constexpr int NArms = 2
 
static constexpr int NLocalTracksMAX = 20
 
static constexpr int NPlaneBins = NplaneMAX * NRPotBinsInStation
 
static constexpr int NplaneMAX = 6
 
static constexpr int NROCsMAX = 6
 
static constexpr int NRPglobalBins = 4
 
static constexpr int NRPotBinsInStation = RPn_last - RPn_first
 
static constexpr int NRPotsMAX = 6
 
static constexpr int NStationMAX = 3
 
static constexpr int RPn_first = 3
 
static constexpr int RPn_last = 4
 
static constexpr int RPotsIDMAX = 8
 
static constexpr int RPotsTotalNumber = NArms * NStationMAX * NRPotsMAX
 
static constexpr int StationIDMAX = 4
 

Detailed Description

Definition at line 33 of file CTPPSPixelDQMSource.cc.

Constructor & Destructor Documentation

◆ CTPPSPixelDQMSource()

CTPPSPixelDQMSource::CTPPSPixelDQMSource ( const edm::ParameterSet ps)

Definition at line 170 of file CTPPSPixelDQMSource.cc.

References protons_cff::arm, submitPVResolutionJobs::count, Exception, edm::ParameterSet::getUntrackedParameter(), isPlanePlotsTurnedOff, NArms, NplaneMAX, NRPotsMAX, NStationMAX, offlinePlots, onlinePlots, alignCSCRings::s, relativeConstraints::station, tokenCluster, tokenDigi, tokenError, tokenTrack, and verbosity.

171  : verbosity(ps.getUntrackedParameter<unsigned int>("verbosity", 0)),
172  rpStatusWord(ps.getUntrackedParameter<unsigned int>("RPStatusWord", 0x8008)) {
173  tokenDigi = consumes<DetSetVector<CTPPSPixelDigi>>(ps.getUntrackedParameter<edm::InputTag>("tagRPixDigi"));
174  tokenError = consumes<DetSetVector<CTPPSPixelDataError>>(ps.getUntrackedParameter<edm::InputTag>("tagRPixError"));
175  tokenCluster = consumes<DetSetVector<CTPPSPixelCluster>>(ps.getUntrackedParameter<edm::InputTag>("tagRPixCluster"));
176  tokenTrack = consumes<DetSetVector<CTPPSPixelLocalTrack>>(ps.getUntrackedParameter<edm::InputTag>("tagRPixLTrack"));
177  offlinePlots = ps.getUntrackedParameter<bool>("offlinePlots", true);
178  onlinePlots = ps.getUntrackedParameter<bool>("onlinePlots", true);
179 
180  vector<string> disabledPlanePlotsVec =
181  ps.getUntrackedParameter<vector<string>>("turnOffPlanePlots", vector<string>());
182 
183  // Parse the strings in disabledPlanePlotsVec and set the flags in
184  // isPlanePlotsTurnedOff
185  for (auto s : disabledPlanePlotsVec) {
186  // Check that the format is <arm>_<station>_<RP>_<Plane>
187  if (count(s.begin(), s.end(), '_') != 3)
188  throw cms::Exception("RPixPlaneCombinatoryTracking") << "Invalid string in turnOffPlanePlots: " << s;
189  else {
190  vector<string> armStationRpPlane;
191  size_t pos = 0;
192  while ((pos = s.find('_')) != string::npos) {
193  armStationRpPlane.push_back(s.substr(0, pos));
194  s.erase(0, pos + 1);
195  }
196  armStationRpPlane.push_back(s);
197 
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));
202 
203  if (arm < NArms && station < NStationMAX && rp < NRPotsMAX && plane < NplaneMAX) {
204  if (verbosity)
205  LogPrint("CTPPSPixelDQMSource")
206  << "Shutting off plots for: Arm " << arm << " Station " << station << " Rp " << rp << " Plane " << plane;
207  isPlanePlotsTurnedOff[arm][station][rp][plane] = true;
208  } else {
209  throw cms::Exception("RPixPlaneCombinatoryTracking") << "Invalid string in turnOffPlanePlots: " << s;
210  }
211  }
212  }
213 }
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDataError > > tokenError
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCluster
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
static constexpr int NRPotsMAX
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenTrack
Log< level::Warning, true > LogPrint
static constexpr int NStationMAX
static constexpr int NArms
static constexpr int NplaneMAX
bool isPlanePlotsTurnedOff[NArms][NStationMAX][NRPotsMAX][NplaneMAX]

◆ ~CTPPSPixelDQMSource()

CTPPSPixelDQMSource::~CTPPSPixelDQMSource ( )
override

Definition at line 217 of file CTPPSPixelDQMSource.cc.

217 {}

Member Function Documentation

◆ analyze()

void CTPPSPixelDQMSource::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 539 of file CTPPSPixelDQMSource.cc.

References gpuClustering::adc, protons_cff::arm, CTPPSDetId::arm(), ClusterSizeMax, cuy::col, dqm::impl::MonitorElement::Fill(), HcalObjRepresent::Fill(), dqmMemoryStats::float, getDet(), getPixPlane(), getPlaneIndex(), getRPglobalBin(), getRPindex(), h2AllPlanesActive, h2CluSize, h2Efficiency, h2ErrorCode, h2ErrorCodeRP, h2HitsMultipl, h2HitsMultROC, h2trackXY0, h2xyHits, hBX, hBXshort, hHitsMult, hitMultMAX, HitsMultPlane, HitsMultROC, hp2HitsMultROC_LS, hp2xyADC, hpixLTrack, hpRPactive, hRPotActivBX, hRPotActivBXall, hRPotActivBXroc, hRPotActivBXroc_2, hRPotActivBXroc_3, hRPotActivPlanes, htrackHits, htrackMult, mps_fire::i, isPlanePlotsTurnedOff, edm::HandleBase::isValid(), SiStripPI::max, nEvents, cms::cuda::nh, NLocalTracksMAX, np, NplaneMAX, NROCsMAX, NRPotsMAX, NStationMAX, offlinePlots, onlinePlots, AlCaHLTBitMon_ParallelJobs::p, prIndex(), alignCSCRings::r, PixelMapPlotter::roc, CTPPSDetId::rp(), RPindexValid, RPotsTotalNumber, RPstatus, CTPPSDetId::station(), relativeConstraints::station, StationStatus, thePixIndices, tokenCluster, tokenDigi, tokenError, tokenTrack, TrackFitDimension, CTPPSPixelIndices::transformToROC(), validateGeometry_cfg::valid, verbosity, DetId::VeryForward, x0_MAX, x0_MIN, y0_MAX, and y0_MIN.

539  {
540  ++nEvents;
541  int lumiId = event.getLuminosityBlock().id().luminosityBlock();
542  if (lumiId < 0)
543  lumiId = 0;
544 
545  int RPactivity[RPotsTotalNumber], RPdigiSize[RPotsTotalNumber];
546  int pixRPTracks[RPotsTotalNumber];
547 
548  for (int rp = 0; rp < RPotsTotalNumber; rp++) {
549  RPactivity[rp] = RPdigiSize[rp] = pixRPTracks[rp] = 0;
550  }
551 
552  for (int ind = 0; ind < RPotsTotalNumber; ind++) {
553  for (int p = 0; p < NplaneMAX; p++) {
554  HitsMultPlane[ind][p] = 0;
555  }
556  }
557  for (int ind = 0; ind < RPotsTotalNumber * NplaneMAX; ind++) {
558  for (int roc = 0; roc < NROCsMAX; roc++) {
559  HitsMultROC[ind][roc] = 0;
560  }
561  }
563  event.getByToken(tokenDigi, pixDigi);
564 
566  event.getByToken(tokenError, pixError);
567 
569  event.getByToken(tokenCluster, pixClus);
570 
572  event.getByToken(tokenTrack, pixTrack);
573 
574  if (onlinePlots) {
575  hBX->Fill(event.bunchCrossing());
576  hBXshort->Fill(event.bunchCrossing());
577  }
578 
579  if (pixTrack.isValid()) {
580  for (const auto &ds_tr : *pixTrack) {
581  int idet = getDet(ds_tr.id);
582  if (idet != DetId::VeryForward) {
583  if (verbosity > 1)
584  LogPrint("CTPPSPixelDQMSource") << "not CTPPS: ds_tr.id" << ds_tr.id;
585  continue;
586  }
587  CTPPSDetId theId(ds_tr.id);
588  int arm = theId.arm() & 0x1;
589  int station = theId.station() & 0x3;
590  int rpot = theId.rp() & 0x7;
591  int rpInd = getRPindex(arm, station, rpot);
592 
593  for (DetSet<CTPPSPixelLocalTrack>::const_iterator dit = ds_tr.begin(); dit != ds_tr.end(); ++dit) {
594  ++pixRPTracks[rpInd];
595  int nh_tr = (dit->ndf() + TrackFitDimension) / 2;
596  if (onlinePlots) {
597  for (int i = 0; i <= NplaneMAX; i++) {
598  if (i == nh_tr)
599  htrackHits[rpInd]->Fill(nh_tr, 1.);
600  else
601  htrackHits[rpInd]->Fill(i, 0.);
602  }
603  }
604  float x0 = dit->x0();
605  float y0 = dit->y0();
606  h2trackXY0[rpInd]->Fill(x0, y0);
607 
608  if (x0_MAX < x0)
609  x0_MAX = x0;
610  if (y0_MAX < y0)
611  y0_MAX = y0;
612  if (x0_MIN > x0)
613  x0_MIN = x0;
614  if (y0_MIN > y0)
615  y0_MIN = y0;
616 
617  if (offlinePlots) {
618  edm::DetSetVector<CTPPSPixelFittedRecHit> fittedHits = dit->hits();
619 
620  std::map<int, int> numberOfPointPerPlaneEff;
621  for (const auto &ds_frh : fittedHits) {
622  int plane = getPixPlane(ds_frh.id);
623  for (DetSet<CTPPSPixelFittedRecHit>::const_iterator frh_it = ds_frh.begin(); frh_it != ds_frh.end();
624  ++frh_it) { // there should always be only one hit in each
625  // vector
626  if (frh_it != ds_frh.begin())
627  if (verbosity > 1)
628  LogPrint("CTPPSPixelDQMSource") << "More than one FittedRecHit found in plane " << plane;
629  if (frh_it->isRealHit())
630  for (int p = 0; p < NplaneMAX; p++) {
631  if (p != plane)
632  numberOfPointPerPlaneEff[p]++;
633  }
634  }
635  }
636 
637  if (verbosity > 1)
638  for (auto planeAndHitsOnOthers : numberOfPointPerPlaneEff) {
639  LogPrint("CTPPSPixelDQMSource")
640  << "For plane " << planeAndHitsOnOthers.first << ", " << planeAndHitsOnOthers.second
641  << " hits on other planes were found" << endl;
642  }
643 
644  for (const auto &ds_frh : fittedHits) {
645  int plane = getPixPlane(ds_frh.id);
646  if (isPlanePlotsTurnedOff[arm][station][rpot][plane])
647  continue;
648  for (DetSet<CTPPSPixelFittedRecHit>::const_iterator frh_it = ds_frh.begin(); frh_it != ds_frh.end();
649  ++frh_it) {
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())
654  h2Efficiency[rpInd][plane]->Fill(frhX0, frhY0, 1);
655  else
656  h2Efficiency[rpInd][plane]->Fill(frhX0, frhY0, 0);
657  }
658  }
659  }
660  }
661  }
662  }
663  } // end if(pixTrack.isValid())
664 
665  bool valid = false;
666  valid |= pixDigi.isValid();
667  // valid |= Clus.isValid();
668 
669  if (!valid && verbosity)
670  LogPrint("CTPPSPixelDQMSource") << "No valid data in Event " << nEvents;
671 
672  if (pixDigi.isValid()) {
673  for (const auto &ds_digi : *pixDigi) {
674  int idet = getDet(ds_digi.id);
675  if (idet != DetId::VeryForward) {
676  if (verbosity > 1)
677  LogPrint("CTPPSPixelDQMSource") << "not CTPPS: ds_digi.id" << ds_digi.id;
678  continue;
679  }
680  // int subdet = getSubdet(ds_digi.id);
681 
682  int plane = getPixPlane(ds_digi.id);
683 
684  CTPPSDetId theId(ds_digi.id);
685  int arm = theId.arm() & 0x1;
686  int station = theId.station() & 0x3;
687  int rpot = theId.rp() & 0x7;
688  int rpInd = getRPindex(arm, station, rpot);
689  RPactivity[rpInd] = 1;
690  ++RPdigiSize[rpInd];
691 
692  if (StationStatus[station] && RPstatus[station][rpot]) {
693  if (onlinePlots) {
694  h2HitsMultipl[arm][station]->Fill(prIndex(rpot, plane), ds_digi.data.size());
696  }
697  int index = getRPindex(arm, station, rpot);
698  HitsMultPlane[index][plane] += ds_digi.data.size();
699  if (RPindexValid[index]) {
700  int nh = ds_digi.data.size();
701  if (nh > hitMultMAX)
702  nh = hitMultMAX;
703  if (!isPlanePlotsTurnedOff[arm][station][rpot][plane])
704  if (onlinePlots)
705  hHitsMult[index][plane]->Fill(nh);
706  }
707  int rocHistIndex = getPlaneIndex(arm, station, rpot, plane);
708 
709  for (DetSet<CTPPSPixelDigi>::const_iterator dit = ds_digi.begin(); dit != ds_digi.end(); ++dit) {
710  int row = dit->row();
711  int col = dit->column();
712  int adc = dit->adc();
713 
714  if (RPindexValid[index]) {
715  if (!isPlanePlotsTurnedOff[arm][station][rpot][plane]) {
716  if (onlinePlots)
717  h2xyHits[index][plane]->Fill(col, row);
718  hp2xyADC[index][plane]->Fill(col, row, adc);
719  }
720  int colROC, rowROC;
721  int trocId;
722  if (!thePixIndices.transformToROC(col, row, trocId, colROC, rowROC)) {
723  if (trocId >= 0 && trocId < NROCsMAX) {
724  ++HitsMultROC[rocHistIndex][trocId];
725  }
726  }
727  } // end if(RPindexValid[index]) {
728  }
729  } // end if(StationStatus[station]) {
730  } // end for(const auto &ds_digi : *pixDigi)
731  } // if(pixDigi.isValid()) {
732 
733  if (pixError.isValid()) {
734  for (const auto &ds_error : *pixError) {
735  int idet = getDet(ds_error.id);
736  if (idet != DetId::VeryForward) {
737  if (idet == 15) { //dummy det id: store in a plot with fed info
738 
739  for (DetSet<CTPPSPixelDataError>::const_iterator dit = ds_error.begin(); dit != ds_error.end(); ++dit) {
740  h2ErrorCode->Fill(dit->errorType(), dit->fedId());
741  }
742  continue;
743  }
744  if (verbosity > 1)
745  LogPrint("CTPPSPixelDQMSource") << "not CTPPS: ds_error.id" << ds_error.id;
746  continue;
747  }
748 
749  int plane = getPixPlane(ds_error.id);
750  CTPPSDetId theId(ds_error.id);
751  int arm = theId.arm() & 0x1;
752  int station = theId.station() & 0x3;
753  int rpot = theId.rp() & 0x7;
754  int rpInd = getRPindex(arm, station, rpot);
755  RPactivity[rpInd] = 1;
756 
757  if (StationStatus[station] && RPstatus[station][rpot]) {
758  int index = getRPindex(arm, station, rpot);
759  for (DetSet<CTPPSPixelDataError>::const_iterator dit = ds_error.begin(); dit != ds_error.end(); ++dit) {
760  if (RPindexValid[index]) {
761  if (!isPlanePlotsTurnedOff[arm][station][rpot][plane]) {
762  h2ErrorCodeRP[index]->Fill(dit->errorType(), plane);
763  }
764  } // end if(RPindexValid[index]) {
765  }
766  } // end if(StationStatus[station]) {
767  } // end for(const auto &ds_error : *pixDigi)
768  } // if(pixError.isValid())
769 
770  if (pixClus.isValid() && onlinePlots)
771  for (const auto &ds : *pixClus) {
772  int idet = getDet(ds.id);
773  if (idet != DetId::VeryForward && verbosity > 1) {
774  LogPrint("CTPPSPixelDQMSource") << "not CTPPS: cluster.id" << ds.id;
775  continue;
776  }
777 
778  CTPPSDetId theId(ds.id);
779  int plane = getPixPlane(ds.id);
780  int arm = theId.arm() & 0x1;
781  int station = theId.station() & 0x3;
782  int rpot = theId.rp() & 0x7;
783 
784  if ((StationStatus[station] == 0) || (RPstatus[station][rpot] == 0))
785  continue;
786 
787  for (const auto &p : ds) {
788  int clusize = p.size();
789 
790  if (clusize > ClusterSizeMax)
791  clusize = ClusterSizeMax;
792 
793  h2CluSize[arm][station]->Fill(prIndex(rpot, plane), clusize);
794  }
795  } // end if(pixClus.isValid()) for(const auto &ds : *pixClus)
796 
797  bool allRPactivity = false;
798  for (int rp = 0; rp < RPotsTotalNumber; rp++)
799  if (RPactivity[rp] > 0)
800  allRPactivity = true;
801  for (int arm = 0; arm < 2; arm++) {
802  for (int stn = 0; stn < NStationMAX; stn++) {
803  for (int rp = 0; rp < NRPotsMAX; rp++) {
804  int index = getRPindex(arm, stn, rp);
805  if (RPindexValid[index] == 0)
806  continue;
807 
808  if (onlinePlots)
809  hpRPactive->Fill(getRPglobalBin(arm, stn), RPactivity[index]);
810  // if(RPactivity[index]==0) continue;
811  if (!allRPactivity)
812  continue;
813  if (onlinePlots)
814  hpixLTrack->Fill(getRPglobalBin(arm, stn), pixRPTracks[index]);
815  int ntr = pixRPTracks[index];
816  if (ntr > NLocalTracksMAX)
817  ntr = NLocalTracksMAX;
818  for (int i = 0; i <= NLocalTracksMAX; i++) {
819  if (i == ntr)
820  htrackMult[index]->Fill(ntr, 1.);
821  else
822  htrackMult[index]->Fill(i, 0.);
823  }
824 
825  int np = 0;
826  for (int p = 0; p < NplaneMAX; p++)
827  if (HitsMultPlane[index][p] > 0)
828  np++;
829  for (int p = 0; p <= NplaneMAX; p++) {
830  if (p == np)
831  hRPotActivPlanes[index]->Fill(p, 1.);
832  else
833  hRPotActivPlanes[index]->Fill(p, 0.);
834  }
835  if (onlinePlots) {
836  if (np >= 5)
837  hRPotActivBX[index]->Fill(event.bunchCrossing());
838  hRPotActivBXall[index]->Fill(event.bunchCrossing(), float(RPdigiSize[index]));
839  }
840 
841  int planesFiredAtROC[NROCsMAX]; // how many planes registered hits on ROC r
842  for (int r = 0; r < NROCsMAX; r++)
843  planesFiredAtROC[r] = 0;
844  for (int p = 0; p < NplaneMAX; p++) {
845  int indp = getPlaneIndex(arm, stn, rp, p);
846  for (int r = 0; r < NROCsMAX; r++)
847  if (HitsMultROC[indp][r] > 0)
848  ++planesFiredAtROC[r];
849  for (int r = 0; r < NROCsMAX; r++) {
850  if (onlinePlots)
851  h2HitsMultROC[index]->Fill(p, r, HitsMultROC[indp][r]);
852  hp2HitsMultROC_LS[index]->Fill(lumiId, p * NROCsMAX + r, HitsMultROC[indp][r]);
853  }
854  }
855  int max = 0;
856  for (int r = 0; r < NROCsMAX; r++)
857  if (max < planesFiredAtROC[r])
858  max = planesFiredAtROC[r];
859  if (max >= 4 && onlinePlots) // fill only if there are at least 4 aligned ROCs firing
860  hRPotActivBXroc[index]->Fill(event.bunchCrossing());
861  if (max >= 3 && onlinePlots) // fill only if there are at least 3 aligned ROCs firing
862  hRPotActivBXroc_3[index]->Fill(event.bunchCrossing());
863  if (max >= 2 && onlinePlots) // fill only if there are at least 2 aligned ROCs firing
864  hRPotActivBXroc_2[index]->Fill(event.bunchCrossing());
865  } // end for(int rp=0; rp<NRPotsMAX; rp++) {
866  }
867  } // end for(int arm=0; arm<2; arm++) {
868 
869  if ((nEvents % 100))
870  return;
871  if (verbosity)
872  LogPrint("CTPPSPixelDQMSource") << "analyze event " << nEvents;
873 }
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]
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCluster
MonitorElement * h2CluSize[NArms][NStationMAX]
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
MonitorElement * htrackMult[RPotsTotalNumber]
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
MonitorElement * h2trackXY0[RPotsTotalNumber]
MonitorElement * hpixLTrack
MonitorElement * hRPotActivBXroc_3[RPotsTotalNumber]
static constexpr int hitMultMAX
static constexpr int NRPotsMAX
CTPPSPixelIndices thePixIndices
static constexpr int RPotsTotalNumber
void Fill(long long x)
MonitorElement * htrackHits[RPotsTotalNumber]
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenTrack
int prIndex(int rp, int plane)
int RPindexValid[RPotsTotalNumber]
MonitorElement * h2Efficiency[RPotsTotalNumber][NplaneMAX]
int np
Definition: AMPTWrapper.h:43
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * h2ErrorCode
MonitorElement * hRPotActivBX[RPotsTotalNumber]
static constexpr int NLocalTracksMAX
static constexpr int ClusterSizeMax
uint32_t nh
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 * hRPotActivBXall[RPotsTotalNumber]
MonitorElement * h2ErrorCodeRP[RPotsTotalNumber]
static constexpr int NStationMAX
static constexpr int NROCsMAX
bool isValid() const
Definition: HandleBase.h:70
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
col
Definition: cuy.py:1009
MonitorElement * h2AllPlanesActive
int getRPglobalBin(int arm, int stn)
int HitsMultROC[RPotsTotalNumber *NplaneMAX][NROCsMAX]
static constexpr int NplaneMAX
collection_type::const_iterator const_iterator
Definition: DetSet.h:31
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]
Definition: event.py:1
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ bookHistograms()

void CTPPSPixelDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 256 of file CTPPSPixelDQMSource.cc.

References protons_cff::arm, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book1DD(), dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::book2DD(), dqm::implementation::IBooker::bookProfile(), dqm::implementation::IBooker::bookProfile2D(), dqm::implementation::NavigatorBase::cd(), ClusterSizeMax, rpixValues::defaultDetSizeInX, MillePedeFileConverter_cfg::e, errCodeSize, getRPglobalBin(), getRPindex(), dqm::legacy::MonitorElement::getTH2D(), dqm::legacy::MonitorElement::getTH2F(), dqm::legacy::MonitorElement::getTProfile(), dqm::legacy::MonitorElement::getTProfile2D(), h2AllPlanesActive, h2CluSize, h2Efficiency, h2ErrorCode, h2ErrorCodeRP, h2HitsMultipl, h2HitsMultROC, h2trackXY0, h2xyHits, hBX, hBXshort, hHitsMult, hitMultMAX, hp2HitsMultROC_LS, hp2xyADC, hpixLTrack, hpRPactive, hRPotActivBX, hRPotActivBXall, hRPotActivBXroc, hRPotActivBXroc_2, hRPotActivBXroc_3, hRPotActivPlanes, htrackHits, htrackMult, isPlanePlotsTurnedOff, mapXbins, mapXmax, mapXmin, mapYbins, mapYmax, mapYmin, LaserClient_cfi::nbins, CTPPSDetId::nFull, NLocalTracksMAX, CTPPSDetId::nPath, NPlaneBins, NplaneMAX, NROCsMAX, NRPglobalBins, CTPPSDetId::nShort, NStationMAX, offlinePlots, onlinePlots, AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::r, rpixValues::ROCSizeInX, rpixValues::ROCSizeInY, RPindexValid, RPn_first, RPn_last, RPstatus, alignCSCRings::s, CTPPSDetId::sdTrackingPixel, dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), StationStatus, and AlCaHLTBitMon_QueryRunRegistry::string.

256  {
257  ibooker.cd();
258  ibooker.setCurrentFolder("CTPPS/TrackingPixel");
259  char s[50];
260  string armTitleShort, stnTitleShort;
261 
262  TAxis *yah1st = nullptr;
263  TAxis *xaRPact = nullptr;
264  TAxis *xah1trk = nullptr;
265  if (onlinePlots) {
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);
268 
269  string str1st = "Pixel planes activity";
270  h2AllPlanesActive = ibooker.book2DD(
271  str1st, str1st + "(digi task);Plane #", NplaneMAX, 0, NplaneMAX, NRPglobalBins, 0.5, NRPglobalBins + 0.5);
272  TH2D *h1st = h2AllPlanesActive->getTH2D();
273  h1st->SetOption("colz");
274  yah1st = h1st->GetYaxis();
275 
276  string str2 = "Pixel RP active";
277  hpRPactive = ibooker.bookProfile(
278  str2, str2 + " per event(digi task)", NRPglobalBins, 0.5, NRPglobalBins + 0.5, -0.1, 1.1, "");
279  xaRPact = hpRPactive->getTProfile()->GetXaxis();
280  hpRPactive->getTProfile()->SetOption("hist");
281  hpRPactive->getTProfile()->SetMinimum(0.);
282  hpRPactive->getTProfile()->SetMaximum(1.1);
283 
284  str2 = "Pixel Local Tracks";
285  hpixLTrack = ibooker.bookProfile(
286  str2, str2 + " per event", NRPglobalBins, 0.5, NRPglobalBins + 0.5, -0.1, NLocalTracksMAX, "");
287 
288  xah1trk = hpixLTrack->getTProfile()->GetXaxis();
289  hpixLTrack->getTProfile()->GetYaxis()->SetTitle("average number of tracks per event");
290  hpixLTrack->getTProfile()->SetOption("hist");
291  }
292  const float minErrCode = 25.;
293  const string errCode[errCodeSize] = {
294  "Invalid ROC ", // error 25
295  "Gap word", // error 26
296  "Dummy word", // error 27
297  "FIFO nearly full", // error 28
298  "Channel Timeout", // error 29
299  "TBM Trailer", // error 30
300  "Event number mismatch", // error 31
301  "Invalid/no FED header", // error 32
302  "Invalid/no FED trailer", // error 33
303  "Size mismatch", // error 34
304  "Conversion: inv. channel", // error 35
305  "Conversion: inv. ROC number", // error 36
306  "Conversion: inv. pixel address", // error 37
307  "-",
308  "CRC" //error 39
309  };
310  h2ErrorCode = ibooker.book2D("Errors in Unidentified Det",
311  "Errors in Unidentified Det;;fed",
312  errCodeSize,
313  minErrCode - 0.5,
314  minErrCode + float(errCodeSize) - 0.5,
315  2,
316  1461.5,
317  1463.5);
318  for (unsigned int iBin = 1; iBin <= errCodeSize; iBin++)
319  h2ErrorCode->setBinLabel(iBin, errCode[iBin - 1]);
320  h2ErrorCode->setBinLabel(1, "1462", 2);
321  h2ErrorCode->setBinLabel(2, "1463", 2);
322  h2ErrorCode->getTH2F()->SetOption("colz");
323 
324  for (int arm = 0; arm < 2; arm++) {
326  string sd, armTitle;
327  ID.armName(sd, CTPPSDetId::nPath);
328  ID.armName(armTitle, CTPPSDetId::nFull);
329  ID.armName(armTitleShort, CTPPSDetId::nShort);
330 
331  ibooker.setCurrentFolder(sd);
332 
333  for (int stn = 0; stn < NStationMAX; stn++) {
334  if (StationStatus[stn] == 0)
335  continue;
336  ID.setStation(stn);
337  string stnd, stnTitle;
338 
339  CTPPSDetId(ID.stationId()).stationName(stnd, CTPPSDetId::nPath);
340  CTPPSDetId(ID.stationId()).stationName(stnTitle, CTPPSDetId::nFull);
341  CTPPSDetId(ID.stationId()).stationName(stnTitleShort, CTPPSDetId::nShort);
342 
343  ibooker.setCurrentFolder(stnd);
344  //--------- RPots ---
345  int pixBinW = 4;
346  for (int rp = RPn_first; rp < RPn_last; rp++) { // only installed pixel pots
347  ID.setRP(rp);
348  string rpd, rpTitle;
349  CTPPSDetId(ID.rpId()).rpName(rpTitle, CTPPSDetId::nShort);
350  string rpBinName = armTitleShort + "_" + stnTitleShort + "_" + rpTitle;
351  if (onlinePlots) {
352  yah1st->SetBinLabel(getRPglobalBin(arm, stn), rpBinName.c_str());
353  xah1trk->SetBinLabel(getRPglobalBin(arm, stn), rpBinName.c_str());
354  xaRPact->SetBinLabel(getRPglobalBin(arm, stn), rpBinName.c_str());
355  }
356  if (RPstatus[stn][rp] == 0)
357  continue;
358  int indexP = getRPindex(arm, stn, rp);
359  RPindexValid[indexP] = 1;
360 
361  CTPPSDetId(ID.rpId()).rpName(rpTitle, CTPPSDetId::nFull);
362  CTPPSDetId(ID.rpId()).rpName(rpd, CTPPSDetId::nPath);
363 
364  ibooker.setCurrentFolder(rpd);
365 
366  const float x0Maximum = 70.;
367  const float y0Maximum = 15.;
368  string st = "track intercept point";
369  string st2 = ": " + stnTitle;
370  h2trackXY0[indexP] = ibooker.book2D(
371  st, st + st2 + ";x0;y0", int(x0Maximum) * 2, 0., x0Maximum, int(y0Maximum) * 4, -y0Maximum, y0Maximum);
372  h2trackXY0[indexP]->getTH2F()->SetOption("colz");
373  st = "Error Code";
374  h2ErrorCodeRP[indexP] = ibooker.book2D(st,
375  st + st2 + ";;plane",
376  errCodeSize,
377  minErrCode - 0.5,
378  minErrCode + float(errCodeSize) - 0.5,
379  6,
380  -0.5,
381  5.5);
382  for (unsigned int iBin = 1; iBin <= errCodeSize; iBin++)
383  h2ErrorCodeRP[indexP]->setBinLabel(iBin, errCode[iBin - 1]);
384  h2ErrorCodeRP[indexP]->getTH2F()->SetOption("colz");
385 
386  st = "number of tracks per event";
387  htrackMult[indexP] = ibooker.bookProfile(st,
388  rpTitle + ";number of tracks",
389  NLocalTracksMAX + 1,
390  -0.5,
391  NLocalTracksMAX + 0.5,
392  -0.5,
393  NLocalTracksMAX + 0.5,
394  "");
395  htrackMult[indexP]->getTProfile()->SetOption("hist");
396 
397  hRPotActivPlanes[indexP] = ibooker.bookProfile("number of fired planes per event",
398  rpTitle + ";nPlanes;Probability",
399  NplaneMAX + 1,
400  -0.5,
401  NplaneMAX + 0.5,
402  -0.5,
403  NplaneMAX + 0.5,
404  "");
405  hRPotActivPlanes[indexP]->getTProfile()->SetOption("hist");
406 
407  hp2HitsMultROC_LS[indexP] = ibooker.bookProfile2D("ROCs hits multiplicity per event vs LS",
408  rpTitle + ";LumiSection;Plane#___ROC#",
409  1000,
410  0.,
411  1000.,
413  0.,
414  double(NplaneMAX * NROCsMAX),
415  0.,
417  "");
418  hp2HitsMultROC_LS[indexP]->getTProfile2D()->SetOption("colz");
419  hp2HitsMultROC_LS[indexP]->getTProfile2D()->SetMinimum(1.0e-10);
420  hp2HitsMultROC_LS[indexP]->getTProfile2D()->SetCanExtend(TProfile2D::kXaxis);
421  TAxis *yahp2 = hp2HitsMultROC_LS[indexP]->getTProfile2D()->GetYaxis();
422  for (int p = 0; p < NplaneMAX; p++) {
423  sprintf(s, "plane%d_0", p);
424  yahp2->SetBinLabel(p * NplaneMAX + 1, s);
425  for (int r = 1; r < NROCsMAX; r++) {
426  sprintf(s, " %d_%d", p, r);
427  yahp2->SetBinLabel(p * NplaneMAX + r + 1, s);
428  }
429  }
430 
431  if (onlinePlots) {
432  string st3 = ";PlaneIndex(=pixelPot*PlaneMAX + plane)";
433 
434  st = "hit multiplicity in planes";
435  h2HitsMultipl[arm][stn] = ibooker.book2DD(
436  st, st + st2 + st3 + ";multiplicity", NPlaneBins, 0, NPlaneBins, hitMultMAX, 0, hitMultMAX);
437  h2HitsMultipl[arm][stn]->getTH2D()->SetOption("colz");
438 
439  st = "cluster size in planes";
440  h2CluSize[arm][stn] = ibooker.book2D(st,
441  st + st2 + st3 + ";Cluster size",
442  NPlaneBins,
443  0,
444  NPlaneBins,
445  ClusterSizeMax + 1,
446  0,
447  ClusterSizeMax + 1);
448  h2CluSize[arm][stn]->getTH2F()->SetOption("colz");
449 
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, "");
452  htrackHits[indexP]->getTProfile()->SetOption("hist");
453 
454  h2HitsMultROC[indexP] = ibooker.bookProfile2D("ROCs hits multiplicity per event",
455  rpTitle + ";plane # ;ROC #",
456  NplaneMAX,
457  -0.5,
458  NplaneMAX - 0.5,
459  NROCsMAX,
460  -0.5,
461  NROCsMAX - 0.5,
462  0.,
464  "");
465  h2HitsMultROC[indexP]->getTProfile2D()->SetOption("colztext");
466  h2HitsMultROC[indexP]->getTProfile2D()->SetMinimum(1.e-10);
467 
468  ibooker.setCurrentFolder(rpd + "/latency");
469  hRPotActivBX[indexP] =
470  ibooker.book1D("5 fired planes per BX", rpTitle + ";Event.BX", 4002, -1.5, 4000. + 0.5);
471 
472  hRPotActivBXroc[indexP] =
473  ibooker.book1D("4 fired ROCs per BX", rpTitle + ";Event.BX", 4002, -1.5, 4000. + 0.5);
474  hRPotActivBXroc_3[indexP] =
475  ibooker.book1D("3 fired ROCs per BX", rpTitle + ";Event.BX", 4002, -1.5, 4000. + 0.5);
476  hRPotActivBXroc_2[indexP] =
477  ibooker.book1D("2 fired ROCs per BX", rpTitle + ";Event.BX", 4002, -1.5, 4000. + 0.5);
478 
479  hRPotActivBXall[indexP] = ibooker.book1D("hits per BX", rpTitle + ";Event.BX", 4002, -1.5, 4000. + 0.5);
480  }
481  int nbins = rpixValues::defaultDetSizeInX / pixBinW;
482 
483  for (int p = 0; p < NplaneMAX; p++) {
484  if (isPlanePlotsTurnedOff[arm][stn][rp][p])
485  continue;
486  sprintf(s, "plane_%d", p);
487  string pd = rpd + "/" + string(s);
488  ibooker.setCurrentFolder(pd);
489  string st1 = ": " + rpTitle + "_" + string(s);
490 
491  st = "adc average value";
492  hp2xyADC[indexP][p] = ibooker.bookProfile2D(st,
493  st1 + ";pix col;pix row",
494  nbins,
495  0,
497  nbins,
498  0,
500  0.,
501  512.,
502  "");
503  hp2xyADC[indexP][p]->getTProfile2D()->SetOption("colz");
504 
505  if (onlinePlots) {
506  st = "hits position";
507  h2xyHits[indexP][p] = ibooker.book2DD(st,
508  st1 + ";pix col;pix row",
510  0,
513  0,
515  h2xyHits[indexP][p]->getTH2D()->SetOption("colz");
516 
517  st = "hits multiplicity";
518  hHitsMult[indexP][p] =
519  ibooker.book1DD(st, st1 + ";number of hits;N / 1 hit", hitMultMAX + 1, -0.5, hitMultMAX + 0.5);
520  }
521 
522  if (offlinePlots) {
523  st = "plane efficiency";
524  h2Efficiency[indexP][p] = ibooker.bookProfile2D(
525  st, st1 + ";x0;y0", mapXbins, mapXmin, mapXmax, mapYbins, mapYmin, mapYmax, 0, 1, "");
526  h2Efficiency[indexP][p]->getTProfile2D()->SetOption("colz");
527  }
528  } // end of for(int p=0; p<NplaneMAX;..
529 
530  } // end for(int rp=0; rp<NRPotsMAX;...
531  } // end of for(int stn=0; stn<
532  } // end of for(int arm=0; arm<2;...
533 
534  return;
535 }
int StationStatus[StationIDMAX]
MonitorElement * hHitsMult[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2xyADC[RPotsTotalNumber][NplaneMAX]
MonitorElement * hpRPactive
MonitorElement * hp2HitsMultROC_LS[RPotsTotalNumber]
static constexpr int mapYbins
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())
Definition: DQMStore.h:476
virtual TProfile * getTProfile() const
MonitorElement * h2CluSize[NArms][NStationMAX]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * htrackMult[RPotsTotalNumber]
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
uint32_t ID
Definition: Definitions.h:24
MonitorElement * h2trackXY0[RPotsTotalNumber]
MonitorElement * hpixLTrack
MonitorElement * hRPotActivBXroc_3[RPotsTotalNumber]
static constexpr int RPn_last
static constexpr int hitMultMAX
static constexpr int NPlaneBins
static constexpr int mapXbins
static constexpr float mapYmax
MonitorElement * htrackHits[RPotsTotalNumber]
virtual TH2F * getTH2F() const
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:155
int RPindexValid[RPotsTotalNumber]
MonitorElement * h2Efficiency[RPotsTotalNumber][NplaneMAX]
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())
Definition: DQMStore.h:399
static constexpr int errCodeSize
MonitorElement * h2ErrorCode
MonitorElement * hRPotActivBX[RPotsTotalNumber]
static constexpr int NLocalTracksMAX
static constexpr int ClusterSizeMax
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)
MonitorElement * hRPotActivBXroc_2[RPotsTotalNumber]
MonitorElement * hRPotActivBXroc[RPotsTotalNumber]
MonitorElement * hRPotActivBXall[RPotsTotalNumber]
constexpr int defaultDetSizeInX
static constexpr int NRPglobalBins
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())
Definition: DQMStore.h:212
MonitorElement * book2DD(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:338
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
MonitorElement * h2AllPlanesActive
static constexpr int RPn_first
virtual TProfile2D * getTProfile2D() const
int getRPglobalBin(int arm, int stn)
static constexpr int NplaneMAX
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * h2xyHits[RPotsTotalNumber][NplaneMAX]
MonitorElement * hRPotActivPlanes[RPotsTotalNumber]
int RPstatus[StationIDMAX][RPotsIDMAX]
MonitorElement * hBXshort
bool isPlanePlotsTurnedOff[NArms][NStationMAX][NRPotsMAX][NplaneMAX]
MonitorElement * h2HitsMultipl[NArms][NStationMAX]
constexpr int ROCSizeInX
static constexpr float mapYmin
constexpr int ROCSizeInY
virtual TH2D * getTH2D() const

◆ dqmBeginRun()

void CTPPSPixelDQMSource::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &   
)
overrideprotected

Definition at line 221 of file CTPPSPixelDQMSource.cc.

References CTPPSPixelLocalTrack::dimension, nEvents, NRPotsMAX, NStationMAX, RPindexValid, RPotsIDMAX, RPstatus, rpStatusWord, StationIDMAX, StationStatus, TrackFitDimension, verbosity, x0_MAX, x0_MIN, y0_MAX, and y0_MIN.

221  {
222  if (verbosity)
223  LogPrint("CTPPSPixelDQMSource") << "RPstatusWord= " << rpStatusWord;
224  nEvents = 0;
225 
226  CTPPSPixelLocalTrack thePixelLocalTrack;
227  TrackFitDimension = thePixelLocalTrack.dimension;
228 
229  for (int stn = 0; stn < StationIDMAX; stn++) {
230  StationStatus[stn] = 0;
231  for (int rp = 0; rp < RPotsIDMAX; rp++)
232  RPstatus[stn][rp] = 0;
233  }
234 
235  unsigned int rpSts = rpStatusWord << 1;
236  for (int stn = 0; stn < NStationMAX; stn++) {
237  int stns = 0;
238  for (int rp = 0; rp < NRPotsMAX; rp++) {
239  rpSts = (rpSts >> 1);
240  RPstatus[stn][rp] = rpSts & 1;
241  if (RPstatus[stn][rp] > 0)
242  stns = 1;
243  }
244  StationStatus[stn] = stns;
245  }
246 
247  for (int ind = 0; ind < 2 * 3 * NRPotsMAX; ind++)
248  RPindexValid[ind] = 0;
249 
250  x0_MIN = y0_MIN = 1.0e06;
251  x0_MAX = y0_MAX = -1.0e06;
252 }
int StationStatus[StationIDMAX]
static constexpr int RPotsIDMAX
static constexpr int dimension
static constexpr int NRPotsMAX
int RPindexValid[RPotsTotalNumber]
Log< level::Warning, true > LogPrint
static constexpr int StationIDMAX
static constexpr int NStationMAX
int RPstatus[StationIDMAX][RPotsIDMAX]

◆ getDet()

int CTPPSPixelDQMSource::getDet ( int  id)
inlineprivate

Definition at line 156 of file CTPPSPixelDQMSource.cc.

References DetId::kDetOffset.

Referenced by analyze().

156 { return (id >> DetId::kDetOffset) & 0xF; }
static const int kDetOffset
Definition: DetId.h:21

◆ getPixPlane()

int CTPPSPixelDQMSource::getPixPlane ( int  id)
inlineprivate

Definition at line 157 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

157 { return ((id >> 16) & 0x7); }

◆ getPlaneIndex()

int CTPPSPixelDQMSource::getPlaneIndex ( int  arm,
int  station,
int  rp,
int  plane 
)
inlineprivate

Definition at line 133 of file CTPPSPixelDQMSource.cc.

References protons_cff::arm, getRPindex(), IndexNotValid, NplaneMAX, and relativeConstraints::station.

Referenced by analyze().

133  {
134  if (plane < 0 || plane >= NplaneMAX)
135  return (IndexNotValid);
136  int rc = getRPindex(arm, station, rp);
137  if (rc == IndexNotValid)
138  return (IndexNotValid);
139  return (rc * NplaneMAX + plane);
140  }
int getRPindex(int arm, int station, int rp)
static constexpr int NplaneMAX

◆ getRPglobalBin()

int CTPPSPixelDQMSource::getRPglobalBin ( int  arm,
int  stn 
)
inlineprivate

Definition at line 146 of file CTPPSPixelDQMSource.cc.

References protons_cff::arm, and NStationMAX.

Referenced by analyze(), and bookHistograms().

146  {
147  static constexpr int stationBinOrder[NStationMAX] = {0, 4, 1};
148  return (arm * 2 + stationBinOrder[stn] + 1);
149  }
static constexpr int NStationMAX

◆ getRPindex()

int CTPPSPixelDQMSource::getRPindex ( int  arm,
int  station,
int  rp 
)
inlineprivate

Definition at line 124 of file CTPPSPixelDQMSource.cc.

References protons_cff::arm, IndexNotValid, NRPotsMAX, NStationMAX, and relativeConstraints::station.

Referenced by analyze(), bookHistograms(), and getPlaneIndex().

124  {
125  if (arm < 0 || station < 0 || rp < 0)
126  return (IndexNotValid);
127  if (arm > 1 || station >= NStationMAX || rp >= NRPotsMAX)
128  return (IndexNotValid);
129  int rc = (arm * NStationMAX + station) * NRPotsMAX + rp;
130  return (rc);
131  }
static constexpr int NRPotsMAX
static constexpr int NStationMAX

◆ getRPInStationBin()

int CTPPSPixelDQMSource::getRPInStationBin ( int  rp)
inlineprivate

Definition at line 142 of file CTPPSPixelDQMSource.cc.

References RPn_first.

142 { return (rp - RPn_first + 1); }
static constexpr int RPn_first

◆ prIndex()

int CTPPSPixelDQMSource::prIndex ( int  rp,
int  plane 
)
inlineprivate

Definition at line 151 of file CTPPSPixelDQMSource.cc.

References NplaneMAX, and RPn_first.

Referenced by analyze().

153  {
154  return ((rp - RPn_first) * NplaneMAX + plane);
155  }
static constexpr int RPn_first
static constexpr int NplaneMAX

Member Data Documentation

◆ ADCMax

constexpr int CTPPSPixelDQMSource::ADCMax = 256
staticprivate

Definition at line 57 of file CTPPSPixelDQMSource.cc.

◆ ClusMultMAX

constexpr int CTPPSPixelDQMSource::ClusMultMAX = 10
staticprivate

Definition at line 62 of file CTPPSPixelDQMSource.cc.

◆ ClusterSizeMax

constexpr int CTPPSPixelDQMSource::ClusterSizeMax = 9
staticprivate

Definition at line 63 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ errCodeSize

constexpr int CTPPSPixelDQMSource::errCodeSize = 15
staticprivate

Definition at line 64 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

◆ h2AllPlanesActive

MonitorElement * CTPPSPixelDQMSource::h2AllPlanesActive
private

Definition at line 80 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ h2CluSize

MonitorElement* CTPPSPixelDQMSource::h2CluSize[NArms][NStationMAX]
private

Definition at line 84 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ h2Efficiency

MonitorElement* CTPPSPixelDQMSource::h2Efficiency[RPotsTotalNumber][NplaneMAX]
private

Definition at line 105 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ h2ErrorCode

MonitorElement* CTPPSPixelDQMSource::h2ErrorCode
private

Definition at line 91 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ h2ErrorCodeRP

MonitorElement* CTPPSPixelDQMSource::h2ErrorCodeRP[RPotsTotalNumber]
private

Definition at line 90 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ h2HitsMultipl

MonitorElement* CTPPSPixelDQMSource::h2HitsMultipl[NArms][NStationMAX]
private

Definition at line 83 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ h2HitsMultROC

MonitorElement* CTPPSPixelDQMSource::h2HitsMultROC[RPotsTotalNumber]
private

Definition at line 100 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ h2trackXY0

MonitorElement* CTPPSPixelDQMSource::h2trackXY0[RPotsTotalNumber]
private

Definition at line 89 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ h2xyHits

MonitorElement* CTPPSPixelDQMSource::h2xyHits[RPotsTotalNumber][NplaneMAX]
private

Definition at line 103 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ h2xyROCHits

MonitorElement* CTPPSPixelDQMSource::h2xyROCHits[RPotsTotalNumber *NplaneMAX][NROCsMAX]
private

Definition at line 106 of file CTPPSPixelDQMSource.cc.

◆ hBX

MonitorElement* CTPPSPixelDQMSource::hBX
private

Definition at line 80 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hBXshort

MonitorElement * CTPPSPixelDQMSource::hBXshort
private

Definition at line 80 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hHitsMult

MonitorElement* CTPPSPixelDQMSource::hHitsMult[RPotsTotalNumber][NplaneMAX]
private

Definition at line 102 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hitMultMAX

constexpr int CTPPSPixelDQMSource::hitMultMAX = 50
staticprivate

Definition at line 61 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ HitsMultPlane

int CTPPSPixelDQMSource::HitsMultPlane[RPotsTotalNumber][NplaneMAX]
private

Definition at line 110 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

◆ HitsMultROC

int CTPPSPixelDQMSource::HitsMultROC[RPotsTotalNumber *NplaneMAX][NROCsMAX]
private

Definition at line 109 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

◆ hp2HitsMultROC_LS

MonitorElement* CTPPSPixelDQMSource::hp2HitsMultROC_LS[RPotsTotalNumber]
private

Definition at line 101 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hp2xyADC

MonitorElement* CTPPSPixelDQMSource::hp2xyADC[RPotsTotalNumber][NplaneMAX]
private

Definition at line 104 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hpixLTrack

MonitorElement * CTPPSPixelDQMSource::hpixLTrack
private

Definition at line 80 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hpRPactive

MonitorElement* CTPPSPixelDQMSource::hpRPactive
private

Definition at line 81 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hROCadc

MonitorElement* CTPPSPixelDQMSource::hROCadc[RPotsTotalNumber *NplaneMAX][NROCsMAX]
private

Definition at line 107 of file CTPPSPixelDQMSource.cc.

◆ hRPotActivBX

MonitorElement* CTPPSPixelDQMSource::hRPotActivBX[RPotsTotalNumber]
private

Definition at line 96 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hRPotActivBXall

MonitorElement* CTPPSPixelDQMSource::hRPotActivBXall[RPotsTotalNumber]
private

Definition at line 108 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hRPotActivBXroc

MonitorElement* CTPPSPixelDQMSource::hRPotActivBXroc[RPotsTotalNumber]
private

Definition at line 97 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hRPotActivBXroc_2

MonitorElement* CTPPSPixelDQMSource::hRPotActivBXroc_2[RPotsTotalNumber]
private

Definition at line 99 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hRPotActivBXroc_3

MonitorElement* CTPPSPixelDQMSource::hRPotActivBXroc_3[RPotsTotalNumber]
private

Definition at line 98 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hRPotActivPlanes

MonitorElement* CTPPSPixelDQMSource::hRPotActivPlanes[RPotsTotalNumber]
private

Definition at line 95 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ htrackHits

MonitorElement* CTPPSPixelDQMSource::htrackHits[RPotsTotalNumber]
private

Definition at line 94 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ htrackMult

MonitorElement* CTPPSPixelDQMSource::htrackMult[RPotsTotalNumber]
private

Definition at line 93 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ IndexNotValid

const int CTPPSPixelDQMSource::IndexNotValid = 0
private

Definition at line 122 of file CTPPSPixelDQMSource.cc.

Referenced by getPlaneIndex(), and getRPindex().

◆ isPlanePlotsTurnedOff

bool CTPPSPixelDQMSource::isPlanePlotsTurnedOff[NArms][NStationMAX][NRPotsMAX][NplaneMAX] = {}
private

Definition at line 117 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), bookHistograms(), and CTPPSPixelDQMSource().

◆ mapXbins

constexpr int CTPPSPixelDQMSource::mapXbins = 200
staticprivate

Definition at line 66 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

◆ mapXmax

const float CTPPSPixelDQMSource::mapXmax = 30. * TMath::Cos(18.4 / 180. * TMath::Pi())
private

Definition at line 71 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

◆ mapXmin

const float CTPPSPixelDQMSource::mapXmin = 0. * TMath::Cos(18.4 / 180. * TMath::Pi())
private

Definition at line 70 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

◆ mapYbins

constexpr int CTPPSPixelDQMSource::mapYbins = 240
staticprivate

Definition at line 67 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

◆ mapYmax

constexpr float CTPPSPixelDQMSource::mapYmax = 8.
staticprivate

Definition at line 69 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

◆ mapYmin

constexpr float CTPPSPixelDQMSource::mapYmin = -16.
staticprivate

Definition at line 68 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

◆ NArms

constexpr int CTPPSPixelDQMSource::NArms = 2
staticprivate

Definition at line 51 of file CTPPSPixelDQMSource.cc.

Referenced by CTPPSPixelDQMSource().

◆ nEvents

long int CTPPSPixelDQMSource::nEvents = 0
private

Definition at line 45 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), dqmBeginRun(), and looper.Looper::loop().

◆ NLocalTracksMAX

constexpr int CTPPSPixelDQMSource::NLocalTracksMAX = 20
staticprivate

Definition at line 60 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ NPlaneBins

constexpr int CTPPSPixelDQMSource::NPlaneBins = NplaneMAX * NRPotBinsInStation
staticprivate

Definition at line 78 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

◆ NplaneMAX

constexpr int CTPPSPixelDQMSource::NplaneMAX = 6
staticprivate

◆ NROCsMAX

constexpr int CTPPSPixelDQMSource::NROCsMAX = 6
staticprivate

Definition at line 55 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ NRPglobalBins

constexpr int CTPPSPixelDQMSource::NRPglobalBins = 4
staticprivate

Definition at line 144 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

◆ NRPotBinsInStation

constexpr int CTPPSPixelDQMSource::NRPotBinsInStation = RPn_last - RPn_first
staticprivate

Definition at line 77 of file CTPPSPixelDQMSource.cc.

◆ NRPotsMAX

constexpr int CTPPSPixelDQMSource::NRPotsMAX = 6
staticprivate

Definition at line 53 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), CTPPSPixelDQMSource(), dqmBeginRun(), and getRPindex().

◆ NStationMAX

constexpr int CTPPSPixelDQMSource::NStationMAX = 3
staticprivate

◆ offlinePlots

bool CTPPSPixelDQMSource::offlinePlots = true
private

Definition at line 113 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), bookHistograms(), and CTPPSPixelDQMSource().

◆ onlinePlots

bool CTPPSPixelDQMSource::onlinePlots = true
private

Definition at line 114 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), bookHistograms(), and CTPPSPixelDQMSource().

◆ RPindexValid

int CTPPSPixelDQMSource::RPindexValid[RPotsTotalNumber]
private

Definition at line 88 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

◆ RPn_first

constexpr int CTPPSPixelDQMSource::RPn_first = 3
staticprivate

Definition at line 56 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms(), getRPInStationBin(), and prIndex().

◆ RPn_last

constexpr int CTPPSPixelDQMSource::RPn_last = 4
staticprivate

Definition at line 56 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

◆ RPotsIDMAX

constexpr int CTPPSPixelDQMSource::RPotsIDMAX = 8
staticprivate

Definition at line 59 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun().

◆ RPotsTotalNumber

constexpr int CTPPSPixelDQMSource::RPotsTotalNumber = NArms * NStationMAX * NRPotsMAX
staticprivate

Definition at line 86 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

◆ RPstatus

int CTPPSPixelDQMSource::RPstatus[StationIDMAX][RPotsIDMAX]
private

Definition at line 120 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

◆ rpStatusWord

unsigned int CTPPSPixelDQMSource::rpStatusWord = 0x8008
private

Definition at line 119 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun().

◆ StationIDMAX

constexpr int CTPPSPixelDQMSource::StationIDMAX = 4
staticprivate

Definition at line 58 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun().

◆ StationStatus

int CTPPSPixelDQMSource::StationStatus[StationIDMAX]
private

Definition at line 121 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

◆ thePixIndices

CTPPSPixelIndices CTPPSPixelDQMSource::thePixIndices
private

Definition at line 73 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

◆ tokenCluster

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelCluster> > CTPPSPixelDQMSource::tokenCluster
private

Definition at line 48 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and CTPPSPixelDQMSource().

◆ tokenDigi

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelDigi> > CTPPSPixelDQMSource::tokenDigi
private

Definition at line 46 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and CTPPSPixelDQMSource().

◆ tokenError

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelDataError> > CTPPSPixelDQMSource::tokenError
private

Definition at line 47 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and CTPPSPixelDQMSource().

◆ tokenTrack

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelLocalTrack> > CTPPSPixelDQMSource::tokenTrack
private

Definition at line 49 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and CTPPSPixelDQMSource().

◆ TrackFitDimension

int CTPPSPixelDQMSource::TrackFitDimension = 4
private

Definition at line 75 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

◆ verbosity

unsigned int CTPPSPixelDQMSource::verbosity
private

Definition at line 44 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), CTPPSPixelDQMSource(), and dqmBeginRun().

◆ x0_MAX

float CTPPSPixelDQMSource::x0_MAX
private

Definition at line 160 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

◆ x0_MIN

float CTPPSPixelDQMSource::x0_MIN
private

Definition at line 160 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

◆ y0_MAX

float CTPPSPixelDQMSource::y0_MAX
private

Definition at line 160 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

◆ y0_MIN

float CTPPSPixelDQMSource::y0_MIN
private

Definition at line 160 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().