00001
00002
00003
00004
00005
00006 #ifndef StMuDstFilterMaker_hh
00007 #define StMuDstFilterMaker_hh
00008
00009 #include "StMaker.h"
00010 #include "StChain.h"
00011
00012 #include "StMuDstMaker.h"
00013 #include "StMuDst.h"
00014 #include "StMuEvent.h"
00015 #include "StMuTrack.h"
00016 #ifndef __NO_STRANGE_MUDST__
00017 class StStrangeEvMuDst;
00018 class StV0MuDst;
00019 class StXiMuDst;
00020 #endif
00021 #include <string>
00022
00023 class StMuEmcCollection;
00024
00025 class TTree;
00026 class TFile;
00027
00032 class StMuDstFilterMaker : public StMaker {
00033 public:
00035 StMuDstFilterMaker(const char* name="muDstFilter");
00036 ~StMuDstFilterMaker();
00037
00038 int Make();
00039 int Finish();
00040 virtual const char *GetCVS() const {
00041 static const char cvs[]="Tag $Name: $ $Id: StMuDstFilterMaker.h,v 1.10 2011/04/08 01:25:50 fisyak Exp $ built "__DATE__" "__TIME__ ;
00042 return cvs;
00043 }
00044
00045 void setOutputDirName(const char* name) { mOutDirName = string(name); }
00046 void setOutputFileName(const char* name) { mOutFileName = string(name); }
00047 void setMuDstMaker( StMuDstMaker* maker) { mMuDstMaker = maker; }
00048 void setFilterGlobals(int filterGlobals = 1) { mFilterGlobals = filterGlobals; }
00049 void setDoBemc(int doBemc=1) { mDoBemc = doBemc;}
00050 void setDoEemc(int doEemc=1) { mDoEemc = doEemc;}
00051
00052 protected:
00054 template<class T> bool filter(T* t) { return false;}
00056 bool filter(StMuDst* mu) {return mu->event() && fabs(mu->event()->primaryVertexPosition().z())<100 ;}
00058 bool filter(StMuEvent* ev) {return true; }
00059 bool filter(StMuTrack* track);
00060 bool filter(StMuEmcCollection* emc) { return true; }
00061
00062
00063 StMuDstMaker* mMuDstMaker;
00064
00065
00066 TFile* mFile;
00067 string mOutDirName;
00068 string mOutFileName;
00069 string mCurFileName;
00070 TChain* mChain;
00071 TTree* mTTree;
00072 Int_t mFilterGlobals;
00073 Int_t mDoBemc;
00074 Int_t mDoEemc;
00075 void createArrays();
00076 void clearArrays();
00077 void clear();
00078 void close();
00079 void open(const Char_t *);
00080 template <class T>
00081 int addType(TClonesArray* tcaTo , T t);
00082 template <class T>
00083 int addType(TClonesArray *tca, TClonesArray* tcaTo , T *t);
00084
00086 TClonesArray* mArrays[__NARRAYS__];
00087 #ifndef __NO_STRANGE_MUDST__
00088 TClonesArray* mStrangeArrays[__NSTRANGEARRAYS__];
00089 #endif
00090 TClonesArray* mEmcArrays[__NEMCARRAYS__];
00091
00092 ClassDef(StMuDstFilterMaker, 1)
00093 };
00094
00095
00096 #endif
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
00139
00140
00141
00142