CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TGCT.cc
Go to the documentation of this file.
4 
5 // Trigger Headers
6 
7 // GCT and RCT data formats
11 
12 using namespace edm;
13 
14 // Define statics for bins etc.
15 const unsigned int JETETABINS = 22;
16 const float JETETAMIN = -0.5;
17 const float JETETAMAX = 21.5;
18 
19 const unsigned int EMETABINS = 22;
20 const float EMETAMIN = -0.5;
21 const float EMETAMAX = 21.5;
22 
23 const unsigned int METPHIBINS = 72;
24 const float METPHIMIN = -0.5;
25 const float METPHIMAX = 71.5;
26 
27 const unsigned int MHTPHIBINS = 18;
28 const float MHTPHIMIN = -0.5;
29 const float MHTPHIMAX = 17.5;
30 
31 const unsigned int PHIBINS = 18;
32 const float PHIMIN = -0.5;
33 const float PHIMAX = 17.5;
34 
35 const unsigned int OFBINS = 2;
36 const float OFMIN = -0.5;
37 const float OFMAX = 1.5;
38 
39 const unsigned int BXBINS = 5;
40 const float BXMIN = -2.5;
41 const float BXMAX = 2.5;
42 
43 // Bins for 3, 5, 6, 7, 10 and 12 bits
44 const unsigned int R3BINS = 8;
45 const float R3MIN = -0.5;
46 const float R3MAX = 7.5;
47 const unsigned int R5BINS = 32;
48 const float R5MIN = -0.5;
49 const float R5MAX = 31.5;
50 const unsigned int R6BINS = 64;
51 const float R6MIN = -0.5;
52 const float R6MAX = 63.5;
53 const unsigned int R7BINS = 128;
54 const float R7MIN = -0.5;
55 const float R7MAX = 127.5;
56 const unsigned int R12BINS = 4096;
57 const float R12MIN = -0.5;
58 const float R12MAX = 4095.5;
59 
61  monitorDir_(ps.getUntrackedParameter<std::string>("monitorDir","")),
62  gctCenJetsSource_(ps.getParameter<edm::InputTag>("gctCentralJetsSource")),
63  gctForJetsSource_(ps.getParameter<edm::InputTag>("gctForwardJetsSource")),
64  gctTauJetsSource_(ps.getParameter<edm::InputTag>("gctTauJetsSource")),
65  gctIsoTauJetsSource_(ps.getParameter<edm::InputTag>("gctIsoTauJetsSource")),
66  gctEnergySumsSource_(ps.getParameter<edm::InputTag>("gctEnergySumsSource")),
67  gctIsoEmSource_(ps.getParameter<edm::InputTag>("gctIsoEmSource")),
68  gctNonIsoEmSource_(ps.getParameter<edm::InputTag>("gctNonIsoEmSource")),
69  m_stage1_layer2_(ps.getParameter<bool>("stage1_layer2_")),
70  filterTriggerType_ (ps.getParameter< int >("filterTriggerType"))
71 {
72 
73  // verbosity switch
74  verbose_ = ps.getUntrackedParameter < bool > ("verbose", false);
75 
76  if (verbose_)
77  edm::LogInfo("L1TGCT") << "L1TGCT: constructor...." << std::endl;
78 
79  outputFile_ = ps.getUntrackedParameter < std::string > ("outputFile", "");
80  if (outputFile_.size() != 0) {
81  edm::LogInfo("L1TGCT") << "L1T Monitoring histograms will be saved to "
82  << outputFile_ << std::endl;
83  }
84 
85  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
86  if(disable){
87  outputFile_="";
88  }
89 
90  //set Token(-s)
91  gctIsoEmSourceToken_ = consumes<L1GctEmCandCollection>(ps.getParameter<edm::InputTag>("gctIsoEmSource"));
92  gctNonIsoEmSourceToken_ = consumes<L1GctEmCandCollection>(ps.getParameter<edm::InputTag>("gctNonIsoEmSource"));
93  gctCenJetsSourceToken_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctCentralJetsSource"));
94  gctForJetsSourceToken_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctForwardJetsSource"));
95  gctTauJetsSourceToken_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctTauJetsSource"));
96  if(m_stage1_layer2_ == true){
97  gctIsoTauJetsSourceToken_=consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctIsoTauJetsSource"));
98  }
99  gctEnergySumsSourceToken_ = consumes<L1GctHFRingEtSumsCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
100  l1HFCountsToken_ = consumes<L1GctHFBitCountsCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
101  l1EtMissToken_ = consumes<L1GctEtMissCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
102  l1HtMissToken_ = consumes<L1GctHtMissCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
103  l1EtHadToken_ = consumes<L1GctEtHadCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
104  l1EtTotalToken_ = consumes<L1GctEtTotalCollection>(ps.getParameter<edm::InputTag>("gctEnergySumsSource"));
105 }
106 
108 {
109 }
110 
112 {
113 
114  nev_ = 0;
115 
116  ibooker.setCurrentFolder(monitorDir_);
117 
118  triggerType_ =ibooker.book1D("TriggerType", "TriggerType", 17, -0.5, 16.5);
119 
120  l1GctAllJetsEtEtaPhi_ = ibooker.book2D("AllJetsEtEtaPhi", "CENTRAL AND FORWARD JET E_{T}",JETETABINS, JETETAMIN, JETETAMAX,PHIBINS, PHIMIN, PHIMAX);
121  l1GctCenJetsEtEtaPhi_ = ibooker.book2D("CenJetsEtEtaPhi", "CENTRAL JET E_{T}",JETETABINS, JETETAMIN, JETETAMAX, PHIBINS, PHIMIN, PHIMAX);
122  l1GctForJetsEtEtaPhi_ = ibooker.book2D("ForJetsEtEtaPhi", "FORWARD JET E_{T}", JETETABINS, JETETAMIN, JETETAMAX, PHIBINS, PHIMIN, PHIMAX);
123  l1GctTauJetsEtEtaPhi_ = ibooker.book2D("TauJetsEtEtaPhi", "TAU JET E_{T}", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
124  if (m_stage1_layer2_ == true){
125  l1GctIsoTauJetsEtEtaPhi_ = ibooker.book2D("IsoTauJetsEtEtaPhi", "ISOTAU JET E_{T}", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
126  }
127  l1GctIsoEmRankEtaPhi_ = ibooker.book2D("IsoEmRankEtaPhi", "ISO EM E_{T}", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
128  l1GctNonIsoEmRankEtaPhi_ = ibooker.book2D("NonIsoEmRankEtaPhi", "NON-ISO EM E_{T}", EMETABINS, EMETAMIN, EMETAMAX,PHIBINS, PHIMIN, PHIMAX);
129  l1GctAllJetsOccEtaPhi_ = ibooker.book2D("AllJetsOccEtaPhi", "CENTRAL AND FORWARD JET OCCUPANCY", JETETABINS, JETETAMIN, JETETAMAX, PHIBINS, PHIMIN, PHIMAX);
130  l1GctCenJetsOccEtaPhi_ = ibooker.book2D("CenJetsOccEtaPhi", "CENTRAL JET OCCUPANCY", JETETABINS, JETETAMIN, JETETAMAX, PHIBINS, PHIMIN, PHIMAX);
131  l1GctForJetsOccEtaPhi_ = ibooker.book2D("ForJetsOccEtaPhi", "FORWARD JET OCCUPANCY",JETETABINS, JETETAMIN, JETETAMAX, PHIBINS, PHIMIN, PHIMAX);
132  l1GctTauJetsOccEtaPhi_ = ibooker.book2D("TauJetsOccEtaPhi", "TAU JET OCCUPANCY", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
133  if (m_stage1_layer2_ == true){
134  l1GctIsoTauJetsOccEtaPhi_ = ibooker.book2D("IsoTauJetsOccEtaPhi", "ISOTAU JET OCCUPANCY", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
135  }
136  l1GctIsoEmOccEtaPhi_ = ibooker.book2D("IsoEmOccEtaPhi", "ISO EM OCCUPANCY", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
137  l1GctNonIsoEmOccEtaPhi_ = ibooker.book2D("NonIsoEmOccEtaPhi", "NON-ISO EM OCCUPANCY", EMETABINS, EMETAMIN, EMETAMAX, PHIBINS, PHIMIN, PHIMAX);
138 
139 
140  //HF Ring stuff
141 
142  l1GctHFRing1TowerCountPosEtaNegEta_ = ibooker.book2D("HFRing1TowerCountCorr", "HF RING1 TOWER COUNT CORRELATION +/- #eta", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
143  l1GctHFRing2TowerCountPosEtaNegEta_ = ibooker.book2D("HFRing2TowerCountCorr", "HF RING2 TOWER COUNT CORRELATION +/- #eta", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
144 
145  l1GctHFRing1TowerCountPosEta_ = ibooker.book1D("HFRing1TowerCountPosEta", "HF RING1 TOWER COUNT #eta +", R3BINS, R3MIN, R3MAX);
146  l1GctHFRing1TowerCountNegEta_ = ibooker.book1D("HFRing1TowerCountNegEta", "HF RING1 TOWER COUNT #eta -", R3BINS, R3MIN, R3MAX);
147  l1GctHFRing2TowerCountPosEta_ = ibooker.book1D("HFRing2TowerCountPosEta", "HF RING2 TOWER COUNT #eta +", R3BINS, R3MIN, R3MAX);
148  l1GctHFRing2TowerCountNegEta_ = ibooker.book1D("HFRing2TowerCountNegEta", "HF RING2 TOWER COUNT #eta -", R3BINS, R3MIN, R3MAX);
149 
150  l1GctHFRingTowerCountOccBx_ = ibooker.book2D("HFRingTowerCountOccBx", "HF RING TOWER COUNT PER BX",BXBINS, BXMIN, BXMAX, R3BINS, R3MIN, R3MAX);
151 
152  if (m_stage1_layer2_ == false){
153  l1GctHFRing1PosEtaNegEta_ = ibooker.book2D("HFRing1Corr", "HF RING1 E_{T} CORRELATION +/- #eta", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
154  l1GctHFRing2PosEtaNegEta_ = ibooker.book2D("HFRing2Corr", "HF RING2 E_{T} CORRELATION +/- #eta", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
155  l1GctHFRing1ETSumPosEta_ = ibooker.book1D("HFRing1ETSumPosEta", "HF RING1 E_{T} #eta +", R3BINS, R3MIN, R3MAX);
156  l1GctHFRing1ETSumNegEta_ = ibooker.book1D("HFRing1ETSumNegEta", "HF RING1 E_{T} #eta -", R3BINS, R3MIN, R3MAX);
157  l1GctHFRing2ETSumPosEta_ = ibooker.book1D("HFRing2ETSumPosEta", "HF RING2 E_{T} #eta +", R3BINS, R3MIN, R3MAX);
158  l1GctHFRing2ETSumNegEta_ = ibooker.book1D("HFRing2ETSumNegEta", "HF RING2 E_{T} #eta -", R3BINS, R3MIN, R3MAX);
159  l1GctHFRingETSumOccBx_ = ibooker.book2D("HFRingETSumOccBx", "HF RING E_{T} PER BX",BXBINS, BXMIN, BXMAX, R3BINS, R3MIN, R3MAX);
160  l1GctHFRingRatioPosEta_ = ibooker.book1D("HFRingRatioPosEta", "HF RING E_{T} RATIO #eta +", R5BINS, R5MIN, R5MAX);
161  l1GctHFRingRatioNegEta_ = ibooker.book1D("HFRingRatioNegEta", "HF RING E_{T} RATIO #eta -", R5BINS, R5MIN, R5MAX);
162  }
163 
164  if (m_stage1_layer2_ == true){
165  l1GctHFRing1PosEtaNegEta_ = ibooker.book2D("IsoTau 1 2 Corr", "IsoTau 1 IsoTau 2 E_{T} CORRELATION", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
166  l1GctHFRing2PosEtaNegEta_ = ibooker.book2D("IsoTau 3 4 Corr", "IsoTau 3 IsoTau 4 CORRELATION", R3BINS, R3MIN, R3MAX, R3BINS, R3MIN, R3MAX);
167  l1GctHFRing1ETSumPosEta_ = ibooker.book1D("Iso Tau 1 Et", "Isolated Tau1 E_{T}", 9, -0.5, 8.5);
168  l1GctHFRing1ETSumNegEta_ = ibooker.book1D("Iso Tau 2 Et", "Isolated Tau2 E_{T}", 9, -0.5, 8.5);
169  l1GctHFRing2ETSumPosEta_ = ibooker.book1D("Iso Tau 3 Et", "Isolated Tau3 E_{T}", 9, -0.5, 8.5);
170  l1GctHFRing2ETSumNegEta_ = ibooker.book1D("Iso Tau 4 Et", "Isolated Tau4 E_{T}", 9, -0.5, 8.5);
171  l1GctHFRingETSumOccBx_ = ibooker.book2D("IsoTau HFRingSum OccBx", "Iso Tau PER BX",BXBINS, BXMIN, BXMAX, R3BINS, R3MIN, R3MAX);
172  l1GctHFRingRatioPosEta_ = ibooker.book1D("IsoTau Ratio 1 2", "IsoTau E_{T} RATIO", 9, -0.5, 8.5);
173  l1GctHFRingRatioNegEta_ = ibooker.book1D("IsoTau Ratio 1 2", "IsoTau E_{T} RATIO", 9, -0.5, 8.5);
174  }
175 
176  // Rank histograms
177  l1GctCenJetsRank_ = ibooker.book1D("CenJetsRank", "CENTRAL JET E_{T}", R6BINS, R6MIN, R6MAX);
178  l1GctForJetsRank_ = ibooker.book1D("ForJetsRank", "FORWARD JET E_{T}", R6BINS, R6MIN, R6MAX);
179  l1GctTauJetsRank_ = ibooker.book1D("TauJetsRank", "TAU JET E_{T}", R6BINS, R6MIN, R6MAX);
180  if (m_stage1_layer2_ == true){
181  l1GctIsoTauJetsRank_ = ibooker.book1D("IsoTauJetsRank", "ISOTAU JET E_{T}", R6BINS, R6MIN, R6MAX);
182  }
183  l1GctIsoEmRank_ = ibooker.book1D("IsoEmRank", "ISO EM E_{T}", R6BINS, R6MIN, R6MAX);
184  l1GctNonIsoEmRank_ = ibooker.book1D("NonIsoEmRank", "NON-ISO EM E_{T}", R6BINS, R6MIN, R6MAX);
185 
186  l1GctAllJetsOccRankBx_ = ibooker.book2D("AllJetsOccRankBx","ALL JETS E_{T} PER BX",BXBINS,BXMIN,BXMAX,R6BINS,R6MIN,R6MAX);
187  l1GctAllEmOccRankBx_ = ibooker.book2D("AllEmOccRankBx","ALL EM E_{T} PER BX",BXBINS,BXMIN,BXMAX,R6BINS,R6MIN,R6MAX);
188 
189  // Energy sums
190  l1GctEtMiss_ = ibooker.book1D("EtMiss", "MET", R12BINS, R12MIN, R12MAX);
191  l1GctEtMissPhi_ = ibooker.book1D("EtMissPhi", "MET #phi", METPHIBINS, METPHIMIN, METPHIMAX);
192  l1GctEtMissOf_ = ibooker.book1D("EtMissOf", "MET OVERFLOW", OFBINS, OFMIN, OFMAX);
193  l1GctEtMissOccBx_ = ibooker.book2D("EtMissOccBx","MET PER BX",BXBINS,BXMIN,BXMAX,R12BINS,R12MIN,R12MAX);
194  if (m_stage1_layer2_ == false) {
195  l1GctHtMiss_ = ibooker.book1D("HtMiss", "MHT", R7BINS, R7MIN, R7MAX);
196  l1GctHtMissPhi_ = ibooker.book1D("HtMissPhi", "MHT #phi", MHTPHIBINS, MHTPHIMIN, MHTPHIMAX);
197  l1GctHtMissOf_ = ibooker.book1D("HtMissOf", "MHT OVERFLOW", OFBINS, OFMIN, OFMAX);
198  l1GctHtMissOccBx_ = ibooker.book2D("HtMissOccBx","MHT PER BX",BXBINS,BXMIN,BXMAX,R7BINS,R7MIN,R7MAX);
199  }
200  if (m_stage1_layer2_ == true) {
201  l1GctHtMiss_ = ibooker.book1D("HtMissHtTotal", "MHTHT", R7BINS, R7MIN, R7MAX);
202  l1GctHtMissPhi_ = ibooker.book1D("HtMissHtTotal Phi", "MHTHT #phi", MHTPHIBINS, MHTPHIMIN, MHTPHIMAX);
203  l1GctHtMissOf_ = ibooker.book1D("HtMissHtTotal Of", "MHTHT OVERFLOW", OFBINS, OFMIN, OFMAX);
204  l1GctHtMissOccBx_ = ibooker.book2D("HtMissHtTotal OccBx","MHTHT PER BX",BXBINS,BXMIN,BXMAX,R7BINS,R7MIN,R7MAX);
205  }
206  l1GctEtMissHtMissCorr_ = ibooker.book2D("EtMissHtMissCorr", "MET MHT CORRELATION", R6BINS, R12MIN, R12MAX, R6BINS, R7MIN, R7MAX);
207  l1GctEtMissHtMissCorrPhi_ = ibooker.book2D("EtMissHtMissPhiCorr", "MET MHT #phi CORRELATION", METPHIBINS, METPHIMIN, METPHIMAX, MHTPHIBINS, MHTPHIMIN, MHTPHIMAX);
208  l1GctEtTotal_ = ibooker.book1D("EtTotal", "SUM E_{T}", R12BINS, R12MIN, R12MAX);
209  l1GctEtTotalOf_ = ibooker.book1D("EtTotalOf", "SUM E_{T} OVERFLOW", OFBINS, OFMIN, OFMAX);
210  l1GctEtTotalOccBx_ = ibooker.book2D("EtTotalOccBx","SUM E_{T} PER BX",BXBINS,BXMIN,BXMAX,R12BINS,R12MIN,R12MAX);
211  l1GctEtHad_ = ibooker.book1D("EtHad", "H_{T}", R12BINS, R12MIN, R12MAX);
212  l1GctEtHadOf_ = ibooker.book1D("EtHadOf", "H_{T} OVERFLOW", OFBINS, OFMIN, OFMAX);
213  l1GctEtHadOccBx_ = ibooker.book2D("EtHadOccBx","H_{T} PER BX",BXBINS,BXMIN,BXMAX,R12BINS,R12MIN,R12MAX);
214  l1GctEtTotalEtHadCorr_ = ibooker.book2D("EtTotalEtHadCorr", "Sum E_{T} H_{T} CORRELATION", R6BINS, R12MIN, R12MAX, R6BINS, R12MIN, R12MAX);
215  //}
216 }
217 
218 
219 void L1TGCT::dqmBeginRun(edm::Run const& iRrun, edm::EventSetup const& evSetup) {
220 
221 }
222 
224 
225 }
226 
228 {
229  nev_++;
230  if (verbose_) {
231  edm::LogInfo("L1TGCT") << "L1TGCT: analyze...." << std::endl;
232  }
233 
234 
235  // filter according trigger type
236  // enum ExperimentType {
237  // Undefined = 0,
238  // PhysicsTrigger = 1,
239  // CalibrationTrigger = 2,
240  // RandomTrigger = 3,
241  // Reserved = 4,
242  // TracedEvent = 5,
243  // TestTrigger = 6,
244  // ErrorTrigger = 15
245 
246  // fill a histogram with the trigger type, for normalization fill also last bin
247  // ErrorTrigger + 1
248  double triggerType = static_cast<double> (e.experimentType()) + 0.001;
249  double triggerTypeLast = static_cast<double> (edm::EventAuxiliary::ExperimentType::ErrorTrigger)
250  + 0.001;
251  triggerType_->Fill(triggerType);
252  triggerType_->Fill(triggerTypeLast + 1);
253 
254  // filter only if trigger type is greater than 0, negative values disable filtering
255  if (filterTriggerType_ >= 0) {
256 
257  // now filter, for real data only
258  if (e.isRealData()) {
259  if (!(e.experimentType() == filterTriggerType_)) {
260 
261  edm::LogInfo("L1TGCT") << "\n Event of TriggerType "
262  << e.experimentType() << " rejected" << std::endl;
263  return;
264 
265  }
266  }
267 
268  }
269 
270  // Get all the collections
276  if(m_stage1_layer2_ == true) {
278  e.getByToken(gctIsoTauJetsSourceToken_, l1IsoTauJets);
279  }
286 
287  e.getByToken(gctIsoEmSourceToken_, l1IsoEm);
288  e.getByToken(gctNonIsoEmSourceToken_, l1NonIsoEm);
289  e.getByToken(gctCenJetsSourceToken_, l1CenJets);
290  e.getByToken(gctForJetsSourceToken_, l1ForJets);
291  e.getByToken(gctTauJetsSourceToken_, l1TauJets);
293  e.getByToken(l1HFCountsToken_, l1HFCounts);
294  e.getByToken(l1EtMissToken_, l1EtMiss);
295  e.getByToken(l1HtMissToken_, l1HtMiss);
296  e.getByToken(l1EtHadToken_, l1EtHad);
297  e.getByToken(l1EtTotalToken_, l1EtTotal);
298 
299  // Fill histograms
300 
301  // Central jets
302  if (l1CenJets.isValid()) {
303  for (L1GctJetCandCollection::const_iterator cj = l1CenJets->begin();cj != l1CenJets->end(); cj++) {
304  // only plot central BX
305  if (cj->bx()==0) {
306  l1GctCenJetsRank_->Fill(cj->rank());
307  // only plot eta and phi maps for non-zero candidates
308  if (cj->rank()) {
309  l1GctAllJetsEtEtaPhi_->Fill(cj->regionId().ieta(),cj->regionId().iphi(),cj->rank());
310  l1GctAllJetsOccEtaPhi_->Fill(cj->regionId().ieta(),cj->regionId().iphi());
311  l1GctCenJetsEtEtaPhi_->Fill(cj->regionId().ieta(),cj->regionId().iphi(),cj->rank());
312  l1GctCenJetsOccEtaPhi_->Fill(cj->regionId().ieta(),cj->regionId().iphi());
313  }
314  }
315  if (cj->rank()) l1GctAllJetsOccRankBx_->Fill(cj->bx(),cj->rank()); // for all BX
316  }
317  } else {
318  edm::LogWarning("DataNotFound") << " Could not find l1CenJets label was " << gctCenJetsSource_ ;
319  }
320 
321  // Forward jets
322  if (l1ForJets.isValid()) {
323  for (L1GctJetCandCollection::const_iterator fj = l1ForJets->begin(); fj != l1ForJets->end(); fj++) {
324  // only plot central BX
325  if (fj->bx()==0) {
326  l1GctForJetsRank_->Fill(fj->rank());
327  // only plot eta and phi maps for non-zero candidates
328  if (fj->rank()) {
329  l1GctAllJetsEtEtaPhi_->Fill(fj->regionId().ieta(),fj->regionId().iphi(),fj->rank());
330  l1GctAllJetsOccEtaPhi_->Fill(fj->regionId().ieta(),fj->regionId().iphi());
331  l1GctForJetsEtEtaPhi_->Fill(fj->regionId().ieta(),fj->regionId().iphi(),fj->rank());
332  l1GctForJetsOccEtaPhi_->Fill(fj->regionId().ieta(),fj->regionId().iphi());
333  }
334  }
335  if (fj->rank()) l1GctAllJetsOccRankBx_->Fill(fj->bx(),fj->rank()); // for all BX
336  }
337  } else {
338  edm::LogWarning("DataNotFound") << " Could not find l1ForJets label was " << gctForJetsSource_ ;
339  }
340 
341  // Tau jets
342  if (l1TauJets.isValid()) {
343  for (L1GctJetCandCollection::const_iterator tj = l1TauJets->begin(); tj != l1TauJets->end(); tj++) {
344  // only plot central BX
345  if (tj->bx()==0) {
346  l1GctTauJetsRank_->Fill(tj->rank());
347  // only plot eta and phi maps for non-zero candidates
348  if (tj->rank()) {
349  l1GctTauJetsEtEtaPhi_->Fill(tj->regionId().ieta(),tj->regionId().iphi(),tj->rank());
350  l1GctTauJetsOccEtaPhi_->Fill(tj->regionId().ieta(),tj->regionId().iphi());
351  }
352  }
353  if (tj->rank()) l1GctAllJetsOccRankBx_->Fill(tj->bx(),tj->rank()); // for all BX
354  }
355  } else {
356  edm::LogWarning("DataNotFound") << " Could not find l1TauJets label was " << gctTauJetsSource_ ;
357  }
358 
359  // IsoTau jets
360  if (m_stage1_layer2_ == true) {
362  e.getByToken(gctIsoTauJetsSourceToken_, l1IsoTauJets);
363  if (l1IsoTauJets.isValid()) {
364  for (L1GctJetCandCollection::const_iterator itj = l1IsoTauJets->begin(); itj != l1IsoTauJets->end(); itj++) {
365  // only plot central BX
366  if (itj->bx()==0) {
367  l1GctIsoTauJetsRank_->Fill(itj->rank());
368  // only plot eta and phi maps for non-zero candidates
369  if (itj->rank()) {
370  l1GctIsoTauJetsEtEtaPhi_->Fill(itj->regionId().ieta(),itj->regionId().iphi(),itj->rank());
371  l1GctIsoTauJetsOccEtaPhi_->Fill(itj->regionId().ieta(),itj->regionId().iphi());
372  }
373  }
374  if (itj->rank()) l1GctAllJetsOccRankBx_->Fill(itj->bx(),itj->rank()); // for all BX
375  }
376  } else {
377  edm::LogWarning("DataNotFound") << " Could not find l1IsoTauJets label was " << gctIsoTauJetsSource_ ;
378  }
379  }
380 
381 
382  // Missing ET
383  if (l1EtMiss.isValid()) {
384  for (L1GctEtMissCollection::const_iterator met = l1EtMiss->begin(); met != l1EtMiss->end(); met++) {
385  // only plot central BX
386  if (met->bx()==0) {
387  if (met->overFlow() == 0 && met->et() > 0) {
388  //Avoid problems with met=0 candidates affecting MET_PHI plots
389  l1GctEtMiss_->Fill(met->et());
390  l1GctEtMissPhi_->Fill(met->phi());
391  }
392  l1GctEtMissOf_->Fill(met->overFlow());
393  }
394  if (met->overFlow() == 0 && met->et() > 0) l1GctEtMissOccBx_->Fill(met->bx(),met->et()); // for all BX
395  }
396  } else {
397  edm::LogWarning("DataNotFound") << " Could not find l1EtMiss label was " << gctEnergySumsSource_ ;
398  }
399 
400  // Missing HT
401  if (l1HtMiss.isValid()) {
402  for (L1GctHtMissCollection::const_iterator mht = l1HtMiss->begin(); mht != l1HtMiss->end(); mht++) {
403  // only plot central BX
404  if (mht->bx()==0) {
405  if (mht->overFlow() == 0 && mht->et() > 0) {
406  //Avoid problems with mht=0 candidates affecting MHT_PHI plots
407  l1GctHtMiss_->Fill(mht->et());
408  l1GctHtMissPhi_->Fill(mht->phi());
409  }
410  l1GctHtMissOf_->Fill(mht->overFlow());
411  }
412  if (mht->overFlow() == 0 && mht->et() > 0) l1GctHtMissOccBx_->Fill(mht->bx(),mht->et()); // for all BX
413  }
414  } else {
415  edm::LogWarning("DataNotFound") << " Could not find l1HtMiss label was " << gctEnergySumsSource_ ;
416  }
417 
418  // Missing ET HT correlations
419  if (l1HtMiss.isValid() && l1EtMiss.isValid()) {
420  if (l1HtMiss->size() == l1EtMiss->size()) {
421  for (unsigned i=0; i<l1HtMiss->size(); i++) {
422  if (l1HtMiss->at(i).overFlow() == 0 && l1EtMiss->at(i).overFlow() == 0 &&
423  l1HtMiss->at(i).bx() == 0 && l1EtMiss->at(i).bx() == 0) {
424  // Avoid problems overflows and only plot central BX
425  l1GctEtMissHtMissCorr_->Fill(l1EtMiss->at(i).et(),l1HtMiss->at(i).et());
426  if (l1HtMiss->at(i).et() && l1EtMiss->at(i).et()){ // Don't plot phi if one or other is zero
427  l1GctEtMissHtMissCorrPhi_->Fill(l1EtMiss->at(i).phi(),l1HtMiss->at(i).phi());
428  }
429  }
430  }
431  }
432  } else {
433  edm::LogWarning("DataNotFound") << " Could not find l1EtMiss or l1HtMiss label was " << gctEnergySumsSource_ ;
434  }
435 
436  // HT
437  if (l1EtHad.isValid()) {
438  for (L1GctEtHadCollection::const_iterator ht = l1EtHad->begin(); ht != l1EtHad->end(); ht++) {
439  // only plot central BX
440  if (ht->bx()==0) {
441  l1GctEtHad_->Fill(ht->et());
442  l1GctEtHadOf_->Fill(ht->overFlow());
443  }
444  l1GctEtHadOccBx_->Fill(ht->bx(),ht->et()); // for all BX
445  }
446  } else {
447  edm::LogWarning("DataNotFound") << " Could not find l1EtHad label was " << gctEnergySumsSource_ ;
448  }
449 
450  // Total ET
451  if (l1EtTotal.isValid()) {
452  for (L1GctEtTotalCollection::const_iterator et = l1EtTotal->begin(); et != l1EtTotal->end(); et++) {
453  // only plot central BX
454  if (et->bx()==0) {
455  l1GctEtTotal_->Fill(et->et());
456  l1GctEtTotalOf_->Fill(et->overFlow());
457  }
458  l1GctEtTotalOccBx_->Fill(et->bx(),et->et()); // for all BX
459  }
460  } else {
461  edm::LogWarning("DataNotFound") << " Could not find l1EtTotal label was " << gctEnergySumsSource_ ;
462  }
463 
464  // Total ET HT correlations
465  if (l1EtTotal.isValid() && l1EtHad.isValid()) {
466  if (l1EtTotal->size() == l1EtHad->size()) {
467  for (unsigned i=0; i<l1EtHad->size(); i++) {
468  if (l1EtHad->at(i).overFlow() == 0 && l1EtTotal->at(i).overFlow() == 0 &&
469  l1EtHad->at(i).bx() == 0 && l1EtTotal->at(i).bx() == 0) {
470  // Avoid problems overflows and only plot central BX
471  l1GctEtTotalEtHadCorr_->Fill(l1EtTotal->at(i).et(),l1EtHad->at(i).et());
472  }
473  }
474  }
475  } else {
476  edm::LogWarning("DataNotFound") << " Could not find l1EtTotal or l1EtHad label was " << gctEnergySumsSource_ ;
477  }
478 
479  //HF Ring Et Sums
480  if (l1HFSums.isValid()) {
481  for (L1GctHFRingEtSumsCollection::const_iterator hfs=l1HFSums->begin(); hfs!=l1HFSums->end(); hfs++){
482  // only plot central BX
483  if (hfs->bx()==0) {
484  // Individual ring Et sums
485  l1GctHFRing1ETSumPosEta_->Fill(hfs->etSum(0));
486  l1GctHFRing1ETSumNegEta_->Fill(hfs->etSum(1));
487  l1GctHFRing2ETSumPosEta_->Fill(hfs->etSum(2));
488  l1GctHFRing2ETSumNegEta_->Fill(hfs->etSum(3));
489  // Ratio of ring Et sums
490  if (hfs->etSum(2)!=0) l1GctHFRingRatioPosEta_->Fill((hfs->etSum(0))/(hfs->etSum(2)));
491  if (hfs->etSum(3)!=0) l1GctHFRingRatioNegEta_->Fill((hfs->etSum(1))/(hfs->etSum(3)));
492  // Correlate positive and neagative eta
493  l1GctHFRing1PosEtaNegEta_->Fill(hfs->etSum(0),hfs->etSum(1));
494  l1GctHFRing2PosEtaNegEta_->Fill(hfs->etSum(2),hfs->etSum(3));
495  }
496  // Occupancy vs BX
497  for (unsigned i=0; i<4; i++){
498  l1GctHFRingETSumOccBx_->Fill(hfs->bx(),hfs->etSum(i));
499  }
500  }
501  } else {
502  edm::LogWarning("DataNotFound") << " Could not find l1HFSums label was " << gctEnergySumsSource_ ;
503  }
504 
505  // HF Ring Counts
506  if (l1HFCounts.isValid()) {
507  for (L1GctHFBitCountsCollection::const_iterator hfc=l1HFCounts->begin(); hfc!=l1HFCounts->end(); hfc++){
508  // only plot central BX
509  if (hfc->bx()==0) {
510  // Individual ring counts
511  l1GctHFRing1TowerCountPosEta_->Fill(hfc->bitCount(0));
512  l1GctHFRing1TowerCountNegEta_->Fill(hfc->bitCount(1));
513  l1GctHFRing2TowerCountPosEta_->Fill(hfc->bitCount(2));
514  l1GctHFRing2TowerCountNegEta_->Fill(hfc->bitCount(3));
515  // Correlate positive and negative eta
516  l1GctHFRing1TowerCountPosEtaNegEta_->Fill(hfc->bitCount(0),hfc->bitCount(1));
517  l1GctHFRing2TowerCountPosEtaNegEta_->Fill(hfc->bitCount(2),hfc->bitCount(3));
518  }
519  // Occupancy vs BX
520  for (unsigned i=0; i<4; i++){
521  l1GctHFRingTowerCountOccBx_->Fill(hfc->bx(),hfc->bitCount(i));
522  }
523  }
524  } else {
525  edm::LogWarning("DataNotFound") << " Could not find l1HFCounts label was " << gctEnergySumsSource_ ;
526  }
527 
528  // Isolated EM
529  if (l1IsoEm.isValid()) {
530  for (L1GctEmCandCollection::const_iterator ie=l1IsoEm->begin(); ie!=l1IsoEm->end(); ie++) {
531  // only plot central BX
532  if (ie->bx()==0) {
533  l1GctIsoEmRank_->Fill(ie->rank());
534  // only plot eta and phi maps for non-zero candidates
535  if (ie->rank()){
536  l1GctIsoEmRankEtaPhi_->Fill(ie->regionId().ieta(),ie->regionId().iphi(),ie->rank());
537  l1GctIsoEmOccEtaPhi_->Fill(ie->regionId().ieta(),ie->regionId().iphi());
538  }
539  }
540  if (ie->rank()) l1GctAllEmOccRankBx_->Fill(ie->bx(),ie->rank()); // for all BX
541  }
542  } else {
543  edm::LogWarning("DataNotFound") << " Could not find l1IsoEm label was " << gctIsoEmSource_ ;
544  }
545 
546  // Non-isolated EM
547  if (l1NonIsoEm.isValid()) {
548  for (L1GctEmCandCollection::const_iterator ne=l1NonIsoEm->begin(); ne!=l1NonIsoEm->end(); ne++) {
549  // only plot central BX
550  if (ne->bx()==0) {
551  l1GctNonIsoEmRank_->Fill(ne->rank());
552  // only plot eta and phi maps for non-zero candidates
553  if (ne->rank()){
554  l1GctNonIsoEmRankEtaPhi_->Fill(ne->regionId().ieta(),ne->regionId().iphi(),ne->rank());
555  l1GctNonIsoEmOccEtaPhi_->Fill(ne->regionId().ieta(),ne->regionId().iphi());
556  }
557  }
558  if (ne->rank()) l1GctAllEmOccRankBx_->Fill(ne->bx(),ne->rank()); // for all BX
559  }
560  } else {
561  edm::LogWarning("DataNotFound") << " Could not find l1NonIsoEm label was " << gctNonIsoEmSource_ ;
562  }
563  edm::LogInfo("L1TGCT") << "L1TGCT: end job...." << std::endl;
564  edm::LogInfo("EndJob") << "analyzed " << nev_ << " events";
565 }
566 
567 
const float METPHIMAX
Definition: L1TGCT.cc:25
T getParameter(std::string const &) const
const unsigned int R6BINS
Definition: L1TCompare.cc:71
const unsigned int BXBINS
Definition: L1TGCT.cc:39
T getUntrackedParameter(std::string const &, T const &) const
#define PHIMAX
int i
Definition: DBlmapReader.cc:9
MonitorElement * l1GctHtMiss_
Definition: L1TGCT.h:182
MonitorElement * l1GctEtHad_
Definition: L1TGCT.h:191
MonitorElement * l1GctHtMissPhi_
Definition: L1TGCT.h:183
const unsigned int OFBINS
Definition: L1TGCT.cc:35
edm::InputTag gctEnergySumsSource_
Definition: L1TGCT.h:224
MonitorElement * l1GctHFRing2TowerCountNegEta_
Definition: L1TGCT.h:204
MonitorElement * l1GctEtMissOccBx_
Definition: L1TGCT.h:181
MonitorElement * l1GctCenJetsRank_
Definition: L1TGCT.h:167
MonitorElement * l1GctHFRing1ETSumNegEta_
Definition: L1TGCT.h:206
MonitorElement * l1GctEtTotalEtHadCorr_
Definition: L1TGCT.h:194
MonitorElement * l1GctHFRing1TowerCountPosEta_
Definition: L1TGCT.h:201
const unsigned int EMETABINS
Definition: L1TGCT.cc:19
MonitorElement * l1GctTauJetsEtEtaPhi_
Definition: L1TGCT.h:154
MonitorElement * l1GctHFRingETSumOccBx_
Definition: L1TGCT.h:211
MonitorElement * l1GctNonIsoEmRank_
Definition: L1TGCT.h:172
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
const unsigned int MHTPHIBINS
Definition: L1TGCT.cc:27
const float OFMAX
Definition: L1TGCT.cc:37
MonitorElement * l1GctEtMiss_
Definition: L1TGCT.h:178
std::string monitorDir_
Definition: L1TGCT.h:145
MonitorElement * l1GctHFRing2ETSumNegEta_
Definition: L1TGCT.h:208
MonitorElement * l1GctAllEmOccRankBx_
Definition: L1TGCT.h:175
edm::EDGetTokenT< L1GctJetCandCollection > gctCenJetsSourceToken_
Definition: L1TGCT.h:235
MonitorElement * l1GctEtTotal_
Definition: L1TGCT.h:188
MonitorElement * l1GctHtMissOf_
Definition: L1TGCT.h:184
edm::EDGetTokenT< L1GctHtMissCollection > l1HtMissToken_
Definition: L1TGCT.h:242
MonitorElement * l1GctIsoTauJetsEtEtaPhi_
Definition: L1TGCT.h:155
MonitorElement * l1GctEtHadOccBx_
Definition: L1TGCT.h:193
MonitorElement * l1GctEtTotalOccBx_
Definition: L1TGCT.h:190
edm::InputTag gctIsoTauJetsSource_
Definition: L1TGCT.h:223
bool isRealData() const
Definition: EventBase.h:63
edm::EDGetTokenT< L1GctEtTotalCollection > l1EtTotalToken_
Definition: L1TGCT.h:244
MonitorElement * l1GctHFRingTowerCountOccBx_
Definition: L1TGCT.h:212
MonitorElement * l1GctForJetsRank_
Definition: L1TGCT.h:168
MonitorElement * l1GctTauJetsRank_
Definition: L1TGCT.h:169
MonitorElement * l1GctHFRing2ETSumPosEta_
Definition: L1TGCT.h:207
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
Definition: L1TGCT.cc:223
void Fill(long long x)
edm::InputTag gctCenJetsSource_
Definition: L1TGCT.h:220
L1TGCT(const edm::ParameterSet &ps)
Definition: L1TGCT.cc:60
MonitorElement * l1GctEtMissPhi_
Definition: L1TGCT.h:179
MonitorElement * l1GctCenJetsEtEtaPhi_
Definition: L1TGCT.h:152
virtual void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
Definition: L1TGCT.cc:219
edm::InputTag gctTauJetsSource_
Definition: L1TGCT.h:222
edm::EDGetTokenT< L1GctEmCandCollection > gctIsoEmSourceToken_
Definition: L1TGCT.h:233
MonitorElement * l1GctAllJetsEtEtaPhi_
Definition: L1TGCT.h:151
const float JETETAMAX
Definition: L1TGCT.cc:17
MonitorElement * l1GctHFRing1ETSumPosEta_
Definition: L1TGCT.h:205
const float R6MAX
Definition: L1TCompare.cc:73
edm::EDGetTokenT< L1GctJetCandCollection > gctTauJetsSourceToken_
Definition: L1TGCT.h:237
const unsigned int R3BINS
Definition: L1TGCT.cc:44
edm::EDGetTokenT< L1GctHFBitCountsCollection > l1HFCountsToken_
Definition: L1TGCT.h:240
MonitorElement * l1GctHFRingRatioNegEta_
Definition: L1TGCT.h:210
const float EMETAMIN
Definition: L1TGCT.cc:20
MonitorElement * l1GctCenJetsOccEtaPhi_
Definition: L1TGCT.h:160
MonitorElement * l1GctIsoTauJetsRank_
Definition: L1TGCT.h:170
MonitorElement * l1GctEtMissOf_
Definition: L1TGCT.h:180
MonitorElement * l1GctForJetsEtEtaPhi_
Definition: L1TGCT.h:153
const unsigned int JETETABINS
Definition: L1TGCT.cc:15
MonitorElement * l1GctIsoEmRank_
Definition: L1TGCT.h:171
const float R12MAX
Definition: L1TGCT.cc:58
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * l1GctHtMissOccBx_
Definition: L1TGCT.h:185
void analyze(const edm::Event &e, const edm::EventSetup &c)
Definition: L1TGCT.cc:227
const float R7MAX
Definition: L1TGCT.cc:55
edm::EDGetTokenT< L1GctEmCandCollection > gctNonIsoEmSourceToken_
Definition: L1TGCT.h:234
const float R5MAX
Definition: L1TGCT.cc:49
MonitorElement * l1GctHFRing2TowerCountPosEta_
Definition: L1TGCT.h:203
edm::EDGetTokenT< L1GctEtHadCollection > l1EtHadToken_
Definition: L1TGCT.h:243
const float R12MIN
Definition: L1TGCT.cc:57
MonitorElement * l1GctHFRing2TowerCountPosEtaNegEta_
Definition: L1TGCT.h:200
bool isValid() const
Definition: HandleBase.h:75
edm::InputTag gctIsoEmSource_
Definition: L1TGCT.h:225
#define PHIMIN
MonitorElement * triggerType_
Definition: L1TGCT.h:148
const float OFMIN
Definition: L1TGCT.cc:36
MonitorElement * l1GctEtMissHtMissCorrPhi_
Definition: L1TGCT.h:187
const float MHTPHIMAX
Definition: L1TGCT.cc:29
const float R5MIN
Definition: L1TGCT.cc:48
MonitorElement * l1GctNonIsoEmOccEtaPhi_
Definition: L1TGCT.h:165
const float MHTPHIMIN
Definition: L1TGCT.cc:28
int filterTriggerType_
Definition: L1TGCT.h:230
const unsigned int R7BINS
Definition: L1TGCT.cc:53
const float R6MIN
Definition: L1TCompare.cc:72
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
edm::InputTag gctForJetsSource_
Definition: L1TGCT.h:221
MonitorElement * l1GctNonIsoEmRankEtaPhi_
Definition: L1TGCT.h:157
int nev_
Definition: L1TGCT.h:214
MonitorElement * l1GctIsoTauJetsOccEtaPhi_
Definition: L1TGCT.h:163
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
bool m_stage1_layer2_
filter TriggerType
Definition: L1TGCT.h:229
MonitorElement * l1GctHFRing1PosEtaNegEta_
Definition: L1TGCT.h:197
const unsigned int R12BINS
Definition: L1TGCT.cc:56
const unsigned int R5BINS
Definition: L1TGCT.cc:47
virtual ~L1TGCT()
Definition: L1TGCT.cc:107
edm::EDGetTokenT< L1GctHFRingEtSumsCollection > gctEnergySumsSourceToken_
Definition: L1TGCT.h:239
MonitorElement * l1GctAllJetsOccEtaPhi_
Definition: L1TGCT.h:159
edm::EDGetTokenT< L1GctJetCandCollection > gctIsoTauJetsSourceToken_
Definition: L1TGCT.h:238
static const int BXMAX
MonitorElement * l1GctHFRingRatioPosEta_
Definition: L1TGCT.h:209
virtual void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
Definition: L1TGCT.cc:111
MonitorElement * l1GctIsoEmRankEtaPhi_
Definition: L1TGCT.h:156
MonitorElement * l1GctHFRing1TowerCountPosEtaNegEta_
Definition: L1TGCT.h:199
const float METPHIMIN
Definition: L1TGCT.cc:24
edm::EventAuxiliary::ExperimentType experimentType() const
Definition: EventBase.h:64
edm::EDGetTokenT< L1GctJetCandCollection > gctForJetsSourceToken_
Definition: L1TGCT.h:236
#define PHIBINS
MonitorElement * l1GctEtHadOf_
Definition: L1TGCT.h:192
std::string outputFile_
Definition: L1TGCT.h:215
MonitorElement * l1GctForJetsOccEtaPhi_
Definition: L1TGCT.h:161
const float EMETAMAX
Definition: L1TGCT.cc:21
MonitorElement * l1GctHFRing1TowerCountNegEta_
Definition: L1TGCT.h:202
edm::EDGetTokenT< L1GctEtMissCollection > l1EtMissToken_
Definition: L1TGCT.h:241
static const int BXMIN
bool verbose_
Definition: L1TGCT.h:216
MonitorElement * l1GctEtTotalOf_
Definition: L1TGCT.h:189
const float R3MAX
Definition: L1TGCT.cc:46
MonitorElement * l1GctAllJetsOccRankBx_
Definition: L1TGCT.h:174
MonitorElement * l1GctEtMissHtMissCorr_
Definition: L1TGCT.h:186
MonitorElement * l1GctHFRing2PosEtaNegEta_
Definition: L1TGCT.h:198
const unsigned int METPHIBINS
Definition: L1TGCT.cc:23
edm::InputTag gctNonIsoEmSource_
Definition: L1TGCT.h:226
MonitorElement * l1GctTauJetsOccEtaPhi_
Definition: L1TGCT.h:162
Definition: Run.h:43
MonitorElement * l1GctIsoEmOccEtaPhi_
Definition: L1TGCT.h:164
const float R3MIN
Definition: L1TGCT.cc:45
const float R7MIN
Definition: L1TGCT.cc:54
const float JETETAMIN
Definition: L1TGCT.cc:16