CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
CTPPSDiamondDQMSource Class Reference
Inheritance diagram for CTPPSDiamondDQMSource:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  ChannelPlots
 plots related to one Diamond channel More...
 
struct  GlobalPlots
 plots related to the whole system More...
 
struct  PlanePlots
 plots related to one Diamond plane More...
 
struct  PotPlots
 plots related to one Diamond detector package More...
 

Public Member Functions

 CTPPSDiamondDQMSource (const edm::ParameterSet &)
 
 ~CTPPSDiamondDQMSource () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
- 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 Attributes

int centralOOT_
 
std::unordered_map< unsigned int, ChannelPlotschannelPlots_
 
int EC_difference_45_
 
int EC_difference_56_
 
bool excludeMultipleHits_
 
GlobalPlots globalPlot_
 
double maximumStripAngleForTomography_
 
double minimumStripAngleForTomography_
 
std::unordered_map< unsigned int, PlanePlotsplanePlots_
 
std::unordered_map< unsigned int, PotPlotspotPlots_
 
std::vector< std::pair< edm::EventRange, int > > runParameters_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHit_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > tokenDiamondTrack_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > tokenDigi_
 
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
 
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
 
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus_
 
unsigned int verbosity_
 

Static Private Attributes

static const int CHANNEL_OF_VFAT_CLOCK = 30
 
static const int CTPPS_DIAMOND_NUM_OF_CHANNELS = 12
 
static const int CTPPS_DIAMOND_NUM_OF_PLANES = 4
 
static const int CTPPS_DIAMOND_RP_ID = 6
 
static const int CTPPS_DIAMOND_STATION_ID = 1
 
static const int CTPPS_FAR_RP_ID = 3
 
static const int CTPPS_FED_ID_45 = 583
 
static const int CTPPS_FED_ID_56 = 582
 
static const int CTPPS_NEAR_RP_ID = 2
 
static const int CTPPS_NUM_OF_ARMS = 2
 
static const double DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
 
static const double HPTDC_BIN_WIDTH_NS = 25./1024
 
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM = 1./DISPLAY_RESOLUTION_FOR_HITS_MM
 
static const double SEC_PER_LUMI_SECTION = 23.31
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 39 of file CTPPSDiamondDQMSource.cc.

Constructor & Destructor Documentation

CTPPSDiamondDQMSource::CTPPSDiamondDQMSource ( const edm::ParameterSet ps)

Definition at line 338 of file CTPPSDiamondDQMSource.cc.

References edm::ParameterSet::getParameter(), muonDTDigis_cfi::pset, and runParameters_.

338  :
344  tokenFEDInfo_ ( consumes< std::vector<TotemFEDInfo> > ( ps.getParameter<edm::InputTag>( "tagFEDInfo" ) ) ),
345  excludeMultipleHits_ ( ps.getParameter<bool>( "excludeMultipleHits" ) ),
346  minimumStripAngleForTomography_( ps.getParameter<double>( "minimumStripAngleForTomography" ) ),
347  maximumStripAngleForTomography_( ps.getParameter<double>( "maximumStripAngleForTomography" ) ),
348  centralOOT_( -999 ),
349  verbosity_ ( ps.getUntrackedParameter<unsigned int>( "verbosity", 0 ) ),
350  EC_difference_56_( -500 ), EC_difference_45_( -500 )
351 {
352  for ( const auto& pset : ps.getParameter< std::vector<edm::ParameterSet> >( "offsetsOOT" ) ) {
353  runParameters_.emplace_back( std::make_pair( pset.getParameter<edm::EventRange>( "validityRange" ), pset.getParameter<int>( "centralOOT" ) ) );
354  }
355 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > tokenDigi_
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< std::pair< edm::EventRange, int > > runParameters_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > tokenDiamondTrack_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHit_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus_
CTPPSDiamondDQMSource::~CTPPSDiamondDQMSource ( )
override

Definition at line 359 of file CTPPSDiamondDQMSource.cc.

360 {}

Member Function Documentation

void CTPPSDiamondDQMSource::analyze ( const edm::Event event,
const edm::EventSetup  
)
overrideprotected

Definition at line 413 of file CTPPSDiamondDQMSource.cc.

References CTPPSDetId::arm(), edm::EventBase::bunchCrossing(), centralOOT_, CHANNEL_OF_VFAT_CLOCK, channelPlots_, CTPPS_FAR_RP_ID, CTPPS_FED_ID_45, CTPPS_FED_ID_56, TauDecayModes::dec, EC_difference_45_, EC_difference_56_, excludeMultipleHits_, MonitorElement::Fill(), HcalObjRepresent::Fill(), HPTDCErrorFlags::getErrorId(), globalPlot_, CTPPSDiamondDQMSource::GlobalPlots::h_trackCorr_hor, HPTDC_BIN_WIDTH_NS, mps_fire::i, edm::eventsetup::heterocontainer::insert(), INV_DISPLAY_RESOLUTION_FOR_HITS_MM, edm::HandleBase::isValid(), maximumStripAngleForTomography_, minimumStripAngleForTomography_, planePlots_, potPlots_, TrackInfoProducer_cfi::rechits, CTPPSDiamondDetId::setChannel(), CTPPSDiamondDetId::setPlane(), mps_update::status, tokenDiamondHit_, tokenDiamondTrack_, tokenDigi_, tokenFEDInfo_, tokenLocalTrack_, tokenStatus_, HiIsolationCommonParameters_cff::track, l1t::tracks, and verbosity_.

414 {
415  // get event data
417  event.getByToken( tokenStatus_, diamondVFATStatus );
418 
420  event.getByToken( tokenLocalTrack_, stripTracks );
421 
423  event.getByToken( tokenDigi_, diamondDigis );
424 
426  event.getByToken( tokenFEDInfo_, fedInfo );
427 
429  event.getByToken( tokenDiamondHit_, diamondRecHits );
430 
432  event.getByToken( tokenDiamondTrack_, diamondLocalTracks );
433 
434  // check validity
435  bool valid = true;
436  valid &= diamondVFATStatus.isValid();
437  valid &= diamondDigis.isValid();
438  valid &= fedInfo.isValid();
439 
440  if ( !valid ) {
441  if ( verbosity_ ) {
442  edm::LogProblem("CTPPSDiamondDQMSource")
443  << "ERROR in TotemDQMModuleRP::analyze > some of the required inputs are not valid. Skipping this event.\n"
444  << " diamondVFATStatus.isValid = " << diamondVFATStatus.isValid() << "\n"
445  << " diamondDigis.isValid = " << diamondDigis.isValid() << "\n"
446  << " fedInfo.isValid = " << fedInfo.isValid();
447  }
448 
449  return;
450  }
451 
452  //------------------------------
453  // RP Plots
454  //------------------------------
455 
456  //------------------------------
457  // Correlation Plots
458  //------------------------------
459 
460  for ( const auto& ds1 : *stripTracks ) {
461  for ( const auto& tr1 : ds1 ) {
462  if ( ! tr1.isValid() ) continue;
463 
464  CTPPSDetId rpId1( ds1.detId() );
465  unsigned int arm1 = rpId1.arm();
466  unsigned int stNum1 = rpId1.station();
467  unsigned int rpNum1 = rpId1.rp();
468  if (stNum1 != 0 || ( rpNum1 != 2 && rpNum1 != 3 ) ) continue;
469  unsigned int idx1 = arm1*3 + rpNum1-2;
470 
471  for ( const auto& ds2 : *stripTracks ) {
472  for ( const auto& tr2 : ds2 ) {
473  if ( ! tr2.isValid() ) continue;
474 
475  CTPPSDetId rpId2(ds2.detId());
476  unsigned int arm2 = rpId2.arm();
477  unsigned int stNum2 = rpId2.station();
478  unsigned int rpNum2 = rpId2.rp();
479  if (stNum2 != 0 || ( rpNum2 != 2 && rpNum2 != 3 ) ) continue;
480  unsigned int idx2 = arm2*3 + rpNum2-2;
481 
482  if ( idx1 >= idx2 ) globalPlot_.h_trackCorr_hor->Fill( 5-idx1, idx2 ); // strips-strips
483  }
484  }
485  for ( const auto& ds2 : *diamondLocalTracks ) {
486  for ( const auto& tr2 : ds2 ) {
487  if ( ! tr2.isValid() ) continue;
488  if ( centralOOT_ != -999 && tr2.getOOTIndex() != centralOOT_ ) continue;
489  if ( excludeMultipleHits_ && tr2.getMultipleHits() > 0 ) continue;
490 
491  CTPPSDetId diamId2( ds2.detId() );
492  unsigned int arm2 = diamId2.arm();
493  if ( idx1 >= arm2*3+2 )
494  globalPlot_.h_trackCorr_hor->Fill( 5-idx1, arm2*3+2 ); // strips-diamonds
495  else
496  globalPlot_.h_trackCorr_hor->Fill( 5-(arm2*3+2 ),idx1 ); // strips-diamonds
497  }
498  }
499  }
500  }
501 
502  for ( const auto& ds1 : *diamondLocalTracks ) {
503  for ( const auto& tr1 : ds1 ) {
504  if ( ! tr1.isValid() ) continue;
505  if ( excludeMultipleHits_ && tr1.getMultipleHits() > 0 ) continue;
506  if ( centralOOT_ != -999 && tr1.getOOTIndex() != centralOOT_ ) continue;
507 
508  CTPPSDetId diamId1( ds1.detId() );
509  unsigned int arm1 = diamId1.arm();
510 
511  globalPlot_.h_trackCorr_hor->Fill( 5-(arm1*3+2), arm1*3+2 ); // diamonds-diamonds
512 
513  for ( const auto& ds2 : *diamondLocalTracks ) {
514  for ( const auto& tr2 : ds2 ) {
515  if ( ! tr2.isValid() ) continue;
516  if ( excludeMultipleHits_ && tr2.getMultipleHits() > 0 ) continue;
517  if ( centralOOT_ != -999 && tr2.getOOTIndex() != centralOOT_ ) continue;
518 
519  CTPPSDetId diamId2( ds2.detId() );
520  unsigned int arm2 = diamId2.arm();
521  if ( arm1 > arm2 ) globalPlot_.h_trackCorr_hor->Fill( 5-(arm1*3+2), arm2*3+2 ); // diamonds-diamonds
522  }
523  }
524  }
525  }
526 
527 
528  // Using CTPPSDiamondDigi
529  for ( const auto& digis : *diamondDigis ) {
530  const CTPPSDiamondDetId detId( digis.detId() );
531  CTPPSDiamondDetId detId_pot( digis.detId() );
532 
533  for ( const auto& digi : digis ) {
534  detId_pot.setPlane( 0 );
535  detId_pot.setChannel( 0 );
536  if ( detId.channel() == CHANNEL_OF_VFAT_CLOCK ) continue;
537  if ( potPlots_.find( detId_pot ) == potPlots_.end() ) continue;
538  //Leading without trailing investigation
539  if ( digi.getLeadingEdge() != 0 || digi.getTrailingEdge() != 0 ) {
540  ++(potPlots_[detId_pot].HitCounter);
541  if ( digi.getLeadingEdge() != 0 && digi.getTrailingEdge() == 0 ) {
542  ++(potPlots_[detId_pot].LeadingOnlyCounter);
543  potPlots_[detId_pot].leadingEdgeCumulative_le->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
544  }
545  if ( digi.getLeadingEdge() == 0 && digi.getTrailingEdge() != 0 ) {
546  ++(potPlots_[detId_pot].TrailingOnlyCounter);
547  potPlots_[detId_pot].trailingEdgeCumulative_te->Fill( HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
548  }
549  if ( digi.getLeadingEdge() != 0 && digi.getTrailingEdge() != 0 ) {
550  ++(potPlots_[detId_pot].CompleteCounter);
551  potPlots_[detId_pot].leadingTrailingCorrelationPot->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge(), HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
552  }
553  }
554 
555  // HPTDC Errors
556  const HPTDCErrorFlags hptdcErrors = digi.getHPTDCErrorFlags();
557  for ( unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex )
558  if ( hptdcErrors.getErrorId( hptdcErrorIndex-1 ) ) potPlots_[detId_pot].HPTDCErrorFlags_cumulative->Fill( hptdcErrorIndex );
559  if ( digi.getMultipleHit() ) ++(potPlots_[detId_pot].MHCounter);
560  }
561  }
562 
563  // EC Errors
564  for ( const auto& vfat_status : *diamondVFATStatus ) {
565  const CTPPSDiamondDetId detId( vfat_status.detId() );
566  CTPPSDiamondDetId detId_pot( vfat_status.detId() );
567  detId_pot.setPlane( 0 );
568  detId_pot.setChannel( 0 );
569  for ( const auto& status : vfat_status ) {
570  if ( !status.isOK() ) continue;
571  if ( potPlots_.find(detId_pot) == potPlots_.end() ) continue;
572 
573  // Check Event Number
574  for ( const auto& optorx : *fedInfo ) {
575  if ( detId.arm() == 1 && optorx.getFEDId() == CTPPS_FED_ID_56 ) {
576  potPlots_[detId_pot].ECCheck->Fill((int)((optorx.getLV1()& 0xFF)-((unsigned int) status.getEC() & 0xFF)) & 0xFF);
577  if ( ( static_cast<int>( ( optorx.getLV1() & 0xFF )-status.getEC() ) != EC_difference_56_ ) && ( static_cast<uint8_t>( ( optorx.getLV1() & 0xFF )-status.getEC() ) < 128 ) )
578  EC_difference_56_ = static_cast<int>( optorx.getLV1() & 0xFF )-( static_cast<unsigned int>( status.getEC() ) & 0xFF );
579  if ( EC_difference_56_ != 1 && EC_difference_56_ != -500 && EC_difference_56_ < 128 && EC_difference_56_ > -128 )
580  if (verbosity_)
581  edm::LogProblem("CTPPSDiamondDQMSource") << "FED " << CTPPS_FED_ID_56 << ": ECError at EV: 0x"<< std::hex << optorx.getLV1()
582  << "\t\tVFAT EC: 0x"<< static_cast<unsigned int>( status.getEC() )
583  << "\twith ID: " << std::dec << detId
584  << "\tdiff: " << EC_difference_56_;
585  }
586  else if ( detId.arm() == 0 && optorx.getFEDId()== CTPPS_FED_ID_45 ) {
587  potPlots_[detId_pot].ECCheck->Fill((int)((optorx.getLV1()& 0xFF)-status.getEC()) & 0xFF);
588  if ( ( static_cast<int>( ( optorx.getLV1() & 0xFF )-status.getEC() ) != EC_difference_45_ ) && ( static_cast<uint8_t>( ( optorx.getLV1() & 0xFF )-status.getEC() ) < 128 ) )
589  EC_difference_45_ = static_cast<int>( optorx.getLV1() & 0xFF )-( static_cast<unsigned int>( status.getEC() ) & 0xFF );
590  if ( EC_difference_45_ != 1 && EC_difference_45_ != -500 && EC_difference_45_ < 128 && EC_difference_45_ > -128 )
591  if (verbosity_)
592  edm::LogProblem("CTPPSDiamondDQMSource") << "FED " << CTPPS_FED_ID_45 << ": ECError at EV: 0x"<< std::hex << optorx.getLV1()
593  << "\t\tVFAT EC: 0x"<< static_cast<unsigned int>( status.getEC() )
594  << "\twith ID: " << std::dec << detId
595  << "\tdiff: " << EC_difference_45_;
596  }
597  }
598  }
599  }
600 
601  // Using CTPPSDiamondRecHit
602  std::unordered_map<unsigned int, std::set<unsigned int> > planes;
603  std::unordered_map<unsigned int, std::set<unsigned int> > planes_inclusive;
604 
605 
606  for ( const auto& rechits : *diamondRecHits ) {
607  CTPPSDiamondDetId detId_pot( rechits.detId() );
608  detId_pot.setPlane( 0 );
609  detId_pot.setChannel( 0 );
610  const CTPPSDiamondDetId detId( rechits.detId() );
611 
612  for ( const auto& rechit : rechits ) {
613  planes_inclusive[detId_pot].insert( detId.plane() );
614  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
615  if ( rechit.getToT() != 0 && centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_ )
616  planes[detId_pot].insert( detId.plane() );
617 
618  if ( potPlots_.find( detId_pot ) == potPlots_.end() ) continue;
619 
620  float UFSDShift = 0.0;
621  if ( rechit.getYWidth() < 3 ) UFSDShift = 0.5; // Display trick for UFSD that have 2 pixels with same X
622 
623  if ( rechit.getToT() != 0 && centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_ ) {
624  TH2F *hitHistoTmp = potPlots_[detId_pot].hitDistribution2d->getTH2F();
625  TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
626  int startBin = hitHistoTmpYAxis->FindBin( rechit.getX() - 0.5*rechit.getXWidth() );
627  int numOfBins = rechit.getXWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
628  for ( int i=0; i<numOfBins; ++i) {
629  hitHistoTmp->Fill( detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin+i) );
630  }
631 
632  hitHistoTmp = potPlots_[detId_pot].hitDistribution2d_lumisection->getTH2F();
633  hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
634  startBin = hitHistoTmpYAxis->FindBin( rechit.getX() - 0.5*rechit.getXWidth() );
635  numOfBins = rechit.getXWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
636  for ( int i=0; i<numOfBins; ++i) {
637  hitHistoTmp->Fill( detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin+i) );
638  }
639 
640  }
641 
642  if ( rechit.getToT() != 0 ) {
643  // Both
644  potPlots_[detId_pot].leadingEdgeCumulative_both->Fill( rechit.getT() + 25*rechit.getOOTIndex() );
645  potPlots_[detId_pot].timeOverThresholdCumulativePot->Fill( rechit.getToT() );
646 
647  TH2F *hitHistoOOTTmp = potPlots_[detId_pot].hitDistribution2dOOT->getTH2F();
648  TAxis *hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
649  int startBin = hitHistoOOTTmpYAxis->FindBin( rechit.getX() - 0.5*rechit.getXWidth() );
650  int numOfBins = rechit.getXWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
651  for ( int i=0; i<numOfBins; ++i) {
652  hitHistoOOTTmp->Fill( detId.plane() + 0.2 * rechit.getOOTIndex(), hitHistoOOTTmpYAxis->GetBinCenter(startBin+i) );
653  }
654  }
655  else {
656  if ( rechit.getT() != 0 ) {
657  // Only leading
658  TH2F *hitHistoOOTTmp = potPlots_[detId_pot].hitDistribution2dOOT_le->getTH2F();
659  TAxis *hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
660  int startBin = hitHistoOOTTmpYAxis->FindBin( rechit.getX() - 0.5*rechit.getXWidth() );
661  int numOfBins = rechit.getXWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
662  for ( int i=0; i<numOfBins; ++i) {
663  hitHistoOOTTmp->Fill( detId.plane() + 0.2 * rechit.getOOTIndex(), hitHistoOOTTmpYAxis->GetBinCenter(startBin+i) );
664  }
665  }
666  }
667  if ( (unsigned int) rechit.getOOTIndex() < potPlots_[detId_pot].activity_per_bx.size() )
668  potPlots_[detId_pot].activity_per_bx.at( rechit.getOOTIndex() )->Fill( event.bunchCrossing() );
669  }
670  }
671 
672  for ( const auto& plt : potPlots_ ) {
673  plt.second.activePlanes->Fill( planes[plt.first].size() );
674  plt.second.activePlanesInclusive->Fill( planes_inclusive[plt.first].size() );
675  }
676 
677  // Using CTPPSDiamondLocalTrack
678  for ( const auto& tracks : *diamondLocalTracks ) {
679  CTPPSDiamondDetId detId_pot( tracks.detId() );
680  detId_pot.setPlane( 0 );
681  detId_pot.setChannel( 0 );
682  const CTPPSDiamondDetId detId( tracks.detId() );
683 
684  for ( const auto& track : tracks ) {
685  if ( ! track.isValid() ) continue;
686  if ( excludeMultipleHits_ && track.getMultipleHits() > 0 ) continue;
687  if ( potPlots_.find( detId_pot ) == potPlots_.end() ) continue;
688 
689  TH2F *trackHistoOOTTmp = potPlots_[detId_pot].trackDistributionOOT->getTH2F();
690  TAxis *trackHistoOOTTmpYAxis = trackHistoOOTTmp->GetYaxis();
691  int startBin = trackHistoOOTTmpYAxis->FindBin( track.getX0() - track.getX0Sigma() );
692  int numOfBins = 2*track.getX0Sigma()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
693  for ( int i=0; i<numOfBins; ++i) {
694  trackHistoOOTTmp->Fill( track.getOOTIndex(), trackHistoOOTTmpYAxis->GetBinCenter(startBin+i) );
695  }
696 
697  if ( centralOOT_ != -999 && track.getOOTIndex() == centralOOT_ ) {
698  TH1F *trackHistoInTimeTmp = potPlots_[detId_pot].trackDistribution->getTH1F();
699  int startBin = trackHistoInTimeTmp->FindBin( track.getX0() - track.getX0Sigma() );
700  int numOfBins = 2*track.getX0Sigma()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
701  for ( int i=0; i<numOfBins; ++i) {
702  trackHistoInTimeTmp->Fill( trackHistoInTimeTmp->GetBinCenter(startBin+i) );
703  }
704  }
705  }
706  }
707 
708  // Tomography of diamonds using strips
709  for ( const auto& rechits : *diamondRecHits ) {
710  CTPPSDiamondDetId detId_pot( rechits.detId() );
711  detId_pot.setPlane( 0 );
712  detId_pot.setChannel( 0 );
713  const CTPPSDiamondDetId detId( rechits.detId() );
714 
715  for ( const auto& rechit : rechits ) {
716  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
717  if ( rechit.getToT() == 0 ) continue;
718  if ( !stripTracks.isValid() ) continue;
719  if ( potPlots_.find( detId_pot ) == potPlots_.end() ) continue;
720 
721  for ( const auto& ds : *stripTracks ) {
722  const CTPPSDetId stripId( ds.detId() );
723  for ( const auto& striplt : ds ) {
724  if ( !striplt.isValid() ) continue;
725  if ( stripId.arm() != detId_pot.arm() ) continue;
726  if ( striplt.getTx() > maximumStripAngleForTomography_ || striplt.getTy() > maximumStripAngleForTomography_) continue;
727  if ( striplt.getTx() < minimumStripAngleForTomography_ || striplt.getTy() < minimumStripAngleForTomography_) continue;
728  if ( stripId.rp() == CTPPS_FAR_RP_ID ) {
729  if ( (unsigned int) rechit.getOOTIndex() < potPlots_[detId_pot].stripTomographyAllFar.size() )
730  potPlots_[detId_pot].stripTomographyAllFar.at( rechit.getOOTIndex() )->Fill( striplt.getX0() + 25*detId.plane(), striplt.getY0() );
731  }
732  }
733  }
734  }
735  }
736 
737  //------------------------------
738  // Clock Plots
739  //------------------------------
740 
741  for ( const auto& digis : *diamondDigis ) {
742  const CTPPSDiamondDetId detId( digis.detId() );
743  CTPPSDiamondDetId detId_pot( digis.detId() );
744  if ( detId.channel() == CHANNEL_OF_VFAT_CLOCK ) {
745  detId_pot.setPlane( 0 );
746  detId_pot.setChannel( 0 );
747  for ( const auto& digi : digis ) {
748  if ( digi.getLeadingEdge() != 0 ) {
749  if ( detId.plane() == 1 ) {
750  potPlots_[detId_pot].clock_Digi1_le->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
751  potPlots_[detId_pot].clock_Digi1_te->Fill( HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
752  }
753  if ( detId.plane() == 3 ) {
754  potPlots_[detId_pot].clock_Digi3_le->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
755  potPlots_[detId_pot].clock_Digi3_te->Fill( HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
756  }
757  }
758  }
759  }
760  }
761 
762  //------------------------------
763  // Plane Plots
764  //------------------------------
765 
766  // Using CTPPSDiamondDigi
767  std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
768  for ( const auto& digis : *diamondDigis ) {
769  const CTPPSDiamondDetId detId( digis.detId() );
770  CTPPSDiamondDetId detId_plane( digis.detId() );
771  for ( const auto& digi : digis ) {
772  detId_plane.setChannel( 0 );
773  if ( detId.channel() == CHANNEL_OF_VFAT_CLOCK ) continue;
774  if ( planePlots_.find( detId_plane ) == planePlots_.end() ) continue;
775 
776  if ( digi.getLeadingEdge() != 0 ) {
777  planePlots_[detId_plane].digiProfileCumulativePerPlane->Fill( detId.channel() );
778  if ( channelsPerPlane.find(detId_plane) != channelsPerPlane.end() ) channelsPerPlane[detId_plane]++;
779  else channelsPerPlane[detId_plane] = 0;
780  }
781  }
782  }
783 
784  for ( const auto& plt : channelsPerPlane ) {
785  planePlots_[plt.first].hit_multiplicity->Fill( plt.second );
786  }
787 
788  // Using CTPPSDiamondRecHit
789  for ( const auto& rechits : *diamondRecHits ) {
790  CTPPSDiamondDetId detId_plane( rechits.detId() );
791  detId_plane.setChannel( 0 );
792  for ( const auto& rechit : rechits ) {
793  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
794  if ( rechit.getToT() == 0 ) continue;
795  if ( planePlots_.find( detId_plane ) != planePlots_.end() ) {
796  if ( centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_ ) {
797  TH1F *hitHistoTmp = planePlots_[detId_plane].hitProfile->getTH1F();
798  int startBin = hitHistoTmp->FindBin( rechit.getX() - 0.5*rechit.getXWidth() );
799  int numOfBins = rechit.getXWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
800  for ( int i=0; i<numOfBins; ++i) {
801  hitHistoTmp->Fill( hitHistoTmp->GetBinCenter(startBin+i) );
802  }
803  }
804  }
805  }
806  }
807 
808  // Tomography of diamonds using strips
809  for ( const auto& rechits : *diamondRecHits ) {
810  CTPPSDiamondDetId detId_plane( rechits.detId() );
811  detId_plane.setChannel( 0 );
812  for ( const auto& rechit : rechits ) {
813  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
814  if ( rechit.getToT() == 0 ) continue;
815  if ( !stripTracks.isValid() ) continue;
816  if (planePlots_.find(detId_plane) == planePlots_.end()) continue;
817 
818  for ( const auto& ds : *stripTracks ) {
819  const CTPPSDetId stripId(ds.detId());
820  for ( const auto& striplt : ds ) {
821  if (! striplt.isValid()) continue;
822  if ( stripId.arm() != detId_plane.arm() ) continue;
823  if ( striplt.getTx() > maximumStripAngleForTomography_ || striplt.getTy() > maximumStripAngleForTomography_) continue;
824  if ( striplt.getTx() < minimumStripAngleForTomography_ || striplt.getTy() < minimumStripAngleForTomography_) continue;
825  if ( stripId.rp() == CTPPS_FAR_RP_ID ) {
826  planePlots_[detId_plane].stripTomography_far->Fill( striplt.getX0() + 25*rechit.getOOTIndex() , striplt.getY0() );
827  }
828  }
829  }
830  }
831  }
832  //------------------------------
833  // Channel Plots
834  //------------------------------
835 
836  //Check Event Number
837  for ( const auto& vfat_status : *diamondVFATStatus ) {
838  const CTPPSDiamondDetId detId( vfat_status.detId() );
839  for ( const auto& status : vfat_status ) {
840  if ( !status.isOK() ) continue;
841  if ( channelPlots_.find(detId) != channelPlots_.end() ) {
842  for ( const auto& optorx : *fedInfo ) {
843  if ( ( detId.arm() == 1 && optorx.getFEDId() == CTPPS_FED_ID_56 ) || ( detId.arm() == 0 && optorx.getFEDId() == CTPPS_FED_ID_45 ) ) {
844  channelPlots_[detId].ECCheckPerChannel->Fill((int)((optorx.getLV1()& 0xFF)-((unsigned int) status.getEC() & 0xFF)) & 0xFF);
845  }
846  }
847  }
848  }
849  }
850 
851  // digi profile cumulative
852  for ( const auto& digis : *diamondDigis ) {
853  const CTPPSDiamondDetId detId( digis.detId() );
854  for ( const auto& digi : digis ) {
855  if ( detId.channel() == CHANNEL_OF_VFAT_CLOCK ) continue;
856  if ( channelPlots_.find( detId ) != channelPlots_.end() ) {
857  // HPTDC Errors
858  const HPTDCErrorFlags hptdcErrors = digi.getHPTDCErrorFlags();
859  for ( unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex )
860  if ( hptdcErrors.getErrorId( hptdcErrorIndex-1 ) ) channelPlots_[detId].HPTDCErrorFlags->Fill( hptdcErrorIndex );
861  if ( digi.getMultipleHit() ) ++(channelPlots_[detId].MHCounter);
862 
863  // Check dropped trailing edges
864  if ( digi.getLeadingEdge() != 0 || digi.getTrailingEdge() != 0 ) {
865  ++(channelPlots_[detId].HitCounter);
866  if ( digi.getLeadingEdge() != 0 && digi.getTrailingEdge() == 0 ) {
867  ++(channelPlots_[detId].LeadingOnlyCounter);
868  channelPlots_[detId].leadingEdgeCumulative_le->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
869  }
870  if ( digi.getLeadingEdge() == 0 && digi.getTrailingEdge() != 0 ) {
871  ++(channelPlots_[detId].TrailingOnlyCounter);
872  channelPlots_[detId].trailingEdgeCumulative_te->Fill( HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
873  }
874  if ( digi.getLeadingEdge() != 0 && digi.getTrailingEdge() != 0 ) {
875  ++(channelPlots_[detId].CompleteCounter);
876  channelPlots_[detId].LeadingTrailingCorrelationPerChannel->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge(), HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
877  }
878  }
879  }
880  }
881  }
882 
883  // Using CTPPSDiamondRecHit
884  for ( const auto& rechits : *diamondRecHits ) {
885  CTPPSDiamondDetId detId( rechits.detId() );
886  for ( const auto& rechit : rechits ) {
887  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
888  if ( channelPlots_.find( detId ) != channelPlots_.end() ) {
889  if ( rechit.getToT() != 0 ) {
890  channelPlots_[detId].leadingEdgeCumulative_both->Fill( rechit.getT() + 25*rechit.getOOTIndex() );
891  channelPlots_[detId].TimeOverThresholdCumulativePerChannel->Fill( rechit.getToT() );
892  }
893  ++(channelPlots_[detId].hitsCounterPerLumisection);
894  }
895 
896  if ( (unsigned int) rechit.getOOTIndex() < channelPlots_[detId].activity_per_bx.size() )
897  channelPlots_[detId].activity_per_bx.at( rechit.getOOTIndex() )->Fill( event.bunchCrossing() );
898  }
899 
900  }
901 
902  // Tomography of diamonds using strips
903  for ( const auto& rechits : *diamondRecHits ) {
904  const CTPPSDiamondDetId detId( rechits.detId() );
905  for ( const auto& rechit : rechits ) {
906  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
907  if ( stripTracks.isValid() ) {
908  if (channelPlots_.find(detId) == channelPlots_.end()) continue;
909  for ( const auto& ds : *stripTracks ) {
910  for ( const auto& striplt : ds ) {
911  CTPPSDetId stripId(ds.detId());
912  if ( !striplt.isValid() ) continue;
913  if ( stripId.arm() != detId.arm() ) continue;
914  if ( striplt.getTx() > maximumStripAngleForTomography_ || striplt.getTy() > maximumStripAngleForTomography_) continue;
915  if ( striplt.getTx() < minimumStripAngleForTomography_ || striplt.getTy() < minimumStripAngleForTomography_) continue;
916  if ( stripId.rp() == CTPPS_FAR_RP_ID ) {
917  channelPlots_[detId].stripTomography_far->Fill( striplt.getX0() + 25*rechit.getOOTIndex(), striplt.getY0() );
918  }
919  }
920  }
921  }
922  }
923  }
924 }
static const int CTPPS_FED_ID_56
static const int CHANNEL_OF_VFAT_CLOCK
void setPlane(uint32_t channel)
void setChannel(uint32_t channel)
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > tokenDigi_
bool getErrorId(unsigned short id) const
int bunchCrossing() const
Definition: EventBase.h:66
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
void Fill(long long x)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:49
uint32_t arm() const
Definition: CTPPSDetId.h:52
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > tokenDiamondTrack_
static const double HPTDC_BIN_WIDTH_NS
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
std::unordered_map< unsigned int, PotPlots > potPlots_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHit_
static const int CTPPS_FAR_RP_ID
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
std::unordered_map< unsigned int, PlanePlots > planePlots_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
static const int CTPPS_FED_ID_45
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus_
void CTPPSDiamondDQMSource::beginLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
overrideprotected

Definition at line 404 of file CTPPSDiamondDQMSource.cc.

References plotFactory::plot, and potPlots_.

405 {
406  for ( auto& plot : potPlots_ )
407  plot.second.hitDistribution2d_lumisection->Reset();
408 }
std::unordered_map< unsigned int, PotPlots > potPlots_
void CTPPSDiamondDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 379 of file CTPPSDiamondDQMSource.cc.

References DQMStore::IBooker::cd(), channelPlots_, CTPPS_DIAMOND_NUM_OF_CHANNELS, CTPPS_DIAMOND_NUM_OF_PLANES, CTPPS_DIAMOND_RP_ID, CTPPS_DIAMOND_STATION_ID, CTPPS_NUM_OF_ARMS, globalPlot_, planePlots_, potPlots_, and DQMStore::IBooker::setCurrentFolder().

380 {
381  ibooker.cd();
382  ibooker.setCurrentFolder( "CTPPS" );
383 
384  globalPlot_= GlobalPlots( ibooker );
385 
386  for ( unsigned short arm = 0; arm < CTPPS_NUM_OF_ARMS; ++arm ) {
388  potPlots_[rpId] = PotPlots( ibooker, rpId );
389  for ( unsigned short pl = 0; pl < CTPPS_DIAMOND_NUM_OF_PLANES; ++pl ) {
391  planePlots_[plId] = PlanePlots( ibooker, plId);
392  for ( unsigned short ch = 0; ch < CTPPS_DIAMOND_NUM_OF_CHANNELS; ++ch ) {
394  channelPlots_[chId] = ChannelPlots( ibooker, chId );
395  }
396  }
397  }
398 }
static const int CTPPS_DIAMOND_NUM_OF_PLANES
static const int CTPPS_NUM_OF_ARMS
static const int CTPPS_DIAMOND_NUM_OF_CHANNELS
static const int CTPPS_DIAMOND_STATION_ID
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
std::unordered_map< unsigned int, PotPlots > potPlots_
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
std::unordered_map< unsigned int, PlanePlots > planePlots_
static const int CTPPS_DIAMOND_RP_ID
void CTPPSDiamondDQMSource::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprotected

Definition at line 365 of file CTPPSDiamondDQMSource.cc.

References centralOOT_, edm::contains(), edm::RunBase::run(), and runParameters_.

366 {
367  centralOOT_ = -999;
368  for ( const auto& oot : runParameters_ ) {
369  if ( edm::contains( oot.first, edm::EventID( iRun.run(), 0, 1 ) ) ) {
370  centralOOT_ = oot.second; break;
371  }
372  }
373 }
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
RunNumber_t run() const
Definition: RunBase.h:40
std::vector< std::pair< edm::EventRange, int > > runParameters_
void CTPPSDiamondDQMSource::endLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
overrideprotected

Definition at line 929 of file CTPPSDiamondDQMSource.cc.

References CTPPSDetId::arm(), CTPPSDiamondDetId::channel(), channelPlots_, CTPPSDiamondDetId::plane(), plotFactory::plot, potPlots_, CTPPSDetId::rp(), and SEC_PER_LUMI_SECTION.

930 {
931  for ( auto& plot : channelPlots_ ) {
932  if ( plot.second.hitsCounterPerLumisection != 0 ) {
933  plot.second.hit_rate->Fill( (double) plot.second.hitsCounterPerLumisection / SEC_PER_LUMI_SECTION );
934  }
935  plot.second.hitsCounterPerLumisection = 0;
936 
937  double HundredOverHitCounter = .0;
938  if ( plot.second.HitCounter != 0 )
939  HundredOverHitCounter = 100. / plot.second.HitCounter;
940  plot.second.HPTDCErrorFlags->setBinContent( 16, HundredOverHitCounter * plot.second.MHCounter );
941  plot.second.leadingWithoutTrailing->setBinContent(1, HundredOverHitCounter * plot.second.LeadingOnlyCounter );
942  plot.second.leadingWithoutTrailing->setBinContent(2, HundredOverHitCounter * plot.second.TrailingOnlyCounter );
943  plot.second.leadingWithoutTrailing->setBinContent(3, HundredOverHitCounter * plot.second.CompleteCounter );
944  }
945 
946  for ( auto& plot : potPlots_ ) {
947  double HundredOverHitCounterPot = 0.;
948  if ( plot.second.HitCounter !=0 )
949  HundredOverHitCounterPot = 100. / plot.second.HitCounter;
950  plot.second.HPTDCErrorFlags_cumulative->setBinContent( 16, HundredOverHitCounterPot * plot.second.MHCounter );
951  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(1, HundredOverHitCounterPot * plot.second.LeadingOnlyCounter );
952  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(2, HundredOverHitCounterPot * plot.second.TrailingOnlyCounter );
953  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(3, HundredOverHitCounterPot * plot.second.CompleteCounter );
954 
955  plot.second.MHComprensive->Reset();
956  CTPPSDiamondDetId rpId(plot.first);
957  for ( auto& chPlot : channelPlots_ ) {
958  CTPPSDiamondDetId chId(chPlot.first);
959  if ( chId.arm() == rpId.arm() && chId.rp() == rpId.rp() ) {
960  plot.second.MHComprensive->Fill(chId.plane(), chId.channel(), chPlot.second.HPTDCErrorFlags->getBinContent( 16 ) );
961  }
962  }
963 
964  }
965 
966 }
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
std::unordered_map< unsigned int, PotPlots > potPlots_
static const double SEC_PER_LUMI_SECTION
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
void CTPPSDiamondDQMSource::endRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 971 of file CTPPSDiamondDQMSource.cc.

References DEFINE_FWK_MODULE.

972 {}

Member Data Documentation

int CTPPSDiamondDQMSource::centralOOT_
private

Definition at line 81 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const int CTPPSDiamondDQMSource::CHANNEL_OF_VFAT_CLOCK = 30
staticprivate

Definition at line 56 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

std::unordered_map<unsigned int, ChannelPlots> CTPPSDiamondDQMSource::channelPlots_
private

Definition at line 179 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_CHANNELS = 12
staticprivate

Definition at line 66 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_PLANES = 4
staticprivate

Definition at line 65 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_RP_ID = 6
staticprivate

Definition at line 62 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_STATION_ID = 1
staticprivate

Definition at line 61 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_FAR_RP_ID = 3
staticprivate

Definition at line 64 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_45 = 583
staticprivate

Definition at line 67 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_56 = 582
staticprivate

Definition at line 68 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_NEAR_RP_ID = 2
staticprivate

Definition at line 63 of file CTPPSDiamondDQMSource.cc.

const int CTPPSDiamondDQMSource::CTPPS_NUM_OF_ARMS = 2
staticprivate

Definition at line 60 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const double CTPPSDiamondDQMSource::DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
staticprivate

Definition at line 57 of file CTPPSDiamondDQMSource.cc.

int CTPPSDiamondDQMSource::EC_difference_45_
private

Definition at line 138 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

int CTPPSDiamondDQMSource::EC_difference_56_
private

Definition at line 138 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

bool CTPPSDiamondDQMSource::excludeMultipleHits_
private

Definition at line 77 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

GlobalPlots CTPPSDiamondDQMSource::globalPlot_
private

Definition at line 93 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and bookHistograms().

const double CTPPSDiamondDQMSource::HPTDC_BIN_WIDTH_NS = 25./1024
staticprivate

Definition at line 59 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const double CTPPSDiamondDQMSource::INV_DISPLAY_RESOLUTION_FOR_HITS_MM = 1./DISPLAY_RESOLUTION_FOR_HITS_MM
staticprivate
double CTPPSDiamondDQMSource::maximumStripAngleForTomography_
private

Definition at line 79 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

double CTPPSDiamondDQMSource::minimumStripAngleForTomography_
private

Definition at line 78 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

std::unordered_map<unsigned int, PlanePlots> CTPPSDiamondDQMSource::planePlots_
private

Definition at line 153 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and bookHistograms().

std::unordered_map<unsigned int, PotPlots> CTPPSDiamondDQMSource::potPlots_
private
std::vector< std::pair<edm::EventRange, int> > CTPPSDiamondDQMSource::runParameters_
private

Definition at line 80 of file CTPPSDiamondDQMSource.cc.

Referenced by CTPPSDiamondDQMSource(), and dqmBeginRun().

const double CTPPSDiamondDQMSource::SEC_PER_LUMI_SECTION = 23.31
staticprivate

Definition at line 55 of file CTPPSDiamondDQMSource.cc.

Referenced by endLuminosityBlock().

edm::EDGetTokenT< edm::DetSetVector<CTPPSDiamondRecHit> > CTPPSDiamondDQMSource::tokenDiamondHit_
private

Definition at line 73 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT< edm::DetSetVector<CTPPSDiamondLocalTrack> > CTPPSDiamondDQMSource::tokenDiamondTrack_
private

Definition at line 74 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT< edm::DetSetVector<CTPPSDiamondDigi> > CTPPSDiamondDQMSource::tokenDigi_
private

Definition at line 72 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT< std::vector<TotemFEDInfo> > CTPPSDiamondDQMSource::tokenFEDInfo_
private

Definition at line 75 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT< edm::DetSetVector<TotemRPLocalTrack> > CTPPSDiamondDQMSource::tokenLocalTrack_
private

Definition at line 71 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT< edm::DetSetVector<TotemVFATStatus> > CTPPSDiamondDQMSource::tokenStatus_
private

Definition at line 70 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

unsigned int CTPPSDiamondDQMSource::verbosity_
private

Definition at line 82 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().