CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/DQMOffline/JetMET/interface/PFJetAnalyzer.h

Go to the documentation of this file.
00001 #ifndef PFJetAnalyzer_H
00002 #define PFJetAnalyzer_H
00003 
00004 
00015 #include <memory>
00016 #include <fstream>
00017 #include "FWCore/Framework/interface/Frameworkfwd.h"
00018 #include "DQMOffline/JetMET/interface/PFJetAnalyzerBase.h"
00019 #include "FWCore/Framework/interface/Event.h"
00020 #include "FWCore/Framework/interface/MakerMacros.h"
00021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00022 #include "FWCore/ServiceRegistry/interface/Service.h"
00023 #include "DQMServices/Core/interface/DQMStore.h"
00024 #include "DQMServices/Core/interface/MonitorElement.h"
00025 //#include "DataFormats/JetReco/interface/CaloJetCollection.h"
00026 #include "DataFormats/JetReco/interface/PFJet.h"
00027 
00028 
00029 #include "GlobalVariables.h"
00030 
00031 
00032 class PFJetAnalyzer : public PFJetAnalyzerBase {
00033  public:
00034 
00036   PFJetAnalyzer(const edm::ParameterSet&);
00037   
00039   virtual ~PFJetAnalyzer();
00040 
00042   void beginJob(DQMStore * dbe);
00043 
00045   void endJob();
00046 
00048   void analyze(const edm::Event&, const edm::EventSetup&, const reco::PFJetCollection& pfJets, const int numPV);
00049   //
00050   void setSource(std::string source) {
00051     _source = source;
00052   }
00053   //
00054   void setLeadJetFlag(int flag) {
00055     _leadJetFlag = flag;
00056   }
00057   int getLeadJetFlag() {
00058     return  _leadJetFlag;
00059   }
00060   void setJetLoPass(int pass) {
00061     _JetLoPass = pass;
00062   }
00063 
00064   void setJetHiPass(int pass) {
00065     _JetHiPass = pass;
00066   }
00067 
00068 
00069  private:
00070   // ----------member data ---------------------------
00071   int   _JetLoPass;
00072   int   _JetHiPass;
00073   int   _leadJetFlag;
00074   double _ptThreshold;
00075 
00076   double _asymmetryThirdJetCut;
00077   double _balanceThirdJetCut;
00078 
00079   int makedijetselection;
00080 
00081   //histo binning parameters
00082   int    etaBin;
00083   double etaMin;
00084   double etaMax;
00085 
00086   int    phiBin;
00087   double phiMin;
00088   double phiMax;
00089 
00090   int    ptBin;
00091   double ptMin;
00092   double ptMax;
00093 
00094   int    eBin;
00095   double eMin;
00096   double eMax;
00097 
00098   int    pBin;
00099   double pMin;
00100   double pMax;
00101 
00102   int fillpfJIDPassFrac;
00103 
00104   double _ThisCHFMin;
00105   double _ThisNHFMax;
00106   double _ThisCEFMax;
00107   double _ThisNEFMax;
00108   double _LooseCHFMin;
00109   double _LooseNHFMax;
00110   double _LooseCEFMax;
00111   double _LooseNEFMax;
00112   double _TightCHFMin;
00113   double _TightNHFMax;
00114   double _TightCEFMax;
00115   double _TightNEFMax;
00116 
00117   //the histos
00118   MonitorElement* jetME;
00119 
00120   edm::ParameterSet parameters;
00121   // Switch for verbosity
00122   std::string metname;
00123   // Calo Jet Label
00124   edm::InputTag thePFJetCollectionLabel;
00125   std::string _source;
00126 
00127 /*   // Generic Jet Parameters */
00128 /*   MonitorElement* mEta; */
00129 /*   MonitorElement* mPhi; */
00130 /*   MonitorElement* mE; */
00131 /*   MonitorElement* mP; */
00132 /*   MonitorElement* mPt; */
00133 /*   MonitorElement* mMass; */
00134 /*   MonitorElement* mConstituents; */
00135 
00136 /*   // Leading Jet Parameters */
00137 /*   MonitorElement* mEtaFirst; */
00138 /*   MonitorElement* mPhiFirst; */
00139 /*   MonitorElement* mEFirst; */
00140 /*   MonitorElement* mPtFirst; */
00141   MonitorElement* mPt;
00142   MonitorElement* mPt_1;
00143   MonitorElement* mPt_2;
00144   MonitorElement* mPt_3;
00145   MonitorElement* mEta;
00146   MonitorElement* mPhi;
00147   MonitorElement* mConstituents;
00148   MonitorElement* mHFrac;
00149   MonitorElement* mEFrac;
00150   MonitorElement* mPhiVSEta;
00151 
00152   MonitorElement* mPt_Barrel;
00153   MonitorElement* mPhi_Barrel;
00154 
00155   MonitorElement* mCHFrac_lowPt_Barrel;
00156   MonitorElement* mNHFrac_lowPt_Barrel;
00157   MonitorElement* mPhFrac_lowPt_Barrel;
00158   MonitorElement* mElFrac_lowPt_Barrel;
00159   MonitorElement* mMuFrac_lowPt_Barrel;
00160   MonitorElement* mCHFrac_mediumPt_Barrel;
00161   MonitorElement* mNHFrac_mediumPt_Barrel;
00162   MonitorElement* mPhFrac_mediumPt_Barrel;
00163   MonitorElement* mElFrac_mediumPt_Barrel;
00164   MonitorElement* mMuFrac_mediumPt_Barrel;
00165   MonitorElement* mCHFrac_highPt_Barrel;
00166   MonitorElement* mNHFrac_highPt_Barrel;
00167   MonitorElement* mPhFrac_highPt_Barrel;
00168   MonitorElement* mElFrac_highPt_Barrel;
00169   MonitorElement* mMuFrac_highPt_Barrel;
00170   MonitorElement* mCHEn_lowPt_Barrel;
00171   MonitorElement* mNHEn_lowPt_Barrel;
00172   MonitorElement* mPhEn_lowPt_Barrel;
00173   MonitorElement* mElEn_lowPt_Barrel;
00174   MonitorElement* mMuEn_lowPt_Barrel;
00175   MonitorElement* mCHEn_mediumPt_Barrel;
00176   MonitorElement* mNHEn_mediumPt_Barrel;
00177   MonitorElement* mPhEn_mediumPt_Barrel;
00178   MonitorElement* mElEn_mediumPt_Barrel;
00179   MonitorElement* mMuEn_mediumPt_Barrel;
00180   MonitorElement* mCHEn_highPt_Barrel;
00181   MonitorElement* mNHEn_highPt_Barrel;
00182   MonitorElement* mPhEn_highPt_Barrel;
00183   MonitorElement* mElEn_highPt_Barrel;
00184   MonitorElement* mMuEn_highPt_Barrel;
00185   MonitorElement* mChMultiplicity_lowPt_Barrel;
00186   MonitorElement* mNeuMultiplicity_lowPt_Barrel;
00187   MonitorElement* mMuMultiplicity_lowPt_Barrel;
00188   MonitorElement* mChMultiplicity_mediumPt_Barrel;
00189   MonitorElement* mNeuMultiplicity_mediumPt_Barrel;
00190   MonitorElement* mMuMultiplicity_mediumPt_Barrel;
00191   MonitorElement* mChMultiplicity_highPt_Barrel;
00192   MonitorElement* mNeuMultiplicity_highPt_Barrel;
00193   MonitorElement* mMuMultiplicity_highPt_Barrel;
00194 
00195   MonitorElement*  mCHFracVSpT_Barrel;
00196   MonitorElement*  mNHFracVSpT_Barrel;
00197   MonitorElement*  mPhFracVSpT_Barrel;
00198   MonitorElement*  mElFracVSpT_Barrel;
00199   MonitorElement*  mMuFracVSpT_Barrel;
00200   MonitorElement*  mCHFracVSpT_EndCap;
00201   MonitorElement*  mNHFracVSpT_EndCap;
00202   MonitorElement*  mPhFracVSpT_EndCap;
00203   MonitorElement*  mElFracVSpT_EndCap;
00204   MonitorElement*  mMuFracVSpT_EndCap;
00205   MonitorElement*  mHFHFracVSpT_Forward;
00206   MonitorElement*  mHFEFracVSpT_Forward;
00207 
00208   MonitorElement*  mCHFracVSeta_lowPt;
00209   MonitorElement*  mNHFracVSeta_lowPt;
00210   MonitorElement*  mPhFracVSeta_lowPt;
00211   MonitorElement*  mElFracVSeta_lowPt;
00212   MonitorElement*  mMuFracVSeta_lowPt;
00213   MonitorElement*  mCHFracVSeta_mediumPt;
00214   MonitorElement*  mNHFracVSeta_mediumPt;
00215   MonitorElement*  mPhFracVSeta_mediumPt;
00216   MonitorElement*  mElFracVSeta_mediumPt;
00217   MonitorElement*  mMuFracVSeta_mediumPt;
00218   MonitorElement*  mCHFracVSeta_highPt;
00219   MonitorElement*  mNHFracVSeta_highPt;
00220   MonitorElement*  mPhFracVSeta_highPt;
00221   MonitorElement*  mElFracVSeta_highPt;
00222   MonitorElement*  mMuFracVSeta_highPt;
00223 
00224   MonitorElement* mCHFrac_lowPt_EndCap;
00225   MonitorElement* mNHFrac_lowPt_EndCap;
00226   MonitorElement* mPhFrac_lowPt_EndCap;
00227   MonitorElement* mElFrac_lowPt_EndCap;
00228   MonitorElement* mMuFrac_lowPt_EndCap;
00229   MonitorElement* mCHFrac_mediumPt_EndCap;
00230   MonitorElement* mNHFrac_mediumPt_EndCap;
00231   MonitorElement* mPhFrac_mediumPt_EndCap;
00232   MonitorElement* mElFrac_mediumPt_EndCap;
00233   MonitorElement* mMuFrac_mediumPt_EndCap;
00234   MonitorElement* mCHFrac_highPt_EndCap;
00235   MonitorElement* mNHFrac_highPt_EndCap;
00236   MonitorElement* mPhFrac_highPt_EndCap;
00237   MonitorElement* mElFrac_highPt_EndCap;
00238   MonitorElement* mMuFrac_highPt_EndCap;
00239 
00240   MonitorElement* mCHEn_lowPt_EndCap;
00241   MonitorElement* mNHEn_lowPt_EndCap;
00242   MonitorElement* mPhEn_lowPt_EndCap;
00243   MonitorElement* mElEn_lowPt_EndCap;
00244   MonitorElement* mMuEn_lowPt_EndCap;
00245   MonitorElement* mCHEn_mediumPt_EndCap;
00246   MonitorElement* mNHEn_mediumPt_EndCap;
00247   MonitorElement* mPhEn_mediumPt_EndCap;
00248   MonitorElement* mElEn_mediumPt_EndCap;
00249   MonitorElement* mMuEn_mediumPt_EndCap;
00250   MonitorElement* mCHEn_highPt_EndCap;
00251   MonitorElement* mNHEn_highPt_EndCap;
00252   MonitorElement* mPhEn_highPt_EndCap;
00253   MonitorElement* mElEn_highPt_EndCap;
00254   MonitorElement* mMuEn_highPt_EndCap;
00255 
00256   MonitorElement*   mChMultiplicity_lowPt_EndCap;
00257   MonitorElement*   mNeuMultiplicity_lowPt_EndCap;
00258   MonitorElement*   mMuMultiplicity_lowPt_EndCap;
00259   MonitorElement*   mChMultiplicity_mediumPt_EndCap;
00260   MonitorElement*   mNeuMultiplicity_mediumPt_EndCap;
00261   MonitorElement*   mMuMultiplicity_mediumPt_EndCap;
00262   MonitorElement*   mChMultiplicity_highPt_EndCap;
00263   MonitorElement*   mNeuMultiplicity_highPt_EndCap;
00264   MonitorElement*   mMuMultiplicity_highPt_EndCap;
00265 
00266 
00267   MonitorElement* mPt_EndCap;
00268   MonitorElement* mPhi_EndCap;
00269 
00270   MonitorElement* mPt_Forward;
00271   MonitorElement* mPhi_Forward;
00272 
00273   MonitorElement*mHFEFrac_lowPt_Forward;
00274   MonitorElement*mHFHFrac_lowPt_Forward;
00275   MonitorElement*mHFEFrac_mediumPt_Forward;
00276   MonitorElement*mHFHFrac_mediumPt_Forward;
00277   MonitorElement*mHFEFrac_highPt_Forward;
00278   MonitorElement*mHFHFrac_highPt_Forward;
00279   MonitorElement*mHFEEn_lowPt_Forward;
00280   MonitorElement*mHFHEn_lowPt_Forward;
00281   MonitorElement*mHFEEn_mediumPt_Forward;
00282   MonitorElement*mHFHEn_mediumPt_Forward;
00283   MonitorElement*mHFEEn_highPt_Forward;
00284   MonitorElement*mHFHEn_highPt_Forward;
00285   MonitorElement*   mChMultiplicity_lowPt_Forward;
00286   MonitorElement*   mNeuMultiplicity_lowPt_Forward;
00287   MonitorElement*   mMuMultiplicity_lowPt_Forward;
00288   MonitorElement*   mChMultiplicity_mediumPt_Forward;
00289   MonitorElement*   mNeuMultiplicity_mediumPt_Forward;
00290   MonitorElement*   mMuMultiplicity_mediumPt_Forward;
00291   MonitorElement*   mChMultiplicity_highPt_Forward;
00292   MonitorElement*   mNeuMultiplicity_highPt_Forward;
00293   MonitorElement*   mMuMultiplicity_highPt_Forward;
00294 
00295   //MonitorElement* mPt_Barrel_Lo;
00296   //MonitorElement* mPhi_Barrel_Lo;
00297   MonitorElement* mConstituents_Barrel;
00298   MonitorElement* mHFrac_Barrel;
00299   MonitorElement* mEFrac_Barrel;
00300   //MonitorElement* mPt_EndCap_Lo;
00301   //MonitorElement* mPhi_EndCap_Lo;
00302   MonitorElement* mConstituents_EndCap;
00303   MonitorElement* mHFrac_EndCap;
00304   MonitorElement* mEFrac_EndCap;
00305   //MonitorElement* mPt_Forward_Lo;
00306   //MonitorElement* mPhi_Forward_Lo;
00307   MonitorElement* mConstituents_Forward;
00308   MonitorElement* mHFrac_Forward;
00309   MonitorElement* mEFrac_Forward;
00310 
00311   MonitorElement* mPt_Barrel_Hi;
00312   MonitorElement* mPhi_Barrel_Hi;
00313   MonitorElement* mConstituents_Barrel_Hi;
00314   MonitorElement* mHFrac_Barrel_Hi;
00315   MonitorElement* mPt_EndCap_Hi;
00316   MonitorElement* mPhi_EndCap_Hi;
00317   MonitorElement* mConstituents_EndCap_Hi;
00318   MonitorElement* mHFrac_EndCap_Hi;
00319   MonitorElement* mPt_Forward_Hi;
00320   MonitorElement* mPhi_Forward_Hi;
00321   MonitorElement* mConstituents_Forward_Hi;
00322   MonitorElement* mHFrac_Forward_Hi;
00323   // ---
00324 
00325 
00326   //MonitorElement* mE_Barrel;
00327   //MonitorElement* mE_EndCap;
00328   //MonitorElement* mE_Forward;
00329 
00330   //MonitorElement* mE;
00331   //MonitorElement* mP;
00332   //MonitorElement* mMass;
00333   MonitorElement* mNJets;
00334   MonitorElement* mDPhi;
00335 
00336   // Leading Jet Parameters
00337   MonitorElement* mEtaFirst;
00338   MonitorElement* mPhiFirst;
00339   //MonitorElement* mEFirst;
00340   MonitorElement* mPtFirst;
00341 
00342   // Events passing the jet triggers
00343   //MonitorElement* mEta_Lo;
00344   MonitorElement* mPhi_Lo;
00345   MonitorElement* mPt_Lo;
00346 
00347   MonitorElement* mEta_Hi;
00348   MonitorElement* mPhi_Hi;
00349   MonitorElement* mPt_Hi;
00350   // PFlowJet specific
00351 
00352   MonitorElement* mChargedHadronEnergy;
00353   MonitorElement* mNeutralHadronEnergy;
00354   MonitorElement* mChargedEmEnergy;
00355   MonitorElement* mChargedMuEnergy;
00356   MonitorElement* mNeutralEmEnergy;
00357   MonitorElement* mChargedMultiplicity;
00358   MonitorElement* mNeutralMultiplicity;
00359   MonitorElement* mMuonMultiplicity;
00360 
00361   //new Plots with Res./ Eff. as function of neutral, charged &  em fraction
00362 
00363   MonitorElement* mNeutralFraction;
00364   MonitorElement* mNeutralFraction2;
00365 
00366   MonitorElement* mEEffNeutralFraction;
00367   MonitorElement* mEEffChargedFraction;
00368   MonitorElement* mEResNeutralFraction;
00369   MonitorElement* mEResChargedFraction;
00370   MonitorElement* nEEff;
00371 
00372   MonitorElement* mLooseJIDPassFractionVSeta;
00373   MonitorElement* mLooseJIDPassFractionVSpt;
00374   MonitorElement* mTightJIDPassFractionVSeta;
00375   MonitorElement* mTightJIDPassFractionVSpt;
00376 
00377   //dijet analysis quantities
00378   MonitorElement* mDijetBalance;
00379   MonitorElement* mDijetAsymmetry;
00380 
00381 
00382   // NPV profiles
00383   //----------------------------------------------------------------------------
00384   MonitorElement* mNJets_profile;
00385   MonitorElement* mPt_profile;
00386   MonitorElement* mEta_profile;
00387   MonitorElement* mPhi_profile;
00388   MonitorElement* mConstituents_profile;
00389   MonitorElement* mHFrac_profile;
00390   MonitorElement* mEFrac_profile;
00391 
00392   MonitorElement* mChargedHadronEnergy_profile;
00393   MonitorElement* mNeutralHadronEnergy_profile;
00394   MonitorElement* mChargedEmEnergy_profile;
00395   MonitorElement* mChargedMuEnergy_profile;
00396   MonitorElement* mNeutralEmEnergy_profile;
00397   MonitorElement* mChargedMultiplicity_profile;
00398   MonitorElement* mNeutralMultiplicity_profile;
00399   MonitorElement* mMuonMultiplicity_profile;
00400 };
00401 
00402 
00403 #endif