00001 #ifndef TkConvValidator_H 00002 #define TkConvValidator_H 00003 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" 00004 #include "Geometry/CaloGeometry/interface/CaloGeometry.h" 00005 #include "Geometry/CaloTopology/interface/CaloTopology.h" 00006 #include "FWCore/Framework/interface/EDAnalyzer.h" 00007 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00008 #include "FWCore/Framework/interface/Event.h" 00009 #include "FWCore/Framework/interface/EventSetup.h" 00010 #include "FWCore/Framework/interface/ESHandle.h" 00011 #include "RecoEgamma/EgammaMCTools/interface/PhotonMCTruthFinder.h" 00012 #include "SimTracker/TrackAssociation/interface/TrackAssociatorBase.h" 00013 #include "MagneticField/Engine/interface/MagneticField.h" 00014 #include "DataFormats/Common/interface/RefToBaseVector.h" 00015 #include "DataFormats/Common/interface/RefVector.h" 00016 #include "DataFormats/VertexReco/interface/VertexFwd.h" 00017 #include "DataFormats/VertexReco/interface/Vertex.h" 00018 // 00019 //DQM services 00020 #include "DQMServices/Core/interface/DQMStore.h" 00021 #include "FWCore/ServiceRegistry/interface/Service.h" 00022 #include "DQMServices/Core/interface/MonitorElement.h" 00023 00024 00025 // 00026 #include <map> 00027 #include <vector> 00028 00029 // forward declarations 00030 class TFile; 00031 class TH1F; 00032 class TH2F; 00033 class TProfile; 00034 class TTree; 00035 class SimVertex; 00036 class SimTrack; 00048 class TkConvValidator : public edm::EDAnalyzer 00049 { 00050 00051 public: 00052 00053 // 00054 explicit TkConvValidator( const edm::ParameterSet& ) ; 00055 virtual ~TkConvValidator(); 00056 00057 00058 virtual void analyze( const edm::Event&, const edm::EventSetup& ) ; 00059 virtual void beginJob(); 00060 virtual void beginRun( edm::Run const & r, edm::EventSetup const & theEventSetup) ; 00061 virtual void endRun (edm::Run& r, edm::EventSetup const & es); 00062 virtual void endJob() ; 00063 00064 private: 00065 // 00066 00067 float phiNormalization( float& a); 00068 float etaTransformation( float a, float b); 00069 math::XYZVector recalculateMomentumAtFittedVertex (const MagneticField& mf, const TrackerGeometry& trackerGeom, const edm::RefToBase<reco::Track>& tk,const reco::Vertex& vtx); 00070 00071 00072 std::string fName_; 00073 DQMStore *dbe_; 00074 edm::ESHandle<MagneticField> theMF_; 00075 00076 int verbosity_; 00077 int nEvt_; 00078 int nEntry_; 00079 int nSimConv_[2]; 00080 int nMatched_; 00081 int nRecConv_; 00082 int nRecConvAss_; 00083 int nRecConvAssWithEcal_; 00084 00085 int nInvalidPCA_; 00086 00087 edm::ParameterSet parameters_; 00088 edm::ESHandle<CaloGeometry> theCaloGeom_; 00089 edm::ESHandle<CaloTopology> theCaloTopo_; 00090 00091 std::string conversionCollectionProducer_; 00092 std::string conversionCollection_; 00093 std::string conversionTrackProducer_; 00094 00095 std::string dqmpath_; 00096 00097 edm::InputTag label_tp_; 00098 00099 PhotonMCTruthFinder* thePhotonMCTruthFinder_; 00100 TrackAssociatorBase * theTrackAssociator_; 00101 00102 bool isRunCentrally_; 00103 00104 double minPhoEtCut_; 00105 double trkIsolExtRadius_; 00106 double trkIsolInnRadius_; 00107 double trkPtLow_; 00108 double lip_; 00109 double ecalIsolRadius_; 00110 double bcEtLow_; 00111 double hcalIsolExtRadius_; 00112 double hcalIsolInnRadius_; 00113 double hcalHitEtLow_; 00114 int numOfTracksInCone_; 00115 double trkPtSumCut_; 00116 double ecalEtSumCut_; 00117 double hcalEtSumCut_; 00118 bool dCotCutOn_; 00119 double dCotCutValue_; 00120 double dCotHardCutValue_; 00121 bool generalTracksOnly_; 00122 bool arbitratedMerged_; 00123 bool arbitratedEcalSeeded_; 00124 bool ecalalgotracks_; 00125 bool highPurity_; 00126 double minProb_; 00127 uint maxHitsBeforeVtx_; 00128 double minLxy_; 00129 00130 00132 double mcPhi_; 00133 double mcEta_; 00134 double mcConvPt_; 00135 double mcConvR_; 00136 double mcConvZ_; 00137 double mcConvY_; 00138 double mcConvX_; 00139 double mcConvPhi_; 00140 double mcConvEta_; 00141 double mcJetEta_; 00142 double mcJetPhi_; 00143 00144 edm::RefVector<TrackingParticleCollection> theConvTP_; 00145 //std::vector<TrackingParticleRef> theConvTP_; 00146 00147 double minPhoPtForEffic; 00148 double maxPhoEtaForEffic; 00149 double maxPhoZForEffic; 00150 double maxPhoRForEffic; 00151 double minPhoPtForPurity; 00152 double maxPhoEtaForPurity; 00153 double maxPhoZForPurity; 00154 double maxPhoRForPurity; 00155 00156 double simMinPt_; 00157 double simMaxPt_; 00158 00160 double recMinPt_; 00161 double recMaxPt_; 00162 00163 // 00164 // 00165 MonitorElement* h_nSimConv_[2]; 00166 MonitorElement* h_SimConvEtaPix_[2]; 00167 // 00168 MonitorElement* h_simTkPt_; 00169 MonitorElement* h_simTkEta_; 00170 00171 MonitorElement* h_simConvVtxRvsZ_[4]; 00172 MonitorElement* h_simConvVtxYvsX_; 00173 00174 00176 MonitorElement* h_AllSimConv_[5]; 00177 MonitorElement* h_VisSimConv_[6]; 00178 MonitorElement* h_VisSimConvLarge_; 00180 MonitorElement* h_SimConvOneTracks_[5]; 00181 MonitorElement* h_SimConvOneMTracks_[5]; 00182 MonitorElement* h_SimConvTwoTracks_[5]; 00183 MonitorElement* h_SimConvTwoMTracks_[5]; 00184 MonitorElement* h_SimConvTwoMTracksAndVtxPGT0_[5]; 00185 MonitorElement* h_SimConvTwoMTracksAndVtxPGT0005_[5]; 00186 MonitorElement* h_SimConvTwoMTracksAndVtxPGT01_[5]; 00187 // Numerator for double-counting quantification 00188 MonitorElement* h_SimRecConvOneTracks_[5]; 00189 MonitorElement* h_SimRecConvOneMTracks_[5]; 00190 MonitorElement* h_SimRecConvTwoTracks_[5]; 00191 MonitorElement* h_SimRecConvTwoMTracks_[5]; 00192 00193 // Denominators for conversion fake rate 00194 MonitorElement* h_RecoConvTwoTracks_[5]; 00195 // Numerators for conversion fake rate 00196 MonitorElement* h_RecoConvTwoMTracks_[5]; 00197 00198 00200 MonitorElement* h_nConv_[3][3]; 00201 MonitorElement* h_convEta_[3][3]; 00202 MonitorElement* h_convEta2_[3][3]; 00203 MonitorElement* h_convPhi_[3][3]; 00204 MonitorElement* h_convR_[3][3]; 00205 MonitorElement* h_convZ_[3][3]; 00206 MonitorElement* h_convPt_[3][3]; 00207 00208 MonitorElement* h_convRplot_; 00209 MonitorElement* h_convZplot_; 00210 00211 MonitorElement* h_convPtRes_[3]; 00212 00213 MonitorElement* h_invMass_[3][3]; 00214 00215 MonitorElement* h_DPhiTracksAtVtx_[3][3]; 00216 MonitorElement* h2_DPhiTracksAtVtxVsEta_; 00217 MonitorElement* p_DPhiTracksAtVtxVsEta_; 00218 MonitorElement* h2_DPhiTracksAtVtxVsR_; 00219 MonitorElement* p_DPhiTracksAtVtxVsR_; 00220 00221 MonitorElement* h_DCotTracks_[3][3]; 00222 MonitorElement* h2_DCotTracksVsEta_; 00223 MonitorElement* p_DCotTracksVsEta_; 00224 MonitorElement* h2_DCotTracksVsR_; 00225 MonitorElement* p_DCotTracksVsR_; 00226 00227 MonitorElement* h_distMinAppTracks_[3][3]; 00228 00229 MonitorElement* h_DPhiTracksAtEcal_[3][3]; 00230 MonitorElement* h2_DPhiTracksAtEcalVsR_; 00231 MonitorElement* p_DPhiTracksAtEcalVsR_; 00232 MonitorElement* h2_DPhiTracksAtEcalVsEta_; 00233 MonitorElement* p_DPhiTracksAtEcalVsEta_; 00234 00235 MonitorElement* h_DEtaTracksAtEcal_[3][3]; 00236 00237 00238 00239 MonitorElement* h_convVtxRvsZ_[3]; 00240 MonitorElement* h_convVtxYvsX_; 00241 MonitorElement* h_convVtxRvsZ_zoom_[2]; 00242 MonitorElement* h_convVtxYvsX_zoom_[2]; 00243 00244 MonitorElement* h_convVtxdX_; 00245 MonitorElement* h_convVtxdY_; 00246 MonitorElement* h_convVtxdZ_; 00247 MonitorElement* h_convVtxdR_; 00248 MonitorElement* h_convVtxdEta_; 00249 MonitorElement* h_convVtxdPhi_; 00250 00251 MonitorElement* h_convVtxdX_barrel_; 00252 MonitorElement* h_convVtxdY_barrel_; 00253 MonitorElement* h_convVtxdZ_barrel_; 00254 MonitorElement* h_convVtxdR_barrel_; 00255 00256 MonitorElement* h_convVtxdX_endcap_; 00257 MonitorElement* h_convVtxdY_endcap_; 00258 MonitorElement* h_convVtxdZ_endcap_; 00259 MonitorElement* h_convVtxdR_endcap_; 00260 00261 00262 MonitorElement* h2_convVtxdRVsR_; 00263 MonitorElement* h2_convVtxdRVsEta_; 00264 00265 MonitorElement* p_convVtxdRVsR_; 00266 MonitorElement* p_convVtxdRVsEta_; 00267 00268 MonitorElement* p_convVtxdXVsX_; 00269 MonitorElement* p_convVtxdYVsY_; 00270 MonitorElement* p_convVtxdZVsZ_; 00271 MonitorElement* p_convVtxdZVsR_; 00272 00273 00274 MonitorElement* p2_convVtxdRVsRZ_; 00275 MonitorElement* p2_convVtxdZVsRZ_; 00276 00277 MonitorElement* h2_convVtxRrecVsTrue_; 00278 00279 00280 MonitorElement* h_vtxChi2Prob_[3][3]; 00281 00282 00283 00284 MonitorElement* h_zPVFromTracks_[2]; 00285 MonitorElement* h_dzPVFromTracks_[2]; 00286 MonitorElement* h2_dzPVVsR_; 00287 MonitorElement* p_dzPVVsR_; 00288 00289 MonitorElement* h_lxybs_[3][3]; 00290 MonitorElement* h_maxNHitsBeforeVtx_[3][3]; 00291 MonitorElement* h_leadNHitsBeforeVtx_[3][3]; 00292 MonitorElement* h_trailNHitsBeforeVtx_[3][3]; 00293 MonitorElement* h_sumNHitsBeforeVtx_[3][3]; 00294 MonitorElement* h_deltaExpectedHitsInner_[3][3]; 00295 MonitorElement* h_leadExpectedHitsInner_[3][3]; 00296 MonitorElement* h_maxDlClosestHitToVtx_[3][3]; 00297 MonitorElement* h_maxDlClosestHitToVtxSig_[3][3]; 00298 MonitorElement* h_nSharedHits_[3][3]; 00299 00300 00301 00303 MonitorElement* nHits_[3]; 00304 MonitorElement* p_nHitsVsEta_[3]; 00305 MonitorElement* nHitsVsEta_[3]; 00306 MonitorElement* p_nHitsVsR_[3]; 00307 MonitorElement* nHitsVsR_[3]; 00308 MonitorElement* h_tkChi2_[3]; 00309 MonitorElement* h_tkChi2Large_[3]; 00310 MonitorElement* h2_Chi2VsEta_[3]; 00311 MonitorElement* p_Chi2VsEta_[3]; 00312 MonitorElement* h2_Chi2VsR_[3]; 00313 MonitorElement* p_Chi2VsR_[3]; 00314 00315 MonitorElement* h_TkD0_[3]; 00316 00317 MonitorElement* h_TkPtPull_[3]; 00318 MonitorElement* h2_TkPtPull_[3]; 00319 MonitorElement* p_TkPtPull_[3]; 00320 MonitorElement* h2_PtRecVsPtSim_[3]; 00321 MonitorElement* h2_photonPtRecVsPtSim_; 00322 00323 MonitorElement* h_match_; 00324 00325 MonitorElement* p2_effRZ_; 00326 00327 MonitorElement* h_nHitsBeforeVtx_[3]; 00328 MonitorElement* h_dlClosestHitToVtx_[3]; 00329 MonitorElement* h_dlClosestHitToVtxSig_[3]; 00330 00331 }; 00332 00333 00334 00335 00336 #endif