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