CMS 3D CMS Logo

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 () override
 
- 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
 
 ~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 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 & 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Member Functions

void analyze (Event const &, EventSetup const &) override
 
void beginJob () override
 
void beginLuminosityBlock (LuminosityBlock const &, EventSetup const &) override
 
void beginRun (Run const &, EventSetup const &) override
 
void endJob () override
 
void endLuminosityBlock (LuminosityBlock const &, EventSetup const &) override
 
void endRun (Run const &, EventSetup const &) override
 

Private Attributes

bool bxZeroOnly_
 
bool egCheck_
 
int egCount_
 
edm::EDGetTokenT< EGammaBxCollectionegToken_
 
bool jetCheck_
 
int jetCount_
 
edm::EDGetTokenT< JetBxCollectionjetToken_
 
bool muonCheck_
 
int muonCount_
 
edm::EDGetTokenT< MuonBxCollectionmuonToken_
 
bool sumCheck_
 
int sumCount_
 
edm::EDGetTokenT< EtSumBxCollectionsumToken_
 
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(), metsig::tau, and nano_cff::taus.

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 ( )
override

Definition at line 108 of file L1TSummary.cc.

108 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 112 of file L1TSummary.cc.

References BXVector< T >::begin(), gather_cfg::cout, BXVector< T >::end(), edm::Event::getByToken(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), 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() << " type: " << it->getType() << "\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 }
const_iterator end(int bx) 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
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:74
int sumCount_
Definition: L1TSummary.cc:62
edm::EDGetTokenT< EGammaBxCollection > egToken_
Definition: L1TSummary.cc:52
int getFirstBX() const
int jetCount_
Definition: L1TSummary.cc:61
bool jetCheck_
Definition: L1TSummary.cc:46
edm::EDGetTokenT< JetBxCollection > jetToken_
Definition: L1TSummary.cc:54
int getLastBX() const
int egCount_
Definition: L1TSummary.cc:59
const_iterator begin(int bx) const
string tag_
Definition: L1TSummary.cc:41
void L1TSummary::beginJob ( void  )
overrideprivatevirtual

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 }
void L1TSummary::beginLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 248 of file L1TSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 238 of file L1TSummary.cc.

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

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
int egCount_
Definition: L1TSummary.cc:59
string tag_
Definition: L1TSummary.cc:41
void L1TSummary::endLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 253 of file L1TSummary.cc.

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

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(), DEFINE_FWK_MODULE, 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.