00001 #ifndef PhotonValidator_H
00002 #define PhotonValidator_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
00015
00016 #include "DQMServices/Core/interface/DQMStore.h"
00017 #include "FWCore/ServiceRegistry/interface/Service.h"
00018 #include "DQMServices/Core/interface/MonitorElement.h"
00019
00020
00021 #include <map>
00022 #include <vector>
00034
00035 class TFile;
00036 class TH1F;
00037 class TH2F;
00038 class TProfile;
00039 class TTree;
00040 class SimVertex;
00041 class SimTrack;
00042
00043
00044 class PhotonValidator : public edm::EDAnalyzer
00045 {
00046
00047 public:
00048
00049
00050 explicit PhotonValidator( const edm::ParameterSet& ) ;
00051 virtual ~PhotonValidator();
00052
00053
00054 virtual void analyze( const edm::Event&, const edm::EventSetup& ) ;
00055 virtual void beginJob( const edm::EventSetup& ) ;
00056 virtual void beginRun( edm::Run& r, edm::EventSetup const & theEventSetup) ;
00057 virtual void endJob() ;
00058
00059 private:
00060
00061
00062 float phiNormalization( float& a);
00063 float etaTransformation( float a, float b);
00064 std::vector<float> errors( TH1* histo1, TH1* histo2 );
00065 void fillPlotFromVectors(MonitorElement* h, std::vector<int>& numerator, std::vector<int>& denominator,std::string type);
00066 void initVectors();
00067 void doProfileX(TH2 * th2, MonitorElement* me);
00068 void doProfileX(MonitorElement * th2m, MonitorElement* me);
00069
00070
00071 std::string fName_;
00072 DQMStore *dbe_;
00073 edm::ESHandle<MagneticField> theMF_;
00074
00075 int verbosity_;
00076 int nEvt_;
00077 int nEntry_;
00078 int nSimPho_;
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
00092 std::string photonCollectionProducer_;
00093 std::string photonCollection_;
00094
00095 edm::InputTag bcBarrelCollection_;
00096 edm::InputTag bcEndcapCollection_;
00097
00098 edm::InputTag barrelEcalHits_;
00099 edm::InputTag endcapEcalHits_;
00100
00101 edm::InputTag label_tp_;
00102
00103
00104 std::string conversionOITrackProducer_;
00105 std::string conversionIOTrackProducer_;
00106
00107
00108
00109 PhotonMCTruthFinder* thePhotonMCTruthFinder_;
00110 TrackAssociatorBase * theTrackAssociator_;
00111
00112 double minPhoEtCut_;
00113 double trkIsolExtRadius_;
00114 double trkIsolInnRadius_;
00115 double trkPtLow_;
00116 double lip_;
00117 double ecalIsolRadius_;
00118 double bcEtLow_;
00119 double hcalIsolExtRadius_;
00120 double hcalIsolInnRadius_;
00121 double hcalHitEtLow_;
00122 int numOfTracksInCone_;
00123 double trkPtSumCut_;
00124 double ecalEtSumCut_;
00125 double hcalEtSumCut_;
00126 bool dCotCutOn_;
00127 double dCotCutValue_;
00128 double dCotHardCutValue_;
00129
00131 double mcPhi_;
00132 double mcEta_;
00133 double mcConvR_;
00134 double mcConvZ_;
00135 double mcConvY_;
00136 double mcConvX_;
00137 std::vector<TrackingParticleRef> theConvTP_;
00138
00139 double simMinPt_;
00140 double simMaxPt_;
00141
00143 double recMinPt_;
00144 double recMaxPt_;
00145
00146 std::vector<double> etaintervals_, etaintervalslarge_, phiintervals_, rintervals_, zintervals_;
00147 std::vector<double> etintervals_;
00148 std::vector<int> totSimPhoEta_, totMatchedSimPhoEta_, totSimPhoPhi_, totMatchedSimPhoPhi_;
00149 std::vector<int> totSimConvEta_, totSimConvPhi_, totSimConvR_, totSimConvZ_, totSimConvEt_;
00150 std::vector<int> totMatchedSimConvEtaTwoTracks_,totMatchedSimConvPhiTwoTracks_, totMatchedSimConvRTwoTracks_, totMatchedSimConvZTwoTracks_, totMatchedSimConvEtTwoTracks_ ;
00151 std::vector<int> totMatchedSimConvEtaOneTrack_, totMatchedSimConvPhiOneTrack_, totMatchedSimConvROneTrack_, totMatchedSimConvZOneTrack_;
00152 std::vector<int> totMatchedRecConvEtaTwoTracks_,totMatchedRecConvPhiTwoTracks_, totMatchedRecConvRTwoTracks_, totMatchedRecConvZTwoTracks_,totMatchedRecConvEtTwoTracks_ ;
00153 std::vector<int> totRecAssConvEtaTwoTracks_,totRecAssConvPhiTwoTracks_, totRecAssConvRTwoTracks_, totRecAssConvZTwoTracks_,totRecAssConvEtTwoTracks_ ;
00154
00155
00156 MonitorElement* h_nSimPho_;
00157 MonitorElement* h_SimPhoE_;
00158 MonitorElement* h_SimPhoEt_;
00159 MonitorElement* h_SimPhoPhi_;
00160 MonitorElement* h_SimPhoEta_;
00161
00162 MonitorElement* h_nSimConv_[2];
00163 MonitorElement* h_SimConvE_[2];
00164 MonitorElement* h_SimConvEt_[2];
00165 MonitorElement* h_SimConvPhi_[2];
00166 MonitorElement* h_SimConvEta_[2];
00167 MonitorElement* h_SimConvEtaPix_[2];
00168
00169 MonitorElement* h_SimConvR_[2];
00170 MonitorElement* h_SimConvZ_[2];
00171
00172 MonitorElement* h_simTkPt_;
00173 MonitorElement* h_simTkEta_;
00174
00175
00176
00177 MonitorElement* phoEffEta_;
00178 MonitorElement* phoEffPhi_;
00179
00180
00181 MonitorElement* convEffEtaTwoTracks_;
00182 MonitorElement* convEffPhiTwoTracks_;
00183 MonitorElement* convEffRTwoTracks_;
00184 MonitorElement* convEffZTwoTracks_;
00185 MonitorElement* convEffEtTwoTracks_;
00186
00187 MonitorElement* convFakeRateEtaTwoTracks_;
00188 MonitorElement* convFakeRatePhiTwoTracks_;
00189 MonitorElement* convFakeRateRTwoTracks_;
00190 MonitorElement* convFakeRateZTwoTracks_;
00191 MonitorElement* convFakeRateEtTwoTracks_;
00192
00193
00194 MonitorElement* convEffEtaOneTrack_;
00195 MonitorElement* convEffPhiOneTrack_;
00196 MonitorElement* convEffROneTrack_;
00197 MonitorElement* convEffZOneTrack_;
00198
00199
00200
00201
00202
00203 MonitorElement* h_phoDEta_[2];
00204 MonitorElement* h_phoDPhi_[2];
00205
00206
00207 MonitorElement* h_nPho_[2][3];
00208 MonitorElement* h_scEta_[2];
00209 MonitorElement* h_scPhi_[2];
00210 MonitorElement* h_scEtaPhi_[2];
00211
00212 MonitorElement* h_scE_[2][3];
00213 MonitorElement* h_scEt_[2][3];
00214
00215 MonitorElement* h_r9_[3][3];
00216 MonitorElement* h2_r9VsEta_[3];
00217 MonitorElement* p_r9VsEta_[3];
00218
00219
00220 MonitorElement* h_phoE_[2][3];
00221 MonitorElement* h_phoEt_[2][3];
00222 MonitorElement* h_phoERes_[3][3];
00223
00224 MonitorElement* h2_eResVsEta_[3];
00225 MonitorElement* p_eResVsEta_[3];
00226
00227
00228 MonitorElement* h_phoEta_[2];
00229 MonitorElement* h_phoPhi_[2];
00230
00231
00232
00234 MonitorElement* h_nConv_[2][3];
00235 MonitorElement* h_convEta_[2];
00236 MonitorElement* h_convPhi_[2];
00237 MonitorElement* h_convERes_[2][3];
00238 MonitorElement* h_convPRes_[2][3];
00239
00240 MonitorElement* h_invMass_[2][3];
00241 MonitorElement* h_r9VsNofTracks_[2][3];
00242 MonitorElement* h_EoverPTracks_[2][3];
00243 MonitorElement* h_PoverETracks_[2][3];
00244
00245
00246 MonitorElement* h2_EoverEtrueVsEoverP_[3];
00247 MonitorElement* h2_PoverPtrueVsEoverP_[3];
00248
00249 MonitorElement* h2_EoverPVsEta_[3];
00250 MonitorElement* p_EoverPVsEta_[3];
00251 MonitorElement* h2_EoverPVsR_[3];
00252 MonitorElement* p_EoverPVsR_[3];
00253
00254 MonitorElement* h2_EoverEtrueVsEta_[3];
00255 MonitorElement* p_EoverEtrueVsEta_[3];
00256 MonitorElement* h2_EoverEtrueVsR_[3];
00257 MonitorElement* p_EoverEtrueVsR_[3];
00258
00259
00260 MonitorElement* h2_PoverPtrueVsEta_[3];
00261 MonitorElement* p_PoverPtrueVsEta_[3];
00262
00263 MonitorElement* h_DPhiTracksAtVtx_[2][3];
00264 MonitorElement* h2_DPhiTracksAtVtxVsEta_;
00265 MonitorElement* p_DPhiTracksAtVtxVsEta_;
00266 MonitorElement* h2_DPhiTracksAtVtxVsR_;
00267 MonitorElement* p_DPhiTracksAtVtxVsR_;
00268
00269 MonitorElement* h_DCotTracks_[2][3];
00270 MonitorElement* h2_DCotTracksVsEta_;
00271 MonitorElement* p_DCotTracksVsEta_;
00272 MonitorElement* h2_DCotTracksVsR_;
00273 MonitorElement* p_DCotTracksVsR_;
00274
00275 MonitorElement* h_distMinAppTracks_[2][3];
00276
00277
00278
00279 MonitorElement* h_DPhiTracksAtEcal_[2][3];
00280 MonitorElement* h2_DPhiTracksAtEcalVsR_;
00281 MonitorElement* p_DPhiTracksAtEcalVsR_;
00282 MonitorElement* h2_DPhiTracksAtEcalVsEta_;
00283 MonitorElement* p_DPhiTracksAtEcalVsEta_;
00284
00285
00286 MonitorElement* h_DEtaTracksAtEcal_[2][3];
00287
00288
00289
00290 MonitorElement* h_convVtxRvsZ_[3];
00291 MonitorElement* h_convVtxdX_;
00292 MonitorElement* h_convVtxdY_;
00293 MonitorElement* h_convVtxdZ_;
00294 MonitorElement* h_convVtxdR_;
00295 MonitorElement* h2_convVtxdRVsR_;
00296 MonitorElement* p_convVtxdRVsR_;
00297
00298
00299 MonitorElement* h_zPVFromTracks_[2];
00300 MonitorElement* h_dzPVFromTracks_[2];
00301 MonitorElement* h2_dzPVVsR_;
00302 MonitorElement* p_dzPVVsR_;
00303
00304
00306 MonitorElement* h_nHitsVsEta_[2];
00307 MonitorElement* nHitsVsEta_[2];
00308 MonitorElement* h_nHitsVsR_[2];
00309 MonitorElement* nHitsVsR_[2];
00310 MonitorElement* h_tkChi2_[2];
00311 MonitorElement* h2_Chi2VsEta_[3];
00312 MonitorElement* p_Chi2VsEta_[3];
00313 MonitorElement* h2_Chi2VsR_[3];
00314 MonitorElement* p_Chi2VsR_[3];
00315
00316 MonitorElement* h_TkD0_[3];
00317
00318 MonitorElement* h_TkPtPull_[3];
00319 MonitorElement* h2_TkPtPull_[3];
00320 MonitorElement* p_TkPtPull_[3];
00321 MonitorElement* h2_PtRecVsPtSim_[3];
00322
00323 MonitorElement* hBCEnergyOverTrackPout_[3];
00324
00325
00326
00327
00328
00329
00330
00331 };
00332
00333 #endif