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

Public Member Functions

 L1UpgradeTreeProducer (const edm::ParameterSet &)
 
 ~L1UpgradeTreeProducer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices 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

edm::EDGetTokenT< l1t::EGammaBxCollectionegToken_
 
edm::Service< TFileServicefs_
 
edm::EDGetTokenT< l1t::JetBxCollectionjetToken_
 
unsigned maxL1Upgrade_
 
edm::EDGetTokenT< l1t::MuonBxCollectionmuonToken_
 
edm::EDGetTokenT< l1t::EtSumBxCollectionsumToken_
 
std::vector< edm::EDGetTokenT< l1t::TauBxCollection > > tauTokens_
 
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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: Produce L1 Extra tree

Implementation:

Definition at line 49 of file L1UpgradeTreeProducer.cc.

Constructor & Destructor Documentation

◆ L1UpgradeTreeProducer()

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

Definition at line 80 of file L1UpgradeTreeProducer.cc.

80  {
81  egToken_ = consumes<l1t::EGammaBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("egToken"));
82  //tauToken_ = consumes<l1t::TauBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("tauToken"));
83  jetToken_ = consumes<l1t::JetBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("jetToken"));
84  sumToken_ = consumes<l1t::EtSumBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("sumToken"));
85  muonToken_ = consumes<l1t::MuonBxCollection>(iConfig.getUntrackedParameter<edm::InputTag>("muonToken"));
86 
87  const auto& taus = iConfig.getUntrackedParameter<std::vector<edm::InputTag>>("tauTokens");
88  for (const auto& tau : taus) {
89  tauTokens_.push_back(consumes<l1t::TauBxCollection>(tau));
90  }
91 
92  maxL1Upgrade_ = iConfig.getParameter<unsigned int>("maxL1Upgrade");
93 
96 
97  // set up output
98  tree_ = fs_->make<TTree>("L1UpgradeTree", "L1UpgradeTree");
99  tree_->Branch("L1Upgrade", "L1Analysis::L1AnalysisL1UpgradeDataFormat", &l1UpgradeData, 32000, 3);
100 }

References egToken_, fs_, L1Analysis::L1AnalysisL1Upgrade::getData(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), jetToken_, l1Upgrade, l1UpgradeData, TFileService::make(), maxL1Upgrade_, muonToken_, sumToken_, metsig::tau, Tau3MuMonitor_cff::taus, tauTokens_, and tree_.

◆ ~L1UpgradeTreeProducer()

L1UpgradeTreeProducer::~L1UpgradeTreeProducer ( )
override

Definition at line 102 of file L1UpgradeTreeProducer.cc.

102  {
103  // do anything here that needs to be done at desctruction time
104  // (e.g. close files, deallocate resources etc.)
105 }

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 112 of file L1UpgradeTreeProducer.cc.

112  {
113  l1Upgrade->Reset();
114 
119 
120  iEvent.getByToken(egToken_, eg);
121  iEvent.getByToken(jetToken_, jet);
122  iEvent.getByToken(sumToken_, sums);
123  iEvent.getByToken(muonToken_, muon);
124 
125  if (eg.isValid()) {
127  } else {
128  edm::LogWarning("MissingProduct") << "L1Upgrade Em not found. Branch will not be filled" << std::endl;
129  }
130  if (jet.isValid()) {
132  } else {
133  edm::LogWarning("MissingProduct") << "L1Upgrade Jets not found. Branch will not be filled" << std::endl;
134  }
135 
136  if (sums.isValid()) {
138  } else {
139  edm::LogWarning("MissingProduct") << "L1Upgrade EtSums not found. Branch will not be filled" << std::endl;
140  }
141 
142  if (muon.isValid()) {
144  } else {
145  edm::LogWarning("MissingProduct") << "L1Upgrade Muons not found. Branch will not be filled" << std::endl;
146  }
147 
148  for (auto& tautoken : tauTokens_) {
150  iEvent.getByToken(tautoken, tau);
151  if (tau.isValid()) {
153  } else {
154  edm::LogWarning("MissingProduct") << "L1Upgrade Tau not found. Branch will not be filled" << std::endl;
155  }
156  }
157 
158  tree_->Fill();
159 }

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

◆ beginJob()

void L1UpgradeTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 162 of file L1UpgradeTreeProducer.cc.

162 {}

◆ endJob()

void L1UpgradeTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 165 of file L1UpgradeTreeProducer.cc.

165 {}

Member Data Documentation

◆ egToken_

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

Definition at line 73 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

◆ fs_

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

Definition at line 67 of file L1UpgradeTreeProducer.cc.

Referenced by L1UpgradeTreeProducer().

◆ jetToken_

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

Definition at line 75 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

◆ l1Upgrade

L1Analysis::L1AnalysisL1Upgrade* L1UpgradeTreeProducer::l1Upgrade

Definition at line 60 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

◆ l1UpgradeData

L1Analysis::L1AnalysisL1UpgradeDataFormat* L1UpgradeTreeProducer::l1UpgradeData

Definition at line 61 of file L1UpgradeTreeProducer.cc.

Referenced by L1UpgradeTreeProducer().

◆ maxL1Upgrade_

unsigned L1UpgradeTreeProducer::maxL1Upgrade_
private

Definition at line 64 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

◆ muonToken_

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

Definition at line 77 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

◆ sumToken_

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

Definition at line 76 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

◆ tauTokens_

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

Definition at line 74 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

◆ tree_

TTree* L1UpgradeTreeProducer::tree_
private

Definition at line 70 of file L1UpgradeTreeProducer.cc.

Referenced by analyze(), and L1UpgradeTreeProducer().

L1Analysis::L1AnalysisL1Upgrade::Reset
void Reset()
Definition: L1AnalysisL1Upgrade.h:27
L1Analysis::L1AnalysisL1Upgrade::SetJet
void SetJet(const edm::Handle< l1t::JetBxCollection > jet, unsigned maxL1Upgrade)
Definition: L1AnalysisL1Upgrade.cc:64
L1Analysis::L1AnalysisL1Upgrade::getData
L1AnalysisL1UpgradeDataFormat * getData()
Definition: L1AnalysisL1Upgrade.h:33
metsig::tau
Definition: SignAlgoResolutions.h:49
muon
Definition: MuonCocktails.h:17
L1UpgradeTreeProducer::maxL1Upgrade_
unsigned maxL1Upgrade_
Definition: L1UpgradeTreeProducer.cc:64
Tau3MuMonitor_cff.taus
taus
Definition: Tau3MuMonitor_cff.py:7
L1UpgradeTreeProducer::muonToken_
edm::EDGetTokenT< l1t::MuonBxCollection > muonToken_
Definition: L1UpgradeTreeProducer.cc:77
L1UpgradeTreeProducer::fs_
edm::Service< TFileService > fs_
Definition: L1UpgradeTreeProducer.cc:67
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
L1UpgradeTreeProducer::l1UpgradeData
L1Analysis::L1AnalysisL1UpgradeDataFormat * l1UpgradeData
Definition: L1UpgradeTreeProducer.cc:61
HLT_2018_cff.muon
muon
Definition: HLT_2018_cff.py:10349
edm::Handle
Definition: AssociativeIterator.h:50
L1UpgradeTreeProducer::tree_
TTree * tree_
Definition: L1UpgradeTreeProducer.cc:70
L1Analysis::L1AnalysisL1Upgrade::SetMuon
void SetMuon(const edm::Handle< l1t::MuonBxCollection > muon, unsigned maxL1Upgrade)
Definition: L1AnalysisL1Upgrade.cc:92
edm::LogWarning
Definition: MessageLogger.h:141
L1UpgradeTreeProducer::l1Upgrade
L1Analysis::L1AnalysisL1Upgrade * l1Upgrade
Definition: L1UpgradeTreeProducer.cc:60
L1UpgradeTreeProducer::egToken_
edm::EDGetTokenT< l1t::EGammaBxCollection > egToken_
Definition: L1UpgradeTreeProducer.cc:73
iEvent
int iEvent
Definition: GenABIO.cc:224
L1Analysis::L1AnalysisL1Upgrade::SetSum
void SetSum(const edm::Handle< l1t::EtSumBxCollection > sums, unsigned maxL1Upgrade)
Definition: L1AnalysisL1Upgrade.cc:121
L1Analysis::L1AnalysisL1Upgrade
Definition: L1AnalysisL1Upgrade.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
L1UpgradeTreeProducer::tauTokens_
std::vector< edm::EDGetTokenT< l1t::TauBxCollection > > tauTokens_
Definition: L1UpgradeTreeProducer.cc:74
L1Analysis::L1AnalysisL1Upgrade::SetEm
void SetEm(const edm::Handle< l1t::EGammaBxCollection > em, unsigned maxL1Upgrade)
Definition: L1AnalysisL1Upgrade.cc:7
metsig::jet
Definition: SignAlgoResolutions.h:47
L1UpgradeTreeProducer::jetToken_
edm::EDGetTokenT< l1t::JetBxCollection > jetToken_
Definition: L1UpgradeTreeProducer.cc:75
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
L1Analysis::L1AnalysisL1Upgrade::SetTau
void SetTau(const edm::Handle< l1t::TauBxCollection > tau, unsigned maxL1Upgrade)
Definition: L1AnalysisL1Upgrade.cc:36
edm::InputTag
Definition: InputTag.h:15
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
L1UpgradeTreeProducer::sumToken_
edm::EDGetTokenT< l1t::EtSumBxCollection > sumToken_
Definition: L1UpgradeTreeProducer.cc:76