00001 #ifndef madbase_h
00002 #define madbase_h
00003 #include <iostream>
00004 #include <string>
00005 #include "TROOT.h"
00006 #include "TChain.h"
00007 #include "TFile.h"
00008 #include "CandNtupleSR/NtpSRRecord.h"
00009 #include "CandNtupleSR/NtpSREvent.h"
00010 #include "CandNtupleSR/NtpSRTrack.h"
00011 #include "CandNtupleSR/NtpSRShower.h"
00012 #include "CandNtupleSR/NtpSRCluster.h"
00013 #include "CandNtupleSR/NtpSRSlice.h"
00014 #include "CandNtupleSR/NtpSRShieldStrip.h"
00015 #include "CandNtupleSR/NtpSRStrip.h"
00016 #include "CandNtupleSR/NtpSRDmxStatus.h"
00017 #include "CandNtupleSR/NtpSRDetStatus.h"
00018 #include "StandardNtuple/NtpStRecord.h"
00019 #include "MCNtuple/NtpMCRecord.h"
00020 #include "MCNtuple/NtpMCSummary.h"
00021 #include "MCNtuple/NtpMCTruth.h"
00022 #include "MCNtuple/NtpMCStdHep.h"
00023 #include "TruthHelperNtuple/NtpTHRecord.h"
00024 #include "TruthHelperNtuple/NtpTHSlice.h"
00025 #include "TruthHelperNtuple/NtpTHShower.h"
00026 #include "TruthHelperNtuple/NtpTHTrack.h"
00027 #include "TruthHelperNtuple/NtpTHEvent.h"
00028 #include "CandNtupleSR/NtpSRShieldSummary.h"
00029 #include "CandNtupleSR/NtpSREventSummary.h"
00030 #include "Record/RecCandHeader.h"
00031 #include "CandNtupleEM/NtpEMShower.h"
00032 #include "CandNtupleEM/NtpEMRecord.h"
00033 #include "CandNtupleEM/NtpEMSummary.h"
00034 #include "JobControl/JobC.h"
00035 #include "JobControl/JobCInput.h"
00036 #include "JobControl/JobCPath.h"
00037 #include "MinosObjectMap/MomNavigator.h"
00038 #include "MadChain.h"
00039
00040 class MadBase
00041 {
00042 protected :
00043
00044 MadChain *fChain;
00045 JobC *fJC;
00046 string jcPath;
00047 int fCurRun;
00048 int lastEntry;
00049
00050 int whichSource;
00051
00052 NtpStRecord *strecord;
00053 NtpSRRecord *record;
00054 const RecCandHeader *ntpHeader;
00055 NtpSRShieldSummary *shieldSummary;
00056 NtpSREventSummary *eventSummary;
00057 NtpSRDmxStatus *dmxStatus;
00058 NtpSRDetStatus *detStatus;
00059
00060 NtpSREvent *ntpEvent;
00061 NtpSRTrack *ntpTrack;
00062 NtpSRShower *ntpShower;
00063 NtpSRCluster *ntpCluster;
00064 NtpSRSlice *ntpSlice;
00065 NtpSRShieldStrip *ntpShieldStrip;
00066 NtpSRStrip *ntpStrip;
00067
00068 NtpMCRecord *mcrecord;
00069 NtpMCSummary *mcHeader;
00070 NtpMCTruth *ntpTruth;
00071 NtpMCStdHep *ntpStdHep;
00072
00073 NtpTHRecord *threcord;
00074 NtpTHSlice *ntpTHSlice;
00075 NtpTHEvent *ntpTHEvent;
00076 NtpTHTrack *ntpTHTrack;
00077 NtpTHShower *ntpTHShower;
00078
00079 NtpEMRecord *emrecord;
00080 NtpEMSummary *ntpEMSummary;
00081 NtpEMShower *ntpEMShower;
00082
00083 Bool_t isMC;
00084 Bool_t isTH;
00085 Bool_t isEM;
00086 Bool_t isST;
00087 Int_t Nentries;
00088
00090
00091
00092
00093
00094
00095
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00140
00141
00142
00144
00145
00146
00147
00148
00149
00150
00152
00153
00154 Bool_t LoadTrack(Int_t idx);
00155
00156 Bool_t LoadShower(Int_t idx);
00157
00158 Bool_t LoadCluster(Int_t idx);
00159
00160 Bool_t LoadEvent(Int_t idx);
00161
00162 Bool_t LoadSlice(Int_t idx);
00163
00164 Bool_t LoadShieldStrip(Int_t idx);
00165
00166 Bool_t LoadStrip(Int_t idx);
00167
00168 Bool_t LoadTruth(Int_t idx);
00169
00170 Bool_t LoadStdHep(Int_t idx);
00171
00172 Bool_t LoadTHTrack(Int_t);
00173 Bool_t LoadTHEvent(Int_t);
00174 Bool_t LoadTHShower(Int_t);
00175 Bool_t LoadTHSlice(Int_t);
00176
00177 Bool_t LoadEMShower(Int_t);
00178
00179
00180
00181
00182
00183 Bool_t LoadLargestTrackFromEvent(Int_t event, Int_t& trkidx);
00184 Bool_t LoadShower_Jim(Int_t event, Int_t& shwidx, Int_t detector);
00185 Bool_t LoadLargestShowerFromEvent(Int_t event, Int_t& shwidx);
00186
00187 Bool_t LoadShowerAtTrackVertex(Int_t event, Int_t track, Int_t& shwidx);
00188
00189
00190
00191
00192 Bool_t LoadTruthForReco(Int_t,Int_t&);
00193
00194
00195
00196
00197 Bool_t LoadTruthForRecoTH(Int_t,Int_t&);
00198 Bool_t LoadSliceForRecoTH(Int_t,Int_t&);
00199 Float_t RecoShwEnergy(Int_t ishw=0,Int_t opt=-1, Int_t det=1);
00200
00201
00202
00203
00204 public:
00205 MadBase(TChain *chainSR=0,TChain *chainMC=0,
00206 TChain *chainTH=0,TChain *chainEM=0);
00207 MadBase(JobC *,string,int);
00208 ~MadBase();
00209 Int_t GetEntry(Int_t run,Int_t snarl);
00210 Int_t GetEntry(Int_t entry);
00211 void InitChain(TChain *chainSR,TChain *chainMC,
00212 TChain *chainTH,TChain *chainEM, bool build_index=false);
00213 void Clear();
00214
00215
00216 public:
00217
00218
00219
00220
00221
00222 const NtpSREventSummary* GetEventSummary(){return eventSummary;}
00223 const RecCandHeader* GetHeader() {return ntpHeader;}
00224 const NtpSRTrack* GetTrack(Int_t);
00225 const NtpSRTrack* GetLargestTrackFromEvent(Int_t,Int_t&);
00226 const NtpSRShower* GetShower(Int_t);
00227 const NtpSRCluster* GetCluster(Int_t);
00228 const NtpSRShower* GetLargestShowerFromEvent(Int_t,Int_t&);
00229 const NtpSRShower* GetShowerAtTrackVertex(Int_t,Int_t,Int_t&);
00230 const NtpSREvent* GetEvent(Int_t);
00231 const NtpSRSlice* GetSlice(Int_t);
00232 const NtpSRShieldStrip* GetShieldStrip(Int_t);
00233 const NtpSRStrip* GetStrip(Int_t);
00234
00235 const NtpMCTruth* GetTruth(Int_t);
00236 const NtpMCStdHep* GetStdHep(Int_t);
00237 const NtpMCTruth* GetTruthForReco(Int_t,Int_t&);
00238 const NtpTHSlice* GetSliceForRecoTH(Int_t,Int_t&);
00239 const NtpMCTruth* GetTruthForRecoTH(Int_t,Int_t&);
00240 const NtpTHTrack* GetTHTrack(Int_t);
00241 const NtpTHEvent* GetTHEvent(Int_t);
00242 const NtpTHShower* GetTHShower(Int_t);
00243 const NtpTHSlice* GetTHSlice(Int_t);
00244
00245 const NtpEMShower* GetEMShower(Int_t);
00246
00247
00248 };
00249
00250 #endif // #ifdef madbase_h