CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QcdPhotonsDQM.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2012/10/10 04:00:00 $
5  * $Revision: 1.32 $
6  * \author Michael B. Anderson, University of Wisconsin Madison
7  */
8 
10 
14 
19 
21 
23 
24 // Physics Objects
28 
29 // Vertex
32 
33 // For removing ECAL Spikes
39 
42 
43 //geometry
44 //#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
45 //#include "Geometry/Records/interface/IdealGeometryRecord.h"
46 //#include "Geometry/Records/interface/CaloGeometryRecord.h"
47 //#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h"
48 //#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
49 //#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
50 //#include "Geometry/EcalAlgo/interface/EcalPreshowerGeometry.h"
51 
52 // Math stuff
55 
56 #include <vector>
57 
58 #include <string>
59 #include <cmath>
60 using namespace std;
61 using namespace edm;
62 using namespace reco;
63 
64 
66  // Get parameters from configuration file
67  theTriggerPathToPass_ = parameters.getParameter<string>("triggerPathToPass");
68  thePlotTheseTriggersToo_ = parameters.getParameter<vector<string> >("plotTheseTriggersToo");
69  trigTag_ = parameters.getUntrackedParameter<edm::InputTag>("trigTag");
70  thePhotonCollectionLabel_ = parameters.getParameter<InputTag>("photonCollection");
71  theJetCollectionLabel_ = parameters.getParameter<InputTag>("jetCollection");
72  theVertexCollectionLabel_ = parameters.getParameter<InputTag>("vertexCollection");
73  theMinJetPt_ = parameters.getParameter<double>("minJetPt");
74  theMinPhotonEt_ = parameters.getParameter<double>("minPhotonEt");
75  theRequirePhotonFound_ = parameters.getParameter<bool>("requirePhotonFound");
76  thePlotPhotonMaxEt_ = parameters.getParameter<double>("plotPhotonMaxEt");
77  thePlotPhotonMaxEta_ = parameters.getParameter<double>("plotPhotonMaxEta");
78  thePlotJetMaxEta_ = parameters.getParameter<double>("plotJetMaxEta");
79  theBarrelRecHitTag = parameters.getParameter<InputTag>("barrelRecHitTag");
80  theEndcapRecHitTag = parameters.getParameter<InputTag>("endcapRecHitTag");
81  // just to initialize
82  isValidHltConfig_ = false;
83 
84  // coverity says...
85  h_deltaEt_photon_jet = 0;
86  h_deltaPhi_jet_jet2 = 0;
87  h_deltaPhi_photon_jet = 0;
88  h_deltaPhi_photon_jet2 = 0;
89  h_deltaR_jet_jet2 = 0;
90  h_deltaR_photon_jet2 = 0;
91  h_jet2_eta = 0;
92  h_jet2_pt = 0;
93  h_jet2_ptOverPhotonEt = 0;
94  h_jet_count = 0;
95  h_jet_eta = 0;
96  h_jet_pt = 0;
97  h_photon_count_bar = 0;
98  h_photon_count_end = 0;
99  h_photon_et = 0;
100  h_photon_et_beforeCuts = 0;
101  h_photon_et_jetco = 0;
102  h_photon_et_jetcs = 0;
103  h_photon_et_jetfo = 0;
104  h_photon_et_jetfs = 0;
105  h_photon_et_ratio_co_cs = 0;
106  h_photon_et_ratio_co_fo = 0;
107  h_photon_et_ratio_co_fs = 0;
108  h_photon_et_ratio_cs_fo = 0;
109  h_photon_et_ratio_cs_fs = 0;
110  h_photon_et_ratio_fo_fs = 0;
111  h_photon_eta = 0;
112  h_triggers_passed = 0;
113 
114  theDbe = Service<DQMStore>().operator->();
115 
116 }
117 
119 }
120 
121 
123 
124  logTraceName = "QcdPhotonAnalyzer";
125 
126  LogTrace(logTraceName)<<"Parameters initialization";
127 
128  theDbe->setCurrentFolder("Physics/QcdPhotons"); // Use folder with name of PAG
129 
130  std::stringstream aStringStream;
131  std::string aString;
132  aStringStream << theMinJetPt_;
133  aString = aStringStream.str();
134 
135  // Monitor of triggers passed
136  int numOfTriggersToMonitor = thePlotTheseTriggersToo_.size();
137  h_triggers_passed = theDbe->book1D("triggers_passed", "Events passing these trigger paths", numOfTriggersToMonitor, 0, numOfTriggersToMonitor);
138  for (int i=0; i<numOfTriggersToMonitor; i++) {
139  h_triggers_passed->setBinLabel(i+1,thePlotTheseTriggersToo_[i]);
140  }
141 
142  // Keep the number of plots and number of bins to a minimum!
143  h_photon_et_beforeCuts = theDbe->book1D("photon_et_beforeCuts", "#gamma with highest E_{T};E_{T}(#gamma) (GeV)", 20, 0., thePlotPhotonMaxEt_);
144  h_photon_et = theDbe->book1D("photon_et", "#gamma with highest E_{T};E_{T}(#gamma) (GeV)", 20, 0., thePlotPhotonMaxEt_);
145  h_photon_eta = theDbe->book1D("photon_eta", "#gamma with highest E_{T};#eta(#gamma)", 40, -thePlotPhotonMaxEta_, thePlotPhotonMaxEta_);
146  h_photon_count_bar = theDbe->book1D("photon_count_bar","Number of #gamma's passing selection (Barrel);Number of #gamma's", 8, -0.5, 7.5);
147  h_photon_count_end = theDbe->book1D("photon_count_end","Number of #gamma's passing selection (Endcap);Number of #gamma's", 8, -0.5, 7.5);
148 
149  h_jet_pt = theDbe->book1D("jet_pt", "Jet with highest p_{T} (from "+theJetCollectionLabel_.label()+");p_{T}(1^{st} jet) (GeV)", 20, 0., thePlotPhotonMaxEt_);
150  h_jet_eta = theDbe->book1D("jet_eta", "Jet with highest p_{T} (from "+theJetCollectionLabel_.label()+");#eta(1^{st} jet)", 20, -thePlotJetMaxEta_, thePlotJetMaxEta_);
151  h_deltaPhi_photon_jet = theDbe->book1D("deltaPhi_photon_jet", "#Delta#phi between Highest E_{T} #gamma and jet;#Delta#phi(#gamma,1^{st} jet)", 20, 0, 3.1415926);
152  h_deltaPhi_jet_jet2 = theDbe->book1D("deltaPhi_jet_jet2", "#Delta#phi between Highest E_{T} jet and 2^{nd} jet;#Delta#phi(1^{st} jet,2^{nd} jet)", 20, 0, 3.1415926);
153  h_deltaEt_photon_jet = theDbe->book1D("deltaEt_photon_jet", "(E_{T}(#gamma)-p_{T}(jet))/E_{T}(#gamma) when #Delta#phi(#gamma,1^{st} jet) > 2.8;#DeltaE_{T}(#gamma,1^{st} jet)/E_{T}(#gamma)", 20, -1.0, 1.0);
154  h_jet_count = theDbe->book1D("jet_count", "Number of "+theJetCollectionLabel_.label()+" (p_{T} > "+aString+" GeV);Number of Jets", 8, -0.5, 7.5);
155  h_jet2_pt = theDbe->book1D("jet2_pt", "Jet with 2^{nd} highest p_{T} (from "+theJetCollectionLabel_.label()+");p_{T}(2^{nd} jet) (GeV)", 20, 0., thePlotPhotonMaxEt_);
156  h_jet2_eta = theDbe->book1D("jet2_eta", "Jet with 2^{nd} highest p_{T} (from "+theJetCollectionLabel_.label()+");#eta(2^{nd} jet)", 20, -thePlotJetMaxEta_, thePlotJetMaxEta_);
157  h_jet2_ptOverPhotonEt = theDbe->book1D("jet2_ptOverPhotonEt", "p_{T}(2^{nd} highest jet) / E_{T}(#gamma);p_{T}(2^{nd} Jet)/E_{T}(#gamma)", 20, 0.0, 4.0);
158  h_deltaPhi_photon_jet2 = theDbe->book1D("deltaPhi_photon_jet2","#Delta#phi between Highest E_{T} #gamma and 2^{nd} highest jet;#Delta#phi(#gamma,2^{nd} jet)", 20, 0, 3.1415926);
159  h_deltaR_jet_jet2 = theDbe->book1D("deltaR_jet_jet2", "#DeltaR between Highest Jet and 2^{nd} Highest;#DeltaR(1^{st} jet,2^{nd} jet)", 30, 0, 6.0);
160  h_deltaR_photon_jet2 = theDbe->book1D("deltaR_photon_jet2", "#DeltaR between Highest E_{T} #gamma and 2^{nd} jet;#DeltaR(#gamma, 2^{nd} jet)", 30, 0, 6.0);
161 
162  // Photon Et for different jet configurations
163  Float_t bins_et[] = {15,20,30,50,80};
164  int num_bins_et = 4;
165  h_photon_et_jetcs = theDbe->book1D("photon_et_jetcs", "#gamma with highest E_{T} (#eta(jet)<1.45, #eta(#gamma)#eta(jet)>0);E_{T}(#gamma) (GeV)", num_bins_et, bins_et);
166  h_photon_et_jetco = theDbe->book1D("photon_et_jetco", "#gamma with highest E_{T} (#eta(jet)<1.45, #eta(#gamma)#eta(jet)<0);E_{T}(#gamma) (GeV)", num_bins_et, bins_et);
167  h_photon_et_jetfs = theDbe->book1D("photon_et_jetfs", "#gamma with highest E_{T} (1.55<#eta(jet)<2.5, #eta(#gamma)#eta(jet)>0);E_{T}(#gamma) (GeV)", num_bins_et, bins_et);
168  h_photon_et_jetfo = theDbe->book1D("photon_et_jetfo", "#gamma with highest E_{T} (1.55<#eta(jet)<2.5, #eta(#gamma)#eta(jet)<0);E_{T}(#gamma) (GeV)", num_bins_et, bins_et);
169  h_photon_et_jetcs->getTH1F()->Sumw2();
170  h_photon_et_jetco->getTH1F()->Sumw2();
171  h_photon_et_jetfs->getTH1F()->Sumw2();
172  h_photon_et_jetfo->getTH1F()->Sumw2();
173  // Ratio of the above Photon Et distributions
174  h_photon_et_ratio_co_cs = theDbe->book1D("photon_et_ratio_00_co_cs", "D(|#eta(jet)|<1.45, #eta(jet)*#eta(#gamma)<0) / D(|#eta(jet)|<1.45, #eta(jet)*#eta(#gamma)>0);E_{T}(#gamma) (GeV); ratio", num_bins_et, bins_et);
175  h_photon_et_ratio_fo_fs = theDbe->book1D("photon_et_ratio_01_fo_fs", "D(1.55<|#eta(jet)|<2.6, #eta(jet)*#eta(#gamma)<0) / D(1.55<|#eta(jet)|<2.6, #eta(jet)*#eta(#gamma)>0);E_{T}(#gamma) (GeV); ratio", num_bins_et, bins_et);
176  h_photon_et_ratio_cs_fs = theDbe->book1D("photon_et_ratio_02_cs_fs", "D(|#eta(jet)|<1.45, #eta(jet)*#eta(#gamma)>0) / D(1.55<|#eta(jet)|<2.6, #eta(jet)*#eta(#gamma)>0);E_{T}(#gamma) (GeV); ratio", num_bins_et, bins_et);
177  h_photon_et_ratio_co_fs = theDbe->book1D("photon_et_ratio_03_co_fs", "D(|#eta(jet)|<1.45, #eta(jet)*#eta(#gamma)<0) / D(1.55<|#eta(jet)|<2.6, #eta(jet)*#eta(#gamma)>0);E_{T}(#gamma) (GeV); ratio", num_bins_et, bins_et);
178  h_photon_et_ratio_cs_fo = theDbe->book1D("photon_et_ratio_04_cs_fo", "D(|#eta(jet)|<1.45, #eta(jet)*#eta(#gamma)>0) / D(1.55<|#eta(jet)|<2.6, #eta(jet)*#eta(#gamma)<0);E_{T}(#gamma) (GeV); ratio", num_bins_et, bins_et);
179  h_photon_et_ratio_co_fo = theDbe->book1D("photon_et_ratio_05_co_fo", "D(|#eta(jet)|<1.45, #eta(jet)*#eta(#gamma)<0) / D(1.55<|#eta(jet)|<2.6, #eta(jet)*#eta(#gamma)<0);E_{T}(#gamma) (GeV); ratio", num_bins_et, bins_et);
180  h_photon_et_ratio_co_cs->getTH1F()->Sumw2();
181  h_photon_et_ratio_fo_fs->getTH1F()->Sumw2();
182  h_photon_et_ratio_cs_fs->getTH1F()->Sumw2();
183  h_photon_et_ratio_co_fs->getTH1F()->Sumw2();
184  h_photon_et_ratio_cs_fo->getTH1F()->Sumw2();
185  h_photon_et_ratio_co_fo->getTH1F()->Sumw2();
186 }
187 
188 
192 void QcdPhotonsDQM::beginRun( const edm::Run &iRun, const edm::EventSetup &iSet ) {
193 
194  // passed as parameter to HLTConfigProvider::init(), not yet used
195  bool isConfigChanged = false;
196 
197  // isValidHltConfig_ could be used to short-circuit analyze() in case of problems
198  isValidHltConfig_ = hltConfigProvider_.init( iRun, iSet, "HLT", isConfigChanged );
199 
200  num_events_in_run = 0;
201 }
202 
203 
204 void QcdPhotonsDQM::analyze(const Event& iEvent, const EventSetup& iSetup) {
205  num_events_in_run++;
206 
208  //if( ! isValidHltConfig_ ) return;
209 
210  LogTrace(logTraceName)<<"Analysis of event # ";
211 
213  // Did event pass HLT paths?
214  Handle<TriggerResults> HLTresults;
215  iEvent.getByLabel(trigTag_, HLTresults);
216  if (!HLTresults.isValid()) {
217  //LogWarning("") << ">>> TRIGGER collection does not exist !!!";
218  return;
219  }
220  const edm::TriggerNames & trigNames = iEvent.triggerNames(*HLTresults);
221 
222  bool passed_HLT=false;
223 
224  // See if event passed trigger paths
225  // increment that bin in the trigger plot
226  for (unsigned int i=0; i<thePlotTheseTriggersToo_.size(); i++) {
227  passed_HLT = false;
228  for (unsigned int ti=0; (ti<trigNames.size()) && !passed_HLT; ++ti) {
229  size_t pos = trigNames.triggerName(ti).find(thePlotTheseTriggersToo_[i]);
230  if (pos==0) passed_HLT = HLTresults->accept(ti);
231  }
232  if (passed_HLT) h_triggers_passed->Fill(i);
233  }
234 
235 
236  // grab photons
237  Handle<PhotonCollection> photonCollection;
238  iEvent.getByLabel(thePhotonCollectionLabel_, photonCollection);
239 
240  // If photon collection is empty, exit
241  if (!photonCollection.isValid()) return;
242 
243 
244  // Quit if the event did not pass the HLT path we care about
245  passed_HLT = false;
246  {
247  //bool found=false;
248  for (unsigned int ti=0; ti<trigNames.size(); ++ti) {
249  size_t pos = trigNames.triggerName(ti).find(theTriggerPathToPass_);
250  if (pos==0) {
251  passed_HLT = HLTresults->accept(ti);
252  //found=true;
253  break;
254  }
255  }
256 
257  // Assumption: reco photons are ordered by Et
258  for (PhotonCollection::const_iterator recoPhoton = photonCollection->begin(); recoPhoton!=photonCollection->end(); recoPhoton++){
259  // stop looping over photons once we get to too low Et
260  if ( recoPhoton->et() < theMinPhotonEt_ ) break;
261 
262  h_photon_et_beforeCuts->Fill(recoPhoton->et());
263  break; // leading photon only
264  }
265 
266  if (!passed_HLT) {
267  return;
268  }
269  }
270 
272 
273  //std::cout << "\tpassed main trigger (" << theTriggerPathToPass_ << ")" << std::endl;
274 
276  // Does event have valid vertex?
277  // Get the primary event vertex
278  Handle<VertexCollection> vertexHandle;
279  iEvent.getByLabel(theVertexCollectionLabel_, vertexHandle);
280  VertexCollection vertexCollection = *(vertexHandle.product());
281  //double vtx_ndof = -1.0;
282  //double vtx_z = 0.0;
283  //bool vtx_isFake = true;
284  //if (vertexCollection.size()>0) {
285  // vtx_ndof = vertexCollection.begin()->ndof();
286  // vtx_z = vertexCollection.begin()->z();
287  // vtx_isFake = false;
288  //}
289  //if (vtx_isFake || fabs(vtx_z)>15 || vtx_ndof<4) return;
290 
291  int nvvertex = 0;
292  for (unsigned int i=0; i<vertexCollection.size(); ++i) {
293  if (vertexCollection[i].isValid()) nvvertex++;
294  }
295  if (nvvertex==0) return;
296 
298 
299  //std::cout << "\tpassed vertex selection" << std::endl;
300 
301 
303  // Did the event pass certain L1 Technical Trigger bits?
304  // It's probably beam halo
305  // TODO: ADD code
307 
308 
309  // For finding spikes
310  Handle<EcalRecHitCollection> EBReducedRecHits;
311  iEvent.getByLabel(theBarrelRecHitTag, EBReducedRecHits);
312  Handle<EcalRecHitCollection> EEReducedRecHits;
313  iEvent.getByLabel(theEndcapRecHitTag, EEReducedRecHits);
314  EcalClusterLazyTools lazyTool(iEvent, iSetup, theBarrelRecHitTag, theEndcapRecHitTag);
315 
316 
317  // Find the highest et "decent" photon
318  float photon_et = -9.0;
319  float photon_eta = -9.0;
320  float photon_phi = -9.0;
321  bool photon_passPhotonID = false;
322  bool found_lead_pho = false;
323  int photon_count_bar = 0;
324  int photon_count_end = 0;
325  // Assumption: reco photons are ordered by Et
326  for (PhotonCollection::const_iterator recoPhoton = photonCollection->begin(); recoPhoton!=photonCollection->end(); recoPhoton++){
327 
328  // stop looping over photons once we get to too low Et
329  if ( recoPhoton->et() < theMinPhotonEt_ ) break;
330 
331  /*
332  // Ignore ECAL Spikes
333  const reco::CaloClusterPtr seed = recoPhoton->superCluster()->seed();
334  DetId id = lazyTool.getMaximum(*seed).first; // Cluster shape variables
335  // float time = -999., outOfTimeChi2 = -999., chi2 = -999.; // UNUSED
336  int flags=-1, severity = -1;
337  const EcalRecHitCollection & rechits = ( recoPhoton->isEB() ? *EBReducedRecHits : *EEReducedRecHits);
338  EcalRecHitCollection::const_iterator it = rechits.find( id );
339  if( it != rechits.end() ) {
340  // time = it->time(); // UNUSED
341  // outOfTimeChi2 = it->outOfTimeChi2(); // UNUSED
342  // chi2 = it->chi2(); // UNUSED
343  flags = it->recoFlag();
344 
345  edm::ESHandle<EcalSeverityLevelAlgo> sevlv;
346  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
347  severity = sevlv->severityLevel( id, rechits);
348  }
349  bool isNotSpike = ((recoPhoton->isEB() && (severity!=3 && severity!=4 ) && (flags != 2) ) || recoPhoton->isEE());
350  if (!isNotSpike) continue; // move on to next photon
351  // END of determining ECAL Spikes
352  */
353 
354  bool pho_current_passPhotonID = false;
355  bool pho_current_isEB = recoPhoton->isEB();
356  bool pho_current_isEE = recoPhoton->isEE();
357 
358  if ( pho_current_isEB && (recoPhoton->sigmaIetaIeta() < 0.01 || recoPhoton->hadronicOverEm() < 0.05) ) {
359  // Photon object in barrel passes photon ID
360  pho_current_passPhotonID = true;
361  photon_count_bar++;
362  } else if ( pho_current_isEE && (recoPhoton->hadronicOverEm() < 0.05) ) {
363  // Photon object in endcap passes photon ID
364  pho_current_passPhotonID = true;
365  photon_count_end++;
366  }
367 
368  if (!found_lead_pho) {
369  found_lead_pho = true;
370  photon_passPhotonID = pho_current_passPhotonID;
371  photon_et = recoPhoton->et();
372  photon_eta = recoPhoton->eta();
373  photon_phi = recoPhoton->phi();
374  }
375  }
376 
377  // If user requires a photon to be found, but none is, return.
378  // theRequirePhotonFound should pretty much always be set to 'True'
379  // except when running on qcd monte carlo just to see the jets.
380  if ( theRequirePhotonFound_ && (!photon_passPhotonID || photon_et<theMinPhotonEt_) ) return;
381 
382 
384  // Find the highest et jet
385  Handle<View<Jet> > jetCollection;
386  iEvent.getByLabel (theJetCollectionLabel_,jetCollection);
387  if (!jetCollection.isValid()) return;
388 
389  float jet_pt = -8.0;
390  float jet_eta = -8.0;
391  float jet_phi = -8.0;
392  int jet_count = 0;
393  float jet2_pt = -9.0;
394  float jet2_eta = -9.0;
395  float jet2_phi = -9.0;
396  // Assumption: jets are ordered by Et
397  for (unsigned int i_jet = 0; i_jet < jetCollection->size(); i_jet++) {
398  const Jet* jet = & jetCollection->at(i_jet);
399 
400  float jet_current_pt = jet->pt();
401 
402  // don't care about jets that overlap with the lead photon
403  if ( deltaR(jet->eta(), jet->phi(), photon_eta, photon_phi) < 0.5 ) continue;
404  // stop looping over jets once we get to too low Et
405  if (jet_current_pt < theMinJetPt_) break;
406 
407  jet_count++;
408  if (jet_current_pt > jet_pt) {
409  jet2_pt = jet_pt; // 2nd highest jet get's et from current highest
410  jet2_eta = jet_eta;
411  jet2_phi = jet_phi;
412  jet_pt = jet_current_pt; // current highest jet gets et from the new highest
413  jet_eta = jet->eta();
414  jet_phi = jet->phi();
415  } else if (jet_current_pt > jet2_pt) {
416  jet2_pt = jet_current_pt;
417  jet2_eta = jet->eta();
418  jet2_phi = jet->phi();
419  }
420  }
422 
423 
425  // Fill histograms if a jet found
426  // NOTE: if a photon was required to be found, but wasn't
427  // we wouldn't have made it to this point in the code
428  if ( jet_pt > 0.0 ) {
429 
430  // Photon Plots
431  h_photon_et ->Fill( photon_et );
432  h_photon_eta ->Fill( photon_eta );
433  h_photon_count_bar->Fill( photon_count_bar );
434  h_photon_count_end->Fill( photon_count_end );
435 
436  // Photon Et hists for different orientations to the jet
437  if ( fabs(photon_eta)<1.45 && photon_passPhotonID ) { // Lead photon is in barrel
438  if (fabs(jet_eta)<1.45){ // jet is in barrel
439  if (photon_eta*jet_eta>0) {
440  h_photon_et_jetcs->Fill(photon_et);
441  } else {
442  h_photon_et_jetco->Fill(photon_et);
443  }
444  } else if (jet_eta>1.55 && jet_eta<2.5) { // jet is in endcap
445  if (photon_eta*jet_eta>0) {
446  h_photon_et_jetfs->Fill(photon_et);
447  } else {
448  h_photon_et_jetfo->Fill(photon_et);
449  }
450  }
451  } // END of Lead Photon is in Barrel
452 
453  // Jet Plots
454  h_jet_pt ->Fill( jet_pt );
455  h_jet_eta ->Fill( jet_eta );
456  h_jet_count ->Fill( jet_count );
457  h_deltaPhi_photon_jet ->Fill( abs(deltaPhi(photon_phi, jet_phi)) );
458  if ( abs(deltaPhi(photon_phi,jet_phi))>2.8 ) h_deltaEt_photon_jet->Fill( (photon_et-jet_pt)/photon_et );
459 
460  // 2nd Highest Jet Plots
461  if ( jet2_pt > 0.0 ) {
462  h_jet2_pt ->Fill( jet2_pt );
463  h_jet2_eta ->Fill( jet2_eta );
464  h_jet2_ptOverPhotonEt ->Fill( jet2_pt/photon_et );
465  h_deltaPhi_photon_jet2->Fill( abs(deltaPhi(photon_phi, jet2_phi)) );
466  h_deltaPhi_jet_jet2 ->Fill( abs(deltaPhi( jet_phi, jet2_phi)) );
467  h_deltaR_jet_jet2 ->Fill( deltaR( jet_eta, jet_phi, jet2_eta, jet2_phi) );
468  h_deltaR_photon_jet2 ->Fill( deltaR(photon_eta, photon_phi, jet2_eta, jet2_phi) );
469  }
470  }
471  // End of Filling histograms
473 }
474 
475 
477 
479  if (num_events_in_run>0) {
480  h_triggers_passed->getTH1F()->Scale(1.0/num_events_in_run);
481  }
482  h_photon_et_ratio_co_cs->getTH1F()->Divide( h_photon_et_jetco->getTH1F(), h_photon_et_jetcs->getTH1F() );
483  h_photon_et_ratio_fo_fs->getTH1F()->Divide( h_photon_et_jetfo->getTH1F(), h_photon_et_jetfs->getTH1F() );
484  h_photon_et_ratio_cs_fs->getTH1F()->Divide( h_photon_et_jetcs->getTH1F(), h_photon_et_jetfs->getTH1F() );
485  h_photon_et_ratio_co_fs->getTH1F()->Divide( h_photon_et_jetco->getTH1F(), h_photon_et_jetfs->getTH1F() );
486  h_photon_et_ratio_cs_fo->getTH1F()->Divide( h_photon_et_jetcs->getTH1F(), h_photon_et_jetfo->getTH1F() );
487  h_photon_et_ratio_co_fo->getTH1F()->Divide( h_photon_et_jetco->getTH1F(), h_photon_et_jetfo->getTH1F() );
488 }
489 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:199
Base class for all types of Jets.
Definition: Jet.h:21
void beginJob()
Inizialize parameters for histo binning.
#define abs(x)
Definition: mlp_lapack.h:159
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
Strings::size_type size() const
Definition: TriggerNames.cc:39
tuple vertexCollection
virtual double eta() const
momentum pseudorapidity
void endRun(const edm::Run &, const edm::EventSetup &)
QcdPhotonsDQM(const edm::ParameterSet &)
Constructor.
int iEvent
Definition: GenABIO.cc:243
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
#define LogTrace(id)
void endJob(void)
Save the histos.
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:75
virtual double pt() const
transverse momentum
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
void beginRun(const edm::Run &, const edm::EventSetup &)
T const * product() const
Definition: Handle.h:74
virtual ~QcdPhotonsDQM()
Destructor.
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.
virtual double phi() const
momentum azimuthal angle
Definition: Run.h:33