CMS 3D CMS Logo

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

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

Inheritance diagram for L1UpgradeTreeProducer:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1UpgradeTreeProducer (const edm::ParameterSet &)
 
 ~L1UpgradeTreeProducer () 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

L1Analysis::L1AnalysisL1Upgradel1Upgrade
 
L1Analysis::L1AnalysisL1UpgradeDataFormatl1UpgradeData
 

Private Member Functions

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

Private Attributes

const edm::EDGetTokenT< l1t::EGammaBxCollectionegToken_
 
edm::Service< TFileServicefs_
 
const edm::EDGetTokenT< l1t::JetBxCollectionjetToken_
 
unsigned maxL1Upgrade_
 
const edm::EDGetTokenT< l1t::MuonShowerBxCollectionmuonShowerToken_
 
const edm::EDGetTokenT< l1t::MuonBxCollectionmuonToken_
 
const edm::EDGetTokenT< l1t::EtSumBxCollectionsumToken_
 
const edm::EDGetTokenT< l1t::EtSumBxCollectionsumZDCToken_
 
std::vector< edm::EDGetTokenT< l1t::TauBxCollection > > tauTokens_
 
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 50 of file L1UpgradeTreeProducer.cc.

Constructor & Destructor Documentation

◆ L1UpgradeTreeProducer()

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

Definition at line 85 of file L1UpgradeTreeProducer.cc.

References fs_, L1Analysis::L1AnalysisL1Upgrade::getData(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), TFileService::kSharedResource, l1Upgrade, l1UpgradeData, TFileService::make(), maxL1Upgrade_, Tau3MuMonitor_cff::taus, tauTokens_, and tree_.

86  : egToken_(consumes<l1t::EGammaBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("egToken"))),
87  jetToken_(consumes<l1t::JetBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("jetToken"))),
88  sumToken_(consumes<l1t::EtSumBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("sumToken"))),
89  muonToken_(consumes<l1t::MuonBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("muonToken"))),
91  consumes<l1t::MuonShowerBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("muonShowerToken"))),
92  sumZDCToken_(consumes<l1t::EtSumBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("sumZDCToken"))) {
93  const auto& taus = iConfig.getUntrackedParameter<std::vector<edm::InputTag>>("tauTokens");
94  for (const auto& tau : taus) {
95  tauTokens_.push_back(consumes<l1t::TauBxCollection>(tau));
96  }
97 
98  maxL1Upgrade_ = iConfig.getParameter<unsigned int>("maxL1Upgrade");
99 
102 
103  usesResource(TFileService::kSharedResource);
104 
105  // set up output
106  tree_ = fs_->make<TTree>("L1UpgradeTree", "L1UpgradeTree");
107  tree_->Branch("L1Upgrade", "L1Analysis::L1AnalysisL1UpgradeDataFormat", &l1UpgradeData, 32000, 3);
108 }
static const std::string kSharedResource
Definition: TFileService.h:76
std::vector< edm::EDGetTokenT< l1t::TauBxCollection > > tauTokens_
edm::Service< TFileService > fs_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< l1t::EtSumBxCollection > sumToken_
const edm::EDGetTokenT< l1t::MuonShowerBxCollection > muonShowerToken_
const edm::EDGetTokenT< l1t::JetBxCollection > jetToken_
T getUntrackedParameter(std::string const &, T const &) const
const edm::EDGetTokenT< l1t::EtSumBxCollection > sumZDCToken_
L1Analysis::L1AnalysisL1Upgrade * l1Upgrade
L1AnalysisL1UpgradeDataFormat * getData()
L1Analysis::L1AnalysisL1UpgradeDataFormat * l1UpgradeData
const edm::EDGetTokenT< l1t::EGammaBxCollection > egToken_
const edm::EDGetTokenT< l1t::MuonBxCollection > muonToken_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64

◆ ~L1UpgradeTreeProducer()

L1UpgradeTreeProducer::~L1UpgradeTreeProducer ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 115 of file L1UpgradeTreeProducer.cc.

References egToken_, iEvent, edm::HandleBase::isValid(), metsig::jet, jetToken_, l1Upgrade, maxL1Upgrade_, HLT_2024v10_cff::muon, muonShowerToken_, muonToken_, L1Analysis::L1AnalysisL1Upgrade::Reset(), L1Analysis::L1AnalysisL1Upgrade::SetEm(), L1Analysis::L1AnalysisL1Upgrade::SetJet(), L1Analysis::L1AnalysisL1Upgrade::SetMuon(), L1Analysis::L1AnalysisL1Upgrade::SetMuonShower(), L1Analysis::L1AnalysisL1Upgrade::SetSum(), L1Analysis::L1AnalysisL1Upgrade::SetSumZDC(), L1Analysis::L1AnalysisL1Upgrade::SetTau(), sumToken_, sumZDCToken_, metsig::tau, tauTokens_, and tree_.

115  {
116  l1Upgrade->Reset();
117 
124 
125  iEvent.getByToken(egToken_, eg);
126  iEvent.getByToken(jetToken_, jet);
127  iEvent.getByToken(sumToken_, sums);
128  iEvent.getByToken(muonToken_, muon);
129  iEvent.getByToken(muonShowerToken_, muonShower);
130  iEvent.getByToken(sumZDCToken_, sumsZDC);
131 
132  if (eg.isValid()) {
134  } else {
135  edm::LogWarning("MissingProduct") << "L1Upgrade Em not found. Branch will not be filled" << std::endl;
136  }
137  if (jet.isValid()) {
139  } else {
140  edm::LogWarning("MissingProduct") << "L1Upgrade Jets not found. Branch will not be filled" << std::endl;
141  }
142 
143  if (sums.isValid()) {
145  } else {
146  edm::LogWarning("MissingProduct") << "L1Upgrade EtSums not found. Branch will not be filled" << std::endl;
147  }
148 
149  if (muon.isValid()) {
151  } else {
152  edm::LogWarning("MissingProduct") << "L1Upgrade Muons not found. Branch will not be filled" << std::endl;
153  }
154 
155  if (muonShower.isValid()) {
156  l1Upgrade->SetMuonShower(muonShower, maxL1Upgrade_);
157  } else {
158  edm::LogWarning("MissingProduct") << "L1Upgrade Muon Showers not found. Branch will not be filled" << std::endl;
159  }
160 
161  if (sumsZDC.isValid()) {
162  l1Upgrade->SetSumZDC(sumsZDC, maxL1Upgrade_);
163  } else {
164  edm::LogWarning("MissingProduct") << "L1Upgrade EtZDCSums not found. Branch will not be filled" << std::endl;
165  }
166 
167  for (auto& tautoken : tauTokens_) {
169  iEvent.getByToken(tautoken, tau);
170  if (tau.isValid()) {
172  } else {
173  edm::LogWarning("MissingProduct") << "L1Upgrade Tau not found. Branch will not be filled" << std::endl;
174  }
175  }
176 
177  tree_->Fill();
178 }
std::vector< edm::EDGetTokenT< l1t::TauBxCollection > > tauTokens_
void SetMuon(const edm::Handle< l1t::MuonBxCollection > muon, unsigned maxL1Upgrade)
const edm::EDGetTokenT< l1t::EtSumBxCollection > sumToken_
void SetSumZDC(const edm::Handle< l1t::EtSumBxCollection > sumsZDC, unsigned maxL1Upgrade)
const edm::EDGetTokenT< l1t::MuonShowerBxCollection > muonShowerToken_
void SetJet(const edm::Handle< l1t::JetBxCollection > jet, unsigned maxL1Upgrade)
void SetEm(const edm::Handle< l1t::EGammaBxCollection > em, unsigned maxL1Upgrade)
const edm::EDGetTokenT< l1t::JetBxCollection > jetToken_
const edm::EDGetTokenT< l1t::EtSumBxCollection > sumZDCToken_
L1Analysis::L1AnalysisL1Upgrade * l1Upgrade
int iEvent
Definition: GenABIO.cc:224
void SetTau(const edm::Handle< l1t::TauBxCollection > tau, unsigned maxL1Upgrade)
void SetMuonShower(const edm::Handle< l1t::MuonShowerBxCollection > muonShower, unsigned maxL1Upgrade)
bool isValid() const
Definition: HandleBase.h:70
const edm::EDGetTokenT< l1t::EGammaBxCollection > egToken_
const edm::EDGetTokenT< l1t::MuonBxCollection > muonToken_
Log< level::Warning, false > LogWarning
void SetSum(const edm::Handle< l1t::EtSumBxCollection > sums, unsigned maxL1Upgrade)

◆ beginJob()

void L1UpgradeTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 181 of file L1UpgradeTreeProducer.cc.

181 {}

◆ endJob()

void L1UpgradeTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 184 of file L1UpgradeTreeProducer.cc.

184 {}

Member Data Documentation

◆ egToken_

const edm::EDGetTokenT<l1t::EGammaBxCollection> L1UpgradeTreeProducer::egToken_
private

Definition at line 74 of file L1UpgradeTreeProducer.cc.

Referenced by analyze().

◆ fs_

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

Definition at line 68 of file L1UpgradeTreeProducer.cc.

Referenced by L1UpgradeTreeProducer().

◆ jetToken_

const edm::EDGetTokenT<l1t::JetBxCollection> L1UpgradeTreeProducer::jetToken_
private

Definition at line 75 of file L1UpgradeTreeProducer.cc.

Referenced by analyze().

◆ l1Upgrade

L1Analysis::L1AnalysisL1Upgrade* L1UpgradeTreeProducer::l1Upgrade

Definition at line 61 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

◆ l1UpgradeData

L1Analysis::L1AnalysisL1UpgradeDataFormat* L1UpgradeTreeProducer::l1UpgradeData

Definition at line 62 of file L1UpgradeTreeProducer.cc.

Referenced by L1UpgradeTreeProducer().

◆ maxL1Upgrade_

unsigned L1UpgradeTreeProducer::maxL1Upgrade_
private

Definition at line 65 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

◆ muonShowerToken_

const edm::EDGetTokenT<l1t::MuonShowerBxCollection> L1UpgradeTreeProducer::muonShowerToken_
private

Definition at line 78 of file L1UpgradeTreeProducer.cc.

Referenced by analyze().

◆ muonToken_

const edm::EDGetTokenT<l1t::MuonBxCollection> L1UpgradeTreeProducer::muonToken_
private

Definition at line 77 of file L1UpgradeTreeProducer.cc.

Referenced by analyze().

◆ sumToken_

const edm::EDGetTokenT<l1t::EtSumBxCollection> L1UpgradeTreeProducer::sumToken_
private

Definition at line 76 of file L1UpgradeTreeProducer.cc.

Referenced by analyze().

◆ sumZDCToken_

const edm::EDGetTokenT<l1t::EtSumBxCollection> L1UpgradeTreeProducer::sumZDCToken_
private

Definition at line 80 of file L1UpgradeTreeProducer.cc.

Referenced by analyze().

◆ tauTokens_

std::vector<edm::EDGetTokenT<l1t::TauBxCollection> > L1UpgradeTreeProducer::tauTokens_
private

Definition at line 82 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

◆ tree_

TTree* L1UpgradeTreeProducer::tree_
private

Definition at line 71 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().