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 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
 

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 59 of file CTPPSDiamondDQMSource.cc.

Constructor & Destructor Documentation

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

Definition at line 359 of file CTPPSDiamondDQMSource.cc.

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

359  :
365  tokenFEDInfo_ ( consumes< std::vector<TotemFEDInfo> > ( ps.getParameter<edm::InputTag>( "tagFEDInfo" ) ) ),
366  excludeMultipleHits_ ( ps.getParameter<bool>( "excludeMultipleHits" ) ),
367  centralOOT_( -999 ),
368  verbosity_ ( ps.getUntrackedParameter<unsigned int>( "verbosity", 0 ) ),
369  EC_difference_56_( -500 ), EC_difference_45_( -500 )
370 {
371  for ( const auto& pset : ps.getParameter< std::vector<edm::ParameterSet> >( "offsetsOOT" ) ) {
372  runParameters_.emplace_back( std::make_pair( pset.getParameter<edm::EventRange>( "validityRange" ), pset.getParameter<int>( "centralOOT" ) ) );
373  }
374 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > tokenDigi_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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 378 of file CTPPSDiamondDQMSource.cc.

379 {}

Member Function Documentation

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

Definition at line 447 of file CTPPSDiamondDQMSource.cc.

References 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(), horizontalShiftBwDiamondPixels_, horizontalShiftOfDiamond_, HPTDC_BIN_WIDTH_NS, mps_fire::i, 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_.

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

Definition at line 438 of file CTPPSDiamondDQMSource.cc.

References plotFactory::plot, and potPlots_.

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

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

414 {
415  ibooker.cd();
416  ibooker.setCurrentFolder( "CTPPS" );
417 
418  globalPlot_= GlobalPlots( ibooker );
419 
420  for ( unsigned short arm = 0; arm < CTPPS_NUM_OF_ARMS; ++arm ) {
422  potPlots_[rpId] = PotPlots( ibooker, rpId );
423  for ( unsigned short pl = 0; pl < CTPPS_DIAMOND_NUM_OF_PLANES; ++pl ) {
425  planePlots_[plId] = PlanePlots( ibooker, plId);
426  for ( unsigned short ch = 0; ch < CTPPS_DIAMOND_NUM_OF_CHANNELS; ++ch ) {
428  channelPlots_[chId] = ChannelPlots( ibooker, chId );
429  }
430  }
431  }
432 }
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 iSetup 
)
overrideprotected

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

385 {
386  centralOOT_ = -999;
387  for ( const auto& oot : runParameters_ ) {
388  if ( edm::contains( oot.first, edm::EventID( iRun.run(), 0, 1 ) ) ) {
389  centralOOT_ = oot.second; break;
390  }
391  }
392 
393  // Get detector shifts from the geometry
395  iSetup.get<VeryForwardRealGeometryRecord>().get( geometry_ );
396  const CTPPSGeometry *geom = geometry_.product();
398  const DetGeomDesc* det = geom->getSensor( detid );
399  horizontalShiftOfDiamond_ = det->translation().x() - det->params().at( 0 );
400 
401  // Rough alignement of pixel detector for diamond thomography
403  if ( iRun.run()>300000 ) { //Pixel installed
404  det = geom->getSensor( pixid );
406  }
407 }
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:37
DDTranslation translation() const
Definition: DetGeomDesc.h:84
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:33
const T & get() const
Definition: EventSetup.h:59
static const int CTPPS_FAR_RP_ID
std::vector< double > params() const
Definition: DetGeomDesc.h:89
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::endLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
overrideprotected

Definition at line 948 of file CTPPSDiamondDQMSource.cc.

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

949 {
950  for ( auto& plot : channelPlots_ ) {
951  if ( plot.second.hitsCounterPerLumisection != 0 ) {
952  plot.second.hit_rate->Fill( (double) plot.second.hitsCounterPerLumisection / SEC_PER_LUMI_SECTION );
953  }
954  plot.second.hitsCounterPerLumisection = 0;
955 
956  double HundredOverHitCounter = .0;
957  if ( plot.second.HitCounter != 0 )
958  HundredOverHitCounter = 100. / plot.second.HitCounter;
959  plot.second.HPTDCErrorFlags->setBinContent( 16, HundredOverHitCounter * plot.second.MHCounter );
960  plot.second.leadingWithoutTrailing->setBinContent(1, HundredOverHitCounter * plot.second.LeadingOnlyCounter );
961  plot.second.leadingWithoutTrailing->setBinContent(2, HundredOverHitCounter * plot.second.TrailingOnlyCounter );
962  plot.second.leadingWithoutTrailing->setBinContent(3, HundredOverHitCounter * plot.second.CompleteCounter );
963  }
964 
965  for ( auto& plot : potPlots_ ) {
966  double HundredOverHitCounterPot = 0.;
967  if ( plot.second.HitCounter !=0 )
968  HundredOverHitCounterPot = 100. / plot.second.HitCounter;
969  plot.second.HPTDCErrorFlags_cumulative->setBinContent( 16, HundredOverHitCounterPot * plot.second.MHCounter );
970  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(1, HundredOverHitCounterPot * plot.second.LeadingOnlyCounter );
971  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(2, HundredOverHitCounterPot * plot.second.TrailingOnlyCounter );
972  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(3, HundredOverHitCounterPot * plot.second.CompleteCounter );
973 
974  plot.second.MHComprensive->Reset();
975  CTPPSDiamondDetId rpId(plot.first);
976  for ( auto& chPlot : channelPlots_ ) {
977  CTPPSDiamondDetId chId(chPlot.first);
978  if ( chId.arm() == rpId.arm() && chId.rp() == rpId.rp() ) {
979  plot.second.MHComprensive->Fill(chId.plane(), chId.channel(), chPlot.second.HPTDCErrorFlags->getBinContent( 16 ) );
980  }
981  }
982 
983  }
984 
985  // Efficiencies of single channels
986  for ( auto& plot : potPlots_ ) {
987  plot.second.EfficiencyOfChannelsInPot->Reset();
988  for ( auto& element : plot.second.effTriplecountingChMap ) {
989  if ( plot.second.effDoublecountingChMap[ element.first ] > 0) {
990  int plane = element.first / 100;
991  int channel = element.first % 100;
992  double counted = element.second;
993  double total = plot.second.effDoublecountingChMap[ element.first ];
994  double efficiency = counted / total;
995 // double error = std::sqrt( efficiency * ( 1 - efficiency ) / total );
996 
997  plot.second.EfficiencyOfChannelsInPot->Fill(plane, channel, 100*efficiency);
998  }
999  }
1000  }
1001 
1002  // Efficeincy wrt pixels //TODO
1003  for ( auto& plot : planePlots_ ) {
1004  TH2F *hitHistoTmp = plot.second.EfficiencyWRTPixelsInPlane->getTH2F();
1005 
1006  CTPPSDiamondDetId detId_pot( plot.first );
1007  detId_pot.setPlane( 0 );
1008 
1009  hitHistoTmp->Divide( &(plot.second.pixelTracksMapWithDiamonds), &(potPlots_[detId_pot].pixelTracksMap) );
1010  }
1011 }
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_
void CTPPSDiamondDQMSource::endRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 1016 of file CTPPSDiamondDQMSource.cc.

References DEFINE_FWK_MODULE.

1017 {}

Member Data Documentation

int CTPPSDiamondDQMSource::centralOOT_
private

Definition at line 102 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const int CTPPSDiamondDQMSource::CHANNEL_OF_VFAT_CLOCK = 30
staticprivate

Definition at line 76 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 205 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_CHANNELS = 12
staticprivate

Definition at line 87 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_PLANES = 4
staticprivate

Definition at line 86 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_RP_ID = 6
staticprivate

Definition at line 82 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_STATION_ID = 1
staticprivate

Definition at line 81 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_FAR_RP_ID = 3
staticprivate

Definition at line 85 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_45 = 583
staticprivate

Definition at line 88 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_56 = 582
staticprivate

Definition at line 89 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_NEAR_RP_ID = 2
staticprivate

Definition at line 84 of file CTPPSDiamondDQMSource.cc.

const int CTPPSDiamondDQMSource::CTPPS_NUM_OF_ARMS = 2
staticprivate

Definition at line 80 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_PIXEL_STATION_ID = 2
staticprivate

Definition at line 83 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const double CTPPSDiamondDQMSource::DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
staticprivate

Definition at line 77 of file CTPPSDiamondDQMSource.cc.

int CTPPSDiamondDQMSource::EC_difference_45_
private

Definition at line 162 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

int CTPPSDiamondDQMSource::EC_difference_56_
private

Definition at line 162 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

bool CTPPSDiamondDQMSource::excludeMultipleHits_
private

Definition at line 98 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

GlobalPlots CTPPSDiamondDQMSource::globalPlot_
private

Definition at line 112 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

double CTPPSDiamondDQMSource::horizontalShiftBwDiamondPixels_
private

Definition at line 99 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

double CTPPSDiamondDQMSource::horizontalShiftOfDiamond_
private

Definition at line 100 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

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

Definition at line 79 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 180 of file CTPPSDiamondDQMSource.cc.

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

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

Definition at line 101 of file CTPPSDiamondDQMSource.cc.

Referenced by CTPPSDiamondDQMSource(), and dqmBeginRun().

const double CTPPSDiamondDQMSource::SEC_PER_LUMI_SECTION = 23.31
staticprivate

Definition at line 75 of file CTPPSDiamondDQMSource.cc.

Referenced by endLuminosityBlock().

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

Definition at line 94 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 95 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 93 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 96 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 92 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 91 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

unsigned int CTPPSDiamondDQMSource::verbosity_
private

Definition at line 103 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().