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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & itemsToGetFromEvent () 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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 &)
 

Private Member Functions

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

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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Detailed Description

Definition at line 23 of file L1TBasicDemo.cc.

Constructor & Destructor Documentation

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

Definition at line 45 of file L1TBasicDemo.cc.

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

45  {
46  egToken_ = consumes<l1t::EGammaBxCollection> (iConfig.getParameter<edm::InputTag>("EgTag"));
47  tauToken_ = consumes<l1t::TauBxCollection> (iConfig.getParameter<edm::InputTag>("TauTag"));
48  jetToken_ = consumes<l1t::JetBxCollection> (iConfig.getParameter<edm::InputTag>("JetTag"));
49  sumToken_ = consumes<l1t::EtSumBxCollection> (iConfig.getParameter<edm::InputTag>("SumTag"));
50  muonToken_ = consumes<l1t::MuonBxCollection> (iConfig.getParameter<edm::InputTag>("MuonTag"));
51  trigger_bx_only = iConfig.getParameter<bool>("UseTriggerBxOnly");
52 }
T getParameter(std::string const &) const
edm::EDGetTokenT< l1t::EtSumBxCollection > sumToken_
Definition: L1TBasicDemo.cc:38
edm::EDGetTokenT< l1t::TauBxCollection > tauToken_
Definition: L1TBasicDemo.cc:36
edm::EDGetTokenT< l1t::MuonBxCollection > muonToken_
Definition: L1TBasicDemo.cc:39
edm::EDGetTokenT< l1t::JetBxCollection > jetToken_
Definition: L1TBasicDemo.cc:37
edm::EDGetTokenT< l1t::EGammaBxCollection > egToken_
Definition: L1TBasicDemo.cc:35
L1TBasicDemo::~L1TBasicDemo ( )

Definition at line 55 of file L1TBasicDemo.cc.

55 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 58 of file L1TBasicDemo.cc.

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

59 {
60  cout << "INFO: dumping EGamma BX collection:\n";
62  iEvent.getByToken(egToken_, eg);
63  if (eg.isValid()){
64  for (int ibx = eg->getFirstBX(); ibx <= eg->getLastBX(); ++ibx) {
65  if (trigger_bx_only && (ibx != 0)) continue;
66  for (auto it=eg->begin(ibx); it!=eg->end(ibx); it++){
67  if (it->et() == 0) continue; // if you don't care about L1T candidates with zero ET.
68  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
69  }
70  }
71  } else {
72  edm::LogWarning("MissingProduct") << "L1Upgrade e-gamma bx collection not found." << std::endl;
73  }
74 
75  cout << "INFO: dumping Tau BX collection:\n";
77  iEvent.getByToken(tauToken_, tau);
78  if (tau.isValid()){
79  for (int ibx = tau->getFirstBX(); ibx <= tau->getLastBX(); ++ibx) {
80  if (trigger_bx_only && (ibx != 0)) continue;
81  for (auto it=tau->begin(ibx); it!=tau->end(ibx); it++){
82  if (it->et() == 0) continue; // if you don't care about L1T candidates with zero ET.
83  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
84  }
85  }
86  } else {
87  edm::LogWarning("MissingProduct") << "L1Upgrade tau bx collection not found." << std::endl;
88  }
89 
90  cout << "INFO: dumping Jet BX collection:\n";
92  iEvent.getByToken(jetToken_, jet);
93  if (jet.isValid()){
94  for (int ibx = jet->getFirstBX(); ibx <= jet->getLastBX(); ++ibx) {
95  if (trigger_bx_only && (ibx != 0)) continue;
96  for (auto it=jet->begin(ibx); it!=jet->end(ibx); it++){
97  if (it->et() == 0) continue; // if you don't care about L1T candidates with zero ET.
98  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
99  }
100  }
101  } else {
102  edm::LogWarning("MissingProduct") << "L1Upgrade jet bx collection not found." << std::endl;
103  }
104 
105  cout << "INFO: dumping EtSum BX collection:\n";
107  iEvent.getByToken(sumToken_, sum);
108  if (sum.isValid()){
109  l1t::EtSumHelper hsum(sum);
110  cout << "met: " << hsum.MissingEt() << "\n";
111  cout << "met phi: " << hsum.MissingEtPhi() << "\n";
112  cout << "mht: " << hsum.MissingHt() << "\n";
113  cout << "mht phi: " << hsum.MissingHtPhi() << "\n";
114  cout << "sum et: " << hsum.TotalEt() << "\n";
115  cout << "sum ht: " << hsum.TotalHt() << "\n";
116  } else {
117  edm::LogWarning("MissingProduct") << "L1Upgrade sum bx collection not found." << std::endl;
118  }
119 
120  cout << "INFO: dumping Muon BX collection:\n";
122  iEvent.getByToken(muonToken_, muon);
123  if (muon.isValid()){
124  for (int ibx = muon->getFirstBX(); ibx <= muon->getLastBX(); ++ibx) {
125  if (trigger_bx_only && (ibx != 0)) continue;
126  for (auto it=muon->begin(ibx); it!=muon->end(ibx); it++){
127  if (it->et() == 0) continue; // if you don't care about L1T candidates with zero ET.
128  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
129  }
130  }
131  } else {
132  edm::LogWarning("MissingProduct") << "L1Upgrade muon bx collection not found." << std::endl;
133  }
134 }
const_iterator end(int bx) const
edm::EDGetTokenT< l1t::EtSumBxCollection > sumToken_
Definition: L1TBasicDemo.cc:38
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< l1t::TauBxCollection > tauToken_
Definition: L1TBasicDemo.cc:36
edm::EDGetTokenT< l1t::MuonBxCollection > muonToken_
Definition: L1TBasicDemo.cc:39
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< l1t::JetBxCollection > jetToken_
Definition: L1TBasicDemo.cc:37
int getFirstBX() const
edm::EDGetTokenT< l1t::EGammaBxCollection > egToken_
Definition: L1TBasicDemo.cc:35
int getLastBX() const
const_iterator begin(int bx) const
void L1TBasicDemo::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 142 of file L1TBasicDemo.cc.

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

142  {
143  //The following says we do not know what parameters are allowed so do no validation
144  // Please change this to state exactly what you do use, even if it is no parameters
146  desc.setUnknown();
147  descriptions.addDefault(desc);
148 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

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

Definition at line 35 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

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

Definition at line 37 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

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

Definition at line 39 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

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

Definition at line 38 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

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

Definition at line 36 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().

int L1TBasicDemo::trigger_bx_only
private

Definition at line 41 of file L1TBasicDemo.cc.

Referenced by analyze(), and L1TBasicDemo().