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::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1EventTreeProducer (const edm::ParameterSet &)
 
 ~L1EventTreeProducer () override=default
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 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)
 

Public Attributes

std::unique_ptr< 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_
 
const edm::EDGetTokenT< edm::TriggerResultshltSource_
 
TTree * tree_
 

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

Description: Produce L1 Extra tree

Implementation:

Definition at line 49 of file L1EventTreeProducer.cc.

Constructor & Destructor Documentation

◆ L1EventTreeProducer()

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

Definition at line 74 of file L1EventTreeProducer.cc.

References edm::EDConsumerBase::consumesCollector(), fs_, edm::ParameterSet::getUntrackedParameter(), TFileService::kSharedResource, 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.

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

◆ ~L1EventTreeProducer()

L1EventTreeProducer::~L1EventTreeProducer ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 100 of file L1EventTreeProducer.cc.

References hltSource_, iEvent, edm::EDGetTokenT< T >::isUninitialized(), l1Event, and tree_.

100  {
101  if (!hltSource_.isUninitialized()) {
102  l1Event->Reset();
103  l1Event->Set(iEvent, hltSource_);
104  }
105  tree_->Fill();
106 }
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:104
std::unique_ptr< L1Analysis::L1AnalysisEvent > l1Event
int iEvent
Definition: GenABIO.cc:224
const edm::EDGetTokenT< edm::TriggerResults > hltSource_

◆ beginJob()

void L1EventTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 109 of file L1EventTreeProducer.cc.

109 {}

◆ endJob()

void L1EventTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 112 of file L1EventTreeProducer.cc.

112 {}

Member Data Documentation

◆ fs_

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

Definition at line 65 of file L1EventTreeProducer.cc.

Referenced by L1EventTreeProducer().

◆ hltSource_

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

Definition at line 71 of file L1EventTreeProducer.cc.

Referenced by analyze().

◆ l1Event

std::unique_ptr<L1Analysis::L1AnalysisEvent> L1EventTreeProducer::l1Event

Definition at line 60 of file L1EventTreeProducer.cc.

Referenced by analyze(), and L1EventTreeProducer().

◆ l1EventData

L1Analysis::L1AnalysisEventDataFormat* L1EventTreeProducer::l1EventData

Definition at line 61 of file L1EventTreeProducer.cc.

Referenced by L1EventTreeProducer().

◆ tree_

TTree* L1EventTreeProducer::tree_
private

Definition at line 68 of file L1EventTreeProducer.cc.

Referenced by analyze(), and L1EventTreeProducer().