CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/RecoEgamma/Examples/plugins/SiStripElectronAnalyzer.h

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