CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
LHCInfoPerFillAnalyzer Class Reference
Inheritance diagram for LHCInfoPerFillAnalyzer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 LHCInfoPerFillAnalyzer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

edm::ESWatcher< LHCInfoPerFillRcdinfoPerFillWatcher_
 
edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcdtokenInfoPerFill_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 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)
 

Detailed Description

Definition at line 16 of file LHCInfoPerFillAnalyzer.cc.

Constructor & Destructor Documentation

◆ LHCInfoPerFillAnalyzer()

LHCInfoPerFillAnalyzer::LHCInfoPerFillAnalyzer ( const edm::ParameterSet )
inlineexplicit

Definition at line 18 of file LHCInfoPerFillAnalyzer.cc.

19  : tokenInfoPerFill_(esConsumes<LHCInfoPerFill, LHCInfoPerFillRcd>()) {}
edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > tokenInfoPerFill_

Member Function Documentation

◆ analyze()

void LHCInfoPerFillAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 31 of file LHCInfoPerFillAnalyzer.cc.

References funct::abs(), cms::cuda::assert(), edm::ESWatcher< T >::check(), EPS, edm::EventSetup::getData(), infoPerFillWatcher_, and tokenInfoPerFill_.

31  {
33 
34  LHCInfoPerFill lhcInfoPerFill = iSetup.getData(tokenInfoPerFill_);
35  const float EPS = 1E-4;
36  assert(lhcInfoPerFill.fillNumber() == 3);
37  assert(lhcInfoPerFill.bunchesInBeam1() == 10);
38  assert(lhcInfoPerFill.bunchesInBeam2() == 8);
39  assert(lhcInfoPerFill.collidingBunches() == 5);
40  assert(lhcInfoPerFill.targetBunches() == 4);
41  assert(lhcInfoPerFill.fillType() == lhcInfoPerFill.PROTONS);
42  assert(lhcInfoPerFill.particleTypeForBeam1() == lhcInfoPerFill.PROTON);
43  assert(lhcInfoPerFill.particleTypeForBeam2() == lhcInfoPerFill.PROTON);
44  assert(abs(lhcInfoPerFill.intensityForBeam1() - 1016.5) < EPS);
45  assert(abs(lhcInfoPerFill.intensityForBeam2() - 1096.66) < EPS);
46  assert(abs(lhcInfoPerFill.energy() - 7000) < EPS);
47  assert(abs(lhcInfoPerFill.delivLumi() - 2E-07) < EPS);
48  assert(abs(lhcInfoPerFill.recLumi() - 2E-07) < EPS);
49  assert(abs(lhcInfoPerFill.instLumi() - 0) < EPS);
50  assert(abs(lhcInfoPerFill.instLumiError() - 0) < EPS);
51  assert(lhcInfoPerFill.createTime() == 6561530930997627120);
52  assert(lhcInfoPerFill.beginTime() == 6561530930997627120);
53  assert(lhcInfoPerFill.endTime() == 6561530930997627120);
54  assert(lhcInfoPerFill.injectionScheme() == "None");
55  assert(lhcInfoPerFill.lumiPerBX().size() == 2);
56  assert(abs(lhcInfoPerFill.lumiPerBX()[0] - 0.000114139) < EPS);
57  assert(abs(lhcInfoPerFill.lumiPerBX()[1] - 0.000114139) < EPS);
58  assert(lhcInfoPerFill.lhcState() == "some lhcState");
59  assert(lhcInfoPerFill.lhcComment() == "some lhcComment");
60  assert(lhcInfoPerFill.ctppsStatus() == "some ctppsStatus");
61  edm::LogInfo("LHCInfoPerFillAnalyzer") << "LHCInfoPerFill retrieved:\n" << lhcInfoPerFill;
62 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
#define EPS
assert(be >=bs)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::ESGetToken< LHCInfoPerFill, LHCInfoPerFillRcd > tokenInfoPerFill_
Log< level::Info, false > LogInfo
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
edm::ESWatcher< LHCInfoPerFillRcd > infoPerFillWatcher_

◆ beginJob()

void LHCInfoPerFillAnalyzer::beginJob ( )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 22 of file LHCInfoPerFillAnalyzer.cc.

22 {}

◆ endJob()

void LHCInfoPerFillAnalyzer::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 24 of file LHCInfoPerFillAnalyzer.cc.

24 {}

Member Data Documentation

◆ infoPerFillWatcher_

edm::ESWatcher<LHCInfoPerFillRcd> LHCInfoPerFillAnalyzer::infoPerFillWatcher_
private

Definition at line 26 of file LHCInfoPerFillAnalyzer.cc.

Referenced by analyze().

◆ tokenInfoPerFill_

edm::ESGetToken<LHCInfoPerFill, LHCInfoPerFillRcd> LHCInfoPerFillAnalyzer::tokenInfoPerFill_
private

Definition at line 28 of file LHCInfoPerFillAnalyzer.cc.

Referenced by analyze().