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