CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1TBasicDemo Class Reference
Inheritance diagram for L1TBasicDemo:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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 ()
 

Private Member Functions

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

Private Attributes

edm::EDGetTokenT< l1t::EGammaBxCollectionegToken_
 
edm::EDGetTokenT< l1t::JetBxCollectionjetToken_
 
edm::EDGetTokenT< l1t::MuonBxCollectionmuonToken_
 
edm::EDGetTokenT< l1t::EtSumBxCollectionsumToken_
 
edm::EDGetTokenT< l1t::TauBxCollectiontauToken_
 
int trigger_bx_only
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

Definition at line 23 of file L1TBasicDemo.cc.

Constructor & Destructor Documentation

◆ L1TBasicDemo()

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

Definition at line 43 of file L1TBasicDemo.cc.

43  {
44  egToken_ = consumes<l1t::EGammaBxCollection>(iConfig.getParameter<edm::InputTag>("EgTag"));
45  tauToken_ = consumes<l1t::TauBxCollection>(iConfig.getParameter<edm::InputTag>("TauTag"));
46  jetToken_ = consumes<l1t::JetBxCollection>(iConfig.getParameter<edm::InputTag>("JetTag"));
47  sumToken_ = consumes<l1t::EtSumBxCollection>(iConfig.getParameter<edm::InputTag>("SumTag"));
48  muonToken_ = consumes<l1t::MuonBxCollection>(iConfig.getParameter<edm::InputTag>("MuonTag"));
49  trigger_bx_only = iConfig.getParameter<bool>("UseTriggerBxOnly");
50 }

References egToken_, edm::ParameterSet::getParameter(), jetToken_, muonToken_, sumToken_, tauToken_, and trigger_bx_only.

◆ ~L1TBasicDemo()

L1TBasicDemo::~L1TBasicDemo ( )
override

Definition at line 52 of file L1TBasicDemo.cc.

52 {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 54 of file L1TBasicDemo.cc.

54  {
55  cout << "INFO: dumping EGamma BX collection:\n";
57  iEvent.getByToken(egToken_, eg);
58  if (eg.isValid()) {
59  for (int ibx = eg->getFirstBX(); ibx <= eg->getLastBX(); ++ibx) {
60  if (trigger_bx_only && (ibx != 0))
61  continue;
62  for (auto it = eg->begin(ibx); it != eg->end(ibx); it++) {
63  if (it->et() == 0)
64  continue; // if you don't care about L1T candidates with zero ET.
65  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
66  }
67  }
68  } else {
69  edm::LogWarning("MissingProduct") << "L1Upgrade e-gamma bx collection not found." << std::endl;
70  }
71 
72  cout << "INFO: dumping Tau BX collection:\n";
74  iEvent.getByToken(tauToken_, tau);
75  if (tau.isValid()) {
76  for (int ibx = tau->getFirstBX(); ibx <= tau->getLastBX(); ++ibx) {
77  if (trigger_bx_only && (ibx != 0))
78  continue;
79  for (auto it = tau->begin(ibx); it != tau->end(ibx); it++) {
80  if (it->et() == 0)
81  continue; // if you don't care about L1T candidates with zero ET.
82  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
83  }
84  }
85  } else {
86  edm::LogWarning("MissingProduct") << "L1Upgrade tau bx collection not found." << std::endl;
87  }
88 
89  cout << "INFO: dumping Jet BX collection:\n";
91  iEvent.getByToken(jetToken_, jet);
92  if (jet.isValid()) {
93  for (int ibx = jet->getFirstBX(); ibx <= jet->getLastBX(); ++ibx) {
94  if (trigger_bx_only && (ibx != 0))
95  continue;
96  for (auto it = jet->begin(ibx); it != jet->end(ibx); it++) {
97  if (it->et() == 0)
98  continue; // if you don't care about L1T candidates with zero ET.
99  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
100  }
101  }
102  } else {
103  edm::LogWarning("MissingProduct") << "L1Upgrade jet bx collection not found." << std::endl;
104  }
105 
106  cout << "INFO: dumping EtSum BX collection:\n";
108  iEvent.getByToken(sumToken_, sum);
109  if (sum.isValid()) {
110  l1t::EtSumHelper hsum(sum);
111  cout << "met: " << hsum.MissingEt() << "\n";
112  cout << "met phi: " << hsum.MissingEtPhi() << "\n";
113  cout << "mht: " << hsum.MissingHt() << "\n";
114  cout << "mht phi: " << hsum.MissingHtPhi() << "\n";
115  cout << "sum et: " << hsum.TotalEt() << "\n";
116  cout << "sum ht: " << hsum.TotalHt() << "\n";
117  } else {
118  edm::LogWarning("MissingProduct") << "L1Upgrade sum bx collection not found." << std::endl;
119  }
120 
121  cout << "INFO: dumping Muon BX collection:\n";
123  iEvent.getByToken(muonToken_, muon);
124  if (muon.isValid()) {
125  for (int ibx = muon->getFirstBX(); ibx <= muon->getLastBX(); ++ibx) {
126  if (trigger_bx_only && (ibx != 0))
127  continue;
128  for (auto it = muon->begin(ibx); it != muon->end(ibx); it++) {
129  if (it->et() == 0)
130  continue; // if you don't care about L1T candidates with zero ET.
131  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
132  }
133  }
134  } else {
135  edm::LogWarning("MissingProduct") << "L1Upgrade muon bx collection not found." << std::endl;
136  }
137 }

References BXVector< T >::begin(), gather_cfg::cout, egToken_, BXVector< T >::end(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), iEvent, edm::HandleBase::isValid(), metsig::jet, jetToken_, l1t::EtSumHelper::MissingEt(), l1t::EtSumHelper::MissingEtPhi(), l1t::EtSumHelper::MissingHt(), l1t::EtSumHelper::MissingHtPhi(), HLT_2018_cff::muon, muonToken_, sumToken_, metsig::tau, tauToken_, l1t::EtSumHelper::TotalEt(), l1t::EtSumHelper::TotalHt(), and trigger_bx_only.

◆ fillDescriptions()

void L1TBasicDemo::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 139 of file L1TBasicDemo.cc.

139  {
140  //The following says we do not know what parameters are allowed so do no validation
141  // Please change this to state exactly what you do use, even if it is no parameters
143  desc.setUnknown();
144  descriptions.addDefault(desc);
145 }

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

Member Data Documentation

◆ egToken_

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

Definition at line 34 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

◆ jetToken_

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

Definition at line 36 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

◆ muonToken_

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

Definition at line 38 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

◆ sumToken_

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

Definition at line 37 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

◆ tauToken_

edm::EDGetTokenT<l1t::TauBxCollection> L1TBasicDemo::tauToken_
private

Definition at line 35 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

◆ trigger_bx_only

int L1TBasicDemo::trigger_bx_only
private

Definition at line 40 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

L1TBasicDemo::tauToken_
edm::EDGetTokenT< l1t::TauBxCollection > tauToken_
Definition: L1TBasicDemo.cc:35
metsig::tau
Definition: SignAlgoResolutions.h:49
muon
Definition: MuonCocktails.h:17
L1TBasicDemo::jetToken_
edm::EDGetTokenT< l1t::JetBxCollection > jetToken_
Definition: L1TBasicDemo.cc:36
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLT_2018_cff.muon
muon
Definition: HLT_2018_cff.py:10349
edm::Handle
Definition: AssociativeIterator.h:50
BXVector::getFirstBX
int getFirstBX() const
BXVector::begin
const_iterator begin(int bx) const
L1TBasicDemo::egToken_
edm::EDGetTokenT< l1t::EGammaBxCollection > egToken_
Definition: L1TBasicDemo.cc:34
edm::LogWarning
Definition: MessageLogger.h:141
BXVector::end
const_iterator end(int bx) const
iEvent
int iEvent
Definition: GenABIO.cc:224
L1TBasicDemo::sumToken_
edm::EDGetTokenT< l1t::EtSumBxCollection > sumToken_
Definition: L1TBasicDemo.cc:37
edm::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
L1TBasicDemo::trigger_bx_only
int trigger_bx_only
Definition: L1TBasicDemo.cc:40
l1t::EtSumHelper
Definition: EtSumHelper.h:12
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
BXVector::getLastBX
int getLastBX() const
edm::InputTag
Definition: InputTag.h:15
L1TBasicDemo::muonToken_
edm::EDGetTokenT< l1t::MuonBxCollection > muonToken_
Definition: L1TBasicDemo.cc:38