00001 #ifndef BASE_ANALYSIS_H_
00002 #define BASE_ANALYSIS_H_
00003
00004 #include <iostream>
00005 #include <string>
00006 #include <map>
00007 #include <vector>
00008
00009 #include "HepMC/GenEvent.h"
00010
00011 #include "fastjet/PseudoJet.hh"
00012 #include "fastjet/JetDefinition.hh"
00013
00014
00015 namespace fastjet {
00016 class ClusterSequence;
00017 }
00018 namespace HepPDT {
00019 class ParticleDataTable;
00020 }
00021 class TFile;
00022 class TH1D;
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 class baseAnalysis
00033 {
00034 public:
00035 baseAnalysis();
00036 virtual ~baseAnalysis();
00037
00038 virtual int Finalize();
00039 virtual int Finalize(TFile* output);
00040
00041 virtual TH1D* popHisto();
00042
00043 virtual int Init(double maxeta = 2.5, double minpt = 0.5 );
00044 virtual int Process(HepMC::GenEvent* hepmcevt);
00045
00046
00047
00048 virtual std::vector<TH1D*> averagedHistograms();
00049
00050 virtual std::vector<TH1D*>& Histograms();
00051
00052
00053 int InitJetFinder(double coneRadius, double overlapThreshold, double jet_ptmin, double lepton_ptmin, double DeltaR_lepton_track,
00054 int jetalgorithm = 2);
00055
00056 int FindJetableParticles(HepMC::GenEvent* hepmcevt);
00057 int FindJet(HepMC::GenEvent* hepmcevt);
00058 int DeleteJetObject(HepMC::GenEvent* hepmcevt);
00059
00060 std::vector<fastjet::PseudoJet> GetJet(HepMC::GenEvent* hepmcevt);
00061 virtual void SetJet(std::vector<fastjet::PseudoJet>* inclusive_jets);
00062
00063
00064 int FindMissingEt(HepMC::GenEvent* hepmcevt);
00065 int ClearMissingEt(HepMC::GenEvent* hepmcevt);
00066
00067
00068 int ClearEvent(HepMC::GenEvent* hepmcevt);
00069
00070
00071 inline int setOutputFileName(const std::string& filename);
00072
00073
00074 inline int setOutputRootDir(const std::string& dirname);
00075
00076
00077 static bool IsNeutrino(int pid);
00078 static bool IsGamma(int pid);
00079 static bool IsNeutron(int pid);
00080 static bool IsK0(int pid);
00081 static bool IsPi0(int pid);
00082 static bool IsElectron(int pid);
00083 static bool IsMuon(int pid);
00084 static bool IsGluon(int pid);
00085
00086
00087 static bool chargedParticle(int pid);
00088
00089
00090 virtual int IsFinalStateParticle(HepMC::GenParticle *p);
00091
00092
00093 inline int setMaxEtaCut(double maxeta);
00094
00095
00096 inline int setMinPtCut(double minpt);
00097
00098
00099 TH1D* initHist(const std::string &name, const std::string &title, const std::string &xlabel,
00100 int nrBins=100, double xmin=0.0, double xmax=100.0);
00101 TH1D* initHistVariableBin(const std::string &name, const std::string &title, const std::string &xlabel,
00102 int nbin, double nbinRange[]);
00103
00104
00105 bool checkDaughter(HepMC::GenParticle* mother, HepMC::GenParticle* daughter, int maxGenerations=-1);
00106
00107
00108 bool trackfromPID(int pid, HepMC::GenParticle* track, int maxGenerations=-1);
00109
00110
00111 static double getRapidity(const HepMC::GenEvent::particle_const_iterator& p);
00112
00113 protected:
00114
00115 fastjet::JetDefinition::Plugin* m_plugin;
00116 fastjet::JetDefinition* m_jetDef;
00117
00118 std::vector< fastjet::PseudoJet > m_input_particles;
00119 std::vector< fastjet::PseudoJet > m_inclusive_jets;
00120 fastjet::ClusterSequence* m_clust_seq;
00121
00122 std::map< std::string, int > m_histCounter;
00123 std::vector<TH1D*> m_histVector;
00124
00125 std::string m_outputFileName;
00126 std::string m_outputRootDir;
00127
00128
00129 double m_coneRadius;
00130 double m_overlapThreshold;
00131 double m_jet_ptmin;
00132 double m_lepton_ptmin;
00133 double m_DeltaR_lepton_track;
00134 bool m_Jetfinder_enabled;
00135
00136
00137 double m_max_eta;
00138 double m_min_pt;
00139
00140
00141 double exMissTruth;
00142 double eyMissTruth;
00143 double etMissTruth;
00144 double etsumMissTruth;
00145
00146
00147 };
00148
00149 #endif // BASE_ANALYSIS_H_
00150