00001
00002 #ifndef EGAMMAFACTORY_H
00003 #define EGAMMAFACTORY_H
00004
00005 #ifdef XAOD_STANDALONE
00006
00011 #include <array>
00012 #include <memory>
00013
00014 #include <AsgTools/AsgMessaging.h>
00015 #include <xAODRootAccess/TEvent.h>
00016 #include <xAODRootAccess/TStore.h>
00017 #include <xAODEgamma/Electron.h>
00018 #include <xAODEgamma/Photon.h>
00019 #include <xAODEgamma/Egamma.h>
00020 #include <xAODEgamma/PhotonContainer.h>
00021 #include <xAODEgamma/PhotonAuxContainer.h>
00022 #include <xAODEgamma/ElectronContainer.h>
00023 #include <xAODEgamma/ElectronAuxContainer.h>
00024 #include <xAODEventInfo/EventInfo.h>
00025 #include <xAODCaloEvent/CaloClusterContainer.h>
00026 #include <xAODCaloEvent/CaloClusterAuxContainer.h>
00027 #include <xAODTracking/VertexContainer.h>
00028 #include <xAODTracking/VertexAuxContainer.h>
00029 #include <xAODTracking/TrackParticleContainer.h>
00030 #include <xAODTracking/TrackParticleAuxContainer.h>
00031
00032 #include <TProfile2D.h>
00033 #include <TFile.h>
00034
00035 class EgammaFactory : public asg::AsgMessaging {
00036 public:
00037 EgammaFactory();
00038 ~EgammaFactory();
00039 void clear();
00040 void create_structure();
00041 xAOD::CaloCluster* create_cluster(float eta, float phi, float e0, float e1, float e2, float e3, float e);
00042 xAOD::Photon* create_converted_photon(float eta, float phi, float e);
00043 xAOD::Photon* create_unconverted_photon(float eta, float phi, float e);
00044 xAOD::Photon* create_photon(float eta, float phi, float e, float rconv=0, float zconv=0);
00045 xAOD::Photon* create_photon(float eta, float phi, float e0, float e1, float e2, float e3, float e, float rconv=0, float zconv=0);
00046 xAOD::Electron* create_electron(float eta, float phi, float e);
00047 xAOD::Electron* create_electron(float eta, float phi, float e0, float e1, float e2, float e3, float e);
00048 xAOD::EventInfo* create_eventinfo(bool simulation, int runnumber, int eventnumber=1);
00049 private:
00050 xAOD::TStore m_store;
00051 xAOD::CaloClusterContainer* m_clusters;
00052 xAOD::CaloClusterAuxContainer* m_clAux;
00053 xAOD::VertexContainer* m_vertexes;
00054 xAOD::VertexAuxContainer* m_vxAux;
00055 xAOD::PhotonContainer* m_photons;
00056 xAOD::PhotonAuxContainer* m_photonsAux;
00057 xAOD::ElectronContainer* m_electrons;
00058 xAOD::ElectronAuxContainer* m_electronsAux;
00059 xAOD::TrackParticleContainer* m_tracks;
00060 xAOD::TrackParticleAuxContainer* m_tracksAux;
00061
00062 std::unique_ptr<TFile> m_fave;
00063 std::array<TProfile2D*, 4> m_histos_electron;
00064 std::array<TProfile2D*, 4> m_histos_conv;
00065 std::array<TProfile2D*, 4> m_histos_unconv;
00066 TProfile2D* m_histo_rconv;
00067 TProfile2D* m_histo_zconv;
00068 std::array<double, 4> get_layers_fraction(const std::array<TProfile2D*, 4>& prof, double eta, double pt) const;
00069 };
00070
00071 #else
00072
00073 struct EgammaFactory {
00074 };
00075
00076 #endif
00077
00078 #endif