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:
one::DQMEDAnalyzer< edm::LuminosityBlockCache< dds::Cache > > one::dqmimplementation::DQMBaseClass< T... >

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 one::DQMEDAnalyzer< edm::LuminosityBlockCache< dds::Cache > >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void analyze (const edm::Event &, 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 endRun (const edm::Run &, const edm::EventSetup &) override
 
std::shared_ptr< dds::CacheglobalBeginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) const override
 
void globalEndLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 

Private Attributes

int centralOOT_
 
std::unordered_map< unsigned int, ChannelPlotschannelPlots_
 
int EC_difference_45_
 
int EC_difference_56_
 
bool excludeMultipleHits_
 
GlobalPlots globalPlot_
 
double horizontalShiftBwDiamondPixels_
 
double horizontalShiftOfDiamond_
 
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< CTPPSPixelLocalTrack > > tokenPixelTrack_
 
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 int CTPPS_PIXEL_STATION_ID = 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
 

Detailed Description

Definition at line 67 of file CTPPSDiamondDQMSource.cc.

Constructor & Destructor Documentation

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

Definition at line 376 of file CTPPSDiamondDQMSource.cc.

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

376  :
377  tokenStatus_ ( consumes< edm::DetSetVector<TotemVFATStatus> > ( ps.getParameter<edm::InputTag>( "tagStatus" ) ) ),
378  tokenPixelTrack_ ( consumes< edm::DetSetVector<CTPPSPixelLocalTrack> > ( ps.getParameter<edm::InputTag>( "tagPixelLocalTracks" ) ) ),
379  tokenDigi_ ( consumes< edm::DetSetVector<CTPPSDiamondDigi> > ( ps.getParameter<edm::InputTag>( "tagDigi" ) ) ),
380  tokenDiamondHit_ ( consumes< edm::DetSetVector<CTPPSDiamondRecHit> > ( ps.getParameter<edm::InputTag>( "tagDiamondRecHits" ) ) ),
381  tokenDiamondTrack_( consumes< edm::DetSetVector<CTPPSDiamondLocalTrack> >( ps.getParameter<edm::InputTag>( "tagDiamondLocalTracks" ) ) ),
382  tokenFEDInfo_ ( consumes< std::vector<TotemFEDInfo> > ( ps.getParameter<edm::InputTag>( "tagFEDInfo" ) ) ),
383  excludeMultipleHits_ ( ps.getParameter<bool>( "excludeMultipleHits" ) ),
384  centralOOT_( -999 ),
385  verbosity_ ( ps.getUntrackedParameter<unsigned int>( "verbosity", 0 ) ),
386  EC_difference_56_( -500 ), EC_difference_45_( -500 )
387 {
388  for ( const auto& pset : ps.getParameter< std::vector<edm::ParameterSet> >( "offsetsOOT" ) ) {
389  runParameters_.emplace_back( std::make_pair( pset.getParameter<edm::EventRange>( "validityRange" ), pset.getParameter<int>( "centralOOT" ) ) );
390  }
391 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > tokenDigi_
std::vector< std::pair< edm::EventRange, int > > runParameters_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelTrack_
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 395 of file CTPPSDiamondDQMSource.cc.

396 {}

Member Function Documentation

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

Definition at line 467 of file CTPPSDiamondDQMSource.cc.

References funct::abs(), edm::EventBase::bunchCrossing(), centralOOT_, CHANNEL_OF_VFAT_CLOCK, channelAlignedWithTrack(), channelPlots_, CTPPS_DIAMOND_RP_ID, CTPPS_DIAMOND_STATION_ID, CTPPS_FAR_RP_ID, CTPPS_FED_ID_45, CTPPS_FED_ID_56, CTPPS_PIXEL_STATION_ID, TauDecayModes::dec, EC_difference_45_, EC_difference_56_, excludeMultipleHits_, HcalObjRepresent::Fill(), edm::EventSetup::get(), HPTDCErrorFlags::getErrorId(), edm::Event::getLuminosityBlock(), horizontalShiftBwDiamondPixels_, horizontalShiftOfDiamond_, HPTDC_BIN_WIDTH_NS, mps_fire::i, edm::LuminosityBlock::index(), edm::eventsetup::heterocontainer::insert(), createfilelist::int, INV_DISPLAY_RESOLUTION_FOR_HITS_MM, edm::HandleBase::isValid(), PixelTracks_cff::pixelTracks, planePlots_, potPlots_, edm::ESHandle< T >::product(), TrackInfoProducer_cfi::rechits, CTPPSDiamondDetId::setChannel(), CTPPSDiamondDetId::setPlane(), mps_update::status, CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING, tokenDiamondHit_, tokenDiamondTrack_, tokenDigi_, tokenFEDInfo_, tokenPixelTrack_, tokenStatus_, HiIsolationCommonParameters_cff::track, l1t::tracks, and verbosity_.

468 {
469  // get event data
471  event.getByToken( tokenStatus_, diamondVFATStatus );
472 
474  event.getByToken( tokenPixelTrack_, pixelTracks );
475 
477  event.getByToken( tokenDigi_, diamondDigis );
478 
480  event.getByToken( tokenFEDInfo_, fedInfo );
481 
483  event.getByToken( tokenDiamondHit_, diamondRecHits );
484 
486  event.getByToken( tokenDiamondTrack_, diamondLocalTracks );
487 
489  iSetup.get<VeryForwardRealGeometryRecord>().get( geometry_ );
490 
491  // check validity
492  bool valid = true;
493  valid &= diamondVFATStatus.isValid();
494  valid &= pixelTracks.isValid();
495  valid &= diamondDigis.isValid();
496  valid &= fedInfo.isValid();
497  valid &= diamondRecHits.isValid();
498  valid &= diamondLocalTracks.isValid();
499 
500  if ( !valid ) {
501  if ( verbosity_ ) {
502  edm::LogProblem("CTPPSDiamondDQMSource")
503  << "ERROR in CTPPSDiamondDQMSource::analyze > some of the required inputs are not valid. Skipping this event.\n"
504  << " diamondVFATStatus.isValid = " << diamondVFATStatus.isValid() << "\n"
505  << " pixelTracks.isValid = " << pixelTracks.isValid() << "\n"
506  << " diamondDigis.isValid = " << diamondDigis.isValid() << "\n"
507  << " fedInfo.isValid = " << fedInfo.isValid() << "\n"
508  << " diamondRecHits.isValid = " << diamondRecHits.isValid() << "\n"
509  << " diamondLocalTracks.isValid = " << diamondLocalTracks.isValid();
510  }
511 
512  return;
513  }
514 
515  //------------------------------
516  // RP Plots
517  //------------------------------
518 
519  //------------------------------
520  // Correlation Plots
521  //------------------------------
522 
523  // Using CTPPSDiamondDigi
524  for ( const auto& digis : *diamondDigis ) {
525  const CTPPSDiamondDetId detId( digis.detId() );
526  CTPPSDiamondDetId detId_pot( digis.detId() );
527 
528  for ( const auto& digi : digis ) {
529  detId_pot.setPlane( 0 );
530  detId_pot.setChannel( 0 );
531  if ( detId.channel() == CHANNEL_OF_VFAT_CLOCK ) continue;
532  if ( potPlots_.find( detId_pot ) == potPlots_.end() ) continue;
533  //Leading without trailing investigation
534  if ( digi.getLeadingEdge() != 0 || digi.getTrailingEdge() != 0 ) {
535  ++(potPlots_[detId_pot].HitCounter);
536  if ( digi.getLeadingEdge() != 0 ) {
537  potPlots_[detId_pot].leadingEdgeCumulative_all->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
538  }
539  if ( digi.getLeadingEdge() != 0 && digi.getTrailingEdge() == 0 ) {
540  ++(potPlots_[detId_pot].LeadingOnlyCounter);
541  potPlots_[detId_pot].leadingEdgeCumulative_le->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
542  }
543  if ( digi.getLeadingEdge() == 0 && digi.getTrailingEdge() != 0 ) {
544  ++(potPlots_[detId_pot].TrailingOnlyCounter);
545  potPlots_[detId_pot].trailingEdgeCumulative_te->Fill( HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
546  }
547  if ( digi.getLeadingEdge() != 0 && digi.getTrailingEdge() != 0 ) {
548  ++(potPlots_[detId_pot].CompleteCounter);
549  potPlots_[detId_pot].leadingTrailingCorrelationPot->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge(), HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
550  }
551  }
552 
553  // HPTDC Errors
554  const HPTDCErrorFlags hptdcErrors = digi.getHPTDCErrorFlags();
555  if ( detId.channel() == 6 || detId.channel() == 7 ) // ch6 for HPTDC 0 and ch7 for HPTDC 1
556  {
557  int verticalIndex = 2*detId.plane() + (detId.channel() - 6);
558  for ( unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex )
559  if ( hptdcErrors.getErrorId( hptdcErrorIndex-1 ) ) potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill( hptdcErrorIndex, verticalIndex );
560  }
561  if ( digi.getMultipleHit() ) ++(potPlots_[detId_pot].MHCounter);
562  }
563  }
564 
565  // EC Errors
566  for ( const auto& vfat_status : *diamondVFATStatus ) {
567  const CTPPSDiamondDetId detId( vfat_status.detId() );
568  CTPPSDiamondDetId detId_pot( vfat_status.detId() );
569  detId_pot.setPlane( 0 );
570  detId_pot.setChannel( 0 );
571  for ( const auto& status : vfat_status ) {
572  if ( !status.isOK() ) continue;
573  if ( potPlots_.find(detId_pot) == potPlots_.end() ) continue;
574  if ( channelPlots_.find(detId) == channelPlots_.end() ) continue;
575 
576  // Check Event Number
577  for ( const auto& optorx : *fedInfo ) {
578  if ( detId.arm() == 1 && optorx.getFEDId() == CTPPS_FED_ID_56 ) {
579  potPlots_[detId_pot].ECCheck->Fill((int)((optorx.getLV1()& 0xFF)-((unsigned int) status.getEC() & 0xFF)) & 0xFF);
580  if ( ( static_cast<int>( ( optorx.getLV1() & 0xFF )-status.getEC() ) != EC_difference_56_ ) && ( static_cast<uint8_t>( ( optorx.getLV1() & 0xFF )-status.getEC() ) < 128 ) )
581  EC_difference_56_ = static_cast<int>( optorx.getLV1() & 0xFF )-( static_cast<unsigned int>( status.getEC() ) & 0xFF );
582  if ( EC_difference_56_ != 1 && EC_difference_56_ != -500 && std::abs(EC_difference_56_) < 127 )
583  {
584  if ( detId.channel() == 6 || detId.channel() == 7 ) potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill( 16, 2*detId.plane() + (detId.channel() - 6) );
585  if (verbosity_)
586  edm::LogProblem("CTPPSDiamondDQMSource") << "FED " << CTPPS_FED_ID_56 << ": ECError at EV: 0x"<< std::hex << optorx.getLV1()
587  << "\t\tVFAT EC: 0x"<< static_cast<unsigned int>( status.getEC() )
588  << "\twith ID: " << std::dec << detId
589  << "\tdiff: " << EC_difference_56_;
590  }
591  }
592  else if ( detId.arm() == 0 && optorx.getFEDId()== CTPPS_FED_ID_45 ) {
593  potPlots_[detId_pot].ECCheck->Fill((int)((optorx.getLV1()& 0xFF)-status.getEC()) & 0xFF);
594  if ( ( static_cast<int>( ( optorx.getLV1() & 0xFF )-status.getEC() ) != EC_difference_45_ ) && ( static_cast<uint8_t>( ( optorx.getLV1() & 0xFF )-status.getEC() ) < 128 ) )
595  EC_difference_45_ = static_cast<int>( optorx.getLV1() & 0xFF )-( static_cast<unsigned int>( status.getEC() ) & 0xFF );
596  if ( EC_difference_45_ != 1 && EC_difference_45_ != -500 && std::abs(EC_difference_45_) < 127 )
597  {
598  if ( detId.channel() == 6 || detId.channel() == 7 ) potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill( 16, 2*detId.plane() + (detId.channel() - 6) );
599  if (verbosity_)
600  edm::LogProblem("CTPPSDiamondDQMSource") << "FED " << CTPPS_FED_ID_45 << ": ECError at EV: 0x"<< std::hex << optorx.getLV1()
601  << "\t\tVFAT EC: 0x"<< static_cast<unsigned int>( status.getEC() )
602  << "\twith ID: " << std::dec << detId
603  << "\tdiff: " << EC_difference_45_;
604  }
605  }
606  }
607  }
608  }
609 
610  // Using CTPPSDiamondRecHit
611  std::unordered_map<unsigned int, std::set<unsigned int> > planes;
612  std::unordered_map<unsigned int, std::set<unsigned int> > planes_inclusive;
613 
614 
615  auto lumiCache = luminosityBlockCache(event.getLuminosityBlock().index());
616  for ( const auto& rechits : *diamondRecHits ) {
617  CTPPSDiamondDetId detId_pot( rechits.detId() );
618  detId_pot.setPlane( 0 );
619  detId_pot.setChannel( 0 );
620  const CTPPSDiamondDetId detId( rechits.detId() );
621 
622  for ( const auto& rechit : rechits ) {
623  planes_inclusive[detId_pot].insert( detId.plane() );
624  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
625  if ( rechit.getToT() != 0 && centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_ )
626  planes[detId_pot].insert( detId.plane() );
627 
628  if ( potPlots_.find( detId_pot ) == potPlots_.end() ) continue;
629 
630  float UFSDShift = 0.0;
631  if ( rechit.getYWidth() < 3 ) UFSDShift = 0.5; // Display trick for UFSD that have 2 pixels with same X
632 
633  if ( rechit.getToT() != 0 && centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_ ) {
634  TH2F *hitHistoTmp = potPlots_[detId_pot].hitDistribution2d->getTH2F();
635  TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
636  int startBin = hitHistoTmpYAxis->FindBin( rechit.getX() - horizontalShiftOfDiamond_ - 0.5*rechit.getXWidth() );
637  int numOfBins = rechit.getXWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
638  for ( int i=0; i<numOfBins; ++i) {
639  hitHistoTmp->Fill( detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin+i) );
640  }
641 
642  hitHistoTmp = lumiCache->hitDistribution2dMap[detId_pot].get();
643  hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
644  startBin = hitHistoTmpYAxis->FindBin( rechit.getX() - horizontalShiftOfDiamond_ - 0.5*rechit.getXWidth() );
645  numOfBins = rechit.getXWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
646  for ( int i=0; i<numOfBins; ++i) {
647  hitHistoTmp->Fill( detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin+i) );
648  }
649 
650  }
651 
652  if ( rechit.getToT() != 0 ) {
653  // Both
654  potPlots_[detId_pot].leadingEdgeCumulative_both->Fill( rechit.getT() + 25*rechit.getOOTIndex() );
655  potPlots_[detId_pot].timeOverThresholdCumulativePot->Fill( rechit.getToT() );
656 
657  TH2F *hitHistoOOTTmp = potPlots_[detId_pot].hitDistribution2dOOT->getTH2F();
658  TAxis *hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
659  int startBin = hitHistoOOTTmpYAxis->FindBin( rechit.getX() - horizontalShiftOfDiamond_ - 0.5*rechit.getXWidth() );
660  int numOfBins = rechit.getXWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
661  for ( int i=0; i<numOfBins; ++i) {
662  hitHistoOOTTmp->Fill( detId.plane() + 0.25 * rechit.getOOTIndex(), hitHistoOOTTmpYAxis->GetBinCenter(startBin+i) );
663  }
664  }
665  else {
666  if ( rechit.getOOTIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING ) {
667  // Only leading
668  TH2F *hitHistoOOTTmp = potPlots_[detId_pot].hitDistribution2dOOT_le->getTH2F();
669  TAxis *hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
670  int startBin = hitHistoOOTTmpYAxis->FindBin( rechit.getX() - horizontalShiftOfDiamond_ - 0.5*rechit.getXWidth() );
671  int numOfBins = rechit.getXWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
672  for ( int i=0; i<numOfBins; ++i) {
673  hitHistoOOTTmp->Fill( detId.plane() + 0.25 * rechit.getOOTIndex(), hitHistoOOTTmpYAxis->GetBinCenter(startBin+i) );
674  }
675  }
676  }
677  if ( rechit.getOOTIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING && rechit.getOOTIndex() < (int) potPlots_[detId_pot].activity_per_bx.size() )
678  potPlots_[detId_pot].activity_per_bx.at( rechit.getOOTIndex() )->Fill( event.bunchCrossing() );
679  }
680  }
681 
682  for ( const auto& plt : potPlots_ ) {
683  plt.second.activePlanes->Fill( planes[plt.first].size() );
684  plt.second.activePlanesInclusive->Fill( planes_inclusive[plt.first].size() );
685  }
686 
687  // Using CTPPSDiamondLocalTrack
688  for ( const auto& tracks : *diamondLocalTracks ) {
689  CTPPSDiamondDetId detId_pot( tracks.detId() );
690  detId_pot.setPlane( 0 );
691  detId_pot.setChannel( 0 );
692  const CTPPSDiamondDetId detId( tracks.detId() );
693 
694  for ( const auto& track : tracks ) {
695  if ( ! track.isValid() ) continue;
696  if ( track.getOOTIndex() == CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING ) continue;
697  if ( excludeMultipleHits_ && track.getMultipleHits() > 0 ) continue;
698  if ( potPlots_.find( detId_pot ) == potPlots_.end() ) continue;
699 
700  TH2F *trackHistoOOTTmp = potPlots_[detId_pot].trackDistributionOOT->getTH2F();
701  TAxis *trackHistoOOTTmpYAxis = trackHistoOOTTmp->GetYaxis();
702  int startBin = trackHistoOOTTmpYAxis->FindBin( track.getX0() - horizontalShiftOfDiamond_ - track.getX0Sigma() );
703  int numOfBins = 2*track.getX0Sigma()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
704  for ( int i=0; i<numOfBins; ++i) {
705  trackHistoOOTTmp->Fill( track.getOOTIndex(), trackHistoOOTTmpYAxis->GetBinCenter(startBin+i) );
706  }
707 
708  if ( centralOOT_ != -999 && track.getOOTIndex() == centralOOT_ ) {
709  TH1F *trackHistoInTimeTmp = potPlots_[detId_pot].trackDistribution->getTH1F();
710  int startBin = trackHistoInTimeTmp->FindBin( track.getX0() - horizontalShiftOfDiamond_ - track.getX0Sigma() );
711  int numOfBins = 2*track.getX0Sigma()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
712  for ( int i=0; i<numOfBins; ++i) {
713  trackHistoInTimeTmp->Fill( trackHistoInTimeTmp->GetBinCenter(startBin+i) );
714  }
715  }
716  }
717  }
718 
719  // Channel efficiency using CTPPSDiamondLocalTrack
720  for ( const auto& tracks : *diamondLocalTracks ) {
721  CTPPSDiamondDetId detId_pot( tracks.detId() );
722  detId_pot.setPlane( 0 );
723  detId_pot.setChannel( 0 );
724  for ( const auto& track : tracks ) {
725  // Find hits and planes in the track
726  int numOfHits = 0;
727  std::set<int> planesInTrackSet;
728  for ( const auto& vec : *diamondRecHits ) {
729  const CTPPSDiamondDetId detid( vec.detId() );
730  if ( detid.arm() != detId_pot.arm() ) continue;
731 
732  for ( const auto& hit : vec ) {
733  // first check if the hit contributes to the track
734  if ( track.containsHit(hit) ) {
735  ++numOfHits;
736  planesInTrackSet.insert(detid.plane());
737  }
738  }
739  }
740 
741  if ( numOfHits > 0 && numOfHits <= 10 && planesInTrackSet.size() > 2 ) {
742  for ( int plane=0; plane<4; ++plane ) {
743  for ( int channel=0; channel<12; ++channel ) {
744  int map_index = plane*100 + channel;
745  if ( potPlots_[detId_pot].effDoublecountingChMap.find( map_index ) == potPlots_[detId_pot].effDoublecountingChMap.end() ) {
746  potPlots_[detId_pot].effTriplecountingChMap[map_index] = 0;
747  potPlots_[detId_pot].effDoublecountingChMap[map_index] = 0;
748  }
749  CTPPSDiamondDetId detId( detId_pot.arm(), CTPPS_DIAMOND_STATION_ID, CTPPS_DIAMOND_RP_ID, plane, channel);
750  if ( channelAlignedWithTrack( geometry_.product(), detId, track, 0.2) ) {
751  // Channel should fire
752  ++(potPlots_[detId_pot].effDoublecountingChMap[map_index]);
753  for ( const auto& rechits : *diamondRecHits ) {
754  CTPPSDiamondDetId detId_hit( rechits.detId() );
755  if ( detId_hit == detId ) {
756  for ( const auto& rechit : rechits ) {
757  if ( track.containsHit( rechit, 1 ) ) {
758  // Channel fired
759  ++(potPlots_[detId_pot].effTriplecountingChMap[map_index]);
760  }
761  }
762  }
763  }
764  }
765  }
766  }
767  }
768  }
769  }
770 
771  // Tomography of diamonds using pixel
772  for ( const auto& rechits : *diamondRecHits ) {
773  CTPPSDiamondDetId detId_pot( rechits.detId() );
774  detId_pot.setPlane( 0 );
775  detId_pot.setChannel( 0 );
776  const CTPPSDiamondDetId detId( rechits.detId() );
777  for ( const auto& rechit : rechits ) {
778  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
779  if ( rechit.getToT() == 0 ) continue;
780  if ( !pixelTracks.isValid() ) continue;
781  if ( potPlots_.find( detId_pot ) == potPlots_.end() ) continue;
782 
783  for ( const auto& ds : *pixelTracks ) {
784  if ( ds.size() > 1 ) continue;
785  const CTPPSPixelDetId pixId( ds.detId() );
786  if ( pixId.station() != CTPPS_PIXEL_STATION_ID || pixId.rp() != CTPPS_FAR_RP_ID ) continue;
787  for ( const auto& lt : ds ) {
788  if ( lt.isValid() && pixId.arm() == detId_pot.arm() ) {
789  if ( rechit.getOOTIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING && rechit.getOOTIndex() < (int) potPlots_[detId_pot].pixelTomographyAll.size() && rechit.getOOTIndex() >= 0 && lt.getX0() - horizontalShiftBwDiamondPixels_ < 24 )
790  potPlots_[detId_pot].pixelTomographyAll.at( rechit.getOOTIndex() )->Fill( lt.getX0() - horizontalShiftBwDiamondPixels_ + 25*detId.plane(), lt.getY0() );
791  }
792  }
793  }
794  }
795  }
796 
797  //------------------------------
798  // Clock Plots
799  //------------------------------
800  // Commented out to save space in the DQM files, but code should be kept
801  // for ( const auto& digis : *diamondDigis ) {
802  // const CTPPSDiamondDetId detId( digis.detId() );
803  // CTPPSDiamondDetId detId_pot( digis.detId() );
804  // if ( detId.channel() == CHANNEL_OF_VFAT_CLOCK ) {
805  // detId_pot.setPlane( 0 );
806  // detId_pot.setChannel( 0 );
807  // for ( const auto& digi : digis ) {
808  // if ( digi.getLeadingEdge() != 0 ) {
809  // if ( detId.plane() == 1 ) {
810  // potPlots_[detId_pot].clock_Digi1_le->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
811  // potPlots_[detId_pot].clock_Digi1_te->Fill( HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
812  // }
813  // if ( detId.plane() == 3 ) {
814  // potPlots_[detId_pot].clock_Digi3_le->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
815  // potPlots_[detId_pot].clock_Digi3_te->Fill( HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
816  // }
817  // }
818  // }
819  // }
820  // }
821 
822  //------------------------------
823  // Plane Plots
824  //------------------------------
825 
826  // Using CTPPSDiamondDigi
827  std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
828  for ( const auto& digis : *diamondDigis ) {
829  const CTPPSDiamondDetId detId( digis.detId() );
830  CTPPSDiamondDetId detId_plane( digis.detId() );
831  for ( const auto& digi : digis ) {
832  detId_plane.setChannel( 0 );
833  if ( detId.channel() == CHANNEL_OF_VFAT_CLOCK ) continue;
834  if ( planePlots_.find( detId_plane ) == planePlots_.end() ) continue;
835 
836  if ( digi.getLeadingEdge() != 0 ) {
837  planePlots_[detId_plane].digiProfileCumulativePerPlane->Fill( detId.channel() );
838  if ( channelsPerPlane.find(detId_plane) != channelsPerPlane.end() ) channelsPerPlane[detId_plane]++;
839  else channelsPerPlane[detId_plane] = 0;
840  }
841  }
842  }
843 
844  for ( const auto& plt : channelsPerPlane ) {
845  planePlots_[plt.first].hit_multiplicity->Fill( plt.second );
846  }
847 
848  // Using CTPPSDiamondRecHit
849  for ( const auto& rechits : *diamondRecHits ) {
850  CTPPSDiamondDetId detId_plane( rechits.detId() );
851  detId_plane.setChannel( 0 );
852  for ( const auto& rechit : rechits ) {
853  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
854  if ( rechit.getToT() == 0 ) continue;
855  if ( planePlots_.find( detId_plane ) != planePlots_.end() ) {
856  if ( centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_ ) {
857  TH1F *hitHistoTmp = planePlots_[detId_plane].hitProfile->getTH1F();
858  int startBin = hitHistoTmp->FindBin( rechit.getX() - horizontalShiftOfDiamond_ - 0.5*rechit.getXWidth() );
859  int numOfBins = rechit.getXWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
860  for ( int i=0; i<numOfBins; ++i) {
861  hitHistoTmp->Fill( hitHistoTmp->GetBinCenter(startBin+i) );
862  }
863  }
864  }
865  }
866  }
867 
868 
869  //Tomography of diamonds using pixel and Efficiency WRT Pixels
870  for ( const auto& ds : *pixelTracks ) {
871  const CTPPSPixelDetId pixId( ds.detId() );
872  if ( pixId.station() != CTPPS_PIXEL_STATION_ID || pixId.rp() != CTPPS_FAR_RP_ID ) continue;
873  if ( ds.size() > 1 ) continue;
874  for ( const auto& lt : ds ) {
875  if ( lt.isValid() ) {
876  // For efficieny
878  potPlots_[detId_pot].pixelTracksMap.Fill( lt.getX0() - horizontalShiftBwDiamondPixels_, lt.getY0() );
879 
880  std::set< CTPPSDiamondDetId > planesWitHits_set;
881  for ( const auto& rechits : *diamondRecHits ) {
882  CTPPSDiamondDetId detId_plane( rechits.detId() );
883  detId_plane.setChannel( 0 );
884  for ( const auto& rechit : rechits ) {
885  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
886  if ( rechit.getOOTIndex() == CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING || rechit.getToT() == 0 ) continue;
887  if ( planePlots_.find(detId_plane) == planePlots_.end() ) continue;
888  if ( pixId.arm() == detId_plane.arm() && lt.getX0() - horizontalShiftBwDiamondPixels_ < 24 ) {
889  planePlots_[detId_plane].pixelTomography_far->Fill( lt.getX0() - horizontalShiftBwDiamondPixels_ + 25*rechit.getOOTIndex(), lt.getY0() );
890  if ( centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_ ) planesWitHits_set.insert( detId_plane );
891  }
892 
893  }
894  }
895 
896  for (auto& planeId : planesWitHits_set)
897  planePlots_[planeId].pixelTracksMapWithDiamonds.Fill( lt.getX0() - horizontalShiftBwDiamondPixels_, lt.getY0() );
898 
899  }
900 
901  }
902  }
903 
904 
905  //------------------------------
906  // Channel Plots
907  //------------------------------
908 
909  // digi profile cumulative
910  for ( const auto& digis : *diamondDigis ) {
911  const CTPPSDiamondDetId detId( digis.detId() );
912  for ( const auto& digi : digis ) {
913  if ( detId.channel() == CHANNEL_OF_VFAT_CLOCK ) continue;
914  if ( channelPlots_.find( detId ) != channelPlots_.end() ) {
915  // HPTDC Errors
916  const HPTDCErrorFlags hptdcErrors = digi.getHPTDCErrorFlags();
917  for ( unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex )
918  if ( hptdcErrors.getErrorId( hptdcErrorIndex-1 ) ) channelPlots_[detId].HPTDCErrorFlags->Fill( hptdcErrorIndex );
919  if ( digi.getMultipleHit() ) ++(channelPlots_[detId].MHCounter);
920 
921  // Check dropped trailing edges
922  if ( digi.getLeadingEdge() != 0 || digi.getTrailingEdge() != 0 ) {
923  ++(channelPlots_[detId].HitCounter);
924  if ( digi.getLeadingEdge() != 0 && digi.getTrailingEdge() == 0 ) {
925  ++(channelPlots_[detId].LeadingOnlyCounter);
926  channelPlots_[detId].leadingEdgeCumulative_le->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
927  }
928  if ( digi.getLeadingEdge() == 0 && digi.getTrailingEdge() != 0 ) {
929  ++(channelPlots_[detId].TrailingOnlyCounter);
930  channelPlots_[detId].trailingEdgeCumulative_te->Fill( HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
931  }
932  if ( digi.getLeadingEdge() != 0 && digi.getTrailingEdge() != 0 ) {
933  ++(channelPlots_[detId].CompleteCounter);
934  channelPlots_[detId].LeadingTrailingCorrelationPerChannel->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge(), HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
935  }
936  }
937  }
938  }
939  }
940 
941  // Using CTPPSDiamondRecHit
942 
943  for ( const auto& rechits : *diamondRecHits ) {
944  CTPPSDiamondDetId detId( rechits.detId() );
945  for ( const auto& rechit : rechits ) {
946  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
947  if ( channelPlots_.find( detId ) != channelPlots_.end() ) {
948  if ( rechit.getOOTIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING && rechit.getToT() != 0 ) {
949  channelPlots_[detId].leadingEdgeCumulative_both->Fill( rechit.getT() + 25*rechit.getOOTIndex() );
950  channelPlots_[detId].TimeOverThresholdCumulativePerChannel->Fill( rechit.getToT() );
951  }
952  ++(lumiCache->hitsCounterMap[detId]);
953  }
954 
955  if ( rechit.getOOTIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING && rechit.getOOTIndex() < (int) channelPlots_[detId].activity_per_bx.size() )
956  channelPlots_[detId].activity_per_bx.at( rechit.getOOTIndex() )->Fill( event.bunchCrossing() );
957  }
958 
959  }
960 
961  // Tomography of diamonds using pixel
962  for ( const auto& rechits : *diamondRecHits ) {
963  const CTPPSDiamondDetId detId( rechits.detId() );
964  for ( const auto& rechit : rechits ) {
965  if ( excludeMultipleHits_ && rechit.getMultipleHits() > 0 ) continue;
966  if ( rechit.getOOTIndex() == CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING || rechit.getToT() == 0 ) continue;
967  if ( !pixelTracks.isValid() ) continue;
968  if (channelPlots_.find(detId) == channelPlots_.end()) continue;
969 
970  for ( const auto& ds : *pixelTracks ) {
971  const CTPPSPixelDetId pixId( ds.detId() );
972  if ( pixId.station() != CTPPS_PIXEL_STATION_ID || pixId.rp() != CTPPS_FAR_RP_ID ) continue;
973  if ( ds.size() > 1 ) continue;
974  for ( const auto& lt : ds ) {
975  if ( lt.isValid() && pixId.arm() == detId.arm() && lt.getX0() - horizontalShiftBwDiamondPixels_ < 24 )
976  channelPlots_[detId].pixelTomography_far->Fill( lt.getX0() - horizontalShiftBwDiamondPixels_ + 25*rechit.getOOTIndex(), lt.getY0() );
977  }
978  }
979  }
980  }
981 
982 }
static const int CTPPS_FED_ID_56
static const int CHANNEL_OF_VFAT_CLOCK
LuminosityBlockIndex index() const
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:64
Event setup record containing the real (actual) geometry information.
static const int CTPPS_PIXEL_STATION_ID
static const int CTPPS_DIAMOND_STATION_ID
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelTrack_
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:97
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
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
bool channelAlignedWithTrack(const CTPPSGeometry *geom, const CTPPSDiamondDetId &detid, const CTPPSDiamondLocalTrack &localTrack, const float tolerance=1)
std::unordered_map< unsigned int, PotPlots > potPlots_
static constexpr int TIMESLICE_WITHOUT_LEADING
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHit_
static const int CTPPS_FAR_RP_ID
T get() const
Definition: EventSetup.h:71
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
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
static const int CTPPS_FED_ID_45
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus_
void CTPPSDiamondDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 430 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().

431 {
432  ibooker.cd();
433  ibooker.setCurrentFolder( "CTPPS" );
434 
435  globalPlot_= GlobalPlots( ibooker );
436 
437  for ( unsigned short arm = 0; arm < CTPPS_NUM_OF_ARMS; ++arm ) {
439  potPlots_[rpId] = PotPlots( ibooker, rpId );
440  for ( unsigned short pl = 0; pl < CTPPS_DIAMOND_NUM_OF_PLANES; ++pl ) {
442  planePlots_[plId] = PlanePlots( ibooker, plId);
443  for ( unsigned short ch = 0; ch < CTPPS_DIAMOND_NUM_OF_CHANNELS; ++ch ) {
445  channelPlots_[chId] = ChannelPlots( ibooker, chId );
446  }
447  }
448  }
449 }
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
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
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 iSetup 
)
overrideprotected

Definition at line 401 of file CTPPSDiamondDQMSource.cc.

References centralOOT_, edm::contains(), CTPPS_DIAMOND_RP_ID, CTPPS_DIAMOND_STATION_ID, CTPPS_FAR_RP_ID, CTPPS_PIXEL_STATION_ID, relativeConstraints::geom, edm::EventSetup::get(), CTPPSGeometry::getSensor(), horizontalShiftBwDiamondPixels_, horizontalShiftOfDiamond_, DetGeomDesc::params(), edm::ESHandle< T >::product(), edm::RunBase::run(), runParameters_, and DetGeomDesc::translation().

402 {
403  centralOOT_ = -999;
404  for ( const auto& oot : runParameters_ ) {
405  if ( edm::contains( oot.first, edm::EventID( iRun.run(), 0, 1 ) ) ) {
406  centralOOT_ = oot.second; break;
407  }
408  }
409 
410  // Get detector shifts from the geometry
412  iSetup.get<VeryForwardRealGeometryRecord>().get( geometry_ );
413  const CTPPSGeometry *geom = geometry_.product();
415  const DetGeomDesc* det = geom->getSensor( detid );
416  horizontalShiftOfDiamond_ = det->translation().x() - det->params().at( 0 );
417 
418  // Rough alignement of pixel detector for diamond thomography
420  if ( iRun.run()>300000 ) { //Pixel installed
421  det = geom->getSensor( pixid );
423  }
424 }
Translation translation() const
Definition: DetGeomDesc.h:66
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
RunNumber_t run() const
Definition: RunBase.h:40
Event setup record containing the real (actual) geometry information.
static const int CTPPS_PIXEL_STATION_ID
static const int CTPPS_DIAMOND_STATION_ID
const DetGeomDesc * getSensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
std::vector< std::pair< edm::EventRange, int > > runParameters_
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:33
static const int CTPPS_FAR_RP_ID
T get() const
Definition: EventSetup.h:71
std::vector< double > params() const
Definition: DetGeomDesc.h:68
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
static const int CTPPS_DIAMOND_RP_ID
T const * product() const
Definition: ESHandle.h:86
void CTPPSDiamondDQMSource::endRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 1059 of file CTPPSDiamondDQMSource.cc.

References DEFINE_FWK_MODULE.

1060 {}
std::shared_ptr< dds::Cache > CTPPSDiamondDQMSource::globalBeginLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
) const
overrideprotected

Definition at line 455 of file CTPPSDiamondDQMSource.cc.

References edmIntegrityCheck::d, plotFactory::plot, and potPlots_.

456 {
457  auto d = std::make_shared<dds::Cache>();
458  d->hitDistribution2dMap.reserve(potPlots_.size());
459  for ( auto& plot : potPlots_ )
460  d->hitDistribution2dMap[plot.first] = std::unique_ptr<TH2F>(static_cast<TH2F*>(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
461  return d;
462 }
std::unordered_map< unsigned int, PotPlots > potPlots_
void CTPPSDiamondDQMSource::globalEndLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup  
)
overrideprotected

Definition at line 987 of file CTPPSDiamondDQMSource.cc.

References CTPPSDetId::arm(), CTPPSDiamondDetId::channel(), channelPlots_, PostProcessor_cff::efficiency, edm::LuminosityBlock::index(), CTPPSDiamondDetId::plane(), planePlots_, plotFactory::plot, potPlots_, CTPPSDetId::rp(), SEC_PER_LUMI_SECTION, CTPPSDiamondDetId::setPlane(), and pileupDistInMC::total.

988 {
989 
990  auto lumiCache = luminosityBlockCache(iLumi.index());
991  for ( auto& plot : potPlots_ ) {
992  *(plot.second.hitDistribution2d_lumisection->getTH2F())=*(lumiCache->hitDistribution2dMap[plot.first]);
993  }
994  for ( auto& plot : channelPlots_ ) {
995  auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first];
996  if ( hitsCounterPerLumisection != 0 ) {
997  plot.second.hit_rate->Fill( (double) hitsCounterPerLumisection / SEC_PER_LUMI_SECTION );
998  }
999 
1000  double HundredOverHitCounter = .0;
1001  if ( plot.second.HitCounter != 0 )
1002  HundredOverHitCounter = 100. / plot.second.HitCounter;
1003  plot.second.HPTDCErrorFlags->setBinContent( 16, HundredOverHitCounter * plot.second.MHCounter );
1004  plot.second.leadingWithoutTrailing->setBinContent(1, HundredOverHitCounter * plot.second.LeadingOnlyCounter );
1005  plot.second.leadingWithoutTrailing->setBinContent(2, HundredOverHitCounter * plot.second.TrailingOnlyCounter );
1006  plot.second.leadingWithoutTrailing->setBinContent(3, HundredOverHitCounter * plot.second.CompleteCounter );
1007  }
1008 
1009  for ( auto& plot : potPlots_ ) {
1010  double HundredOverHitCounterPot = 0.;
1011  if ( plot.second.HitCounter !=0 )
1012  HundredOverHitCounterPot = 100. / plot.second.HitCounter;
1013  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(1, HundredOverHitCounterPot * plot.second.LeadingOnlyCounter );
1014  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(2, HundredOverHitCounterPot * plot.second.TrailingOnlyCounter );
1015  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(3, HundredOverHitCounterPot * plot.second.CompleteCounter );
1016 
1017  plot.second.MHComprensive->Reset();
1018  CTPPSDiamondDetId rpId(plot.first);
1019  for ( auto& chPlot : channelPlots_ ) {
1020  CTPPSDiamondDetId chId(chPlot.first);
1021  if ( chId.arm() == rpId.arm() && chId.rp() == rpId.rp() ) {
1022  plot.second.MHComprensive->Fill(chId.plane(), chId.channel(), chPlot.second.HPTDCErrorFlags->getBinContent( 16 ) );
1023  }
1024  }
1025 
1026  }
1027 
1028  // Efficiencies of single channels
1029  for ( auto& plot : potPlots_ ) {
1030  plot.second.EfficiencyOfChannelsInPot->Reset();
1031  for ( auto& element : plot.second.effTriplecountingChMap ) {
1032  if ( plot.second.effDoublecountingChMap[ element.first ] > 0) {
1033  int plane = element.first / 100;
1034  int channel = element.first % 100;
1035  double counted = element.second;
1036  double total = plot.second.effDoublecountingChMap[ element.first ];
1037  double efficiency = counted / total;
1038 // double error = std::sqrt( efficiency * ( 1 - efficiency ) / total );
1039 
1040  plot.second.EfficiencyOfChannelsInPot->Fill(plane, channel, 100*efficiency);
1041  }
1042  }
1043  }
1044 
1045  // Efficeincy wrt pixels //TODO
1046  for ( auto& plot : planePlots_ ) {
1047  TH2F *hitHistoTmp = plot.second.EfficiencyWRTPixelsInPlane->getTH2F();
1048 
1049  CTPPSDiamondDetId detId_pot( plot.first );
1050  detId_pot.setPlane( 0 );
1051 
1052  hitHistoTmp->Divide( &(plot.second.pixelTracksMapWithDiamonds), &(potPlots_[detId_pot].pixelTracksMap) );
1053  }
1054 }
LuminosityBlockIndex index() const
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...
std::unordered_map< unsigned int, PlanePlots > planePlots_

Member Data Documentation

int CTPPSDiamondDQMSource::centralOOT_
private

Definition at line 110 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const int CTPPSDiamondDQMSource::CHANNEL_OF_VFAT_CLOCK = 30
staticprivate

Definition at line 84 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 212 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_CHANNELS = 12
staticprivate

Definition at line 95 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_PLANES = 4
staticprivate

Definition at line 94 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_RP_ID = 6
staticprivate

Definition at line 90 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_STATION_ID = 1
staticprivate

Definition at line 89 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_FAR_RP_ID = 3
staticprivate

Definition at line 93 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_45 = 583
staticprivate

Definition at line 96 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_56 = 582
staticprivate

Definition at line 97 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_NEAR_RP_ID = 2
staticprivate

Definition at line 92 of file CTPPSDiamondDQMSource.cc.

const int CTPPSDiamondDQMSource::CTPPS_NUM_OF_ARMS = 2
staticprivate

Definition at line 88 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_PIXEL_STATION_ID = 2
staticprivate

Definition at line 91 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const double CTPPSDiamondDQMSource::DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
staticprivate

Definition at line 85 of file CTPPSDiamondDQMSource.cc.

int CTPPSDiamondDQMSource::EC_difference_45_
private

Definition at line 170 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

int CTPPSDiamondDQMSource::EC_difference_56_
private

Definition at line 170 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

bool CTPPSDiamondDQMSource::excludeMultipleHits_
private

Definition at line 106 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

GlobalPlots CTPPSDiamondDQMSource::globalPlot_
private

Definition at line 120 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

double CTPPSDiamondDQMSource::horizontalShiftBwDiamondPixels_
private

Definition at line 107 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

double CTPPSDiamondDQMSource::horizontalShiftOfDiamond_
private

Definition at line 108 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

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

Definition at line 87 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const double CTPPSDiamondDQMSource::INV_DISPLAY_RESOLUTION_FOR_HITS_MM = 1./DISPLAY_RESOLUTION_FOR_HITS_MM
staticprivate
std::unordered_map<unsigned int, PlanePlots> CTPPSDiamondDQMSource::planePlots_
private

Definition at line 188 of file CTPPSDiamondDQMSource.cc.

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

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

Definition at line 109 of file CTPPSDiamondDQMSource.cc.

Referenced by CTPPSDiamondDQMSource(), and dqmBeginRun().

const double CTPPSDiamondDQMSource::SEC_PER_LUMI_SECTION = 23.31
staticprivate

Definition at line 83 of file CTPPSDiamondDQMSource.cc.

Referenced by globalEndLuminosityBlock().

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

Definition at line 102 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 103 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 101 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 104 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT< edm::DetSetVector<CTPPSPixelLocalTrack> > CTPPSDiamondDQMSource::tokenPixelTrack_
private

Definition at line 100 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 99 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

unsigned int CTPPSDiamondDQMSource::verbosity_
private

Definition at line 111 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().