00001
00002
00003
00004
00005
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef DIJETRATIO_HH
00023 #define DIJETRATIO_HH
00024
00025 #include <memory>
00026 #include <string>
00027 #include <iostream>
00028 #include <map>
00029 #include <algorithm>
00030
00031
00032 #include "FWCore/Framework/interface/Frameworkfwd.h"
00033 #include "FWCore/Framework/interface/EDAnalyzer.h"
00034 #include "FWCore/Framework/interface/Event.h"
00035 #include "FWCore/Framework/interface/MakerMacros.h"
00036 #include "FWCore/Framework/interface/Selector.h"
00037
00038 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00039 #include "DataFormats/Common/interface/Ref.h"
00040 #include "DataFormats/JetReco/interface/Jet.h"
00041 #include "DataFormats/TrackReco/interface/Track.h"
00042
00043 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
00044 #include "DataFormats/JetReco/interface/PFJetCollection.h"
00045 #include "DataFormats/JetReco/interface/GenJetCollection.h"
00046 #include "DataFormats/JetReco/interface/CaloJet.h"
00047 #include "DataFormats/JetReco/interface/PFJet.h"
00048 #include "DataFormats/JetReco/interface/GenJet.h"
00049 #include "CLHEP/Vector/LorentzVector.h"
00050
00051 #include "TFile.h"
00052 #include "TH1.h"
00053 #include "TH2.h"
00054
00055 const int histoSize = 5;
00056
00057
00058 inline void hInit(TH1F* hJet[], const char* name){
00059 int const binSize = 35;
00060 float massBin[binSize+1] = { 100, 113, 132, 153, 176, 201,
00061 229, 259, 292, 327, 366, 400,
00062 453, 501, 553, 609, 669, 733,
00063 802, 875, 954, 1038, 1127, 1222,
00064 1323, 1431, 1546, 1667, 1796, 1934,
00065 2079, 2233, 2396, 2569, 2752,3000};
00066
00067
00068
00069 std::string tit = std::string(name) + "_Eta_innerEtaCut_outerEtaCut";
00070 hJet[0] = new TH1F(tit.c_str(), "DiJet Mass", binSize, massBin);
00071
00072
00073
00074 tit = std::string(name) + "_Eta_0_innerEtaCut";
00075 hJet[1] = new TH1F(tit.c_str(), "DiJet Mass", binSize, massBin);
00076
00077 tit = std::string(name) + "_LeadJetEta";
00078 hJet[2] = new TH1F(tit.c_str(), "1^{st} Leading Jet #eta", 120, -6., 6.);
00079 tit = std::string(name) + "_SecondJetEta";
00080 hJet[3] = new TH1F(tit.c_str(), "2^{nd} Leading Jet #eta", 120, -6., 6.);
00081 tit = std::string(name) + "_numEvents";
00082 hJet[4] = new TH1F(tit.c_str(), "No. of events", 10, 0.,10.);
00083
00084 return ;
00085 }
00086
00087
00088
00089 template <class R>
00090 void histoFill(TH1F* jetHisto[], edm::Handle<R> jetsRec, double eta1, double eta2)
00091 {
00092
00093 jetHisto[4]->Fill(1.);
00094
00095 if ((*jetsRec).size() >=2){
00096 double px1 = (*jetsRec)[0].px();
00097 double py1 = (*jetsRec)[0].py();
00098 double pz1 = (*jetsRec)[0].pz();
00099 double e1 = (*jetsRec)[0].energy();
00100 double jetEta1 = (*jetsRec)[0].eta();
00101 jetHisto[2]->Fill(jetEta1);
00102
00103 double px2 = (*jetsRec)[1].px();
00104 double py2 = (*jetsRec)[1].py();
00105 double pz2 = (*jetsRec)[1].pz();
00106 double e2 = (*jetsRec)[1].energy();
00107 double jetEta2 = (*jetsRec)[1].eta();
00108 jetHisto[3]->Fill(jetEta2);
00109
00110 CLHEP::HepLorentzVector v1(px1,py1,pz1,e1);
00111 CLHEP::HepLorentzVector v2(px2,py2,pz2,e2);
00112 CLHEP::HepLorentzVector v(0.,0.,0.,0.);
00113 v = v1 + v2;
00114 float mass = v.m();
00115
00116 if ( fabs(jetEta1) > 0.0 && fabs(jetEta1) < eta1)
00117 if ( fabs(jetEta2) > 0.0 && fabs(jetEta2) < eta1)
00118 jetHisto[0]->Fill(mass);
00119
00120 if ( fabs(jetEta1) > eta1 && fabs(jetEta1) < eta2)
00121 if ( fabs(jetEta2) > eta1 && fabs(jetEta2) < eta2)
00122 jetHisto[1]->Fill(mass);
00123
00124 }
00125 }
00126
00127
00128
00129
00130
00131 template<class Jet>
00132 class DijetRatio : public edm::EDAnalyzer {
00133 public:
00134 explicit DijetRatio(const edm::ParameterSet&);
00135 ~DijetRatio();
00136
00137
00138 typedef std::vector<Jet> JetCollection;
00139 virtual void beginJob() ;
00140 virtual void analyze(const edm::Event&, const edm::EventSetup&);
00141 virtual void endJob() ;
00142
00143
00144
00145 std::string fOutputFileName ;
00146
00147
00148 std::string m_Mid5CorRecJetsSrc;
00149 std::string m_Mid5CaloJetsSrc;
00150
00151
00152 double m_eta3;
00153 double m_eta4;
00154
00155
00156 static const int hisotNumber = 10;
00157
00158 TH1F* hCalo[hisotNumber];
00159 TH1F* hCor[hisotNumber];
00160
00161
00162 TFile* hOutputFile ;
00163 };
00164
00165 #endif
00166