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:

Public Member Functions

 L1TSummary (const ParameterSet &)
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (Event const &, EventSetup const &) override
 
void beginJob () override
 
void endJob () 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_
 

Detailed Description

Definition at line 23 of file L1TSummary.cc.

Constructor & Destructor Documentation

◆ L1TSummary()

L1TSummary::L1TSummary ( const ParameterSet iConfig)
explicit

Definition at line 60 of file L1TSummary.cc.

References edm::ParameterSet::getParameter(), and Tau3MuMonitor_cff::taus.

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

Member Function Documentation

◆ analyze()

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

Definition at line 108 of file L1TSummary.cc.

References BXVector< T >::begin(), gather_cfg::cout, BXVector< T >::end(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), iEvent, and edm::HandleBase::isValid().

108  {
109  cout << "L1TSummary Module output for " << tag_ << "\n";
110  if (egCheck_) {
112  iEvent.getByToken(egToken_, XTMP);
113  if (XTMP.isValid()) {
114  cout << "INFO: L1T found e-gamma collection.\n";
115  for (int ibx = XTMP->getFirstBX(); ibx <= XTMP->getLastBX(); ++ibx) {
116  for (auto it = XTMP->begin(ibx); it != XTMP->end(ibx); it++) {
117  if (bxZeroOnly_ && (ibx != 0))
118  continue;
119  if (it->et() > 0) {
120  egCount_++;
121  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi()
122  << "\n";
123  }
124  }
125  }
126  } else {
127  LogWarning("MissingProduct") << "L1Upgrade e-gamma's not found." << std::endl;
128  }
129  }
130 
131  if (tauCheck_) {
132  for (auto& tautoken : tauTokens_) {
134  iEvent.getByToken(tautoken, XTMP);
135  if (XTMP.isValid()) {
136  cout << "INFO: L1T found tau collection.\n";
137  for (int ibx = XTMP->getFirstBX(); ibx <= XTMP->getLastBX(); ++ibx) {
138  for (auto it = XTMP->begin(ibx); it != XTMP->end(ibx); it++) {
139  if (it->et() > 0) {
140  if (bxZeroOnly_ && (ibx != 0))
141  continue;
142  tauCount_++;
143  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi()
144  << "\n";
145  }
146  }
147  }
148  } else {
149  LogWarning("MissingProduct") << "L1Upgrade tau's not found." << std::endl;
150  }
151  }
152  }
153 
154  if (jetCheck_) {
156  iEvent.getByToken(jetToken_, XTMP);
157  if (XTMP.isValid()) {
158  cout << "INFO: L1T found jet collection.\n";
159  for (int ibx = XTMP->getFirstBX(); ibx <= XTMP->getLastBX(); ++ibx) {
160  for (auto it = XTMP->begin(ibx); it != XTMP->end(ibx); it++) {
161  if (it->et() > 0) {
162  if (bxZeroOnly_ && (ibx != 0))
163  continue;
164  jetCount_++;
165  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi()
166  << "\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))
184  continue;
185  sumCount_++;
186  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi()
187  << " type: " << it->getType() << "\n";
188  //}
189  }
190  }
191  } else {
192  LogWarning("MissingProduct") << "L1T upgrade sums not found." << std::endl;
193  }
194  }
195 
196  if (muonCheck_) {
198  iEvent.getByToken(muonToken_, XTMP);
199  if (XTMP.isValid()) {
200  cout << "INFO: L1T found muon collection.\n";
201  for (int ibx = XTMP->getFirstBX(); ibx <= XTMP->getLastBX(); ++ibx) {
202  for (auto it = XTMP->begin(ibx); it != XTMP->end(ibx); it++) {
203  if (it->et() > 0) {
204  if (bxZeroOnly_ && (ibx != 0))
205  continue;
206  muonCount_++;
207  cout << "bx: " << ibx << " et: " << it->et() << " eta: " << it->eta() << " phi: " << it->phi()
208  << "\n";
209  }
210  }
211  }
212  } else {
213  LogWarning("MissingProduct") << "L1T upgrade muons not found." << std::endl;
214  }
215  }
216 }
int getLastBX() const
int getFirstBX() const
edm::EDGetTokenT< MuonBxCollection > muonToken_
Definition: L1TSummary.cc:50
bool sumCheck_
Definition: L1TSummary.cc:41
bool egCheck_
Definition: L1TSummary.cc:38
edm::EDGetTokenT< EtSumBxCollection > sumToken_
Definition: L1TSummary.cc:49
bool muonCheck_
Definition: L1TSummary.cc:42
bool tauCheck_
Definition: L1TSummary.cc:39
const_iterator begin(int bx) const
int iEvent
Definition: GenABIO.cc:224
bool bxZeroOnly_
Definition: L1TSummary.cc:43
std::vector< edm::EDGetTokenT< TauBxCollection > > tauTokens_
Definition: L1TSummary.cc:47
int muonCount_
Definition: L1TSummary.cc:57
int tauCount_
Definition: L1TSummary.cc:54
int sumCount_
Definition: L1TSummary.cc:56
edm::EDGetTokenT< EGammaBxCollection > egToken_
Definition: L1TSummary.cc:46
int jetCount_
Definition: L1TSummary.cc:55
bool isValid() const
Definition: HandleBase.h:70
bool jetCheck_
Definition: L1TSummary.cc:40
const_iterator end(int bx) const
edm::EDGetTokenT< JetBxCollection > jetToken_
Definition: L1TSummary.cc:48
Log< level::Warning, false > LogWarning
int egCount_
Definition: L1TSummary.cc:53
string tag_
Definition: L1TSummary.cc:35

◆ beginJob()

void L1TSummary::beginJob ( void  )
overrideprivate

Definition at line 218 of file L1TSummary.cc.

References gather_cfg::cout.

218 { cout << "INFO: L1TSummary module beginJob called.\n"; }

◆ endJob()

void L1TSummary::endJob ( void  )
overrideprivate

Definition at line 220 of file L1TSummary.cc.

References gather_cfg::cout.

220  {
221  cout << "INFO: L1T Summary for " << tag_ << "\n";
222  cout << "INFO: count of non-zero candidates for each type follows:\n";
223  if (egCheck_)
224  cout << "eg: " << egCount_ << "\n";
225  if (tauCheck_)
226  cout << "tau: " << tauCount_ << "\n";
227  if (jetCheck_)
228  cout << "jet: " << jetCount_ << "\n";
229  if (sumCheck_)
230  cout << "sum: " << sumCount_ << "\n";
231  if (muonCheck_)
232  cout << "muon: " << muonCount_ << "\n";
233 }
bool sumCheck_
Definition: L1TSummary.cc:41
bool egCheck_
Definition: L1TSummary.cc:38
bool muonCheck_
Definition: L1TSummary.cc:42
bool tauCheck_
Definition: L1TSummary.cc:39
int muonCount_
Definition: L1TSummary.cc:57
int tauCount_
Definition: L1TSummary.cc:54
int sumCount_
Definition: L1TSummary.cc:56
int jetCount_
Definition: L1TSummary.cc:55
bool jetCheck_
Definition: L1TSummary.cc:40
int egCount_
Definition: L1TSummary.cc:53
string tag_
Definition: L1TSummary.cc:35

◆ fillDescriptions()

void L1TSummary::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 235 of file L1TSummary.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

235  {
236  //The following says we do not know what parameters are allowed so do no validation
237  // Please change this to state exactly what you do use, even if it is no parameters
239  desc.setUnknown();
240  descriptions.addDefault(desc);
241 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ bxZeroOnly_

bool L1TSummary::bxZeroOnly_
private

Definition at line 43 of file L1TSummary.cc.

◆ egCheck_

bool L1TSummary::egCheck_
private

Definition at line 38 of file L1TSummary.cc.

◆ egCount_

int L1TSummary::egCount_
private

Definition at line 53 of file L1TSummary.cc.

◆ egToken_

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

Definition at line 46 of file L1TSummary.cc.

◆ jetCheck_

bool L1TSummary::jetCheck_
private

Definition at line 40 of file L1TSummary.cc.

◆ jetCount_

int L1TSummary::jetCount_
private

Definition at line 55 of file L1TSummary.cc.

◆ jetToken_

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

Definition at line 48 of file L1TSummary.cc.

◆ muonCheck_

bool L1TSummary::muonCheck_
private

Definition at line 42 of file L1TSummary.cc.

◆ muonCount_

int L1TSummary::muonCount_
private

Definition at line 57 of file L1TSummary.cc.

◆ muonToken_

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

Definition at line 50 of file L1TSummary.cc.

◆ sumCheck_

bool L1TSummary::sumCheck_
private

Definition at line 41 of file L1TSummary.cc.

◆ sumCount_

int L1TSummary::sumCount_
private

Definition at line 56 of file L1TSummary.cc.

◆ sumToken_

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

Definition at line 49 of file L1TSummary.cc.

◆ tag_

string L1TSummary::tag_
private

Definition at line 35 of file L1TSummary.cc.

◆ tauCheck_

bool L1TSummary::tauCheck_
private

Definition at line 39 of file L1TSummary.cc.

◆ tauCount_

int L1TSummary::tauCount_
private

Definition at line 54 of file L1TSummary.cc.

◆ tauTokens_

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

Definition at line 47 of file L1TSummary.cc.