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
 
 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 beginLuminosityBlock (edm::LuminosityBlock const &lumi, 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 endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
 
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]
 
MonitorElementhp2HitsOcc [NArms][NStationMAX]
 
MonitorElementhp2xyADC [RPotsTotalNumber][NplaneMAX]
 
MonitorElementhRPotActivBX [RPotsTotalNumber]
 
MonitorElementhRPotActivBXroc [RPotsTotalNumber]
 
MonitorElementhRPotActivPlanes [RPotsTotalNumber]
 
MonitorElementhRPotActivROCs [RPotsTotalNumber]
 
MonitorElementhRPotActivROCsMax [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 135 of file CTPPSPixelDQMSource.cc.

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

135  :
136  verbosity(ps.getUntrackedParameter<unsigned int>("verbosity", 0)),
137  rpStatusWord(ps.getUntrackedParameter<unsigned int>("RPStatusWord",0x8000))
138 {
139  tokenDigi = consumes<DetSetVector<CTPPSPixelDigi> >(ps.getParameter<edm::InputTag>("tagRPixDigi"));
140 // tokenCluster=consumes<DetSetVector<CTPPSPixelCluster>>(ps.getParameter<edm::InputTag>("tagRPixCluster"));
141 
142 }
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 146 of file CTPPSPixelDQMSource.cc.

147 {
148 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 337 of file CTPPSPixelDQMSource.cc.

References ecalMGPA::adc(), CTPPSDetId::arm(), edm::DetSet< T >::begin(), edm::EventBase::bunchCrossing(), cuy::col, MonitorElement::Fill(), getDet(), getPixPlane(), getPlaneIndex(), getRPindex(), h2HitsMultipl, h2HitsMultROC, h2PlaneActive, h2xyHits, h2xyROCadc, h2xyROCHits, hBX, hBXshort, hHitsMult, HitsMultPlane, HitsMultROC, hp2HitsOcc, hp2xyADC, hRPotActivBX, hRPotActivBXroc, hRPotActivPlanes, hRPotActivROCs, hRPotActivROCsMax, diffTreeTool::index, edm::HandleBase::isValid(), hpstanc_transforms::max, multHits, 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.

338 {
339  ++nEvents;
340  int RPactivity[2][NRPotsMAX];
341  for(int arm = 0; arm <2; arm++) {
342  for(int rp=0; rp<NRPotsMAX; rp++) {
343  RPactivity[arm][rp] = 0;
344  }
345  }
346  for(int ind=0; ind<2*3*NRPotsMAX; ind++) {
347  for(int p=0; p<NplaneMAX; p++) {
348  HitsMultPlane[ind][p] = 0;
349  }
350  }
351  for(int ind=0; ind<2*3*NRPotsMAX*NplaneMAX; ind++) {
352  for(int rp=0; rp<NROCsMAX; rp++) {
353  HitsMultROC[ind][rp] = 0;
354  }
355  }
357  event.getByToken(tokenDigi, pixDigi);
358 
359  hBX->Fill(event.bunchCrossing());
360  hBXshort->Fill(event.bunchCrossing());
361 
362  bool valid = false;
363  valid |= pixDigi.isValid();
364 // valid |= Clus.isValid();
365 
366  if(!valid && verbosity) LogPrint("CTPPSPixelDQMSource") <<"No valid data in Event "<<nEvents;
367 
368  if(pixDigi.isValid()) {
369  for(const auto &ds_digi : *pixDigi) {
370  int idet = getDet(ds_digi.id);
371  if(idet != DetId::VeryForward) {
372  if(verbosity>1) LogPrint("CTPPSPixelDQMSource") <<"not CTPPS: ds_digi.id"<<ds_digi.id;
373  continue;
374  }
375  // int subdet = getSubdet(ds_digi.id);
376 
377  int plane = getPixPlane(ds_digi.id);
378 
379  CTPPSDetId theId(ds_digi.id);
380  int arm = theId.arm()&0x1;
381  int station = theId.station()&0x3;
382  int rpot = theId.rp()&0x7;
383  RPactivity[arm][rpot] = 1;
384 
385  if(StationStatus[station] && RPstatus[station][rpot]) {
386 
387  hp2HitsOcc[arm][station]->Fill(plane,rpot,(int)ds_digi.data.size());
388  h2HitsMultipl[arm][station]->Fill(prIndex(rpot,plane),ds_digi.data.size());
389  h2PlaneActive[arm][station]->Fill(plane,rpot);
390 
391  int index = getRPindex(arm,station,rpot);
392  HitsMultPlane[index][plane] += ds_digi.data.size();
393  if(RPindexValid[index]) {
394  hHitsMult[index][plane]->Fill(ds_digi.data.size());
395  }
396  int rocHistIndex = getPlaneIndex(arm,station,rpot,plane);
397 
398  for(DetSet<CTPPSPixelDigi>::const_iterator dit = ds_digi.begin();
399  dit != ds_digi.end(); ++dit) {
400  int row = dit->row();
401  int col = dit->column();
402  int adc = dit->adc();
403 
404  if(RPindexValid[index]) {
405  h2xyHits[index][plane]->Fill(col,row);
406  hp2xyADC[index][plane]->Fill(col,row,adc);
407  int colROC, rowROC;
408  int trocId;
409  if(!thePixIndices.transformToROC(col,row, trocId, colROC, rowROC)) {
410  if(trocId>=0 && trocId<NROCsMAX) {
411  h2xyROCHits[rocHistIndex][trocId]->Fill(rowROC,colROC);
412  h2xyROCadc[rocHistIndex][trocId]->Fill(rowROC,colROC,adc);
413  ++HitsMultROC[rocHistIndex][trocId];
414  }
415  }
416  } //end if(RPindexValid[index]) {
417  }
418 
419  if(int(ds_digi.data.size()) > multHits) multHits = ds_digi.data.size();
420  } // end if(StationStatus[station]) {
421  } // end for(const auto &ds_digi : *pixDigi)
422  } //if(pixDigi.isValid()) {
423 
424  for(int arm=0; arm<2; arm++) {
425  for(int stn=0; stn<NStationMAX; stn++) {
426  for(int rp=0; rp<NRPotsMAX; rp++) {
427  int index = getRPindex(arm,stn,rp);
428  if(RPindexValid[index]==0) continue;
429  if(RPactivity[arm][rp]==0) continue;
430 
431  int np = 0;
432  for(int p=0; p<NplaneMAX; p++) {
433  if(HitsMultPlane[index][p]>0) np++;
434  }
436  if(np>5) { hRPotActivBX[index]->Fill(event.bunchCrossing());}
437 
438  int rocf[NplaneMAX];
439  for(int r=0; r<NROCsMAX; r++) { rocf[r]=0; }
440  for(int p=0; p<NplaneMAX; p++) {
441  int indp = getPlaneIndex(arm,stn,rp,p);
442  for(int r=0; r<NROCsMAX; r++) {
443  if(HitsMultROC[indp][r] > 0) ++rocf[r];
444  }
445  for(int r=0; r<NROCsMAX; r++) {
446  h2HitsMultROC[index]->Fill(p,r,HitsMultROC[indp][r]);
447  }
448  }
449  int max = 0;
450  for(int r=0; r<NROCsMAX; r++) {
451  if(max < rocf[r]) { max = rocf[r]; }
452  }
453  for(int r=0; r<NROCsMAX; r++) {
454  hRPotActivROCs[index]->Fill(r,rocf[r]);
455  }
456  for(int r=0; r<NROCsMAX; r++) {
457  if(rocf[r] == max) {hRPotActivROCsMax[index]->Fill(r,max);}
458  }
459  if(max > 4) hRPotActivBXroc[index]->Fill(event.bunchCrossing());
460  }
461  }
462  }
463 
464  if((nEvents % 100)) return;
465  if(verbosity) LogPrint("CTPPSPixelDQMSource")<<"analyze event "<<nEvents;
466 }
int adc(sample_type sample)
get the ADC sample (12 bits)
MonitorElement * hHitsMult[RPotsTotalNumber][NplaneMAX]
int HitsMultPlane[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2xyADC[RPotsTotalNumber][NplaneMAX]
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
MonitorElement * hp2HitsOcc[NArms][NStationMAX]
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
MonitorElement * hRPotActivROCsMax[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
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]
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::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 331 of file CTPPSPixelDQMSource.cc.

333 {
334 }
void CTPPSPixelDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 179 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, hp2HitsOcc, hp2xyADC, hRPotActivBX, hRPotActivBXroc, hRPotActivPlanes, hRPotActivROCs, hRPotActivROCsMax, diffTreeTool::index, pileupCalc::nbins, CTPPSDetId::nFull, CTPPSDetId::nPath, NplaneMAX, NROCsMAX, CTPPSDetId::nShort, NStationMAX, AlCaHLTBitMon_ParallelJobs::p, pixRowMAX, 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.

181 {
182  ibooker.cd();
183  ibooker.setCurrentFolder("CTPPS/TrackingPixel");
184  char s[50];
185  hBX = ibooker.book1D("events per BX", "ctpps_pixel;Event.BX", 4002, -1.5, 4000. +0.5);
186  hBXshort = ibooker.book1D("events per BX(short)", "ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
187 
188  for(int arm=0; arm<2; arm++) {
190  string sd, armTitle;
191  ID.armName(sd, CTPPSDetId::nPath);
192  ID.armName(armTitle, CTPPSDetId::nFull);
193 
194  ibooker.setCurrentFolder(sd);
195 
196  for(int stn=2; stn<NStationMAX; stn++) {
197  if(StationStatus[stn]==0) continue;
198  ID.setStation(stn);
199  string stnd, stnTitle;
200 
201  CTPPSDetId(ID.getStationId()).stationName(stnd, CTPPSDetId::nPath);
202  CTPPSDetId(ID.getStationId()).stationName(stnTitle, CTPPSDetId::nFull);
203 
204  ibooker.setCurrentFolder(stnd);
205 
206  string st = "planes activity";
207  string st2 = ": " + stnTitle;
208 
209  int rpnbins = RPn_last-RPn_first;
210 
211  h2PlaneActive[arm][stn] = ibooker.book2DD(st,st+st2+";Plane #",
212  NplaneMAX,0,NplaneMAX, rpnbins, RPn_first,RPn_last);
213  TH2D *h = h2PlaneActive[arm][stn]->getTH2D();
214  h->SetOption("colz");
215  TAxis *yah = h->GetYaxis();
216 
217  st = "hit average multiplicity in planes";
218 
219  hp2HitsOcc[arm][stn]= ibooker.bookProfile2D(st,st+st2+";Plane #",
220  NplaneMAX, 0, NplaneMAX, rpnbins, RPn_first,RPn_last,0,20000);
221  TProfile2D *h2 = hp2HitsOcc[arm][stn]->getTProfile2D();
222  h2->SetOption("textcolz");
223  TAxis *yah2 = h2->GetYaxis();
224 
225  int xmax = NplaneMAX*rpnbins;
226 
227  st = "hit multiplicity in planes";
228  string st3 = ";PlaneIndex(=pixelPot*PlaneMAX + plane)";
229  h2HitsMultipl[arm][stn]= ibooker.book2DD(st,st+st2+st3+";multiplicity",
230  xmax,0,xmax,hitMultMAX,0,hitMultMAX);
231  h2HitsMultipl[arm][stn]->getTH2D()->SetOption("colz");
232 
233  st = "cluster multiplicity in planes";
234  h2ClusMultipl[arm][stn] = ibooker.book2DD(st,st+st2+st3+";multiplicity",
235  xmax,0,xmax, ClusMultMAX,0,ClusMultMAX);
236  h2ClusMultipl[arm][stn]->getTH2D()->SetOption("colz");
237 
238  st = "cluster size in planes";
239  h2CluSize[arm][stn] = ibooker.book2D(st,st+st2+st3+";Cluster size",
240  xmax,0,xmax, CluSizeMAX,0,CluSizeMAX);
241  h2CluSize[arm][stn]->getTH2F()->SetOption("colz");
242 
243 //--------- Hits ---
244  int pixBinW = 4;
245  for(int rp=RPn_first; rp<RPn_last; rp++) { // only installed pixel pots
246  ID.setRP(rp);
247  string rpd, rpTitle;
248  CTPPSDetId(ID.getRPId()).rpName(rpTitle, CTPPSDetId::nShort);
249  yah->SetBinLabel(rp - RPn_first +1, rpTitle.c_str()); // h
250  yah2->SetBinLabel(rp - RPn_first +1, rpTitle.c_str()); //h2
251 
252  if(RPstatus[stn][rp]==0) continue;
253  int indexP = getRPindex(arm,stn,rp);
254  RPindexValid[indexP] = 1;
255 
256  CTPPSDetId(ID.getRPId()).rpName(rpTitle, CTPPSDetId::nFull);
257  CTPPSDetId(ID.getRPId()).rpName(rpd, CTPPSDetId::nPath);
258 
259  ibooker.setCurrentFolder(rpd);
260 
261  hRPotActivPlanes[indexP] =
262  ibooker.book1D("number of fired planes per event", rpTitle+";nPlanes",
263  NplaneMAX, -0.5, NplaneMAX+0.5);
264  hRPotActivBX[indexP] =
265  ibooker.book1D("5 fired planes per BX", rpTitle+";Event.BX", 4002, -1.5, 4000.+0.5);
266  hRPotActivBXroc[indexP] =
267  ibooker.book1D("4 fired ROCs per BX", rpTitle+";Event.BX", 4002, -1.5, 4000.+0.5);
268 
269  h2HitsMultROC[indexP] = ibooker.bookProfile2D("ROCs hits multiplicity per event",
270  rpTitle+";plane # ;ROC #", NplaneMAX,-0.5,NplaneMAX-0.5, NROCsMAX,-0.5,NROCsMAX-0.5, 100,0,1.e3);
271 
272  h2HitsMultROC[indexP]->getTProfile2D()->SetOption("colztext");
273  h2HitsMultROC[indexP]->getTProfile2D()->SetMinimum(1.e-10);
274 
275  hRPotActivROCs[indexP] = ibooker.book2D("number of fired aligned_ROCs per event",
276  rpTitle+";ROC ID;number of fired ROCs", NROCsMAX,-0.5,NROCsMAX-0.5, 7,-0.5,6.5);
277  hRPotActivROCs[indexP]->getTH2F()->SetOption("colz");
278 
279  hRPotActivROCsMax[indexP]= ibooker.book2D("max number of fired aligned_ROCs per event",
280  rpTitle+";ROC ID;number of fired ROCs", NROCsMAX,-0.5,NROCsMAX-0.5, 7,-0.5,6.5);
281  hRPotActivROCsMax[indexP]->getTH2F()->SetOption("colz");
282 
283  int nbins = pixRowMAX/pixBinW;
284 
285  for(int p=0; p<NplaneMAX; p++) {
286  sprintf(s,"plane_%d",p);
287  string pd = rpd+"/"+string(s);
288  ibooker.setCurrentFolder(pd);
289  string st1 = ": "+rpTitle+"_"+string(s);
290  st = "hits position";
291  h2xyHits[indexP][p]=ibooker.book2DD(st,st1+";pix col;pix row",
292  nbins,0,pixRowMAX,nbins,0,pixRowMAX);
293  h2xyHits[indexP][p]->getTH2D()->SetOption("colz");
294 
295  st = "adc average value";
296  hp2xyADC[indexP][p]=ibooker.bookProfile2D(st,st1+";pix col;pix row",
297  nbins,0,pixRowMAX,nbins,0,pixRowMAX,100,0,1.e10,"");
298  hp2xyADC[indexP][p]->getTProfile2D()->SetOption("colz");
299 
300  st = "hits multiplicity";
301  hHitsMult[indexP][p]=ibooker.book1DD(st,st1+";number of hits;N / 1 hit",
303 
304  ibooker.setCurrentFolder(pd + "/ROCs");
305  int index = getPlaneIndex(arm,stn,rp,p);
306 
307  for(int roc=0; roc<6; roc++) {
308  sprintf(s,"ROC_%d",roc);
309  string st2 = st1 + "_" + string(s);
310  ibooker.setCurrentFolder(pd + "/ROCs/" + string(s));
311 
312  h2xyROCHits[index][roc]=ibooker.book2DD("hits",st2+";pix row;pix col",
314  h2xyROCHits[index][roc]->getTH2D()->SetOption("colz");
315 
316  string st = "adc average value";
317  h2xyROCadc[index][roc]=ibooker.bookProfile2D(st,st2+";pix row;pix col",
319  h2xyROCadc[index][roc]->getTProfile2D()->SetOption("colz");
320  }
321  } // end of for(int p=0; p<NplaneMAX;..
322 
323  } // end for(int rp=0; rp<NRPotsMAX;...
324  } // end of for(int stn=0; stn<
325  } //end of for(int arm=0; arm<2;...
326 
327  return;
328 }
MonitorElement * hHitsMult[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2xyADC[RPotsTotalNumber][NplaneMAX]
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
MonitorElement * hRPotActivROCsMax[RPotsTotalNumber]
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]
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 152 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.

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

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 469 of file CTPPSPixelDQMSource.cc.

470 {
471 }
void CTPPSPixelDQMSource::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 474 of file CTPPSPixelDQMSource.cc.

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

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

Definition at line 115 of file CTPPSPixelDQMSource.cc.

References DetId::kDetOffset.

Referenced by analyze().

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

Definition at line 117 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

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

Definition at line 106 of file CTPPSPixelDQMSource.cc.

References getRPindex().

Referenced by analyze(), and bookHistograms().

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

Definition at line 99 of file CTPPSPixelDQMSource.cc.

References relativeConstraints::station.

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

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

Definition at line 113 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

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

Member Data Documentation

const int CTPPSPixelDQMSource::CluSizeMAX = 25
private

Definition at line 59 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

int CTPPSPixelDQMSource::cluSizeMaxData
private

Definition at line 121 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun(), and endRun().

const int CTPPSPixelDQMSource::ClusMultMAX = 90
private

Definition at line 58 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

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

Definition at line 74 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

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

Definition at line 73 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

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

Definition at line 71 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::h2HitsMultROC[RPotsTotalNumber]
private

Definition at line 82 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 72 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 86 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 89 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 88 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hBX
private

Definition at line 68 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement * CTPPSPixelDQMSource::hBXshort
private

Definition at line 68 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 85 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

const int CTPPSPixelDQMSource::hitMultMAX = 300
private

Definition at line 57 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

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

Definition at line 91 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

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

Definition at line 90 of file CTPPSPixelDQMSource.cc.

Referenced by analyze().

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

Definition at line 70 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 87 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hRPotActivBX[RPotsTotalNumber]
private

Definition at line 80 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hRPotActivBXroc[RPotsTotalNumber]
private

Definition at line 81 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hRPotActivPlanes[RPotsTotalNumber]
private

Definition at line 79 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hRPotActivROCs[RPotsTotalNumber]
private

Definition at line 83 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* CTPPSPixelDQMSource::hRPotActivROCsMax[RPotsTotalNumber]
private

Definition at line 84 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

const int CTPPSPixelDQMSource::IndexNotValid = 0
private

Definition at line 97 of file CTPPSPixelDQMSource.cc.

int CTPPSPixelDQMSource::multClus
private

Definition at line 121 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun(), and endRun().

int CTPPSPixelDQMSource::multHits
private

Definition at line 121 of file CTPPSPixelDQMSource.cc.

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

int CTPPSPixelDQMSource::NArms =2
staticprivate

Definition at line 51 of file CTPPSPixelDQMSource.cc.

long int CTPPSPixelDQMSource::nEvents = 0
private

Definition at line 66 of file CTPPSPixelDQMSource.cc.

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

int CTPPSPixelDQMSource::NplaneMAX =6
staticprivate

Definition at line 54 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

int CTPPSPixelDQMSource::NROCsMAX = 6
staticprivate

Definition at line 55 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

int CTPPSPixelDQMSource::NRPotsMAX =6
staticprivate

Definition at line 53 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

int CTPPSPixelDQMSource::NStationMAX =3
staticprivate

Definition at line 52 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and bookHistograms().

int CTPPSPixelDQMSource::pixColMAX = 156
private

Definition at line 63 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun().

int CTPPSPixelDQMSource::pixRowMAX = 160
private

Definition at line 62 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms(), and dqmBeginRun().

int CTPPSPixelDQMSource::ROCSizeInX = pixRowMAX/2
private

Definition at line 64 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms(), and dqmBeginRun().

int CTPPSPixelDQMSource::ROCSizeInY = pixColMAX/3
private

Definition at line 65 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms(), and dqmBeginRun().

int CTPPSPixelDQMSource::RPindexValid[RPotsTotalNumber]
private

Definition at line 78 of file CTPPSPixelDQMSource.cc.

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

const int CTPPSPixelDQMSource::RPn_first = 3
private

Definition at line 56 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSPixelDQMSource::RPn_last = 4
private

Definition at line 56 of file CTPPSPixelDQMSource.cc.

Referenced by bookHistograms().

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

Definition at line 76 of file CTPPSPixelDQMSource.cc.

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

Definition at line 95 of file CTPPSPixelDQMSource.cc.

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

unsigned int CTPPSPixelDQMSource::rpStatusWord = 0x8000
private

Definition at line 94 of file CTPPSPixelDQMSource.cc.

Referenced by dqmBeginRun().

int CTPPSPixelDQMSource::StationStatus[NStationMAX]
private

Definition at line 96 of file CTPPSPixelDQMSource.cc.

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

CTPPSPixelIndices CTPPSPixelDQMSource::thePixIndices
private

Definition at line 61 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

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

Definition at line 48 of file CTPPSPixelDQMSource.cc.

Referenced by analyze(), and CTPPSPixelDQMSource().

unsigned int CTPPSPixelDQMSource::verbosity
private

Definition at line 46 of file CTPPSPixelDQMSource.cc.

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