CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
L1EventTreeProducer Class Reference

#include <L1TriggerDPG/L1Ntuples/src/L1EventTreeProducer.cc>

Inheritance diagram for L1EventTreeProducer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1EventTreeProducer (const edm::ParameterSet &)
 
 ~L1EventTreeProducer () 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
 
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::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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Public Attributes

L1Analysis::L1AnalysisEventl1Event
 
L1Analysis::L1AnalysisEventDataFormatl1EventData
 

Private Member Functions

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

Private Attributes

edm::Service< TFileServicefs_
 
edm::EDGetTokenT< edm::TriggerResultshltSource_
 
TTree * tree_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Description: Produce L1 Extra tree

Implementation:

Definition at line 49 of file L1EventTreeProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 76 of file L1EventTreeProducer.cc.

References edm::EDConsumerBase::consumesCollector(), fs_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltSource_, l1Event, l1EventData, TFileService::make(), l1EventTree_cfi::maxAllowedWeight, l1EventTree_cfi::puDataFile, l1EventTree_cfi::puDataHist, l1EventTree_cfi::puMCFile, l1EventTree_cfi::puMCHist, AlCaHLTBitMon_QueryRunRegistry::string, tree_, and l1EventTree_cfi::useAvgVtx.

76  {
77  hltSource_ = consumes<edm::TriggerResults>(iConfig.getParameter<edm::InputTag>("hltSource"));
78 
79  std::string puMCFile = iConfig.getUntrackedParameter<std::string>("puMCFile", "");
80  std::string puMCHist = iConfig.getUntrackedParameter<std::string>("puMCHist", "pileup");
81  std::string puDataFile = iConfig.getUntrackedParameter<std::string>("puDataFile", "");
82  std::string puDataHist = iConfig.getUntrackedParameter<std::string>("puDataHist", "pileup");
83 
84  bool useAvgVtx = iConfig.getUntrackedParameter<bool>("useAvgVtx", true);
85  double maxAllowedWeight = iConfig.getUntrackedParameter<double>("maxAllowedWeight", -1);
86 
90 
91  // set up output
92  tree_ = fs_->make<TTree>("L1EventTree", "L1EventTree");
93  tree_->Branch("Event", "L1Analysis::L1AnalysisEventDataFormat", &l1EventData, 32000, 3);
94 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::TriggerResults > hltSource_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
L1AnalysisEventDataFormat * getData()
edm::Service< TFileService > fs_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
L1Analysis::L1AnalysisEvent * l1Event
L1Analysis::L1AnalysisEventDataFormat * l1EventData
L1EventTreeProducer::~L1EventTreeProducer ( )
override

Definition at line 96 of file L1EventTreeProducer.cc.

References l1Event.

96  {
97  // do anything here that needs to be done at desctruction time
98  // (e.g. close files, deallocate resources etc.)
99  delete l1Event;
100 }
L1Analysis::L1AnalysisEvent * l1Event

Member Function Documentation

void L1EventTreeProducer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 107 of file L1EventTreeProducer.cc.

References hltSource_, edm::EDGetTokenT< T >::isUninitialized(), l1Event, L1Analysis::L1AnalysisEvent::Reset(), L1Analysis::L1AnalysisEvent::Set(), and tree_.

107  {
108  if (!hltSource_.isUninitialized()) {
109  l1Event->Reset();
110  l1Event->Set(iEvent, hltSource_);
111  }
112  tree_->Fill();
113 }
edm::EDGetTokenT< edm::TriggerResults > hltSource_
L1Analysis::L1AnalysisEvent * l1Event
void Set(const edm::Event &e, const edm::EDGetTokenT< edm::TriggerResults > &hlt_)
bool isUninitialized() const
Definition: EDGetToken.h:70
void L1EventTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 116 of file L1EventTreeProducer.cc.

116 {}
void L1EventTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 119 of file L1EventTreeProducer.cc.

References DEFINE_FWK_MODULE.

119 {}

Member Data Documentation

edm::Service<TFileService> L1EventTreeProducer::fs_
private

Definition at line 65 of file L1EventTreeProducer.cc.

Referenced by L1EventTreeProducer().

edm::EDGetTokenT<edm::TriggerResults> L1EventTreeProducer::hltSource_
private

Definition at line 70 of file L1EventTreeProducer.cc.

Referenced by analyze(), and L1EventTreeProducer().

L1Analysis::L1AnalysisEvent* L1EventTreeProducer::l1Event

Definition at line 60 of file L1EventTreeProducer.cc.

Referenced by analyze(), L1EventTreeProducer(), and ~L1EventTreeProducer().

L1Analysis::L1AnalysisEventDataFormat* L1EventTreeProducer::l1EventData

Definition at line 61 of file L1EventTreeProducer.cc.

Referenced by L1EventTreeProducer().

TTree* L1EventTreeProducer::tree_
private

Definition at line 68 of file L1EventTreeProducer.cc.

Referenced by analyze(), and L1EventTreeProducer().