CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Attributes
HGCalTriggerNtupleManager Class Reference
Inheritance diagram for HGCalTriggerNtupleManager:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

typedef std::unique_ptr
< HGCalTriggerNtupleBase
ntuple_ptr
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 HGCalTriggerNtupleManager (const edm::ParameterSet &conf)
 
 ~HGCalTriggerNtupleManager () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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)
 

Private Attributes

edm::Service< TFileServicefile_service_
 
std::vector< ntuple_ptrhgc_ntuples_
 
edm::ESGetToken< MagneticField,
IdealMagneticFieldRecord
magfieldToken_
 
HGCalTriggerNtupleEventSetup ntuple_es_
 
edm::ESGetToken
< HepPDT::ParticleDataTable,
PDTRecord
pdtToken_
 
TTree * tree_
 
edm::ESGetToken
< HGCalTriggerGeometryBase,
CaloGeometryRecord
triggerGeomToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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)
 

Detailed Description

Definition at line 17 of file HGCalTriggerNtupleManager.cc.

Member Typedef Documentation

Definition at line 19 of file HGCalTriggerNtupleManager.cc.

Constructor & Destructor Documentation

HGCalTriggerNtupleManager::HGCalTriggerNtupleManager ( const edm::ParameterSet conf)
explicit

Definition at line 40 of file HGCalTriggerNtupleManager.cc.

References edm::EDConsumerBase::consumesCollector(), beamerCreator::create(), file_service_, get, edm::ParameterSet::getParameterSetVector(), hgc_ntuples_, TFileService::make(), AlCaHLTBitMon_QueryRunRegistry::string, and tree_.

41  : pdtToken_(esConsumes<HepPDT::ParticleDataTable, PDTRecord, edm::Transition::BeginRun>()),
42  magfieldToken_(esConsumes<MagneticField, IdealMagneticFieldRecord, edm::Transition::BeginRun>()),
43  triggerGeomToken_(esConsumes<HGCalTriggerGeometryBase, CaloGeometryRecord, edm::Transition::BeginRun>()) {
44  tree_ = file_service_->make<TTree>("HGCalTriggerNtuple", "HGCalTriggerNtuple");
45  const std::vector<edm::ParameterSet>& ntuple_cfgs = conf.getParameterSetVector("Ntuples");
46  for (const auto& ntuple_cfg : ntuple_cfgs) {
47  const std::string& ntuple_name = ntuple_cfg.getParameter<std::string>("NtupleName");
48  hgc_ntuples_.emplace_back(HGCalTriggerNtupleFactory::get()->create(ntuple_name, ntuple_cfg));
49  hgc_ntuples_.back()->initialize(*tree_, ntuple_cfg, consumesCollector());
50  }
51 }
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
VParameterSet const & getParameterSetVector(std::string const &name) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::Service< TFileService > file_service_
edm::ESGetToken< HepPDT::ParticleDataTable, PDTRecord > pdtToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
#define get
std::vector< ntuple_ptr > hgc_ntuples_
HGCalTriggerNtupleManager::~HGCalTriggerNtupleManager ( )
inlineoverride

Definition at line 23 of file HGCalTriggerNtupleManager.cc.

23 {};

Member Function Documentation

void HGCalTriggerNtupleManager::analyze ( const edm::Event e,
const edm::EventSetup es 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 59 of file HGCalTriggerNtupleManager.cc.

References hgc_ntuples_, ntuple_es_, and tree_.

59  {
60  for (auto& hgc_ntuple : hgc_ntuples_) {
61  if (hgc_ntuple->accessEventSetup()) {
62  hgc_ntuple->fill(e, es);
63  } else {
64  hgc_ntuple->fill(e, ntuple_es_);
65  }
66  }
67 
68  tree_->Fill();
69 }
HGCalTriggerNtupleEventSetup ntuple_es_
std::vector< ntuple_ptr > hgc_ntuples_
void HGCalTriggerNtupleManager::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 53 of file HGCalTriggerNtupleManager.cc.

References HGCalTriggerNtupleEventSetup::geometry, edm::EventSetup::getHandle(), HGCalTriggerNtupleEventSetup::magfield, magfieldToken_, ntuple_es_, HGCalTriggerNtupleEventSetup::pdt, pdtToken_, and triggerGeomToken_.

53  {
57 }
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
HGCalTriggerNtupleEventSetup ntuple_es_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
edm::ESHandle< MagneticField > magfield
edm::ESHandle< HGCalTriggerGeometryBase > geometry
edm::ESGetToken< HepPDT::ParticleDataTable, PDTRecord > pdtToken_
edm::ESHandle< HepPDT::ParticleDataTable > pdt
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151

Member Data Documentation

edm::Service<TFileService> HGCalTriggerNtupleManager::file_service_
private

Definition at line 28 of file HGCalTriggerNtupleManager.cc.

Referenced by HGCalTriggerNtupleManager().

std::vector<ntuple_ptr> HGCalTriggerNtupleManager::hgc_ntuples_
private

Definition at line 29 of file HGCalTriggerNtupleManager.cc.

Referenced by analyze(), and HGCalTriggerNtupleManager().

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> HGCalTriggerNtupleManager::magfieldToken_
private

Definition at line 34 of file HGCalTriggerNtupleManager.cc.

Referenced by beginRun().

HGCalTriggerNtupleEventSetup HGCalTriggerNtupleManager::ntuple_es_
private

Definition at line 32 of file HGCalTriggerNtupleManager.cc.

Referenced by analyze(), and beginRun().

edm::ESGetToken<HepPDT::ParticleDataTable, PDTRecord> HGCalTriggerNtupleManager::pdtToken_
private

Definition at line 33 of file HGCalTriggerNtupleManager.cc.

Referenced by beginRun().

TTree* HGCalTriggerNtupleManager::tree_
private

Definition at line 30 of file HGCalTriggerNtupleManager.cc.

Referenced by analyze(), and HGCalTriggerNtupleManager().

edm::ESGetToken<HGCalTriggerGeometryBase, CaloGeometryRecord> HGCalTriggerNtupleManager::triggerGeomToken_
private

Definition at line 35 of file HGCalTriggerNtupleManager.cc.

Referenced by beginRun().