CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
L1CaloSummaryTreeProducer Class Reference
Inheritance diagram for L1CaloSummaryTreeProducer:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1CaloSummaryTreeProducer (const edm::ParameterSet &)
 
 ~L1CaloSummaryTreeProducer () override
 
- 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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

L1Analysis::L1AnalysisCaloSummaryDataFormatcaloSummaryData_
 

Private Member Functions

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

Private Attributes

edm::Service< TFileServicefs_
 
const edm::EDGetTokenT< L1CaloRegionCollectionregionToken_
 
const edm::EDGetTokenT< float > scoreToken_
 
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

Definition at line 25 of file L1CaloSummaryTreeProducer.cc.

Constructor & Destructor Documentation

◆ L1CaloSummaryTreeProducer()

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

Definition at line 45 of file L1CaloSummaryTreeProducer.cc.

References caloSummaryData_, fs_, TFileService::kSharedResource, TFileService::make(), and tree_.

46  : scoreToken_(consumes<float>(iConfig.getUntrackedParameter<edm::InputTag>("scoreToken"))),
47  regionToken_(consumes<L1CaloRegionCollection>(iConfig.getUntrackedParameter<edm::InputTag>("regionToken"))) {
48  usesResource(TFileService::kSharedResource);
49  tree_ = fs_->make<TTree>("L1CaloSummaryTree", "L1CaloSummaryTree");
50  tree_->Branch("CaloSummary", "L1Analysis::L1AnalysisCaloSummaryDataFormat", &caloSummaryData_, 32000, 3);
51 
53 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getUntrackedParameter(std::string const &, T const &) const
const edm::EDGetTokenT< float > scoreToken_
L1Analysis::L1AnalysisCaloSummaryDataFormat * caloSummaryData_
const edm::EDGetTokenT< L1CaloRegionCollection > regionToken_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::Service< TFileService > fs_

◆ ~L1CaloSummaryTreeProducer()

L1CaloSummaryTreeProducer::~L1CaloSummaryTreeProducer ( )
override

Definition at line 80 of file L1CaloSummaryTreeProducer.cc.

References caloSummaryData_.

80 { delete caloSummaryData_; }
L1Analysis::L1AnalysisCaloSummaryDataFormat * caloSummaryData_

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 55 of file L1CaloSummaryTreeProducer.cc.

References caloSummaryData_, L1Analysis::L1AnalysisCaloSummaryDataFormat::CICADAScore, iEvent, L1Analysis::L1AnalysisCaloSummaryDataFormat::modelInput, regionToken_, L1Analysis::L1AnalysisCaloSummaryDataFormat::Reset(), offlineSlimmedPrimaryVertices_cfi::score, scoreToken_, and tree_.

55  {
57 
59  iEvent.getByToken(regionToken_, regions);
60 
61  if (regions.isValid()) {
62  for (const auto& itr : *regions) {
63  caloSummaryData_->modelInput[itr.gctPhi()][itr.gctEta() - 4] =
64  itr.et(); //4 is subtracted off of the Eta to account for the 4+4 forward/backward HF regions that are not used in CICADA. These take offset the iEta by 4
65  }
66  } else {
67  edm::LogWarning("L1Ntuple") << "Could not find region regions. CICADA model input will not be filled";
68  }
69 
71  iEvent.getByToken(scoreToken_, score);
72  if (score.isValid())
74  else
75  edm::LogWarning("L1Ntuple") << "Could not find a proper CICADA score. CICADA score will not be filled.";
76 
77  tree_->Fill();
78 }
const edm::EDGetTokenT< float > scoreToken_
int iEvent
Definition: GenABIO.cc:224
L1Analysis::L1AnalysisCaloSummaryDataFormat * caloSummaryData_
const edm::EDGetTokenT< L1CaloRegionCollection > regionToken_
Log< level::Warning, false > LogWarning

◆ beginJob()

void L1CaloSummaryTreeProducer::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 31 of file L1CaloSummaryTreeProducer.cc.

31 {};

◆ endJob()

void L1CaloSummaryTreeProducer::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 33 of file L1CaloSummaryTreeProducer.cc.

33 {};

Member Data Documentation

◆ caloSummaryData_

L1Analysis::L1AnalysisCaloSummaryDataFormat* L1CaloSummaryTreeProducer::caloSummaryData_

◆ fs_

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

Definition at line 41 of file L1CaloSummaryTreeProducer.cc.

Referenced by L1CaloSummaryTreeProducer().

◆ regionToken_

const edm::EDGetTokenT<L1CaloRegionCollection> L1CaloSummaryTreeProducer::regionToken_
private

Definition at line 40 of file L1CaloSummaryTreeProducer.cc.

Referenced by analyze().

◆ scoreToken_

const edm::EDGetTokenT<float> L1CaloSummaryTreeProducer::scoreToken_
private

Definition at line 39 of file L1CaloSummaryTreeProducer.cc.

Referenced by analyze().

◆ tree_

TTree* L1CaloSummaryTreeProducer::tree_
private

Definition at line 42 of file L1CaloSummaryTreeProducer.cc.

Referenced by analyze(), and L1CaloSummaryTreeProducer().