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:
DQMOneEDAnalyzer< edm::LuminosityBlockCache< dds::Cache > > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > 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 DQMOneEDAnalyzer< edm::LuminosityBlockCache< dds::Cache > >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
std::shared_ptr< dds::CacheglobalBeginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) const override
 
void globalEndLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< dds::Cache > >
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Attributes

int centralOOT_
 
std::unordered_map< unsigned int, ChannelPlotschannelPlots_
 
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecordctppsGeometryEventToken_
 
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecordctppsGeometryRunToken_
 
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 DQMOneEDAnalyzer< edm::LuminosityBlockCache< dds::Cache > >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- 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 DQMOneEDAnalyzer< edm::LuminosityBlockCache< dds::Cache > >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 68 of file CTPPSDiamondDQMSource.cc.

Constructor & Destructor Documentation

◆ CTPPSDiamondDQMSource()

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

Definition at line 476 of file CTPPSDiamondDQMSource.cc.

485  tokenFEDInfo_(consumes<std::vector<TotemFEDInfo>>(ps.getParameter<edm::InputTag>("tagFEDInfo"))),
486  ctppsGeometryRunToken_(esConsumes<CTPPSGeometry, VeryForwardRealGeometryRecord, edm::Transition::BeginRun>()),
487  ctppsGeometryEventToken_(esConsumes<CTPPSGeometry, VeryForwardRealGeometryRecord>()),
488  excludeMultipleHits_(ps.getParameter<bool>("excludeMultipleHits")),
489  centralOOT_(-999),
490  verbosity_(ps.getUntrackedParameter<unsigned int>("verbosity", 0)),
491  EC_difference_56_(-500),
492  EC_difference_45_(-500) {
493  for (const auto& pset : ps.getParameter<std::vector<edm::ParameterSet>>("offsetsOOT")) {
494  runParameters_.emplace_back(
495  std::make_pair(pset.getParameter<edm::EventRange>("validityRange"), pset.getParameter<int>("centralOOT")));
496  }
497 }

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

◆ ~CTPPSDiamondDQMSource()

CTPPSDiamondDQMSource::~CTPPSDiamondDQMSource ( )
override

Definition at line 501 of file CTPPSDiamondDQMSource.cc.

501 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMOneEDAnalyzer< edm::LuminosityBlockCache< dds::Cache > >.

Definition at line 564 of file CTPPSDiamondDQMSource.cc.

564  {
565  // get event data
567  event.getByToken(tokenStatus_, diamondVFATStatus);
568 
570  event.getByToken(tokenPixelTrack_, pixelTracks);
571 
573  event.getByToken(tokenDigi_, diamondDigis);
574 
576  event.getByToken(tokenFEDInfo_, fedInfo);
577 
579  event.getByToken(tokenDiamondHit_, diamondRecHits);
580 
582  event.getByToken(tokenDiamondTrack_, diamondLocalTracks);
583 
584  const CTPPSGeometry* ctppsGeometry = &iSetup.getData(ctppsGeometryEventToken_);
585 
586  // check validity
587  bool valid = true;
588  valid &= diamondVFATStatus.isValid();
589  valid &= pixelTracks.isValid();
590  valid &= diamondDigis.isValid();
591  valid &= fedInfo.isValid();
592  valid &= diamondRecHits.isValid();
593  valid &= diamondLocalTracks.isValid();
594 
595  if (!valid) {
596  if (verbosity_) {
597  edm::LogProblem("CTPPSDiamondDQMSource")
598  << "ERROR in CTPPSDiamondDQMSource::analyze > some of the required inputs are not valid. Skipping this "
599  "event.\n"
600  << " diamondVFATStatus.isValid = " << diamondVFATStatus.isValid() << "\n"
601  << " pixelTracks.isValid = " << pixelTracks.isValid() << "\n"
602  << " diamondDigis.isValid = " << diamondDigis.isValid() << "\n"
603  << " fedInfo.isValid = " << fedInfo.isValid() << "\n"
604  << " diamondRecHits.isValid = " << diamondRecHits.isValid() << "\n"
605  << " diamondLocalTracks.isValid = " << diamondLocalTracks.isValid();
606  }
607 
608  return;
609  }
610 
611  //------------------------------
612  // RP Plots
613  //------------------------------
614 
615  //------------------------------
616  // Correlation Plots
617  //------------------------------
618 
619  // Using CTPPSDiamondDigi
620  for (const auto& digis : *diamondDigis) {
621  const CTPPSDiamondDetId detId(digis.detId());
622  CTPPSDiamondDetId detId_pot(digis.detId());
623 
624  for (const auto& digi : digis) {
625  detId_pot.setPlane(0);
626  detId_pot.setChannel(0);
627  if (detId.channel() == CHANNEL_OF_VFAT_CLOCK)
628  continue;
629  if (potPlots_.find(detId_pot) == potPlots_.end())
630  continue;
631  //Leading without trailing investigation
632  if (digi.leadingEdge() != 0 || digi.trailingEdge() != 0) {
633  ++(potPlots_[detId_pot].HitCounter);
634  if (digi.leadingEdge() != 0) {
635  potPlots_[detId_pot].leadingEdgeCumulative_all->Fill(HPTDC_BIN_WIDTH_NS * digi.leadingEdge());
636  }
637  if (digi.leadingEdge() != 0 && digi.trailingEdge() == 0) {
638  ++(potPlots_[detId_pot].LeadingOnlyCounter);
639  potPlots_[detId_pot].leadingEdgeCumulative_le->Fill(HPTDC_BIN_WIDTH_NS * digi.leadingEdge());
640  }
641  if (digi.leadingEdge() == 0 && digi.trailingEdge() != 0) {
642  ++(potPlots_[detId_pot].TrailingOnlyCounter);
643  potPlots_[detId_pot].trailingEdgeCumulative_te->Fill(HPTDC_BIN_WIDTH_NS * digi.trailingEdge());
644  }
645  if (digi.leadingEdge() != 0 && digi.trailingEdge() != 0) {
646  ++(potPlots_[detId_pot].CompleteCounter);
647  potPlots_[detId_pot].leadingTrailingCorrelationPot->Fill(HPTDC_BIN_WIDTH_NS * digi.leadingEdge(),
648  HPTDC_BIN_WIDTH_NS * digi.trailingEdge());
649  }
650  }
651 
652  // HPTDC Errors
653  const HPTDCErrorFlags hptdcErrors = digi.hptdcErrorFlags();
654  if (detId.channel() == 6 || detId.channel() == 7) // ch6 for HPTDC 0 and ch7 for HPTDC 1
655  {
656  int verticalIndex = 2 * detId.plane() + (detId.channel() - 6);
657  for (unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex)
658  if (hptdcErrors.errorId(hptdcErrorIndex - 1))
659  potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(hptdcErrorIndex, verticalIndex);
660  }
661  if (digi.multipleHit())
662  ++(potPlots_[detId_pot].MHCounter);
663  }
664  }
665 
666  // EC Errors
667  for (const auto& vfat_status : *diamondVFATStatus) {
668  const CTPPSDiamondDetId detId(vfat_status.detId());
669  CTPPSDiamondDetId detId_pot(vfat_status.detId());
670  detId_pot.setPlane(0);
671  detId_pot.setChannel(0);
672  for (const auto& status : vfat_status) {
673  if (!status.isOK())
674  continue;
675  if (potPlots_.find(detId_pot) == potPlots_.end())
676  continue;
677  if (channelPlots_.find(detId) == channelPlots_.end())
678  continue;
679 
680  // Check Event Number
681  for (const auto& optorx : *fedInfo) {
682  if (detId.arm() == 1 && optorx.fedId() == CTPPS_FED_ID_56) {
683  potPlots_[detId_pot].ECCheck->Fill((int)((optorx.lv1() & 0xFF) - ((unsigned int)status.ec() & 0xFF)) & 0xFF);
684  if ((static_cast<int>((optorx.lv1() & 0xFF) - status.ec()) != EC_difference_56_) &&
685  (static_cast<uint8_t>((optorx.lv1() & 0xFF) - status.ec()) < 128))
686  EC_difference_56_ = static_cast<int>(optorx.lv1() & 0xFF) - (static_cast<unsigned int>(status.ec()) & 0xFF);
687  if (EC_difference_56_ != 1 && EC_difference_56_ != -500 && std::abs(EC_difference_56_) < 127) {
688  if (detId.channel() == 6 || detId.channel() == 7)
689  potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(16, 2 * detId.plane() + (detId.channel() - 6));
690  if (verbosity_)
691  edm::LogProblem("CTPPSDiamondDQMSource")
692  << "FED " << CTPPS_FED_ID_56 << ": ECError at EV: 0x" << std::hex << optorx.lv1() << "\t\tVFAT EC: 0x"
693  << static_cast<unsigned int>(status.ec()) << "\twith ID: " << std::dec << detId
694  << "\tdiff: " << EC_difference_56_;
695  }
696  } else if (detId.arm() == 0 && optorx.fedId() == CTPPS_FED_ID_45) {
697  potPlots_[detId_pot].ECCheck->Fill((int)((optorx.lv1() & 0xFF) - status.ec()) & 0xFF);
698  if ((static_cast<int>((optorx.lv1() & 0xFF) - status.ec()) != EC_difference_45_) &&
699  (static_cast<uint8_t>((optorx.lv1() & 0xFF) - status.ec()) < 128))
700  EC_difference_45_ = static_cast<int>(optorx.lv1() & 0xFF) - (static_cast<unsigned int>(status.ec()) & 0xFF);
701  if (EC_difference_45_ != 1 && EC_difference_45_ != -500 && std::abs(EC_difference_45_) < 127) {
702  if (detId.channel() == 6 || detId.channel() == 7)
703  potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(16, 2 * detId.plane() + (detId.channel() - 6));
704  if (verbosity_)
705  edm::LogProblem("CTPPSDiamondDQMSource")
706  << "FED " << CTPPS_FED_ID_45 << ": ECError at EV: 0x" << std::hex << optorx.lv1() << "\t\tVFAT EC: 0x"
707  << static_cast<unsigned int>(status.ec()) << "\twith ID: " << std::dec << detId
708  << "\tdiff: " << EC_difference_45_;
709  }
710  }
711  }
712  }
713  }
714 
715  // Using CTPPSDiamondRecHit
716  std::unordered_map<unsigned int, std::set<unsigned int>> planes;
717  std::unordered_map<unsigned int, std::set<unsigned int>> planes_inclusive;
718 
719  auto lumiCache = luminosityBlockCache(event.getLuminosityBlock().index());
720  for (const auto& rechits : *diamondRecHits) {
721  CTPPSDiamondDetId detId_pot(rechits.detId());
722  detId_pot.setPlane(0);
723  detId_pot.setChannel(0);
724  const CTPPSDiamondDetId detId(rechits.detId());
725 
726  for (const auto& rechit : rechits) {
727  planes_inclusive[detId_pot].insert(detId.plane());
728  if (excludeMultipleHits_ && rechit.multipleHits() > 0)
729  continue;
730  if (rechit.toT() != 0 && centralOOT_ != -999 && rechit.ootIndex() == centralOOT_)
731  planes[detId_pot].insert(detId.plane());
732 
733  if (potPlots_.find(detId_pot) == potPlots_.end())
734  continue;
735 
736  float UFSDShift = 0.0;
737  if (rechit.yWidth() < 3)
738  UFSDShift = 0.5; // Display trick for UFSD that have 2 pixels with same X
739 
740  if (rechit.toT() != 0 && centralOOT_ != -999 && rechit.ootIndex() == centralOOT_) {
741  TH2F* hitHistoTmp = potPlots_[detId_pot].hitDistribution2d->getTH2F();
742  TAxis* hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
743  int startBin = hitHistoTmpYAxis->FindBin(rechit.x() - horizontalShiftOfDiamond_ - 0.5 * rechit.xWidth());
744  int numOfBins = rechit.xWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
745  for (int i = 0; i < numOfBins; ++i) {
746  hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin + i));
747  }
748 
749  hitHistoTmp = lumiCache->hitDistribution2dMap[detId_pot].get();
750  hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
751  startBin = hitHistoTmpYAxis->FindBin(rechit.x() - horizontalShiftOfDiamond_ - 0.5 * rechit.xWidth());
752  numOfBins = rechit.xWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
753  for (int i = 0; i < numOfBins; ++i) {
754  hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin + i));
755  }
756  }
757 
758  if (rechit.toT() != 0) {
759  // Both
760  potPlots_[detId_pot].leadingEdgeCumulative_both->Fill(rechit.time() + 25 * rechit.ootIndex());
761  potPlots_[detId_pot].timeOverThresholdCumulativePot->Fill(rechit.toT());
762 
763  TH2F* hitHistoOOTTmp = potPlots_[detId_pot].hitDistribution2dOOT->getTH2F();
764  TAxis* hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
765  int startBin = hitHistoOOTTmpYAxis->FindBin(rechit.x() - horizontalShiftOfDiamond_ - 0.5 * rechit.xWidth());
766  int numOfBins = rechit.xWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
767  for (int i = 0; i < numOfBins; ++i) {
768  hitHistoOOTTmp->Fill(detId.plane() + 0.25 * rechit.ootIndex(),
769  hitHistoOOTTmpYAxis->GetBinCenter(startBin + i));
770  }
771  } else {
772  if (rechit.ootIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING) {
773  // Only leading
774  TH2F* hitHistoOOTTmp = potPlots_[detId_pot].hitDistribution2dOOT_le->getTH2F();
775  TAxis* hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
776  int startBin = hitHistoOOTTmpYAxis->FindBin(rechit.x() - horizontalShiftOfDiamond_ - 0.5 * rechit.xWidth());
777  int numOfBins = rechit.xWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
778  for (int i = 0; i < numOfBins; ++i) {
779  hitHistoOOTTmp->Fill(detId.plane() + 0.25 * rechit.ootIndex(),
780  hitHistoOOTTmpYAxis->GetBinCenter(startBin + i));
781  }
782  }
783  }
784  if (rechit.ootIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING &&
785  potPlots_[detId_pot].activity_per_bx.count(rechit.ootIndex()) > 0)
786  potPlots_[detId_pot].activity_per_bx.at(rechit.ootIndex())->Fill(event.bunchCrossing());
787  }
788  }
789 
790  for (const auto& plt : potPlots_) {
791  plt.second.activePlanes->Fill(planes[plt.first].size());
792  plt.second.activePlanesInclusive->Fill(planes_inclusive[plt.first].size());
793  }
794 
795  // Using CTPPSDiamondLocalTrack
796  for (const auto& tracks : *diamondLocalTracks) {
797  CTPPSDiamondDetId detId_pot(tracks.detId());
798  detId_pot.setPlane(0);
799  detId_pot.setChannel(0);
800  const CTPPSDiamondDetId detId(tracks.detId());
801 
802  for (const auto& track : tracks) {
803  if (!track.isValid())
804  continue;
806  continue;
807  if (excludeMultipleHits_ && track.multipleHits() > 0)
808  continue;
809  if (potPlots_.find(detId_pot) == potPlots_.end())
810  continue;
811 
812  TH2F* trackHistoOOTTmp = potPlots_[detId_pot].trackDistributionOOT->getTH2F();
813  TAxis* trackHistoOOTTmpYAxis = trackHistoOOTTmp->GetYaxis();
814  int startBin = trackHistoOOTTmpYAxis->FindBin(track.x0() - horizontalShiftOfDiamond_ - track.x0Sigma());
815  int numOfBins = 2 * track.x0Sigma() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
816  for (int i = 0; i < numOfBins; ++i) {
817  trackHistoOOTTmp->Fill(track.ootIndex(), trackHistoOOTTmpYAxis->GetBinCenter(startBin + i));
818  }
819 
820  if (centralOOT_ != -999 && track.ootIndex() == centralOOT_) {
821  TH1F* trackHistoInTimeTmp = potPlots_[detId_pot].trackDistribution->getTH1F();
822  int startBin = trackHistoInTimeTmp->FindBin(track.x0() - horizontalShiftOfDiamond_ - track.x0Sigma());
823  int numOfBins = 2 * track.x0Sigma() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
824  for (int i = 0; i < numOfBins; ++i) {
825  trackHistoInTimeTmp->Fill(trackHistoInTimeTmp->GetBinCenter(startBin + i));
826  }
827  }
828  }
829  }
830 
831  // Channel efficiency using CTPPSDiamondLocalTrack
832  for (const auto& tracks : *diamondLocalTracks) {
833  CTPPSDiamondDetId detId_pot(tracks.detId());
834  detId_pot.setPlane(0);
835  detId_pot.setChannel(0);
836  for (const auto& track : tracks) {
837  // Find hits and planes in the track
838  int numOfHits = 0;
839  std::set<int> planesInTrackSet;
840  for (const auto& vec : *diamondRecHits) {
841  const CTPPSDiamondDetId detid(vec.detId());
842  if (detid.arm() != detId_pot.arm())
843  continue;
844 
845  for (const auto& hit : vec) {
846  // first check if the hit contributes to the track
847  if (track.containsHit(hit)) {
848  ++numOfHits;
849  planesInTrackSet.insert(detid.plane());
850  }
851  }
852  }
853 
854  if (numOfHits > 0 && numOfHits <= 10 && planesInTrackSet.size() > 2) {
855  for (int plane = 0; plane < 4; ++plane) {
856  for (int channel = 0; channel < 12; ++channel) {
857  int map_index = plane * 100 + channel;
858  if (potPlots_[detId_pot].effDoublecountingChMap.find(map_index) ==
859  potPlots_[detId_pot].effDoublecountingChMap.end()) {
860  potPlots_[detId_pot].effTriplecountingChMap[map_index] = 0;
861  potPlots_[detId_pot].effDoublecountingChMap[map_index] = 0;
862  }
863  CTPPSDiamondDetId detId(detId_pot.arm(), CTPPS_DIAMOND_STATION_ID, CTPPS_DIAMOND_RP_ID, plane, channel);
864  if (channelAlignedWithTrack(ctppsGeometry, detId, track, 0.2)) {
865  // Channel should fire
866  ++(potPlots_[detId_pot].effDoublecountingChMap[map_index]);
867  for (const auto& rechits : *diamondRecHits) {
868  CTPPSDiamondDetId detId_hit(rechits.detId());
869  if (detId_hit == detId) {
870  for (const auto& rechit : rechits) {
871  if (track.containsHit(rechit, 1)) {
872  // Channel fired
873  ++(potPlots_[detId_pot].effTriplecountingChMap[map_index]);
874  }
875  }
876  }
877  }
878  }
879  }
880  }
881  }
882  }
883  }
884 
885  // Tomography of diamonds using pixel
886  for (const auto& rechits : *diamondRecHits) {
887  CTPPSDiamondDetId detId_pot(rechits.detId());
888  detId_pot.setPlane(0);
889  detId_pot.setChannel(0);
890  const CTPPSDiamondDetId detId(rechits.detId());
891  for (const auto& rechit : rechits) {
892  if (excludeMultipleHits_ && rechit.multipleHits() > 0)
893  continue;
894  if (rechit.toT() == 0)
895  continue;
896  if (!pixelTracks.isValid())
897  continue;
898  if (potPlots_.find(detId_pot) == potPlots_.end())
899  continue;
900 
901  for (const auto& ds : *pixelTracks) {
902  if (ds.size() > 1)
903  continue;
904  const CTPPSPixelDetId pixId(ds.detId());
905  if (pixId.station() != CTPPS_PIXEL_STATION_ID || pixId.rp() != CTPPS_FAR_RP_ID)
906  continue;
907  for (const auto& lt : ds) {
908  if (lt.isValid() && pixId.arm() == detId_pot.arm()) {
909  if (rechit.ootIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING && rechit.ootIndex() >= 0 &&
910  potPlots_[detId_pot].pixelTomographyAll.count(rechit.ootIndex()) > 0 &&
911  lt.x0() - horizontalShiftBwDiamondPixels_ < 24)
912  potPlots_[detId_pot]
913  .pixelTomographyAll.at(rechit.ootIndex())
914  ->Fill(lt.x0() - horizontalShiftBwDiamondPixels_ + 25 * detId.plane(), lt.y0());
915  }
916  }
917  }
918  }
919  }
920 
921  //------------------------------
922  // Clock Plots
923  //------------------------------
924  // Commented out to save space in the DQM files, but code should be kept
925  // for ( const auto& digis : *diamondDigis ) {
926  // const CTPPSDiamondDetId detId( digis.detId() );
927  // CTPPSDiamondDetId detId_pot( digis.detId() );
928  // if ( detId.channel() == CHANNEL_OF_VFAT_CLOCK ) {
929  // detId_pot.setPlane( 0 );
930  // detId_pot.setChannel( 0 );
931  // for ( const auto& digi : digis ) {
932  // if ( digi.leadingEdge() != 0 ) {
933  // if ( detId.plane() == 1 ) {
934  // potPlots_[detId_pot].clock_Digi1_le->Fill( HPTDC_BIN_WIDTH_NS * digi.leadingEdge() );
935  // potPlots_[detId_pot].clock_Digi1_te->Fill( HPTDC_BIN_WIDTH_NS * digi.trailingEdge() );
936  // }
937  // if ( detId.plane() == 3 ) {
938  // potPlots_[detId_pot].clock_Digi3_le->Fill( HPTDC_BIN_WIDTH_NS * digi.leadingEdge() );
939  // potPlots_[detId_pot].clock_Digi3_te->Fill( HPTDC_BIN_WIDTH_NS * digi.trailingEdge() );
940  // }
941  // }
942  // }
943  // }
944  // }
945 
946  //------------------------------
947  // Plane Plots
948  //------------------------------
949 
950  // Using CTPPSDiamondDigi
951  std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
952  for (const auto& digis : *diamondDigis) {
953  const CTPPSDiamondDetId detId(digis.detId());
954  CTPPSDiamondDetId detId_plane(digis.detId());
955  for (const auto& digi : digis) {
956  detId_plane.setChannel(0);
957  if (detId.channel() == CHANNEL_OF_VFAT_CLOCK)
958  continue;
959  if (planePlots_.find(detId_plane) == planePlots_.end())
960  continue;
961 
962  if (digi.leadingEdge() != 0) {
963  planePlots_[detId_plane].digiProfileCumulativePerPlane->Fill(detId.channel());
964  if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
965  channelsPerPlane[detId_plane]++;
966  else
967  channelsPerPlane[detId_plane] = 0;
968  }
969  }
970  }
971 
972  for (const auto& plt : channelsPerPlane) {
973  planePlots_[plt.first].hit_multiplicity->Fill(plt.second);
974  }
975 
976  // Using CTPPSDiamondRecHit
977  for (const auto& rechits : *diamondRecHits) {
978  CTPPSDiamondDetId detId_plane(rechits.detId());
979  detId_plane.setChannel(0);
980  for (const auto& rechit : rechits) {
981  if (excludeMultipleHits_ && rechit.multipleHits() > 0)
982  continue;
983  if (rechit.toT() == 0)
984  continue;
985  if (planePlots_.find(detId_plane) != planePlots_.end()) {
986  if (centralOOT_ != -999 && rechit.ootIndex() == centralOOT_) {
987  TH1F* hitHistoTmp = planePlots_[detId_plane].hitProfile->getTH1F();
988  int startBin = hitHistoTmp->FindBin(rechit.x() - horizontalShiftOfDiamond_ - 0.5 * rechit.xWidth());
989  int numOfBins = rechit.xWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
990  for (int i = 0; i < numOfBins; ++i) {
991  hitHistoTmp->Fill(hitHistoTmp->GetBinCenter(startBin + i));
992  }
993  }
994  }
995  }
996  }
997 
998  //Tomography of diamonds using pixel and Efficiency WRT Pixels
999  for (const auto& ds : *pixelTracks) {
1000  const CTPPSPixelDetId pixId(ds.detId());
1001  if (pixId.station() != CTPPS_PIXEL_STATION_ID || pixId.rp() != CTPPS_FAR_RP_ID)
1002  continue;
1003  if (ds.size() > 1)
1004  continue;
1005  for (const auto& lt : ds) {
1006  if (lt.isValid()) {
1007  // For efficieny
1009  potPlots_[detId_pot].pixelTracksMap.Fill(lt.x0() - horizontalShiftBwDiamondPixels_, lt.y0());
1010 
1011  std::set<CTPPSDiamondDetId> planesWitHits_set;
1012  for (const auto& rechits : *diamondRecHits) {
1013  CTPPSDiamondDetId detId_plane(rechits.detId());
1014  detId_plane.setChannel(0);
1015  for (const auto& rechit : rechits) {
1016  if (excludeMultipleHits_ && rechit.multipleHits() > 0)
1017  continue;
1018  if (rechit.ootIndex() == CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING || rechit.toT() == 0)
1019  continue;
1020  if (planePlots_.find(detId_plane) == planePlots_.end())
1021  continue;
1022  if (pixId.arm() == detId_plane.arm() && lt.x0() - horizontalShiftBwDiamondPixels_ < 24) {
1023  planePlots_[detId_plane].pixelTomography_far->Fill(
1024  lt.x0() - horizontalShiftBwDiamondPixels_ + 25 * rechit.ootIndex(), lt.y0());
1025  if (centralOOT_ != -999 && rechit.ootIndex() == centralOOT_)
1026  planesWitHits_set.insert(detId_plane);
1027  }
1028  }
1029  }
1030 
1031  for (auto& planeId : planesWitHits_set)
1032  planePlots_[planeId].pixelTracksMapWithDiamonds.Fill(lt.x0() - horizontalShiftBwDiamondPixels_, lt.y0());
1033  }
1034  }
1035  }
1036 
1037  //------------------------------
1038  // Channel Plots
1039  //------------------------------
1040 
1041  // digi profile cumulative
1042  for (const auto& digis : *diamondDigis) {
1043  const CTPPSDiamondDetId detId(digis.detId());
1044  for (const auto& digi : digis) {
1045  if (detId.channel() == CHANNEL_OF_VFAT_CLOCK)
1046  continue;
1047  if (channelPlots_.find(detId) != channelPlots_.end()) {
1048  // HPTDC Errors
1049  const HPTDCErrorFlags hptdcErrors = digi.hptdcErrorFlags();
1050  for (unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex)
1051  if (hptdcErrors.errorId(hptdcErrorIndex - 1))
1052  channelPlots_[detId].HPTDCErrorFlags->Fill(hptdcErrorIndex);
1053  if (digi.multipleHit())
1054  ++(channelPlots_[detId].MHCounter);
1055 
1056  // Check dropped trailing edges
1057  if (digi.leadingEdge() != 0 || digi.trailingEdge() != 0) {
1058  ++(channelPlots_[detId].HitCounter);
1059  if (digi.leadingEdge() != 0 && digi.trailingEdge() == 0) {
1060  ++(channelPlots_[detId].LeadingOnlyCounter);
1061  channelPlots_[detId].leadingEdgeCumulative_le->Fill(HPTDC_BIN_WIDTH_NS * digi.leadingEdge());
1062  }
1063  if (digi.leadingEdge() == 0 && digi.trailingEdge() != 0) {
1064  ++(channelPlots_[detId].TrailingOnlyCounter);
1065  channelPlots_[detId].trailingEdgeCumulative_te->Fill(HPTDC_BIN_WIDTH_NS * digi.trailingEdge());
1066  }
1067  if (digi.leadingEdge() != 0 && digi.trailingEdge() != 0) {
1068  ++(channelPlots_[detId].CompleteCounter);
1069  channelPlots_[detId].LeadingTrailingCorrelationPerChannel->Fill(HPTDC_BIN_WIDTH_NS * digi.leadingEdge(),
1070  HPTDC_BIN_WIDTH_NS * digi.trailingEdge());
1071  }
1072  }
1073  }
1074  }
1075  }
1076 
1077  // Using CTPPSDiamondRecHit
1078 
1079  for (const auto& rechits : *diamondRecHits) {
1080  CTPPSDiamondDetId detId(rechits.detId());
1081  for (const auto& rechit : rechits) {
1082  if (excludeMultipleHits_ && rechit.multipleHits() > 0)
1083  continue;
1084  if (channelPlots_.find(detId) != channelPlots_.end()) {
1085  if (rechit.ootIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING && rechit.toT() != 0) {
1086  channelPlots_[detId].leadingEdgeCumulative_both->Fill(rechit.time() + 25 * rechit.ootIndex());
1087  channelPlots_[detId].TimeOverThresholdCumulativePerChannel->Fill(rechit.toT());
1088  }
1089  ++(lumiCache->hitsCounterMap[detId]);
1090  }
1091 
1092  if (rechit.ootIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING &&
1093  channelPlots_[detId].activity_per_bx.count(rechit.ootIndex()) > 0)
1094  channelPlots_[detId].activity_per_bx.at(rechit.ootIndex())->Fill(event.bunchCrossing());
1095  }
1096  }
1097 
1098  // Tomography of diamonds using pixel
1099  for (const auto& rechits : *diamondRecHits) {
1100  const CTPPSDiamondDetId detId(rechits.detId());
1101  for (const auto& rechit : rechits) {
1102  if (excludeMultipleHits_ && rechit.multipleHits() > 0)
1103  continue;
1104  if (rechit.ootIndex() == CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING || rechit.toT() == 0)
1105  continue;
1106  if (!pixelTracks.isValid())
1107  continue;
1108  if (channelPlots_.find(detId) == channelPlots_.end())
1109  continue;
1110 
1111  for (const auto& ds : *pixelTracks) {
1112  const CTPPSPixelDetId pixId(ds.detId());
1113  if (pixId.station() != CTPPS_PIXEL_STATION_ID || pixId.rp() != CTPPS_FAR_RP_ID)
1114  continue;
1115  if (ds.size() > 1)
1116  continue;
1117  for (const auto& lt : ds) {
1118  if (lt.isValid() && pixId.arm() == detId.arm() && lt.x0() - horizontalShiftBwDiamondPixels_ < 24)
1119  channelPlots_[detId].pixelTomography_far->Fill(
1120  lt.x0() - horizontalShiftBwDiamondPixels_ + 25 * rechit.ootIndex(), lt.y0());
1121  }
1122  }
1123  }
1124  }
1125 }

References funct::abs(), 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, ctppsGeometryEventToken_, TauDecayModes::dec, EC_difference_45_, EC_difference_56_, HPTDCErrorFlags::errorId(), excludeMultipleHits_, HcalObjRepresent::Fill(), edm::EventSetup::getData(), horizontalShiftBwDiamondPixels_, horizontalShiftOfDiamond_, HPTDC_BIN_WIDTH_NS, mps_fire::i, edm::eventsetup::heterocontainer::insert(), INV_DISPLAY_RESOLUTION_FOR_HITS_MM, edm::HandleBase::isValid(), BeamSpotProblemMonitor_cff::pixelTracks, planePlots_, potPlots_, TrackInfoProducer_cfi::rechits, CTPPSDiamondDetId::setChannel(), CTPPSDiamondDetId::setPlane(), mps_update::status, CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING, tokenDiamondHit_, tokenDiamondTrack_, tokenDigi_, tokenFEDInfo_, tokenPixelTrack_, tokenStatus_, HLT_2018_cff::track, PDWG_EXOHSCP_cff::tracks, validateGeometry_cfg::valid, and verbosity_.

◆ bookHistograms()

void CTPPSDiamondDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 530 of file CTPPSDiamondDQMSource.cc.

530  {
531  ibooker.cd();
532  ibooker.setCurrentFolder("CTPPS");
533 
534  globalPlot_ = GlobalPlots(ibooker);
535 
536  for (unsigned short arm = 0; arm < CTPPS_NUM_OF_ARMS; ++arm) {
538  potPlots_[rpId] = PotPlots(ibooker, rpId);
539  for (unsigned short pl = 0; pl < CTPPS_DIAMOND_NUM_OF_PLANES; ++pl) {
541  planePlots_[plId] = PlanePlots(ibooker, plId);
542  for (unsigned short ch = 0; ch < CTPPS_DIAMOND_NUM_OF_CHANNELS; ++ch) {
544  channelPlots_[chId] = ChannelPlots(ibooker, chId);
545  }
546  }
547  }
548 }

References 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 year_2016_postTS2_cff::rpId.

◆ dqmBeginRun()

void CTPPSDiamondDQMSource::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMOneEDAnalyzer< edm::LuminosityBlockCache< dds::Cache > >.

Definition at line 505 of file CTPPSDiamondDQMSource.cc.

505  {
506  centralOOT_ = -999;
507  for (const auto& oot : runParameters_) {
508  if (edm::contains(oot.first, edm::EventID(iRun.run(), 0, 1))) {
509  centralOOT_ = oot.second;
510  break;
511  }
512  }
513 
514  // Get detector shifts from the geometry
517  const DetGeomDesc* det = geom.sensor(detid);
518  horizontalShiftOfDiamond_ = det->translation().x() - det->params().at(0);
519 
520  // Rough alignement of pixel detector for diamond thomography
522  if (iRun.run() > 300000) { //Pixel installed
523  det = geom.sensor(pixid);
525  }
526 }

References centralOOT_, edm::contains(), CTPPS_DIAMOND_RP_ID, CTPPS_DIAMOND_STATION_ID, CTPPS_FAR_RP_ID, CTPPS_PIXEL_STATION_ID, ctppsGeometryRunToken_, relativeConstraints::geom, edm::EventSetup::getData(), horizontalShiftBwDiamondPixels_, horizontalShiftOfDiamond_, DetGeomDesc::params(), edm::RunBase::run(), runParameters_, and DetGeomDesc::translation().

◆ globalBeginLuminosityBlock()

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

Definition at line 552 of file CTPPSDiamondDQMSource.cc.

553  {
554  auto d = std::make_shared<dds::Cache>();
555  d->hitDistribution2dMap.reserve(potPlots_.size());
556  for (auto& plot : potPlots_)
557  d->hitDistribution2dMap[plot.first] =
558  std::unique_ptr<TH2F>(static_cast<TH2F*>(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
559  return d;
560 }

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

◆ globalEndLuminosityBlock()

void CTPPSDiamondDQMSource::globalEndLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup  
)
overrideprotected

Definition at line 1129 of file CTPPSDiamondDQMSource.cc.

1129  {
1130  auto lumiCache = luminosityBlockCache(iLumi.index());
1131  for (auto& plot : potPlots_) {
1132  *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]);
1133  }
1134  for (auto& plot : channelPlots_) {
1135  auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first];
1136  if (hitsCounterPerLumisection != 0) {
1137  plot.second.hit_rate->Fill((double)hitsCounterPerLumisection / SEC_PER_LUMI_SECTION);
1138  }
1139 
1140  double HundredOverHitCounter = .0;
1141  if (plot.second.HitCounter != 0)
1142  HundredOverHitCounter = 100. / plot.second.HitCounter;
1143  plot.second.HPTDCErrorFlags->setBinContent(16, HundredOverHitCounter * plot.second.MHCounter);
1144  plot.second.leadingWithoutTrailing->setBinContent(1, HundredOverHitCounter * plot.second.LeadingOnlyCounter);
1145  plot.second.leadingWithoutTrailing->setBinContent(2, HundredOverHitCounter * plot.second.TrailingOnlyCounter);
1146  plot.second.leadingWithoutTrailing->setBinContent(3, HundredOverHitCounter * plot.second.CompleteCounter);
1147  }
1148 
1149  for (auto& plot : potPlots_) {
1150  double HundredOverHitCounterPot = 0.;
1151  if (plot.second.HitCounter != 0)
1152  HundredOverHitCounterPot = 100. / plot.second.HitCounter;
1153  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(
1154  1, HundredOverHitCounterPot * plot.second.LeadingOnlyCounter);
1155  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(
1156  2, HundredOverHitCounterPot * plot.second.TrailingOnlyCounter);
1157  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(
1158  3, HundredOverHitCounterPot * plot.second.CompleteCounter);
1159 
1160  plot.second.MHComprensive->Reset();
1161  CTPPSDiamondDetId rpId(plot.first);
1162  for (auto& chPlot : channelPlots_) {
1163  CTPPSDiamondDetId chId(chPlot.first);
1164  if (chId.arm() == rpId.arm() && chId.rp() == rpId.rp()) {
1165  plot.second.MHComprensive->Fill(chId.plane(), chId.channel(), chPlot.second.HPTDCErrorFlags->getBinContent(16));
1166  }
1167  }
1168  }
1169 
1170  // Efficiencies of single channels
1171  for (auto& plot : potPlots_) {
1172  plot.second.EfficiencyOfChannelsInPot->Reset();
1173  for (auto& element : plot.second.effTriplecountingChMap) {
1174  if (plot.second.effDoublecountingChMap[element.first] > 0) {
1175  int plane = element.first / 100;
1176  int channel = element.first % 100;
1177  double counted = element.second;
1178  double total = plot.second.effDoublecountingChMap[element.first];
1179  double efficiency = counted / total;
1180  // double error = std::sqrt( efficiency * ( 1 - efficiency ) / total );
1181 
1182  plot.second.EfficiencyOfChannelsInPot->Fill(plane, channel, 100 * efficiency);
1183  }
1184  }
1185  }
1186 
1187  // Efficeincy wrt pixels //TODO
1188  for (auto& plot : planePlots_) {
1189  TH2F* hitHistoTmp = plot.second.EfficiencyWRTPixelsInPlane->getTH2F();
1190 
1191  CTPPSDiamondDetId detId_pot(plot.first);
1192  detId_pot.setPlane(0);
1193 
1194  hitHistoTmp->Divide(&(plot.second.pixelTracksMapWithDiamonds), &(potPlots_[detId_pot].pixelTracksMap));
1195  }
1196 }

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

Member Data Documentation

◆ centralOOT_

int CTPPSDiamondDQMSource::centralOOT_
private

Definition at line 113 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

◆ CHANNEL_OF_VFAT_CLOCK

const int CTPPSDiamondDQMSource::CHANNEL_OF_VFAT_CLOCK = 30
staticprivate

Definition at line 84 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ channelPlots_

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

Definition at line 204 of file CTPPSDiamondDQMSource.cc.

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

◆ CTPPS_DIAMOND_NUM_OF_CHANNELS

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_CHANNELS = 12
staticprivate

Definition at line 95 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

◆ CTPPS_DIAMOND_NUM_OF_PLANES

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_PLANES = 4
staticprivate

Definition at line 94 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

◆ CTPPS_DIAMOND_RP_ID

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_RP_ID = 6
staticprivate

Definition at line 90 of file CTPPSDiamondDQMSource.cc.

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

◆ CTPPS_DIAMOND_STATION_ID

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_STATION_ID = 1
staticprivate

Definition at line 89 of file CTPPSDiamondDQMSource.cc.

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

◆ CTPPS_FAR_RP_ID

const int CTPPSDiamondDQMSource::CTPPS_FAR_RP_ID = 3
staticprivate

Definition at line 93 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

◆ CTPPS_FED_ID_45

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_45 = 583
staticprivate

Definition at line 96 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ CTPPS_FED_ID_56

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_56 = 582
staticprivate

Definition at line 97 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ CTPPS_NEAR_RP_ID

const int CTPPSDiamondDQMSource::CTPPS_NEAR_RP_ID = 2
staticprivate

Definition at line 92 of file CTPPSDiamondDQMSource.cc.

◆ CTPPS_NUM_OF_ARMS

const int CTPPSDiamondDQMSource::CTPPS_NUM_OF_ARMS = 2
staticprivate

Definition at line 88 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

◆ CTPPS_PIXEL_STATION_ID

const int CTPPSDiamondDQMSource::CTPPS_PIXEL_STATION_ID = 2
staticprivate

Definition at line 91 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

◆ ctppsGeometryEventToken_

edm::ESGetToken<CTPPSGeometry, VeryForwardRealGeometryRecord> CTPPSDiamondDQMSource::ctppsGeometryEventToken_
private

Definition at line 107 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ ctppsGeometryRunToken_

edm::ESGetToken<CTPPSGeometry, VeryForwardRealGeometryRecord> CTPPSDiamondDQMSource::ctppsGeometryRunToken_
private

Definition at line 106 of file CTPPSDiamondDQMSource.cc.

Referenced by dqmBeginRun().

◆ DISPLAY_RESOLUTION_FOR_HITS_MM

const double CTPPSDiamondDQMSource::DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
staticprivate

Definition at line 85 of file CTPPSDiamondDQMSource.cc.

◆ EC_difference_45_

int CTPPSDiamondDQMSource::EC_difference_45_
private

Definition at line 166 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ EC_difference_56_

int CTPPSDiamondDQMSource::EC_difference_56_
private

Definition at line 166 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ excludeMultipleHits_

bool CTPPSDiamondDQMSource::excludeMultipleHits_
private

Definition at line 109 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ globalPlot_

GlobalPlots CTPPSDiamondDQMSource::globalPlot_
private

Definition at line 122 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

◆ horizontalShiftBwDiamondPixels_

double CTPPSDiamondDQMSource::horizontalShiftBwDiamondPixels_
private

Definition at line 110 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

◆ horizontalShiftOfDiamond_

double CTPPSDiamondDQMSource::horizontalShiftOfDiamond_
private

Definition at line 111 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

◆ HPTDC_BIN_WIDTH_NS

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

Definition at line 87 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ INV_DISPLAY_RESOLUTION_FOR_HITS_MM

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

◆ planePlots_

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

Definition at line 183 of file CTPPSDiamondDQMSource.cc.

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

◆ potPlots_

std::unordered_map<unsigned int, PotPlots> CTPPSDiamondDQMSource::potPlots_
private

◆ runParameters_

std::vector<std::pair<edm::EventRange, int> > CTPPSDiamondDQMSource::runParameters_
private

Definition at line 112 of file CTPPSDiamondDQMSource.cc.

Referenced by CTPPSDiamondDQMSource(), and dqmBeginRun().

◆ SEC_PER_LUMI_SECTION

const double CTPPSDiamondDQMSource::SEC_PER_LUMI_SECTION = 23.31
staticprivate

Definition at line 83 of file CTPPSDiamondDQMSource.cc.

Referenced by globalEndLuminosityBlock().

◆ tokenDiamondHit_

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

Definition at line 102 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ tokenDiamondTrack_

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

Definition at line 103 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ tokenDigi_

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

Definition at line 101 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ tokenFEDInfo_

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

Definition at line 104 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ tokenPixelTrack_

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

Definition at line 100 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ tokenStatus_

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

Definition at line 99 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

◆ verbosity_

unsigned int CTPPSDiamondDQMSource::verbosity_
private

Definition at line 114 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::DetSetVector
Definition: DetSetVector.h:61
CTPPSDiamondDQMSource::tokenPixelTrack_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelTrack_
Definition: CTPPSDiamondDQMSource.cc:100
CTPPSDiamondDQMSource::tokenDigi_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > tokenDigi_
Definition: CTPPSDiamondDQMSource.cc:101
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:355
CTPPSDiamondDQMSource::HPTDC_BIN_WIDTH_NS
static const double HPTDC_BIN_WIDTH_NS
Definition: CTPPSDiamondDQMSource.cc:87
CTPPSDiamondDQMSource::CTPPS_FAR_RP_ID
static const int CTPPS_FAR_RP_ID
Definition: CTPPSDiamondDQMSource.cc:93
CTPPSGeometry
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:29
CTPPSDiamondDQMSource::ctppsGeometryRunToken_
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > ctppsGeometryRunToken_
Definition: CTPPSDiamondDQMSource.cc:106
CTPPSDiamondDQMSource::potPlots_
std::unordered_map< unsigned int, PotPlots > potPlots_
Definition: CTPPSDiamondDQMSource.cc:165
CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_CHANNELS
static const int CTPPS_DIAMOND_NUM_OF_CHANNELS
Definition: CTPPSDiamondDQMSource.cc:95
mps_update.status
status
Definition: mps_update.py:69
edm::LuminosityBlock::index
LuminosityBlockIndex index() const
Definition: LuminosityBlock.cc:20
CTPPSDiamondDQMSource::tokenDiamondTrack_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > tokenDiamondTrack_
Definition: CTPPSDiamondDQMSource.cc:103
CTPPSDiamondDQMSource::tokenFEDInfo_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
Definition: CTPPSDiamondDQMSource.cc:104
CTPPSDiamondDetId::setPlane
void setPlane(uint32_t channel)
Definition: CTPPSDiamondDetId.h:48
CTPPSDiamondDQMSource::tokenDiamondHit_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHit_
Definition: CTPPSDiamondDQMSource.cc:102
CTPPSDiamondDQMSource::channelPlots_
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
Definition: CTPPSDiamondDQMSource.cc:204
CTPPSDiamondDetId::setChannel
void setChannel(uint32_t channel)
Definition: CTPPSDiamondDetId.h:55
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
L1TObjectsTimingClient_cff.efficiency
efficiency
Definition: L1TObjectsTimingClient_cff.py:10
year_2016_postTS2_cff.rpId
rpId
Definition: year_2016_postTS2_cff.py:23
CTPPSDiamondDQMSource::excludeMultipleHits_
bool excludeMultipleHits_
Definition: CTPPSDiamondDQMSource.cc:109
edm::Handle
Definition: AssociativeIterator.h:50
plotFactory.plot
plot
Definition: plotFactory.py:109
edm::RunBase::run
RunNumber_t run() const
Definition: RunBase.h:40
validateGeometry_cfg.valid
valid
Definition: validateGeometry_cfg.py:21
CTPPSDiamondDQMSource::CTPPS_FED_ID_45
static const int CTPPS_FED_ID_45
Definition: CTPPSDiamondDQMSource.cc:96
HPTDCErrorFlags
Definition: HPTDCErrorFlags.h:15
CTPPSDiamondDQMSource::EC_difference_45_
int EC_difference_45_
Definition: CTPPSDiamondDQMSource.cc:166
CTPPSDiamondDQMSource::EC_difference_56_
int EC_difference_56_
Definition: CTPPSDiamondDQMSource.cc:166
CTPPSDiamondDQMSource::planePlots_
std::unordered_map< unsigned int, PlanePlots > planePlots_
Definition: CTPPSDiamondDQMSource.cc:183
CTPPSDiamondDQMSource::horizontalShiftOfDiamond_
double horizontalShiftOfDiamond_
Definition: CTPPSDiamondDQMSource.cc:111
CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_PLANES
static const int CTPPS_DIAMOND_NUM_OF_PLANES
Definition: CTPPSDiamondDQMSource.cc:94
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
CTPPSDiamondDQMSource::CHANNEL_OF_VFAT_CLOCK
static const int CHANNEL_OF_VFAT_CLOCK
Definition: CTPPSDiamondDQMSource.cc:84
CTPPSDiamondDQMSource::ctppsGeometryEventToken_
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > ctppsGeometryEventToken_
Definition: CTPPSDiamondDQMSource.cc:107
CTPPSDiamondDQMSource::centralOOT_
int centralOOT_
Definition: CTPPSDiamondDQMSource.cc:113
CTPPSDiamondDQMSource::CTPPS_PIXEL_STATION_ID
static const int CTPPS_PIXEL_STATION_ID
Definition: CTPPSDiamondDQMSource.cc:91
CTPPSDiamondDetId
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
Definition: CTPPSDiamondDetId.h:24
CTPPSDiamondDQMSource::INV_DISPLAY_RESOLUTION_FOR_HITS_MM
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM
Definition: CTPPSDiamondDQMSource.cc:86
CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING
static constexpr int TIMESLICE_WITHOUT_LEADING
Definition: CTPPSDiamondRecHit.h:44
CTPPSDiamondDQMSource::globalPlot_
GlobalPlots globalPlot_
Definition: CTPPSDiamondDQMSource.cc:122
edm::LogProblem
Definition: MessageLogger.h:387
TrackInfoProducer_cfi.rechits
rechits
Definition: TrackInfoProducer_cfi.py:9
CTPPSDiamondDQMSource::CTPPS_NUM_OF_ARMS
static const int CTPPS_NUM_OF_ARMS
Definition: CTPPSDiamondDQMSource.cc:88
CTPPSDiamondDQMSource::CTPPS_FED_ID_56
static const int CTPPS_FED_ID_56
Definition: CTPPSDiamondDQMSource.cc:97
DetGeomDesc
Geometrical description of a sensor.
Definition: DetGeomDesc.h:34
CTPPSDiamondDQMSource::CTPPS_DIAMOND_STATION_ID
static const int CTPPS_DIAMOND_STATION_ID
Definition: CTPPSDiamondDQMSource.cc:89
HPTDCErrorFlags::errorId
bool errorId(unsigned short id) const
Definition: HPTDCErrorFlags.h:19
channelAlignedWithTrack
bool channelAlignedWithTrack(const CTPPSGeometry *geom, const CTPPSDiamondDetId &detid, const CTPPSDiamondLocalTrack &localTrack, const float tolerance=1)
Definition: CTPPSDiamondDQMSource.cc:45
edm::contains
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:37
CTPPSPixelDetId
Definition: CTPPSPixelDetId.h:16
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:113
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::eventsetup::heterocontainer::insert
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
CTPPSDiamondDQMSource::SEC_PER_LUMI_SECTION
static const double SEC_PER_LUMI_SECTION
Definition: CTPPSDiamondDQMSource.cc:83
DetGeomDesc::params
std::vector< double > params() const
Definition: DetGeomDesc.h:66
CTPPSDiamondDQMSource::verbosity_
unsigned int verbosity_
Definition: CTPPSDiamondDQMSource.cc:114
DetGeomDesc::translation
Translation translation() const
Definition: DetGeomDesc.h:64
dqmMemoryStats.total
total
Definition: dqmMemoryStats.py:152
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
ztail.d
d
Definition: ztail.py:151
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:126
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
edm::EventID
Definition: EventID.h:31
CTPPSDiamondDQMSource::CTPPS_DIAMOND_RP_ID
static const int CTPPS_DIAMOND_RP_ID
Definition: CTPPSDiamondDQMSource.cc:90
edm::EventRange
Definition: EventRange.h:31
CTPPSDiamondDQMSource::tokenStatus_
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus_
Definition: CTPPSDiamondDQMSource.cc:99
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
BeamSpotProblemMonitor_cff.pixelTracks
pixelTracks
Definition: BeamSpotProblemMonitor_cff.py:7
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
CTPPSDiamondDQMSource::horizontalShiftBwDiamondPixels_
double horizontalShiftBwDiamondPixels_
Definition: CTPPSDiamondDQMSource.cc:110
CTPPSDiamondDQMSource::runParameters_
std::vector< std::pair< edm::EventRange, int > > runParameters_
Definition: CTPPSDiamondDQMSource.cc:112