00001 #ifndef ATNUEVENTSELECTOR_H 00002 #define ATNUEVENTSELECTOR_H 00003 00004 #include "TObject.h" 00005 #include "TCanvas.h" 00006 #include "TButton.h" 00007 00008 #include "TChain.h" 00009 #include "TDirectory.h" 00010 #include "TFile.h" 00011 #include "TTree.h" 00012 #include "TString.h" 00013 00014 #include <vector> 00015 using std::vector; 00016 00017 #include "AtNuEventType.h" 00018 #include "AtNuAtmosEventType.h" 00019 00020 class AtNuEventNtuple; 00021 class AtNuEventSelection; 00022 class AtNuEventSelectionFactory; 00023 class AtmosEvent; 00024 00025 class AtNuEventSelector : public TObject 00026 { 00027 00028 public: 00029 00030 AtNuEventSelector(); 00031 virtual ~AtNuEventSelector(); 00032 00033 void Initialize(); 00034 void AddFile(const char* file); 00035 void AddList(const char* file); 00036 00037 void SelectGoodSlice(Bool_t select = 1); 00038 void SelectGoodEvent(Bool_t select = 1); 00039 void SelectGoodTrack(Bool_t select = 1); 00040 void SelectGoodShower(Bool_t select = 1); 00041 void SelectCV(Bool_t select = 1); 00042 void SelectCE(Bool_t select = 1); 00043 void SelectFC(Bool_t select = 1); 00044 void SelectPC(Bool_t select = 1); 00045 void SelectCVUP(Bool_t select = 1); 00046 void SelectUPMU(Bool_t select = 1); 00047 void SelectCosmic(Bool_t select = 1); 00048 void SelectGoodCosmic(Bool_t select = 1); 00049 void SelectStoppingMuon(Bool_t select = 1); 00050 void SelectThroughGoingMuon(Bool_t select = 1); 00051 void SelectMultipleMuon(Bool_t select = 1); 00052 void SelectSpill(Bool_t select = 1); 00053 void SelectFakeSpill(Bool_t select = 1); 00054 void SelectBeamSpill(Bool_t select = 1); 00055 void SelectAtmosNumu(Bool_t select = 1); 00056 void SelectAtmosNue(Bool_t select = 1); 00057 00058 void PassGoodSlice(Bool_t pass = 1); 00059 void PassGoodEvent(Bool_t pass = 1); 00060 void PassGoodTrack(Bool_t pass = 1); 00061 void PassGoodShower(Bool_t pass = 1); 00062 void PassCV(Bool_t pass = 1); 00063 void PassCE(Bool_t pass = 1); 00064 void PassFC(Bool_t pass = 1); 00065 void PassPC(Bool_t pass = 1); 00066 void PassCVUP(Bool_t pass = 1); 00067 void PassUPMU(Bool_t pass = 1); 00068 void PassCosmic(Bool_t pass = 1); 00069 void PassGoodCosmic(Bool_t pass = 1); 00070 void PassStoppingMuon(Bool_t pass = 1); 00071 void PassThroughGoingMuon(Bool_t pass = 1); 00072 void PassMultipleMuon(Bool_t pass = 1); 00073 void PassSpill(Bool_t pass = 1); 00074 void PassBeamSpill(Bool_t pass = 1); 00075 void PassFakeSpill(Bool_t pass = 1); 00076 00077 void FailGoodSlice(Bool_t fail = 1); 00078 void FailGoodEvent(Bool_t fail = 1); 00079 void FailGoodTrack(Bool_t fail = 1); 00080 void FailGoodShower(Bool_t fail = 1); 00081 void FailCV(Bool_t fail = 1); 00082 void FailCE(Bool_t fail = 1); 00083 void FailFC(Bool_t fail = 1); 00084 void FailPC(Bool_t fail = 1); 00085 void FailCVUP(Bool_t fail = 1); 00086 void FailUPMU(Bool_t fail = 1); 00087 void FailCosmic(Bool_t fail = 1); 00088 void FailGoodCosmic(Bool_t fail = 1); 00089 void FailStoppingMuon(Bool_t fail = 1); 00090 void FailThroughGoingMuon(Bool_t fail = 1); 00091 void FailMultipleMuon(Bool_t fail = 1); 00092 void FailSpill(Bool_t fail = 1); 00093 void FailBeamSpill(Bool_t fail = 1); 00094 void FailFakeSpill(Bool_t fail = 1); 00095 00096 void PreSelectAtmosNumu(Bool_t select = 1); 00097 void PreSelectAtmosNue(Bool_t select = 1); 00098 00099 void WriteEvents(Bool_t write = 1); 00100 void SetEventFile(const char* filename); 00101 void SetEventFileMaxSize(Double_t maxsize_mb); 00102 00103 void WriteSummaries(Bool_t write = 1); 00104 void SetSummaryFile(const char* filename); 00105 void SetSummaryFileMaxSize(Double_t maxsize_mb); 00106 00107 void WriteTracks(Bool_t write = 1); 00108 void WriteShowers(Bool_t write = 1); 00109 void WriteTracksLimit(Int_t limit = 1); 00110 void WriteShowersLimit(Int_t limit = 1); 00111 00112 void Run(Int_t entries = -1); 00113 00114 private: 00115 00116 void RunEventSelection(Int_t entries = -1); 00117 void RunEventSelectionEnd(); 00118 00119 void StartEventSelection(); 00120 Bool_t PassFail(Int_t eventtype, 00121 Int_t atmoseventtype); 00122 00123 void OpenFile(TString filename); 00124 void WriteToFile(); 00125 void CloseFile(); 00126 00127 void WriteOutEvent(); 00128 void WriteOutSummary(AtmosEvent* event, 00129 Int_t eventtype, Int_t atmoseventtype, 00130 Double_t shieldtime, Double_t spilltime, 00131 Int_t ptrackid, Int_t pshowerid); 00132 00133 TFile* fNewFile; 00134 TTree* fNewTree; 00135 TString fNewFileName; 00136 TString fSummaryFileName; 00137 Double_t fEventFileMaxSizeBytes; 00138 Double_t fEventFileMaxSizeMegaBytes; 00139 Double_t fSummaryFileMaxSizeBytes; 00140 Double_t fSummaryFileMaxSizeMegaBytes; 00141 Int_t fFileNumber; 00142 00143 AtNuEventSelectionFactory* fSelectionFactory; 00144 AtNuEventSelection* fSelection; 00145 AtNuEventNtuple* fNtuple; 00146 00147 Bool_t fWriteTracks; 00148 Bool_t fWriteShowers; 00149 Int_t fWriteTracksLimit; 00150 Int_t fWriteShowersLimit; 00151 00152 Bool_t fSelectionOnOff; 00153 Bool_t fSelectEventType; 00154 00155 Bool_t fSelectGoodSlice; 00156 Bool_t fSelectGoodEvent; 00157 Bool_t fSelectGoodTrack; 00158 Bool_t fSelectGoodShower; 00159 Bool_t fSelectCV; 00160 Bool_t fSelectCE; 00161 Bool_t fSelectFC; 00162 Bool_t fSelectPC; 00163 Bool_t fSelectCVUP; 00164 Bool_t fSelectUPMU; 00165 Bool_t fSelectCosmic; 00166 Bool_t fSelectGoodCosmic; 00167 Bool_t fSelectStoppingMuon; 00168 Bool_t fSelectThroughGoingMuon; 00169 Bool_t fSelectMultipleMuon; 00170 Bool_t fSelectSpill; 00171 Bool_t fSelectBeamSpill; 00172 Bool_t fSelectFakeSpill; 00173 Bool_t fSelectAtmosNumu; 00174 Bool_t fSelectAtmosNue; 00175 00176 Bool_t fPassGoodSlice; 00177 Bool_t fPassGoodEvent; 00178 Bool_t fPassGoodTrack; 00179 Bool_t fPassGoodShower; 00180 Bool_t fPassCV; 00181 Bool_t fPassCE; 00182 Bool_t fPassFC; 00183 Bool_t fPassPC; 00184 Bool_t fPassCVUP; 00185 Bool_t fPassUPMU; 00186 Bool_t fPassCosmic; 00187 Bool_t fPassGoodCosmic; 00188 Bool_t fPassStoppingMuon; 00189 Bool_t fPassThroughGoingMuon; 00190 Bool_t fPassMultipleMuon; 00191 Bool_t fPassSpill; 00192 Bool_t fPassBeamSpill; 00193 Bool_t fPassFakeSpill; 00194 00195 Bool_t fFailGoodSlice; 00196 Bool_t fFailGoodEvent; 00197 Bool_t fFailGoodTrack; 00198 Bool_t fFailGoodShower; 00199 Bool_t fFailCV; 00200 Bool_t fFailCE; 00201 Bool_t fFailFC; 00202 Bool_t fFailPC; 00203 Bool_t fFailCVUP; 00204 Bool_t fFailUPMU; 00205 Bool_t fFailCosmic; 00206 Bool_t fFailGoodCosmic; 00207 Bool_t fFailStoppingMuon; 00208 Bool_t fFailThroughGoingMuon; 00209 Bool_t fFailMultipleMuon; 00210 Bool_t fFailSpill; 00211 Bool_t fFailBeamSpill; 00212 Bool_t fFailFakeSpill; 00213 00214 Bool_t fPreSelectAtmosNumu; 00215 Bool_t fPreSelectAtmosNue; 00216 00217 Bool_t fWriteEvents; 00218 Bool_t fWriteSummaries; 00219 00220 TChain* fChain; 00221 Int_t fLast; 00222 Int_t fRun; 00223 00224 Int_t fEventList; 00225 Int_t fEventListCounter; 00226 Int_t fEventListLast; 00227 00228 vector<Int_t> fRunList; 00229 vector<Int_t> fSnarlList; 00230 00231 AtmosEvent* fEvent; 00232 00233 ClassDef(AtNuEventSelector, 0) 00234 }; 00235 00236 00237 #endif // ATNUEVENTSELECTOR_H 00238