CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PPSTimingCalibrationPCLWorker Class Reference
Inheritance diagram for PPSTimingCalibrationPCLWorker:
DQMGlobalEDAnalyzer< TimingCalibrationHistograms > DQMGlobalEDAnalyzerBase< TimingCalibrationHistograms, Args... > edm::global::EDProducer< edm::RunCache< TimingCalibrationHistograms >, edm::EndRunProducer, edm::Accumulator, Args... > edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void dqmAnalyze (const edm::Event &, const edm::EventSetup &, const TimingCalibrationHistograms &) const override
 
 PPSTimingCalibrationPCLWorker (const edm::ParameterSet &)
 
- Public Member Functions inherited from DQMGlobalEDAnalyzer< TimingCalibrationHistograms >
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &, TimingCalibrationHistograms const &) const
 
void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup) const final
 
- Public Member Functions inherited from DQMGlobalEDAnalyzerBase< TimingCalibrationHistograms, Args... >
void accumulate (edm::StreamID id, edm::Event const &event, edm::EventSetup const &setup) const final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &, TimingCalibrationHistograms &) const
 
 DQMGlobalEDAnalyzerBase ()
 
std::shared_ptr< TimingCalibrationHistogramsglobalBeginRun (edm::Run const &run, edm::EventSetup const &setup) const final
 
void globalEndRun (edm::Run const &, edm::EventSetup const &) const final
 
- Public Member Functions inherited from edm::global::EDProducer< edm::RunCache< TimingCalibrationHistograms >, edm::EndRunProducer, edm::Accumulator, Args... >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void bookHistograms (DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &, TimingCalibrationHistograms &) const override
 
template<typename T >
bool searchForProduct (edm::Event const &iEvent, const std::vector< edm::EDGetTokenT< T >> &tokens, const std::vector< edm::InputTag > &tags, edm::Handle< T > &handle) const
 

Private Attributes

std::vector< edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > > diamondRecHitTokens_
 
const std::string dqmDir_
 
const edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecordgeomEsToken_
 
const std::vector< edm::InputTagRecHitTags_
 

Additional Inherited Members

- Public Types inherited from DQMGlobalEDAnalyzerBase< TimingCalibrationHistograms, Args... >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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
 
- Protected Member Functions inherited from DQMGlobalEDAnalyzerBase< TimingCalibrationHistograms, Args... >
uint64_t meId (edm::Run const &run) const
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMGlobalEDAnalyzerBase< TimingCalibrationHistograms, Args... >
DQMStoredqmstore_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 30 of file PPSTimingCalibrationPCLWorker.cc.

Constructor & Destructor Documentation

◆ PPSTimingCalibrationPCLWorker()

PPSTimingCalibrationPCLWorker::PPSTimingCalibrationPCLWorker ( const edm::ParameterSet iConfig)
explicit

Definition at line 59 of file PPSTimingCalibrationPCLWorker.cc.

References edm::EDConsumerBase::consumes(), diamondRecHitTokens_, RecHitTags_, and makeGlobalPositionRcd_cfg::tag.

60  : RecHitTags_(iConfig.getParameter<std::vector<edm::InputTag>>("diamondRecHitTags")),
61  geomEsToken_(esConsumes<edm::Transition::BeginRun>()),
62  dqmDir_(iConfig.getParameter<std::string>("dqmDir")) {
63  for (auto& tag : RecHitTags_)
65 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > > diamondRecHitTokens_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geomEsToken_
const std::vector< edm::InputTag > RecHitTags_

Member Function Documentation

◆ bookHistograms()

void PPSTimingCalibrationPCLWorker::bookHistograms ( DQMStore::IBooker iBooker,
const edm::Run iRun,
const edm::EventSetup iSetup,
TimingCalibrationHistograms iHists 
) const
overrideprivatevirtual

Implements DQMGlobalEDAnalyzerBase< TimingCalibrationHistograms, Args... >.

Definition at line 69 of file PPSTimingCalibrationPCLWorker.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), CTPPSDiamondDetId::channelName(), CTPPSDiamondDetId::check(), dqmDir_, relativeConstraints::geom, geomEsToken_, edm::EventSetup::getData(), TimingCalibrationHistograms::leadingTime, TimingCalibrationHistograms::leadingTimeVsToT, DetId::rawId(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and TimingCalibrationHistograms::toT.

72  {
73  iBooker.cd();
74  iBooker.setCurrentFolder(dqmDir_);
75  std::string ch_name;
76 
77  const auto& geom = iSetup.getData(geomEsToken_);
78  for (auto it = geom.beginSensor(); it != geom.endSensor(); ++it) {
79  if (!CTPPSDiamondDetId::check(it->first))
80  continue;
81  const CTPPSDiamondDetId detid(it->first);
82 
83  detid.channelName(ch_name);
84  iHists.leadingTime[detid.rawId()] = iBooker.book1D("t_" + ch_name, ch_name + ";t (ns);Entries", 1200, -60., 60.);
85  iHists.toT[detid.rawId()] = iBooker.book1D("tot_" + ch_name, ch_name + ";ToT (ns);Entries", 100, -20., 20.);
86  iHists.leadingTimeVsToT[detid.rawId()] =
87  iBooker.book2D("tvstot_" + ch_name, ch_name + ";ToT (ns);t (ns)", 240, 0., 60., 450, -20., 25.);
88  }
89 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
const edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geomEsToken_
static bool check(unsigned int raw)
returns true if the raw ID is a PPS-timing one
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ dqmAnalyze()

void PPSTimingCalibrationPCLWorker::dqmAnalyze ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const TimingCalibrationHistograms iHists 
) const
overridevirtual

Implements DQMGlobalEDAnalyzerBase< TimingCalibrationHistograms, Args... >.

Definition at line 93 of file PPSTimingCalibrationPCLWorker.cc.

References diamondRecHitTokens_, HcalObjRepresent::Fill(), iEvent, TimingCalibrationHistograms::leadingTime, TimingCalibrationHistograms::leadingTimeVsToT, RecHitTags_, searchForProduct(), and TimingCalibrationHistograms::toT.

95  {
97  // then extract the rechits information for later processing
99 
100  // ensure timing detectors rechits are found in the event content
101  if (dsv_rechits->empty()) {
102  edm::LogWarning("PPSTimingCalibrationPCLWorker:dqmAnalyze") << "No rechits retrieved from the event content.";
103  return;
104  }
105  for (const auto& ds_rechits : *dsv_rechits) {
106  const CTPPSDiamondDetId detid(ds_rechits.detId());
107  if (iHists.leadingTimeVsToT.count(detid.rawId()) == 0) {
108  edm::LogWarning("PPSTimingCalibrationPCLWorker:dqmAnalyze")
109  << "Pad with detId=" << detid << " is not set to be monitored.";
110  continue;
111  }
112  for (const auto& rechit : ds_rechits) {
113  // skip invalid rechits
114  if (rechit.time() == 0. || rechit.toT() < 0.)
115  continue;
116  iHists.leadingTime.at(detid.rawId())->Fill(rechit.time());
117  iHists.toT.at(detid.rawId())->Fill(rechit.toT());
118  iHists.leadingTimeVsToT.at(detid.rawId())->Fill(rechit.toT(), rechit.time());
119  }
120  }
121 }
bool searchForProduct(edm::Event const &iEvent, const std::vector< edm::EDGetTokenT< T >> &tokens, const std::vector< edm::InputTag > &tags, edm::Handle< T > &handle) const
std::vector< edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > > diamondRecHitTokens_
int iEvent
Definition: GenABIO.cc:224
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
const std::vector< edm::InputTag > RecHitTags_
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
Log< level::Warning, false > LogWarning

◆ fillDescriptions()

void PPSTimingCalibrationPCLWorker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 125 of file PPSTimingCalibrationPCLWorker.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

125  {
127  desc.add<std::vector<edm::InputTag>>("diamondRecHitTags", {edm::InputTag("ctppsDiamondRecHits")})
128  ->setComment("input tag for the PPS diamond detectors rechits");
129  desc.add<std::string>("dqmDir", "AlCaReco/PPSTimingCalibrationPCL")
130  ->setComment("output path for the various DQM plots");
131 
132  descriptions.addWithDefaultLabel(desc);
133 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ searchForProduct()

template<typename T >
bool PPSTimingCalibrationPCLWorker::searchForProduct ( edm::Event const &  iEvent,
const std::vector< edm::EDGetTokenT< T >> &  tokens,
const std::vector< edm::InputTag > &  tags,
edm::Handle< T > &  handle 
) const
private

Definition at line 136 of file PPSTimingCalibrationPCLWorker.cc.

References Exception, h, patZpeak::handle, mps_fire::i, iEvent, edm::errors::ProductNotFound, and triggerMatcherToHLTDebug_cfi::tags.

Referenced by dqmAnalyze().

139  {
140  bool foundProduct = false;
141  for (unsigned int i = 0; i < tokens.size(); i++)
142  if (auto h = iEvent.getHandle(tokens[i])) {
143  handle = h;
144  foundProduct = true;
145  edm::LogInfo("searchForProduct") << "Found a product with " << tags[i];
146  break;
147  }
148 
149  if (!foundProduct)
150  throw edm::Exception(edm::errors::ProductNotFound) << "Could not find a product with any of the selected labels.";
151 
152  return foundProduct;
153 }
int iEvent
Definition: GenABIO.cc:224
Log< level::Info, false > LogInfo
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

Member Data Documentation

◆ diamondRecHitTokens_

std::vector<edm::EDGetTokenT<edm::DetSetVector<CTPPSDiamondRecHit> > > PPSTimingCalibrationPCLWorker::diamondRecHitTokens_
private

Definition at line 51 of file PPSTimingCalibrationPCLWorker.cc.

Referenced by dqmAnalyze(), and PPSTimingCalibrationPCLWorker().

◆ dqmDir_

const std::string PPSTimingCalibrationPCLWorker::dqmDir_
private

Definition at line 54 of file PPSTimingCalibrationPCLWorker.cc.

Referenced by bookHistograms().

◆ geomEsToken_

const edm::ESGetToken<CTPPSGeometry, VeryForwardRealGeometryRecord> PPSTimingCalibrationPCLWorker::geomEsToken_
private

Definition at line 52 of file PPSTimingCalibrationPCLWorker.cc.

Referenced by bookHistograms().

◆ RecHitTags_

const std::vector<edm::InputTag> PPSTimingCalibrationPCLWorker::RecHitTags_
private

Definition at line 50 of file PPSTimingCalibrationPCLWorker.cc.

Referenced by dqmAnalyze(), and PPSTimingCalibrationPCLWorker().