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) final
 
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
 
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 () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
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)
 
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
 
void dqmEndRun (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 analyze (edm::Event const &, edm::EventSetup const &)
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 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 66 of file CTPPSDiamondDQMSource.cc.

Constructor & Destructor Documentation

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

Definition at line 472 of file CTPPSDiamondDQMSource.cc.

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

481  tokenFEDInfo_(consumes<std::vector<TotemFEDInfo>>(ps.getParameter<edm::InputTag>("tagFEDInfo"))),
482  excludeMultipleHits_(ps.getParameter<bool>("excludeMultipleHits")),
483  centralOOT_(-999),
484  verbosity_(ps.getUntrackedParameter<unsigned int>("verbosity", 0)),
485  EC_difference_56_(-500),
486  EC_difference_45_(-500) {
487  for (const auto& pset : ps.getParameter<std::vector<edm::ParameterSet>>("offsetsOOT")) {
488  runParameters_.emplace_back(
489  std::make_pair(pset.getParameter<edm::EventRange>("validityRange"), pset.getParameter<int>("centralOOT")));
490  }
491 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHit_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > tokenDiamondTrack_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelTrack_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< std::pair< edm::EventRange, int > > runParameters_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > tokenDigi_
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus_
CTPPSDiamondDQMSource::~CTPPSDiamondDQMSource ( )
override

Definition at line 495 of file CTPPSDiamondDQMSource.cc.

495 {}

Member Function Documentation

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

Definition at line 560 of file CTPPSDiamondDQMSource.cc.

References funct::abs(), edm::EventBase::bunchCrossing(), centralOOT_, CHANNEL_OF_VFAT_CLOCK, channelAlignedWithTrack(), channelPlots_, CTPPS_DIAMOND_RP_ID, CTPPS_DIAMOND_STATION_ID, CTPPS_FAR_RP_ID, CTPPS_FED_ID_45, CTPPS_FED_ID_56, CTPPS_PIXEL_STATION_ID, TauDecayModes::dec, EC_difference_45_, EC_difference_56_, HPTDCErrorFlags::errorId(), excludeMultipleHits_, HcalObjRepresent::Fill(), edm::EventSetup::get(), edm::Event::getLuminosityBlock(), horizontalShiftBwDiamondPixels_, horizontalShiftOfDiamond_, HPTDC_BIN_WIDTH_NS, mps_fire::i, edm::LuminosityBlock::index(), edm::eventsetup::heterocontainer::insert(), INV_DISPLAY_RESOLUTION_FOR_HITS_MM, edm::HandleBase::isValid(), BeamSpotProblemMonitor_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_, HLT_2018_cff::track, PDWG_EXOHSCP_cff::tracks, validateGeometry_cfg::valid, and verbosity_.

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

Definition at line 526 of file CTPPSDiamondDQMSource.cc.

References dqm::dqmstoreimpl::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 dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder().

526  {
527  ibooker.cd();
528  ibooker.setCurrentFolder("CTPPS");
529 
530  globalPlot_ = GlobalPlots(ibooker);
531 
532  for (unsigned short arm = 0; arm < CTPPS_NUM_OF_ARMS; ++arm) {
534  potPlots_[rpId] = PotPlots(ibooker, rpId);
535  for (unsigned short pl = 0; pl < CTPPS_DIAMOND_NUM_OF_PLANES; ++pl) {
537  planePlots_[plId] = PlanePlots(ibooker, plId);
538  for (unsigned short ch = 0; ch < CTPPS_DIAMOND_NUM_OF_CHANNELS; ++ch) {
540  channelPlots_[chId] = ChannelPlots(ibooker, chId);
541  }
542  }
543  }
544 }
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_
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 499 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(), horizontalShiftBwDiamondPixels_, horizontalShiftOfDiamond_, DetGeomDesc::params(), edm::ESHandle< T >::product(), edm::RunBase::run(), runParameters_, CTPPSGeometry::sensor(), and DetGeomDesc::translation().

499  {
500  centralOOT_ = -999;
501  for (const auto& oot : runParameters_) {
502  if (edm::contains(oot.first, edm::EventID(iRun.run(), 0, 1))) {
503  centralOOT_ = oot.second;
504  break;
505  }
506  }
507 
508  // Get detector shifts from the geometry
510  iSetup.get<VeryForwardRealGeometryRecord>().get(geometry_);
511  const CTPPSGeometry* geom = geometry_.product();
513  const DetGeomDesc* det = geom->sensor(detid);
514  horizontalShiftOfDiamond_ = det->translation().x() - det->params().at(0);
515 
516  // Rough alignement of pixel detector for diamond thomography
518  if (iRun.run() > 300000) { //Pixel installed
519  det = geom->sensor(pixid);
521  }
522 }
Translation translation() const
Definition: DetGeomDesc.h:65
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:37
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
std::vector< std::pair< edm::EventRange, int > > runParameters_
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:33
const DetGeomDesc * sensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
static const int CTPPS_FAR_RP_ID
T get() const
Definition: EventSetup.h:73
std::vector< double > params() const
Definition: DetGeomDesc.h:67
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::dqmEndRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 1197 of file CTPPSDiamondDQMSource.cc.

References DEFINE_FWK_MODULE.

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

Definition at line 548 of file CTPPSDiamondDQMSource.cc.

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

549  {
550  auto d = std::make_shared<dds::Cache>();
551  d->hitDistribution2dMap.reserve(potPlots_.size());
552  for (auto& plot : potPlots_)
553  d->hitDistribution2dMap[plot.first] =
554  std::unique_ptr<TH2F>(static_cast<TH2F*>(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
555  return d;
556 }
d
Definition: ztail.py:151
std::unordered_map< unsigned int, PotPlots > potPlots_
void CTPPSDiamondDQMSource::globalEndLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup  
)
overrideprotected

Definition at line 1126 of file CTPPSDiamondDQMSource.cc.

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

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

Member Data Documentation

int CTPPSDiamondDQMSource::centralOOT_
private

Definition at line 109 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const int CTPPSDiamondDQMSource::CHANNEL_OF_VFAT_CLOCK = 30
staticprivate

Definition at line 83 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 200 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_CHANNELS = 12
staticprivate

Definition at line 94 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_PLANES = 4
staticprivate

Definition at line 93 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_RP_ID = 6
staticprivate

Definition at line 89 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_STATION_ID = 1
staticprivate

Definition at line 88 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_FAR_RP_ID = 3
staticprivate

Definition at line 92 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_45 = 583
staticprivate

Definition at line 95 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_56 = 582
staticprivate

Definition at line 96 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_NEAR_RP_ID = 2
staticprivate

Definition at line 91 of file CTPPSDiamondDQMSource.cc.

const int CTPPSDiamondDQMSource::CTPPS_NUM_OF_ARMS = 2
staticprivate

Definition at line 87 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_PIXEL_STATION_ID = 2
staticprivate

Definition at line 90 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const double CTPPSDiamondDQMSource::DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
staticprivate

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

Referenced by analyze().

GlobalPlots CTPPSDiamondDQMSource::globalPlot_
private

Definition at line 118 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

double CTPPSDiamondDQMSource::horizontalShiftBwDiamondPixels_
private

Definition at line 106 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

double CTPPSDiamondDQMSource::horizontalShiftOfDiamond_
private

Definition at line 107 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

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

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

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

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

Definition at line 108 of file CTPPSDiamondDQMSource.cc.

Referenced by CTPPSDiamondDQMSource(), and dqmBeginRun().

const double CTPPSDiamondDQMSource::SEC_PER_LUMI_SECTION = 23.31
staticprivate

Definition at line 82 of file CTPPSDiamondDQMSource.cc.

Referenced by globalEndLuminosityBlock().

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

Definition at line 101 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 102 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 100 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 103 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 99 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 98 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

unsigned int CTPPSDiamondDQMSource::verbosity_
private

Definition at line 110 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().