CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1TSummary Class Reference
Inheritance diagram for L1TSummary:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 L1TSummary (const ParameterSet &)
 
 ~L1TSummary ()
 
- 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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (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 (Event const &, EventSetup const &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (LuminosityBlock const &, EventSetup const &)
 
virtual void beginRun (Run const &, EventSetup const &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (LuminosityBlock const &, EventSetup const &)
 
virtual void endRun (Run const &, EventSetup const &)
 

Private Attributes

bool bxZeroOnly_
 
bool egCheck_
 
int egCount_
 
edm::EDGetTokenT
< EGammaBxCollection
egToken_
 
bool jetCheck_
 
int jetCount_
 
edm::EDGetTokenT< JetBxCollectionjetToken_
 
bool muonCheck_
 
int muonCount_
 
edm::EDGetTokenT
< MuonBxCollection
muonToken_
 
bool sumCheck_
 
int sumCount_
 
edm::EDGetTokenT
< EtSumBxCollection
sumToken_
 
string tag_
 
bool tauCheck_
 
int tauCount_
 
std::vector< edm::EDGetTokenT
< TauBxCollection > > 
tauTokens_
 

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 L1TSummary.cc.

Constructor & Destructor Documentation

L1TSummary::L1TSummary ( const ParameterSet iConfig)
explicit

Definition at line 66 of file L1TSummary.cc.

References edm::ParameterSet::getParameter(), and metsig::tau.

66  {
67 
68 
69  // InputTag barrelTfInputTag = iConfig.getParameter<InputTag>("barrelTFInput");
70  // InputTag overlapTfInputTag = iConfig.getParameter<InputTag>("overlapTFInput");
71  // InputTag forwardTfInputTag = iConfig.getParameter<InputTag>("forwardTFInput");
72  //m_barrelTfInputToken = consumes<MicroGMTConfiguration::InputCollection>(iConfig.getParameter<InputTag>("bmtfDigis"));
73 
74  tag_ = iConfig.getParameter<string>("tag");
75 
76  egCheck_ = iConfig.getParameter<bool>("egCheck");
77  tauCheck_ = iConfig.getParameter<bool>("tauCheck");
78  jetCheck_ = iConfig.getParameter<bool>("jetCheck");
79  sumCheck_ = iConfig.getParameter<bool>("sumCheck");
80  muonCheck_ = iConfig.getParameter<bool>("muonCheck");
81  bxZeroOnly_ = iConfig.getParameter<bool>("bxZeroOnly");
82 
83  //cout << "L1T Summary for " << tag << "\n";
84  //cout << "DEBUG: egCheck: " << egCheck_ << "\n";
85  //cout << "DEBUG: tauCheck: " << tauCheck_ << "\n";
86  //cout << "DEBUG: jetCheck: " << jetCheck_ << "\n";
87  //cout << "DEBUG: sumCheck: " << sumCheck_ << "\n";
88  //cout << "DEBUG: muonCheck: " << muonCheck_ << "\n";
89 
90  if (egCheck_) {egToken_ = consumes<EGammaBxCollection> (iConfig.getParameter<InputTag>("egToken"));}
91  if (tauCheck_) {
92  const auto& taus = iConfig.getParameter<std::vector<edm::InputTag>>("tauTokens");
93  for (const auto& tau: taus) {
94  tauTokens_.push_back(consumes<l1t::TauBxCollection>(tau));
95  }
96  }
97  if (jetCheck_) {jetToken_ = consumes<JetBxCollection> (iConfig.getParameter<InputTag>("jetToken"));}
98  if (sumCheck_) {sumToken_ = consumes<EtSumBxCollection> (iConfig.getParameter<InputTag>("sumToken"));}
99  if (muonCheck_) {muonToken_ = consumes<MuonBxCollection> (iConfig.getParameter<InputTag>("muonToken"));}
100 
101  egCount_ = 0;
102  tauCount_ = 0;
103  jetCount_ = 0;
104  sumCount_ = 0;
105  muonCount_ = 0;
106 }
T getParameter(std::string const &) const
edm::EDGetTokenT< MuonBxCollection > muonToken_
Definition: L1TSummary.cc:56
bool sumCheck_
Definition: L1TSummary.cc:47
bool egCheck_
Definition: L1TSummary.cc:44
edm::EDGetTokenT< EtSumBxCollection > sumToken_
Definition: L1TSummary.cc:55
bool muonCheck_
Definition: L1TSummary.cc:48
bool tauCheck_
Definition: L1TSummary.cc:45
bool bxZeroOnly_
Definition: L1TSummary.cc:49
std::vector< edm::EDGetTokenT< TauBxCollection > > tauTokens_
Definition: L1TSummary.cc:53
int muonCount_
Definition: L1TSummary.cc:63
int tauCount_
Definition: L1TSummary.cc:60
int sumCount_
Definition: L1TSummary.cc:62
edm::EDGetTokenT< EGammaBxCollection > egToken_
Definition: L1TSummary.cc:52
int jetCount_
Definition: L1TSummary.cc:61
bool jetCheck_
Definition: L1TSummary.cc:46
edm::EDGetTokenT< JetBxCollection > jetToken_
Definition: L1TSummary.cc:54
int egCount_
Definition: L1TSummary.cc:59
string tag_
Definition: L1TSummary.cc:41
L1TSummary::~L1TSummary ( )

Definition at line 108 of file L1TSummary.cc.

108 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 112 of file L1TSummary.cc.

References gather_cfg::cout, edm::Event::getByToken(), and edm::HandleBase::isValid().

113 {
114 
115  cout << "L1TSummary Module output for " << tag_ << "\n";
116  if (egCheck_){
118  iEvent.getByToken(egToken_, XTMP);
119  if (XTMP.isValid()){
120  cout << "INFO: L1T found e-gamma collection.\n";
121  for (int ibx = XTMP->getFirstBX(); ibx <= XTMP->getLastBX(); ++ibx) {
122  for (auto it=XTMP->begin(ibx); it!=XTMP->end(ibx); it++){
123  if (bxZeroOnly_ && (ibx != 0)) continue;
124  if (it->et() > 0){
125  egCount_++;
126  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
127  }
128  }
129  }
130  } else {
131  LogWarning("MissingProduct") << "L1Upgrade e-gamma's not found." << std::endl;
132  }
133  }
134 
135  if (tauCheck_){
136  for (auto & tautoken: tauTokens_){
138  iEvent.getByToken(tautoken, XTMP);
139  if (XTMP.isValid()){
140  cout << "INFO: L1T found tau collection.\n";
141  for (int ibx = XTMP->getFirstBX(); ibx <= XTMP->getLastBX(); ++ibx) {
142  for (auto it=XTMP->begin(ibx); it!=XTMP->end(ibx); it++){
143  if (it->et() > 0){
144  if (bxZeroOnly_ && (ibx != 0)) continue;
145  tauCount_++;
146  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
147  }
148  }
149  }
150  } else {
151  LogWarning("MissingProduct") << "L1Upgrade tau's not found." << std::endl;
152  }
153  }
154  }
155 
156  if (jetCheck_){
158  iEvent.getByToken(jetToken_, XTMP);
159  if (XTMP.isValid()){
160  cout << "INFO: L1T found jet collection.\n";
161  for (int ibx = XTMP->getFirstBX(); ibx <= XTMP->getLastBX(); ++ibx) {
162  for (auto it=XTMP->begin(ibx); it!=XTMP->end(ibx); it++){
163  if (it->et() > 0) {
164  if (bxZeroOnly_ && (ibx != 0)) continue;
165  jetCount_++;
166  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
167  }
168  }
169  }
170  } else {
171  LogWarning("MissingProduct") << "L1T upgrade jets not found." << std::endl;
172  }
173  }
174 
175  if (sumCheck_){
177  iEvent.getByToken(sumToken_, XTMP);
178  if (XTMP.isValid()){
179  cout << "INFO: L1T found sum collection.\n";
180  for (int ibx = XTMP->getFirstBX(); ibx <= XTMP->getLastBX(); ++ibx) {
181  for (auto it=XTMP->begin(ibx); it!=XTMP->end(ibx); it++){
182  if (it->et() > 0) {
183  if (bxZeroOnly_ && (ibx != 0)) continue;
184  sumCount_++;
185  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
186  }
187  }
188  }
189  } else {
190  LogWarning("MissingProduct") << "L1T upgrade sums not found." << std::endl;
191  }
192  }
193 
194 
195  if (muonCheck_){
197  iEvent.getByToken(muonToken_, XTMP);
198  if (XTMP.isValid()){
199  cout << "INFO: L1T found muon collection.\n";
200  for (int ibx = XTMP->getFirstBX(); ibx <= XTMP->getLastBX(); ++ibx) {
201  for (auto it=XTMP->begin(ibx); it!=XTMP->end(ibx); it++){
202  if (it->et() > 0){
203  if (bxZeroOnly_ && (ibx != 0)) continue;
204  muonCount_++;
205  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi() << "\n";
206  }
207  }
208  }
209  } else {
210  LogWarning("MissingProduct") << "L1T upgrade muons not found." << std::endl;
211  }
212  }
213 
214 
215 
216 
217 
218 }
edm::EDGetTokenT< MuonBxCollection > muonToken_
Definition: L1TSummary.cc:56
bool sumCheck_
Definition: L1TSummary.cc:47
bool egCheck_
Definition: L1TSummary.cc:44
edm::EDGetTokenT< EtSumBxCollection > sumToken_
Definition: L1TSummary.cc:55
bool muonCheck_
Definition: L1TSummary.cc:48
bool tauCheck_
Definition: L1TSummary.cc:45
int iEvent
Definition: GenABIO.cc:230
bool bxZeroOnly_
Definition: L1TSummary.cc:49
std::vector< edm::EDGetTokenT< TauBxCollection > > tauTokens_
Definition: L1TSummary.cc:53
int muonCount_
Definition: L1TSummary.cc:63
int tauCount_
Definition: L1TSummary.cc:60
bool isValid() const
Definition: HandleBase.h:75
int sumCount_
Definition: L1TSummary.cc:62
edm::EDGetTokenT< EGammaBxCollection > egToken_
Definition: L1TSummary.cc:52
int jetCount_
Definition: L1TSummary.cc:61
bool jetCheck_
Definition: L1TSummary.cc:46
edm::EDGetTokenT< JetBxCollection > jetToken_
Definition: L1TSummary.cc:54
tuple cout
Definition: gather_cfg.py:145
int egCount_
Definition: L1TSummary.cc:59
string tag_
Definition: L1TSummary.cc:41
void L1TSummary::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 221 of file L1TSummary.cc.

References gather_cfg::cout.

222 {
223  cout << "INFO: L1TSummary module beginJob called.\n";
224 }
tuple cout
Definition: gather_cfg.py:145
void L1TSummary::beginLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 248 of file L1TSummary.cc.

249 {
250 }
void L1TSummary::beginRun ( Run const &  run,
EventSetup const &  iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 238 of file L1TSummary.cc.

239 {
240 }
void L1TSummary::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 227 of file L1TSummary.cc.

References gather_cfg::cout.

227  {
228  cout << "INFO: L1T Summary for " << tag_ << "\n";
229  cout << "INFO: count of non-zero candidates for each type follows:\n";
230  if (egCheck_) cout << "eg: " << egCount_ << "\n";
231  if (tauCheck_) cout << "tau: " << tauCount_ << "\n";
232  if (jetCheck_) cout << "jet: " << jetCount_ << "\n";
233  if (sumCheck_) cout << "sum: " << sumCount_ << "\n";
234  if (muonCheck_) cout << "muon: " << muonCount_ << "\n";
235 }
bool sumCheck_
Definition: L1TSummary.cc:47
bool egCheck_
Definition: L1TSummary.cc:44
bool muonCheck_
Definition: L1TSummary.cc:48
bool tauCheck_
Definition: L1TSummary.cc:45
int muonCount_
Definition: L1TSummary.cc:63
int tauCount_
Definition: L1TSummary.cc:60
int sumCount_
Definition: L1TSummary.cc:62
int jetCount_
Definition: L1TSummary.cc:61
bool jetCheck_
Definition: L1TSummary.cc:46
tuple cout
Definition: gather_cfg.py:145
int egCount_
Definition: L1TSummary.cc:59
string tag_
Definition: L1TSummary.cc:41
void L1TSummary::endLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 253 of file L1TSummary.cc.

254 {
255 }
void L1TSummary::endRun ( Run const &  ,
EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 243 of file L1TSummary.cc.

244 {
245 }
void L1TSummary::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 258 of file L1TSummary.cc.

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

258  {
259  //The following says we do not know what parameters are allowed so do no validation
260  // Please change this to state exactly what you do use, even if it is no parameters
262  desc.setUnknown();
263  descriptions.addDefault(desc);
264 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

bool L1TSummary::bxZeroOnly_
private

Definition at line 49 of file L1TSummary.cc.

bool L1TSummary::egCheck_
private

Definition at line 44 of file L1TSummary.cc.

int L1TSummary::egCount_
private

Definition at line 59 of file L1TSummary.cc.

edm::EDGetTokenT<EGammaBxCollection> L1TSummary::egToken_
private

Definition at line 52 of file L1TSummary.cc.

bool L1TSummary::jetCheck_
private

Definition at line 46 of file L1TSummary.cc.

int L1TSummary::jetCount_
private

Definition at line 61 of file L1TSummary.cc.

edm::EDGetTokenT<JetBxCollection> L1TSummary::jetToken_
private

Definition at line 54 of file L1TSummary.cc.

bool L1TSummary::muonCheck_
private

Definition at line 48 of file L1TSummary.cc.

int L1TSummary::muonCount_
private

Definition at line 63 of file L1TSummary.cc.

edm::EDGetTokenT<MuonBxCollection> L1TSummary::muonToken_
private

Definition at line 56 of file L1TSummary.cc.

bool L1TSummary::sumCheck_
private

Definition at line 47 of file L1TSummary.cc.

int L1TSummary::sumCount_
private

Definition at line 62 of file L1TSummary.cc.

edm::EDGetTokenT<EtSumBxCollection> L1TSummary::sumToken_
private

Definition at line 55 of file L1TSummary.cc.

string L1TSummary::tag_
private

Definition at line 41 of file L1TSummary.cc.

bool L1TSummary::tauCheck_
private

Definition at line 45 of file L1TSummary.cc.

int L1TSummary::tauCount_
private

Definition at line 60 of file L1TSummary.cc.

std::vector< edm::EDGetTokenT<TauBxCollection> > L1TSummary::tauTokens_
private

Definition at line 53 of file L1TSummary.cc.