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
 
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)
 
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 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 50 of file L1EventTreeProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 83 of file L1EventTreeProducer.cc.

References edm::EDConsumerBase::consumesCollector(), fs_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltSource_, l1Event, l1EventData, TFileService::make(), AlCaHLTBitMon_QueryRunRegistry::string, and tree_.

84 {
85  hltSource_ = consumes<edm::TriggerResults>(iConfig.getParameter<edm::InputTag>("hltSource"));
86 
87  std::string puMCFile = iConfig.getUntrackedParameter<std::string>("puMCFile", "");
88  std::string puMCHist = iConfig.getUntrackedParameter<std::string>("puMCHist", "pileup");
89  std::string puDataFile = iConfig.getUntrackedParameter<std::string>("puDataFile", "");
90  std::string puDataHist = iConfig.getUntrackedParameter<std::string>("puDataHist", "pileup");
91 
92  bool useAvgVtx = iConfig.getUntrackedParameter<bool>("useAvgVtx", true);
93  double maxAllowedWeight = iConfig.getUntrackedParameter<double>("maxAllowedWeight", -1);
94 
95  l1Event = new L1Analysis::L1AnalysisEvent(puMCFile, puMCHist,
96  puDataFile, puDataHist,
97  useAvgVtx, maxAllowedWeight,consumesCollector());
99 
100  // set up output
101  tree_=fs_->make<TTree>("L1EventTree", "L1EventTree");
102  tree_->Branch("Event", "L1Analysis::L1AnalysisEventDataFormat", &l1EventData, 32000, 3);
103 }
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 106 of file L1EventTreeProducer.cc.

References l1Event.

107 {
108 
109  // do anything here that needs to be done at desctruction time
110  // (e.g. close files, deallocate resources etc.)
111  delete l1Event;
112 
113 }
L1Analysis::L1AnalysisEvent * l1Event

Member Function Documentation

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

Definition at line 122 of file L1EventTreeProducer.cc.

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

123 {
124  if(!hltSource_.isUninitialized()) {
125  l1Event->Reset();
126  l1Event->Set(iEvent,hltSource_);
127  }
128  tree_->Fill();
129 }
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:73
void L1EventTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file L1EventTreeProducer.cc.

134 {
135 }
void L1EventTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 139 of file L1EventTreeProducer.cc.

References DEFINE_FWK_MODULE.

139  {
140 }

Member Data Documentation

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

Definition at line 69 of file L1EventTreeProducer.cc.

Referenced by L1EventTreeProducer().

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

Definition at line 74 of file L1EventTreeProducer.cc.

Referenced by analyze(), and L1EventTreeProducer().

L1Analysis::L1AnalysisEvent* L1EventTreeProducer::l1Event

Definition at line 63 of file L1EventTreeProducer.cc.

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

L1Analysis::L1AnalysisEventDataFormat* L1EventTreeProducer::l1EventData

Definition at line 64 of file L1EventTreeProducer.cc.

Referenced by L1EventTreeProducer().

TTree* L1EventTreeProducer::tree_
private

Definition at line 72 of file L1EventTreeProducer.cc.

Referenced by analyze(), and L1EventTreeProducer().