2 #ifndef ROOT_StEventHelper
3 #define ROOT_StEventHelper
16 #include "TPoints3DABC.h"
17 #include "StThreeVectorF.hh"
18 #include "StMCTruth.h"
19 #include "StHelixD.hh"
20 #include "StPhysicalHelixD.hh"
21 #include "StPhysicalHelixD.hh"
22 #include "StHelixHelper.h"
31 class StarClassLibrary;
48 int IsValid(){
return fVtx!=0;}
55 const StTrack *GetTrack(
int idx);
56 const StTrack *GetParent() {
return GetTrack(-1);}
72 int GetCharge()
const;
74 float GetImpact()
const;
75 float GetCurv()
const;
76 int numberOfFitPoints(
int detid=0)
const;
80 float GetPsi()
const {
return GetMom().phi();}
81 float GetDip()
const {
return atan2(GetMom().z(),GetMom().perp());}
84 const StHit *GetHit(
int idx)
const;
85 const StPtrVecHit *GetHits()
const;
86 StMCTruth GetTruth(
int byCount=0,
double rXYMin=0.,
double rXYMax=1000.)
const;
91 mutable const StPtrVecHit *fHits;
123 void Print(
const char* option=
"")
const;
124 int GetNTot() {
return fNTot;}
125 int GetNErr() {
return fNErr ;}
126 static TString Say(
int errn,
const char *klas=
"StTrack");
145 enum EHKind {kUDF = 0
146 ,kVTX = BIT( 1),kTRK = BIT( 2),kHIT = BIT( 3),kHRR = BIT( 4)
147 ,kPRM = BIT( 5),kKNK = BIT( 6),kV0 = BIT( 7),kXI = BIT( 8)
148 ,kTGB = BIT(10),kTPR = BIT(11),kTPT = BIT(12),kTSY = BIT(13)
149 ,kEGB = BIT(14),kEPR = BIT(15)
150 ,kUSE = BIT(20),kUNU = BIT(21),kFIT = BIT(22),kTHT = BIT(23)
154 extern const char *EHKindN[];
155 extern const int EHKindS[];
157 #ifdef __EVENTHELPER_ONLY__
158 const char *EHKindN[] = {
"undefined"
159 ,
"Vertex" ,
"Tracks" ,
"Hits" ,
"HitArr"
160 ,
"Primary" ,
"Kink" ,
"V0" ,
"Xi"
161 ,
"Global" ,
"PRIMARY" ,
"Tpt" ,
"SECONDARY"
162 ,
"estGlobal",
"estPrimary"
163 ,
"Used" ,
"Unused" ,
"Fitted",
"Track Hits"
165 const int EHKindS[]= {kUDF
185 TObjArray *SelConts (
const char *sel=
".*");
186 TObjArray *SelTracks(
const char *sel=0, Int_t th=0);
187 TObjArray *SelHits (
const char *RegEx, Int_t un=0,Int_t flag=0);
188 TObjArray *SelVertex(
const char *sel, Int_t th=0);
189 TObjArray *ExpandAndFilter(
const TObject *evobjs,
int flag,TObjArray *out=0);
190 TObjArray *MakePoints ( TObjArray *evobjs,
int flag);
191 virtual void ls(Option_t* option=
"")
const;
192 virtual void Clear(Option_t *opt=
"");
193 void Reset(
const TObject *evt=0,
const char *opt=
"");
194 static int Kind(
const TObject *to);
195 static void Remove(
StEvent *ev,
const char *className);
196 static void Break(
int kase);
205 StPoints3DABC(
const char *name=
"",
const char *title=
"",
const TObject *obj=0)
208 if (obj && (!name || !name[0])) {
209 sprintf(buf,
"%s(%p)",obj->GetName(),(
void*)obj);name = buf;}
210 fName=name;fTitle=title;fObj = obj;}
214 virtual const char *GetName ()
const {
return fName.Data();}
215 virtual const char *GetTitle()
const {
return fTitle.Data();}
216 virtual Float_t GetX(Int_t idx)
const {
return fXYZ[idx*3+0];}
217 virtual Float_t GetY(Int_t idx)
const {
return fXYZ[idx*3+1];}
218 virtual Float_t GetZ(Int_t idx)
const {
return fXYZ[idx*3+2];}
219 virtual Int_t Size()
const {
return fSize;}
220 virtual Int_t Kind()
const {
return 0;}
221 virtual const TObject *GetObject()
const {
return fObj;}
223 Int_t Add(
float x,
float y,
float z){
return TPoints3DABC::Add(x,y,z);}
225 virtual Int_t DistancetoPrimitive(Int_t, Int_t ){
return -1;}
226 virtual Int_t GetLastPosition()
const {
return 0;}
227 virtual Option_t* GetOption()
const{
return 0;}
228 virtual const Float_t* GetXYZ(Int_t idx) {
return fXYZ+3*idx;}
229 virtual Float_t *GetXYZ(Float_t *xyz,Int_t idx,Int_t num=1)
const
230 {
return TPoints3DABC::GetXYZ(xyz,idx,num);}
231 virtual void PaintPoints(Int_t , Float_t* , Option_t* ){}
232 virtual Int_t SetLastPosition(Int_t ){
return 0;}
233 virtual Int_t SetNextPoint(Float_t , Float_t , Float_t ){
return 0;}
234 virtual void SetOption(Option_t* ){}
235 virtual Int_t SetPoints(Int_t , Float_t * ,
const Option_t * ){
return 0;}
236 virtual Int_t SetPoint(Int_t , Float_t , Float_t , Float_t ){
return 0;}
258 virtual Int_t Kind()
const {
return 2;}
259 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
277 virtual Int_t Kind()
const {
return 1;}
291 virtual Int_t Kind()
const {
return 4+fInnOut;}
309 virtual Int_t Kind()
const {
return 3;}
324 virtual float *GetPars()
const = 0;
325 virtual const float *GetDefs()
const = 0;
326 virtual const char **GetNams()
const = 0;
327 bool *GetActive() {
return &fActive;}
329 bool Active()
const {
return fActive;}
330 void SetActive(
bool active){fActive = active;}
331 virtual Int_t Accept(
StPoints3DABC *pnt, Color_t&, Size_t&, Style_t&)=0;
345 virtual float *GetPars()
const {
return (
float*)(&fFirst+1);}
346 virtual const float *GetDefs()
const;
347 virtual const char **GetNams()
const;
348 Int_t Accept(
StPoints3DABC *pnt, Color_t&, Size_t&, Style_t&);
369 float fEncodedMethod;
380 virtual float *GetPars()
const {
return (
float*)(&fFirst+1);}
381 virtual const float *GetDefs()
const;
382 virtual const char **GetNams()
const;
383 Int_t Accept(
StPoints3DABC *pnt, Color_t&, Size_t&, Style_t&)
384 {
return Accept(pnt); }
400 float fnHitsCutHighP;
405 float fchargeForLowP;
406 float fdEdxMassCutHigh;
407 float fdEdxFractionCutHigh;
408 float fdEdxMassCutLow;
409 float fdEdxFractionCutLow;
429 virtual float *GetPars()
const {
return (
float*)(&fFirst+1);}
430 virtual const float *GetDefs()
const;
431 virtual const char **GetNams()
const;
434 virtual Int_t Accept(
StPoints3DABC *pnt, Color_t&, Size_t&, Style_t&);
435 Int_t Accept(
const StTrack *
track, Color_t&, Size_t&, Style_t&);
451 float fNSigmaElectron ;
452 float fNColorElectron ;
457 float fNSigmaProton ;
458 float fNColorProton ;
474 #endif //ROOT_StEventHelper
const float * GetErrMtx()