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 
18 
23 
24 
31 
35 
38 
41 
42 // #include "DataFormats/PhotonReco/interface/PhotonFwd.h"
43 // #include "DataFormats/PhotonReco/interface/Photon.h"
44 
45 
48 // #include "DataFormats/HepMCCandidate/interface/GenParticleCandidate.h"
50 // #include "FWCore/Framework/interface/Handle.h"
52 // #include "FWCore/Framework/interface/EventSetup.h"
54 
56 
62 
63 // #include "DataFormats/Scalers/interface/DcsStatus.h"
64 
65 
68 #include <TROOT.h>
69 #include <TSystem.h>
70 #include <TFile.h>
71 #include <TCanvas.h>
72 #include <cmath>
73 
74 using namespace edm;
75 using namespace reco;
76 using namespace std;
77 
78 
79 #define INVALID 9999.
80 #define DEBUG false
81 #define MAXJETS 100
82 
83 typedef struct RBX_struct {
84  double et;
85  double hadEnergy;
86  double emEnergy;
87  float hcalTime;
88  float ecalTime;
89  int nTowers;
90 } RBX ;
91 
92 typedef struct HPD_struct {
93  double et;
94  double hadEnergy;
95  double emEnergy;
96  double time;
97  float hcalTime;
98  float ecalTime;
99  int nTowers;
100 } HPD ;
101 
102 
103 
104 float totBNC, nBNC[4000];
105 
108 
109 // ************************
110 // ************************
111 
112 // Get the algorithm of the jet collections we will read from the .cfg file
113 // which defines the value of the strings CaloJetAlgorithm and GenJetAlgorithm.
114 
116  CaloJetAlgorithm( cfg.getParameter<string>( "CaloJetAlgorithm" ) ),
117  GenJetAlgorithm( cfg.getParameter<string>( "GenJetAlgorithm" ) )
118 {
119  theTriggerResultsLabel = cfg.getParameter<edm::InputTag>("TriggerResultsLabel");
120 }
121 
122 
123 // ************************
124 // ************************
125 
127 
128 
129 
131 
132  // --- passed selection cuts
133  h_pt = fs->make<TH1F>( "pt", "Jet p_{T}", 100, 0, 50 );
134  h_ptRBX = fs->make<TH1F>( "ptRBX", "RBX: Jet p_{T}", 100, 0, 50 );
135  h_ptHPD = fs->make<TH1F>( "ptHPD", "HPD: Jet p_{T}", 100, 0, 50 );
136  h_ptTower = fs->make<TH1F>( "ptTower", "Jet p_{T}", 100, 0, 50 );
137  h_et = fs->make<TH1F>( "et", "Jet E_{T}", 100, 0, 50 );
138  h_eta = fs->make<TH1F>( "eta", "Jet #eta", 100, -4, 4 );
139  h_phi = fs->make<TH1F>( "phi", "Jet #phi", 50, -M_PI, M_PI );
140  // ---
141 
142  hitEtaEt = fs->make<TH1F>( "hitEtaEt", "RecHit #eta", 90, -45, 45 );
143  hitEta = fs->make<TH1F>( "hitEta", "RecHit #eta", 90, -45, 45 );
144  hitPhi = fs->make<TH1F>( "hitPhi", "RecHit #phi", 73, 0, 73 );
145 
146  caloEtaEt = fs->make<TH1F>( "caloEtaEt", "CaloTower #eta", 100, -4, 4 );
147  caloEta = fs->make<TH1F>( "caloEta", "CaloTower #eta", 100, -4, 4 );
148  caloPhi = fs->make<TH1F>( "caloPhi", "CaloTower #phi", 50, -M_PI, M_PI );
149 
150  dijetMass = fs->make<TH1F>("dijetMass","DiJet Mass",100,0,100);
151 
152  totEneLeadJetEta1 = fs->make<TH1F>("totEneLeadJetEta1","Total Energy Lead Jet Eta1 1",100,0,1500);
153  totEneLeadJetEta2 = fs->make<TH1F>("totEneLeadJetEta2","Total Energy Lead Jet Eta2 1",100,0,1500);
154  totEneLeadJetEta3 = fs->make<TH1F>("totEneLeadJetEta3","Total Energy Lead Jet Eta3 1",100,0,1500);
155  hadEneLeadJetEta1 = fs->make<TH1F>("hadEneLeadJetEta1","Hadronic Energy Lead Jet Eta1 1",100,0,1500);
156  hadEneLeadJetEta2 = fs->make<TH1F>("hadEneLeadJetEta2","Hadronic Energy Lead Jet Eta2 1",100,0,1500);
157  hadEneLeadJetEta3 = fs->make<TH1F>("hadEneLeadJetEta3","Hadronic Energy Lead Jet Eta3 1",100,0,1500);
158  emEneLeadJetEta1 = fs->make<TH1F>("emEneLeadJetEta1","EM Energy Lead Jet Eta1 1",100,0,1500);
159  emEneLeadJetEta2 = fs->make<TH1F>("emEneLeadJetEta2","EM Energy Lead Jet Eta2 1",100,0,1500);
160  emEneLeadJetEta3 = fs->make<TH1F>("emEneLeadJetEta3","EM Energy Lead Jet Eta3 1",100,0,1500);
161 
162 
163  hadFracEta1 = fs->make<TH1F>("hadFracEta11","Hadronic Fraction Eta1 Jet 1",100,0,1);
164  hadFracEta2 = fs->make<TH1F>("hadFracEta21","Hadronic Fraction Eta2 Jet 1",100,0,1);
165  hadFracEta3 = fs->make<TH1F>("hadFracEta31","Hadronic Fraction Eta3 Jet 1",100,0,1);
166 
167  SumEt = fs->make<TH1F>("SumEt","SumEt",100,0,100);
168  MET = fs->make<TH1F>("MET", "MET",100,0,50);
169  METSig = fs->make<TH1F>("METSig", "METSig",100,0,50);
170  MEx = fs->make<TH1F>("MEx", "MEx",100,-20,20);
171  MEy = fs->make<TH1F>("MEy", "MEy",100,-20,20);
172  METPhi = fs->make<TH1F>("METPhi", "METPhi",315,0,3.15);
173  MET_RBX = fs->make<TH1F>("MET_RBX", "MET",100,0,1000);
174  MET_HPD = fs->make<TH1F>("MET_HPD", "MET",100,0,1000);
175  MET_Tower = fs->make<TH1F>("MET_Tower", "MET",100,0,1000);
176 
177 
178  h_Vx = fs->make<TH1F>("Vx", "Vx",100,-0.5,0.5);
179  h_Vy = fs->make<TH1F>("Vy", "Vy",100,-0.5,0.5);
180  h_Vz = fs->make<TH1F>("Vz", "Vz",100,-20,20);
181  h_VNTrks = fs->make<TH1F>("VNTrks", "VNTrks",10,1,100);
182 
183  h_Trk_pt = fs->make<TH1F>("Trk_pt", "Trk_pt",100,0,20);
184  h_Trk_NTrk = fs->make<TH1F>("Trk_NTrk", "Trk_NTrk",20,0,20);
185 
186  hf_sumTowerAllEx = fs->make<TH1F>("sumTowerAllEx","Tower Ex",100,-1000,1000);
187  hf_sumTowerAllEy = fs->make<TH1F>("sumTowerAllEy","Tower Ey",100,-1000,1000);
188 
189  hf_TowerJetEt = fs->make<TH1F>("TowerJetEt","Tower/Jet Et 1",50,0,1);
190 
191  ETime = fs->make<TH1F>("ETime","Ecal Time",200,-200,200);
192  HTime = fs->make<TH1F>("HTime","Hcal Time",200,-200,200);
193 
194  towerHadEn = fs->make<TH1F>("towerHadEn" ,"Hadronic Energy in Calo Tower",2000,-100,100);
195  towerEmEn = fs->make<TH1F>("towerEmEn" ,"EM Energy in Calo Tower",2000,-100,100);
196  towerOuterEn = fs->make<TH1F>("towerOuterEn" ,"HO Energy in Calo Tower",2000,-100,100);
197 
198  towerEmFrac = fs->make<TH1F>("towerEmFrac","EM Fraction of Energy in Calo Tower",100,-1.,1.);
199 
200  RBX_et = fs->make<TH1F>("RBX_et","ET in RBX",1000,-20,100);
201  RBX_hadEnergy = fs->make<TH1F>("RBX_hadEnergy","Hcal Energy in RBX",1000,-20,100);
202  RBX_hcalTime = fs->make<TH1F>("RBX_hcalTime","Hcal Time in RBX",200,-200,200);
203  RBX_nTowers = fs->make<TH1F>("RBX_nTowers","Number of Towers in RBX",75,0,75);
204  RBX_N = fs->make<TH1F>("RBX_N","Number of RBX",10,0,10);
205 
206  HPD_et = fs->make<TH1F>("HPD_et","ET in HPD",1000,-20,100);
207  HPD_hadEnergy = fs->make<TH1F>("HPD_hadEnergy","Hcal Energy in HPD",1000,-20,100);
208  HPD_hcalTime = fs->make<TH1F>("HPD_hcalTime","Hcal Time in HPD",200,-200,200);
209  HPD_nTowers = fs->make<TH1F>("HPD_nTowers","Number of Towers in HPD",20,0,20);
210  HPD_N = fs->make<TH1F>("HPD_N","Number of HPD",10,0,10);
211 
212  nTowers1 = fs->make<TH1F>("nTowers1","Number of Towers pt 0.5",100,0,200);
213  nTowers2 = fs->make<TH1F>("nTowers2","Number of Towers pt 1.0",100,0,200);
214  nTowers3 = fs->make<TH1F>("nTowers3","Number of Towers pt 1.5",100,0,200);
215  nTowers4 = fs->make<TH1F>("nTowers4","Number of Towers pt 2.0",100,0,200);
216 
217  nTowersLeadJetPt1 = fs->make<TH1F>("nTowersLeadJetPt1","Number of Towers in Lead Jet pt 0.5",100,0,100);
218  nTowersLeadJetPt2 = fs->make<TH1F>("nTowersLeadJetPt2","Number of Towers in Lead Jet pt 1.0",100,0,100);
219  nTowersLeadJetPt3 = fs->make<TH1F>("nTowersLeadJetPt3","Number of Towers in Lead Jet pt 1.5",100,0,100);
220  nTowersLeadJetPt4 = fs->make<TH1F>("nTowersLeadJetPt4","Number of Towers in Lead Jet pt 2.0",100,0,100);
221 
222  h_nCalJets = fs->make<TH1F>( "nCalJets", "Number of CalJets", 20, 0, 20 );
223 
224  HBEneOOT = fs->make<TH1F>( "HBEneOOT", "HBEneOOT", 200, -5, 10 );
225  HEEneOOT = fs->make<TH1F>( "HEEneOOT", "HEEneOOT", 200, -5, 10 );
226  HFEneOOT = fs->make<TH1F>( "HFEneOOT", "HFEneOOT", 200, -5, 10 );
227  HOEneOOT = fs->make<TH1F>( "HOEneOOT", "HOEneOOT", 200, -5, 10 );
228 
229  HBEne = fs->make<TH1F>( "HBEne", "HBEne", 200, -5, 10 );
230  HBEneTh = fs->make<TH1F>( "HBEneTh", "HBEneTh", 200, -5, 10 );
231  HBEneX = fs->make<TH1F>( "HBEneX", "HBEneX", 200, -5, 10 );
232  HBEneY = fs->make<TH1F>( "HBEneY", "HBEnedY", 200, -5, 10 );
233  HBTime = fs->make<TH1F>( "HBTime", "HBTime", 200, -100, 100 );
234  HBTimeTh = fs->make<TH1F>( "HBTimeTh", "HBTimeTh", 200, -100, 100 );
235  HBTimeX = fs->make<TH1F>( "HBTimeX", "HBTimeX", 200, -100, 100 );
236  HBTimeY = fs->make<TH1F>( "HBTimeY", "HBTimeY", 200, -100, 100 );
237  HEEne = fs->make<TH1F>( "HEEne", "HEEne", 200, -5, 10 );
238  HEEneTh = fs->make<TH1F>( "HEEneTh", "HEEneTh", 200, -5, 10 );
239  HEEneX = fs->make<TH1F>( "HEEneX", "HEEneX", 200, -5, 10 );
240  HEEneY = fs->make<TH1F>( "HEEneY", "HEEneY", 200, -5, 10 );
241  HEposEne = fs->make<TH1F>( "HEposEne", "HEposEne", 200, -5, 10 );
242  HEnegEne = fs->make<TH1F>( "HEnegEne", "HEnegEne", 200, -5, 10 );
243  HETime = fs->make<TH1F>( "HETime", "HETime", 200, -100, 100 );
244  HETimeTh = fs->make<TH1F>( "HETimeTh", "HETimeTh", 200, -100, 100 );
245  HETimeX = fs->make<TH1F>( "HETimeX", "HETimeX", 200, -100, 100 );
246  HETimeY = fs->make<TH1F>( "HETimeY", "HETimeY", 200, -100, 100 );
247  HEposTime = fs->make<TH1F>( "HEposTime", "HEposTime", 200, -100, 100 );
248  HEnegTime = fs->make<TH1F>( "HEnegTime", "HEnegTime", 200, -100, 100 );
249  HOEne = fs->make<TH1F>( "HOEne", "HOEne", 200, -5, 10 );
250  HOEneTh = fs->make<TH1F>( "HOEneTh", "HOEneTh", 200, -5, 10 );
251  HOTime = fs->make<TH1F>( "HOTime", "HOTime", 200, -100, 100 );
252  HOTimeTh = fs->make<TH1F>( "HOTimeTh", "HOTimeTh", 200, -100, 100 );
253 
254  // Histos for separating SiPMs and HPDs in HO:
255  HOSEne = fs->make<TH1F>( "HOSEne", "HOSEne", 12000, -20, 100 );
256  HOSTime = fs->make<TH1F>( "HOSTime", "HOSTime", 200, -100, 100 );
257  HOHEne = fs->make<TH1F>( "HOHEne", "HOHEne", 12000, -20, 100 );
258  HOHTime = fs->make<TH1F>( "HOHTime", "HOHTime", 200, -100, 100 );
259 
260  HOHr0Ene = fs->make<TH1F>( "HOHr0Ene" , "HOHr0Ene", 12000, -20 , 100 );
261  HOHr0Time = fs->make<TH1F>( "HOHr0Time" , "HOHr0Time", 200, -200, 200 );
262  HOHrm1Ene = fs->make<TH1F>( "HOHrm1Ene" , "HOHrm1Ene", 12000, -20 , 100 );
263  HOHrm1Time = fs->make<TH1F>( "HOHrm1Time", "HOHrm1Time", 200, -200, 200 );
264  HOHrm2Ene = fs->make<TH1F>( "HOHrm2Ene" , "HOHrm2Ene", 12000, -20 , 100 );
265  HOHrm2Time = fs->make<TH1F>( "HOHrm2Time", "HOHrm2Time", 200, -200, 200 );
266  HOHrp1Ene = fs->make<TH1F>( "HOHrp1Ene" , "HOHrp1Ene", 12000, -20 , 100 );
267  HOHrp1Time = fs->make<TH1F>( "HOHrp1Time", "HOHrp1Time", 200, -200, 200 );
268  HOHrp2Ene = fs->make<TH1F>( "HOHrp2Ene" , "HOHrp2Ene", 12000, -20 , 100 );
269  HOHrp2Time = fs->make<TH1F>( "HOHrp2Time", "HOHrp2Time", 200, -200, 200 );
270 
271  HBTvsE = fs->make<TH2F>( "HBTvsE", "HBTvsE",100, -5, 50, 100, -100, 100);
272  HETvsE = fs->make<TH2F>( "HETvsE", "HETvsE",100, -5, 50, 100, -100, 100);
273  HFTvsE = fs->make<TH2F>( "HFTvsE", "HFTvsE",100, -5, 50, 100, -100, 100);
274  HOTvsE = fs->make<TH2F>( "HOTvsE", "HOTvsE",100, -5, 50, 100, -100, 100);
275 
276  HFvsZ = fs->make<TH2F>( "HFvsZ", "HFvsZ",100,-50,50,100,-50,50);
277 
278  HOocc = fs->make<TH2F>( "HOocc", "HOocc",81,-40.5,40.5,70,0.5,70.5);
279  HBocc = fs->make<TH2F>( "HBocc", "HBocc",81,-40.5,40.5,70,0.5,70.5);
280  HEocc = fs->make<TH2F>( "HEocc", "HEocc",81,-40.5,40.5,70,0.5,70.5);
281  HFocc = fs->make<TH2F>( "HFocc", "HFocc",81,-40.5,40.5,70,0.5,70.5);
282 
283  HFEne = fs->make<TH1F>( "HFEne", "HFEne", 210, -10, 200 );
284  HFEneTh = fs->make<TH1F>( "HFEneTh", "HFEneTh", 210, -10, 200 );
285  HFEneP = fs->make<TH1F>( "HFEneP", "HFEneP", 200, -5, 10 );
286  HFEneM = fs->make<TH1F>( "HFEneM", "HFEneM", 200, -5, 10 );
287  HFTime = fs->make<TH1F>( "HFTime", "HFTime", 200, -100, 100 );
288  HFTimeTh = fs->make<TH1F>( "HFTimeTh", "HFTimeTh", 200, -100, 100 );
289  HFTimeP = fs->make<TH1F>( "HFTimeP", "HFTimeP", 100, -100, 50 );
290  HFTimeM = fs->make<TH1F>( "HFTimeM", "HFTimeM", 100, -100, 50 );
291  HFTimePMa = fs->make<TH1F>( "HFTimePMa", "HFTimePMa", 100, -100, 100 );
292  HFTimePM = fs->make<TH1F>( "HFTimePM", "HFTimePM", 100, -100, 100 );
293 
294  // Histos for separating HF long/short fibers:
295  HFLEne = fs->make<TH1F>( "HFLEne", "HFLEne", 200, -5, 10 );
296  HFLTime = fs->make<TH1F>( "HFLTime", "HFLTime", 200, -100, 100 );
297  HFSEne = fs->make<TH1F>( "HFSEne", "HFSEne", 200, -5, 10 );
298  HFSTime = fs->make<TH1F>( "HFSTime", "HFSTime", 200, -100, 100 );
299 
300  HFLvsS = fs->make<TH2F>( "HFLvsS", "HFLvsS",220,-20,200,220,-20,200);
301 
302 
303  EBEne = fs->make<TH1F>( "EBEne", "EBEne", 200, -5, 10 );
304  EBEneTh = fs->make<TH1F>( "EBEneTh", "EBEneTh", 200, -5, 10 );
305  EBEneX = fs->make<TH1F>( "EBEneX", "EBEneX", 200, -5, 10 );
306  EBEneY = fs->make<TH1F>( "EBEneY", "EBEneY", 200, -5, 10 );
307  EBTime = fs->make<TH1F>( "EBTime", "EBTime", 200, -100, 100 );
308  EBTimeTh = fs->make<TH1F>( "EBTimeTh", "EBTimeTh", 200, -100, 100 );
309  EBTimeX = fs->make<TH1F>( "EBTimeX", "EBTimeX", 200, -100, 100 );
310  EBTimeY = fs->make<TH1F>( "EBTimeY", "EBTimeY", 200, -100, 100 );
311  EEEne = fs->make<TH1F>( "EEEne", "EEEne", 200, -5, 10 );
312  EEEneTh = fs->make<TH1F>( "EEEneTh", "EEEneTh", 200, -5, 10 );
313  EEEneX = fs->make<TH1F>( "EEEneX", "EEEneX", 200, -5, 10 );
314  EEEneY = fs->make<TH1F>( "EEEneY", "EEEneY", 200, -5, 10 );
315  EEnegEne = fs->make<TH1F>( "EEnegEne", "EEnegEne", 200, -5, 10 );
316  EEposEne = fs->make<TH1F>( "EEposEne", "EEposEne", 200, -5, 10 );
317  EETime = fs->make<TH1F>( "EETime", "EETime", 200, -100, 100 );
318  EETimeTh = fs->make<TH1F>( "EETimeTh", "EETimeTh", 200, -100, 100 );
319  EETimeX = fs->make<TH1F>( "EETimeX", "EETimeX", 200, -100, 100 );
320  EETimeY = fs->make<TH1F>( "EETimeY", "EETimeY", 200, -100, 100 );
321  EEnegTime = fs->make<TH1F>( "EEnegTime", "EEnegTime", 200, -100, 100 );
322  EEposTime = fs->make<TH1F>( "EEposTime", "EEposTime", 200, -100, 100 );
323 
324  h_ptCal = fs->make<TH1F>( "ptCal", "p_{T} of CalJet", 100, 0, 50 );
325  h_etaCal = fs->make<TH1F>( "etaCal", "#eta of CalJet", 100, -4, 4 );
326  h_phiCal = fs->make<TH1F>( "phiCal", "#phi of CalJet", 50, -M_PI, M_PI );
327 
328  h_nGenJets = fs->make<TH1F>( "nGenJets", "Number of GenJets", 20, 0, 20 );
329 
330  h_ptGen = fs->make<TH1F>( "ptGen", "p_{T} of GenJet", 100, 0, 50 );
331  h_etaGen = fs->make<TH1F>( "etaGen", "#eta of GenJet", 100, -4, 4 );
332  h_phiGen = fs->make<TH1F>( "phiGen", "#phi of GenJet", 50, -M_PI, M_PI );
333 
334  h_ptGenL = fs->make<TH1F>( "ptGenL", "p_{T} of GenJetL", 100, 0, 50 );
335  h_etaGenL = fs->make<TH1F>( "etaGenL", "#eta of GenJetL", 100, -4, 4 );
336  h_phiGenL = fs->make<TH1F>( "phiGenL", "#phi of GenJetL", 50, -M_PI, M_PI );
337 
338  h_jetEt = fs->make<TH1F>( "jetEt", "Total Jet Et", 100, 0, 3000 );
339 
340  h_jet1Pt = fs->make<TH1F>( "jet1Pt", "Jet1 Pt", 100, 0, 1000 );
341  h_jet2Pt = fs->make<TH1F>( "jet2Pt", "Jet2 Pt", 100, 0, 1000 );
342  h_jet1PtHLT = fs->make<TH1F>( "jet1PtHLT", "Jet1 Pt HLT", 100, 0, 1000 );
343 
344  h_TotalUnclusteredEt = fs->make<TH1F>( "TotalUnclusteredEt", "Total Unclustered Et", 100, 0, 500 );
345  h_UnclusteredEt = fs->make<TH1F>( "UnclusteredEt", "Unclustered Et", 100, 0, 50 );
346  h_UnclusteredEts = fs->make<TH1F>( "UnclusteredEts", "Unclustered Et", 100, 0, 2 );
347 
348  h_ClusteredE = fs->make<TH1F>( "ClusteredE", "Clustered E", 200, 0, 20 );
349  h_TotalClusteredE = fs->make<TH1F>( "TotalClusteredE", "Total Clustered E", 200, 0, 100 );
350  h_UnclusteredE = fs->make<TH1F>( "UnclusteredE", "Unclustered E", 200, 0, 20 );
351  h_TotalUnclusteredE = fs->make<TH1F>( "TotalUnclusteredE", "Total Unclustered E", 200, 0, 100 );
352 
353  jetHOEne = fs->make<TH1F>("jetHOEne" ,"HO Energy in Jet",100, 0,100);
354  jetEMFraction = fs->make<TH1F>( "jetEMFraction", "Jet EM Fraction", 100, -1.1, 1.1 );
355  NTowers = fs->make<TH1F>( "NTowers", "Number of Towers", 100, 0, 100 );
356 
357 
358  h_EmEnergy = fs->make<TH2F>( "EmEnergy", "Em Energy", 90, -45, 45, 73, 0, 73 );
359  h_HadEnergy = fs->make<TH2F>( "HadEnergy", "Had Energy", 90, -45, 45, 73, 0, 73 );
360 
361  st_Pt = fs->make<TH1F>( "st_Pt", "Pt", 200, 0, 200 );
362  st_Constituents = fs->make<TH1F>( "st_Constituents", "Constituents", 200, 0, 200 );
363  st_Energy = fs->make<TH1F>( "st_Energy", "Tower Energy", 200, 0, 200 );
364  st_EmEnergy = fs->make<TH1F>( "st_EmEnergy", "Tower EmEnergy", 200, 0, 200 );
365  st_HadEnergy = fs->make<TH1F>( "st_HadEnergy", "Tower HadEnergy", 200, 0, 200 );
366  st_OuterEnergy = fs->make<TH1F>( "st_OuterEnergy", "Tower OuterEnergy", 200, 0, 200 );
367  st_Eta = fs->make<TH1F>( "st_Eta", "Eta", 100, -4, 4 );
368  st_Phi = fs->make<TH1F>( "st_Phi", "Phi", 50, -M_PI, M_PI );
369  st_iEta = fs->make<TH1F>( "st_iEta", "iEta", 60, -30, 30 );
370  st_iPhi = fs->make<TH1F>( "st_iPhi", "iPhi", 80, 0, 80 );
371  st_Frac = fs->make<TH1F>( "st_Frac", "Frac", 100, 0, 1 );
372 
373 
374  EBvHB = fs->make<TH2F>( "EBvHB", "EB vs HB",1000,0,4500000.,1000,0,1000000.);
375  EEvHE = fs->make<TH2F>( "EEvHE", "EE vs HE",1000,0,4500000.,1000,0,200000.);
376 
377  ECALvHCAL = fs->make<TH2F>( "ECALvHCAL", "ECAL vs HCAL",100,0,20000000.,100,-500000,500000.);
378  ECALvHCALEta1 = fs->make<TH2F>( "ECALvHCALEta1", "ECAL vs HCALEta1",100,0,20000000.,100,-500000,500000.);
379  ECALvHCALEta2 = fs->make<TH2F>( "ECALvHCALEta2", "ECAL vs HCALEta2",100,0,20000000.,100,-500000,500000.);
380  ECALvHCALEta3 = fs->make<TH2F>( "ECALvHCALEta3", "ECAL vs HCALEta3",100,0,20000000.,100,-500000,500000.);
381 
382  EMF_Eta = fs->make<TProfile>("EMF_Eta","EMF Eta", 100, -50, 50, 0, 10);
383  EMF_Phi = fs->make<TProfile>("EMF_Phi","EMF Phi", 100, 0, 100, 0, 10);
384  EMF_EtaX = fs->make<TProfile>("EMF_EtaX","EMF EtaX", 100, -50, 50, 0, 10);
385  EMF_PhiX = fs->make<TProfile>("EMF_PhiX","EMF PhiX", 100, 0, 100, 0, 10);
386 
387 
388  totBNC = 0;
389  for (int i=0; i<4000; i++) nBNC[i] = 0;
390 
391 }
392 
393 // ************************
394 // ************************
395 void myJetAna::analyze( const edm::Event& evt, const edm::EventSetup& es ) {
396 
397  using namespace edm;
398 
399  bool Pass, Pass_HFTime, Pass_DiJet, Pass_BunchCrossing, Pass_Trigger, Pass_Vertex;
400 
401  int EtaOk10, EtaOk13, EtaOk40;
402 
403  double LeadMass;
404 
405  double HFRecHit[100][100][2];
406 
407  double towerEtCut, towerECut, towerE;
408 
409  towerEtCut = 1.0;
410  towerECut = 1.0;
411 
412  double HBHEThreshold = 2.0;
413  double HFThreshold = 2.0;
414  double HOThreshold = 2.0;
415  double EBEEThreshold = 2.0;
416 
417  float pt1;
418 
419  float minJetPt = 5.;
420  float minJetPt10 = 10.;
421  int jetInd, allJetInd;
422  LeadMass = -1;
423 
424  // Handle<DcsStatusCollection> dcsStatus;
425  // evt.getByLabel("scalersRawToDigi", dcsStatus);
426  // std::cout << dcsStatus << std::endl;
427  // if (dcsStatus.isValid()) {
428  // }
429 
430  // DcsStatus dcsStatus;
431  // Handle<DcsStatus> dcsStatus;
432  // evt.getByLabel("dcsStatus", dcsStatus);
433 
434 
435  math::XYZTLorentzVector p4tmp[2], p4cortmp[2];
436 
437  // --------------------------------------------------------------
438  // --------------------------------------------------------------
439 
440  std::cout << ">>>> ANA: Run = " << evt.id().run()
441  << " Event = " << evt.id().event()
442  << " Bunch Crossing = " << evt.bunchCrossing()
443  << " Orbit Number = " << evt.orbitNumber()
444  << " Luminosity Block = " << evt.luminosityBlock()
445  << std::endl;
446 
447  // *********************
448  // *** Filter Event
449  // *********************
450  Pass = false;
451 
452  /***
453  if (evt.bunchCrossing()== 100) {
454  Pass = true;
455  } else {
456  Pass = false;
457  }
458  ***/
459 
460  // ***********************
461  // *** Pass Trigger
462  // ***********************
463 
464 
465  // **** Get the TriggerResults container
466  Handle<TriggerResults> triggerResults;
467  evt.getByLabel(theTriggerResultsLabel, triggerResults);
468  // evt.getByLabel("TriggerResults::HLT", triggerResults);
469 
470  if (triggerResults.isValid()) {
471  if (DEBUG) std::cout << "trigger valid " << std::endl;
472  const edm::TriggerNames & triggerNames = evt.triggerNames(*triggerResults);
473  unsigned int n = triggerResults->size();
474  for (unsigned int i=0; i!=n; i++) {
475 
476  /***
477  std::cout << ">>> Trigger Name (" << i << ") = " << triggerNames.triggerName(i)
478  << " Accept = " << triggerResults->accept(i)
479  << std::endl;
480  ***/
481  /****
482  if (triggerResults->accept(i) == 1) {
483  std::cout << "+++ Trigger Name (" << i << ") = " << triggerNames.triggerName(i)
484  << " Accept = " << triggerResults->accept(i)
485  << std::endl;
486  }
487  ****/
488 
489  if (DEBUG) std::cout << triggerNames.triggerName(i) << std::endl;
490 
491  // if ( (triggerNames.triggerName(i) == "HLT_ZeroBias") ||
492  // (triggerNames.triggerName(i) == "HLT_MinBias") ||
493  // (triggerNames.triggerName(i) == "HLT_MinBiasHcal") ) {
494 
495  if (triggerNames.triggerName(i) == "HLT_MinBiasBSC") {
496  Pass_Trigger = true;
497  } else {
498  Pass_Trigger = false;
499  }
500 
501  }
502 
503  } else {
504 
506  triggerResults = (*tr);
507 
508  // std::cout << "triggerResults is not valid" << std::endl;
509  // std::cout << triggerResults << std::endl;
510  // std::cout << triggerResults.isValid() << std::endl;
511 
512  if (DEBUG) std::cout << "trigger not valid " << std::endl;
513  edm::LogInfo("myJetAna") << "TriggerResults::HLT not found, "
514  "automatically select events";
515 
516  Pass_Trigger = true;
517 
518  //return;
519  }
520 
521 
522  /***
523  Handle<L1GlobalTriggerReadoutRecord> gtRecord;
524  evt.getByLabel("gtDigis",gtRecord);
525  const TechnicalTriggerWord tWord = gtRecord->technicalTriggerWord();
526 
527  if (gtRecord.isValid()) {
528  if (tWord.at(40)) {
529  Pass_Trigger = true;
530  } else {
531  Pass_Trigger = false;
532  }
533  } else {
534  Pass_Trigger = false;
535  }
536  ****/
537 
538 
539  // *************************
540  // *** Pass Bunch Crossing
541  // *************************
542 
543  // *** Check Luminosity Section
544  if (evt.id().run() == 122294)
545  if ( (evt.luminosityBlock() >= 37) && (evt.luminosityBlock() <= 43) )
546  Pass = true;
547  if (evt.id().run() == 122314)
548  if ( (evt.luminosityBlock() >= 24) && (evt.luminosityBlock() <= 37) )
549  Pass = true;
550  if (evt.id().run() == 123575)
551  Pass = true;
552  if (evt.id().run() == 123596)
553  Pass = true;
554 
555  // ***********
556  if (evt.id().run() == 124009) {
557  if ( (evt.bunchCrossing() == 51) ||
558  (evt.bunchCrossing() == 151) ||
559  (evt.bunchCrossing() == 2824) ) {
560  Pass = true;
561  }
562  }
563 
564  if (evt.id().run() == 124020) {
565  if ( (evt.bunchCrossing() == 51) ||
566  (evt.bunchCrossing() == 151) ||
567  (evt.bunchCrossing() == 2824) ) {
568  Pass = true;
569  }
570  }
571 
572  if (evt.id().run() == 124024) {
573  if ( (evt.bunchCrossing() == 51) ||
574  (evt.bunchCrossing() == 151) ||
575  (evt.bunchCrossing() == 2824) ) {
576  Pass = true;
577  }
578  }
579 
580  if ( (evt.bunchCrossing() == 51) ||
581  (evt.bunchCrossing() == 151) ||
582  (evt.bunchCrossing() == 2596) ||
583  (evt.bunchCrossing() == 2724) ||
584  (evt.bunchCrossing() == 2824) ||
585  (evt.bunchCrossing() == 3487) ) {
586  Pass_BunchCrossing = true;
587  } else {
588  Pass_BunchCrossing = false;
589  }
590 
591 
592  // ***********************
593  // *** Pass HF Timing
594  // ***********************
595 
596  double HFM_ETime, HFP_ETime;
597  double HFM_E, HFP_E;
598  double HF_PMM;
599 
600  HFM_ETime = 0.;
601  HFM_E = 0.;
602  HFP_ETime = 0.;
603  HFP_E = 0.;
604 
605  for (int i=0; i<100; i++) {
606  for (int j=0; j<100; j++) {
607  HFRecHit[i][j][0] = -10.;
608  HFRecHit[i][j][1] = -10.;
609  }
610  }
611 
612 
613  try {
614  std::vector<edm::Handle<HFRecHitCollection> > colls;
615  evt.getManyByType(colls);
616  std::vector<edm::Handle<HFRecHitCollection> >::iterator i;
617  for (i=colls.begin(); i!=colls.end(); i++) {
618  for (HFRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
619  if (j->id().subdet() == HcalForward) {
620 
621  float en = j->energy();
622  HcalDetId id(j->detid().rawId());
623  int ieta = id.ieta();
624  int iphi = id.iphi();
625  int depth = id.depth();
626 
627  HFRecHit[ieta+41][iphi][depth-1] = en;
628 
629  if (j->id().ieta()<0) {
630  if (j->energy() > HFThreshold) {
631  HFM_ETime += j->energy()*j->time();
632  HFM_E += j->energy();
633  }
634  } else {
635  if (j->energy() > HFThreshold) {
636  HFP_ETime += j->energy()*j->time();
637  HFP_E += j->energy();
638  }
639  }
640 
641  }
642  }
643  }
644  } catch (...) {
645  cout << "No HF RecHits." << endl;
646  }
647 
648  if ((HFP_E > 0.) && (HFM_E > 0.)) {
649  HF_PMM = (HFP_ETime / HFP_E) - (HFM_ETime / HFM_E);
650  HFTimePMa->Fill(HF_PMM);
651  } else {
652  HF_PMM = INVALID;
653  }
654 
655 
656  if (fabs(HF_PMM) < 10.) {
657  Pass_HFTime = true;
658  } else {
659  Pass_HFTime = false;
660  }
661 
662 
663  // **************************
664  // *** Pass DiJet Criteria
665  // **************************
666  double highestPt;
667  double nextPt;
668  double dphi;
669  int nDiJet, nJet;
670 
671  nJet = 0;
672  nDiJet = 0;
673  highestPt = 0.0;
674  nextPt = 0.0;
675 
676  allJetInd = 0;
677  Handle<CaloJetCollection> caloJets;
678  evt.getByLabel( CaloJetAlgorithm, caloJets );
679  for( CaloJetCollection::const_iterator cal = caloJets->begin(); cal != caloJets->end(); ++ cal ) {
680 
681  // TODO: verify first two jets are the leading jets
682  if (nJet == 0) p4tmp[0] = cal->p4();
683  if (nJet == 1) p4tmp[1] = cal->p4();
684 
685  if ( (cal->pt() > 3.) &&
686  (fabs(cal->eta()) < 3.0) ) {
687  nDiJet++;
688  }
689  nJet++;
690 
691  }
692 
693 
694  if (nDiJet > 1) {
695  dphi = deltaPhi(p4tmp[0].phi(), p4tmp[1].phi());
696  Pass_DiJet = true;
697  } else {
698  dphi = INVALID;
699  Pass_DiJet = false;
700  }
701 
702 
703  // **************************
704  // *** Pass Vertex
705  // **************************
706  double VTX = 0.;
707  int nVTX = 0;
708 
710  evt.getByLabel("offlinePrimaryVertices", vertexCollection);
711  const reco::VertexCollection vC = *(vertexCollection.product());
712 
713  std::cout << "Reconstructed "<< vC.size() << " vertices" << std::endl ;
714 
715  nVTX = vC.size();
716  for (reco::VertexCollection::const_iterator vertex=vC.begin(); vertex!=vC.end(); vertex++){
717  VTX = vertex->z();
718  }
719 
720  if ( (fabs(VTX) < 20.) && (nVTX > 0) ){
721  Pass_Vertex = true;
722  } else {
723  Pass_Vertex = false;
724  }
725 
726  // ***********************
727  // ***********************
728 
729 
730  nBNC[evt.bunchCrossing()]++;
731  totBNC++;
732 
733  // Pass = true;
734 
735  // *** Check for tracks
736  // edm::Handle<reco::TrackCollection> trackCollection;
737  // evt.getByLabel("generalTracks", trackCollection);
738  // const reco::TrackCollection tC = *(trackCollection.product());
739  // if ((Pass) && (tC.size()>1)) {
740  // } else {
741  // Pass = false;
742  // }
743 
744 
745  // **************************
746  // *** Event Passed Selection
747  // **************************
748 
749 
750  if (evt.id().run() == 1) {
751  if ( (Pass_DiJet) &&
752  (Pass_Vertex) ) {
753  Pass = true;
754  } else {
755  Pass = false;
756  }
757  } else {
758  if ( (Pass_BunchCrossing) &&
759  (Pass_HFTime) &&
760  (Pass_Vertex) ) {
761  Pass = true;
762  } else {
763  Pass = false;
764  }
765  }
766 
767  std::cout << "+++ Result "
768  << " Event = "
769  << evt.id().run()
770  << " LS = "
771  << evt.luminosityBlock()
772  << " dphi = "
773  << dphi
774  << " Pass = "
775  << Pass
776  << std::endl;
777 
778  if (Pass) {
779 
780 
781  // *********************
782  // *** Classify Event
783  // *********************
784  int evtType = 0;
785 
787  evt.getByLabel( "towerMaker", caloTowers );
788 
789  for (int i=0;i<36;i++) {
790  RBXColl[i].et = 0;
791  RBXColl[i].hadEnergy = 0;
792  RBXColl[i].emEnergy = 0;
793  RBXColl[i].hcalTime = 0;
794  RBXColl[i].ecalTime = 0;
795  RBXColl[i].nTowers = 0;
796  }
797  for (int i=0;i<144;i++) {
798  HPDColl[i].et = 0;
799  HPDColl[i].hadEnergy = 0;
800  HPDColl[i].emEnergy = 0;
801  HPDColl[i].hcalTime = 0;
802  HPDColl[i].ecalTime = 0;
803  HPDColl[i].nTowers = 0;
804  }
805 
806  double ETotal, emFrac;
807  double HCALTotalCaloTowerE, ECALTotalCaloTowerE;
808  double HCALTotalCaloTowerE_Eta1, ECALTotalCaloTowerE_Eta1;
809  double HCALTotalCaloTowerE_Eta2, ECALTotalCaloTowerE_Eta2;
810  double HCALTotalCaloTowerE_Eta3, ECALTotalCaloTowerE_Eta3;
811 
812  ETotal = 0.;
813  emFrac = 0.;
814 
815  HCALTotalCaloTowerE = 0;
816  ECALTotalCaloTowerE = 0;
817  HCALTotalCaloTowerE_Eta1 = 0.;
818  ECALTotalCaloTowerE_Eta1 = 0.;
819  HCALTotalCaloTowerE_Eta2 = 0.;
820  ECALTotalCaloTowerE_Eta2 = 0.;
821  HCALTotalCaloTowerE_Eta3 = 0.;
822  ECALTotalCaloTowerE_Eta3 = 0.;
823 
824  for (CaloTowerCollection::const_iterator tower = caloTowers->begin();
825  tower != caloTowers->end(); tower++) {
826  ETotal += tower->hadEnergy();
827  ETotal += tower->emEnergy();
828  }
829 
830  for (CaloTowerCollection::const_iterator tower = caloTowers->begin();
831  tower != caloTowers->end(); tower++) {
832 
833  // Raw tower energy without grouping or thresholds
834 
835  towerHadEn->Fill(tower->hadEnergy());
836  towerEmEn->Fill(tower->emEnergy());
837  towerOuterEn->Fill(tower->outerEnergy());
838 
839  // towerHadEt->Fill(tower->hadEt());
840  // towerEmEt->Fill(tower->emEt());
841  // towerOuterEt->Fill(tower->outerEt());
842 
843  if ((tower->emEnergy()+tower->hadEnergy()) != 0) {
844  emFrac = tower->emEnergy()/(tower->emEnergy()+tower->hadEnergy());
845  towerEmFrac->Fill(emFrac);
846  } else {
847  emFrac = 0.;
848  }
849 
850  /***
851  std::cout << "ETotal = " << ETotal
852  << " EMF = " << emFrac
853  << " EM = " << tower->emEnergy()
854  << " Tot = " << tower->emEnergy()+tower->hadEnergy()
855  << " ieta/iphi = " << tower->ieta() << " / " << tower->iphi()
856  << std::endl;
857  ***/
858 
859  if (abs(tower->iphi()) < 100) EMF_Phi->Fill(tower->iphi(), emFrac);
860  if (abs(tower->ieta()) < 100) EMF_Eta->Fill(tower->ieta(), emFrac);
861  if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) {
862  std::cout << "Bunch Crossing = " << evt.bunchCrossing()
863  << " Orbit Number = " << evt.orbitNumber()
864  << std::endl;
865 
866  if (abs(tower->iphi()) < 100) EMF_PhiX->Fill(tower->iphi(), emFrac);
867  if (abs(tower->ieta()) < 100) EMF_EtaX->Fill(tower->ieta(), emFrac);
868  }
869 
870  HCALTotalCaloTowerE += tower->hadEnergy();
871  ECALTotalCaloTowerE += tower->emEnergy();
872 
873  towerE = tower->hadEnergy() + tower->emEnergy();
874  if (tower->et() > towerEtCut) caloEtaEt->Fill(tower->eta());
875  if (towerE > towerECut) caloEta->Fill(tower->eta());
876  caloPhi->Fill(tower->phi());
877 
878  if (fabs(tower->eta()) < 1.3) {
879  HCALTotalCaloTowerE_Eta1 += tower->hadEnergy();
880  ECALTotalCaloTowerE_Eta1 += tower->emEnergy();
881  }
882  if ((fabs(tower->eta()) >= 1.3) && (fabs(tower->eta()) < 2.5)) {
883  HCALTotalCaloTowerE_Eta2 += tower->hadEnergy();
884  ECALTotalCaloTowerE_Eta2 += tower->emEnergy();
885  }
886  if (fabs(tower->eta()) > 2.5) {
887  HCALTotalCaloTowerE_Eta3 += tower->hadEnergy();
888  ECALTotalCaloTowerE_Eta3 += tower->emEnergy();
889  }
890 
891  /***
892  std::cout << "had = " << tower->hadEnergy()
893  << " em = " << tower->emEnergy()
894  << " fabs(eta) = " << fabs(tower->eta())
895  << " ieta/iphi = " << tower->ieta() << " / " << tower->iphi()
896  << std::endl;
897  ***/
898 
899  if ((tower->hadEnergy() + tower->emEnergy()) > 2.0) {
900 
901  int iRBX = tower->iphi();
902  iRBX = iRBX-2;
903  if (iRBX == 0) iRBX = 17;
904  if (iRBX == -1) iRBX = 18;
905  iRBX = (iRBX-1)/4;
906 
907  if (tower->ieta() < 0) iRBX += 18;
908  if (iRBX < 36) {
909  RBXColl[iRBX].et += tower->et();
910  RBXColl[iRBX].hadEnergy += tower->hadEnergy();
911  RBXColl[iRBX].emEnergy += tower->emEnergy();
912  RBXColl[iRBX].hcalTime += tower->hcalTime();
913  RBXColl[iRBX].ecalTime += tower->ecalTime();
914  RBXColl[iRBX].nTowers++;
915  }
916  /***
917  std::cout << "iRBX = " << iRBX << " "
918  << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi()
919  << " et = " << tower->et()
920  << std::endl;
921  ***/
922  int iHPD = tower->iphi();
923  if (tower->ieta() < 0) iHPD = iHPD + 72;
924  if (iHPD < 144) {
925  HPDColl[iHPD].et += tower->et();
926  HPDColl[iHPD].hadEnergy += tower->hadEnergy();
927  HPDColl[iHPD].emEnergy += tower->emEnergy();
928  HPDColl[iHPD].hcalTime += tower->hcalTime();
929  HPDColl[iHPD].ecalTime += tower->ecalTime();
930  HPDColl[iHPD].nTowers++;
931  }
932  /***
933  std::cout << "iHPD = " << iHPD << " "
934  << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi()
935  << " et = " << tower->et()
936  << std::endl;
937  ***/
938 
939  }
940 
941  }
942 
943  ECALvHCAL->Fill(HCALTotalCaloTowerE, ECALTotalCaloTowerE);
944  ECALvHCALEta1->Fill(HCALTotalCaloTowerE_Eta1, ECALTotalCaloTowerE_Eta1);
945  ECALvHCALEta2->Fill(HCALTotalCaloTowerE_Eta2, ECALTotalCaloTowerE_Eta2);
946  ECALvHCALEta3->Fill(HCALTotalCaloTowerE_Eta3, ECALTotalCaloTowerE_Eta3);
947 
948  std::cout << " Total CaloTower Energy : "
949  << " ETotal= " << ETotal
950  << " HCAL= " << HCALTotalCaloTowerE
951  << " ECAL= " << ECALTotalCaloTowerE
952  << std::endl;
953 
954  /***
955  << " HCAL Eta1 = " << HCALTotalCaloTowerE_Eta1
956  << " ECAL= " << ECALTotalCaloTowerE_Eta1
957  << " HCAL Eta2 = " << HCALTotalCaloTowerE_Eta2
958  << " ECAL= " << ECALTotalCaloTowerE_Eta2
959  << " HCAL Eta3 = " << HCALTotalCaloTowerE_Eta3
960  << " ECAL= " << ECALTotalCaloTowerE_Eta3
961  << std::endl;
962  ***/
963 
964 
965  // Loop over the RBX Collection
966  int nRBX = 0;
967  int nTowers = 0;
968  for (int i=0;i<36;i++) {
969  RBX_et->Fill(RBXColl[i].et);
970  RBX_hadEnergy->Fill(RBXColl[i].hadEnergy);
971  RBX_hcalTime->Fill(RBXColl[i].hcalTime / RBXColl[i].nTowers);
972  RBX_nTowers->Fill(RBXColl[i].nTowers);
973  if (RBXColl[i].hadEnergy > 3.0) {
974  nRBX++;
975  nTowers = RBXColl[i].nTowers;
976  }
977  }
978  RBX_N->Fill(nRBX);
979  if ( (nRBX == 1) && (nTowers > 24) ) {
980  evtType = 1;
981  }
982 
983  // Loop over the HPD Collection
984  int nHPD = 0;
985  for (int i=0;i<144;i++) {
986  HPD_et->Fill(HPDColl[i].et);
987  HPD_hadEnergy->Fill(HPDColl[i].hadEnergy);
988  HPD_hcalTime->Fill(HPDColl[i].hcalTime / HPDColl[i].nTowers);
989  HPD_nTowers->Fill(HPDColl[i].nTowers);
990  if (HPDColl[i].hadEnergy > 3.0) {
991  nHPD++;
992  nTowers = HPDColl[i].nTowers;
993  }
994  }
995  HPD_N->Fill(nHPD);
996  if ( (nHPD == 1) && (nTowers > 6) ) {
997  evtType = 2;
998  cout << " nHPD = " << nHPD
999  << " Towers = " << nTowers
1000  << " Type = " << evtType
1001  << endl;
1002  }
1003 
1004  // **************************************************************
1005  // ** Access Trigger Information
1006  // **************************************************************
1007 
1008  // **** Get the TriggerResults container
1009  Handle<TriggerResults> triggerResults;
1010  evt.getByLabel(theTriggerResultsLabel, triggerResults);
1011 
1012  Int_t JetLoPass = 0;
1013 
1014  if (triggerResults.isValid()) {
1015  if (DEBUG) std::cout << "trigger valid " << std::endl;
1016  const edm::TriggerNames & triggerNames = evt.triggerNames(*triggerResults);
1017  unsigned int n = triggerResults->size();
1018  for (unsigned int i=0; i!=n; i++) {
1019 
1020  /***
1021  std::cout << " Trigger Name = " << triggerNames.triggerName(i)
1022  << " Accept = " << triggerResults->accept(i)
1023  << std::endl;
1024  ***/
1025 
1026  if (DEBUG) std::cout << triggerNames.triggerName(i) << std::endl;
1027 
1028  if ( triggerNames.triggerName(i) == "HLT_Jet30" ) {
1029  JetLoPass = triggerResults->accept(i);
1030  if (DEBUG) std::cout << "Found HLT_Jet30 "
1031  << JetLoPass
1032  << std::endl;
1033  }
1034 
1035  }
1036 
1037  } else {
1038 
1040  triggerResults = (*tr);
1041 
1042  // std::cout << "triggerResults is not valid" << std::endl;
1043  // std::cout << triggerResults << std::endl;
1044  // std::cout << triggerResults.isValid() << std::endl;
1045 
1046  if (DEBUG) std::cout << "trigger not valid " << std::endl;
1047  edm::LogInfo("myJetAna") << "TriggerResults::HLT not found, "
1048  "automatically select events";
1049  //return;
1050  }
1051 
1052  /****
1053  Handle <L1GlobalTriggerReadoutRecord> gtRecord_h;
1054  evt.getByType (gtRecord_h); // assume only one L1 trigger record here
1055  const L1GlobalTriggerReadoutRecord* gtRecord = gtRecord_h.failedToGet () ? 0 : &*gtRecord_h;
1056 
1057  if (gtRecord) { // object is available
1058  for (int l1bit = 0; l1bit < 128; ++l1bit) {
1059  if (gtRecord->decisionWord() [l1bit]) h_L1TrigBit->Fill (l1bit);
1060  }
1061  }
1062  ****/
1063 
1064 
1065 
1066 
1067  // **************************************************************
1068  // ** Loop over the two leading CaloJets and fill some histograms
1069  // **************************************************************
1070  Handle<CaloJetCollection> caloJets;
1071  evt.getByLabel( CaloJetAlgorithm, caloJets );
1072 
1073 
1074  jetInd = 0;
1075  allJetInd = 0;
1076 
1077  EtaOk10 = 0;
1078  EtaOk13 = 0;
1079  EtaOk40 = 0;
1080 
1081  // const JetCorrector* corrector =
1082  // JetCorrector::getJetCorrector (JetCorrectionService, es);
1083 
1084 
1085  highestPt = 0.0;
1086  nextPt = 0.0;
1087 
1088  for( CaloJetCollection::const_iterator cal = caloJets->begin(); cal != caloJets->end(); ++ cal ) {
1089 
1090  // double scale = corrector->correction (*cal);
1091  double scale = 1.0;
1092  double corPt = scale*cal->pt();
1093  // double corPt = cal->pt();
1094  // cout << "Pt = " << cal->pt() << endl;
1095 
1096  if (corPt>highestPt) {
1097  nextPt = highestPt;
1098  p4cortmp[1] = p4cortmp[0];
1099  highestPt = corPt;
1100  p4cortmp[0] = scale*cal->p4();
1101  } else if (corPt>nextPt) {
1102  nextPt = corPt;
1103  p4cortmp[1] = scale*cal->p4();
1104  }
1105 
1106  allJetInd++;
1107  if (allJetInd == 1) {
1108  h_jet1Pt->Fill( cal->pt() );
1109  if (JetLoPass != 0) h_jet1PtHLT->Fill( cal->pt() );
1110  pt1 = cal->pt();
1111  p4tmp[0] = cal->p4();
1112  if ( fabs(cal->eta()) < 1.0) EtaOk10++;
1113  if ( fabs(cal->eta()) < 1.3) EtaOk13++;
1114  if ( fabs(cal->eta()) < 4.0) EtaOk40++;
1115  }
1116  if (allJetInd == 2) {
1117  h_jet2Pt->Fill( cal->pt() );
1118  p4tmp[1] = cal->p4();
1119  if ( fabs(cal->eta()) < 1.0) EtaOk10++;
1120  if ( fabs(cal->eta()) < 1.3) EtaOk13++;
1121  if ( fabs(cal->eta()) < 4.0) EtaOk40++;
1122  }
1123 
1124  if ( cal->pt() > minJetPt) {
1125  h_ptCal->Fill( cal->pt() );
1126  h_etaCal->Fill( cal->eta() );
1127  h_phiCal->Fill( cal->phi() );
1128  jetInd++;
1129  }
1130  }
1131 
1132  h_nCalJets->Fill( jetInd );
1133 
1134  if (jetInd > 1) {
1135  LeadMass = (p4tmp[0]+p4tmp[1]).mass();
1136  dijetMass->Fill( LeadMass );
1137  }
1138 
1139 
1140  // ******************
1141  // *** Jet Properties
1142  // ******************
1143 
1144  int nTow1, nTow2, nTow3, nTow4;
1145  // Handle<CaloJetCollection> jets;
1146  // evt.getByLabel( CaloJetAlgorithm, jets );
1147 
1148  // *********************************************************
1149  // --- Loop over jets and make a list of all the used towers
1150  int jjet = 0;
1151  for ( CaloJetCollection::const_iterator ijet=caloJets->begin(); ijet!=caloJets->end(); ijet++) {
1152  jjet++;
1153 
1154  float hadEne = ijet->hadEnergyInHB() + ijet->hadEnergyInHO() +
1155  ijet->hadEnergyInHE() + ijet->hadEnergyInHF();
1156  float emEne = ijet->emEnergyInEB() + ijet->emEnergyInEE() + ijet->emEnergyInHF();
1157  float had = ijet->energyFractionHadronic();
1158 
1159  float j_et = ijet->et();
1160 
1161  // *** Barrel
1162  if (fabs(ijet->eta()) < 1.3) {
1163  totEneLeadJetEta1->Fill(hadEne+emEne);
1164  hadEneLeadJetEta1->Fill(hadEne);
1165  emEneLeadJetEta1->Fill(emEne);
1166 
1167  if (ijet->pt() > minJetPt10)
1168  hadFracEta1->Fill(had);
1169  }
1170 
1171  // *** EndCap
1172  if ((fabs(ijet->eta()) > 1.3) && (fabs(ijet->eta()) < 3.) ) {
1173 
1174  totEneLeadJetEta2->Fill(hadEne+emEne);
1175  hadEneLeadJetEta2->Fill(hadEne);
1176  emEneLeadJetEta2->Fill(emEne);
1177 
1178  if (ijet->pt() > minJetPt10)
1179  hadFracEta2->Fill(had);
1180  }
1181 
1182  // *** Forward
1183  if (fabs(ijet->eta()) > 3.) {
1184 
1185  totEneLeadJetEta3->Fill(hadEne+emEne);
1186  hadEneLeadJetEta3->Fill(hadEne);
1187  emEneLeadJetEta3->Fill(emEne);
1188 
1189  if (ijet->pt() > minJetPt10)
1190  hadFracEta3->Fill(had);
1191  }
1192 
1193  // *** CaloTowers in Jet
1194  const std::vector<CaloTowerPtr> jetCaloRefs = ijet->getCaloConstituents();
1195  int nConstituents = jetCaloRefs.size();
1196  NTowers->Fill(nConstituents);
1197 
1198  if (jjet == 1) {
1199 
1200  nTow1 = nTow2 = nTow3 = nTow4 = 0;
1201  for (int i = 0; i <nConstituents ; i++){
1202 
1203  float et = jetCaloRefs[i]->et();
1204 
1205  if (et > 0.5) nTow1++;
1206  if (et > 1.0) nTow2++;
1207  if (et > 1.5) nTow3++;
1208  if (et > 2.0) nTow4++;
1209 
1210  hf_TowerJetEt->Fill(et/j_et);
1211 
1212  }
1213 
1214  nTowersLeadJetPt1->Fill(nTow1);
1215  nTowersLeadJetPt2->Fill(nTow2);
1216  nTowersLeadJetPt3->Fill(nTow3);
1217  nTowersLeadJetPt4->Fill(nTow4);
1218 
1219  }
1220 
1221  }
1222 
1223 
1224  // **********************
1225  // *** Unclustered Energy
1226  // **********************
1227 
1228  double SumPtJet(0);
1229 
1230  double SumEtNotJets(0);
1231  double SumEtJets(0);
1232  double SumEtTowers(0);
1233  double TotalClusteredE(0);
1234  double TotalUnclusteredE(0);
1235 
1236  double sumJetPx(0);
1237  double sumJetPy(0);
1238 
1239  double sumTowerAllPx(0);
1240  double sumTowerAllPy(0);
1241 
1242  double sumTowerAllEx(0);
1243  double sumTowerAllEy(0);
1244 
1245  double HCALTotalE, HBTotalE, HETotalE, HOTotalE, HFTotalE;
1246  double ECALTotalE, EBTotalE, EETotalE;
1247 
1248  std::vector<CaloTowerPtr> UsedTowerList;
1249  std::vector<CaloTower> TowerUsedInJets;
1250  std::vector<CaloTower> TowerNotUsedInJets;
1251 
1252  // *********************
1253  // *** Hcal recHits
1254  // *********************
1255 
1257 
1258  HCALTotalE = HBTotalE = HETotalE = HOTotalE = HFTotalE = 0.;
1259  try {
1260  std::vector<edm::Handle<HBHERecHitCollection> > colls;
1261  evt.getManyByType(colls);
1262  std::vector<edm::Handle<HBHERecHitCollection> >::iterator i;
1263  for (i=colls.begin(); i!=colls.end(); i++) {
1264  for (HBHERecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
1265  // std::cout << *j << std::endl;
1266  if (j->id().subdet() == HcalBarrel) {
1267  HBEne->Fill(j->energy());
1268  HBTime->Fill(j->time());
1269  HBTvsE->Fill(j->energy(), j->time());
1270 
1271  if ((j->time()<25.) || (j->time()>75.)) {
1272  HBEneOOT->Fill(j->energy());
1273  }
1274 
1275  if (j->energy() > HBHEThreshold) {
1276  HBEneTh->Fill(j->energy());
1277  HBTimeTh->Fill(j->time());
1278  HBTotalE += j->energy();
1279  HBocc->Fill(j->id().ieta(),j->id().iphi());
1280  hitEta->Fill(j->id().ieta());
1281  hitPhi->Fill(j->id().iphi());
1282  }
1283  if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) {
1284  HBEneX->Fill(j->energy());
1285  if (j->energy() > HBHEThreshold) HBTimeX->Fill(j->time());
1286  }
1287  if ( (evt.id().run() == 120020) && (evt.id().event() == 457) ) {
1288  HBEneY->Fill(j->energy());
1289  if (j->energy() > HBHEThreshold) HBTimeY->Fill(j->time());
1290  }
1291  }
1292  if (j->id().subdet() == HcalEndcap) {
1293  HEEne->Fill(j->energy());
1294  HETime->Fill(j->time());
1295  HETvsE->Fill(j->energy(), j->time());
1296 
1297  if ((j->time()<25.) || (j->time()>75.)) {
1298  HEEneOOT->Fill(j->energy());
1299  }
1300 
1301  if (j->energy() > HBHEThreshold) {
1302  HEEneTh->Fill(j->energy());
1303  HETimeTh->Fill(j->time());
1304  HETotalE += j->energy();
1305  HEocc->Fill(j->id().ieta(),j->id().iphi());
1306  hitEta->Fill(j->id().ieta());
1307  hitPhi->Fill(j->id().iphi());
1308  }
1309 
1310  if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) {
1311  HEEneX->Fill(j->energy());
1312  if (j->energy() > HBHEThreshold) HETimeX->Fill(j->time());
1313  }
1314  if ( (evt.id().run() == 120020) && (evt.id().event() == 457) ) {
1315  HEEneY->Fill(j->energy());
1316  if (j->energy() > HBHEThreshold) HETimeY->Fill(j->time());
1317  }
1318 
1319  // Fill +-HE separately
1320  if (j->id().ieta()<0) {
1321  HEnegEne->Fill(j->energy());
1322  if (j->energy() > HBHEThreshold) {
1323  HEnegTime->Fill(j->time());
1324  }
1325  } else {
1326  HEposEne->Fill(j->energy());
1327  if (j->energy() > HBHEThreshold) {
1328  HEposTime->Fill(j->time());
1329  }
1330  }
1331 
1332  }
1333 
1334  /***
1335  std::cout << j->id() << " "
1336  << j->id().subdet() << " "
1337  << j->id().ieta() << " "
1338  << j->id().iphi() << " "
1339  << j->id().depth() << " "
1340  << j->energy() << " "
1341  << j->time() << std::endl;
1342  ****/
1343  }
1344  }
1345  } catch (...) {
1346  cout << "No HB/HE RecHits." << endl;
1347  }
1348 
1349 
1350  HFM_ETime = 0.;
1351  HFM_E = 0.;
1352  HFP_ETime = 0.;
1353  HFP_E = 0.;
1354 
1355  try {
1356  std::vector<edm::Handle<HFRecHitCollection> > colls;
1357  evt.getManyByType(colls);
1358  std::vector<edm::Handle<HFRecHitCollection> >::iterator i;
1359  for (i=colls.begin(); i!=colls.end(); i++) {
1360  for (HFRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
1361 
1362  /****
1363  float en = j->energy();
1364  HcalDetId id(j->detid().rawId());
1365  int ieta = id.ieta();
1366  int iphi = id.iphi();
1367  int depth = id.depth();
1368  *****/
1369 
1370  // std::cout << *j << std::endl;
1371 
1372  if (j->id().subdet() == HcalForward) {
1373  HFEne->Fill(j->energy());
1374  HFTime->Fill(j->time());
1375  HFTvsE->Fill(j->energy(), j->time());
1376  if (j->energy() > HFThreshold) {
1377  HFEneTh->Fill(j->energy());
1378  HFTimeTh->Fill(j->time());
1379  HFTotalE += j->energy();
1380  HFocc->Fill(j->id().ieta(),j->id().iphi());
1381  hitEta->Fill(j->id().ieta());
1382  hitPhi->Fill(j->id().iphi());
1383  }
1384 
1385  if (j->id().ieta()<0) {
1386  if (j->energy() > HFThreshold) {
1387  // HFTimeM->Fill(j->time());
1388  HFEneM->Fill(j->energy());
1389  HFM_ETime += j->energy()*j->time();
1390  HFM_E += j->energy();
1391  }
1392  } else {
1393  if (j->energy() > HFThreshold) {
1394  // HFTimeP->Fill(j->time());
1395  HFEneP->Fill(j->energy());
1396  HFP_ETime += j->energy()*j->time();
1397  HFP_E += j->energy();
1398  }
1399  }
1400 
1401  // Long and short fibers
1402  if (j->id().depth() == 1){
1403  HFLEne->Fill(j->energy());
1404  if (j->energy() > HFThreshold) HFLTime->Fill(j->time());
1405  } else {
1406  HFSEne->Fill(j->energy());
1407  if (j->energy() > HFThreshold) HFSTime->Fill(j->time());
1408  }
1409  }
1410  }
1411  }
1412  } catch (...) {
1413  cout << "No HF RecHits." << endl;
1414  }
1415 
1416  for (int i=0; i<100; i++) {
1417  for (int j=0; j<100; j++) {
1418  HFLvsS->Fill(HFRecHit[i][j][1], HFRecHit[i][j][0]);
1419  }
1420  }
1421 
1422  if (HFP_E > 0.) HFTimeP->Fill(HFP_ETime / HFP_E);
1423  if (HFM_E > 0.) HFTimeM->Fill(HFM_ETime / HFM_E);
1424 
1425  if ((HFP_E > 0.) && (HFM_E > 0.)) {
1426  HF_PMM = (HFP_ETime / HFP_E) - (HFM_ETime / HFM_E);
1427  HFTimePM->Fill(HF_PMM);
1428  } else {
1429  HF_PMM = INVALID;
1430  }
1431 
1432 
1433 
1434  try {
1435  std::vector<edm::Handle<HORecHitCollection> > colls;
1436  evt.getManyByType(colls);
1437  std::vector<edm::Handle<HORecHitCollection> >::iterator i;
1438  for (i=colls.begin(); i!=colls.end(); i++) {
1439  for (HORecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
1440  if (j->id().subdet() == HcalOuter) {
1441  HOEne->Fill(j->energy());
1442  HOTime->Fill(j->time());
1443  HOTvsE->Fill(j->energy(), j->time());
1444  if (j->energy() > HOThreshold) {
1445  HOEneTh->Fill(j->energy());
1446  HOTimeTh->Fill(j->time());
1447  HOTotalE += j->energy();
1448  HOocc->Fill(j->id().ieta(),j->id().iphi());
1449  }
1450 
1451  // Separate SiPMs and HPDs:
1452  if (((j->id().iphi()>=59 && j->id().iphi()<=70 &&
1453  j->id().ieta()>=11 && j->id().ieta()<=15) ||
1454  (j->id().iphi()>=47 && j->id().iphi()<=58 &&
1455  j->id().ieta()>=5 && j->id().ieta()<=10)))
1456  {
1457  HOSEne->Fill(j->energy());
1458  if (j->energy() > HOThreshold) HOSTime->Fill(j->time());
1459  } else if ((j->id().iphi()<59 || j->id().iphi()>70 ||
1460  j->id().ieta()<11 || j->id().ieta()>15) &&
1461  (j->id().iphi()<47 || j->id().iphi()>58 ||
1462  j->id().ieta()<5 || j->id().ieta()>10))
1463  {
1464  HOHEne->Fill(j->energy());
1465  if (j->energy() > HOThreshold) HOHTime->Fill(j->time());
1466  // Separate rings -1,-2,0,1,2 in HPDs:
1467  if (j->id().ieta()<= -11){
1468  HOHrm2Ene->Fill(j->energy());
1469  if (j->energy() > HOThreshold) HOHrm2Time->Fill(j->time());
1470  } else if (j->id().ieta()>= -10 && j->id().ieta() <= -5) {
1471  HOHrm1Ene->Fill(j->energy());
1472  if (j->energy() > HOThreshold) HOHrm1Time->Fill(j->time());
1473  } else if (j->id().ieta()>= -4 && j->id().ieta() <= 4) {
1474  HOHr0Ene->Fill(j->energy());
1475  if (j->energy() > HOThreshold) HOHr0Time->Fill(j->time());
1476  } else if (j->id().ieta()>= 5 && j->id().ieta() <= 10) {
1477  HOHrp1Ene->Fill(j->energy());
1478  if (j->energy() > HOThreshold) HOHrp1Time->Fill(j->time());
1479  } else if (j->id().ieta()>= 11) {
1480  HOHrp2Ene->Fill(j->energy());
1481  if (j->energy() > HOThreshold) HOHrp2Time->Fill(j->time());
1482  } else {
1483  std::cout << "Finding events that are in no ring !?!" << std::endl;
1484  std::cout << "eta = " << j->id().ieta() << std::endl;
1485 
1486  }
1487  } else {
1488  std::cout << "Finding events that are neither SiPM nor HPD!?" << std::endl;
1489  }
1490 
1491 
1492 
1493  }
1494  // std::cout << *j << std::endl;
1495  }
1496  }
1497  } catch (...) {
1498  cout << "No HO RecHits." << endl;
1499  }
1500 
1501  HCALTotalE = HBTotalE + HETotalE + HFTotalE + HOTotalE;
1502  ECALTotalE = EBTotalE = EETotalE = 0.;
1503 
1504 
1505  try {
1506  std::vector<edm::Handle<EcalRecHitCollection> > colls;
1507  evt.getManyByType(colls);
1508  std::vector<edm::Handle<EcalRecHitCollection> >::iterator i;
1509  for (i=colls.begin(); i!=colls.end(); i++) {
1510  for (EcalRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
1511  if (j->id().subdetId() == EcalBarrel) {
1512  EBEne->Fill(j->energy());
1513  EBTime->Fill(j->time());
1514  if (j->energy() > EBEEThreshold) {
1515  EBEneTh->Fill(j->energy());
1516  EBTimeTh->Fill(j->time());
1517  }
1518  if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) {
1519  EBEneX->Fill(j->energy());
1520  EBTimeX->Fill(j->time());
1521  }
1522  if ( (evt.id().run() == 120020) && (evt.id().event() == 457) ) {
1523  EBEneY->Fill(j->energy());
1524  EBTimeY->Fill(j->time());
1525  }
1526  EBTotalE += j->energy();
1527  }
1528  if (j->id().subdetId() == EcalEndcap) {
1529  EEEne->Fill(j->energy());
1530  EETime->Fill(j->time());
1531  if (j->energy() > EBEEThreshold) {
1532  EEEneTh->Fill(j->energy());
1533  EETimeTh->Fill(j->time());
1534  }
1535  if ( (evt.id().run() == 120020) && (evt.id().event() == 453) ) {
1536  EEEneX->Fill(j->energy());
1537  EETimeX->Fill(j->time());
1538  }
1539  if ( (evt.id().run() == 120020) && (evt.id().event() == 457 ) ) {
1540  EEEneY->Fill(j->energy());
1541  EETimeY->Fill(j->time());
1542  }
1543  EETotalE += j->energy();
1544  }
1545  // std::cout << *j << std::endl;
1546  // std::cout << "EB ID = " << j->id().subdetId() << "/" << EcalBarrel << std::endl;
1547  }
1548  }
1549  } catch (...) {
1550  cout << "No ECAL RecHits." << endl;
1551  }
1552 
1553  EBvHB->Fill(HBTotalE, EBTotalE);
1554  EEvHE->Fill(HETotalE, EETotalE);
1555 
1556  /*****
1557  try {
1558  std::vector<edm::Handle<EBRecHitCollection> > colls;
1559  evt.getManyByType(colls);
1560  std::vector<edm::Handle<EBRecHitCollection> >::iterator i;
1561 
1562  for (i=colls.begin(); i!=colls.end(); i++) {
1563  for (EBRecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
1564  // if (j->id().subdetId() == EcalBarrel) {
1565  EBEne->Fill(j->energy());
1566  EBTime->Fill(j->time());
1567  // EBTotalE = j->energy();
1568  // }
1569  // std::cout << *j << std::endl;
1570  // std::cout << "EB ID = " << j->id().subdetId() << "/" << EcalBarrel << std::endl;
1571  }
1572  }
1573  } catch (...) {
1574  cout << "No EB RecHits." << endl;
1575  }
1576 
1577  try {
1578  std::vector<edm::Handle<EERecHitCollection> > colls;
1579  evt.getManyByType(colls);
1580  std::vector<edm::Handle<EERecHitCollection> >::iterator i;
1581  for (i=colls.begin(); i!=colls.end(); i++) {
1582  for (EERecHitCollection::const_iterator j=(*i)->begin(); j!=(*i)->end(); j++) {
1583  // if (j->id().subdetId() == EcalEndcap) {
1584  EEEne->Fill(j->energy());
1585  EETime->Fill(j->time());
1586  // EETotalE = j->energy();
1587  // Separate +-EE;
1588  EEDetId EEid = EEDetId(j->id());
1589  if (!EEid.positiveZ())
1590  {
1591  EEnegEne->Fill(j->energy());
1592  EEnegTime->Fill(j->time());
1593  }else{
1594  EEposEne->Fill(j->energy());
1595  EEposTime->Fill(j->time());
1596  }
1597  // }
1598  // std::cout << *j << std::endl;
1599  }
1600  }
1601  } catch (...) {
1602  cout << "No EE RecHits." << endl;
1603  }
1604  ******/
1605 
1606  ECALTotalE = EBTotalE + EETotalE;
1607 
1608  if ( (EBTotalE > 320000) && (EBTotalE < 330000) &&
1609  (HBTotalE > 2700000) && (HBTotalE < 2800000) ) {
1610 
1611  std::cout << ">>> Off Axis! "
1612  << std::endl;
1613 
1614  }
1615 
1616  std::cout << " Rechits: Total Energy : "
1617  << " HCAL= " << HCALTotalE
1618  << " ECAL= " << ECALTotalE
1619  << " HB = " << HBTotalE
1620  << " EB = " << EBTotalE
1621  << std::endl;
1622 
1623 
1624  // *********************
1625  // *** CaloTowers
1626  // *********************
1627  // Handle<CaloTowerCollection> caloTowers;
1628  // evt.getByLabel( "towerMaker", caloTowers );
1629 
1630  nTow1 = nTow2 = nTow3 = nTow4 = 0;
1631 
1632  double sum_et = 0.0;
1633  double sum_ex = 0.0;
1634  double sum_ey = 0.0;
1635  // double sum_ez = 0.0;
1636 
1637 
1638  // std::cout<<">>>> Run " << evt.id().run() << " Event " << evt.id().event() << std::endl;
1639  // --- Loop over towers and make a lists of used and unused towers
1640  for (CaloTowerCollection::const_iterator tower = caloTowers->begin();
1641  tower != caloTowers->end(); tower++) {
1642 
1643  Double_t et = tower->et();
1644 
1645  if (et > 0.5) nTow1++;
1646  if (et > 1.0) nTow2++;
1647  if (et > 1.5) nTow3++;
1648  if (et > 2.0) nTow4++;
1649 
1650  // if ( (fabs(tower->ieta() > 42)) || (fabs(tower->iphi()) > 72) ) {
1651  // std::cout << "ieta/iphi = " << tower->ieta() << " / " << tower->iphi() << std::endl;
1652  // }
1653 
1654  if (tower->emEnergy() > 2.0) {
1655  h_EmEnergy->Fill (tower->ieta(), tower->iphi(), tower->emEnergy());
1656  }
1657  if (tower->hadEnergy() > 2.0) {
1658  h_HadEnergy->Fill (tower->ieta(), tower->iphi(), tower->hadEnergy());
1659  }
1660 
1661  if (et>0.5) {
1662 
1663  ETime->Fill(tower->ecalTime());
1664  HTime->Fill(tower->hcalTime());
1665 
1666  // ********
1667  double phix = tower->phi();
1668  // double theta = tower->theta();
1669  // double e = tower->energy();
1670  // double et = e*sin(theta);
1671  // double et = tower->emEt() + tower->hadEt();
1672  double et = tower->et();
1673 
1674  // sum_ez += e*cos(theta);
1675  sum_et += et;
1676  sum_ex += et*cos(phix);
1677  sum_ey += et*sin(phix);
1678  // ********
1679 
1680  Double_t phi = tower->phi();
1681  SumEtTowers += tower->et();
1682 
1683  sumTowerAllEx += et*cos(phi);
1684  sumTowerAllEy += et*sin(phi);
1685 
1686  }
1687 
1688  }
1689 
1690  // SumEt->Fill(sum_et);
1691  // MET->Fill(sqrt( sum_ex*sum_ex + sum_ey*sum_ey));
1692 
1693  hf_sumTowerAllEx->Fill(sumTowerAllEx);
1694  hf_sumTowerAllEy->Fill(sumTowerAllEy);
1695 
1696  nTowers1->Fill(nTow1);
1697  nTowers2->Fill(nTow2);
1698  nTowers3->Fill(nTow3);
1699  nTowers4->Fill(nTow4);
1700 
1701 
1702  // *********************
1703  // *********************
1704 
1705  UsedTowerList.clear();
1706  TowerUsedInJets.clear();
1707  TowerNotUsedInJets.clear();
1708 
1709  // --- Loop over jets and make a list of all the used towers
1710  // evt.getByLabel( CaloJetAlgorithm, jets );
1711  for ( CaloJetCollection::const_iterator ijet=caloJets->begin(); ijet!=caloJets->end(); ijet++) {
1712 
1713  Double_t jetPt = ijet->pt();
1714  Double_t jetEta = ijet->eta();
1715  Double_t jetPhi = ijet->phi();
1716 
1717  // if (jetPt>5.0) {
1718 
1719  Double_t jetPx = jetPt*cos(jetPhi);
1720  Double_t jetPy = jetPt*sin(jetPhi);
1721 
1722  sumJetPx +=jetPx;
1723  sumJetPy +=jetPy;
1724 
1725  const std::vector<CaloTowerPtr> jetCaloRefs = ijet->getCaloConstituents();
1726  int nConstituents = jetCaloRefs.size();
1727  for (int i = 0; i <nConstituents ; i++){
1728 
1729  UsedTowerList.push_back(jetCaloRefs[i]);
1730  }
1731 
1732  SumPtJet +=jetPt;
1733 
1734  // }
1735 
1736  if ( (jetPt>80.0) && (fabs(jetEta) < 1.3) ){
1737  st_Pt->Fill( jetPt );
1738  int nConstituents = ijet->getCaloConstituents().size();
1739  st_Constituents->Fill( nConstituents );
1740 
1741  float maxEne = 0.;
1742  float totEne = 0.;
1743 
1744  for(unsigned twr=0; twr<ijet->getCaloConstituents().size(); ++twr){
1745  CaloTowerPtr tower = (ijet->getCaloConstituents())[twr];
1746  // CaloTowerDetId id = tower->id();
1747  if( tower->et()>0. ){
1748 
1749  if (tower->energy() > maxEne) maxEne = tower->energy();
1750  totEne += tower->energy();
1751 
1752  st_Energy->Fill( tower->energy() );
1753  st_EmEnergy->Fill( tower->emEnergy() );
1754  st_HadEnergy->Fill( tower->hadEnergy() );
1755  st_OuterEnergy->Fill( tower->outerEnergy() );
1756 
1757  st_Eta->Fill( tower->eta() );
1758  st_Phi->Fill( tower->phi() );
1759 
1760  st_iEta->Fill( tower->ieta() );
1761  st_iPhi->Fill( tower->iphi() );
1762 
1763  /****
1764  std::cout << ">>> Towers : "
1765  << " " << tower->energy()
1766  << " " << tower->emEnergy()
1767  << " " << tower->hadEnergy()
1768  << " " << tower->outerEnergy()
1769  << " " << tower->et()
1770  << " " << tower->emEt()
1771  << " " << tower->hadEt()
1772  << " " << tower->outerEt()
1773  << " " << tower->eta()
1774  << " " << tower->phi()
1775  << std::endl;
1776  ****/
1777  }
1778  }
1779  st_Frac->Fill( maxEne / totEne );
1780 
1781  }
1782 
1783  }
1784 
1785  int NTowersUsed = UsedTowerList.size();
1786 
1787  // --- Loop over towers and make a lists of used and unused towers
1788  for (CaloTowerCollection::const_iterator tower = caloTowers->begin();
1789  tower != caloTowers->end(); tower++) {
1790 
1791  CaloTower t = *tower;
1792  Double_t et = tower->et();
1793 
1794  if(et>0) {
1795 
1796  Double_t phi = tower->phi();
1797  SumEtTowers += tower->et();
1798 
1799  sumTowerAllPx += et*cos(phi);
1800  sumTowerAllPy += et*sin(phi);
1801 
1802  bool used = false;
1803 
1804  for(int i=0; i<NTowersUsed; i++){
1805  if(tower->id() == UsedTowerList[i]->id()){
1806  used=true;
1807  break;
1808  }
1809  }
1810 
1811  if (used) {
1812  TowerUsedInJets.push_back(t);
1813  } else {
1814  TowerNotUsedInJets.push_back(t);
1815  }
1816  }
1817  }
1818 
1819  int nUsed = TowerUsedInJets.size();
1820  int nNotUsed = TowerNotUsedInJets.size();
1821 
1822  SumEtJets = 0;
1823  SumEtNotJets = 0;
1824  TotalClusteredE = 0;
1825  TotalUnclusteredE = 0;
1826 
1827  for(int i=0;i<nUsed;i++){
1828  SumEtJets += TowerUsedInJets[i].et();
1829  h_ClusteredE->Fill(TowerUsedInJets[i].energy());
1830  if (TowerUsedInJets[i].energy() > 1.0)
1831  TotalClusteredE += TowerUsedInJets[i].energy();
1832  }
1833  h_jetEt->Fill(SumEtJets);
1834 
1835  for(int i=0;i<nNotUsed;i++){
1836  if (TowerNotUsedInJets[i].et() > 0.5)
1837  SumEtNotJets += TowerNotUsedInJets[i].et();
1838  h_UnclusteredEt->Fill(TowerNotUsedInJets[i].et());
1839  h_UnclusteredEts->Fill(TowerNotUsedInJets[i].et());
1840  h_UnclusteredE->Fill(TowerNotUsedInJets[i].energy());
1841  if (TowerNotUsedInJets[i].energy() > 1.0)
1842  TotalUnclusteredE += TowerNotUsedInJets[i].energy();
1843  }
1844 
1845  h_TotalClusteredE->Fill(TotalClusteredE);
1846  h_TotalUnclusteredE->Fill(TotalUnclusteredE);
1847  h_TotalUnclusteredEt->Fill(SumEtNotJets);
1848 
1849  // ********************************
1850  // *** CaloMET
1851  // ********************************
1852 
1854  evt.getByLabel("met", calometcoll);
1855  if (calometcoll.isValid()) {
1856  const CaloMETCollection *calometcol = calometcoll.product();
1857  const CaloMET *calomet;
1858  calomet = &(calometcol->front());
1859 
1860  double caloSumET = calomet->sumEt();
1861  double caloMET = calomet->pt();
1862  double caloMETSig = calomet->mEtSig();
1863  double caloMEx = calomet->px();
1864  double caloMEy = calomet->py();
1865  double caloMETPhi = calomet->phi();
1866 
1867  SumEt->Fill(caloSumET);
1868  MET->Fill(caloMET);
1869  if (evtType == 0) MET_Tower->Fill(caloMET);
1870  if (evtType == 1) MET_RBX->Fill(caloMET);
1871  if (evtType == 2) MET_HPD->Fill(caloMET);
1872  METSig->Fill(caloMETSig);
1873  MEx->Fill(caloMEx);
1874  MEy->Fill(caloMEy);
1875  METPhi->Fill(caloMETPhi);
1876 
1877  /***
1878  double caloEz = calomet->e_longitudinal();
1879 
1880  double caloMaxEtInEMTowers = calomet->maxEtInEmTowers();
1881  double caloMaxEtInHadTowers = calomet->maxEtInHadTowers();
1882  double caloEtFractionHadronic = calomet->etFractionHadronic();
1883  double caloEmEtFraction = calomet->emEtFraction();
1884 
1885  double caloHadEtInHB = calomet->hadEtInHB();
1886  double caloHadEtInHO = calomet->hadEtInHO();
1887  double caloHadEtInHE = calomet->hadEtInHE();
1888  double caloHadEtInHF = calomet->hadEtInHF();
1889  double caloEmEtInEB = calomet->emEtInEB();
1890  double caloEmEtInEE = calomet->emEtInEE();
1891  double caloEmEtInHF = calomet->emEtInHF();
1892  ****/
1893  }
1894 
1895  // ********************************
1896  // *** Vertex
1897  // ********************************
1898  VTX = INVALID;
1899  nVTX = 0;
1900 
1902  evt.getByLabel("offlinePrimaryVertices", vertexCollection);
1903  const reco::VertexCollection vC = *(vertexCollection.product());
1904 
1905  std::cout << "Reconstructed "<< vC.size() << " vertices" << std::endl ;
1906  nVTX = vC.size();
1907  for (reco::VertexCollection::const_iterator vertex=vC.begin(); vertex!=vC.end(); vertex++){
1908 
1909  h_Vx->Fill(vertex->x());
1910  h_Vy->Fill(vertex->y());
1911  h_Vz->Fill(vertex->z());
1912  VTX = vertex->z();
1913  // h_VNTrks->Fill(vertex->tracksSize());
1914 
1915  }
1916 
1917  if ((HF_PMM != INVALID) || (nVTX > 0)) {
1918  HFvsZ->Fill(HF_PMM,VTX);
1919  }
1920 
1921  // ********************************
1922  // *** Tracks
1923  // ********************************
1925  // evt.getByLabel("ctfWithMaterialTracks", trackCollection);
1926  evt.getByLabel("generalTracks", trackCollection);
1927 
1928  const reco::TrackCollection tC = *(trackCollection.product());
1929 
1930  std::cout << "ANA: Reconstructed "<< tC.size() << " tracks" << std::endl ;
1931 
1932  h_Trk_NTrk->Fill(tC.size());
1933  for (reco::TrackCollection::const_iterator track=tC.begin(); track!=tC.end(); track++){
1934 
1935  h_Trk_pt->Fill(track->pt());
1936 
1937  }
1938 
1939 
1940  /****
1941  std::cout << "Track number "<< i << std::endl ;
1942  std::cout << "\tmomentum: " << track->momentum()<< std::endl;
1943  std::cout << "\tPT: " << track->pt()<< std::endl;
1944  std::cout << "\tvertex: " << track->vertex()<< std::endl;
1945  std::cout << "\timpact parameter: " << track->d0()<< std::endl;
1946  std::cout << "\tcharge: " << track->charge()<< std::endl;
1947  std::cout << "\tnormalizedChi2: " << track->normalizedChi2()<< std::endl;
1948 
1949  cout<<"\tFrom EXTRA : "<<endl;
1950  cout<<"\t\touter PT "<< track->outerPt()<<endl;
1951  std::cout << "\t direction: " << track->seedDirection() << std::endl;
1952  ****/
1953 
1954  // ********************************
1955  // *** Photons
1956  // ********************************
1957  /***
1958  edm::Handle<reco::PhotonCollection> photonCollection;
1959  evt.getByLabel("photons", photonCollection);
1960  const reco::PhotonCollection pC = *(photonCollection.product());
1961 
1962  std::cout << "Reconstructed "<< pC.size() << " photons" << std::endl ;
1963  for (reco::PhotonCollection::const_iterator photon=pC.begin(); photon!=pC.end(); photon++){
1964  }
1965  ***/
1966 
1967  // ********************************
1968  // *** Muons
1969  // ********************************
1970  /***
1971  edm::Handle<reco::MuonCollection> muonCollection;
1972  evt.getByLabel("muons", muonCollection);
1973 
1974  const reco::MuonCollection mC = *(muonCollection.product());
1975 
1976  std::cout << "Reconstructed "<< mC.size() << " muons" << std::endl ;
1977  for (reco::MuonCollection::const_iterator muon=mC.begin(); muon!=mC.end(); muon++){
1978  }
1979  ***/
1980 
1981 
1982 
1983 
1984  // ********************************
1985  // *** Events passing seletion cuts
1986  // ********************************
1987 
1988  // --- Cosmic Cleanup
1989  // --- Vertex
1990  // --- Eta
1991 
1992  int iJet;
1993  iJet = 0;
1994  for( CaloJetCollection::const_iterator ijet = caloJets->begin(); ijet != caloJets->end(); ++ ijet ) {
1995 
1996  // if ( (fabs(ijet->eta()) < 1.3) &&
1997  // (fabs(ijet->pt()) > 20.) ) {
1998 
1999  // (ijet->emEnergyFraction() > 0.01) &&
2000  // (ijet->emEnergyFraction() > 0.99) ) {
2001 
2002  iJet++;
2003  if (iJet == 1) {
2004  cout << " CaloJet: Event Type = " << evtType
2005  << " pt = " << ijet->pt()
2006  << endl;
2007  }
2008  h_pt->Fill(ijet->pt());
2009  if (evtType == 0) h_ptTower->Fill(ijet->pt());
2010  if (evtType == 1) h_ptRBX->Fill(ijet->pt());
2011  if (evtType == 2) h_ptHPD->Fill(ijet->pt());
2012  h_et->Fill(ijet->et());
2013  h_eta->Fill(ijet->eta());
2014  h_phi->Fill(ijet->phi());
2015 
2016  jetHOEne->Fill(ijet->hadEnergyInHO());
2017  jetEMFraction->Fill(ijet->emEnergyFraction());
2018 
2019  // }
2020  }
2021 
2022 
2023 
2024  //*****************************
2025  //*** Get the GenJet collection
2026  //*****************************
2027 
2028  /**************
2029  Handle<GenJetCollection> genJets;
2030  evt.getByLabel( GenJetAlgorithm, genJets );
2031 
2032  //Loop over the two leading GenJets and fill some histograms
2033  jetInd = 0;
2034  allJetInd = 0;
2035  for( GenJetCollection::const_iterator gen = genJets->begin(); gen != genJets->end(); ++ gen ) {
2036  allJetInd++;
2037  if (allJetInd == 1) {
2038  p4tmp[0] = gen->p4();
2039  }
2040  if (allJetInd == 2) {
2041  p4tmp[1] = gen->p4();
2042  }
2043 
2044  if ( (allJetInd == 1) || (allJetInd == 2) ) {
2045  h_ptGenL->Fill( gen->pt() );
2046  h_etaGenL->Fill( gen->eta() );
2047  h_phiGenL->Fill( gen->phi() );
2048  }
2049 
2050  if ( gen->pt() > minJetPt) {
2051  // std::cout << "GEN JET1 #" << jetInd << std::endl << gen->print() << std::endl;
2052  h_ptGen->Fill( gen->pt() );
2053  h_etaGen->Fill( gen->eta() );
2054  h_phiGen->Fill( gen->phi() );
2055  jetInd++;
2056  }
2057  }
2058 
2059  h_nGenJets->Fill( jetInd );
2060  *******/
2061  }
2062 
2063 }
2064 
2065 // ***********************************
2066 // ***********************************
2068 
2069  for (int i=0; i<4000; i++) {
2070  if ((nBNC[i]/totBNC) > 0.05) {
2071  std::cout << "+++ " << i << " "
2072  << (nBNC[i]/totBNC) << " "
2073  << nBNC[i] << " "
2074  << totBNC << " "
2075  << std::endl;
2076  }
2077  }
2078 
2079 
2080 }
TH1F * MET_HPD
Definition: myJetAna.h:188
RunNumber_t run() const
Definition: EventID.h:42
TH1F * HFTimeTh
Definition: myJetAna.h:101
void getManyByType(std::vector< Handle< PROD > > &results) const
Definition: Event.h:414
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
TH1F * h_pt
Definition: myJetAna.h:63
TH1F * EEEneX
Definition: myJetAna.h:151
TH1F * st_EmEnergy
Definition: myJetAna.h:290
int i
Definition: DBlmapReader.cc:9
TH1F * HFTimeM
Definition: myJetAna.h:107
TH1F * EEnegTime
Definition: myJetAna.h:159
TH1F * HFEneTh
Definition: myJetAna.h:99
TH1F * HETimeX
Definition: myJetAna.h:94
TH2F * ECALvHCALEta3
Definition: myJetAna.h:305
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:208
double emEnergy
Definition: myFilter.cc:54
TH1F * HBEne
Definition: myJetAna.h:78
TH1F * h_ptCal
Definition: myJetAna.h:252
TH1F * totEneLeadJetEta3
Definition: myJetAna.h:225
TH1F * HBTimeTh
Definition: myJetAna.h:83
TH1F * hadFracEta1
Definition: myJetAna.h:233
TH1F * RBX_nTowers
Definition: myJetAna.h:174
TH1F * HOHrp2Time
Definition: myJetAna.h:140
double et
Definition: myFilter.cc:52
TH1F * st_Frac
Definition: myJetAna.h:297
TH2F * HETvsE
Definition: myJetAna.h:114
TH1F * nTowersLeadJetPt2
Definition: myJetAna.h:219
TH1F * MET_Tower
Definition: myJetAna.h:186
TH1F * HOHrm1Time
Definition: myJetAna.h:134
TH1F * h_ClusteredE
Definition: myJetAna.h:273
TH1F * HEposTime
Definition: myJetAna.h:96
TH1F * h_nCalJets
Definition: myJetAna.h:241
TH1F * h_phiGenL
Definition: myJetAna.h:262
TH1F * HOHrp1Time
Definition: myJetAna.h:138
TH1F * nTowers4
Definition: myJetAna.h:217
TH1F * HFEneM
Definition: myJetAna.h:106
TH2F * HBocc
Definition: myJetAna.h:124
TH1F * hitEtaEt
Definition: myJetAna.h:248
TH1F * RBX_N
Definition: myJetAna.h:175
TH1F * h_nGenJets
Definition: myJetAna.h:242
TH1F * HOEneOOT
Definition: myJetAna.h:76
TH1F * h_etaGenL
Definition: myJetAna.h:261
double deltaPhi(float phi1, float phi2)
Definition: VectorUtil.h:30
TH1F * h_et
Definition: myJetAna.h:67
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
TH1F * hadFracEta2
Definition: myJetAna.h:234
TH1F * HOTime
Definition: myJetAna.h:121
TH1F * EEEneY
Definition: myJetAna.h:152
TH1F * EETime
Definition: myJetAna.h:155
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
TH1F * HEEneX
Definition: myJetAna.h:88
double emEnergy
Definition: myFilter.cc:45
TH1F * EBTimeTh
Definition: myJetAna.h:146
TH1F * hf_TowerJetEt
Definition: myJetAna.h:209
TH1F * totEneLeadJetEta2
Definition: myJetAna.h:224
TH1F * HFLTime
Definition: myJetAna.h:109
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
std::vector< T >::const_iterator const_iterator
int bunchCrossing() const
Definition: EventBase.h:62
TH1F * HEEneTh
Definition: myJetAna.h:87
TH1F * HBTimeY
Definition: myJetAna.h:85
TH1F * h_ptRBX
Definition: myJetAna.h:65
#define abs(x)
Definition: mlp_lapack.h:159
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
double hadEnergy
Definition: myFilter.cc:53
TH1F * HOHr0Time
Definition: myJetAna.h:132
TH2F * HOTvsE
Definition: myJetAna.h:116
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
int nTowers
Definition: myFilter.cc:48
TH1F * h_TotalUnclusteredE
Definition: myJetAna.h:271
TH2F * h_EmEnergy
Definition: myJetAna.h:284
TH1F * HOHrp1Ene
Definition: myJetAna.h:137
TH2F * HOocc
Definition: myJetAna.h:123
TH1F * HETimeTh
Definition: myJetAna.h:93
TH1F * HFLEne
Definition: myJetAna.h:108
TH1F * HOEneTh
Definition: myJetAna.h:120
TH1F * EEnegEne
Definition: myJetAna.h:153
TH1F * ETime
Definition: myJetAna.h:211
TH1F * HFTimePMa
Definition: myJetAna.h:104
TH1F * h_Trk_NTrk
Definition: myJetAna.h:204
TH1F * EETimeY
Definition: myJetAna.h:158
TH1F * h_Trk_pt
Definition: myJetAna.h:203
float totBNC
Definition: myJetAna.cc:104
TH1F * HEEne
Definition: myJetAna.h:86
HPD HPDColl[144]
Definition: myJetAna.cc:107
#define INVALID
Definition: myJetAna.cc:79
TH1F * caloEtaEt
Definition: myJetAna.h:244
TH2F * ECALvHCALEta2
Definition: myJetAna.h:304
TH1F * HBTime
Definition: myJetAna.h:82
void analyze(const edm::Event &, const edm::EventSetup &)
Definition: myJetAna.cc:395
TH1F * towerEmFrac
Definition: myJetAna.h:169
TH1F * nTowers2
Definition: myJetAna.h:215
TH1F * h_jet1Pt
Definition: myJetAna.h:276
TH2F * EEvHE
Definition: myJetAna.h:301
double et
Definition: myFilter.cc:43
TH1F * HPD_hcalTime
Definition: myJetAna.h:179
float nBNC[4000]
Definition: myJetAna.cc:104
TH2F * EBvHB
Definition: myJetAna.h:300
TH1F * h_eta
Definition: myJetAna.h:68
TH1F * HOTimeTh
Definition: myJetAna.h:122
TH1F * EEEne
Definition: myJetAna.h:149
TH1F * HFTimePM
Definition: myJetAna.h:105
Collection of Calo MET.
TH1F * EBTimeY
Definition: myJetAna.h:148
TH1F * HFSEne
Definition: myJetAna.h:110
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
struct HPD_struct HPD
TH1F * HOEne
Definition: myJetAna.h:119
TH1F * HPD_nTowers
Definition: myJetAna.h:180
TH1F * EETimeTh
Definition: myJetAna.h:156
TH2F * h_HadEnergy
Definition: myJetAna.h:285
TH1F * towerOuterEn
Definition: myJetAna.h:167
TProfile * EMF_EtaX
Definition: myJetAna.h:309
int nTowers
Definition: myFilter.cc:58
TH1F * EBEneY
Definition: myJetAna.h:144
RBX RBXColl[36]
Definition: myJetAna.cc:106
double mEtSig() const
Definition: MET.h:50
TH1F * HPD_hadEnergy
Definition: myJetAna.h:178
TH1F * HTime
Definition: myJetAna.h:212
TH1F * EBTime
Definition: myJetAna.h:145
double sumEt() const
Definition: MET.h:48
TH1F * jetHOEne
Definition: myJetAna.h:280
std::string CaloJetAlgorithm
Definition: myJetAna.h:56
TH1F * h_jet2Pt
Definition: myJetAna.h:277
TH1F * HFTime
Definition: myJetAna.h:100
TH1F * h_TotalUnclusteredEt
Definition: myJetAna.h:268
TH1F * h_Vz
Definition: myJetAna.h:198
edm::InputTag theTriggerResultsLabel
Definition: myJetAna.h:58
accept
Definition: HLTenums.h:22
TH1F * jetEMFraction
Definition: myJetAna.h:281
TH1F * h_ptGenL
Definition: myJetAna.h:260
TH1F * h_TotalClusteredE
Definition: myJetAna.h:274
TH1F * HETime
Definition: myJetAna.h:92
Definition: MET.h:32
TH1F * HBEneY
Definition: myJetAna.h:81
TH1F * hf_sumTowerAllEy
Definition: myJetAna.h:208
TH1F * st_Constituents
Definition: myJetAna.h:288
TH1F * HBEneOOT
Definition: myJetAna.h:73
TH1F * HFSTime
Definition: myJetAna.h:118
TProfile * EMF_Eta
Definition: myJetAna.h:307
TH1F * hadEneLeadJetEta2
Definition: myJetAna.h:227
TH1F * HFTimeP
Definition: myJetAna.h:103
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TH1F * HEposEne
Definition: myJetAna.h:90
float ecalTime
Definition: myFilter.cc:57
TH1F * st_iEta
Definition: myJetAna.h:295
TH1F * h_Vy
Definition: myJetAna.h:197
TH1F * HEEneOOT
Definition: myJetAna.h:74
int j
Definition: DBlmapReader.cc:9
TH2F * HEocc
Definition: myJetAna.h:125
TH1F * h_jet1PtHLT
Definition: myJetAna.h:278
TH1F * h_etaCal
Definition: myJetAna.h:253
TH1F * h_UnclusteredEts
Definition: myJetAna.h:267
TH1F * st_OuterEnergy
Definition: myJetAna.h:292
int orbitNumber() const
Definition: EventBase.h:63
TH1F * HPD_N
Definition: myJetAna.h:181
TH1F * HOHrm2Ene
Definition: myJetAna.h:135
TProfile * EMF_Phi
Definition: myJetAna.h:306
TH1F * HOHTime
Definition: myJetAna.h:130
TH2F * ECALvHCAL
Definition: myJetAna.h:302
bool isValid() const
Definition: HandleBase.h:76
TH1F * totEneLeadJetEta1
Definition: myJetAna.h:223
void beginJob()
Definition: myJetAna.cc:126
TH1F * HOHr0Ene
Definition: myJetAna.h:131
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
TH1F * st_Eta
Definition: myJetAna.h:293
TH1F * RBX_hcalTime
Definition: myJetAna.h:173
TH1F * HOSEne
Definition: myJetAna.h:127
TProfile * EMF_PhiX
Definition: myJetAna.h:308
TH1F * hadFracEta3
Definition: myJetAna.h:235
TH1F * nTowers1
Definition: myJetAna.h:214
TH1F * HOHEne
Definition: myJetAna.h:129
TH1F * EBEne
Definition: myJetAna.h:141
TH2F * HFTvsE
Definition: myJetAna.h:115
float hcalTime
Definition: myFilter.cc:46
TH1F * EBTimeX
Definition: myJetAna.h:147
#define M_PI
Definition: BFit3D.cc:3
TH1F * hf_sumTowerAllEx
Definition: myJetAna.h:207
struct RBX_struct RBX
TH1F * HOSTime
Definition: myJetAna.h:128
TH1F * HOHrm2Time
Definition: myJetAna.h:136
TH1F * MEy
Definition: myJetAna.h:191
TH1F * hitPhi
Definition: myJetAna.h:250
virtual double px() const
x coordinate of momentum vector
TH1F * METPhi
Definition: myJetAna.h:192
virtual double pt() const
transverse momentum
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
TH1F * SumEt
Definition: myJetAna.h:184
TH1F * st_iPhi
Definition: myJetAna.h:296
TH1F * RBX_et
Definition: myJetAna.h:171
TH1F * emEneLeadJetEta2
Definition: myJetAna.h:230
TH1F * nTowersLeadJetPt4
Definition: myJetAna.h:221
TH1F * RBX_hadEnergy
Definition: myJetAna.h:172
TH1F * h_ptTower
Definition: myJetAna.h:64
double hadEnergy
Definition: myFilter.cc:44
T const * product() const
Definition: Handle.h:74
TH1F * h_jetEt
Definition: myJetAna.h:264
TH1F * towerHadEn
Definition: myJetAna.h:165
TH1F * h_phiCal
Definition: myJetAna.h:254
TH1F * h_etaGen
Definition: myJetAna.h:257
TH2F * HFocc
Definition: myJetAna.h:126
TH1F * EBEneTh
Definition: myJetAna.h:142
TH1F * HEnegTime
Definition: myJetAna.h:97
edm::EventID id() const
Definition: EventBase.h:56
TH1F * h_Vx
Definition: myJetAna.h:196
float hcalTime
Definition: myFilter.cc:56
TH1F * HETimeY
Definition: myJetAna.h:95
TH1F * h_UnclusteredEt
Definition: myJetAna.h:266
TH1F * caloPhi
Definition: myJetAna.h:246
TH1F * EEposEne
Definition: myJetAna.h:154
TH1F * MET_RBX
Definition: myJetAna.h:187
TH1F * h_ptHPD
Definition: myJetAna.h:66
TH1F * HBEneX
Definition: myJetAna.h:80
TH1F * h_phi
Definition: myJetAna.h:69
float ecalTime
Definition: myFilter.cc:47
TH1F * h_VNTrks
Definition: myJetAna.h:199
TH1F * HBEneTh
Definition: myJetAna.h:79
TH2F * ECALvHCALEta1
Definition: myJetAna.h:303
TH1F * st_Energy
Definition: myJetAna.h:289
TH1F * towerEmEn
Definition: myJetAna.h:166
T * make() const
make new ROOT object
TH1F * NTowers
Definition: myJetAna.h:282
TH1F * HOHrm1Ene
Definition: myJetAna.h:133
TH1F * hitEta
Definition: myJetAna.h:249
TH1F * HEnegEne
Definition: myJetAna.h:91
TH1F * dijetMass
Definition: myJetAna.h:239
myJetAna(const edm::ParameterSet &)
Definition: myJetAna.cc:115
TH1F * h_ptGen
Definition: myJetAna.h:256
TH1F * HEEneY
Definition: myJetAna.h:89
TH1F * HPD_et
Definition: myJetAna.h:177
TH1F * nTowersLeadJetPt3
Definition: myJetAna.h:220
tuple cout
Definition: gather_cfg.py:41
TH1F * st_Phi
Definition: myJetAna.h:294
TH1F * caloEta
Definition: myJetAna.h:245
TH1F * st_Pt
Definition: myJetAna.h:287
#define DEBUG
Definition: myJetAna.cc:80
TH1F * HFEneP
Definition: myJetAna.h:102
TH1F * HFEne
Definition: myJetAna.h:98
TH1F * hadEneLeadJetEta1
Definition: myJetAna.h:226
TH1F * st_HadEnergy
Definition: myJetAna.h:291
TH1F * EBEneX
Definition: myJetAna.h:143
TH2F * HFvsZ
Definition: myJetAna.h:299
TH1F * HBTimeX
Definition: myJetAna.h:84
virtual double phi() const
momentum azimuthal angle
TH1F * HFEneOOT
Definition: myJetAna.h:75
TH1F * emEneLeadJetEta3
Definition: myJetAna.h:231
TH2F * HBTvsE
Definition: myJetAna.h:113
TH1F * hadEneLeadJetEta3
Definition: myJetAna.h:228
TH1F * h_UnclusteredE
Definition: myJetAna.h:270
virtual double py() const
y coordinate of momentum vector
void endJob()
Definition: myJetAna.cc:2067
TH1F * EEposTime
Definition: myJetAna.h:160
TH1F * nTowersLeadJetPt1
Definition: myJetAna.h:218
TH1F * HOHrp2Ene
Definition: myJetAna.h:139
TH1F * MEx
Definition: myJetAna.h:190
TH1F * METSig
Definition: myJetAna.h:189
TH1F * EETimeX
Definition: myJetAna.h:157
TH1F * h_phiGen
Definition: myJetAna.h:258
TH1F * nTowers3
Definition: myJetAna.h:216
TH1F * EEEneTh
Definition: myJetAna.h:150
Definition: DDAxes.h:10
TH1F * emEneLeadJetEta1
Definition: myJetAna.h:229
TH2F * HFLvsS
Definition: myJetAna.h:111