00001 #ifndef RecoEgamma_Examples_SiStripElectronAnalyzer_h 00002 #define RecoEgamma_Examples_SiStripElectronAnalyzer_h 00003 // -*- C++ -*- 00004 // 00005 // Package: RecoEgamma/Examples 00006 // Class : SiStripElectronAnalyzer 00007 // 00016 // 00017 // Original Author: 00018 // Created: Fri May 26 16:52:45 EDT 2006 00019 // $Id: SiStripElectronAnalyzer.h,v 1.1 2007/03/22 16:12:25 futyand Exp $ 00020 // 00021 00022 // system include files 00023 #include <memory> 00024 #include <map> 00025 00026 // user include files 00027 00028 #include "FWCore/Framework/interface/Frameworkfwd.h" 00029 #include "FWCore/Framework/interface/EDAnalyzer.h" 00030 00031 #include "TFile.h" 00032 #include "TH1F.h" 00033 00034 #include "TNtuple.h" 00035 #include "TTree.h" 00036 #include "TBranch.h" 00037 00038 // forward declarations 00039 00040 #define myMaxHits 1000 00041 00042 // 00043 // class decleration 00044 // 00045 00046 class SiStripElectronAnalyzer : public edm::EDAnalyzer { 00047 public: 00048 explicit SiStripElectronAnalyzer(const edm::ParameterSet&); 00049 ~SiStripElectronAnalyzer(); 00050 00051 00052 virtual void analyze(const edm::Event&, const edm::EventSetup&); 00053 virtual void beginJob(edm::EventSetup const& iSetup); 00054 virtual void initNtuple ( void ) ; 00055 virtual void endJob( void ); 00056 00057 private: 00058 double unwrapPhi(double phi) const { 00059 while (phi > M_PI) { phi -= 2.*M_PI; } 00060 while (phi < -M_PI) { phi += 2.*M_PI; } 00061 return phi; 00062 } 00063 00064 00065 // ----------member data --------------------------- 00066 std::string fileName_; 00067 00068 00069 TFile* file_; 00070 TH1F* numCand_; 00071 TH1F* numElectrons_; 00072 TH1F* numSuperClusters_; 00073 TH1F* energySuperClusters_ ; 00074 TH1F* sizeSuperClusters_; 00075 TH1F* emaxSuperClusters_; 00076 TH1F* phiWidthSuperClusters_; 00077 00078 TH1F* energySuperClustersEl_ ; 00079 TH1F* sizeSuperClustersEl_; 00080 TH1F* emaxSuperClustersEl_; 00081 TH1F* phiWidthSuperClustersEl_; 00082 00083 TH1F* ptDiff ; 00084 TH1F* pDiff ; 00085 TH1F* pElectronFailed ; 00086 TH1F* ptElectronFailed ; 00087 TH1F* pElectronPassed ; 00088 TH1F* ptElectronPassed ; 00089 TH1F* sizeSuperClustersPassed ; 00090 TH1F* sizeSuperClustersFailed ; 00091 TH1F* energySuperClustersPassed ; 00092 TH1F* energySuperClustersFailed ; 00093 TH1F* eOverPFailed ; 00094 TH1F* eOverPPassed ; 00095 00096 00097 TH1F* numSiStereoHits_; 00098 TH1F* numSiMonoHits_; 00099 TH1F* numSiMatchedHits_; 00100 00101 TTree* myTree_; 00102 00103 int NShowers_ ; 00104 float EShower_[myMaxHits] ; 00105 float XShower_[myMaxHits] ; 00106 float YShower_[myMaxHits] ; 00107 float ZShower_[myMaxHits] ; 00108 00109 int NStereoHits_ ; 00110 float StereoHitX_[myMaxHits] ; 00111 float StereoHitY_[myMaxHits] ; 00112 float StereoHitZ_[myMaxHits] ; 00113 00114 float StereoHitR_[myMaxHits]; 00115 float StereoHitPhi_[myMaxHits]; 00116 float StereoHitTheta_[myMaxHits]; 00117 00118 // errors in local coords 00119 float StereoHitSigX_[myMaxHits] ; 00120 float StereoHitSigY_[myMaxHits] ; 00121 float StereoHitCorr_[myMaxHits] ; 00122 00123 float StereoHitSignal_[myMaxHits]; 00124 float StereoHitNoise_[myMaxHits]; 00125 int StereoHitWidth_[myMaxHits]; 00126 00127 int StereoDetector_[myMaxHits]; 00128 int StereoLayer_[myMaxHits]; 00129 00130 // mono corresponds to "rphi" only hits 00131 int NMonoHits_ ; 00132 float MonoHitX_[myMaxHits] ; 00133 float MonoHitY_[myMaxHits] ; 00134 float MonoHitZ_[myMaxHits] ; 00135 00136 float MonoHitR_[myMaxHits]; 00137 float MonoHitPhi_[myMaxHits]; 00138 float MonoHitTheta_[myMaxHits]; 00139 00140 // errors in local coords 00141 float MonoHitSigX_[myMaxHits] ; 00142 float MonoHitSigY_[myMaxHits] ; 00143 float MonoHitCorr_[myMaxHits] ; 00144 00145 float MonoHitSignal_[myMaxHits]; 00146 float MonoHitNoise_[myMaxHits]; 00147 int MonoHitWidth_[myMaxHits]; 00148 00149 int MonoDetector_[myMaxHits]; 00150 int MonoLayer_[myMaxHits]; 00151 00152 // matched hits 00153 int NMatchedHits_ ; 00154 float MatchedHitX_[myMaxHits] ; 00155 float MatchedHitY_[myMaxHits] ; 00156 float MatchedHitZ_[myMaxHits] ; 00157 00158 float MatchedHitR_[myMaxHits]; 00159 float MatchedHitPhi_[myMaxHits]; 00160 float MatchedHitTheta_[myMaxHits]; 00161 00162 // errors in local coords 00163 float MatchedHitSigX_[myMaxHits] ; 00164 float MatchedHitSigY_[myMaxHits] ; 00165 float MatchedHitCorr_[myMaxHits] ; 00166 00167 float MatchedHitSignal_[myMaxHits]; 00168 float MatchedHitNoise_[myMaxHits]; 00169 int MatchedHitWidth_[myMaxHits]; 00170 00171 int MatchedDetector_[myMaxHits]; 00172 int MatchedLayer_[myMaxHits]; 00173 00174 00175 std::string mctruthProducer_; 00176 std::string mctruthCollection_; 00177 std::string superClusterProducer_; 00178 std::string superClusterCollection_; 00179 std::string basicClusterProducer_; 00180 std::string basicClusterCollection_; 00181 std::string eBRecHitProducer_; 00182 std::string eBRecHitCollection_; 00183 std::string siElectronProducer_; 00184 std::string siElectronCollection_; 00185 std::string electronProducer_; 00186 std::string electronCollection_; 00187 std::string siHitProducer_; 00188 std::string siRphiHitCollection_; 00189 std::string siStereoHitCollection_; 00190 std::string siMatchedHitCollection_; 00191 }; 00192 00193 #endif