CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes
PPSAssociationCutsESSource Class Reference
Inheritance diagram for PPSAssociationCutsESSource:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Member Functions

 PPSAssociationCutsESSource (const edm::ParameterSet &)
 
std::shared_ptr< PPSAssociationCutsproduce (const PPSAssociationCutsRcd &)
 
 ~PPSAssociationCutsESSource () override=default
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Static Private Member Functions

static edm::ParameterSetDescription getIOVDefaultParameters ()
 

Private Attributes

unsigned int currentAssociationCutIdx_
 
bool currentAssociationCutValid_
 
std::vector< std::shared_ptr< PPSAssociationCuts > > ppsAssociationCuts_
 
std::vector< edm::EventRangevalidityRanges_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 

Detailed Description

Definition at line 25 of file PPSAssociationCutsESSource.cc.

Constructor & Destructor Documentation

◆ PPSAssociationCutsESSource()

PPSAssociationCutsESSource::PPSAssociationCutsESSource ( const edm::ParameterSet iConfig)

Definition at line 50 of file PPSAssociationCutsESSource.cc.

References edm::ParameterSet::getParameter(), and writeEcalDQMStatus::interval.

50  {
51  for (const auto &interval : iConfig.getParameter<std::vector<edm::ParameterSet>>("configuration")) {
52  ppsAssociationCuts_.push_back(make_shared<PPSAssociationCuts>(interval));
53  validityRanges_.push_back(interval.getParameter<edm::EventRange>("validityRange"));
54  }
55 
56  setWhatProduced(this);
57  findingRecord<PPSAssociationCutsRcd>();
58 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< std::shared_ptr< PPSAssociationCuts > > ppsAssociationCuts_
std::vector< edm::EventRange > validityRanges_

◆ ~PPSAssociationCutsESSource()

PPSAssociationCutsESSource::~PPSAssociationCutsESSource ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 103 of file PPSAssociationCutsESSource.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, getIOVDefaultParameters(), and AlCaHLTBitMon_QueryRunRegistry::string.

103  {
105  desc.add<std::string>("ppsAssociationCutsLabel", "");
106 
108 
109  std::vector<edm::ParameterSet> vDefaults;
110  desc.addVPSet("configuration", validator, vDefaults);
111 
112  descriptions.add("ppsAssociationCutsESSource", desc);
113 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static edm::ParameterSetDescription getIOVDefaultParameters()

◆ getIOVDefaultParameters()

edm::ParameterSetDescription PPSAssociationCutsESSource::getIOVDefaultParameters ( )
staticprivate

Definition at line 115 of file PPSAssociationCutsESSource.cc.

References submitPVResolutionJobs::desc, PPSAssociationCuts::getDefaultParameters(), nano_mu_digi_cff::sector, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fillDescriptions().

115  {
117  desc.add<edm::EventRange>("validityRange", edm::EventRange())->setComment("interval of validity");
118 
119  for (auto &sector : {"45", "56"}) {
120  desc.add<edm::ParameterSetDescription>("association_cuts_" + std::string(sector),
122  ->setComment("track-association cuts for sector " + std::string(sector));
123  }
124 
125  return desc;
126 }
static edm::ParameterSetDescription getDefaultParameters()

◆ produce()

std::shared_ptr< PPSAssociationCuts > PPSAssociationCutsESSource::produce ( const PPSAssociationCutsRcd )

Definition at line 90 of file PPSAssociationCutsESSource.cc.

References convertSQLitetoXML_cfg::output.

90  {
91  auto output = std::make_shared<PPSAssociationCuts>();
92 
94  const auto &associationCut = ppsAssociationCuts_[currentAssociationCutIdx_];
95  output = associationCut;
96  }
97 
98  return output;
99 }
std::vector< std::shared_ptr< PPSAssociationCuts > > ppsAssociationCuts_
Definition: output.py:1

◆ setIntervalFor()

void PPSAssociationCutsESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey key,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
)
overrideprotectedvirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 62 of file PPSAssociationCutsESSource.cc.

References edm::contains(), edm::EventID::event(), edm::IOVSyncValue::eventID(), heavyIonCSV_trainingSettings::idx, submitPVResolutionJobs::key, edm::EventID::luminosityBlock(), edm::EventID::run(), and command_line::start.

64  {
65  for (unsigned int idx = 0; idx < ppsAssociationCuts_.size(); ++idx) {
66  // is within an entry ?
67  if (edm::contains(validityRanges_[idx], iosv.eventID())) {
70  oValidity = edm::ValidityInterval(edm::IOVSyncValue(validityRanges_[idx].startEventID()),
71  edm::IOVSyncValue(validityRanges_[idx].endEventID()));
72  return;
73  }
74  }
75 
78 
79  edm::LogInfo("PPSAssociationCutsESSource")
80  << ">> PPSAssociationCutsESSource::setIntervalFor(" << key.name() << ")\n"
81  << " run=" << iosv.eventID().run() << ", event=" << iosv.eventID().event();
82 
83  const edm::EventID start(iosv.eventID().run(), iosv.eventID().luminosityBlock(), iosv.eventID().event());
84  const edm::EventID end(iosv.eventID().run(), iosv.eventID().luminosityBlock(), iosv.eventID().event());
86 }
Definition: start.py:1
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:37
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
std::vector< std::shared_ptr< PPSAssociationCuts > > ppsAssociationCuts_
key
prepare the HTCondor submission files and eventually submit them
Log< level::Info, false > LogInfo
RunNumber_t run() const
Definition: EventID.h:38
const EventID & eventID() const
Definition: IOVSyncValue.h:40
std::vector< edm::EventRange > validityRanges_
EventNumber_t event() const
Definition: EventID.h:40

Member Data Documentation

◆ currentAssociationCutIdx_

unsigned int PPSAssociationCutsESSource::currentAssociationCutIdx_
private

Definition at line 43 of file PPSAssociationCutsESSource.cc.

◆ currentAssociationCutValid_

bool PPSAssociationCutsESSource::currentAssociationCutValid_
private

Definition at line 42 of file PPSAssociationCutsESSource.cc.

◆ ppsAssociationCuts_

std::vector<std::shared_ptr<PPSAssociationCuts> > PPSAssociationCutsESSource::ppsAssociationCuts_
private

Definition at line 44 of file PPSAssociationCutsESSource.cc.

◆ validityRanges_

std::vector<edm::EventRange> PPSAssociationCutsESSource::validityRanges_
private

Definition at line 45 of file PPSAssociationCutsESSource.cc.