CMS 3D CMS Logo

L1AnalysisGCT.cc
Go to the documentation of this file.
3 
5 {
6 }
7 
9 {
10  verbose_ = verbose;
11 }
12 
14 {
15 
16 }
20  const edm::Handle < L1GctJetCandCollection > l1IsoTauJets)
21 {
22  // std::cout << "L1IsoTauJets valid: " << l1IsoTauJets.isValid() <<std::endl;
23  // edm::LogAbsolute("L1") << "CCLA: " << l1IsoTauJets.isValid() <<std::endl;
24  // Central jets
25  if ( verbose_ ) {
26  edm::LogInfo("L1Prompt") << "L1NtupleProducer: number of central jets = "
27  << l1CenJets->size() << std::endl;
28  }
29  gct_.CJetSize= l1CenJets->size();//1
30  for (L1GctJetCandCollection::const_iterator cj = l1CenJets->begin();
31  cj != l1CenJets->end(); cj++) {
32  gct_.CJetEta.push_back(cj->regionId().ieta());//2
33  gct_.CJetPhi.push_back(cj->regionId().iphi());//3
34  gct_.CJetRnk.push_back(cj->rank());//4
35  gct_.CJetBx .push_back(cj->bx());//4
36  if ( verbose_ ) {
37  edm::LogInfo("L1Prompt") << "L1NtupleProducer: Central jet "
38  << cj->regionId().iphi() << ", " << cj->regionId().ieta()
39  << ", " << cj->rank() << std::endl;
40  }
41  }
42 
43  // Forward jets
44  if ( verbose_ ) {
45  edm::LogInfo("L1Prompt") << "L1NtupleProducer: number of forward jets = "
46  << l1ForJets->size() << std::endl;
47  }
48  gct_.FJetSize= l1ForJets->size();//5
49  for (L1GctJetCandCollection::const_iterator fj = l1ForJets->begin();
50  fj != l1ForJets->end(); fj++) {
51  gct_.FJetEta.push_back(fj->regionId().ieta());//6
52  gct_.FJetPhi.push_back(fj->regionId().iphi());//7
53  gct_.FJetRnk.push_back(fj->rank());//8
54  gct_.FJetBx .push_back(fj->bx());//8
55  if ( verbose_ ) {
56  edm::LogInfo("L1Prompt") << "L1NtupleProducer: Forward jet "
57  << fj->regionId().iphi() << ", " << fj->regionId().ieta()
58  << ", " << fj->rank() << std::endl;
59  }
60  }
61 
62  // Tau jets
63  if ( verbose_ ) {
64  edm::LogInfo("L1Prompt") << "L1NtupleProducer: number of tau jets = "
65  << l1TauJets->size() << std::endl;
66  }
67  gct_.TJetSize= l1TauJets->size();//9
68  for (L1GctJetCandCollection::const_iterator tj = l1TauJets->begin();
69  tj != l1TauJets->end(); tj++) {
70  //if ( tj->rank() == 0 ) continue;
71  gct_.TJetEta.push_back(tj->regionId().ieta());//10
72  gct_.TJetPhi.push_back(tj->regionId().iphi());//11
73  gct_.TJetRnk.push_back(tj->rank());//12
74  gct_.TJetBx .push_back(tj->bx());//
75  if ( verbose_ ) {
76  edm::LogInfo("L1Prompt") << "L1NtupleProducer: Tau jet "
77  << tj->regionId().iphi() << ", " << tj->regionId().ieta()
78  << ", " << tj->rank() << std::endl;
79  }
80  }
81 
82  // Isolated Tau Jets
83  if (l1IsoTauJets.isValid()){
84 
85  if ( verbose_ ) {
86  edm::LogInfo("L1Prompt") << "L1NtupleProducer: number of isoTau jets = "
87  << l1IsoTauJets->size() << std::endl;
88  }
89  gct_.IsoTJetSize= l1IsoTauJets->size();//9
90  for (L1GctJetCandCollection::const_iterator tj = l1IsoTauJets->begin();
91  tj != l1IsoTauJets->end(); tj++) {
92  //if ( tj->rank() == 0 ) continue;
93  gct_.IsoTJetEta.push_back(tj->regionId().ieta());//10
94  gct_.IsoTJetPhi.push_back(tj->regionId().iphi());//11
95  gct_.IsoTJetRnk.push_back(tj->rank());//12
96  gct_.IsoTJetBx .push_back(tj->bx());//
97  if ( verbose_ ) {
98  edm::LogInfo("L1Prompt") << "L1NtupleProducer: IsoTau jet "
99  << tj->regionId().iphi() << ", " << tj->regionId().ieta()
100  << ", " << tj->rank() << std::endl;
101  }
102  }
103 
104  }
105 
106 }
107 
112 {
113 
114  // Energy sums
115  for (L1GctEtMissCollection::const_iterator etm = l1EtMiss->begin();
116  etm != l1EtMiss->end();
117  ++etm) {
118 
119  gct_.EtMiss.push_back( etm->et() );
120  gct_.EtMissPhi.push_back( etm->phi() );
121  gct_.EtMissBX.push_back( etm->bx() );
122  gct_.EtMissSize++;
123 
124  if ( verbose_ ) {
125  edm::LogInfo("L1Prompt") << "L1NtupleProducer: Et Miss "
126  << etm->et() << ", " << etm->phi()
127  << ", " << etm->bx() << std::endl;
128  }
129  }
130 
131  for (L1GctHtMissCollection::const_iterator htm = l1HtMiss->begin();
132  htm != l1HtMiss->end();
133  ++htm) {
134 
135  gct_.HtMiss.push_back( htm->et() );
136  gct_.HtMissPhi.push_back( htm->phi() );
137  gct_.HtMissBX.push_back( htm->bx() );
138  gct_.HtMissSize++;
139 
140  if ( verbose_ ) {
141  edm::LogInfo("L1Prompt") << "L1NtupleProducer: Ht Miss "
142  << htm->et() << ", " << htm->phi()
143  << ", " << htm->bx() << std::endl;
144  }
145  }
146 
147  for (L1GctEtHadCollection::const_iterator ht = l1EtHad->begin();
148  ht != l1EtHad->end();
149  ++ht) {
150 
151  gct_.EtHad.push_back( ht->et() );
152  gct_.EtHadBX.push_back( ht->bx() );
153  gct_.EtHadSize++;
154 
155  if ( verbose_ ) {
156  edm::LogInfo("L1Prompt") << "L1NtupleProducer: Ht Total "
157  << ht->et()
158  << ", " << ht->bx() << std::endl;
159  }
160  }
161 
162  for (L1GctEtTotalCollection::const_iterator ett = l1EtTotal->begin();
163  ett != l1EtTotal->end();
164  ++ett) {
165 
166  gct_.EtTot.push_back( ett->et() );
167  gct_.EtTotBX.push_back( ett->bx() );
168  gct_.EtTotSize++;
169 
170  if ( verbose_ ) {
171  edm::LogInfo("L1Prompt") << "L1NtupleProducer: Et Total "
172  << ett->et()
173  << ", " << ett->bx() << std::endl;
174  }
175  }
176 
177 }
178 
181 {
182 
183  //Fill HF Ring Histograms
184  gct_.HFRingEtSumSize=l1HFSums->size();
185  int ies=0;
186  for (L1GctHFRingEtSumsCollection::const_iterator hfs=l1HFSums->begin(); hfs!=l1HFSums->end(); hfs++){
187  gct_.HFRingEtSumEta.push_back(hfs->etSum(ies));
188  if ( verbose_ ) {
189  edm::LogInfo("L1Prompt") << "L1NtupleProducer: HF Sums "
190  << l1HFSums->size() << ", " << hfs->etSum(ies) << std::endl;
191  }
192  ies++;
193  }
194 
195  int ibc=0;
196  gct_.HFBitCountsSize=l1HFCounts->size();
197  for (L1GctHFBitCountsCollection::const_iterator hfc=l1HFCounts->begin(); hfc!=l1HFCounts->end(); hfc++){
198  gct_.HFBitCountsEta.push_back(hfc->bitCount(ibc));
199  if ( verbose_ ) {
200  edm::LogInfo("L1Prompt") << "L1NtupleProducer: HF Counts "
201  << l1HFCounts->size() << ", " << hfc->bitCount(ibc) << std::endl;
202  }
203  ibc++;
204  }
205 
206 }
207 
209  const edm::Handle < L1GctEmCandCollection > l1NonIsoEm)
210 {
211 
212  // Isolated EM
213  if ( verbose_ ) {
214  edm::LogInfo("L1Prompt") << "L1TGCT: number of iso em cands: "
215  << l1IsoEm->size() << std::endl;
216  }
217 
218  gct_.IsoEmSize = l1IsoEm->size();
219  for (L1GctEmCandCollection::const_iterator ie=l1IsoEm->begin(); ie!=l1IsoEm->end(); ie++) {
220 
221  gct_.IsoEmEta.push_back(ie->regionId().ieta());
222  gct_.IsoEmPhi.push_back(ie->regionId().iphi());
223  gct_.IsoEmRnk.push_back(ie->rank());
224  gct_.IsoEmBx.push_back(ie->bx());
225  }
226 
227  // Non-isolated EM
228  if ( verbose_ ) {
229  edm::LogInfo("L1Prompt") << "L1TGCT: number of non-iso em cands: "
230  << l1NonIsoEm->size() << std::endl;
231  }
232  gct_.NonIsoEmSize = l1NonIsoEm->size();
233 
234  for (L1GctEmCandCollection::const_iterator ne=l1NonIsoEm->begin(); ne!=l1NonIsoEm->end(); ne++) {
235  gct_.NonIsoEmEta.push_back(ne->regionId().ieta());
236  gct_.NonIsoEmPhi.push_back(ne->regionId().iphi());
237  gct_.NonIsoEmRnk.push_back(ne->rank());
238  gct_.NonIsoEmBx.push_back(ne->bx());
239 
240  }
241 
242 }
243 
244 
void SetHFminbias(const edm::Handle< L1GctHFRingEtSumsCollection > l1HFSums, const edm::Handle< L1GctHFBitCountsCollection > l1HFCounts)
void SetEm(const edm::Handle< L1GctEmCandCollection > l1IsoEm, const edm::Handle< L1GctEmCandCollection > l1NonIsoEm)
static int verbose
L1AnalysisGCTDataFormat gct_
Definition: L1AnalysisGCT.h:46
bool isValid() const
Definition: HandleBase.h:74
void SetES(const edm::Handle< L1GctEtMissCollection > l1EtMiss, const edm::Handle< L1GctHtMissCollection > l1HtMiss, const edm::Handle< L1GctEtHadCollection > l1EtHad, const edm::Handle< L1GctEtTotalCollection > l1EtTotal)
void SetJet(const edm::Handle< L1GctJetCandCollection > l1CenJets, const edm::Handle< L1GctJetCandCollection > l1ForJets, const edm::Handle< L1GctJetCandCollection > l1TauJets, const edm::Handle< L1GctJetCandCollection > l1IsoTauJets)