Go to the documentation of this file.00001 #ifndef PhotonAnalyzer_H
00002 #define PhotonAnalyzer_H
00003
00004 #include "FWCore/ServiceRegistry/interface/Service.h"
00005 #include "CommonTools/UtilAlgos/interface/TFileService.h"
00006
00007 #include "FWCore/Framework/interface/Frameworkfwd.h"
00008 #include "FWCore/Framework/interface/MakerMacros.h"
00009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00010 #include "FWCore/Utilities/interface/Exception.h"
00011
00012 #include "DataFormats/Math/interface/deltaR.h"
00013 #include "DataFormats/Common/interface/Handle.h"
00014 #include "DataFormats/TrackReco/interface/Track.h"
00015 #include "DataFormats/TrackReco/interface/TrackExtra.h"
00016 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00017 #include "DataFormats/Common/interface/ValueMap.h"
00018 #include "DataFormats/EgammaCandidates/interface/Conversion.h"
00019 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
00020 #include "DataFormats/EgammaCandidates/interface/Photon.h"
00021 #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"
00022
00023 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00024 #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
00025 #include "DataFormats/CaloRecHit/interface/CaloCluster.h"
00026 #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
00027 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00028 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00029 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00030 #include "DataFormats/DetId/interface/DetId.h"
00031
00032 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
00033 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h"
00034 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h"
00035 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00036
00038 #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h"
00039 #include "RecoEcal/EgammaCoreTools/interface/EcalEtaPhiRegion.h"
00040 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h"
00041
00042 #include "CommonTools/Statistics/interface/ChiSquaredProbability.h"
00043
00044
00045 #include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h"
00046 #include "Geometry/CaloTopology/interface/CaloTopology.h"
00047 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
00048 #include "Geometry/Records/interface/IdealGeometryRecord.h"
00049 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00050 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
00051 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00052 #include "Geometry/CaloTopology/interface/EcalEndcapTopology.h"
00053 #include "Geometry/CaloTopology/interface/EcalBarrelTopology.h"
00054
00055 #include "TFile.h"
00056 #include "TH1.h"
00057 #include "TH2.h"
00058 #include "TTree.h"
00059 #include "TVector3.h"
00060 #include "TProfile.h"
00061
00062
00063 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00064 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00065 #include "Geometry/CaloTopology/interface/CaloTopology.h"
00066 #include "FWCore/Framework/interface/EDAnalyzer.h"
00067 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00068 #include "FWCore/Framework/interface/Event.h"
00069 #include "FWCore/Framework/interface/EventSetup.h"
00070 #include "FWCore/Framework/interface/ESHandle.h"
00071
00072
00073
00074 #include "DQMServices/Core/interface/DQMStore.h"
00075 #include "FWCore/ServiceRegistry/interface/Service.h"
00076 #include "DQMServices/Core/interface/MonitorElement.h"
00077
00078
00079
00080 #include <vector>
00081 #include <string>
00082
00095
00096 class TFile;
00097 class TH1F;
00098 class TH2F;
00099 class TProfile;
00100 class TTree;
00101 class SimVertex;
00102 class SimTrack;
00103
00104
00105 class PhotonAnalyzer : public edm::EDAnalyzer
00106 {
00107
00108
00109 public:
00110
00111
00112 explicit PhotonAnalyzer( const edm::ParameterSet& ) ;
00113 virtual ~PhotonAnalyzer();
00114
00115
00116 virtual void analyze( const edm::Event&, const edm::EventSetup& ) ;
00117 virtual void beginJob() ;
00118 virtual void endJob() ;
00119 virtual void endRun(const edm::Run& , const edm::EventSetup& ) ;
00120
00121
00122 private:
00123
00124
00125 float phiNormalization( float& a);
00126
00127 MonitorElement* bookHisto(std::string histoName, std::string title, int bin, double min, double max);
00128
00129 void book2DHistoVector(std::vector<std::vector<MonitorElement*> > & toFill,
00130 std::string histoType, std::string histoName, std::string title,
00131 int xbin, double xmin, double xmax,
00132 int ybin=1,double ymin=1, double ymax=2);
00133
00134 void book3DHistoVector( std::vector<std::vector<std::vector<MonitorElement*> > > & toFill,
00135 std::string histoType, std::string histoName, std::string title,
00136 int xbin, double xmin, double xmax,
00137 int ybin=1,double ymin=1, double ymax=2);
00138
00139
00140 void fill2DHistoVector(std::vector<std::vector<MonitorElement*> >& histoVector,double x, int cut, int type);
00141 void fill2DHistoVector(std::vector<std::vector<MonitorElement*> >& histoVector,double x, double y, int cut, int type);
00142
00143 void fill3DHistoVector(std::vector<std::vector<std::vector<MonitorElement*> > >& histoVector,double x, int cut, int type, int part);
00144 void fill3DHistoVector(std::vector<std::vector<std::vector<MonitorElement*> > >& histoVector,double x, double y, int cut, int type, int part);
00145
00146
00147
00149
00150 std::string fName_;
00151 int verbosity_;
00152
00153 unsigned int prescaleFactor_;
00154
00155 std::string photonProducer_;
00156 std::string photonCollection_;
00157
00158 std::string barrelRecHitProducer_;
00159 std::string barrelRecHitCollection_;
00160
00161 std::string endcapRecHitProducer_;
00162 std::string endcapRecHitCollection_;
00163
00164 edm::InputTag triggerEvent_;
00165
00166 double minPhoEtCut_;
00167 double invMassEtCut_;
00168
00169 double cutStep_;
00170 int numberOfSteps_;
00171
00172 bool useBinning_;
00173 bool useTriggerFiltering_;
00174 bool standAlone_;
00175 std::string outputFileName_;
00176
00177 bool minimalSetOfHistos_;
00178 bool excludeBkgHistos_;
00179
00180 int isolationStrength_;
00181
00182 bool isHeavyIon_;
00183
00184 edm::ParameterSet parameters_;
00185
00187
00188 DQMStore *dbe_;
00189 std::stringstream currentFolder_;
00190
00191 int histo_index_photons_;
00192 int histo_index_conversions_;
00193 int histo_index_efficiency_;
00194 int histo_index_invMass_;
00195
00196
00197 int nEvt_;
00198 int nEntry_;
00199
00200 std::vector<std::string> types_;
00201 std::vector<std::string> parts_;
00202
00204
00205 MonitorElement* totalNumberOfHistos_efficiencyFolder;
00206 MonitorElement* totalNumberOfHistos_invMassFolder;
00207 MonitorElement* totalNumberOfHistos_photonsFolder;
00208 MonitorElement* totalNumberOfHistos_conversionsFolder;
00209
00210
00211 MonitorElement* h_phoEta_Loose_;
00212 MonitorElement* h_phoEta_Tight_;
00213 MonitorElement* h_phoEt_Loose_;
00214 MonitorElement* h_phoEt_Tight_;
00215
00216 MonitorElement* h_phoEta_preHLT_;
00217 MonitorElement* h_phoEta_postHLT_;
00218 MonitorElement* h_phoEt_preHLT_;
00219 MonitorElement* h_phoEt_postHLT_;
00220
00221 MonitorElement* h_convEta_Loose_;
00222 MonitorElement* h_convEta_Tight_;
00223 MonitorElement* h_convEt_Loose_;
00224 MonitorElement* h_convEt_Tight_;
00225
00226
00227 MonitorElement* h_phoEta_Vertex_;
00228
00229 MonitorElement* h_invMassTwoWithTracks_;
00230 MonitorElement* h_invMassOneWithTracks_;
00231 MonitorElement* h_invMassZeroWithTracks_;
00232 MonitorElement* h_invMassAllPhotons_;
00233
00235
00236
00237 std::vector<std::vector<MonitorElement*> > h_nTrackIsolSolidVsEta_;
00238 std::vector<std::vector<MonitorElement*> > h_trackPtSumSolidVsEta_;
00239 std::vector<std::vector<MonitorElement*> > h_nTrackIsolHollowVsEta_;
00240 std::vector<std::vector<MonitorElement*> > h_trackPtSumHollowVsEta_;
00241 std::vector<std::vector<MonitorElement*> > h_ecalSumVsEta_;
00242 std::vector<std::vector<MonitorElement*> > h_hcalSumVsEta_;
00243
00244
00245 std::vector<std::vector<MonitorElement*> > h_nTrackIsolSolidVsEt_;
00246 std::vector<std::vector<MonitorElement*> > h_trackPtSumSolidVsEt_;
00247 std::vector<std::vector<MonitorElement*> > h_nTrackIsolHollowVsEt_;
00248 std::vector<std::vector<MonitorElement*> > h_trackPtSumHollowVsEt_;
00249 std::vector<std::vector<MonitorElement*> > h_ecalSumVsEt_;
00250 std::vector<std::vector<MonitorElement*> > h_hcalSumVsEt_;
00251
00252
00253 std::vector<std::vector<MonitorElement*> > h_nTrackIsolSolid_;
00254 std::vector<std::vector<MonitorElement*> > h_trackPtSumSolid_;
00255 std::vector<std::vector<MonitorElement*> > h_nTrackIsolHollow_;
00256 std::vector<std::vector<MonitorElement*> > h_trackPtSumHollow_;
00257 std::vector<std::vector<MonitorElement*> > h_ecalSum_;
00258 std::vector<std::vector<MonitorElement*> > h_hcalSum_;
00259
00260
00261 std::vector<std::vector<MonitorElement*> > p_nTrackIsolSolidVsEta_;
00262 std::vector<std::vector<MonitorElement*> > p_trackPtSumSolidVsEta_;
00263 std::vector<std::vector<MonitorElement*> > p_nTrackIsolHollowVsEta_;
00264 std::vector<std::vector<MonitorElement*> > p_trackPtSumHollowVsEta_;
00265 std::vector<std::vector<MonitorElement*> > p_ecalSumVsEta_;
00266 std::vector<std::vector<MonitorElement*> > p_hcalSumVsEta_;
00267
00268 std::vector<std::vector<MonitorElement*> > p_nTrackIsolSolidVsEt_;
00269 std::vector<std::vector<MonitorElement*> > p_trackPtSumSolidVsEt_;
00270 std::vector<std::vector<MonitorElement*> > p_nTrackIsolHollowVsEt_;
00271 std::vector<std::vector<MonitorElement*> > p_trackPtSumHollowVsEt_;
00272
00273 std::vector<std::vector<MonitorElement*> > p_r9VsEt_;
00274 std::vector<std::vector<MonitorElement*> > p_r9VsEta_;
00275
00276 std::vector<std::vector<MonitorElement*> > p_e1x5VsEt_;
00277 std::vector<std::vector<MonitorElement*> > p_e1x5VsEta_;
00278
00279 std::vector<std::vector<MonitorElement*> > p_e2x5VsEt_;
00280 std::vector<std::vector<MonitorElement*> > p_e2x5VsEta_;
00281
00282 std::vector<std::vector<MonitorElement*> > p_maxEXtalOver3x3VsEt_;
00283 std::vector<std::vector<MonitorElement*> > p_maxEXtalOver3x3VsEta_;
00284
00285 std::vector<std::vector<MonitorElement*> > p_r1x5VsEt_;
00286 std::vector<std::vector<MonitorElement*> > p_r1x5VsEta_;
00287
00288 std::vector<std::vector<MonitorElement*> > p_r2x5VsEt_;
00289 std::vector<std::vector<MonitorElement*> > p_r2x5VsEta_;
00290
00291 std::vector<std::vector<MonitorElement*> > p_sigmaIetaIetaVsEta_;
00292
00293 std::vector<std::vector<MonitorElement*> > p_dCotTracksVsEta_;
00294
00295 std::vector<std::vector<MonitorElement*> > p_hOverEVsEta_;
00296 std::vector<std::vector<MonitorElement*> > p_hOverEVsEt_;
00297
00298 std::vector<std::vector<MonitorElement*> > h_phoEta_;
00299 std::vector<std::vector<MonitorElement*> > h_scEta_;
00300
00301
00302 std::vector<std::vector<MonitorElement*> > h_phoConvEtaForEfficiency_;
00303
00304 std::vector<std::vector<MonitorElement*> > h_phoEta_BadChannels_;
00305 std::vector<std::vector<MonitorElement*> > h_phoEt_BadChannels_;
00306 std::vector<std::vector<MonitorElement*> > h_phoPhi_BadChannels_;
00307
00308 std::vector<std::vector<MonitorElement*> > h_phoConvEta_;
00309
00310 std::vector<std::vector<MonitorElement*> > h_convVtxRvsZ_;
00311 std::vector<std::vector<MonitorElement*> > h_convVtxZEndcap_;
00312 std::vector<std::vector<MonitorElement*> > h_convVtxZ_;
00313 std::vector<std::vector<MonitorElement*> > h_convVtxYvsX_;
00314 std::vector<std::vector<MonitorElement*> > h_convVtxR_;
00315
00316 std::vector<std::vector<MonitorElement*> > h_r9VsEt_;
00317 std::vector<std::vector<MonitorElement*> > h_r9VsEta_;
00318
00319
00320 std::vector<std::vector<MonitorElement*> > h_e1x5VsEt_;
00321 std::vector<std::vector<MonitorElement*> > h_e1x5VsEta_;
00322
00323 std::vector<std::vector<MonitorElement*> > h_e2x5VsEt_;
00324 std::vector<std::vector<MonitorElement*> > h_e2x5VsEta_;
00325
00326 std::vector<std::vector<MonitorElement*> > h_maxEXtalOver3x3VsEt_;
00327 std::vector<std::vector<MonitorElement*> > h_maxEXtalOver3x3VsEta_;
00328
00329 std::vector<std::vector<MonitorElement*> > h_r1x5VsEt_;
00330 std::vector<std::vector<MonitorElement*> > h_r1x5VsEta_;
00331
00332 std::vector<std::vector<MonitorElement*> > h_r2x5VsEt_;
00333 std::vector<std::vector<MonitorElement*> > h_r2x5VsEta_;
00334
00335 std::vector<std::vector<MonitorElement*> > h_sigmaIetaIetaVsEta_;
00336
00337 std::vector<std::vector<MonitorElement*> > h_tkChi2_;
00338
00339 std::vector<std::vector<MonitorElement*> > h_vertexChi2Prob_;
00340
00341 std::vector<std::vector<MonitorElement*> > p_nHitsVsEta_;
00342
00343 std::vector<std::vector<MonitorElement*> > p_tkChi2VsEta_;
00344
00345
00347
00348 std::vector<std::vector<std::vector<MonitorElement*> > > p_ecalSumVsEt_;
00349 std::vector<std::vector<std::vector<MonitorElement*> > > p_hcalSumVsEt_;
00350
00351 std::vector<std::vector<std::vector<MonitorElement*> > > h_phoE_;
00352 std::vector<std::vector<std::vector<MonitorElement*> > > h_phoEt_;
00353 std::vector<std::vector<std::vector<MonitorElement*> > > h_r9_;
00354 std::vector<std::vector<std::vector<MonitorElement*> > > h_phoPhi_;
00355 std::vector<std::vector<std::vector<MonitorElement*> > > h_scPhi_;
00356 std::vector<std::vector<std::vector<MonitorElement*> > > h_phoConvPhiForEfficiency_;
00357 std::vector<std::vector<std::vector<MonitorElement*> > > h_phoConvPhi_;
00358
00359
00360
00361 std::vector<std::vector<std::vector<MonitorElement*> > > h_hOverE_;
00362 std::vector<std::vector<std::vector<MonitorElement*> > > h_h1OverE_;
00363 std::vector<std::vector<std::vector<MonitorElement*> > > h_h2OverE_;
00364
00365 std::vector<std::vector<std::vector<MonitorElement*> > > h_phoSigmaIetaIeta_;
00366
00367 std::vector<std::vector<std::vector<MonitorElement*> > > h_nPho_;
00368
00369 std::vector<std::vector<std::vector<MonitorElement*> > > h_phoConvE_;
00370 std::vector<std::vector<std::vector<MonitorElement*> > > h_phoConvEt_;
00371 std::vector<std::vector<std::vector<MonitorElement*> > > h_phoConvR9_;
00372
00373 std::vector<std::vector<std::vector<MonitorElement*> > > h_nConv_;
00374
00375 std::vector<std::vector<std::vector<MonitorElement*> > > h_eOverPTracks_;
00376 std::vector<std::vector<std::vector<MonitorElement*> > > h_pOverETracks_;
00377
00378 std::vector<std::vector<std::vector<MonitorElement*> > > h_dCotTracks_;
00379
00380 std::vector<std::vector<std::vector<MonitorElement*> > > h_dPhiTracksAtVtx_;
00381 std::vector<std::vector<std::vector<MonitorElement*> > > h_dPhiTracksAtEcal_;
00382
00383 std::vector<std::vector<std::vector<MonitorElement*> > > h_dEtaTracksAtEcal_;
00384
00385 };
00386
00387
00388
00389
00390
00391 #endif
00392
00393
00394
00395