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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 CTPPSPixelDQMSource (const edm::ParameterSet &ps)
 
virtual ~CTPPSPixelDQMSource ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

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

Private Attributes

const int CluSizeMAX = 25
 
int cluSizeMaxData
 
const int ClusMultMAX = 90
 
MonitorElementh2CluSize [NArms][NStationMAX]
 
MonitorElementh2ClusMultipl [NArms][NStationMAX]
 
MonitorElementh2HitsMultipl [NArms][NStationMAX]
 
MonitorElementh2HitsMultROC [RPotsTotalNumber]
 
MonitorElementh2PlaneActive [NArms][NStationMAX]
 
MonitorElementh2xyHits [RPotsTotalNumber][NplaneMAX]
 
MonitorElementh2xyROCadc [RPotsTotalNumber *NplaneMAX][NROCsMAX]
 
MonitorElementh2xyROCHits [RPotsTotalNumber *NplaneMAX][NROCsMAX]
 
MonitorElementhBX
 
MonitorElementhBXshort
 
MonitorElementhHitsMult [RPotsTotalNumber][NplaneMAX]
 
const int hitMultMAX = 300
 
int HitsMultPlane [RPotsTotalNumber][NplaneMAX]
 
int HitsMultROC [RPotsTotalNumber *NplaneMAX][NROCsMAX]
 
MonitorElementhp2HitsMultROC_LS [RPotsTotalNumber]
 
MonitorElementhp2HitsOcc [NArms][NStationMAX]
 
MonitorElementhp2xyADC [RPotsTotalNumber][NplaneMAX]
 
MonitorElementhRPotActivBX [RPotsTotalNumber]
 
MonitorElementhRPotActivBXall [RPotsTotalNumber]
 
MonitorElementhRPotActivBXroc [RPotsTotalNumber]
 
MonitorElementhRPotActivPlanes [RPotsTotalNumber]
 
MonitorElementhRPotActivROCs [RPotsTotalNumber]
 
const int IndexNotValid = 0
 
int multClus
 
int multHits
 
long int nEvents = 0
 
int pixColMAX = 156
 
int pixRowMAX = 160
 
int ROCSizeInX = pixRowMAX/2
 
int ROCSizeInY = pixColMAX/3
 
int RPindexValid [RPotsTotalNumber]
 
const int RPn_first = 3
 
const int RPn_last = 4
 
int RPstatus [NStationMAX][NRPotsMAX]
 
unsigned int rpStatusWord = 0x8000
 
int StationStatus [NStationMAX]
 
CTPPSPixelIndices thePixIndices
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
 
unsigned int verbosity
 

Static Private Attributes

static int NArms =2
 
static int NplaneMAX =6
 
static int NROCsMAX = 6
 
static int NRPotsMAX =6
 
static int NStationMAX =3
 
static int RPotsTotalNumber =NArms*NStationMAX*NRPotsMAX
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 31 of file CTPPSPixelDQMSource.cc.

Constructor & Destructor Documentation

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

Definition at line 130 of file CTPPSPixelDQMSource.cc.

References edm::ParameterSet::getParameter(), and tokenDigi.

130  :
131  verbosity(ps.getUntrackedParameter<unsigned int>("verbosity", 0)),
132  rpStatusWord(ps.getUntrackedParameter<unsigned int>("RPStatusWord",0x8000))
133 {
134  tokenDigi = consumes<DetSetVector<CTPPSPixelDigi> >(ps.getParameter<edm::InputTag>("tagRPixDigi"));
135 // tokenCluster=consumes<DetSetVector<CTPPSPixelCluster>>(ps.getParameter<edm::InputTag>("tagRPixCluster"));
136 
137 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
CTPPSPixelDQMSource::~CTPPSPixelDQMSource ( )
virtual

Definition at line 141 of file CTPPSPixelDQMSource.cc.

142 {
143 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 346 of file CTPPSPixelDQMSource.cc.

References ecalMGPA::adc(), CTPPSDetId::arm(), edm::DetSet< T >::begin(), edm::EventBase::bunchCrossing(), cuy::col, MonitorElement::Fill(), HcalObjRepresent::Fill(), objects.autophobj::float, getDet(), getPixPlane(), getPlaneIndex(), getRPindex(), h2HitsMultipl, h2HitsMultROC, h2PlaneActive, h2xyHits, h2xyROCadc, h2xyROCHits, hBX, hBXshort, hHitsMult, HitsMultPlane, HitsMultROC, hp2HitsMultROC_LS, hp2HitsOcc, hp2xyADC, hRPotActivBX, hRPotActivBXall, hRPotActivBXroc, hRPotActivPlanes, hRPotActivROCs, diffTreeTool::index, edm::HandleBase::isValid(), hpstanc_transforms::max, multHits, NArms, nEvents, np, NplaneMAX, NROCsMAX, NRPotsMAX, NStationMAX, AlCaHLTBitMon_ParallelJobs::p, prIndex(), alignCSCRings::r, CTPPSDetId::rp(), RPindexValid, RPstatus, CTPPSDetId::station(), relativeConstraints::station, StationStatus, thePixIndices, tokenDigi, CTPPSPixelIndices::transformToROC(), verbosity, and DetId::VeryForward.

347 {
348  ++nEvents;
349  int lumiId = event.getLuminosityBlock().id().luminosityBlock();
350  if(lumiId<0) lumiId=0;
351 
352  int RPactivity[NArms][NRPotsMAX], digiSize[NArms][NRPotsMAX];
353  for(int arm = 0; arm <2; arm++) {
354  for(int rp=0; rp<NRPotsMAX; rp++) {
355  RPactivity[arm][rp] = digiSize[arm][rp] = 0;
356  }
357  }
358  for(int ind=0; ind<2*3*NRPotsMAX; ind++) {
359  for(int p=0; p<NplaneMAX; p++) {
360  HitsMultPlane[ind][p] = 0;
361  }
362  }
363  for(int ind=0; ind<2*3*NRPotsMAX*NplaneMAX; ind++) {
364  for(int rp=0; rp<NROCsMAX; rp++) {
365  HitsMultROC[ind][rp] = 0;
366  }
367  }
369  event.getByToken(tokenDigi, pixDigi);
370 
371  hBX->Fill(event.bunchCrossing());
372  hBXshort->Fill(event.bunchCrossing());
373 
374  bool valid = false;
375  valid |= pixDigi.isValid();
376 // valid |= Clus.isValid();
377 
378  if(!valid && verbosity) LogPrint("CTPPSPixelDQMSource") <<"No valid data in Event "<<nEvents;
379 
380  if(pixDigi.isValid()) {
381  for(const auto &ds_digi : *pixDigi)
382  {
383  int idet = getDet(ds_digi.id);
384  if(idet != DetId::VeryForward) {
385  if(verbosity>1) LogPrint("CTPPSPixelDQMSource") <<"not CTPPS: ds_digi.id"<<ds_digi.id;
386  continue;
387  }
388  // int subdet = getSubdet(ds_digi.id);
389 
390  int plane = getPixPlane(ds_digi.id);
391 
392  CTPPSDetId theId(ds_digi.id);
393  int arm = theId.arm()&0x1;
394  int station = theId.station()&0x3;
395  int rpot = theId.rp()&0x7;
396  RPactivity[arm][rpot] = 1;
397  ++digiSize[arm][rpot];
398 
399  if(StationStatus[station] && RPstatus[station][rpot]) {
400 
401  hp2HitsOcc[arm][station]->Fill(plane,rpot,(int)ds_digi.data.size());
402  h2HitsMultipl[arm][station]->Fill(prIndex(rpot,plane),ds_digi.data.size());
403  h2PlaneActive[arm][station]->Fill(plane,rpot);
404 
405  int index = getRPindex(arm,station,rpot);
406  HitsMultPlane[index][plane] += ds_digi.data.size();
407  if(RPindexValid[index]) {
408  hHitsMult[index][plane]->Fill(ds_digi.data.size());
409  }
410  int rocHistIndex = getPlaneIndex(arm,station,rpot,plane);
411 
412  for(DetSet<CTPPSPixelDigi>::const_iterator dit = ds_digi.begin();
413  dit != ds_digi.end(); ++dit) {
414  int row = dit->row();
415  int col = dit->column();
416  int adc = dit->adc();
417 
418  if(RPindexValid[index]) {
419  h2xyHits[index][plane]->Fill(col,row);
420  hp2xyADC[index][plane]->Fill(col,row,adc);
421  int colROC, rowROC;
422  int trocId;
423  if(!thePixIndices.transformToROC(col,row, trocId, colROC, rowROC)) {
424  if(trocId>=0 && trocId<NROCsMAX) {
425  h2xyROCHits[rocHistIndex][trocId]->Fill(colROC,rowROC);
426  h2xyROCadc[rocHistIndex][trocId]->Fill(colROC,rowROC,adc);
427  ++HitsMultROC[rocHistIndex][trocId];
428  }
429  }
430  } //end if(RPindexValid[index]) {
431  }
432 
433  if(int(ds_digi.data.size()) > multHits) multHits = ds_digi.data.size();
434  } // end if(StationStatus[station]) {
435  } // end for(const auto &ds_digi : *pixDigi)
436  } //if(pixDigi.isValid()) {
437 
438  for(int arm=0; arm<2; arm++) {
439  for(int stn=0; stn<NStationMAX; stn++) {
440  for(int rp=0; rp<NRPotsMAX; rp++) {
441  int index = getRPindex(arm,stn,rp);
442  if(RPindexValid[index]==0) continue;
443  if(RPactivity[arm][rp]==0) continue;
444 
445  int np = 0;
446  for(int p=0; p<NplaneMAX; p++) if(HitsMultPlane[index][p]>0) np++;
448  if(np>5) hRPotActivBX[index]->Fill(event.bunchCrossing());
449  hRPotActivBXall[index]->Fill(event.bunchCrossing(),float(digiSize[arm][rp]));
450 
451  int rocf[NplaneMAX];
452  for(int r=0; r<NROCsMAX; r++) rocf[r]=0;
453  for(int p=0; p<NplaneMAX; p++) {
454  int indp = getPlaneIndex(arm,stn,rp,p);
455  for(int r=0; r<NROCsMAX; r++) if(HitsMultROC[indp][r] > 0) ++rocf[r];
456  for(int r=0; r<NROCsMAX; r++) {
457  h2HitsMultROC[index]->Fill(p,r,HitsMultROC[indp][r]);
458  hp2HitsMultROC_LS[index]->Fill(lumiId,p*NROCsMAX+r,HitsMultROC[indp][r]);
459  }
460  }
461  int max = 0;
462  for(int r=0; r<NROCsMAX; r++)
463  if(max < rocf[r]) { max = rocf[r]; }
464 
465  for(int r=0; r<NROCsMAX; r++) hRPotActivROCs[index]->Fill(r,rocf[r]);
466 
467  if(max > 4) hRPotActivBXroc[index]->Fill(event.bunchCrossing());
468  } //end for(int rp=0; rp<NRPotsMAX; rp++) {
469  }
470  } //end for(int arm=0; arm<2; arm++) {
471 
472  if((nEvents % 100)) return;
473  if(verbosity) LogPrint("CTPPSPixelDQMSource")<<"analyze event "<<nEvents;
474 }
int adc(sample_type sample)
get the ADC sample (12 bits)
MonitorElement * hHitsMult[RPotsTotalNumber][NplaneMAX]
int HitsMultPlane[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2xyADC[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2HitsMultROC_LS[RPotsTotalNumber]
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
MonitorElement * hp2HitsOcc[NArms][NStationMAX]
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
CTPPSPixelIndices thePixIndices
void Fill(long long x)
int prIndex(int rp, int plane)
int RPindexValid[RPotsTotalNumber]
int RPstatus[NStationMAX][NRPotsMAX]
int np
Definition: AMPTWrapper.h:33
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * hRPotActivBX[RPotsTotalNumber]
MonitorElement * h2xyROCadc[RPotsTotalNumber *NplaneMAX][NROCsMAX]
bool isValid() const
Definition: HandleBase.h:74
int getRPindex(int arm, int station, int rp)
MonitorElement * hRPotActivBXroc[RPotsTotalNumber]
MonitorElement * h2PlaneActive[NArms][NStationMAX]
iterator begin()
Definition: DetSet.h:59
MonitorElement * h2xyROCHits[RPotsTotalNumber *NplaneMAX][NROCsMAX]
MonitorElement * hRPotActivBXall[RPotsTotalNumber]
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
int transformToROC(const int col, const int row, int &rocId, int &colROC, int &rowROC) const
MonitorElement * hRPotActivROCs[RPotsTotalNumber]
col
Definition: cuy.py:1008
int StationStatus[NStationMAX]
int HitsMultROC[RPotsTotalNumber *NplaneMAX][NROCsMAX]
int getPlaneIndex(int arm, int station, int rp, int plane)
MonitorElement * h2xyHits[RPotsTotalNumber][NplaneMAX]
MonitorElement * hRPotActivPlanes[RPotsTotalNumber]
MonitorElement * hBXshort
MonitorElement * h2HitsMultipl[NArms][NStationMAX]
Definition: event.py:1
void CTPPSPixelDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 174 of file CTPPSPixelDQMSource.cc.

References CTPPSDetId::armName(), DQMStore::IBooker::book1D(), DQMStore::IBooker::book1DD(), DQMStore::IBooker::book2D(), DQMStore::IBooker::book2DD(), DQMStore::IBooker::bookProfile2D(), DQMStore::IBooker::cd(), CluSizeMAX, ClusMultMAX, MillePedeFileConverter_cfg::e, getPlaneIndex(), CTPPSDetId::getRPId(), getRPindex(), CTPPSDetId::getStationId(), MonitorElement::getTH2D(), MonitorElement::getTH2F(), MonitorElement::getTProfile2D(), h2CluSize, h2ClusMultipl, h2HitsMultipl, h2HitsMultROC, h2PlaneActive, h2xyHits, h2xyROCadc, h2xyROCHits, hBX, hBXshort, hHitsMult, hitMultMAX, hp2HitsMultROC_LS, hp2HitsOcc, hp2xyADC, hRPotActivBX, hRPotActivBXall, hRPotActivBXroc, hRPotActivPlanes, hRPotActivROCs, diffTreeTool::index, pileupCalc::nbins, CTPPSDetId::nFull, CTPPSDetId::nPath, NplaneMAX, NROCsMAX, CTPPSDetId::nShort, NStationMAX, AlCaHLTBitMon_ParallelJobs::p, pixRowMAX, alignCSCRings::r, ROCSizeInX, ROCSizeInY, RPindexValid, RPn_first, RPn_last, RPstatus, alignCSCRings::s, sd, CTPPSDetId::sdTrackingPixel, DQMStore::IBooker::setCurrentFolder(), CTPPSDetId::setRP(), CTPPSDetId::setStation(), StationStatus, AlCaHLTBitMon_QueryRunRegistry::string, and TrackerOfflineValidation_Dqm_cff::xmax.

176 {
177  ibooker.cd();
178  ibooker.setCurrentFolder("CTPPS/TrackingPixel");
179  char s[50];
180  hBX = ibooker.book1D("events per BX", "ctpps_pixel;Event.BX", 4002, -1.5, 4000. +0.5);
181  hBXshort = ibooker.book1D("events per BX(short)", "ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
182 
183  for(int arm=0; arm<2; arm++) {
185  string sd, armTitle;
186  ID.armName(sd, CTPPSDetId::nPath);
187  ID.armName(armTitle, CTPPSDetId::nFull);
188 
189  ibooker.setCurrentFolder(sd);
190 
191  for(int stn=2; stn<NStationMAX; stn++) {
192  if(StationStatus[stn]==0) continue;
193  ID.setStation(stn);
194  string stnd, stnTitle;
195 
196  CTPPSDetId(ID.getStationId()).stationName(stnd, CTPPSDetId::nPath);
197  CTPPSDetId(ID.getStationId()).stationName(stnTitle, CTPPSDetId::nFull);
198 
199  ibooker.setCurrentFolder(stnd);
200 
201  string st = "planes activity";
202  string st2 = ": " + stnTitle;
203 
204  int rpnbins = RPn_last-RPn_first;
205 
206  h2PlaneActive[arm][stn] = ibooker.book2DD(st,st+st2+";Plane #",
207  NplaneMAX,0,NplaneMAX, rpnbins, RPn_first,RPn_last);
208  TH2D *h = h2PlaneActive[arm][stn]->getTH2D();
209  h->SetOption("colz");
210  TAxis *yah = h->GetYaxis();
211 
212  st = "hit average multiplicity in planes";
213  int PlaneMultCut = 20;
214  hp2HitsOcc[arm][stn]= ibooker.bookProfile2D(st,st+st2+";Plane #",
215  NplaneMAX, 0, NplaneMAX, rpnbins, RPn_first,RPn_last,-1,PlaneMultCut,"");
216  TProfile2D *h2 = hp2HitsOcc[arm][stn]->getTProfile2D();
217  h2->SetOption("textcolz");
218  TAxis *yah2 = h2->GetYaxis();
219 
220  int xmax = NplaneMAX*rpnbins;
221 
222  st = "hit multiplicity in planes";
223  string st3 = ";PlaneIndex(=pixelPot*PlaneMAX + plane)";
224  h2HitsMultipl[arm][stn]= ibooker.book2DD(st,st+st2+st3+";multiplicity",
225  xmax,0,xmax,hitMultMAX,0,hitMultMAX);
226  h2HitsMultipl[arm][stn]->getTH2D()->SetOption("colz");
227 
228  st = "cluster multiplicity in planes";
229  h2ClusMultipl[arm][stn] = ibooker.book2DD(st,st+st2+st3+";multiplicity",
230  xmax,0,xmax, ClusMultMAX,0,ClusMultMAX);
231  h2ClusMultipl[arm][stn]->getTH2D()->SetOption("colz");
232 
233  st = "cluster size in planes";
234  h2CluSize[arm][stn] = ibooker.book2D(st,st+st2+st3+";Cluster size",
235  xmax,0,xmax, CluSizeMAX,0,CluSizeMAX);
236  h2CluSize[arm][stn]->getTH2F()->SetOption("colz");
237 
238 //--------- RPots ---
239  int pixBinW = 4;
240  for(int rp=RPn_first; rp<RPn_last; rp++) { // only installed pixel pots
241  ID.setRP(rp);
242  string rpd, rpTitle;
243  CTPPSDetId(ID.getRPId()).rpName(rpTitle, CTPPSDetId::nShort);
244  yah->SetBinLabel(rp - RPn_first +1, rpTitle.c_str()); // h
245  yah2->SetBinLabel(rp - RPn_first +1, rpTitle.c_str()); //h2
246 
247  if(RPstatus[stn][rp]==0) continue;
248  int indexP = getRPindex(arm,stn,rp);
249  RPindexValid[indexP] = 1;
250 
251  CTPPSDetId(ID.getRPId()).rpName(rpTitle, CTPPSDetId::nFull);
252  CTPPSDetId(ID.getRPId()).rpName(rpd, CTPPSDetId::nPath);
253 
254  ibooker.setCurrentFolder(rpd);
255 
256  hRPotActivPlanes[indexP] =
257  ibooker.book1D("number of fired planes per event", rpTitle+";nPlanes",
258  NplaneMAX+1, -0.5, NplaneMAX+0.5);
259  hRPotActivBX[indexP] =
260  ibooker.book1D("5 fired planes per BX", rpTitle+";Event.BX", 4002, -1.5, 4000.+0.5);
261 
262  h2HitsMultROC[indexP] = ibooker.bookProfile2D("ROCs hits multiplicity per event",
263  rpTitle+";plane # ;ROC #", NplaneMAX,-0.5,NplaneMAX-0.5, NROCsMAX,-0.5,NROCsMAX-0.5,
264  0.,ROCSizeInX*ROCSizeInY,"");
265  h2HitsMultROC[indexP]->getTProfile2D()->SetOption("colztext");
266  h2HitsMultROC[indexP]->getTProfile2D()->SetMinimum(1.e-10);
267 
268 
269  hp2HitsMultROC_LS[indexP]=ibooker.bookProfile2D("ROCs_hits_multiplicity_per_event vs LS",
270  rpTitle+";LumiSection;Plane#___ROC#", 1000,0.,1000.,
271  NplaneMAX*NROCsMAX,0.,double(NplaneMAX*NROCsMAX),0.,ROCSizeInX*ROCSizeInY,"");
272  hp2HitsMultROC_LS[indexP]->getTProfile2D()->SetOption("colz");
273  hp2HitsMultROC_LS[indexP]->getTProfile2D()->SetMinimum(1.0e-10);
274  hp2HitsMultROC_LS[indexP]->getTProfile2D()->SetCanExtend(TProfile2D::kXaxis);
275  TAxis *yahp2 = hp2HitsMultROC_LS[indexP]->getTProfile2D()->GetYaxis();
276  for(int p=0; p<NplaneMAX; p++) {
277  sprintf(s,"plane%d_0",p);
278  yahp2->SetBinLabel(p*NplaneMAX+1,s);
279  for(int r=1; r<NROCsMAX; r++) {
280  sprintf(s," %d_%d",p,r);
281  yahp2->SetBinLabel(p*NplaneMAX+r+1,s);
282  }
283  }
284 
285  hRPotActivROCs[indexP] = ibooker.book2D("number of fired aligned_ROCs per event",
286  rpTitle+";ROC ID;number of fired ROCs", NROCsMAX,-0.5,NROCsMAX-0.5, 7,-0.5,6.5);
287  hRPotActivROCs[indexP]->getTH2F()->SetOption("colz");
288 
289  ibooker.setCurrentFolder(rpd+"/latency");
290 
291  hRPotActivBXroc[indexP] =
292  ibooker.book1D("4 fired ROCs per BX", rpTitle+";Event.BX", 4002, -1.5, 4000.+0.5);
293 
294  hRPotActivBXall[indexP] =
295  ibooker.book1D("hits per BX", rpTitle+";Event.BX", 4002, -1.5, 4000.+0.5);
296 
297  int nbins = pixRowMAX/pixBinW;
298 
299  for(int p=0; p<NplaneMAX; p++) {
300  sprintf(s,"plane_%d",p);
301  string pd = rpd+"/"+string(s);
302  ibooker.setCurrentFolder(pd);
303  string st1 = ": "+rpTitle+"_"+string(s);
304  st = "hits position";
305  h2xyHits[indexP][p]=ibooker.book2DD(st,st1+";pix col;pix row",
306  nbins,0,pixRowMAX,nbins,0,pixRowMAX);
307  h2xyHits[indexP][p]->getTH2D()->SetOption("colz");
308 
309  st = "adc average value";
310  hp2xyADC[indexP][p]=ibooker.bookProfile2D(st,st1+";pix col;pix row",
311  nbins,0,pixRowMAX,nbins,0,pixRowMAX, 0.,512.,"");
312  hp2xyADC[indexP][p]->getTProfile2D()->SetOption("colz");
313 
314  st = "hits multiplicity";
315  hHitsMult[indexP][p]=ibooker.book1DD(st,st1+";number of hits;N / 1 hit",
316  hitMultMAX,-0.5,hitMultMAX-0.5);
317 
318  ibooker.setCurrentFolder(pd + "/ROCs");
319  int index = getPlaneIndex(arm,stn,rp,p);
320 
321  for(int roc=0; roc<NROCsMAX; roc++) {
322  sprintf(s,"ROC_%d",roc);
323  string st2 = st1 + "_" + string(s);
324  ibooker.setCurrentFolder(pd + "/ROCs/" + string(s));
325 
326  h2xyROCHits[index][roc]=ibooker.book2DD("hits",st2+";pix col;pix row",
327  ROCSizeInY,0,ROCSizeInY, ROCSizeInX,0,ROCSizeInX);
328  h2xyROCHits[index][roc]->getTH2D()->SetOption("colz");
329 
330  string st = "adc average value";
331  h2xyROCadc[index][roc]=ibooker.bookProfile2D(st,st2+";pix col;pix row",
332  ROCSizeInY,0,ROCSizeInY,ROCSizeInX,0,ROCSizeInX, 0.,512.,"");
333  h2xyROCadc[index][roc]->getTProfile2D()->SetOption("colz");
334  }
335  } // end of for(int p=0; p<NplaneMAX;..
336 
337  } // end for(int rp=0; rp<NRPotsMAX;...
338  } // end of for(int stn=0; stn<
339  } //end of for(int arm=0; arm<2;...
340 
341  return;
342 }
MonitorElement * hHitsMult[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2xyADC[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2HitsMultROC_LS[RPotsTotalNumber]
MonitorElement * h2CluSize[NArms][NStationMAX]
TProfile2D * getTProfile2D(void) const
MonitorElement * hp2HitsOcc[NArms][NStationMAX]
void cd(void)
Definition: DQMStore.cc:269
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
uint32_t ID
Definition: Definitions.h:26
TH2D * getTH2D(void) const
int RPindexValid[RPotsTotalNumber]
int RPstatus[NStationMAX][NRPotsMAX]
MonitorElement * h2ClusMultipl[NArms][NStationMAX]
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
MonitorElement * hRPotActivBX[RPotsTotalNumber]
MonitorElement * h2xyROCadc[RPotsTotalNumber *NplaneMAX][NROCsMAX]
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
int getRPindex(int arm, int station, int rp)
MonitorElement * hRPotActivBXroc[RPotsTotalNumber]
MonitorElement * h2PlaneActive[NArms][NStationMAX]
MonitorElement * h2xyROCHits[RPotsTotalNumber *NplaneMAX][NROCsMAX]
MonitorElement * hRPotActivBXall[RPotsTotalNumber]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
double sd
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
MonitorElement * hRPotActivROCs[RPotsTotalNumber]
MonitorElement * book2DD(Args &&...args)
Definition: DQMStore.h:145
int StationStatus[NStationMAX]
TH2F * getTH2F(void) const
int getPlaneIndex(int arm, int station, int rp, int plane)
MonitorElement * h2xyHits[RPotsTotalNumber][NplaneMAX]
MonitorElement * hRPotActivPlanes[RPotsTotalNumber]
MonitorElement * book1DD(Args &&...args)
Definition: DQMStore.h:127
MonitorElement * hBXshort
MonitorElement * h2HitsMultipl[NArms][NStationMAX]
void CTPPSPixelDQMSource::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 147 of file CTPPSPixelDQMSource.cc.

References cluSizeMaxData, CTPPSPixelIndices::getDefaultColDetSize(), CTPPSPixelIndices::getDefaultRowDetSize(), multClus, multHits, nEvents, NRPotsMAX, pixColMAX, pixRowMAX, ROCSizeInX, ROCSizeInY, RPindexValid, RPstatus, rpStatusWord, StationStatus, thePixIndices, and verbosity.

148 {
149  if(verbosity) LogPrint("CTPPSPixelDQMSource") <<"RPstatusWord= "<<rpStatusWord;
150  nEvents = 0;
151 
154  ROCSizeInX = pixRowMAX/2; // ROC row size in pixels = 80
155  ROCSizeInY = pixColMAX/3;
156 
157  unsigned int rpSts = rpStatusWord<<1;
158  for(int stn=0; stn<3; stn++) {
159  int stns = 0;
160  for(int rp=0; rp<NRPotsMAX; rp++) {
161  rpSts = (rpSts >> 1); RPstatus[stn][rp] = rpSts&1;
162  if(RPstatus[stn][rp] > 0) stns = 1;
163  }
164  StationStatus[stn]=stns;
165  }
166 
167  for(int ind=0; ind<2*3*NRPotsMAX; ind++) RPindexValid[ind] = 0;
168 
170 }
int getDefaultRowDetSize() const
CTPPSPixelIndices thePixIndices
int RPindexValid[RPotsTotalNumber]
int RPstatus[NStationMAX][NRPotsMAX]
int getDefaultColDetSize() const
int StationStatus[NStationMAX]
void CTPPSPixelDQMSource::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 477 of file CTPPSPixelDQMSource.cc.

References cluSizeMaxData, DEFINE_FWK_MODULE, multClus, multHits, nEvents, edm::RunBase::run(), and verbosity.

478 {
479  if(!verbosity) return;
480  LogPrint("CTPPSPixelDQMSource")
481  <<"end of Run "<<run.run()<<": "<<nEvents<<" events\n"
482  <<"mult Hits/Clus: "<<multHits<<" / "<<multClus
483  <<" cluSizeMaxData= "<<cluSizeMaxData;
484 }
int CTPPSPixelDQMSource::getDet ( int  id)
inlineprivate

Definition at line 113 of file CTPPSPixelDQMSource.cc.

References DetId::kDetOffset.

Referenced by analyze().

114  { return (id>>DetId::kDetOffset)&0xF; }
static const int kDetOffset
Definition: DetId.h:20
int CTPPSPixelDQMSource::getPixPlane ( int  id)
inlineprivate

Definition at line 115 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

116  { return ((id>>16)&0x7); }
int CTPPSPixelDQMSource::getPlaneIndex ( int  arm,
int  station,
int  rp,
int  plane 
)
inlineprivate

Definition at line 104 of file CTPPSPixelDQMSource.cc.

References getRPindex().

Referenced by analyze(), and bookHistograms().

104  {
105  if(plane<0 || plane>=NplaneMAX) return(IndexNotValid);
106  int rc = getRPindex(arm, station, rp);
107  if(rc == IndexNotValid) return(IndexNotValid);
108  return(rc*NplaneMAX + plane);
109  }
int getRPindex(int arm, int station, int rp)
int CTPPSPixelDQMSource::getRPindex ( int  arm,
int  station,
int  rp 
)
inlineprivate

Definition at line 97 of file CTPPSPixelDQMSource.cc.

References relativeConstraints::station.

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

97  {
98  if(arm<0 || station<0 || rp<0) return(IndexNotValid);
99  if(arm>1 || station>=NStationMAX || rp>=NRPotsMAX) return(IndexNotValid);
100  int rc = (arm*NStationMAX+station)*NRPotsMAX + rp;
101  return(rc);
102  }
int CTPPSPixelDQMSource::prIndex ( int  rp,
int  plane 
)
inlineprivate

Definition at line 111 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

112  {return((rp - RPn_first)*NplaneMAX + plane);}

Member Data Documentation

const int CTPPSPixelDQMSource::CluSizeMAX = 25
private

Definition at line 57 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

int CTPPSPixelDQMSource::cluSizeMaxData
private

Definition at line 119 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun(), and endRun().

const int CTPPSPixelDQMSource::ClusMultMAX = 90
private

Definition at line 56 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

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

Definition at line 71 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

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

Definition at line 70 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

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

Definition at line 68 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::h2HitsMultROC[RPotsTotalNumber]
private

Definition at line 79 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 69 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 83 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 86 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 85 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hBX
private

Definition at line 65 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement * CTPPSPixelDQMSource::hBXshort
private

Definition at line 65 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 82 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

const int CTPPSPixelDQMSource::hitMultMAX = 300
private

Definition at line 55 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

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

Definition at line 89 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

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

Definition at line 88 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

MonitorElement* CTPPSPixelDQMSource::hp2HitsMultROC_LS[RPotsTotalNumber]
private

Definition at line 80 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 67 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 84 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hRPotActivBX[RPotsTotalNumber]
private

Definition at line 77 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hRPotActivBXall[RPotsTotalNumber]
private

Definition at line 87 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hRPotActivBXroc[RPotsTotalNumber]
private

Definition at line 78 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hRPotActivPlanes[RPotsTotalNumber]
private

Definition at line 76 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hRPotActivROCs[RPotsTotalNumber]
private

Definition at line 81 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

const int CTPPSPixelDQMSource::IndexNotValid = 0
private

Definition at line 95 of file CTPPSPixelDQMSource.cc.

int CTPPSPixelDQMSource::multClus
private

Definition at line 119 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun(), and endRun().

int CTPPSPixelDQMSource::multHits
private

Definition at line 119 of file CTPPSPixelDQMSource.cc.

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

int CTPPSPixelDQMSource::NArms =2
staticprivate

Definition at line 49 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

long int CTPPSPixelDQMSource::nEvents = 0
private

Definition at line 45 of file CTPPSPixelDQMSource.cc.

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

int CTPPSPixelDQMSource::NplaneMAX =6
staticprivate

Definition at line 52 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

int CTPPSPixelDQMSource::NROCsMAX = 6
staticprivate

Definition at line 53 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

int CTPPSPixelDQMSource::NRPotsMAX =6
staticprivate

Definition at line 51 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

int CTPPSPixelDQMSource::NStationMAX =3
staticprivate

Definition at line 50 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

int CTPPSPixelDQMSource::pixColMAX = 156
private

Definition at line 61 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun().

int CTPPSPixelDQMSource::pixRowMAX = 160
private

Definition at line 60 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms(), and dqmBeginRun().

int CTPPSPixelDQMSource::ROCSizeInX = pixRowMAX/2
private

Definition at line 62 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms(), and dqmBeginRun().

int CTPPSPixelDQMSource::ROCSizeInY = pixColMAX/3
private

Definition at line 63 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms(), and dqmBeginRun().

int CTPPSPixelDQMSource::RPindexValid[RPotsTotalNumber]
private

Definition at line 75 of file CTPPSPixelDQMSource.cc.

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

const int CTPPSPixelDQMSource::RPn_first = 3
private

Definition at line 54 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSPixelDQMSource::RPn_last = 4
private

Definition at line 54 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

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

Definition at line 73 of file CTPPSPixelDQMSource.cc.

int CTPPSPixelDQMSource::RPstatus[NStationMAX][NRPotsMAX]
private

Definition at line 93 of file CTPPSPixelDQMSource.cc.

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

unsigned int CTPPSPixelDQMSource::rpStatusWord = 0x8000
private

Definition at line 92 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun().

int CTPPSPixelDQMSource::StationStatus[NStationMAX]
private

Definition at line 94 of file CTPPSPixelDQMSource.cc.

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

CTPPSPixelIndices CTPPSPixelDQMSource::thePixIndices
private

Definition at line 59 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

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

Definition at line 46 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and CTPPSPixelDQMSource().

unsigned int CTPPSPixelDQMSource::verbosity
private

Definition at line 44 of file CTPPSPixelDQMSource.cc.

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