StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTpcHitErrors.h
1 #ifndef StTpcHitErrors_h
2 #define StTpcHitErrors_h
3 #include "TMDFParameters.h"
4 
5 class StTpcHitErrors : public TObject {
6  public:
7  static StTpcHitErrors* instance();
8  // virtual void calculateError(Double_t _z, Double_t _eta, Double_t _tanl, Double_t x,Double_t &ecross, Double_t &edip) const;
9  StTpcHitErrors(Int_t nXZ = 2, Int_t Sec = 2, Int_t Row = 2, Int_t MS = 2, Int_t Prompt = 2) :
10  fXZ(nXZ), fSec(Sec), fRow(Row), fMS(MS), fPrompt(Prompt),
11  fNxz(fXZ*fSec*fRow*fMS*fPrompt), fMDFXZ(fNxz) {
12  fgInstance = this; fMDFXZ.SetOwner(kTRUE);
13  }
14  virtual ~StTpcHitErrors() {fgInstance = 0;}
15  Int_t Index(Int_t iXZ, Int_t sec, Int_t row, Int_t ms, Int_t prompt) {
16  Int_t indx = prompt + fPrompt*(ms + fMS*(row + fRow*(sec + fSec*iXZ)));
17  return indx;
18  }
19  TMDFParameters *Get(Int_t iXZ, Int_t sec, Int_t row, Int_t ms, Int_t prompt) {
20  Int_t indx = Index(iXZ,sec,row,ms,prompt);
21  TMDFParameters::SetCurrent((TMDFParameters *) fMDFXZ[indx]);
22  return (TMDFParameters *) fMDFXZ[indx];
23  }
24  TMDFParameters *GetMu (Int_t iXZ, Int_t sec, Int_t row, Int_t prompt) {return Get(iXZ,sec,row,0,prompt);}
25  TMDFParameters *GetSigmaSQ(Int_t iXZ, Int_t sec, Int_t row, Int_t prompt) {return Get(iXZ,sec,row,1,prompt);}
26  Double_t calcError(Int_t iXZ, Int_t sec, Int_t row, Double_t _z, Double_t _eta, Double_t _tanl, Int_t Npads, Int_t Ntmbks, Double_t AdcL, Double_t xPad);
27  void Set(Int_t iXZ, Int_t sec, Int_t row, Int_t ms, Int_t prompt, TMDFParameters *mdfX) {fMDFXZ.AddAtAndExpand(mdfX,Index(iXZ,sec,row,ms,prompt));}
28  private:
29  Int_t fXZ; // in X or Z
30  Int_t fSec; // for West and East
31  Int_t fRow; // for Inner and Outer
32  Int_t fMS; // = 0 for mean, = 1 for log(sigma)
33  Int_t fPrompt; // = 0 for drift, = 1 for prompt
34  Int_t fNxz;
35  TObjArray fMDFXZ;
36  static StTpcHitErrors* fgInstance;
37  ClassDef(StTpcHitErrors,1) //
38 };
39 #endif