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< l1t::CICADABxCollectionscoreToken_
 
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 26 of file L1CaloSummaryTreeProducer.cc.

Constructor & Destructor Documentation

◆ L1CaloSummaryTreeProducer()

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

Definition at line 46 of file L1CaloSummaryTreeProducer.cc.

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

47  : scoreToken_(consumes<l1t::CICADABxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("scoreToken"))),
48  regionToken_(consumes<L1CaloRegionCollection>(iConfig.getUntrackedParameter<edm::InputTag>("regionToken"))) {
49  usesResource(TFileService::kSharedResource);
50  tree_ = fs_->make<TTree>("L1CaloSummaryTree", "L1CaloSummaryTree");
51  tree_->Branch("CaloSummary", "L1Analysis::L1AnalysisCaloSummaryDataFormat", &caloSummaryData_, 32000, 3);
52 
54 }
static const std::string kSharedResource
Definition: TFileService.h:76
const edm::EDGetTokenT< l1t::CICADABxCollection > scoreToken_
T getUntrackedParameter(std::string const &, T const &) const
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 81 of file L1CaloSummaryTreeProducer.cc.

References caloSummaryData_.

81 { 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 56 of file L1CaloSummaryTreeProducer.cc.

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

56  {
58 
60  iEvent.getByToken(regionToken_, regions);
61 
62  if (regions.isValid()) {
63  for (const auto& itr : *regions) {
64  caloSummaryData_->modelInput[itr.gctPhi()][itr.gctEta() - 4] =
65  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
66  }
67  } else {
68  edm::LogWarning("L1Ntuple") << "Could not find region regions. CICADA model input will not be filled";
69  }
70 
72  iEvent.getByToken(scoreToken_, score);
73  if (score.isValid())
74  caloSummaryData_->CICADAScore = score->at(0, 0);
75  else
76  edm::LogWarning("L1Ntuple") << "Could not find a proper CICADA score. CICADA score will not be filled.";
77 
78  tree_->Fill();
79 }
const edm::EDGetTokenT< l1t::CICADABxCollection > 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 32 of file L1CaloSummaryTreeProducer.cc.

32 {}

◆ endJob()

void L1CaloSummaryTreeProducer::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 34 of file L1CaloSummaryTreeProducer.cc.

34 {}

Member Data Documentation

◆ caloSummaryData_

L1Analysis::L1AnalysisCaloSummaryDataFormat* L1CaloSummaryTreeProducer::caloSummaryData_

◆ fs_

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

Definition at line 42 of file L1CaloSummaryTreeProducer.cc.

Referenced by L1CaloSummaryTreeProducer().

◆ regionToken_

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

Definition at line 41 of file L1CaloSummaryTreeProducer.cc.

Referenced by analyze().

◆ scoreToken_

const edm::EDGetTokenT<l1t::CICADABxCollection> L1CaloSummaryTreeProducer::scoreToken_
private

Definition at line 40 of file L1CaloSummaryTreeProducer.cc.

Referenced by analyze().

◆ tree_

TTree* L1CaloSummaryTreeProducer::tree_
private

Definition at line 43 of file L1CaloSummaryTreeProducer.cc.

Referenced by analyze(), and L1CaloSummaryTreeProducer().