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