CMS 3D CMS Logo

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< HGCalTriggerNtupleBasentuple_ptr
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
 HGCalTriggerNtupleManager (const edm::ParameterSet &conf)
 
 ~HGCalTriggerNtupleManager ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::Service< TFileServicefile_service_
 
std::vector< ntuple_ptrhgc_ntuples_
 
TTree * tree_
 

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 &)
 
- 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 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)
 

Detailed Description

Definition at line 11 of file HGCalTriggerNtupleManager.cc.

Member Typedef Documentation

Definition at line 14 of file HGCalTriggerNtupleManager.cc.

Constructor & Destructor Documentation

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

Definition at line 33 of file HGCalTriggerNtupleManager.cc.

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

34 {
35  tree_ = file_service_->make<TTree>("HGCalTriggerNtuple","HGCalTriggerNtuple");
36  const std::vector<edm::ParameterSet> ntuple_cfgs = conf.getParameterSetVector("Ntuples");
37  for(const auto& ntuple_cfg : ntuple_cfgs)
38  {
39  const std::string& ntuple_name = ntuple_cfg.getParameter<std::string>("NtupleName");
40  hgc_ntuples_.emplace_back( HGCalTriggerNtupleFactory::get()->create(ntuple_name, ntuple_cfg) );
41  hgc_ntuples_.back()->initialize(*tree_, ntuple_cfg , consumesCollector());
42  }
43 }
VParameterSet const & getParameterSetVector(std::string const &name) const
def create(alignables, pedeDump, additionalData, outputFile, config)
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::Service< TFileService > file_service_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
T get(const Candidate &c)
Definition: component.h:55
std::vector< ntuple_ptr > hgc_ntuples_
HGCalTriggerNtupleManager::~HGCalTriggerNtupleManager ( )
inline

Definition at line 18 of file HGCalTriggerNtupleManager.cc.

18 {};

Member Function Documentation

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

Definition at line 48 of file HGCalTriggerNtupleManager.cc.

References hgc_ntuples_, and tree_.

Referenced by beginRun(), and HGCalTriggerNtupleManager().

49 {
50  for(auto& hgc_ntuple : hgc_ntuples_)
51  {
52  hgc_ntuple->fill(e,es);
53  }
54  tree_->Fill();
55 }
std::vector< ntuple_ptr > hgc_ntuples_
virtual void HGCalTriggerNtupleManager::beginRun ( const edm::Run ,
const edm::EventSetup  
)
inlinevirtual

Definition at line 19 of file HGCalTriggerNtupleManager.cc.

References analyze().

19 {};

Member Data Documentation

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

Definition at line 23 of file HGCalTriggerNtupleManager.cc.

Referenced by HGCalTriggerNtupleManager().

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

Definition at line 24 of file HGCalTriggerNtupleManager.cc.

Referenced by analyze(), and HGCalTriggerNtupleManager().

TTree* HGCalTriggerNtupleManager::tree_
private

Definition at line 25 of file HGCalTriggerNtupleManager.cc.

Referenced by analyze(), and HGCalTriggerNtupleManager().