ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/src/HistosMET.cc
Revision: 1.2
Committed: Thu May 28 15:12:45 2009 UTC (15 years, 11 months ago) by amagnan
Content type: text/plain
Branch: MAIN
CVS Tags: v00-03-00, v00-02-01, v00-02-00, v00-01-00
Changes since 1.1: +1 -1 lines
Log Message:
add JetFlavour class + selectors

File Contents

# User Rev Content
1 amagnan 1.1 #include <iostream>
2     #include <fstream>
3    
4     #include "FWCore/MessageLogger/interface/MessageLogger.h"
5    
6     #include "DataFormats/METReco/interface/GenMET.h"
7    
8     #include "UserCode/HbbAnalysis/interface/HistosMET.hh"
9    
10     namespace HbbAnalysis {//namespace
11    
12     void HistosMET::Initialise(TFileDirectory & aDir, std::string aName, bool aDoGenMatched){
13    
14     p_MET = aDir.make<TH1F>("p_MET",";MET (GeV.c^{-1});N_{entries}",200,0,200);
15     p_MEx = aDir.make<TH1F>("p_MEx",";MEX (GeV.c^{-1});N_{entries}",200,-100,100);
16     p_MEy = aDir.make<TH1F>("p_MEy",";MEY (GeV.c^{-1});N_{entries}",200,-100,100);
17     p_SumET = aDir.make<TH1F>("p_SumET",";SumET (GeV.c^{-1});N_{entries}",500,0,500);
18     p_phi = aDir.make<TH1F>("p_phi",";#phi;N_{entries}",64,-3.2,3.2);
19     p_mEtSig = aDir.make<TH1F>("p_mEtSig",";MET/#sqrt{SumET};N_{entries}",100,0,10);
20    
21     p_genMET_MET = aDir.make<TH1F>("p_genMET_MET",";MET (GeV.c^{-1});N_{entries}",200,0,200);
22     p_genMET_MEx = aDir.make<TH1F>("p_genMET_MEx",";MEX (GeV.c^{-1});N_{entries}",200,-100,100);
23     p_genMET_MEy = aDir.make<TH1F>("p_genMET_MEy",";MEY (GeV.c^{-1});N_{entries}",200,-100,100);
24     p_genMET_SumET = aDir.make<TH1F>("p_genMET_SumET",";SumET (GeV.c^{-1});N_{entries}",500,0,500);
25     p_genMET_phi = aDir.make<TH1F>("p_genMET_phi",";#phi;N_{entries}",64,-3.2,3.2);
26     p_genMET_mEtSig = aDir.make<TH1F>("p_genMET_mEtSig",";MET/#sqrt{SumET};N_{entries}",100,0,10);
27    
28     p_RecoOverGen_MET = aDir.make<TH1F>("p_RecoOverGen_MET",";MET^{reco}/MET^{gen};N_{entries}",500,0,100);
29     p_RecoOverGen_MEx = aDir.make<TH1F>("p_RecoOverGen_MEx",";MEx^{reco}/MEx^{gen};N_{entries}",500,-50,50);
30     p_RecoOverGen_MEy = aDir.make<TH1F>("p_RecoOverGen_MEy",";MEy^{reco}/MEy^{gen};N_{entries}",500,-50,50);
31     p_RecoOverGen_SumET = aDir.make<TH1F>("p_RecoOverGen_SumET",";SumET^{reco}/SumET^{gen};N_{entries}",500,0,10);
32    
33     }
34    
35 amagnan 1.2 void HistosMET::FillEventHistograms(const edm::Handle<std::vector<pat::MET> > & aCol)
36 amagnan 1.1 {
37     assert(aCol->size() == 1);
38     const pat::MET & lMet = *(aCol->begin());
39    
40     p_MET->Fill(lMet.pt());
41     p_MEx->Fill(lMet.px());
42     p_MEy->Fill(lMet.py());
43     p_SumET->Fill(lMet.sumEt());
44     p_phi->Fill(lMet.phi());
45     p_mEtSig->Fill(lMet.mEtSig());
46    
47     const reco::GenMET *lGenMET = lMet.genMET();
48    
49     if (lGenMET){
50     p_genMET_MET->Fill(lGenMET->pt());
51     p_genMET_MEx->Fill(lGenMET->px());
52     p_genMET_MEy->Fill(lGenMET->py());
53     p_genMET_SumET->Fill(lGenMET->sumEt());
54     p_genMET_phi->Fill(lGenMET->phi());
55     p_genMET_mEtSig->Fill(lGenMET->mEtSig());
56    
57     if (lGenMET->pt()) p_RecoOverGen_MET->Fill(lMet.pt()/lGenMET->pt());
58     if (lGenMET->px()) p_RecoOverGen_MEx->Fill(lMet.px()/lGenMET->px());
59     if (lGenMET->py()) p_RecoOverGen_MEy->Fill(lMet.py()/lGenMET->py());
60     if (lGenMET->sumEt()) p_RecoOverGen_SumET->Fill(lMet.sumEt()/lGenMET->sumEt());
61     }
62    
63    
64     }
65    
66     }//namespace
67    
68