CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
myJetAna.cc
Go to the documentation of this file.
1 // myJetAna.cc
2 // Description: Access Cruzet Data
3 // Author: Frank Chlebana
4 // Date: 24 - July - 2008
5 //
13 
16 
20 
25 
32 
37 
39 
42 
45 
46 // #include "DataFormats/PhotonReco/interface/PhotonFwd.h"
47 // #include "DataFormats/PhotonReco/interface/Photon.h"
48 
49 
52 // #include "DataFormats/HepMCCandidate/interface/GenParticleCandidate.h"
54 // #include "FWCore/Framework/interface/Handle.h"
56 // #include "FWCore/Framework/interface/EventSetup.h"
58 
60 
62 // #include "FWCore/Common/interface/TriggerNames.h"
66 
67 // #include "DataFormats/Scalers/interface/DcsStatus.h"
68 
69 // include files
72 
74 
75 
78 #include <TROOT.h>
79 #include <TSystem.h>
80 #include <TFile.h>
81 #include <TCanvas.h>
82 #include <cmath>
83 
84 using namespace edm;
85 using namespace reco;
86 using namespace std;
87 
88 
89 #define INVALID 9999.
90 #define DEBUG false
91 #define MAXJETS 100
92 
93 typedef struct RBX_struct {
94  double et;
95  double hadEnergy;
96  double emEnergy;
97  float hcalTime;
98  float ecalTime;
99  int nTowers;
100 } RBX ;
101 
102 typedef struct HPD_struct {
103  double et;
104  double hadEnergy;
105  double emEnergy;
106  double time;
107  float hcalTime;
108  float ecalTime;
109  int nTowers;
110 } HPD ;
111 
112 
113 
114 float totBNC, nBNC[4000];
115 
118 
119 // ************************
120 // ************************
121 
122 // Get the algorithm of the jet collections we will read from the .cfg file
123 // which defines the value of the strings CaloJetAlgorithm and GenJetAlgorithm.
124 
126  CaloJetAlgorithm( cfg.getParameter<string>( "CaloJetAlgorithm" ) ),
127  GenJetAlgorithm( cfg.getParameter<string>( "GenJetAlgorithm" ) ),
128  hcalNoiseSummaryTag_(cfg.getParameter<edm::InputTag>("hcalNoiseSummaryTag"))
129 {
130  theTriggerResultsLabel = cfg.getParameter<edm::InputTag>("TriggerResultsLabel");
131 }
132 
133 
134 // ************************
135 // ************************
136 
138 
139 
140 
142 
143  // --- passed selection cuts
144  h_pt = fs->make<TH1F>( "pt", "Jet p_{T}", 100, 0, 50 );
145  h_ptRBX = fs->make<TH1F>( "ptRBX", "RBX: Jet p_{T}", 100, 0, 50 );
146  h_ptHPD = fs->make<TH1F>( "ptHPD", "HPD: Jet p_{T}", 100, 0, 50 );
147  h_ptTower = fs->make<TH1F>( "ptTower", "Jet p_{T}", 100, 0, 50 );
148  h_et = fs->make<TH1F>( "et", "Jet E_{T}", 100, 0, 50 );
149  h_eta = fs->make<TH1F>( "eta", "Jet #eta", 100, -5, 5 );
150  h_phi = fs->make<TH1F>( "phi", "Jet #phi", 50, -M_PI, M_PI );
151  // ---
152 
153  hitEtaEt = fs->make<TH1F>( "hitEtaEt", "RecHit #eta", 90, -45, 45 );
154  hitEta = fs->make<TH1F>( "hitEta", "RecHit #eta", 90, -45, 45 );
155  hitPhi = fs->make<TH1F>( "hitPhi", "RecHit #phi", 73, 0, 73 );
156 
157  caloEtaEt = fs->make<TH1F>( "caloEtaEt", "CaloTower #eta", 100, -4, 4 );
158  caloEta = fs->make<TH1F>( "caloEta", "CaloTower #eta", 100, -4, 4 );
159  caloPhi = fs->make<TH1F>( "caloPhi", "CaloTower #phi", 50, -M_PI, M_PI );
160 
161  dijetMass = fs->make<TH1F>("dijetMass","DiJet Mass",100,0,100);
162 
163  totEneLeadJetEta1 = fs->make<TH1F>("totEneLeadJetEta1","Total Energy Lead Jet Eta1 1",100,0,100);
164  totEneLeadJetEta2 = fs->make<TH1F>("totEneLeadJetEta2","Total Energy Lead Jet Eta2 1",150,0,150);
165  totEneLeadJetEta3 = fs->make<TH1F>("totEneLeadJetEta3","Total Energy Lead Jet Eta3 1",150,0,150);
166 
167  hadEneLeadJetEta1 = fs->make<TH1F>("hadEneLeadJetEta1","Hadronic Energy Lead Jet Eta1 1",50,0,50);
168  hadEneLeadJetEta2 = fs->make<TH1F>("hadEneLeadJetEta2","Hadronic Energy Lead Jet Eta2 1",100,0,100);
169  hadEneLeadJetEta3 = fs->make<TH1F>("hadEneLeadJetEta3","Hadronic Energy Lead Jet Eta3 1",100,0,100);
170  emEneLeadJetEta1 = fs->make<TH1F>("emEneLeadJetEta1","EM Energy Lead Jet Eta1 1",50,0,50);
171  emEneLeadJetEta2 = fs->make<TH1F>("emEneLeadJetEta2","EM Energy Lead Jet Eta2 1",100,0,100);
172  emEneLeadJetEta3 = fs->make<TH1F>("emEneLeadJetEta3","EM Energy Lead Jet Eta3 1",100,0,100);
173 
174 
175  hadFracEta1 = fs->make<TH1F>("hadFracEta11","Hadronic Fraction Eta1 Jet 1",100,0,1);
176  hadFracEta2 = fs->make<TH1F>("hadFracEta21","Hadronic Fraction Eta2 Jet 1",100,0,1);
177  hadFracEta3 = fs->make<TH1F>("hadFracEta31","Hadronic Fraction Eta3 Jet 1",100,0,1);
178 
179  HFSumEt = fs->make<TH1F>("HFSumEt","HFSumEt",100,0,100);
180  HFMET = fs->make<TH1F>("HFMET", "HFMET",120,0,120);
181 
182  SumEt = fs->make<TH1F>("SumEt","SumEt",100,0,100);
183  MET = fs->make<TH1F>("MET", "MET",120,0,120);
184  OERMET = fs->make<TH1F>("OERMET", "OERMET",120,0,120);
185  METSig = fs->make<TH1F>("METSig", "METSig",100,0,50);
186  MEx = fs->make<TH1F>("MEx", "MEx",100,-20,20);
187  MEy = fs->make<TH1F>("MEy", "MEy",100,-20,20);
188  METPhi = fs->make<TH1F>("METPhi", "METPhi",315,0,3.15);
189  MET_RBX = fs->make<TH1F>("MET_RBX", "MET",100,0,1000);
190  MET_HPD = fs->make<TH1F>("MET_HPD", "MET",100,0,1000);
191  MET_Tower = fs->make<TH1F>("MET_Tower", "MET",100,0,1000);
192 
193  SiClusters = fs->make<TH1F>("SiClusters", "SiClusters",150,0,1500);
194 
195  h_Vx = fs->make<TH1F>("Vx", "Vx",100,-0.5,0.5);
196  h_Vy = fs->make<TH1F>("Vy", "Vy",100,-0.5,0.5);
197  h_Vz = fs->make<TH1F>("Vz", "Vz",100,-20,20);
198  h_VNTrks = fs->make<TH1F>("VNTrks", "VNTrks",10,1,100);
199 
200  h_Trk_pt = fs->make<TH1F>("Trk_pt", "Trk_pt",100,0,20);
201  h_Trk_NTrk = fs->make<TH1F>("Trk_NTrk", "Trk_NTrk",150,0,150);
202 
203  hf_sumTowerAllEx = fs->make<TH1F>("sumTowerAllEx","Tower Ex",100,-1000,1000);
204  hf_sumTowerAllEy = fs->make<TH1F>("sumTowerAllEy","Tower Ey",100,-1000,1000);
205 
206  hf_TowerJetEt = fs->make<TH1F>("TowerJetEt","Tower/Jet Et 1",50,0,1);
207 
208  ETime = fs->make<TH1F>("ETime","Ecal Time",200,-200,200);
209  HTime = fs->make<TH1F>("HTime","Hcal Time",200,-200,200);
210 
211  towerHadEnHB = fs->make<TH1F>("towerHadEnHB" ,"HB: Calo Tower HAD Energy",210,-1,20);
212  towerHadEnHE = fs->make<TH1F>("towerHadEnHE" ,"HE: Calo Tower HAD Energy",510,-1,50);
213  towerHadEnHF = fs->make<TH1F>("towerHadEnHF" ,"HF: Calo Tower HAD Energy",510,-1,50);
214 
215  towerEmEnHB = fs->make<TH1F>("towerEmEnHB" ,"HB: Calo Tower EM Energy",210,-1,20);
216  towerEmEnHE = fs->make<TH1F>("towerEmEnHE" ,"HE: Calo Tower EM Energy",510,-1,50);
217  towerEmEnHF = fs->make<TH1F>("towerEmEnHF" ,"HF: Calo Tower EM Energy",510,-1,50);
218 
219  towerHadEn = fs->make<TH1F>("towerHadEn" ,"Hadronic Energy in Calo Tower",2000,-100,100);
220  towerEmEn = fs->make<TH1F>("towerEmEn" ,"EM Energy in Calo Tower",2000,-100,100);
221  towerOuterEn = fs->make<TH1F>("towerOuterEn" ,"HO Energy in Calo Tower",2000,-100,100);
222 
223  towerEmFrac = fs->make<TH1F>("towerEmFrac","EM Fraction of Energy in Calo Tower",100,-1.,1.);
224 
225  RBX_et = fs->make<TH1F>("RBX_et","ET in RBX",1000,-20,100);
226  RBX_hadEnergy = fs->make<TH1F>("RBX_hadEnergy","Hcal Energy in RBX",1000,-20,100);
227  RBX_hcalTime = fs->make<TH1F>("RBX_hcalTime","Hcal Time in RBX",200,-200,200);
228  RBX_nTowers = fs->make<TH1F>("RBX_nTowers","Number of Towers in RBX",75,0,75);
229  RBX_N = fs->make<TH1F>("RBX_N","Number of RBX",10,0,10);
230 
231  HPD_et = fs->make<TH1F>("HPD_et","ET in HPD",1000,-20,100);
232  HPD_hadEnergy = fs->make<TH1F>("HPD_hadEnergy","Hcal Energy in HPD",1000,-20,100);
233  HPD_hcalTime = fs->make<TH1F>("HPD_hcalTime","Hcal Time in HPD",200,-200,200);
234  HPD_nTowers = fs->make<TH1F>("HPD_nTowers","Number of Towers in HPD",20,0,20);
235  HPD_N = fs->make<TH1F>("HPD_N","Number of HPD",10,0,10);
236 
237  nTowers1 = fs->make<TH1F>("nTowers1","Number of Towers pt 0.5",100,0,200);
238  nTowers2 = fs->make<TH1F>("nTowers2","Number of Towers pt 1.0",100,0,200);
239  nTowers3 = fs->make<TH1F>("nTowers3","Number of Towers pt 1.5",100,0,200);
240  nTowers4 = fs->make<TH1F>("nTowers4","Number of Towers pt 2.0",100,0,200);
241 
242  nTowersLeadJetPt1 = fs->make<TH1F>("nTowersLeadJetPt1","Number of Towers in Lead Jet pt 0.5",100,0,100);
243  nTowersLeadJetPt2 = fs->make<TH1F>("nTowersLeadJetPt2","Number of Towers in Lead Jet pt 1.0",100,0,100);
244  nTowersLeadJetPt3 = fs->make<TH1F>("nTowersLeadJetPt3","Number of Towers in Lead Jet pt 1.5",100,0,100);
245  nTowersLeadJetPt4 = fs->make<TH1F>("nTowersLeadJetPt4","Number of Towers in Lead Jet pt 2.0",100,0,100);
246 
247  h_nCalJets = fs->make<TH1F>( "nCalJets", "Number of CalJets", 20, 0, 20 );
248 
249  HBEneOOT = fs->make<TH1F>( "HBEneOOT", "HBEneOOT", 200, -5, 10 );
250  HEEneOOT = fs->make<TH1F>( "HEEneOOT", "HEEneOOT", 200, -5, 10 );
251  HFEneOOT = fs->make<TH1F>( "HFEneOOT", "HFEneOOT", 200, -5, 10 );
252  HOEneOOT = fs->make<TH1F>( "HOEneOOT", "HOEneOOT", 200, -5, 10 );
253 
254  HBEneOOTTh = fs->make<TH1F>( "HBEneOOTTh", "HBEneOOTTh", 200, -5, 10 );
255  HEEneOOTTh = fs->make<TH1F>( "HEEneOOTTh", "HEEneOOTTh", 200, -5, 10 );
256  HFEneOOTTh = fs->make<TH1F>( "HFEneOOTTh", "HFEneOOTTh", 200, -5, 10 );
257  HOEneOOTTh = fs->make<TH1F>( "HOEneOOTTh", "HOEneOOTTh", 200, -5, 10 );
258 
259  HBEneOOTTh1 = fs->make<TH1F>( "HBEneOOTTh1", "HBEneOOT", 200, -5, 10 );
260  HEEneOOTTh1 = fs->make<TH1F>( "HEEneOOTTh1", "HEEneOOT", 200, -5, 10 );
261  HFEneOOTTh1 = fs->make<TH1F>( "HFEneOOTTh1", "HFEneOOT", 200, -5, 10 );
262  HOEneOOTTh1 = fs->make<TH1F>( "HOEneOOTTh1", "HOEneOOT", 200, -5, 10 );
263 
264  HBEneTThr = fs->make<TH1F>( "HBEneTThr", "HBEneTThr", 105, -5, 100 );
265  HEEneTThr = fs->make<TH1F>( "HEEneTThr", "HEEneTThr", 105, -5, 100 );
266  HFEneTThr = fs->make<TH1F>( "HFEneTThr", "HFEneTThr", 105, -5, 100 );
267 
268 
269  HBEne = fs->make<TH1F>( "HBEne", "HBEne", 205, -5, 200 );
270  HBEneTh = fs->make<TH1F>( "HBEneTh", "HBEneTh", 205, -5, 200 );
271  HBEneTh1 = fs->make<TH1F>( "HBEneTh1", "HBEneTh1", 205, -5, 200 );
272  HBEneX = fs->make<TH1F>( "HBEneX", "HBEneX", 200, -5, 10 );
273  HBEneY = fs->make<TH1F>( "HBEneY", "HBEnedY", 200, -5, 10 );
274  HBTime = fs->make<TH1F>( "HBTime", "HBTime", 200, -100, 100 );
275  HBTimeTh = fs->make<TH1F>( "HBTimeTh", "HBTimeTh", 200, -100, 100 );
276  HBTimeTh1 = fs->make<TH1F>( "HBTimeTh1", "HBTimeTh1", 200, -100, 100 );
277  HBTimeTh2 = fs->make<TH1F>( "HBTimeTh2", "HBTimeTh2", 200, -100, 100 );
278  HBTimeTh3 = fs->make<TH1F>( "HBTimeTh3", "HBTimeTh3", 200, -100, 100 );
279  HBTimeThR = fs->make<TH1F>( "HBTimeThR", "HBTimeThR", 200, -100, 100 );
280  HBTimeTh1R = fs->make<TH1F>( "HBTimeTh1R", "HBTimeTh1R", 200, -100, 100 );
281  HBTimeTh2R = fs->make<TH1F>( "HBTimeTh2R", "HBTimeTh2R", 200, -100, 100 );
282  HBTimeTh3R = fs->make<TH1F>( "HBTimeTh3R", "HBTimeTh3R", 200, -100, 100 );
283 
284  HBTimeFlagged = fs->make<TH1F>( "HBTimeFlagged", "HBTimeFlagged", 200, -100, 100 );
285  HBTimeThFlagged = fs->make<TH1F>( "HBTimeThFlagged", "HBTimeThFlagged", 200, -100, 100 );
286  HBTimeTh1Flagged = fs->make<TH1F>( "HBTimeTh1Flagged", "HBTimeTh1Flagged", 200, -100, 100 );
287  HBTimeTh2Flagged = fs->make<TH1F>( "HBTimeTh2Flagged", "HBTimeTh2Flagged", 200, -100, 100 );
288 
289  HBTimeFlagged2 = fs->make<TH1F>( "HBTimeFlagged2", "HBTimeFlagged2", 200, -100, 100 );
290  HBTimeThFlagged2 = fs->make<TH1F>( "HBTimeThFlagged2", "HBTimeThFlagged2", 200, -100, 100 );
291  HBTimeTh1Flagged2 = fs->make<TH1F>( "HBTimeTh1Flagged2", "HBTimeTh1Flagged2", 200, -100, 100 );
292  HBTimeTh2Flagged2 = fs->make<TH1F>( "HBTimeTh2Flagged2", "HBTimeTh2Flagged2", 200, -100, 100 );
293 
294  HBTimeX = fs->make<TH1F>( "HBTimeX", "HBTimeX", 200, -100, 100 );
295  HBTimeY = fs->make<TH1F>( "HBTimeY", "HBTimeY", 200, -100, 100 );
296  HEEne = fs->make<TH1F>( "HEEne", "HEEne", 205, -5, 200 );
297  HEEneTh = fs->make<TH1F>( "HEEneTh", "HEEneTh", 205, -5, 200 );
298  HEEneTh1 = fs->make<TH1F>( "HEEneTh1", "HEEneTh1", 205, -5, 200 );
299  HEEneX = fs->make<TH1F>( "HEEneX", "HEEneX", 200, -5, 10 );
300  HEEneY = fs->make<TH1F>( "HEEneY", "HEEneY", 200, -5, 10 );
301  HEposEne = fs->make<TH1F>( "HEposEne", "HEposEne", 200, -5, 10 );
302  HEnegEne = fs->make<TH1F>( "HEnegEne", "HEnegEne", 200, -5, 10 );
303  HETime = fs->make<TH1F>( "HETime", "HETime", 200, -100, 100 );
304  HETimeTh = fs->make<TH1F>( "HETimeTh", "HETimeTh", 200, -100, 100 );
305  HETimeTh1 = fs->make<TH1F>( "HETimeTh1", "HETimeTh1", 200, -100, 100 );
306  HETimeTh2 = fs->make<TH1F>( "HETimeTh2", "HETimeTh2", 200, -100, 100 );
307  HETimeTh3 = fs->make<TH1F>( "HETimeTh3", "HETimeTh3", 200, -100, 100 );
308  HETimeThR = fs->make<TH1F>( "HETimeThR", "HETimeThR", 200, -100, 100 );
309  HETimeTh1R = fs->make<TH1F>( "HETimeTh1R", "HETimeTh1R", 200, -100, 100 );
310  HETimeTh2R = fs->make<TH1F>( "HETimeTh2R", "HETimeTh2R", 200, -100, 100 );
311  HETimeTh3R = fs->make<TH1F>( "HETimeTh3R", "HETimeTh3R", 200, -100, 100 );
312 
313  HETimeFlagged = fs->make<TH1F>( "HETimeFlagged", "HETimeFlagged", 200, -100, 100 );
314  HETimeThFlagged = fs->make<TH1F>( "HETimeThFlagged", "HETimeThFlagged", 200, -100, 100 );
315  HETimeTh1Flagged = fs->make<TH1F>( "HETimeTh1Flagged", "HETimeTh1Flagged", 200, -100, 100 );
316  HETimeTh2Flagged = fs->make<TH1F>( "HETimeTh2Flagged", "HETimeTh2Flagged", 200, -100, 100 );
317 
318  HETimeFlagged2 = fs->make<TH1F>( "HETimeFlagged2", "HETimeFlagged2", 200, -100, 100 );
319  HETimeThFlagged2 = fs->make<TH1F>( "HETimeThFlagged2", "HETimeThFlagged2", 200, -100, 100 );
320  HETimeTh1Flagged2 = fs->make<TH1F>( "HETimeTh1Flagged2", "HETimeTh1Flagged2", 200, -100, 100 );
321  HETimeTh2Flagged2 = fs->make<TH1F>( "HETimeTh2Flagged2", "HETimeTh2Flagged2", 200, -100, 100 );
322 
323  HETimeX = fs->make<TH1F>( "HETimeX", "HETimeX", 200, -100, 100 );
324  HETimeY = fs->make<TH1F>( "HETimeY", "HETimeY", 200, -100, 100 );
325  HEposTime = fs->make<TH1F>( "HEposTime", "HEposTime", 200, -100, 100 );
326  HEnegTime = fs->make<TH1F>( "HEnegTime", "HEnegTime", 200, -100, 100 );
327  HOEne = fs->make<TH1F>( "HOEne", "HOEne", 200, -5, 10 );
328  HOEneTh = fs->make<TH1F>( "HOEneTh", "HOEneTh", 200, -5, 10 );
329  HOEneTh1 = fs->make<TH1F>( "HOEneTh1", "HOEneTh1", 200, -5, 10 );
330  HOTime = fs->make<TH1F>( "HOTime", "HOTime", 200, -100, 100 );
331  HOTimeTh = fs->make<TH1F>( "HOTimeTh", "HOTimeTh", 200, -100, 100 );
332 
333  // Histos for separating SiPMs and HPDs in HO:
334  HOSEne = fs->make<TH1F>( "HOSEne", "HOSEne", 12000, -20, 100 );
335  HOSTime = fs->make<TH1F>( "HOSTime", "HOSTime", 200, -100, 100 );
336  HOHEne = fs->make<TH1F>( "HOHEne", "HOHEne", 12000, -20, 100 );
337  HOHTime = fs->make<TH1F>( "HOHTime", "HOHTime", 200, -100, 100 );
338 
339  HOHr0Ene = fs->make<TH1F>( "HOHr0Ene" , "HOHr0Ene", 12000, -20 , 100 );
340  HOHr0Time = fs->make<TH1F>( "HOHr0Time" , "HOHr0Time", 200, -200, 200 );
341  HOHrm1Ene = fs->make<TH1F>( "HOHrm1Ene" , "HOHrm1Ene", 12000, -20 , 100 );
342  HOHrm1Time = fs->make<TH1F>( "HOHrm1Time", "HOHrm1Time", 200, -200, 200 );
343  HOHrm2Ene = fs->make<TH1F>( "HOHrm2Ene" , "HOHrm2Ene", 12000, -20 , 100 );
344  HOHrm2Time = fs->make<TH1F>( "HOHrm2Time", "HOHrm2Time", 200, -200, 200 );
345  HOHrp1Ene = fs->make<TH1F>( "HOHrp1Ene" , "HOHrp1Ene", 12000, -20 , 100 );
346  HOHrp1Time = fs->make<TH1F>( "HOHrp1Time", "HOHrp1Time", 200, -200, 200 );
347  HOHrp2Ene = fs->make<TH1F>( "HOHrp2Ene" , "HOHrp2Ene", 12000, -20 , 100 );
348  HOHrp2Time = fs->make<TH1F>( "HOHrp2Time", "HOHrp2Time", 200, -200, 200 );
349 
350  HBTvsE = fs->make<TH2F>( "HBTvsE", "HBTvsE",305, -5, 300, 100, -100, 100);
351  HETvsE = fs->make<TH2F>( "HETvsE", "HETvsE",305, -5, 300, 100, -100, 100);
352 
353  HFTvsE = fs->make<TH2F>( "HFTvsE", "HFTvsE",305, -5, 300, 100, -100, 100);
354  HFTvsEFlagged = fs->make<TH2F>( "HFTvsEFlagged", "HFTvsEFlagged",305, -5, 300, 100, -100, 100);
355  HFTvsEFlagged2 = fs->make<TH2F>( "HFTvsEFlagged2", "HFTvsEFlagged2",305, -5, 300, 100, -100, 100);
356 
357  HFTvsEThr = fs->make<TH2F>( "HFTvsEThr", "HFTvsEThr",305, -5, 300, 100, -100, 100);
358  HFTvsEFlaggedThr = fs->make<TH2F>( "HFTvsEFlaggedThr", "HFTvsEFlaggedThr",305, -5, 300, 100, -100, 100);
359  HFTvsEFlagged2Thr = fs->make<TH2F>( "HFTvsEFlagged2Thr", "HFTvsEFlagged2Thr",305, -5, 300, 100, -100, 100);
360 
361  HOTvsE = fs->make<TH2F>( "HOTvsE", "HOTvsE",305, -5, 300, 100, -100, 100);
362 
363  HFvsZ = fs->make<TH2F>( "HFvsZ", "HFvsZ",100,-50,50,100,-50,50);
364 
365 
366 
367  HOocc = fs->make<TH2F>( "HOocc", "HOocc",85,-42.5,42.5,70,0.5,70.5);
368  HBocc = fs->make<TH2F>( "HBocc", "HBocc",85,-42.5,42.5,70,0.5,70.5);
369  HEocc = fs->make<TH2F>( "HEocc", "HEocc",85,-42.5,42.5,70,0.5,70.5);
370  HFocc = fs->make<TH2F>( "HFocc", "HFocc",85,-42.5,42.5,70,0.5,70.5);
371  HFoccTime = fs->make<TH2F>( "HFoccTime", "HFoccTime",85,-42.5,42.5,70,0.5,70.5);
372  HFoccFlagged = fs->make<TH2F>( "HFoccFlagged", "HFoccFlagged",85,-42.5,42.5,70,0.5,70.5);
373  HFoccFlagged2 = fs->make<TH2F>( "HFoccFlagged2", "HFoccFlagged2",85,-42.5,42.5,70,0.5,70.5);
374 
375  HFEtaPhiNFlagged = fs->make<TH2F>( "HFEtaPhiNFlagged", "HFEtaPhiNFlagged",85,-42.5,42.5,70,0.5,70.5);
376 
377  // HFEtaFlagged = fs->make<TProfile>( "HFEtaFlagged", "HFEtaFlagged",85,-42.5,42.5,0, 10000);
378  HFEtaFlagged = fs->make<TH1F>( "HFEtaFlagged", "HFEtaFlagged",85,-42.5,42.5);
379  HFEtaFlaggedL = fs->make<TH1F>( "HFEtaFlaggedL", "HFEtaFlaggedL",85,-42.5,42.5);
380  HFEtaFlaggedLN = fs->make<TH1F>( "HFEtaFlaggedLN", "HFEtaFlaggedLN",85,-42.5,42.5);
381  HFEtaFlaggedS = fs->make<TH1F>( "HFEtaFlaggedS", "HFEtaFlaggedS",85,-42.5,42.5);
382  HFEtaFlaggedSN = fs->make<TH1F>( "HFEtaFlaggedSN", "HFEtaFlaggedSN",85,-42.5,42.5);
383 
384  HFEtaNFlagged = fs->make<TProfile>( "HFEtaNFlagged", "HFEtaNFlagged",85,-42.5,42.5,0, 10000);
385 
386  HOoccOOT = fs->make<TH2F>( "HOoccOOT", "HOoccOOT",85,-42.5,42.5,70,0.5,70.5);
387  HBoccOOT = fs->make<TH2F>( "HBoccOOT", "HBoccOOT",85,-42.5,42.5,70,0.5,70.5);
388  HEoccOOT = fs->make<TH2F>( "HEoccOOT", "HEoccOOT",85,-42.5,42.5,70,0.5,70.5);
389  HFoccOOT = fs->make<TH2F>( "HFoccOOT", "HFoccOOT",85,-42.5,42.5,70,0.5,70.5);
390 
391  HFEnePMT0 = fs->make<TH1F>( "HFEnePMT0", "HFEnePMT0", 210, -10, 200 );
392  HFEnePMT1 = fs->make<TH1F>( "HFEnePMT1", "HFEnePMT1", 210, -10, 200 );
393  HFEnePMT2 = fs->make<TH1F>( "HFEnePMT2", "HFEnePMT2", 210, -10, 200 );
394  HFTimePMT0 = fs->make<TH1F>( "HFTimePMT0", "HFTimePMT0", 200, -100, 100 );
395  HFTimePMT1 = fs->make<TH1F>( "HFTimePMT1", "HFTimePMT1", 200, -100, 100 );
396  HFTimePMT2 = fs->make<TH1F>( "HFTimePMT2", "HFTimePMT2", 200, -100, 100 );
397 
398  HFEne = fs->make<TH1F>( "HFEne", "HFEne", 210, -10, 200 );
399  HFEneFlagged = fs->make<TH1F>( "HFEneFlagged", "HFEneFlagged", 210, -10, 200 );
400  HFEneFlagged2 = fs->make<TH1F>( "HFEneFlagged2", "HFEneFlagged2", 210, -10, 200 );
401  HFEneTh = fs->make<TH1F>( "HFEneTh", "HFEneTh", 210, -10, 200 );
402  HFEneTh1 = fs->make<TH1F>( "HFEneTh1", "HFEneTh1", 210, -10, 200 );
403  HFEneP = fs->make<TH1F>( "HFEneP", "HFEneP", 200, -5, 10 );
404  HFEneM = fs->make<TH1F>( "HFEneM", "HFEneM", 200, -5, 10 );
405  HFTime = fs->make<TH1F>( "HFTime", "HFTime", 200, -100, 100 );
406  PMTHits = fs->make<TH1F>( "PMTHits", "PMTHits", 10, 0, 10 );
407  HFTimeFlagged = fs->make<TH1F>( "HFTimeFlagged", "HFTimeFlagged", 200, -100, 100 );
408 
409  HFTimeFlagged2 = fs->make<TH1F>( "HFTimeFlagged2", "HFTimeFlagged2", 200, -100, 100 );
410  HFTimeThFlagged2 = fs->make<TH1F>( "HFTimeThFlagged2", "HFTimeThFlagged2", 200, -100, 100 );
411  HFTimeTh1Flagged2 = fs->make<TH1F>( "HFTimeTh1Flagged2", "HFTimeTh1Flagged2", 200, -100, 100 );
412  HFTimeTh2Flagged2 = fs->make<TH1F>( "HFTimeTh2Flagged2", "HFTimeTh2Flagged2", 200, -100, 100 );
413  HFTimeTh3Flagged2 = fs->make<TH1F>( "HFTimeTh3Flagged2", "HFTimeTh3Flagged2", 200, -100, 100 );
414 
415  HFTimeFlagged3 = fs->make<TH1F>( "HFTimeFlagged3", "HFTimeFlagged3", 200, -100, 100 );
416  HFTimeThFlagged3 = fs->make<TH1F>( "HFTimeThFlagged3", "HFTimeThFlagged3", 200, -100, 100 );
417  HFTimeTh1Flagged3 = fs->make<TH1F>( "HFTimeTh1Flagged3", "HFTimeTh1Flagged3", 200, -100, 100 );
418  HFTimeTh2Flagged3 = fs->make<TH1F>( "HFTimeTh2Flagged3", "HFTimeTh2Flagged3", 200, -100, 100 );
419  HFTimeTh3Flagged3 = fs->make<TH1F>( "HFTimeTh3Flagged3", "HFTimeTh3Flagged3", 200, -100, 100 );
420 
421  HFTimeThFlagged = fs->make<TH1F>( "HFTimeThFlagged", "HFTimeThFlagged", 200, -100, 100 );
422  HFTimeTh2Flagged = fs->make<TH1F>( "HFTimeTh2Flagged", "HFTimeTh2Flagged", 200, -100, 100 );
423  HFTimeTh3Flagged = fs->make<TH1F>( "HFTimeTh3Flagged", "HFTimeTh3Flagged", 200, -100, 100 );
424 
425  HFTimeThFlaggedR = fs->make<TH1F>( "HFTimeThFlaggedR", "HFTimeThFlaggedR", 200, -100, 100 );
426  HFTimeThFlaggedR1 = fs->make<TH1F>( "HFTimeThFlaggedR1", "HFTimeThFlaggedR1", 200, -100, 100 );
427  HFTimeThFlaggedR2 = fs->make<TH1F>( "HFTimeThFlaggedR2", "HFTimeThFlaggedR2", 200, -100, 100 );
428  HFTimeThFlaggedR3 = fs->make<TH1F>( "HFTimeThFlaggedR3", "HFTimeThFlaggedR3", 200, -100, 100 );
429  HFTimeThFlaggedR4 = fs->make<TH1F>( "HFTimeThFlaggedR4", "HFTimeThFlaggedR4", 200, -100, 100 );
430  HFTimeThFlaggedRM = fs->make<TH1F>( "HFTimeThFlaggedRM", "HFTimeThFlaggedRM", 200, -100, 100 );
431  TrkMultFlagged0 = fs->make<TH1F>( "TrkMultFlagged0", "TrkMultFlagged0", 100, 0, 100 );
432  TrkMultFlagged1 = fs->make<TH1F>( "TrkMultFlagged1", "TrkMultFlagged1", 100, 0, 100 );
433  TrkMultFlagged2 = fs->make<TH1F>( "TrkMultFlagged2", "TrkMultFlagged2", 100, 0, 100 );
434  TrkMultFlagged3 = fs->make<TH1F>( "TrkMultFlagged3", "TrkMultFlagged3", 100, 0, 100 );
435  TrkMultFlagged4 = fs->make<TH1F>( "TrkMultFlagged4", "TrkMultFlagged4", 100, 0, 100 );
436  TrkMultFlaggedM = fs->make<TH1F>( "TrkMultFlaggedM", "TrkMultFlaggedM", 100, 0, 100 );
437  HFTimeTh = fs->make<TH1F>( "HFTimeTh", "HFTimeTh", 200, -100, 100 );
438  HFTimeTh1 = fs->make<TH1F>( "HFTimeTh1", "HFTimeTh1", 200, -100, 100 );
439  HFTimeTh2 = fs->make<TH1F>( "HFTimeTh2", "HFTimeTh2", 200, -100, 100 );
440  HFTimeTh3 = fs->make<TH1F>( "HFTimeTh3", "HFTimeTh3", 200, -100, 100 );
441  HFTimeThR = fs->make<TH1F>( "HFTimeThR", "HFTimeThR", 200, -100, 100 );
442  HFTimeTh1R = fs->make<TH1F>( "HFTimeTh1R", "HFTimeTh1R", 200, -100, 100 );
443  HFTimeTh2R = fs->make<TH1F>( "HFTimeTh2R", "HFTimeTh2R", 200, -100, 100 );
444  HFTimeTh3R = fs->make<TH1F>( "HFTimeTh3R", "HFTimeTh3R", 200, -100, 100 );
445  HFTimeP = fs->make<TH1F>( "HFTimeP", "HFTimeP", 100, -100, 50 );
446  HFTimeM = fs->make<TH1F>( "HFTimeM", "HFTimeM", 100, -100, 50 );
447  HFTimePMa = fs->make<TH1F>( "HFTimePMa", "HFTimePMa", 100, -100, 100 );
448  HFTimePM = fs->make<TH1F>( "HFTimePM", "HFTimePM", 100, -100, 100 );
449 
450  // Histos for separating HF long/short fibers:
451  HFLEneAll = fs->make<TH1F>( "HFLEneAll", "HFLEneAll", 210, -10, 200 );
452  HFLEneAllF = fs->make<TH1F>( "HFLEneAllF", "HFLEneAllF", 210, -10, 200 );
453  HFSEneAll = fs->make<TH1F>( "HFSEneAll", "HFSEneAll", 210, -10, 200 );
454  HFSEneAllF = fs->make<TH1F>( "HFSEneAllF", "HFSEneAllF", 210, -10, 200 );
455  HFLEne = fs->make<TH1F>( "HFLEne", "HFLEne", 200, -5, 10 );
456  HFLTime = fs->make<TH1F>( "HFLTime", "HFLTime", 200, -100, 100 );
457  HFSEne = fs->make<TH1F>( "HFSEne", "HFSEne", 200, -5, 10 );
458  HFSTime = fs->make<TH1F>( "HFSTime", "HFSTime", 200, -100, 100 );
459  HFLSRatio = fs->make<TH1F>( "HFLSRatio", "HFLSRatio", 220, -1.1, 1.1 );
460 
461  HFOERatio = fs->make<TH1F>( "HFOERatio", "HFOERatio", 2200, -1.1, 1.1 );
462 
463  HFLvsS = fs->make<TH2F>( "HFLvsS", "HFLvsS",220,-20,200,220,-20,200);
464  HFLEneNoS = fs->make<TH1F>( "HFLEneNoS", "HFLEneNoS", 205, -5, 200 );
465  HFSEneNoL = fs->make<TH1F>( "HFSEneNoL", "HFSEneNoL", 205, -5, 200 );
466  HFLEneNoSFlagged = fs->make<TH1F>( "HFLEneNoSFlagged", "HFLEneNoSFlagged", 205, -5, 200 );
467  HFSEneNoLFlagged = fs->make<TH1F>( "HFSEneNoLFlagged", "HFSEneNoLFlagged", 205, -5, 200 );
468  HFLEneNoSFlaggedN = fs->make<TH1F>( "HFLEneNoSFlaggedN", "HFLEneNoSFlaggedN", 205, -5, 200 );
469  HFSEneNoLFlaggedN = fs->make<TH1F>( "HFSEneNoLFlaggedN", "HFSEneNoLFlaggedN", 205, -5, 200 );
470 
471 
472  EBEne = fs->make<TH1F>( "EBEne", "EBEne", 200, -5, 10 );
473  EBEneTh = fs->make<TH1F>( "EBEneTh", "EBEneTh", 200, -5, 10 );
474  EBEneX = fs->make<TH1F>( "EBEneX", "EBEneX", 200, -5, 10 );
475  EBEneY = fs->make<TH1F>( "EBEneY", "EBEneY", 200, -5, 10 );
476  EBTime = fs->make<TH1F>( "EBTime", "EBTime", 200, -100, 100 );
477  EBTimeTh = fs->make<TH1F>( "EBTimeTh", "EBTimeTh", 200, -100, 100 );
478  EBTimeX = fs->make<TH1F>( "EBTimeX", "EBTimeX", 200, -100, 100 );
479  EBTimeY = fs->make<TH1F>( "EBTimeY", "EBTimeY", 200, -100, 100 );
480  EEEne = fs->make<TH1F>( "EEEne", "EEEne", 200, -5, 10 );
481  EEEneTh = fs->make<TH1F>( "EEEneTh", "EEEneTh", 200, -5, 10 );
482  EEEneX = fs->make<TH1F>( "EEEneX", "EEEneX", 200, -5, 10 );
483  EEEneY = fs->make<TH1F>( "EEEneY", "EEEneY", 200, -5, 10 );
484  EEnegEne = fs->make<TH1F>( "EEnegEne", "EEnegEne", 200, -5, 10 );
485  EEposEne = fs->make<TH1F>( "EEposEne", "EEposEne", 200, -5, 10 );
486  EETime = fs->make<TH1F>( "EETime", "EETime", 200, -100, 100 );
487  EETimeTh = fs->make<TH1F>( "EETimeTh", "EETimeTh", 200, -100, 100 );
488  EETimeX = fs->make<TH1F>( "EETimeX", "EETimeX", 200, -100, 100 );
489  EETimeY = fs->make<TH1F>( "EETimeY", "EETimeY", 200, -100, 100 );
490  EEnegTime = fs->make<TH1F>( "EEnegTime", "EEnegTime", 200, -100, 100 );
491  EEposTime = fs->make<TH1F>( "EEposTime", "EEposTime", 200, -100, 100 );
492 
493  h_nTowersCal = fs->make<TH1F>( "nTowersCal", "N Towers in Jet", 100, 0, 50 );
494  h_EMFracCal = fs->make<TH1F>( "EMFracCal", "EM Fraction in Jet", 100, -1.1, 1.1 );
495  h_ptCal = fs->make<TH1F>( "ptCal", "p_{T} of CalJet", 100, 0, 50 );
496  h_etaCal = fs->make<TH1F>( "etaCal", "#eta of CalJet", 100, -4, 4 );
497  h_phiCal = fs->make<TH1F>( "phiCal", "#phi of CalJet", 50, -M_PI, M_PI );
498 
499  h_nGenJets = fs->make<TH1F>( "nGenJets", "Number of GenJets", 20, 0, 20 );
500 
501  h_ptGen = fs->make<TH1F>( "ptGen", "p_{T} of GenJet", 100, 0, 50 );
502  h_etaGen = fs->make<TH1F>( "etaGen", "#eta of GenJet", 100, -4, 4 );
503  h_phiGen = fs->make<TH1F>( "phiGen", "#phi of GenJet", 50, -M_PI, M_PI );
504 
505  h_ptGenL = fs->make<TH1F>( "ptGenL", "p_{T} of GenJetL", 100, 0, 50 );
506  h_etaGenL = fs->make<TH1F>( "etaGenL", "#eta of GenJetL", 100, -4, 4 );
507  h_phiGenL = fs->make<TH1F>( "phiGenL", "#phi of GenJetL", 50, -M_PI, M_PI );
508 
509  h_jetEt = fs->make<TH1F>( "jetEt", "Total Jet Et", 100, 0, 3000 );
510 
511  h_jet1Pt = fs->make<TH1F>( "jet1Pt", "Jet1 Pt", 100, 0, 1000 );
512  h_jet2Pt = fs->make<TH1F>( "jet2Pt", "Jet2 Pt", 100, 0, 1000 );
513  h_jet1Eta = fs->make<TH1F>( "jet1Eta", "Jet1 Eta", 50, -5, 5 );
514  h_jet2Eta = fs->make<TH1F>( "jet2Eta", "Jet2 Eta", 50, -5, 5 );
515  h_jet1PtHLT = fs->make<TH1F>( "jet1PtHLT", "Jet1 Pt HLT", 100, 0, 1000 );
516 
517  h_TotalUnclusteredEt = fs->make<TH1F>( "TotalUnclusteredEt", "Total Unclustered Et", 100, 0, 500 );
518  h_UnclusteredEt = fs->make<TH1F>( "UnclusteredEt", "Unclustered Et", 100, 0, 50 );
519  h_UnclusteredEts = fs->make<TH1F>( "UnclusteredEts", "Unclustered Et", 100, 0, 2 );
520 
521  h_ClusteredE = fs->make<TH1F>( "ClusteredE", "Clustered E", 200, 0, 20 );
522  h_TotalClusteredE = fs->make<TH1F>( "TotalClusteredE", "Total Clustered E", 200, 0, 100 );
523  h_UnclusteredE = fs->make<TH1F>( "UnclusteredE", "Unclustered E", 200, 0, 20 );
524  h_TotalUnclusteredE = fs->make<TH1F>( "TotalUnclusteredE", "Total Unclustered E", 200, 0, 100 );
525 
526  jetHOEne = fs->make<TH1F>("jetHOEne" ,"HO Energy in Jet",100, 0,100);
527  jetEMFraction = fs->make<TH1F>( "jetEMFraction", "Jet EM Fraction", 100, -1.1, 1.1 );
528  NTowers = fs->make<TH1F>( "NTowers", "Number of Towers", 100, 0, 100 );
529 
530 
531  h_EmEnergy = fs->make<TH2F>( "EmEnergy", "Em Energy", 90, -45, 45, 73, 0, 73 );
532  h_HadEnergy = fs->make<TH2F>( "HadEnergy", "Had Energy", 90, -45, 45, 73, 0, 73 );
533 
534  st_Pt = fs->make<TH1F>( "st_Pt", "Pt", 200, 0, 200 );
535  st_Constituents = fs->make<TH1F>( "st_Constituents", "Constituents", 200, 0, 200 );
536  st_Energy = fs->make<TH1F>( "st_Energy", "Tower Energy", 200, 0, 200 );
537  st_EmEnergy = fs->make<TH1F>( "st_EmEnergy", "Tower EmEnergy", 200, 0, 200 );
538  st_HadEnergy = fs->make<TH1F>( "st_HadEnergy", "Tower HadEnergy", 200, 0, 200 );
539  st_OuterEnergy = fs->make<TH1F>( "st_OuterEnergy", "Tower OuterEnergy", 200, 0, 200 );
540  st_Eta = fs->make<TH1F>( "st_Eta", "Eta", 100, -4, 4 );
541  st_Phi = fs->make<TH1F>( "st_Phi", "Phi", 50, -M_PI, M_PI );
542  st_iEta = fs->make<TH1F>( "st_iEta", "iEta", 60, -30, 30 );
543  st_iPhi = fs->make<TH1F>( "st_iPhi", "iPhi", 80, 0, 80 );
544  st_Frac = fs->make<TH1F>( "st_Frac", "Frac", 100, 0, 1 );
545 
546 
547  EBvHB = fs->make<TH2F>( "EBvHB", "EB vs HB",1000,0,4500000.,1000,0,1000000.);
548  EEvHE = fs->make<TH2F>( "EEvHE", "EE vs HE",1000,0,4500000.,1000,0,200000.);
549 
550  ECALvHCAL = fs->make<TH2F>( "ECALvHCAL", "ECAL vs HCAL",100,0,20000000.,100,-500000,500000.);
551  ECALvHCALEta1 = fs->make<TH2F>( "ECALvHCALEta1", "ECAL vs HCALEta1",100,0,20000000.,100,-500000,500000.);
552  ECALvHCALEta2 = fs->make<TH2F>( "ECALvHCALEta2", "ECAL vs HCALEta2",100,0,20000000.,100,-500000,500000.);
553  ECALvHCALEta3 = fs->make<TH2F>( "ECALvHCALEta3", "ECAL vs HCALEta3",100,0,20000000.,100,-500000,500000.);
554 
555  EMF_Eta = fs->make<TProfile>("EMF_Eta","EMF Eta", 100, -50, 50, 0, 10);
556  EMF_Phi = fs->make<TProfile>("EMF_Phi","EMF Phi", 100, 0, 100, 0, 10);
557  EMF_EtaX = fs->make<TProfile>("EMF_EtaX","EMF EtaX", 100, -50, 50, 0, 10);
558  EMF_PhiX = fs->make<TProfile>("EMF_PhiX","EMF PhiX", 100, 0, 100, 0, 10);
559 
560  HFTimeVsiEtaP = fs->make<TProfile>("HFTimeVsiEtaP","HFTimeVsiEtaP", 13, 28.5, 41.5, -100, 100);
561  HFTimeVsiEtaM = fs->make<TProfile>("HFTimeVsiEtaM","HFTimeVsiEtaM", 13, -41.5, -28.5, -100, 100);
562 
563  HFTimeVsiEtaP5 = fs->make<TProfile>("HFTimeVsiEtaP5","HFTimeVsiEtaP5", 13, 28.5, 41.5, -100, 100);
564  HFTimeVsiEtaM5 = fs->make<TProfile>("HFTimeVsiEtaM5","HFTimeVsiEtaM5", 13, -41.5, -28.5, -100, 100);
565 
566  HFTimeVsiEtaP20 = fs->make<TProfile>("HFTimeVsiEtaP20","HFTimeVsiEtaP20", 13, 28.5, 41.5, -100, 100);
567  HFTimeVsiEtaM20 = fs->make<TProfile>("HFTimeVsiEtaM20","HFTimeVsiEtaM20", 13, -41.5, -28.5, -100, 100);
568 
569  NPass = fs->make<TH1F>( "NPass", "NPass", 3, -1, 1 );
570  NTotal = fs->make<TH1F>( "NTotal", "NTotal", 3, -1, 1 );
571  NTime = fs->make<TH1F>( "NTime", "NTime", 10, 0, 10 );
572 
573 
574  HFRecHitEne = fs->make<TH1F>( "HFRecHitEne", "HFRecHitEne", 300, 0, 3000 );
575  HFRecHitEneClean = fs->make<TH1F>( "HFRecHitEneClean", "HFRecHitEneClean", 300, 0, 3000 );
576  HFRecHitTime = fs->make<TH1F>( "HFRecHitTime", "HFRecHitTime", 120, -60, 60 );
577 
578 
579  HFLongShortPhi = fs->make<TH1F>( "HFLongShortPhi", "HFLongShortPhi", 73, 0, 73 );
580  HFLongShortEta = fs->make<TH1F>( "HFLongShortEta", "HFLongShortEta", 90, -45, 45 );
581  HFLongShortEne = fs->make<TH1F>( "HFLongShortEne", "HFLongShortEne", 300, 0, 3000 );
582  HFLongShortTime = fs->make<TH1F>( "HFLongShortTime", "HFLongShortTime", 120, -60, 60 );
583  HFLongShortNHits = fs->make<TH1F>( "HFLongShortNHits", "HFLongShortNHits", 30, 0, 30 );
584 
585  HFDigiTimePhi = fs->make<TH1F>( "HFDigiTimePhi", "HFDigiTimePhi", 73, 0, 73 );
586  HFDigiTimeEta = fs->make<TH1F>( "HFDigiTimeEta", "HFDigiTimeEta", 90, -45, 45 );
587  HFDigiTimeEne = fs->make<TH1F>( "HFDigiTimeEne", "HFDigiTimeEne", 300, 0, 3000 );
588  HFDigiTimeTime = fs->make<TH1F>( "HFDigiTimeTime", "HFDigiTimeTime", 120, -60, 60 );
589  HFDigiTimeNHits = fs->make<TH1F>( "HFDigiTimeNHits", "HFDigiTimeNHits", 30, 0, 30 );
590 
591 
592  totBNC = 0;
593  for (int i=0; i<4000; i++) nBNC[i] = 0;
594 
595 }
596 
597 // ************************
598 // ************************
599 void myJetAna::analyze( const edm::Event& evt, const edm::EventSetup& es ) {
600 
601  using namespace edm;
602 
603  bool Pass, Pass_HFTime, Pass_DiJet, Pass_BunchCrossing, Pass_Vertex;
604 
605  int EtaOk10, EtaOk13, EtaOk40;
606 
607  double LeadMass;
608 
609  double HFRecHit[100][100][2];
610  int HFRecHitFlag[100][100][2];
611 
612  double towerEtCut, towerECut, towerE;
613 
614  towerEtCut = 1.0;
615  towerECut = 1.0;
616 
617  unsigned int StableRun = 123732;
618 
619  double HBHEThreshold = 2.0;
620  double HFThreshold = 2.0;
621  double HOThreshold = 2.0;
622  double EBEEThreshold = 2.0;
623 
624  double HBHEThreshold1 = 4.0;
625  double HFThreshold1 = 4.0;
626  double HOThreshold1 = 4.0;
627  //double EBEEThreshold1 = 4.0;
628 
629  double HBHEThreshold2 = 10.0;
630  double HFThreshold2 = 10.0;
631  //double HOThreshold2 = 10.0;
632  //double EBEEThreshold2 = 10.0;
633 
634  double HBHEThreshold3 = 40.0;
635  double HFThreshold3 = 40.0;
636  //double HOThreshold3 = 40.0;
637  //double EBEEThreshold3 = 40.0;
638 
639  float minJetPt = 20.;
640  float minJetPt10 = 10.;
641  int jetInd, allJetInd;
642  LeadMass = -1;
643 
644  // Handle<DcsStatusCollection> dcsStatus;
645  // evt.getByLabel("scalersRawToDigi", dcsStatus);
646  // std::cout << dcsStatus << std::endl;
647  // if (dcsStatus.isValid()) {
648  // }
649 
650  // DcsStatus dcsStatus;
651  // Handle<DcsStatus> dcsStatus;
652  // evt.getByLabel("dcsStatus", dcsStatus);
653 
654 
655  math::XYZTLorentzVector p4tmp[2], p4cortmp[2];
656 
657  // --------------------------------------------------------------
658  // --------------------------------------------------------------
659 
660  /***
661  std::cout << ">>>> ANA: Run = " << evt.id().run()
662  << " Event = " << evt.id().event()
663  << " Bunch Crossing = " << evt.bunchCrossing()
664  << " Orbit Number = " << evt.orbitNumber()
665  << " Luminosity Block = " << evt.luminosityBlock()
666  << std::endl;
667  ***/
668 
669  // *********************
670  // *** Filter Event
671  // *********************
672  Pass = false;
673 
674  /***
675  if (evt.bunchCrossing()== 100) {
676  Pass = true;
677  } else {
678  Pass = false;
679  }
680  ***/
681 
682  // ***********************
683  // *** Pass Trigger
684  // ***********************
685 
686 
687  // **** Get the TriggerResults container
690  // evt.getByLabel("TriggerResults::HLT", triggerResults);
691 
692  if (triggerResults.isValid()) {
693  if (DEBUG) std::cout << "trigger valid " << std::endl;
694  // edm::TriggerNames triggerNames; // TriggerNames class
695  // triggerNames.init(*triggerResults);
696  unsigned int n = triggerResults->size();
697  for (unsigned int i=0; i!=n; i++) {
698 
699  /***
700  std::cout << ">>> Trigger Name (" << i << ") = " << triggerNames.triggerName(i)
701  << " Accept = " << triggerResults->accept(i)
702  << std::endl;
703  ***/
704  /****
705  if (triggerResults->accept(i) == 1) {
706  std::cout << "+++ Trigger Name (" << i << ") = " << triggerNames.triggerName(i)
707  << " Accept = " << triggerResults->accept(i)
708  << std::endl;
709  }
710  ****/
711 
712  // if (DEBUG) std::cout << triggerNames.triggerName(i) << std::endl;
713 
714  // if ( (triggerNames.triggerName(i) == "HLT_ZeroBias") ||
715  // (triggerNames.triggerName(i) == "HLT_MinBias") ||
716  // (triggerNames.triggerName(i) == "HLT_MinBiasHcal") ) {
717 
718  }
719 
720  } else {
721 
723  triggerResults = (*tr);
724 
725  // std::cout << "triggerResults is not valid" << std::endl;
726  // std::cout << triggerResults << std::endl;
727  // std::cout << triggerResults.isValid() << std::endl;
728 
729  if (DEBUG) std::cout << "trigger not valid " << std::endl;
730  edm::LogInfo("myJetAna") << "TriggerResults::HLT not found, "
731  "automatically select events";
732 
733  //return;
734  }
735 
736 
737 
738  /***
739  Handle<L1GlobalTriggerReadoutRecord> gtRecord;
740  evt.getByLabel("gtDigis",gtRecord);
741  const TechnicalTriggerWord tWord = gtRecord->technicalTriggerWord();
742 
743  ***/
744 
745 
746  // *************************
747  // *** Pass Bunch Crossing
748  // *************************
749 
750  // *** Check Luminosity Section
751  if (evt.id().run() == 122294)
752  if ( (evt.luminosityBlock() >= 37) && (evt.luminosityBlock() <= 43) )
753  Pass = true;
754  if (evt.id().run() == 122314)
755  if ( (evt.luminosityBlock() >= 24) && (evt.luminosityBlock() <= 37) )
756  Pass = true;
757  if (evt.id().run() == 123575)
758  Pass = true;
759  if (evt.id().run() == 123596)
760  Pass = true;
761 
762  // ***********
763  if (evt.id().run() == 124009) {
764  if ( (evt.bunchCrossing() == 51) ||
765  (evt.bunchCrossing() == 151) ||
766  (evt.bunchCrossing() == 2824) ) {
767  Pass = true;
768  }
769  }
770 
771  if (evt.id().run() == 124020) {
772  if ( (evt.bunchCrossing() == 51) ||
773  (evt.bunchCrossing() == 151) ||
774  (evt.bunchCrossing() == 2824) ) {
775  Pass = true;
776  }
777  }
778 
779  if (evt.id().run() == 124024) {
780  if ( (evt.bunchCrossing() == 51) ||
781  (evt.bunchCrossing() == 151) ||
782  (evt.bunchCrossing() == 2824) ) {
783  Pass = true;
784  }
785  }
786 
787  if ( (evt.bunchCrossing() == 51) ||
788  (evt.bunchCrossing() == 151) ||
789  (evt.bunchCrossing() == 2596) ||
790  (evt.bunchCrossing() == 2724) ||
791  (evt.bunchCrossing() == 2824) ||
792  (evt.bunchCrossing() == 3487) ) {
793  Pass_BunchCrossing = true;
794  } else {
795  Pass_BunchCrossing = false;
796  }
797 
798 
799  // ***********************
800  // *** Pass HF Timing
801  // ***********************
802 
803  double HFM_ETime, HFP_ETime;
804  double HFM_E, HFP_E;
805  double HF_PMM;
806 
807  HFM_ETime = 0.;
808  HFM_E = 0.;
809  HFP_ETime = 0.;
810  HFP_E = 0.;
811 
812  for (int i=0; i<100; i++) {
813  for (int j=0; j<100; j++) {
814  HFRecHit[i][j][0] = -10.;
815  HFRecHit[i][j][1] = -10.;
816  HFRecHitFlag[i][j][0] = 0;
817  HFRecHitFlag[i][j][1] = 0;
818  }
819  }
820 
821 
822  int nTime = 0;
823  int NHFLongShortHits;
824  int NHFDigiTimeHits;
825  NHFLongShortHits = 0;
826  NHFDigiTimeHits = 0;
827 
828  // edm::Handle<reco::VertexCollection> vertexCollection;
829 
830  try {
831  std::vector<edm::Handle<HFRecHitCollection> > colls;
832  evt.getManyByType(colls);
833 
834  std::vector<edm::Handle<HFRecHitCollection> >::iterator i;
835  for (i=colls.begin(); i!=colls.end(); i++) {
836 
837  for (HFRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
838  if (j->id().subdet() == HcalForward) {
839 
840  HFRecHitEne->Fill(j->energy());
841  if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 0) &&
842  (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 0) ) {
843  HFRecHitEneClean->Fill(j->energy());
844  }
845 
846  HFRecHitTime->Fill(j->time());
847 
848  int myFlag;
849  myFlag= j->flagField(HcalCaloFlagLabels::HFLongShort);
850  if (myFlag==1) {
851  NHFLongShortHits++;
852  HFLongShortPhi->Fill(j->id().iphi());
853  HFLongShortEta->Fill(j->id().ieta());
854  HFLongShortEne->Fill(j->energy());
855  HFLongShortTime->Fill(j->time());
856  }
857 
858  myFlag= j->flagField(HcalCaloFlagLabels::HFDigiTime);
859  if (myFlag==1) {
860  NHFDigiTimeHits++;
861  HFDigiTimePhi->Fill(j->id().iphi());
862  HFDigiTimeEta->Fill(j->id().ieta());
863  HFDigiTimeEne->Fill(j->energy());
864  HFDigiTimeTime->Fill(j->time());
865  }
866 
867 
868  float en = j->energy();
869  float time = j->time();
870  if ((en > 20.) && (time>20.)) {
871  HFoccTime->Fill(j->id().ieta(),j->id().iphi());
872  nTime++;
873  }
874  HcalDetId id(j->detid().rawId());
875  int ieta = id.ieta();
876  int iphi = id.iphi();
877  int depth = id.depth();
878 
879 
880  // Long: depth = 1
881  // Short: depth = 2
882  HFRecHit[ieta+41][iphi][depth-1] = en;
883  HFRecHitFlag[ieta+41][iphi][depth-1] = j->flagField(0);
884 
885  /****
886  std::cout << "RecHit Flag = "
887  << j->flagField(0)a
888  << std::endl;
889  ***/
890 
891  if (j->id().ieta()<0) {
892  if (j->energy() > HFThreshold) {
893  HFM_ETime += j->energy()*j->time();
894  HFM_E += j->energy();
895  }
896  } else {
897  if (j->energy() > HFThreshold) {
898  HFP_ETime += j->energy()*j->time();
899  HFP_E += j->energy();
900  }
901  }
902 
903  }
904  }
905  break;
906  }
907  } catch (...) {
908  cout << "No HF RecHits." << endl;
909  }
910 
911  cout << "N HF Hits" << NHFLongShortHits << " " << NHFDigiTimeHits << endl;
912  HFLongShortNHits->Fill(NHFLongShortHits);
913  HFDigiTimeNHits->Fill(NHFDigiTimeHits);
914 
915  NTime->Fill(nTime);
916 
917  double OER = 0, OddEne, EvenEne;
918  int nOdd, nEven;
919 
920  for (int iphi=0; iphi<100; iphi++) {
921  OddEne = EvenEne = 0.;
922  nOdd = 0;
923  nEven = 0;
924  for (int ieta=0; ieta<100; ieta++) {
925  if (HFRecHit[ieta][iphi][0] > 1.0) {
926  if (ieta%2 == 0) {
927  EvenEne += HFRecHit[ieta][iphi][0];
928  nEven++;
929  } else {
930  OddEne += HFRecHit[ieta][iphi][0];
931  nOdd++;
932  }
933  }
934  if (HFRecHit[ieta][iphi][1] > 1.0) {
935  if (ieta%2 == 0) {
936  EvenEne += HFRecHit[ieta][iphi][1];
937  nEven++;
938  } else {
939  OddEne += HFRecHit[ieta][iphi][1];
940  nOdd++;
941  }
942  }
943  }
944  if (((OddEne + EvenEne) > 10.) && (nOdd > 1) && (nEven > 1)) {
945  OER = (OddEne - EvenEne) / (OddEne + EvenEne);
946  HFOERatio->Fill(OER);
947  }
948  }
949 
950  if ((HFP_E > 0.) && (HFM_E > 0.)) {
951  HF_PMM = (HFP_ETime / HFP_E) - (HFM_ETime / HFM_E);
952  HFTimePMa->Fill(HF_PMM);
953  } else {
954  HF_PMM = INVALID;
955  }
956 
957 
958  if (fabs(HF_PMM) < 10.) {
959  Pass_HFTime = true;
960  } else {
961  Pass_HFTime = false;
962  }
963 
964 
965  // **************************
966  // *** Pass DiJet Criteria
967  // **************************
968  double highestPt;
969  double nextPt;
970  // double dphi;
971  int nDiJet, nJet;
972 
973  nJet = 0;
974  nDiJet = 0;
975  highestPt = 0.0;
976  nextPt = 0.0;
977 
978  allJetInd = 0;
981  for( CaloJetCollection::const_iterator cal = caloJets->begin(); cal != caloJets->end(); ++ cal ) {
982 
983  // TODO: verify first two jets are the leading jets
984  if (nJet == 0) p4tmp[0] = cal->p4();
985  if (nJet == 1) p4tmp[1] = cal->p4();
986 
987  if ( (cal->pt() > 3.) &&
988  (fabs(cal->eta()) < 3.0) ) {
989  nDiJet++;
990  }
991  nJet++;
992 
993  }
994 
995 
996  if (nDiJet > 1) {
997  //dphi = deltaPhi(p4tmp[0].phi(), p4tmp[1].phi());
998  Pass_DiJet = true;
999  } else {
1000  // dphi = INVALID;
1001  Pass_DiJet = false;
1002  }
1003 
1004 
1005  // **************************
1006  // *** Pass Vertex
1007  // **************************
1008  double VTX;
1009  int nVTX;
1010 
1012  evt.getByLabel("offlinePrimaryVertices", vertexCollection);
1013  const reco::VertexCollection vC = *(vertexCollection.product());
1014 
1015  // std::cout << "Reconstructed "<< vC.size() << " vertices" << std::endl ;
1016 
1017  nVTX = vC.size();
1018  for (reco::VertexCollection::const_iterator vertex=vC.begin(); vertex!=vC.end(); vertex++){
1019  VTX = vertex->z();
1020  }
1021 
1022  if ( (fabs(VTX) < 20.) && (nVTX > 0) ){
1023  Pass_Vertex = true;
1024  } else {
1025  Pass_Vertex = false;
1026  }
1027 
1028  // ***********************
1029  // ***********************
1030 
1031 
1032  nBNC[evt.bunchCrossing()]++;
1033  totBNC++;
1034 
1035  // Pass = true;
1036 
1037  // *** Check for tracks
1038  // edm::Handle<reco::TrackCollection> trackCollection;
1039  // evt.getByLabel("generalTracks", trackCollection);
1040  // const reco::TrackCollection tC = *(trackCollection.product());
1041  // if ((Pass) && (tC.size()>1)) {
1042  // } else {
1043  // Pass = false;
1044  // }
1045 
1046 
1047  // ********************************
1048  // *** Pixel Clusters
1049  // ********************************
1051  evt.getByLabel("siPixelClusters", hClusterColl);
1052  const edmNew::DetSetVector<SiPixelCluster> clustColl = *(hClusterColl.product());
1053 
1054  edm::Handle<reco::TrackCollection> trackCollection;
1055  evt.getByLabel("generalTracks", trackCollection);
1056  const reco::TrackCollection tC = *(trackCollection.product());
1057 
1058 
1059  // **************************
1060  // *** Event Passed Selection
1061  // **************************
1062 
1063 
1064  if (evt.id().run() == 1) {
1065  if ( (Pass_DiJet) &&
1066  (Pass_Vertex) ) {
1067  Pass = true;
1068  } else {
1069  Pass = false;
1070  }
1071  Pass = true;
1072 
1073  } else {
1074  if ( (Pass_BunchCrossing) &&
1075  (Pass_HFTime) &&
1076  (Pass_Vertex) ) {
1077  Pass = true;
1078  } else {
1079  Pass = false;
1080  }
1081  }
1082 
1083  /***
1084  std::cout << "+++ Result "
1085  << " Event = "
1086  << evt.id().run()
1087  << " LS = "
1088  << evt.luminosityBlock()
1089  << " dphi = "
1090  << dphi
1091  << " Pass = "
1092  << Pass
1093  << std::endl;
1094  ***/
1095 
1096  NTotal->Fill(0);
1097 
1098  Pass = false;
1099  if ((tC.size() > 100) && (clustColl.size() > 1000)) Pass = true;
1100  Pass = true;
1101 
1102  /****
1103  if (Pass_HFTime) {
1104  Pass = true;
1105  } else {
1106  Pass = false;
1107  }
1108  ****/
1109 
1110  // **************************
1111  // *** Noise Summary Object
1112  // **************************
1113 
1115  evt.getByLabel(hcalNoiseSummaryTag_, summary_h);
1116  if(!summary_h.isValid()) {
1117  throw edm::Exception(edm::errors::ProductNotFound) << " could not find HcalNoiseSummary.\n";
1118  // return true;
1119  }
1120 
1121  const HcalNoiseSummary summary = *summary_h;
1122 
1123  bool Pass_NoiseSummary;
1124  Pass_NoiseSummary = true;
1125  if(summary.minE2Over10TS()<0.7) {
1126  Pass_NoiseSummary = false;
1127  }
1128  if(summary.maxE2Over10TS()>0.96) {
1129  Pass_NoiseSummary = false;
1130  }
1131  if(summary.maxHPDHits()>=17) {
1132  Pass_NoiseSummary = false;
1133  }
1134  if(summary.maxRBXHits()>=999) {
1135  Pass_NoiseSummary = false;
1136  }
1137  if(summary.maxHPDNoOtherHits()>=10) {
1138  Pass_NoiseSummary = false;
1139  }
1140  if(summary.maxZeros()>=10) {
1141  Pass_NoiseSummary = false;
1142  }
1143  if(summary.min25GeVHitTime()<-9999.0) {
1144  Pass_NoiseSummary = false;
1145  }
1146  if(summary.max25GeVHitTime()>9999.0) {
1147  Pass_NoiseSummary = false;
1148  }
1149  if(summary.minRBXEMF()<0.01) {
1150  }
1151 
1152  if (Pass_NoiseSummary) {
1153  Pass = false;
1154  } else {
1155  Pass = true;
1156  }
1157 
1158 
1159  Pass = true;
1160  if (Pass) {
1161 
1162  NPass->Fill(0);
1163 
1164  // *********************
1165  // *** Classify Event
1166  // *********************
1167  int evtType = 0;
1168 
1170  evt.getByLabel( "towerMaker", caloTowers );
1171 
1172  for (int i=0;i<36;i++) {
1173  RBXColl[i].et = 0;
1174  RBXColl[i].hadEnergy = 0;
1175  RBXColl[i].emEnergy = 0;
1176  RBXColl[i].hcalTime = 0;
1177  RBXColl[i].ecalTime = 0;
1178  RBXColl[i].nTowers = 0;
1179  }
1180  for (int i=0;i<144;i++) {
1181  HPDColl[i].et = 0;
1182  HPDColl[i].hadEnergy = 0;
1183  HPDColl[i].emEnergy = 0;
1184  HPDColl[i].hcalTime = 0;
1185  HPDColl[i].ecalTime = 0;
1186  HPDColl[i].nTowers = 0;
1187  }
1188 
1189  double ETotal, emFrac;
1190  double HCALTotalCaloTowerE, ECALTotalCaloTowerE;
1191  double HCALTotalCaloTowerE_Eta1, ECALTotalCaloTowerE_Eta1;
1192  double HCALTotalCaloTowerE_Eta2, ECALTotalCaloTowerE_Eta2;
1193  double HCALTotalCaloTowerE_Eta3, ECALTotalCaloTowerE_Eta3;
1194 
1195  ETotal = 0.;
1196  emFrac = 0.;
1197 
1198  HCALTotalCaloTowerE = 0;
1199  ECALTotalCaloTowerE = 0;
1200  HCALTotalCaloTowerE_Eta1 = 0.;
1201  ECALTotalCaloTowerE_Eta1 = 0.;
1202  HCALTotalCaloTowerE_Eta2 = 0.;
1203  ECALTotalCaloTowerE_Eta2 = 0.;
1204  HCALTotalCaloTowerE_Eta3 = 0.;
1205  ECALTotalCaloTowerE_Eta3 = 0.;
1206 
1207  for (CaloTowerCollection::const_iterator tower = caloTowers->begin();
1208  tower != caloTowers->end(); tower++) {
1209  ETotal += tower->hadEnergy();
1210  ETotal += tower->emEnergy();
1211  }
1212 
1213  for (CaloTowerCollection::const_iterator tower = caloTowers->begin();
1214  tower != caloTowers->end(); tower++) {
1215 
1216  // Raw tower energy without grouping or thresholds
1217  if (abs(tower->ieta()) < 100) EMF_Eta->Fill(tower->ieta(), emFrac);
1218 
1219  if (abs(tower->ieta()) < 15) {
1220  towerHadEnHB->Fill(tower->hadEnergy());
1221  towerEmEnHB->Fill(tower->emEnergy());
1222  }
1223  if ( (abs(tower->ieta()) > 17) && ((abs(tower->ieta()) < 30)) ){
1224  towerHadEnHE->Fill(tower->hadEnergy());
1225  towerEmEnHE->Fill(tower->emEnergy());
1226  }
1227  if (abs(tower->ieta()) > 29) {
1228  towerHadEnHF->Fill(tower->hadEnergy());
1229  towerEmEnHF->Fill(tower->emEnergy());
1230  }
1231 
1232  towerHadEn->Fill(tower->hadEnergy());
1233  towerEmEn->Fill(tower->emEnergy());
1234  towerOuterEn->Fill(tower->outerEnergy());
1235 
1236  // towerHadEt->Fill(tower->hadEt());
1237  // towerEmEt->Fill(tower->emEt());
1238  // towerOuterEt->Fill(tower->outerEt());
1239 
1240  if ((tower->emEnergy()+tower->hadEnergy()) != 0) {
1241  emFrac = tower->emEnergy()/(tower->emEnergy()+tower->hadEnergy());
1242  towerEmFrac->Fill(emFrac);
1243  } else {
1244  emFrac = 0.;
1245  }
1246 
1247  /***
1248  std::cout << "ETotal = " << ETotal
1249  << " EMF = " << emFrac
1250  << " EM = " << tower->emEnergy()
1251  << " Tot = " << tower->emEnergy()+tower->hadEnergy()
1252  << " ieta/iphi = " << tower->ieta() << " / " << tower->iphi()
1253  << std::endl;
1254  ***/
1255 
1256  if (abs(tower->iphi()) < 100) EMF_Phi->Fill(tower->iphi(), emFrac);
1257  if (abs(tower->ieta()) < 100) EMF_Eta->Fill(tower->ieta(), emFrac);
1258  if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) {
1259  std::cout << "Bunch Crossing = " << evt.bunchCrossing()
1260  << " Orbit Number = " << evt.orbitNumber()
1261  << std::endl;
1262 
1263  if (abs(tower->iphi()) < 100) EMF_PhiX->Fill(tower->iphi(), emFrac);
1264  if (abs(tower->ieta()) < 100) EMF_EtaX->Fill(tower->ieta(), emFrac);
1265  }
1266 
1267  HCALTotalCaloTowerE += tower->hadEnergy();
1268  ECALTotalCaloTowerE += tower->emEnergy();
1269 
1270  towerE = tower->hadEnergy() + tower->emEnergy();
1271  if (tower->et() > towerEtCut) caloEtaEt->Fill(tower->eta());
1272  if (towerE > towerECut) caloEta->Fill(tower->eta());
1273  caloPhi->Fill(tower->phi());
1274 
1275  if (fabs(tower->eta()) < 1.3) {
1276  HCALTotalCaloTowerE_Eta1 += tower->hadEnergy();
1277  ECALTotalCaloTowerE_Eta1 += tower->emEnergy();
1278  }
1279  if ((fabs(tower->eta()) >= 1.3) && (fabs(tower->eta()) < 2.5)) {
1280  HCALTotalCaloTowerE_Eta2 += tower->hadEnergy();
1281  ECALTotalCaloTowerE_Eta2 += tower->emEnergy();
1282  }
1283  if (fabs(tower->eta()) > 2.5) {
1284  HCALTotalCaloTowerE_Eta3 += tower->hadEnergy();
1285  ECALTotalCaloTowerE_Eta3 += tower->emEnergy();
1286  }
1287 
1288  /***
1289  std::cout << "had = " << tower->hadEnergy()
1290  << " em = " << tower->emEnergy()
1291  << " fabs(eta) = " << fabs(tower->eta())
1292  << " ieta/iphi = " << tower->ieta() << " / " << tower->iphi()
1293  << std::endl;
1294  ***/
1295 
1296  if ((tower->hadEnergy() + tower->emEnergy()) > 2.0) {
1297 
1298  int iRBX = tower->iphi();
1299  iRBX = iRBX-2;
1300  if (iRBX == 0) iRBX = 17;
1301  if (iRBX == -1) iRBX = 18;
1302  iRBX = (iRBX-1)/4;
1303 
1304  if (tower->ieta() < 0) iRBX += 18;
1305  if (iRBX < 36) {
1306  RBXColl[iRBX].et += tower->et();
1307  RBXColl[iRBX].hadEnergy += tower->hadEnergy();
1308  RBXColl[iRBX].emEnergy += tower->emEnergy();
1309  RBXColl[iRBX].hcalTime += tower->hcalTime();
1310  RBXColl[iRBX].ecalTime += tower->ecalTime();
1311  RBXColl[iRBX].nTowers++;
1312  }
1313  /***
1314  std::cout << "iRBX = " << iRBX << " "
1315  << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi()
1316  << " et = " << tower->et()
1317  << std::endl;
1318  ***/
1319  int iHPD = tower->iphi();
1320  if (tower->ieta() < 0) iHPD = iHPD + 72;
1321  if (iHPD < 144) {
1322  HPDColl[iHPD].et += tower->et();
1323  HPDColl[iHPD].hadEnergy += tower->hadEnergy();
1324  HPDColl[iHPD].emEnergy += tower->emEnergy();
1325  HPDColl[iHPD].hcalTime += tower->hcalTime();
1326  HPDColl[iHPD].ecalTime += tower->ecalTime();
1327  HPDColl[iHPD].nTowers++;
1328  }
1329  /***
1330  std::cout << "iHPD = " << iHPD << " "
1331  << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi()
1332  << " et = " << tower->et()
1333  << std::endl;
1334  ***/
1335 
1336  }
1337 
1338  }
1339 
1340  ECALvHCAL->Fill(HCALTotalCaloTowerE, ECALTotalCaloTowerE);
1341  ECALvHCALEta1->Fill(HCALTotalCaloTowerE_Eta1, ECALTotalCaloTowerE_Eta1);
1342  ECALvHCALEta2->Fill(HCALTotalCaloTowerE_Eta2, ECALTotalCaloTowerE_Eta2);
1343  ECALvHCALEta3->Fill(HCALTotalCaloTowerE_Eta3, ECALTotalCaloTowerE_Eta3);
1344 
1345  /***
1346  std::cout << " Total CaloTower Energy : "
1347  << " ETotal= " << ETotal
1348  << " HCAL= " << HCALTotalCaloTowerE
1349  << " ECAL= " << ECALTotalCaloTowerE
1350  << std::endl;
1351  ***/
1352 
1353  /***
1354  << " HCAL Eta1 = " << HCALTotalCaloTowerE_Eta1
1355  << " ECAL= " << ECALTotalCaloTowerE_Eta1
1356  << " HCAL Eta2 = " << HCALTotalCaloTowerE_Eta2
1357  << " ECAL= " << ECALTotalCaloTowerE_Eta2
1358  << " HCAL Eta3 = " << HCALTotalCaloTowerE_Eta3
1359  << " ECAL= " << ECALTotalCaloTowerE_Eta3
1360  << std::endl;
1361  ***/
1362 
1363 
1364  // Loop over the RBX Collection
1365  int nRBX = 0;
1366  int nTowers = 0;
1367  for (int i=0;i<36;i++) {
1368  RBX_et->Fill(RBXColl[i].et);
1369  RBX_hadEnergy->Fill(RBXColl[i].hadEnergy);
1370  RBX_hcalTime->Fill(RBXColl[i].hcalTime / RBXColl[i].nTowers);
1371  RBX_nTowers->Fill(RBXColl[i].nTowers);
1372  if (RBXColl[i].hadEnergy > 3.0) {
1373  nRBX++;
1374  nTowers = RBXColl[i].nTowers;
1375  }
1376  }
1377  RBX_N->Fill(nRBX);
1378  if ( (nRBX == 1) && (nTowers > 24) ) {
1379  evtType = 1;
1380  }
1381 
1382  // Loop over the HPD Collection
1383  int nHPD = 0;
1384  for (int i=0;i<144;i++) {
1385  HPD_et->Fill(HPDColl[i].et);
1386  HPD_hadEnergy->Fill(HPDColl[i].hadEnergy);
1387  HPD_hcalTime->Fill(HPDColl[i].hcalTime / HPDColl[i].nTowers);
1388  HPD_nTowers->Fill(HPDColl[i].nTowers);
1389  if (HPDColl[i].hadEnergy > 3.0) {
1390  nHPD++;
1391  nTowers = HPDColl[i].nTowers;
1392  }
1393  }
1394  HPD_N->Fill(nHPD);
1395  if ( (nHPD == 1) && (nTowers > 6) ) {
1396  evtType = 2;
1397  cout << " nHPD = " << nHPD
1398  << " Towers = " << nTowers
1399  << " Type = " << evtType
1400  << endl;
1401  }
1402 
1403  // **************************************************************
1404  // ** Access Trigger Information
1405  // **************************************************************
1406 
1407  // **** Get the TriggerResults container
1409  evt.getByLabel(theTriggerResultsLabel, triggerResults);
1410 
1411  Int_t JetLoPass = 0;
1412 
1413  if (triggerResults.isValid()) {
1414  if (DEBUG) std::cout << "trigger valid " << std::endl;
1415  // edm::TriggerNames triggerNames; // TriggerNames class
1416  // triggerNames.init(*triggerResults);
1417  unsigned int n = triggerResults->size();
1418  for (unsigned int i=0; i!=n; i++) {
1419 
1420  /***
1421  std::cout << " Trigger Name = " << triggerNames.triggerName(i)
1422  << " Accept = " << triggerResults->accept(i)
1423  << std::endl;
1424  ***/
1425 
1426  // if (DEBUG) std::cout << triggerNames.triggerName(i) << std::endl;
1427 
1428  /***
1429  if ( triggerNames.triggerName(i) == "HLT_Jet30" ) {
1430  JetLoPass = triggerResults->accept(i);
1431  if (DEBUG) std::cout << "Found HLT_Jet30 "
1432  << JetLoPass
1433  << std::endl;
1434  }
1435  ***/
1436 
1437  }
1438 
1439  } else {
1440 
1442  triggerResults = (*tr);
1443 
1444  // std::cout << "triggerResults is not valid" << std::endl;
1445  // std::cout << triggerResults << std::endl;
1446  // std::cout << triggerResults.isValid() << std::endl;
1447 
1448  if (DEBUG) std::cout << "trigger not valid " << std::endl;
1449  edm::LogInfo("myJetAna") << "TriggerResults::HLT not found, "
1450  "automatically select events";
1451  //return;
1452  }
1453 
1454  /****
1455  Handle <L1GlobalTriggerReadoutRecord> gtRecord_h;
1456  evt.getByType (gtRecord_h); // assume only one L1 trigger record here
1457  const L1GlobalTriggerReadoutRecord* gtRecord = gtRecord_h.failedToGet () ? 0 : &*gtRecord_h;
1458 
1459  if (gtRecord) { // object is available
1460  for (int l1bit = 0; l1bit < 128; ++l1bit) {
1461  if (gtRecord->decisionWord() [l1bit]) h_L1TrigBit->Fill (l1bit);
1462  }
1463  }
1464  ****/
1465 
1466 
1467 
1468 
1469  // **************************************************************
1470  // ** Loop over the two leading CaloJets and fill some histograms
1471  // **************************************************************
1473  evt.getByLabel( CaloJetAlgorithm, caloJets );
1474 
1475 
1476  jetInd = 0;
1477  allJetInd = 0;
1478 
1479  EtaOk10 = 0;
1480  EtaOk13 = 0;
1481  EtaOk40 = 0;
1482 
1483  // const JetCorrector* corrector =
1484  // JetCorrector::getJetCorrector (JetCorrectionService, es);
1485 
1486 
1487  highestPt = 0.0;
1488  nextPt = 0.0;
1489 
1490  for( CaloJetCollection::const_iterator cal = caloJets->begin(); cal != caloJets->end(); ++ cal ) {
1491 
1492  // double scale = corrector->correction (*cal);
1493  double scale = 1.0;
1494  double corPt = scale*cal->pt();
1495  // double corPt = cal->pt();
1496  // cout << "Pt = " << cal->pt() << endl;
1497 
1498  if (corPt>highestPt) {
1499  nextPt = highestPt;
1500  p4cortmp[1] = p4cortmp[0];
1501  highestPt = corPt;
1502  p4cortmp[0] = scale*cal->p4();
1503  } else if (corPt>nextPt) {
1504  nextPt = corPt;
1505  p4cortmp[1] = scale*cal->p4();
1506  }
1507 
1508  allJetInd++;
1509  if (allJetInd == 1) {
1510  h_jet1Pt->Fill( cal->pt() );
1511  h_jet1Eta->Fill( cal->eta() );
1512  if (JetLoPass != 0) h_jet1PtHLT->Fill( cal->pt() );
1513  p4tmp[0] = cal->p4();
1514  if ( fabs(cal->eta()) < 1.0) EtaOk10++;
1515  if ( fabs(cal->eta()) < 1.3) EtaOk13++;
1516  if ( fabs(cal->eta()) < 4.0) EtaOk40++;
1517  }
1518  if (allJetInd == 2) {
1519  h_jet2Pt->Fill( cal->pt() );
1520  h_jet2Eta->Fill( cal->eta() );
1521  p4tmp[1] = cal->p4();
1522  if ( fabs(cal->eta()) < 1.0) EtaOk10++;
1523  if ( fabs(cal->eta()) < 1.3) EtaOk13++;
1524  if ( fabs(cal->eta()) < 4.0) EtaOk40++;
1525  }
1526 
1527  if ( cal->pt() > minJetPt) {
1528  const std::vector<CaloTowerPtr> jetCaloRefs = cal->getCaloConstituents();
1529  int nConstituents = jetCaloRefs.size();
1530  h_nTowersCal->Fill(nConstituents);
1531  h_EMFracCal->Fill(cal->emEnergyFraction());
1532  h_ptCal->Fill( cal->pt() );
1533  h_etaCal->Fill( cal->eta() );
1534  h_phiCal->Fill( cal->phi() );
1535  jetInd++;
1536  }
1537  }
1538 
1539  h_nCalJets->Fill( jetInd );
1540 
1541  if (jetInd > 1) {
1542  LeadMass = (p4tmp[0]+p4tmp[1]).mass();
1543  dijetMass->Fill( LeadMass );
1544  }
1545 
1546 
1547  // ******************
1548  // *** Jet Properties
1549  // ******************
1550 
1551  int nTow1, nTow2, nTow3, nTow4;
1552  // Handle<CaloJetCollection> jets;
1553  // evt.getByLabel( CaloJetAlgorithm, jets );
1554 
1555  // *********************************************************
1556  // --- Loop over jets and make a list of all the used towers
1557  int jjet = 0;
1558  for ( CaloJetCollection::const_iterator ijet=caloJets->begin(); ijet!=caloJets->end(); ijet++) {
1559  jjet++;
1560 
1561  float hadEne = ijet->hadEnergyInHB() + ijet->hadEnergyInHO() +
1562  ijet->hadEnergyInHE() + ijet->hadEnergyInHF();
1563  float emEne = ijet->emEnergyInEB() + ijet->emEnergyInEE() + ijet->emEnergyInHF();
1564  float had = ijet->energyFractionHadronic();
1565  float j_et = ijet->et();
1566 
1567  // *** Barrel
1568  if (fabs(ijet->eta()) < 1.3) {
1569  totEneLeadJetEta1->Fill(hadEne+emEne);
1570  hadEneLeadJetEta1->Fill(ijet->hadEnergyInHB());
1571  emEneLeadJetEta1->Fill(ijet->emEnergyInEB());
1572  if (ijet->pt() > minJetPt10) hadFracEta1->Fill(had);
1573  }
1574 
1575  // *** EndCap
1576  if ((fabs(ijet->eta()) > 1.3) && (fabs(ijet->eta()) < 3.) ) {
1577  totEneLeadJetEta2->Fill(hadEne+emEne);
1578  hadEneLeadJetEta2->Fill(ijet->hadEnergyInHE());
1579  emEneLeadJetEta2->Fill(ijet->emEnergyInEE());
1580  if (ijet->pt() > minJetPt10) hadFracEta2->Fill(had);
1581  }
1582 
1583  // *** Forward
1584  if (fabs(ijet->eta()) > 3.) {
1585  totEneLeadJetEta3->Fill(hadEne+emEne);
1586  hadEneLeadJetEta3->Fill(hadEne);
1587  emEneLeadJetEta3->Fill(emEne);
1588  if (ijet->pt() > minJetPt10) hadFracEta3->Fill(had);
1589  }
1590 
1591  // *** CaloTowers in Jet
1592  const std::vector<CaloTowerPtr> jetCaloRefs = ijet->getCaloConstituents();
1593  int nConstituents = jetCaloRefs.size();
1594  NTowers->Fill(nConstituents);
1595 
1596  if (jjet == 1) {
1597 
1598  nTow1 = nTow2 = nTow3 = nTow4 = 0;
1599  for (int i = 0; i <nConstituents ; i++){
1600 
1601  float et = jetCaloRefs[i]->et();
1602 
1603  if (et > 0.5) nTow1++;
1604  if (et > 1.0) nTow2++;
1605  if (et > 1.5) nTow3++;
1606  if (et > 2.0) nTow4++;
1607 
1608  hf_TowerJetEt->Fill(et/j_et);
1609 
1610  }
1611 
1612  nTowersLeadJetPt1->Fill(nTow1);
1613  nTowersLeadJetPt2->Fill(nTow2);
1614  nTowersLeadJetPt3->Fill(nTow3);
1615  nTowersLeadJetPt4->Fill(nTow4);
1616 
1617  }
1618 
1619  }
1620 
1621 
1622  // **********************
1623  // *** Unclustered Energy
1624  // **********************
1625 
1626  double SumPtJet(0);
1627 
1628  double SumEtNotJets(0);
1629  double SumEtJets(0);
1630  double SumEtTowers(0);
1631  double TotalClusteredE(0);
1632  double TotalUnclusteredE(0);
1633 
1634  double sumJetPx(0);
1635  double sumJetPy(0);
1636 
1637  double sumTowerAllPx(0);
1638  double sumTowerAllPy(0);
1639 
1640  double sumTowerAllEx(0);
1641  double sumTowerAllEy(0);
1642 
1643  // double HCALTotalE;
1644  double HBTotalE, HETotalE, HOTotalE, HFTotalE;
1645  // double ECALTotalE;
1646  double EBTotalE, EETotalE;
1647 
1648  std::vector<CaloTowerPtr> UsedTowerList;
1649  std::vector<CaloTower> TowerUsedInJets;
1650  std::vector<CaloTower> TowerNotUsedInJets;
1651 
1652  // *********************
1653  // *** Hcal recHits
1654  // *********************
1655 
1657 
1658  // HCALTotalE = 0.;
1659  HBTotalE = HETotalE = HOTotalE = HFTotalE = 0.;
1660  try {
1661  std::vector<edm::Handle<HBHERecHitCollection> > colls;
1662  evt.getManyByType(colls);
1663  std::vector<edm::Handle<HBHERecHitCollection> >::iterator i;
1664  for (i=colls.begin(); i!=colls.end(); i++) {
1665 
1666 
1667  for (HBHERecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
1668  // std::cout << *j << std::endl;
1669  if (j->id().subdet() == HcalBarrel) {
1670  HBEne->Fill(j->energy());
1671  HBTime->Fill(j->time());
1672  if (!Pass_NoiseSummary) HBTimeFlagged2->Fill(j->time());
1673  if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HBTimeFlagged->Fill(j->time());
1674  HBTvsE->Fill(j->energy(), j->time());
1675 
1676  if (j->time() > 20.) HBEneTThr->Fill(j->energy());
1677 
1678  if ((j->time()<-25.) || (j->time()>75.)) {
1679  HBEneOOT->Fill(j->energy());
1680  if (j->energy() > HBHEThreshold) HBEneOOTTh->Fill(j->energy());
1681  if (j->energy() > HBHEThreshold1) HBEneOOTTh1->Fill(j->energy());
1682  }
1683  if (j->energy() > HBHEThreshold) {
1684  HBEneTh->Fill(j->energy());
1685  HBTimeTh->Fill(j->time());
1686  if (!Pass_NoiseSummary) HBTimeThFlagged2->Fill(j->time());
1687  if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HBTimeThFlagged->Fill(j->time());
1688 
1689  if (evt.id().run() >= StableRun) HBTimeThR->Fill(j->time());
1690  HBTotalE += j->energy();
1691  HBocc->Fill(j->id().ieta(),j->id().iphi());
1692  hitEta->Fill(j->id().ieta());
1693  hitPhi->Fill(j->id().iphi());
1694  }
1695  if (j->energy() > HBHEThreshold1) {
1696  HBEneTh1->Fill(j->energy());
1697  HBTimeTh1->Fill(j->time());
1698  if (!Pass_NoiseSummary) HBTimeTh1Flagged2->Fill(j->time());
1699  if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HBTimeTh1Flagged->Fill(j->time());
1700 
1701  if (evt.id().run() >= StableRun) HBTimeTh1R->Fill(j->time());
1702  if ((j->time()<-25.) || (j->time()>75.)) {
1703  HBoccOOT->Fill(j->id().ieta(),j->id().iphi());
1704  }
1705  }
1706  if (j->energy() > HBHEThreshold2) {
1707  HBTimeTh2->Fill(j->time());
1708  if (!Pass_NoiseSummary) HBTimeTh2Flagged2->Fill(j->time());
1709  if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HBTimeTh2Flagged->Fill(j->time());
1710 
1711  if (evt.id().run() >= StableRun) HBTimeTh2R->Fill(j->time());
1712  }
1713  if (j->energy() > HBHEThreshold3) {
1714  HBTimeTh3->Fill(j->time());
1715  if (evt.id().run() >= StableRun) HBTimeTh3R->Fill(j->time());
1716  }
1717  if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) {
1718  HBEneX->Fill(j->energy());
1719  if (j->energy() > HBHEThreshold) HBTimeX->Fill(j->time());
1720  }
1721  if ( (evt.id().run() == 120020) && (evt.id().event() == 457) ) {
1722  HBEneY->Fill(j->energy());
1723  if (j->energy() > HBHEThreshold) HBTimeY->Fill(j->time());
1724  }
1725  }
1726  if (j->id().subdet() == HcalEndcap) {
1727  HEEne->Fill(j->energy());
1728  HETime->Fill(j->time());
1729  if (!Pass_NoiseSummary) HETimeFlagged2->Fill(j->time());
1730  if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HETimeFlagged->Fill(j->time());
1731  HETvsE->Fill(j->energy(), j->time());
1732 
1733  if (j->time() > 20.) HEEneTThr->Fill(j->energy());
1734 
1735  if ((j->time()<-25.) || (j->time()>75.)) {
1736  HEEneOOT->Fill(j->energy());
1737  if (j->energy() > HBHEThreshold) HEEneOOTTh->Fill(j->energy());
1738  if (j->energy() > HBHEThreshold1) HEEneOOTTh1->Fill(j->energy());
1739  }
1740 
1741  if (j->energy() > HBHEThreshold) {
1742  HEEneTh->Fill(j->energy());
1743  HETimeTh->Fill(j->time());
1744  if (!Pass_NoiseSummary) HETimeThFlagged2->Fill(j->time());
1745  if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HETimeThFlagged->Fill(j->time());
1746 
1747  if (evt.id().run() >= StableRun) HETimeThR->Fill(j->time());
1748  HETotalE += j->energy();
1749  HEocc->Fill(j->id().ieta(),j->id().iphi());
1750  hitEta->Fill(j->id().ieta());
1751  hitPhi->Fill(j->id().iphi());
1752  }
1753  if (j->energy() > HBHEThreshold1) {
1754  HEEneTh1->Fill(j->energy());
1755  HETimeTh1->Fill(j->time());
1756  if (!Pass_NoiseSummary) HETimeTh1Flagged2->Fill(j->time());
1757  if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HETimeTh1Flagged->Fill(j->time());
1758  if (evt.id().run() >= StableRun) HETimeTh1R->Fill(j->time());
1759  if ((j->time()<-25.) || (j->time()>75.)) {
1760  HEoccOOT->Fill(j->id().ieta(),j->id().iphi());
1761  }
1762  }
1763  if (j->energy() > HBHEThreshold2) {
1764  HETimeTh2->Fill(j->time());
1765  if (!Pass_NoiseSummary) HETimeTh2Flagged2->Fill(j->time());
1766  if (j->flagField(HcalCaloFlagLabels::HBHETimingShapedCutsBits) != 0) HETimeTh2Flagged->Fill(j->time());
1767  if (evt.id().run() >= StableRun) HETimeTh2R->Fill(j->time());
1768  }
1769  if (j->energy() > HBHEThreshold3) {
1770  HETimeTh3->Fill(j->time());
1771  if (evt.id().run() >= StableRun) HETimeTh3R->Fill(j->time());
1772  }
1773 
1774  if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) {
1775  HEEneX->Fill(j->energy());
1776  if (j->energy() > HBHEThreshold) HETimeX->Fill(j->time());
1777  }
1778  if ( (evt.id().run() == 120020) && (evt.id().event() == 457) ) {
1779  HEEneY->Fill(j->energy());
1780  if (j->energy() > HBHEThreshold) HETimeY->Fill(j->time());
1781  }
1782 
1783  // Fill +-HE separately
1784  if (j->id().ieta()<0) {
1785  HEnegEne->Fill(j->energy());
1786  if (j->energy() > HBHEThreshold) {
1787  HEnegTime->Fill(j->time());
1788  }
1789  } else {
1790  HEposEne->Fill(j->energy());
1791  if (j->energy() > HBHEThreshold) {
1792  HEposTime->Fill(j->time());
1793  }
1794  }
1795 
1796  }
1797 
1798  /***
1799  std::cout << j->id() << " "
1800  << j->id().subdet() << " "
1801  << j->id().ieta() << " "
1802  << j->id().iphi() << " "
1803  << j->id().depth() << " "
1804  << j->energy() << " "
1805  << j->time() << std::endl;
1806  ****/
1807  }
1808  }
1809  } catch (...) {
1810  cout << "No HB/HE RecHits." << endl;
1811  }
1812 
1813 
1814  HFM_ETime = 0.;
1815  HFM_E = 0.;
1816  HFP_ETime = 0.;
1817  HFP_E = 0.;
1818 
1819  int NPMTHits;
1820  NPMTHits = 0;
1821  try {
1822  std::vector<edm::Handle<HFRecHitCollection> > colls;
1823  evt.getManyByType(colls);
1824  std::vector<edm::Handle<HFRecHitCollection> >::iterator i;
1825  for (i=colls.begin(); i!=colls.end(); i++) {
1826  for (HFRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
1827  if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) ||
1828  (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) {
1829  NPMTHits++;
1830  }
1831  }
1832  break;
1833  }
1834  } catch (...) {
1835  cout << "No HF RecHits." << endl;
1836  }
1837 
1838 
1839  PMTHits->Fill(NPMTHits);
1840 
1841  try {
1842  std::vector<edm::Handle<HFRecHitCollection> > colls;
1843  evt.getManyByType(colls);
1844  std::vector<edm::Handle<HFRecHitCollection> >::iterator i;
1845  for (i=colls.begin(); i!=colls.end(); i++) {
1846  for (HFRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
1847 
1848  /****
1849  float en = j->energy();
1850  HcalDetId id(j->detid().rawId());
1851  int ieta = id.ieta();
1852  int iphi = id.iphi();
1853  int depth = id.depth();
1854  *****/
1855 
1856  // std::cout << *j << std::endl;
1857 
1858  if (j->id().subdet() == HcalForward) {
1859 
1860  if (NPMTHits == 1) {
1861  if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) ||
1862  (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) {
1863  HFEtaFlagged->Fill(j->id().ieta());
1864  if (j->id().depth() == 1) HFEtaFlaggedL->Fill(j->id().ieta());
1865  if (j->id().depth() == 2) HFEtaFlaggedS->Fill(j->id().ieta());
1866  } else {
1867  HFEtaNFlagged->Fill(j->id().ieta(), j->energy());
1868  HFEtaPhiNFlagged->Fill(j->id().ieta(),j->id().iphi(),j->energy());
1869  }
1870  }
1871  if (j->energy() > 20.) {
1872  if (NPMTHits == 0) {
1873  HFEnePMT0->Fill(j->energy());
1874  HFTimePMT0->Fill(j->time());
1875  }
1876  if (NPMTHits == 1) {
1877  if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) ||
1878  (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) {
1879  HFEnePMT1->Fill(j->energy());
1880  HFTimePMT1->Fill(j->time());
1881  }
1882  }
1883  if (NPMTHits > 1) {
1884  if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) ||
1885  (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) {
1886  HFEnePMT2->Fill(j->energy());
1887  HFTimePMT2->Fill(j->time());
1888  }
1889  }
1890  }
1891 
1892  HFTimeVsiEtaP->Fill(j->id().ieta(), j->time());
1893  HFTimeVsiEtaM->Fill(j->id().ieta(), j->time());
1894 
1895  if (j->energy() > 5.) {
1896  HFTimeVsiEtaP5->Fill(j->id().ieta(), j->time());
1897  HFTimeVsiEtaM5->Fill(j->id().ieta(), j->time());
1898  }
1899 
1900  if (j->energy() > 20.) {
1901  HFTimeVsiEtaP20->Fill(j->id().ieta(), j->time());
1902  HFTimeVsiEtaM20->Fill(j->id().ieta(), j->time());
1903  }
1904 
1905  HFEne->Fill(j->energy());
1906  HFTime->Fill(j->time());
1907  HFTvsE->Fill(j->energy(), j->time());
1908 
1909  if (j->time() > 20.) HFEneTThr->Fill(j->energy());
1910 
1911  if (j->energy() > 10.) HFTvsEThr->Fill(j->energy(), j->time());
1912 
1913  if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1)||
1914  (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) {
1915  HFEneFlagged->Fill(j->energy());
1916  HFoccFlagged->Fill(j->id().ieta(),j->id().iphi());
1917  HFTimeFlagged->Fill(j->time());
1918  HFTvsEFlagged->Fill(j->energy(), j->time());
1919 
1920  // std::cout << "Flagged: " << j->energy() << " "
1921  // << j->time()
1922  // << std::endl;
1923  }
1924 
1925 
1926  if (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) {
1927  HFEneFlagged2->Fill(j->energy());
1928  HFoccFlagged2->Fill(j->id().ieta(),j->id().iphi());
1929  HFTimeFlagged2->Fill(j->time());
1930  HFTvsEFlagged2->Fill(j->energy(), j->time());
1931  if (j->energy() > 10.) HFTvsEFlagged2Thr->Fill(j->energy(), j->time());
1932  }
1933 
1934  if (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) {
1935  HFTimeFlagged3->Fill(j->time());
1936  }
1937 
1938  if (j->energy() > HFThreshold) {
1939  HFEneTh->Fill(j->energy());
1940  HFTimeTh->Fill(j->time());
1941  if (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) HFTimeThFlagged2->Fill(j->time());
1942  if (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) HFTimeThFlagged3->Fill(j->time());
1943 
1944  if (evt.id().run() >= StableRun) HFTimeThR->Fill(j->time());
1945  if ( (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1)||
1946  (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) ) {
1947 
1948  HFTimeThFlagged->Fill(j->time());
1949 
1950  if (j->energy() > HFThreshold2) HFTimeTh2Flagged->Fill(j->time());
1951  if (j->energy() > HFThreshold3) HFTimeTh3Flagged->Fill(j->time());
1952 
1953  if (evt.id().run() >= StableRun) {
1954  HFTimeThFlaggedR->Fill(j->time());
1955  if (NPMTHits == 1) HFTimeThFlaggedR1->Fill(j->time());
1956  if (NPMTHits == 2) HFTimeThFlaggedR2->Fill(j->time());
1957  if (NPMTHits == 3) HFTimeThFlaggedR3->Fill(j->time());
1958  if (NPMTHits == 4) HFTimeThFlaggedR4->Fill(j->time());
1959  if (NPMTHits > 1) HFTimeThFlaggedRM->Fill(j->time());
1960  }
1961  }
1962  HFTotalE += j->energy();
1963  HFocc->Fill(j->id().ieta(),j->id().iphi());
1964  hitEta->Fill(j->id().ieta());
1965  hitPhi->Fill(j->id().iphi());
1966  }
1967 
1968  if (j->energy() > HFThreshold1) {
1969  HFEneTh1->Fill(j->energy());
1970  HFTimeTh1->Fill(j->time());
1971  if (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) HFTimeTh1Flagged2->Fill(j->time());
1972  if (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) HFTimeTh1Flagged3->Fill(j->time());
1973  if (evt.id().run() >= StableRun) HFTimeTh1R->Fill(j->time());
1974  if ((j->time()<-20.) || (j->time()>20.)) {
1975  HFoccOOT->Fill(j->id().ieta(),j->id().iphi());
1976  }
1977  }
1978  if (j->energy() > HFThreshold2) {
1979  HFTimeTh2->Fill(j->time());
1980  if (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) HFTimeTh2Flagged2->Fill(j->time());
1981  if (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) HFTimeTh2Flagged3->Fill(j->time());
1982  if (evt.id().run() >= StableRun) HFTimeTh2R->Fill(j->time());
1983  }
1984  if (j->energy() > HFThreshold3) {
1985  HFTimeTh3->Fill(j->time());
1986  if (j->flagField(HcalCaloFlagLabels::HFLongShort) == 1) HFTimeTh3Flagged2->Fill(j->time());
1987  if (j->flagField(HcalCaloFlagLabels::HFDigiTime) == 1) HFTimeTh3Flagged3->Fill(j->time());
1988  if (evt.id().run() >= StableRun) HFTimeTh3R->Fill(j->time());
1989  }
1990 
1991  if (j->id().ieta()<0) {
1992  if (j->energy() > HFThreshold) {
1993  // HFTimeM->Fill(j->time());
1994  HFEneM->Fill(j->energy());
1995  HFM_ETime += j->energy()*j->time();
1996  HFM_E += j->energy();
1997  }
1998  } else {
1999  if (j->energy() > HFThreshold) {
2000  // HFTimeP->Fill(j->time());
2001  HFEneP->Fill(j->energy());
2002  HFP_ETime += j->energy()*j->time();
2003  HFP_E += j->energy();
2004  }
2005  }
2006 
2007  // Long and short fibers
2008  if (j->id().depth() == 1){
2009  HFLEne->Fill(j->energy());
2010  if (j->energy() > HFThreshold) HFLTime->Fill(j->time());
2011  } else {
2012  HFSEne->Fill(j->energy());
2013  if (j->energy() > HFThreshold) HFSTime->Fill(j->time());
2014  }
2015  }
2016  }
2017  break;
2018 
2019  }
2020 
2021  } catch (...) {
2022  cout << "No HF RecHits." << endl;
2023  }
2024 
2025 
2026 
2027  for (int ieta=0; ieta<100; ieta++) {
2028  for (int iphi=0; iphi<100; iphi++) {
2029  double longF, shortF;
2030  if (HFRecHit[ieta][iphi][0] == -10.) {
2031  longF = 0.;
2032  } else {
2033  longF = HFRecHit[ieta][iphi][0];
2034  }
2035  if (HFRecHit[ieta][iphi][1] == -10.) {
2036  shortF = 0.;
2037  } else {
2038  shortF = HFRecHit[ieta][iphi][1];
2039  }
2040  // if ((longF > HFThreshold) || (shortF > HFThreshold)) HFLSRatio->Fill((longF-shortF)/(longF+shortF));
2041 
2042  if (longF > 0.) HFLEneAll->Fill(longF);
2043  if (shortF > 0.) HFSEneAll->Fill(shortF);
2044 
2045 
2046  if ((longF > 20.) || (shortF > 20.)) {
2047  double R = (longF-shortF)/(longF+shortF);
2048  HFLSRatio->Fill(R);
2049  if (fabs(R) > 0.995) {
2050 
2051  // if (longF > 110.) {
2052  // if (longF > 50.) {
2053  if (longF > (162.4-10.19*abs(ieta-41)+.21*abs(ieta-41)*abs(ieta-41)) ) {
2054  HFEtaFlaggedLN->Fill(ieta-41);
2055 
2056  HFLEneAllF->Fill(longF);
2057 
2058  if (shortF == 0.) HFLEneNoSFlaggedN->Fill(longF);
2059  }
2060  // if (shortF > 70.) {
2061  // if (shortF > 50.) {
2062  if (shortF > (129.9-6.61*abs(ieta-41)+0.1153*abs(ieta-41)*abs(ieta-41)) ) {
2063  HFEtaFlaggedSN->Fill(ieta-41);
2064 
2065  HFSEneAllF->Fill(shortF);
2066 
2067  if (longF == 0.) HFSEneNoLFlaggedN->Fill(shortF);
2068  }
2069  }
2070  }
2071  /***
2072  cout << "HF LS Ratio long= "
2073  << longF
2074  << " short= "
2075  << shortF
2076  << endl;
2077  ***/
2078 
2079  HFLvsS->Fill(HFRecHit[ieta][iphi][1], HFRecHit[ieta][iphi][0]);
2080  if ( (HFRecHit[ieta][iphi][1] == -10.) && (HFRecHit[ieta][iphi][0] != -10.) ) {
2081  HFLEneNoS->Fill(HFRecHit[ieta][iphi][0]);
2082  if (HFRecHitFlag[ieta][iphi][0] !=0 ) HFLEneNoSFlagged->Fill(HFRecHit[ieta][iphi][0]);
2083  }
2084  if ( (HFRecHit[ieta][iphi][0] == -10.) && (HFRecHit[ieta][iphi][1] != -10.) ) {
2085  HFSEneNoL->Fill(HFRecHit[ieta][iphi][1]);
2086  if (HFRecHitFlag[ieta][iphi][1] !=0 ) HFSEneNoLFlagged->Fill(HFRecHit[ieta][iphi][1]);
2087  }
2088 
2089  }
2090  }
2091 
2092  if (HFP_E > 0.) HFTimeP->Fill(HFP_ETime / HFP_E);
2093  if (HFM_E > 0.) HFTimeM->Fill(HFM_ETime / HFM_E);
2094 
2095  if ((HFP_E > 0.) && (HFM_E > 0.)) {
2096  HF_PMM = (HFP_ETime / HFP_E) - (HFM_ETime / HFM_E);
2097  HFTimePM->Fill(HF_PMM);
2098  } else {
2099  HF_PMM = INVALID;
2100  }
2101 
2102 
2103 
2104  try {
2105  std::vector<edm::Handle<HORecHitCollection> > colls;
2106  evt.getManyByType(colls);
2107  std::vector<edm::Handle<HORecHitCollection> >::iterator i;
2108  for (i=colls.begin(); i!=colls.end(); i++) {
2109  for (HORecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
2110  if (j->id().subdet() == HcalOuter) {
2111  HOEne->Fill(j->energy());
2112  HOTime->Fill(j->time());
2113  HOTvsE->Fill(j->energy(), j->time());
2114  if (j->energy() > HOThreshold1) {
2115  HOEneTh1->Fill(j->energy());
2116  }
2117  if (j->energy() > HOThreshold) {
2118  HOEneTh->Fill(j->energy());
2119  HOTimeTh->Fill(j->time());
2120  HOTotalE += j->energy();
2121  HOocc->Fill(j->id().ieta(),j->id().iphi());
2122  }
2123 
2124  // Separate SiPMs and HPDs:
2125  if (((j->id().iphi()>=59 && j->id().iphi()<=70 &&
2126  j->id().ieta()>=11 && j->id().ieta()<=15) ||
2127  (j->id().iphi()>=47 && j->id().iphi()<=58 &&
2128  j->id().ieta()>=5 && j->id().ieta()<=10)))
2129  {
2130  HOSEne->Fill(j->energy());
2131  if (j->energy() > HOThreshold) HOSTime->Fill(j->time());
2132  } else if ((j->id().iphi()<59 || j->id().iphi()>70 ||
2133  j->id().ieta()<11 || j->id().ieta()>15) &&
2134  (j->id().iphi()<47 || j->id().iphi()>58 ||
2135  j->id().ieta()<5 || j->id().ieta()>10))
2136  {
2137  HOHEne->Fill(j->energy());
2138  if (j->energy() > HOThreshold) HOHTime->Fill(j->time());
2139  // Separate rings -1,-2,0,1,2 in HPDs:
2140  if (j->id().ieta()<= -11){
2141  HOHrm2Ene->Fill(j->energy());
2142  if (j->energy() > HOThreshold) HOHrm2Time->Fill(j->time());
2143  } else if (j->id().ieta()>= -10 && j->id().ieta() <= -5) {
2144  HOHrm1Ene->Fill(j->energy());
2145  if (j->energy() > HOThreshold) HOHrm1Time->Fill(j->time());
2146  } else if (j->id().ieta()>= -4 && j->id().ieta() <= 4) {
2147  HOHr0Ene->Fill(j->energy());
2148  if (j->energy() > HOThreshold) HOHr0Time->Fill(j->time());
2149  } else if (j->id().ieta()>= 5 && j->id().ieta() <= 10) {
2150  HOHrp1Ene->Fill(j->energy());
2151  if (j->energy() > HOThreshold) HOHrp1Time->Fill(j->time());
2152  } else if (j->id().ieta()>= 11) {
2153  HOHrp2Ene->Fill(j->energy());
2154  if (j->energy() > HOThreshold) HOHrp2Time->Fill(j->time());
2155  } else {
2156  std::cout << "Finding events that are in no ring !?!" << std::endl;
2157  std::cout << "eta = " << j->id().ieta() << std::endl;
2158 
2159  }
2160  } else {
2161  std::cout << "Finding events that are neither SiPM nor HPD!?" << std::endl;
2162  }
2163 
2164 
2165 
2166  }
2167  // std::cout << *j << std::endl;
2168  }
2169  }
2170  } catch (...) {
2171  cout << "No HO RecHits." << endl;
2172  }
2173 
2174  // HCALTotalE = HBTotalE + HETotalE + HFTotalE + HOTotalE;
2175  // ECALTotalE = 0.;
2176  EBTotalE = EETotalE = 0.;
2177 
2178 
2179  try {
2180  std::vector<edm::Handle<EcalRecHitCollection> > colls;
2181  evt.getManyByType(colls);
2182  std::vector<edm::Handle<EcalRecHitCollection> >::iterator i;
2183  for (i=colls.begin(); i!=colls.end(); i++) {
2184  for (EcalRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
2185  if (j->id().subdetId() == EcalBarrel) {
2186  EBEne->Fill(j->energy());
2187  EBTime->Fill(j->time());
2188  if (j->energy() > EBEEThreshold) {
2189  EBEneTh->Fill(j->energy());
2190  EBTimeTh->Fill(j->time());
2191  }
2192  if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) {
2193  EBEneX->Fill(j->energy());
2194  EBTimeX->Fill(j->time());
2195  }
2196  if ( (evt.id().run() == 120020) && (evt.id().event() == 457) ) {
2197  EBEneY->Fill(j->energy());
2198  EBTimeY->Fill(j->time());
2199  }
2200  EBTotalE += j->energy();
2201  }
2202  if (j->id().subdetId() == EcalEndcap) {
2203  EEEne->Fill(j->energy());
2204  EETime->Fill(j->time());
2205  if (j->energy() > EBEEThreshold) {
2206  EEEneTh->Fill(j->energy());
2207  EETimeTh->Fill(j->time());
2208  }
2209  if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) {
2210  EEEneX->Fill(j->energy());
2211  EETimeX->Fill(j->time());
2212  }
2213  if ( (evt.id().run() == 120020) && (evt.id().event() == 457 ) ) {
2214  EEEneY->Fill(j->energy());
2215  EETimeY->Fill(j->time());
2216  }
2217  EETotalE += j->energy();
2218  }
2219  // std::cout << *j << std::endl;
2220  // std::cout << "EB ID = " << j->id().subdetId() << "/" << EcalBarrel << std::endl;
2221  }
2222  }
2223  } catch (...) {
2224  cout << "No ECAL RecHits." << endl;
2225  }
2226 
2227  EBvHB->Fill(HBTotalE, EBTotalE);
2228  EEvHE->Fill(HETotalE, EETotalE);
2229 
2230  /*****
2231  try {
2232  std::vector<edm::Handle<EBRecHitCollection> > colls;
2233  evt.getManyByType(colls);
2234  std::vector<edm::Handle<EBRecHitCollection> >::iterator i;
2235 
2236  for (i=colls.begin(); i!=colls.end(); i++) {
2237  for (EBRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
2238  // if (j->id().subdetId() == EcalBarrel) {
2239  EBEne->Fill(j->energy());
2240  EBTime->Fill(j->time());
2241  // EBTotalE = j->energy();
2242  // }
2243  // std::cout << *j << std::endl;
2244  // std::cout << "EB ID = " << j->id().subdetId() << "/" << EcalBarrel << std::endl;
2245  }
2246  }
2247  } catch (...) {
2248  cout << "No EB RecHits." << endl;
2249  }
2250 
2251  try {
2252  std::vector<edm::Handle<EERecHitCollection> > colls;
2253  evt.getManyByType(colls);
2254  std::vector<edm::Handle<EERecHitCollection> >::iterator i;
2255  for (i=colls.begin(); i!=colls.end(); i++) {
2256  for (EERecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
2257  // if (j->id().subdetId() == EcalEndcap) {
2258  EEEne->Fill(j->energy());
2259  EETime->Fill(j->time());
2260  // EETotalE = j->energy();
2261  // Separate +-EE;
2262  EEDetId EEid = EEDetId(j->id());
2263  if (!EEid.positiveZ())
2264  {
2265  EEnegEne->Fill(j->energy());
2266  EEnegTime->Fill(j->time());
2267  }else{
2268  EEposEne->Fill(j->energy());
2269  EEposTime->Fill(j->time());
2270  }
2271  // }
2272  // std::cout << *j << std::endl;
2273  }
2274  }
2275  } catch (...) {
2276  cout << "No EE RecHits." << endl;
2277  }
2278  ******/
2279 
2280  // ECALTotalE = EBTotalE + EETotalE;
2281 
2282  if ( (EBTotalE > 320000) && (EBTotalE < 330000) &&
2283  (HBTotalE > 2700000) && (HBTotalE < 2800000) ) {
2284 
2285  std::cout << ">>> Off Axis! "
2286  << std::endl;
2287 
2288  }
2289 
2290  /***
2291  std::cout << " Rechits: Total Energy : "
2292  << " HCAL= " << HCALTotalE
2293  << " ECAL= " << ECALTotalE
2294  << " HB = " << HBTotalE
2295  << " EB = " << EBTotalE
2296  << std::endl;
2297  ***/
2298 
2299 
2300  // *********************
2301  // *** CaloTowers
2302  // *********************
2303  // Handle<CaloTowerCollection> caloTowers;
2304  // evt.getByLabel( "towerMaker", caloTowers );
2305 
2306  nTow1 = nTow2 = nTow3 = nTow4 = 0;
2307 
2308  double sum_et = 0.0;
2309  double sum_ex = 0.0;
2310  double sum_ey = 0.0;
2311 
2312  double HFsum_et = 0.0;
2313  double HFsum_ex = 0.0;
2314  double HFsum_ey = 0.0;
2315  // double sum_ez = 0.0;
2316 
2317 
2318  // std::cout<<">>>> Run " << evt.id().run() << " Event " << evt.id().event() << std::endl;
2319  // --- Loop over towers and make a lists of used and unused towers
2320  for (CaloTowerCollection::const_iterator tower = caloTowers->begin();
2321  tower != caloTowers->end(); tower++) {
2322 
2323  Double_t et = tower->et();
2324  Double_t phix = tower->phi();
2325 
2326  if (et > 0.5) nTow1++;
2327  if (et > 1.0) nTow2++;
2328  if (et > 1.5) nTow3++;
2329  if (et > 2.0) nTow4++;
2330 
2331  // if ( (fabs(tower->ieta() > 42)) || (fabs(tower->iphi()) > 72) ) {
2332  // std::cout << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi() << std::endl;
2333  // }
2334 
2335  if (tower->emEnergy() > 2.0) {
2336  h_EmEnergy->Fill (tower->ieta(), tower->iphi(), tower->emEnergy());
2337  }
2338  if (tower->hadEnergy() > 2.0) {
2339  h_HadEnergy->Fill (tower->ieta(), tower->iphi(), tower->hadEnergy());
2340  }
2341 
2342  if (fabs(tower->ieta()) > 29) {
2343  HFsum_et += et;
2344  HFsum_ex += et*cos(phix);
2345  HFsum_ey += et*sin(phix);
2346  }
2347 
2348 
2349  if (et>0.5) {
2350 
2351  ETime->Fill(tower->ecalTime());
2352  HTime->Fill(tower->hcalTime());
2353 
2354  // ********
2355  // double theta = tower->theta();
2356  // double e = tower->energy();
2357  // double et = e*sin(theta);
2358  // double et = tower->emEt() + tower->hadEt();
2359  // sum_ez += e*cos(theta);
2360  sum_et += et;
2361  sum_ex += et*cos(phix);
2362  sum_ey += et*sin(phix);
2363  // ********
2364 
2365  Double_t phi = tower->phi();
2366  SumEtTowers += tower->et();
2367 
2368  sumTowerAllEx += et*cos(phi);
2369  sumTowerAllEy += et*sin(phi);
2370 
2371  }
2372 
2373  }
2374 
2375  // SumEt->Fill(sum_et);
2376  // MET->Fill(sqrt( sum_ex*sum_ex + sum_ey*sum_ey));
2377 
2378  HFSumEt->Fill(HFsum_et);
2379  HFMET->Fill(sqrt( HFsum_ex*HFsum_ex + HFsum_ey*HFsum_ey));
2380 
2381  hf_sumTowerAllEx->Fill(sumTowerAllEx);
2382  hf_sumTowerAllEy->Fill(sumTowerAllEy);
2383 
2384  nTowers1->Fill(nTow1);
2385  nTowers2->Fill(nTow2);
2386  nTowers3->Fill(nTow3);
2387  nTowers4->Fill(nTow4);
2388 
2389 
2390  // *********************
2391  // *********************
2392 
2393  UsedTowerList.clear();
2394  TowerUsedInJets.clear();
2395  TowerNotUsedInJets.clear();
2396 
2397  // --- Loop over jets and make a list of all the used towers
2398  // evt.getByLabel( CaloJetAlgorithm, jets );
2399  for ( CaloJetCollection::const_iterator ijet=caloJets->begin(); ijet!=caloJets->end(); ijet++) {
2400 
2401  Double_t jetPt = ijet->pt();
2402  Double_t jetEta = ijet->eta();
2403  Double_t jetPhi = ijet->phi();
2404 
2405  // if (jetPt>5.0) {
2406 
2407  Double_t jetPx = jetPt*cos(jetPhi);
2408  Double_t jetPy = jetPt*sin(jetPhi);
2409 
2410  sumJetPx +=jetPx;
2411  sumJetPy +=jetPy;
2412 
2413  const std::vector<CaloTowerPtr> jetCaloRefs = ijet->getCaloConstituents();
2414  int nConstituents = jetCaloRefs.size();
2415  for (int i = 0; i <nConstituents ; i++){
2416 
2417  UsedTowerList.push_back(jetCaloRefs[i]);
2418  }
2419 
2420  SumPtJet +=jetPt;
2421 
2422  // }
2423 
2424  if ( (jetPt>80.0) && (fabs(jetEta) < 1.3) ){
2425  st_Pt->Fill( jetPt );
2426  int nConstituents = ijet->getCaloConstituents().size();
2427  st_Constituents->Fill( nConstituents );
2428 
2429  float maxEne = 0.;
2430  float totEne = 0.;
2431 
2432  for(unsigned twr=0; twr<ijet->getCaloConstituents().size(); ++twr){
2433  CaloTowerPtr tower = (ijet->getCaloConstituents())[twr];
2434  // CaloTowerDetId id = tower->id();
2435  if( tower->et()>0. ){
2436 
2437  if (tower->energy() > maxEne) maxEne = tower->energy();
2438  totEne += tower->energy();
2439 
2440  st_Energy->Fill( tower->energy() );
2441  st_EmEnergy->Fill( tower->emEnergy() );
2442  st_HadEnergy->Fill( tower->hadEnergy() );
2443  st_OuterEnergy->Fill( tower->outerEnergy() );
2444 
2445  st_Eta->Fill( tower->eta() );
2446  st_Phi->Fill( tower->phi() );
2447 
2448  st_iEta->Fill( tower->ieta() );
2449  st_iPhi->Fill( tower->iphi() );
2450 
2451  /****
2452  std::cout << ">>> Towers : "
2453  << " " << tower->energy()
2454  << " " << tower->emEnergy()
2455  << " " << tower->hadEnergy()
2456  << " " << tower->outerEnergy()
2457  << " " << tower->et()
2458  << " " << tower->emEt()
2459  << " " << tower->hadEt()
2460  << " " << tower->outerEt()
2461  << " " << tower->eta()
2462  << " " << tower->phi()
2463  << std::endl;
2464  ****/
2465  }
2466  }
2467  st_Frac->Fill( maxEne / totEne );
2468 
2469  }
2470 
2471  }
2472 
2473  int NTowersUsed = UsedTowerList.size();
2474 
2475  // --- Loop over towers and make a lists of used and unused towers
2476  for (CaloTowerCollection::const_iterator tower = caloTowers->begin();
2477  tower != caloTowers->end(); tower++) {
2478 
2479  CaloTower t = *tower;
2480  Double_t et = tower->et();
2481 
2482  if(et>0) {
2483 
2484  Double_t phi = tower->phi();
2485  SumEtTowers += tower->et();
2486 
2487  sumTowerAllPx += et*cos(phi);
2488  sumTowerAllPy += et*sin(phi);
2489 
2490  bool used = false;
2491 
2492  for(int i=0; i<NTowersUsed; i++){
2493  if(tower->id() == UsedTowerList[i]->id()){
2494  used=true;
2495  break;
2496  }
2497  }
2498 
2499  if (used) {
2500  TowerUsedInJets.push_back(t);
2501  } else {
2502  TowerNotUsedInJets.push_back(t);
2503  }
2504  }
2505  }
2506 
2507  int nUsed = TowerUsedInJets.size();
2508  int nNotUsed = TowerNotUsedInJets.size();
2509 
2510  SumEtJets = 0;
2511  SumEtNotJets = 0;
2512  TotalClusteredE = 0;
2513  TotalUnclusteredE = 0;
2514 
2515  for(int i=0;i<nUsed;i++){
2516  SumEtJets += TowerUsedInJets[i].et();
2517  h_ClusteredE->Fill(TowerUsedInJets[i].energy());
2518  if (TowerUsedInJets[i].energy() > 1.0)
2519  TotalClusteredE += TowerUsedInJets[i].energy();
2520  }
2521  h_jetEt->Fill(SumEtJets);
2522 
2523  for(int i=0;i<nNotUsed;i++){
2524  if (TowerNotUsedInJets[i].et() > 0.5)
2525  SumEtNotJets += TowerNotUsedInJets[i].et();
2526  h_UnclusteredEt->Fill(TowerNotUsedInJets[i].et());
2527  h_UnclusteredEts->Fill(TowerNotUsedInJets[i].et());
2528  h_UnclusteredE->Fill(TowerNotUsedInJets[i].energy());
2529  if (TowerNotUsedInJets[i].energy() > 1.0)
2530  TotalUnclusteredE += TowerNotUsedInJets[i].energy();
2531  }
2532 
2533  h_TotalClusteredE->Fill(TotalClusteredE);
2534  h_TotalUnclusteredE->Fill(TotalUnclusteredE);
2535  h_TotalUnclusteredEt->Fill(SumEtNotJets);
2536 
2537  // ********************************
2538  // *** CaloMET
2539  // ********************************
2540 
2542  evt.getByLabel("met", calometcoll);
2543  if (calometcoll.isValid()) {
2544  const CaloMETCollection *calometcol = calometcoll.product();
2545  const CaloMET *calomet;
2546  calomet = &(calometcol->front());
2547 
2548  double caloSumET = calomet->sumEt();
2549  double caloMET = calomet->pt();
2550  double caloMETSig = calomet->mEtSig();
2551  double caloMEx = calomet->px();
2552  double caloMEy = calomet->py();
2553  double caloMETPhi = calomet->phi();
2554 
2555  SumEt->Fill(caloSumET);
2556  MET->Fill(caloMET);
2557  if (std::abs(OER) > 0.8) OERMET->Fill(caloMET);
2558 
2559  if (evtType == 0) MET_Tower->Fill(caloMET);
2560  if (evtType == 1) MET_RBX->Fill(caloMET);
2561  if (evtType == 2) MET_HPD->Fill(caloMET);
2562  METSig->Fill(caloMETSig);
2563  MEx->Fill(caloMEx);
2564  MEy->Fill(caloMEy);
2565  METPhi->Fill(caloMETPhi);
2566 
2567  /***
2568  double caloEz = calomet->e_longitudinal();
2569 
2570  double caloMaxEtInEMTowers = calomet->maxEtInEmTowers();
2571  double caloMaxEtInHadTowers = calomet->maxEtInHadTowers();
2572  double caloEtFractionHadronic = calomet->etFractionHadronic();
2573  double caloEmEtFraction = calomet->emEtFraction();
2574 
2575  double caloHadEtInHB = calomet->hadEtInHB();
2576  double caloHadEtInHO = calomet->hadEtInHO();
2577  double caloHadEtInHE = calomet->hadEtInHE();
2578  double caloHadEtInHF = calomet->hadEtInHF();
2579  double caloEmEtInEB = calomet->emEtInEB();
2580  double caloEmEtInEE = calomet->emEtInEE();
2581  double caloEmEtInHF = calomet->emEtInHF();
2582  ****/
2583  }
2584 
2585  // ********************************
2586  // *** Vertex
2587  // ********************************
2588  VTX = INVALID;
2589  nVTX = 0;
2590 
2592  evt.getByLabel("offlinePrimaryVertices", vertexCollection);
2593  const reco::VertexCollection vC = *(vertexCollection.product());
2594 
2595  // std::cout << "Reconstructed "<< vC.size() << " vertices" << std::endl ;
2596  nVTX = vC.size();
2597  //double vertex_numTrks;
2598  for (reco::VertexCollection::const_iterator vertex=vC.begin(); vertex!=vC.end(); vertex++){
2599 
2600  h_Vx->Fill(vertex->x());
2601  h_Vy->Fill(vertex->y());
2602  h_Vz->Fill(vertex->z());
2603  VTX = vertex->z();
2604  // vertex_numTrks = vertex->tracksSize();
2605  // h_VNTrks->Fill(vertex_numTrks);
2606 
2607  }
2608 
2609  if ((HF_PMM != INVALID) || (nVTX > 0)) {
2610  HFvsZ->Fill(HF_PMM,VTX);
2611  }
2612 
2613  // ********************************
2614  // *** Pixel Clusters
2615  // ********************************
2616  // edm::Handle< edmNew::DetSetVector<SiPixelCluster> > hClusterColl;
2617  // evt.getByLabel("siPixelClusters", hClusterColl);
2618  // const edmNew::DetSetVector<SiPixelCluster> clustColl = *(hClusterColl.product());
2619 
2620  SiClusters->Fill(clustColl.size());
2621 
2622  // ********************************
2623  // *** Tracks
2624  // ********************************
2625  // edm::Handle<reco::TrackCollection> trackCollection;
2626  // evt.getByLabel("ctfWithMaterialTracks", trackCollection);
2627  // evt.getByLabel("generalTracks", trackCollection);
2628  // const reco::TrackCollection tC = *(trackCollection.product());
2629 
2630  // std::cout << "ANA: Reconstructed "<< tC.size() << " tracks" << std::endl ;
2631 
2632  // *************************************
2633  /*****
2634  //Get the Vertex Collection
2635  edm::Handle<std::vector<reco::Vertex> > verticies; evt.getByLabel("offlinePrimaryVertices", verticies);
2636 
2637  //Fill the variables
2638  int _ntracksw5 = 0;
2639  for (std::vector<reco::Vertex>::const_iterator it = verticies->begin(); it != verticies->end(); ++it) {
2640 
2641  // ntracks->push_back(int(it->tracksSize())); //all tracks considered for vertexing
2642  // isvalid->push_back(int(it->isValid()));
2643  // isfake->push_back(int(it->isFake()));
2644 
2645  if(it->tracksSize() > 0) {
2646  std::vector<TrackBaseRef>::const_iterator trackIt;
2647  for( trackIt = it->tracks_begin(); trackIt != it->tracks_end(); trackIt++) {
2648  if(fabs((**trackIt).charge()) <= 1.) {
2649  //tracks that contribute with more than 0.5 weight in vertex reconstruction
2650  if (it->trackWeight(*trackIt) >= 0.5 )
2651  _ntracksw5++;
2652  }
2653  }
2654  }
2655  }
2656  *****/
2657  // *************************************
2658 
2659 
2660  h_Trk_NTrk->Fill(tC.size());
2661  if (NPMTHits == 0) TrkMultFlagged0->Fill(tC.size());
2662  if (NPMTHits == 1) TrkMultFlagged1->Fill(tC.size());
2663  if (NPMTHits == 2) TrkMultFlagged2->Fill(tC.size());
2664  if (NPMTHits == 3) TrkMultFlagged3->Fill(tC.size());
2665  if (NPMTHits == 4) TrkMultFlagged4->Fill(tC.size());
2666  if (NPMTHits > 1) TrkMultFlaggedM->Fill(tC.size());
2667  for (reco::TrackCollection::const_iterator track=tC.begin(); track!=tC.end(); track++){
2668  h_Trk_pt->Fill(track->pt());
2669  }
2670 
2671 
2672  /****
2673  std::cout << "Track number "<< i << std::endl ;
2674  std::cout << "\tmomentum: " << track->momentum()<< std::endl;
2675  std::cout << "\tPT: " << track->pt()<< std::endl;
2676  std::cout << "\tvertex: " << track->vertex()<< std::endl;
2677  std::cout << "\timpact parameter: " << track->d0()<< std::endl;
2678  std::cout << "\tcharge: " << track->charge()<< std::endl;
2679  std::cout << "\tnormalizedChi2: " << track->normalizedChi2()<< std::endl;
2680 
2681  cout<<"\tFrom EXTRA : "<<endl;
2682  cout<<"\t\touter PT "<< track->outerPt()<<endl;
2683  std::cout << "\t direction: " << track->seedDirection() << std::endl;
2684  ****/
2685 
2686  // ********************************
2687  // *** Photons
2688  // ********************************
2689  /***
2690  edm::Handle<reco::PhotonCollection> photonCollection;
2691  evt.getByLabel("photons", photonCollection);
2692  const reco::PhotonCollection pC = *(photonCollection.product());
2693 
2694  std::cout << "Reconstructed "<< pC.size() << " photons" << std::endl ;
2695  for (reco::PhotonCollection::const_iterator photon=pC.begin(); photon!=pC.end(); photon++){
2696  }
2697  ***/
2698 
2699  // ********************************
2700  // *** Muons
2701  // ********************************
2702  /***
2703  edm::Handle<reco::MuonCollection> muonCollection;
2704  evt.getByLabel("muons", muonCollection);
2705 
2706  const reco::MuonCollection mC = *(muonCollection.product());
2707 
2708  std::cout << "Reconstructed "<< mC.size() << " muons" << std::endl ;
2709  for (reco::MuonCollection::const_iterator muon=mC.begin(); muon!=mC.end(); muon++){
2710  }
2711  ***/
2712 
2713 
2714 
2715 
2716  // ********************************
2717  // *** Events passing seletion cuts
2718  // ********************************
2719 
2720  // --- Cosmic Cleanup
2721  // --- Vertex
2722  // --- Eta
2723 
2724  int iJet;
2725  iJet = 0;
2726  for( CaloJetCollection::const_iterator ijet = caloJets->begin(); ijet != caloJets->end(); ++ ijet ) {
2727 
2728  // if ( (fabs(ijet->eta()) < 1.3) &&
2729  // (fabs(ijet->pt()) > 20.) ) {
2730 
2731  // (ijet->emEnergyFraction() > 0.01) &&
2732  // (ijet->emEnergyFraction() > 0.99) ) {
2733 
2734  iJet++;
2735  // if (iJet == 1) {
2736  // cout << " CaloJet: Event Type = " << evtType
2737  // << " pt = " << ijet->pt()
2738  // << endl;
2739  // }
2740  h_pt->Fill(ijet->pt());
2741  if (evtType == 0) h_ptTower->Fill(ijet->pt());
2742  if (evtType == 1) h_ptRBX->Fill(ijet->pt());
2743  if (evtType == 2) h_ptHPD->Fill(ijet->pt());
2744  h_et->Fill(ijet->et());
2745  h_eta->Fill(ijet->eta());
2746  h_phi->Fill(ijet->phi());
2747 
2748  jetHOEne->Fill(ijet->hadEnergyInHO());
2749  jetEMFraction->Fill(ijet->emEnergyFraction());
2750 
2751  // }
2752  }
2753 
2754 
2755 
2756  //*****************************
2757  //*** Get the GenJet collection
2758  //*****************************
2759 
2760  /**************
2761  Handle<GenJetCollection> genJets;
2762  evt.getByLabel( GenJetAlgorithm, genJets );
2763 
2764  //Loop over the two leading GenJets and fill some histograms
2765  jetInd = 0;
2766  allJetInd = 0;
2767  for( GenJetCollection::const_iterator gen = genJets->begin(); gen != genJets->end(); ++ gen ) {
2768  allJetInd++;
2769  if (allJetInd == 1) {
2770  p4tmp[0] = gen->p4();
2771  }
2772  if (allJetInd == 2) {
2773  p4tmp[1] = gen->p4();
2774  }
2775 
2776  if ( (allJetInd == 1) || (allJetInd == 2) ) {
2777  h_ptGenL->Fill( gen->pt() );
2778  h_etaGenL->Fill( gen->eta() );
2779  h_phiGenL->Fill( gen->phi() );
2780  }
2781 
2782  if ( gen->pt() > minJetPt) {
2783  // std::cout << "GEN JET1 #" << jetInd << std::endl << gen->print() << std::endl;
2784  h_ptGen->Fill( gen->pt() );
2785  h_etaGen->Fill( gen->eta() );
2786  h_phiGen->Fill( gen->phi() );
2787  jetInd++;
2788  }
2789  }
2790 
2791  h_nGenJets->Fill( jetInd );
2792  *******/
2793  }
2794 
2795 }
2796 
2797 // ***********************************
2798 // ***********************************
2800 
2801  for (int i=0; i<4000; i++) {
2802  if ((nBNC[i]/totBNC) > 0.05) {
2803  std::cout << "+++ " << i << " "
2804  << (nBNC[i]/totBNC) << " "
2805  << nBNC[i] << " "
2806  << totBNC << " "
2807  << std::endl;
2808  }
2809  }
2810 
2811 
2812 }
TH1F * MET_HPD
Definition: myJetAna.h:328
TProfile * HFTimeVsiEtaM20
Definition: myJetAna.h:483
RunNumber_t run() const
Definition: EventID.h:42
TH1F * HFTimeTh
Definition: myJetAna.h:178
void getManyByType(std::vector< Handle< PROD > > &results) const
Definition: Event.h:395
TH1F * HETimeTh1Flagged2
Definition: myJetAna.h:145
TH1F * HFEtaFlagged
Definition: myJetAna.h:238
TH1F * HBTimeTh1
Definition: myJetAna.h:101
TH1F * HFSEneNoLFlaggedN
Definition: myJetAna.h:219
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
TH1F * TrkMultFlagged1
Definition: myJetAna.h:187
TH1F * h_pt
Definition: myJetAna.h:64
TH1F * EEEneX
Definition: myJetAna.h:281
TH1F * HBEneOOTTh1
Definition: myJetAna.h:84
TH1F * h_jet1Eta
Definition: myJetAna.h:422
TH1F * NTotal
Definition: myJetAna.h:446
TProfile * HFTimeVsiEtaM
Definition: myJetAna.h:479
TH1F * st_EmEnergy
Definition: myJetAna.h:436
int i
Definition: DBlmapReader.cc:9
TH1F * HFTimeM
Definition: myJetAna.h:206
TH1F * EEnegTime
Definition: myJetAna.h:289
TH1F * HFEneTh
Definition: myJetAna.h:160
TH1F * HETimeX
Definition: myJetAna.h:148
TH1F * HOEneOOTTh1
Definition: myJetAna.h:87
TH2F * ECALvHCALEta3
Definition: myJetAna.h:472
double emEnergy
Definition: myFilter.cc:63
TProfile * HFTimeVsiEtaP20
Definition: myJetAna.h:482
TH1F * HBEne
Definition: myJetAna.h:94
TH1F * h_ptCal
Definition: myJetAna.h:396
TH1F * HFTimeTh1Flagged3
Definition: myJetAna.h:175
TH1F * totEneLeadJetEta3
Definition: myJetAna.h:367
TH1F * HBTimeTh
Definition: myJetAna.h:100
TH1F * hadFracEta1
Definition: myJetAna.h:375
TH1F * RBX_nTowers
Definition: myJetAna.h:310
TH1F * HOHrp2Time
Definition: myJetAna.h:270
double et
Definition: myFilter.cc:61
TH1F * st_Frac
Definition: myJetAna.h:443
TH2F * HETvsE
Definition: myJetAna.h:223
TH1F * HFTimeTh1
Definition: myJetAna.h:179
TH1F * HFTimeTh1R
Definition: myJetAna.h:183
TH1F * nTowersLeadJetPt2
Definition: myJetAna.h:361
TH1F * HBTimeTh2
Definition: myJetAna.h:102
TH1F * MET_Tower
Definition: myJetAna.h:326
TH1F * HOHrm1Time
Definition: myJetAna.h:264
TH1F * HFRecHitTime
Definition: myJetAna.h:451
TH1F * HBTimeTh2Flagged2
Definition: myJetAna.h:117
TH1F * HFTimeTh2R
Definition: myJetAna.h:184
TH1F * HFEtaFlaggedSN
Definition: myJetAna.h:242
TH1F * h_ClusteredE
Definition: myJetAna.h:417
TH1F * HEposTime
Definition: myJetAna.h:150
TH1F * h_nCalJets
Definition: myJetAna.h:383
TH1F * HBTimeTh1Flagged2
Definition: myJetAna.h:116
TH1F * h_phiGenL
Definition: myJetAna.h:406
TH1F * HOHrp1Time
Definition: myJetAna.h:268
TH1F * nTowers4
Definition: myJetAna.h:359
TH1F * HFEneM
Definition: myJetAna.h:205
TH2F * HBocc
Definition: myJetAna.h:246
TH1F * hitEtaEt
Definition: myJetAna.h:390
TH1F * RBX_N
Definition: myJetAna.h:311
TH1F * HFTimeFlagged3
Definition: myJetAna.h:173
TH1F * h_nGenJets
Definition: myJetAna.h:384
TH1F * HOEneOOT
Definition: myJetAna.h:77
TH1F * h_etaGenL
Definition: myJetAna.h:405
TH1F * HFEneTThr
Definition: myJetAna.h:92
TH1F * h_et
Definition: myJetAna.h:68
TH1F * h_EMFracCal
Definition: myJetAna.h:395
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
TH1F * HETimeThFlagged2
Definition: myJetAna.h:144
TH1F * HFLEneNoSFlagged
Definition: myJetAna.h:209
TH1F * hadFracEta2
Definition: myJetAna.h:376
TH1F * HOTime
Definition: myJetAna.h:236
TProfile * HFTimeVsiEtaP
Definition: myJetAna.h:478
TH1F * EEEneY
Definition: myJetAna.h:282
TH1F * HFTimeTh3
Definition: myJetAna.h:181
TProfile * HFEtaNFlagged
Definition: myJetAna.h:244
TH1F * EETime
Definition: myJetAna.h:285
TH1F * HFRecHitEne
Definition: myJetAna.h:449
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
TH1F * HEEneX
Definition: myJetAna.h:124
double emEnergy
Definition: myFilter.cc:54
TH1F * EBTimeTh
Definition: myJetAna.h:276
TH1F * hf_TowerJetEt
Definition: myJetAna.h:351
TH1F * HFLEneNoSFlaggedN
Definition: myJetAna.h:210
TH1F * HFSEneAllF
Definition: myJetAna.h:213
TH1F * totEneLeadJetEta2
Definition: myJetAna.h:366
TH1F * HFLTime
Definition: myJetAna.h:211
TH1F * HFEnePMT1
Definition: myJetAna.h:155
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
std::vector< T >::const_iterator const_iterator
TH1F * HFTimeThFlaggedR
Definition: myJetAna.h:195
int bunchCrossing() const
Definition: EventBase.h:62
TH1F * HEEneTh
Definition: myJetAna.h:122
TH1F * HBTimeY
Definition: myJetAna.h:120
TH1F * h_ptRBX
Definition: myJetAna.h:66
#define abs(x)
Definition: mlp_lapack.h:159
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
double hadEnergy
Definition: myFilter.cc:62
TH1F * HBTimeTh3
Definition: myJetAna.h:103
TH1F * HOHr0Time
Definition: myJetAna.h:262
TH2F * HOTvsE
Definition: myJetAna.h:230
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
int nTowers
Definition: myFilter.cc:57
TH1F * HFEnePMT2
Definition: myJetAna.h:156
TH1F * h_TotalUnclusteredE
Definition: myJetAna.h:415
TH2F * h_EmEnergy
Definition: myJetAna.h:430
TH1F * towerEmEnHF
Definition: myJetAna.h:301
TH1F * HOHrp1Ene
Definition: myJetAna.h:267
TH1F * HFTimeThFlaggedR3
Definition: myJetAna.h:198
TH2F * HOocc
Definition: myJetAna.h:245
TH1F * HETimeTh
Definition: myJetAna.h:129
TH1F * HEEneTh1
Definition: myJetAna.h:123
TH1F * HFLEne
Definition: myJetAna.h:207
TH1F * HFSEneNoL
Definition: myJetAna.h:217
TH1F * HOEneTh
Definition: myJetAna.h:234
TH1F * EEnegEne
Definition: myJetAna.h:283
TH1F * HETimeTh2
Definition: myJetAna.h:131
TH1F * ETime
Definition: myJetAna.h:353
TH1F * HFTimePMa
Definition: myJetAna.h:203
TH1F * HBTimeTh3R
Definition: myJetAna.h:107
TH1F * h_Trk_NTrk
Definition: myJetAna.h:346
TH1F * EETimeY
Definition: myJetAna.h:288
TH1F * HETimeFlagged
Definition: myJetAna.h:138
TH1F * h_Trk_pt
Definition: myJetAna.h:345
float totBNC
Definition: myJetAna.cc:114
TH1F * HEEne
Definition: myJetAna.h:121
HPD HPDColl[144]
Definition: myJetAna.cc:117
#define INVALID
Definition: myJetAna.cc:89
TH1F * caloEtaEt
Definition: myJetAna.h:386
TH2F * ECALvHCALEta2
Definition: myJetAna.h:471
TH1F * HBTimeTh2R
Definition: myJetAna.h:106
tuple vertexCollection
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
TH1F * HBTimeTh1Flagged
Definition: myJetAna.h:111
TH1F * HBTime
Definition: myJetAna.h:99
void analyze(const edm::Event &, const edm::EventSetup &)
Definition: myJetAna.cc:599
TH1F * HFEtaFlaggedLN
Definition: myJetAna.h:240
TH1F * HFSEneNoLFlagged
Definition: myJetAna.h:218
TH1F * towerEmFrac
Definition: myJetAna.h:305
TH1F * OERMET
Definition: myJetAna.h:325
TH1F * nTowers2
Definition: myJetAna.h:357
TH1F * HFTimeTh3Flagged
Definition: myJetAna.h:194
TH1F * h_jet1Pt
Definition: myJetAna.h:420
TH2F * EEvHE
Definition: myJetAna.h:468
double et
Definition: myFilter.cc:52
TH1F * HPD_hcalTime
Definition: myJetAna.h:315
TH1F * HFDigiTimeNHits
Definition: myJetAna.h:464
float nBNC[4000]
Definition: myJetAna.cc:114
TH2F * EBvHB
Definition: myJetAna.h:467
TH1F * h_eta
Definition: myJetAna.h:69
TH1F * HOTimeTh
Definition: myJetAna.h:237
TH1F * EEEne
Definition: myJetAna.h:279
TH1F * HFTimePM
Definition: myJetAna.h:204
Collection of Calo MET.
TH1F * HFDigiTimeEne
Definition: myJetAna.h:460
TH1F * EBTimeY
Definition: myJetAna.h:278
TH1F * HFSEne
Definition: myJetAna.h:216
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
struct HPD_struct HPD
TH1F * HOEne
Definition: myJetAna.h:233
TH1F * HPD_nTowers
Definition: myJetAna.h:316
TH1F * HFLEneAll
Definition: myJetAna.h:214
TH1F * EETimeTh
Definition: myJetAna.h:286
TH2F * h_HadEnergy
Definition: myJetAna.h:431
TH1F * towerOuterEn
Definition: myJetAna.h:303
TProfile * EMF_EtaX
Definition: myJetAna.h:476
int nTowers
Definition: myFilter.cc:67
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
TH1F * EBEneY
Definition: myJetAna.h:274
TH1F * HFLSRatio
Definition: myJetAna.h:152
RBX RBXColl[36]
Definition: myJetAna.cc:116
double mEtSig() const
Definition: MET.h:50
TH1F * HPD_hadEnergy
Definition: myJetAna.h:314
TH1F * HFMET
Definition: myJetAna.h:321
TH1F * HTime
Definition: myJetAna.h:354
TH1F * EBTime
Definition: myJetAna.h:275
TH1F * TrkMultFlagged0
Definition: myJetAna.h:186
double sumEt() const
Definition: MET.h:48
TH1F * jetHOEne
Definition: myJetAna.h:426
TH1F * HBTimeThFlagged
Definition: myJetAna.h:110
TH1F * HFTimeTh3Flagged2
Definition: myJetAna.h:172
std::string CaloJetAlgorithm
Definition: myJetAna.h:56
TH1F * h_jet2Pt
Definition: myJetAna.h:421
TH1F * HFTime
Definition: myJetAna.h:165
TH1F * HBTimeThR
Definition: myJetAna.h:104
TH1F * HFTimeTh2Flagged
Definition: myJetAna.h:193
TH1F * h_TotalUnclusteredEt
Definition: myJetAna.h:412
TH1F * h_Vz
Definition: myJetAna.h:340
TH1F * TrkMultFlagged2
Definition: myJetAna.h:188
TH1F * HFEneTh1
Definition: myJetAna.h:161
edm::InputTag theTriggerResultsLabel
Definition: myJetAna.h:58
accept
Definition: HLTenums.h:22
TH1F * jetEMFraction
Definition: myJetAna.h:427
TH1F * HFTimeThFlaggedR2
Definition: myJetAna.h:197
TH1F * h_ptGenL
Definition: myJetAna.h:404
TH1F * HFSEneAll
Definition: myJetAna.h:212
TH1F * HFTimeTh1Flagged2
Definition: myJetAna.h:170
TH1F * h_TotalClusteredE
Definition: myJetAna.h:418
TH1F * HEEneTThr
Definition: myJetAna.h:91
TH1F * HETime
Definition: myJetAna.h:128
Definition: MET.h:32
TH1F * HBEneY
Definition: myJetAna.h:98
TH1F * hf_sumTowerAllEy
Definition: myJetAna.h:350
TH2F * HFTvsEFlagged2Thr
Definition: myJetAna.h:229
T sqrt(T t)
Definition: SSEVec.h:48
TH1F * HETimeTh1Flagged
Definition: myJetAna.h:140
TH1F * NPass
Definition: myJetAna.h:445
TH1F * HFLongShortNHits
Definition: myJetAna.h:463
TH2F * HEoccOOT
Definition: myJetAna.h:255
TH1F * st_Constituents
Definition: myJetAna.h:434
TH1F * HBEneOOT
Definition: myJetAna.h:74
TH1F * HFSTime
Definition: myJetAna.h:232
TProfile * EMF_Eta
Definition: myJetAna.h:474
TH1F * hadEneLeadJetEta2
Definition: myJetAna.h:369
TH1F * HFTimeP
Definition: myJetAna.h:202
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TH1F * HEposEne
Definition: myJetAna.h:126
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
float ecalTime
Definition: myFilter.cc:66
TH1F * HBEneTThr
Definition: myJetAna.h:90
TH1F * HFTimeThFlagged2
Definition: myJetAna.h:169
TH1F * HBTimeFlagged2
Definition: myJetAna.h:114
TH1F * HETimeTh3R
Definition: myJetAna.h:136
TH1F * st_iEta
Definition: myJetAna.h:441
TH1F * HFTimePMT1
Definition: myJetAna.h:163
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
TH1F * h_Vy
Definition: myJetAna.h:339
TH1F * HEEneOOTTh1
Definition: myJetAna.h:85
TH1F * HEEneOOT
Definition: myJetAna.h:75
TH1F * HFTimeThFlaggedR1
Definition: myJetAna.h:196
TH2F * HFoccFlagged
Definition: myJetAna.h:251
int j
Definition: DBlmapReader.cc:9
TH2F * HEocc
Definition: myJetAna.h:247
TH1F * TrkMultFlaggedM
Definition: myJetAna.h:191
TH2F * HFoccFlagged2
Definition: myJetAna.h:252
TH1F * HFTimeTh2Flagged3
Definition: myJetAna.h:176
TH1F * h_jet1PtHLT
Definition: myJetAna.h:424
TH1F * h_etaCal
Definition: myJetAna.h:397
TH1F * h_UnclusteredEts
Definition: myJetAna.h:411
TH1F * st_OuterEnergy
Definition: myJetAna.h:438
TH1F * HFTimeFlagged2
Definition: myJetAna.h:168
TH1F * PMTHits
Definition: myJetAna.h:166
TH1F * HFEneOOTTh
Definition: myJetAna.h:81
int orbitNumber() const
Definition: EventBase.h:63
TH1F * HPD_N
Definition: myJetAna.h:317
TH1F * HOHrm2Ene
Definition: myJetAna.h:265
TH1F * HFTimeThR
Definition: myJetAna.h:182
TH1F * towerEmEnHE
Definition: myJetAna.h:300
TProfile * EMF_Phi
Definition: myJetAna.h:473
TH1F * HOHTime
Definition: myJetAna.h:260
TH2F * ECALvHCAL
Definition: myJetAna.h:469
TH1F * h_jet2Eta
Definition: myJetAna.h:423
TH2F * HFTvsEThr
Definition: myJetAna.h:227
bool isValid() const
Definition: HandleBase.h:76
TH1F * totEneLeadJetEta1
Definition: myJetAna.h:365
TH1F * HFEtaFlaggedL
Definition: myJetAna.h:239
void beginJob()
Definition: myJetAna.cc:137
TH1F * HOHr0Ene
Definition: myJetAna.h:261
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
TH1F * st_Eta
Definition: myJetAna.h:439
TH1F * RBX_hcalTime
Definition: myJetAna.h:309
TH1F * HBTimeFlagged
Definition: myJetAna.h:109
TH1F * HFTimeTh3Flagged3
Definition: myJetAna.h:177
TH2F * HOoccOOT
Definition: myJetAna.h:253
TH1F * HOSEne
Definition: myJetAna.h:257
TH1F * HETimeTh2Flagged
Definition: myJetAna.h:141
TH1F * towerHadEnHB
Definition: myJetAna.h:295
TProfile * EMF_PhiX
Definition: myJetAna.h:475
TH1F * HETimeThR
Definition: myJetAna.h:133
TH1F * HETimeTh1
Definition: myJetAna.h:130
TH1F * HFRecHitEneClean
Definition: myJetAna.h:450
TH1F * hadFracEta3
Definition: myJetAna.h:377
TH1F * HFEneFlagged
Definition: myJetAna.h:158
TH2F * HFoccTime
Definition: myJetAna.h:249
TH1F * nTowers1
Definition: myJetAna.h:356
TH1F * HOHEne
Definition: myJetAna.h:259
TH1F * EBEne
Definition: myJetAna.h:271
TH2F * HFTvsE
Definition: myJetAna.h:224
float hcalTime
Definition: myFilter.cc:55
TH1F * HETimeThFlagged
Definition: myJetAna.h:139
TH1F * HBTimeTh2Flagged
Definition: myJetAna.h:112
TH1F * EBTimeX
Definition: myJetAna.h:277
#define M_PI
Definition: BFit3D.cc:3
TH1F * h_nTowersCal
Definition: myJetAna.h:394
TH1F * hf_sumTowerAllEx
Definition: myJetAna.h:349
TH2F * HFTvsEFlaggedThr
Definition: myJetAna.h:228
TH1F * HFDigiTimeTime
Definition: myJetAna.h:461
struct RBX_struct RBX
TH1F * HOSTime
Definition: myJetAna.h:258
TH1F * HOHrm2Time
Definition: myJetAna.h:266
TH1F * MEy
Definition: myJetAna.h:331
TH1F * HFTimeThFlaggedR4
Definition: myJetAna.h:199
TH1F * hitPhi
Definition: myJetAna.h:392
TH2F * HFTvsEFlagged
Definition: myJetAna.h:225
TH1F * HFTimeFlagged
Definition: myJetAna.h:167
TH1F * HFEnePMT0
Definition: myJetAna.h:154
TH1F * HFLongShortTime
Definition: myJetAna.h:456
TH1F * TrkMultFlagged3
Definition: myJetAna.h:189
TH1F * METPhi
Definition: myJetAna.h:332
TH1F * TrkMultFlagged4
Definition: myJetAna.h:190
TH1F * SumEt
Definition: myJetAna.h:323
TH1F * st_iPhi
Definition: myJetAna.h:442
TH1F * NTime
Definition: myJetAna.h:447
TH1F * RBX_et
Definition: myJetAna.h:307
TH1F * emEneLeadJetEta2
Definition: myJetAna.h:372
TH1F * nTowersLeadJetPt4
Definition: myJetAna.h:363
TH1F * HBEneTh1
Definition: myJetAna.h:96
TH1F * towerHadEnHE
Definition: myJetAna.h:296
TH1F * HETimeTh1R
Definition: myJetAna.h:134
TH1F * RBX_hadEnergy
Definition: myJetAna.h:308
TH1F * HETimeTh2Flagged2
Definition: myJetAna.h:146
TH1F * h_ptTower
Definition: myJetAna.h:65
TH1F * HOEneOOTTh
Definition: myJetAna.h:82
TH1F * HETimeFlagged2
Definition: myJetAna.h:143
double hadEnergy
Definition: myFilter.cc:53
T const * product() const
Definition: Handle.h:74
TH1F * h_jetEt
Definition: myJetAna.h:408
TH1F * towerHadEn
Definition: myJetAna.h:298
TH2F * HFEtaPhiNFlagged
Definition: myJetAna.h:250
TH1F * h_phiCal
Definition: myJetAna.h:398
TH1F * HFDigiTimePhi
Definition: myJetAna.h:458
TProfile * HFTimeVsiEtaM5
Definition: myJetAna.h:481
TH2F * HFoccOOT
Definition: myJetAna.h:256
TH1F * h_etaGen
Definition: myJetAna.h:401
TH1F * HBTimeTh1R
Definition: myJetAna.h:105
TH1F * HFLongShortEne
Definition: myJetAna.h:455
TH1F * HBEneOOTTh
Definition: myJetAna.h:79
TH2F * HFocc
Definition: myJetAna.h:248
edm::InputTag hcalNoiseSummaryTag_
Definition: myJetAna.h:59
TH1F * EBEneTh
Definition: myJetAna.h:272
TH1F * HEnegTime
Definition: myJetAna.h:151
edm::EventID id() const
Definition: EventBase.h:56
TH1F * h_Vx
Definition: myJetAna.h:338
float hcalTime
Definition: myFilter.cc:65
TH1F * HETimeY
Definition: myJetAna.h:149
TH1F * HFTimeThFlaggedRM
Definition: myJetAna.h:200
TH1F * HFEneOOTTh1
Definition: myJetAna.h:86
TH1F * HFDigiTimeEta
Definition: myJetAna.h:459
TH1F * HFSumEt
Definition: myJetAna.h:320
TH1F * HFTimeThFlagged3
Definition: myJetAna.h:174
TH1F * h_UnclusteredEt
Definition: myJetAna.h:410
TH1F * caloPhi
Definition: myJetAna.h:388
TH1F * EEposEne
Definition: myJetAna.h:284
TH1F * MET_RBX
Definition: myJetAna.h:327
TH1F * h_ptHPD
Definition: myJetAna.h:67
TH1F * SiClusters
Definition: myJetAna.h:335
TH1F * HBEneX
Definition: myJetAna.h:97
TH1F * h_phi
Definition: myJetAna.h:70
float ecalTime
Definition: myFilter.cc:56
TH1F * h_VNTrks
Definition: myJetAna.h:341
TH1F * HBEneTh
Definition: myJetAna.h:95
TH1F * HFLongShortEta
Definition: myJetAna.h:454
TH1F * HFLEneAllF
Definition: myJetAna.h:215
TH2F * ECALvHCALEta1
Definition: myJetAna.h:470
TH1F * HFTimeTh2Flagged2
Definition: myJetAna.h:171
TH1F * towerEmEnHB
Definition: myJetAna.h:299
TH1F * st_Energy
Definition: myJetAna.h:435
TH1F * towerEmEn
Definition: myJetAna.h:302
T * make() const
make new ROOT object
TH1F * NTowers
Definition: myJetAna.h:428
TH1F * towerHadEnHF
Definition: myJetAna.h:297
TH1F * HOHrm1Ene
Definition: myJetAna.h:263
TH1F * hitEta
Definition: myJetAna.h:391
TH1F * HEnegEne
Definition: myJetAna.h:127
TH1F * dijetMass
Definition: myJetAna.h:381
TH1F * HBTimeThFlagged2
Definition: myJetAna.h:115
myJetAna(const edm::ParameterSet &)
Definition: myJetAna.cc:125
TH1F * h_ptGen
Definition: myJetAna.h:400
TH1F * HFEtaFlaggedS
Definition: myJetAna.h:241
TH1F * HEEneY
Definition: myJetAna.h:125
TH1F * HPD_et
Definition: myJetAna.h:313
TH1F * nTowersLeadJetPt3
Definition: myJetAna.h:362
tuple cout
Definition: gather_cfg.py:121
TH1F * st_Phi
Definition: myJetAna.h:440
TH1F * caloEta
Definition: myJetAna.h:387
TH1F * st_Pt
Definition: myJetAna.h:433
TH1F * HEEneOOTTh
Definition: myJetAna.h:80
#define DEBUG
Definition: myJetAna.cc:90
TH1F * HOEneTh1
Definition: myJetAna.h:235
TH1F * HFEneP
Definition: myJetAna.h:201
TH1F * HFEne
Definition: myJetAna.h:157
TH1F * hadEneLeadJetEta1
Definition: myJetAna.h:368
TH1F * HFTimeThFlagged
Definition: myJetAna.h:192
TH1F * st_HadEnergy
Definition: myJetAna.h:437
TProfile * HFTimeVsiEtaP5
Definition: myJetAna.h:480
TH1F * EBEneX
Definition: myJetAna.h:273
TH2F * HFvsZ
Definition: myJetAna.h:466
TH1F * HBTimeX
Definition: myJetAna.h:119
TH1F * HFLEneNoS
Definition: myJetAna.h:208
virtual float pt() const GCC11_FINAL
transverse momentum
TH1F * HETimeTh3
Definition: myJetAna.h:132
TH1F * HFTimePMT0
Definition: myJetAna.h:162
TH1F * HFEneOOT
Definition: myJetAna.h:76
TH1F * emEneLeadJetEta3
Definition: myJetAna.h:373
TH2F * HBTvsE
Definition: myJetAna.h:222
TH1F * HETimeTh2R
Definition: myJetAna.h:135
TH1F * HFLongShortPhi
Definition: myJetAna.h:453
TH1F * hadEneLeadJetEta3
Definition: myJetAna.h:370
TH1F * h_UnclusteredE
Definition: myJetAna.h:414
TH1F * HFOERatio
Definition: myJetAna.h:153
void endJob()
Definition: myJetAna.cc:2799
TH1F * EEposTime
Definition: myJetAna.h:290
TH1F * nTowersLeadJetPt1
Definition: myJetAna.h:360
TH1F * HOHrp2Ene
Definition: myJetAna.h:269
TH1F * HFTimeTh2
Definition: myJetAna.h:180
TH1F * HFTimeTh3R
Definition: myJetAna.h:185
TH1F * MEx
Definition: myJetAna.h:330
TH1F * HFTimePMT2
Definition: myJetAna.h:164
TH1F * METSig
Definition: myJetAna.h:329
TH2F * HBoccOOT
Definition: myJetAna.h:254
TH1F * EETimeX
Definition: myJetAna.h:287
TH1F * h_phiGen
Definition: myJetAna.h:402
TH1F * HFEneFlagged2
Definition: myJetAna.h:159
TH2F * HFTvsEFlagged2
Definition: myJetAna.h:226
TH1F * nTowers3
Definition: myJetAna.h:358
TH1F * EEEneTh
Definition: myJetAna.h:280
Definition: DDAxes.h:10
TH1F * emEneLeadJetEta1
Definition: myJetAna.h:371
TH2F * HFLvsS
Definition: myJetAna.h:220