00001 // -*- C++ -*- 00002 // 00003 // Package: L25TauAnalyzer 00004 // Class: L25TauAnalyzer 00005 // 00013 // 00014 // Original Author: Eduardo Luiggi 00015 // Created: Fri Apr 4 16:37:44 CDT 2008 00016 // $Id: L25TauAnalyzer.h,v 1.10 2011/03/01 22:54:26 eluiggi Exp $ 00017 // 00018 // 00019 00020 00021 // system include files 00022 #include <memory> 00023 00024 // user include files 00025 #include "FWCore/Framework/interface/Frameworkfwd.h" 00026 #include "FWCore/Framework/interface/EDAnalyzer.h" 00027 #include "FWCore/Framework/interface/Event.h" 00028 #include "FWCore/Framework/interface/MakerMacros.h" 00029 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00030 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00031 #include "FWCore/ServiceRegistry/interface/Service.h" 00032 #include "DataFormats/Common/interface/Ref.h" 00033 #include "DataFormats/JetReco/interface/CaloJet.h" 00034 #include "DataFormats/JetReco/interface/JetTracksAssociation.h" 00035 #include "DataFormats/TauReco/interface/L2TauInfoAssociation.h" 00036 #include "DataFormats/TrackReco/interface/Track.h" 00037 #include "DataFormats/BTauReco/interface/IsolatedTauTagInfo.h" 00038 #include "DataFormats/Math/interface/LorentzVector.h" 00039 #include "DataFormats/Math/interface/Vector3D.h" 00040 #include "DataFormats/JetReco/interface/GenJet.h" 00041 #include "HepMC/GenParticle.h" 00042 #include "DataFormats/TauReco/interface/PFTau.h" 00043 #include "DataFormats/TauReco/interface/PFTauDiscriminator.h" 00044 #include "DataFormats/Math/interface/Point3D.h" 00045 #include "DataFormats/VertexReco/interface/Vertex.h" 00046 #include "DataFormats/VertexReco/interface/VertexFwd.h" 00047 #include "TLorentzVector.h" 00048 #include <vector> 00049 #include <string> 00050 #include <TTree.h> 00051 #include <TFile.h> 00052 #include "TH1.h" 00053 00054 00055 class L25TauAnalyzer : public edm::EDAnalyzer { 00056 public: 00057 explicit L25TauAnalyzer(const edm::ParameterSet&); 00058 ~L25TauAnalyzer(); 00059 00060 private: 00061 00062 virtual void beginJob(); 00063 virtual void analyze(const edm::Event&, const edm::EventSetup&); 00064 virtual void endJob(); 00065 00066 reco::PFTau match(const reco::Jet&, const reco::PFTauCollection&); 00067 reco::CaloJet matchedToPFTau(const reco::PFTau&, const reco::L2TauInfoAssociation&); 00068 void printInfo(const reco::PFTau& thePFTau, const reco::IsolatedTauTagInfo& theTauTagInfo); 00069 void clearVectors(); 00070 void initializeVectors(); 00071 edm::InputTag _l25JetSource; 00072 edm::InputTag _l2TauInfoAssoc; 00073 edm::InputTag _pfTauSource; 00074 edm::InputTag _pVtxSource; 00075 edm::InputTag _pfTauIsoSource; 00076 edm::InputTag _pfTauMuonDiscSource; 00077 math::XYZPoint theVertexPosition; 00078 00079 bool signal_; 00080 float _minTrackPt; 00081 float _signalCone; 00082 float _isolationCone; 00083 float _l2l25MatchingCone; 00084 float _l25JetLeadTkMacthingCone; 00085 float _l25Dz; 00086 float _l25LeadTkPtMin; 00087 int _nTrkIso; 00088 00089 TTree *l25tree; 00090 00091 int numPixTrkInJet; 00092 int numQPixTrkInJet; 00093 int numQPixTrkInSignalCone; 00094 int numQPixTrkInAnnulus; 00095 int myNtrkIso; 00096 00097 float l25JetEt; 00098 float l25JetEta; 00099 float l25JetPhi; 00100 00101 std::vector<float> *l25TrkPt; 00102 std::vector<float> *l25TrkEta; 00103 std::vector<float> *l25TrkPhi; 00104 std::vector<float> *l25TrkDz; 00105 std::vector<float> *l25TrkDxy; 00106 std::vector<float> *l25TrkChi2; 00107 std::vector<float> *l25TrkChi2NdF; 00108 std::vector<float> *l25TrkNRecHits; 00109 std::vector<float> *l25TrkNValidPixelHits; 00110 00111 std::vector<float> *l25SignalTrkPt; 00112 std::vector<float> *l25SignalTrkChi2NdF; 00113 std::vector<float> *l25SignalTrkChi2; 00114 std::vector<float> *l25SignalTrkDxy; 00115 std::vector<float> *l25SignalTrkDz; 00116 std::vector<float> *l25SignalTrkEta; 00117 std::vector<float> *l25SignalTrkPhi; 00118 std::vector<int> *l25SignalTrkNValidHits; 00119 std::vector<int> *l25SignalTrkNRecHits; 00120 std::vector<int> *l25SignalTrkNValidPixelHits; 00121 std::vector<int> *l25SignalTrkNLostHits; 00122 00123 std::vector<float> *l25IsoTrkPt; 00124 std::vector<float> *l25IsoTrkChi2NdF; 00125 std::vector<float> *l25IsoTrkChi2; 00126 std::vector<float> *l25IsoTrkDxy; 00127 std::vector<float> *l25IsoTrkDz; 00128 std::vector<float> *l25IsoTrkEta; 00129 std::vector<float> *l25IsoTrkPhi; 00130 std::vector<int> *l25IsoTrkNValidHits; 00131 std::vector<int> *l25IsoTrkNRecHits; 00132 std::vector<int> *l25IsoTrkNValidPixelHits; 00133 std::vector<int> *l25IsoTrkNLostHits; 00134 00135 bool hasLeadTrk; 00136 float leadSignalTrackPt; 00137 float leadTrkJetDeltaR; 00138 float pftauL25DeltaR; 00139 00140 bool pfTauHasLeadTrk; 00141 bool pfTauInBounds; 00142 float pfTauIsoDisc; 00143 float pfTauMuonDisc; 00144 float pfTauElecDisc; 00145 float pfTauEt; 00146 float pfTauPt; 00147 float pfTauEta; 00148 float pfTauPhi; 00149 float pfTauLTPt; 00150 int pfTauNProngs; 00151 float pfTauTrkIso; 00152 float pfTauGammaIso; 00153 int pfTauNTrkIso; 00154 float pfTauIsoTrkPt; 00155 float leadTrkPtRes; 00156 float leadTrkDeltaR; 00157 float leadIsoTrkPtRes; 00158 float leadIsoTrkDeltaR; 00159 float pftauSignalTrkDeltaR; 00160 float pftauIsoTrkDeltaR; 00161 00162 float l2JetEt; 00163 float l2JetEta; 00164 float l2JetPhi; 00165 00166 bool l25MatchedToPFTau; 00167 bool L2MatchedToPFtau; 00168 bool L25MatchedToL2; 00169 00170 bool l25Disc_LeadTkDir; 00171 bool l25Disc_JetDir; 00172 bool l25Disc_Trk5_IsoPtMin2_NTrk0; 00173 };