]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/ESD/AliESDRun.h
Moving the classes that belong to the following libraries: STEERBase, ESD, CDB, AOD...
[u/mrichter/AliRoot.git] / STEER / ESD / AliESDRun.h
1 // -*- mode: C++ -*- 
2 #ifndef ALIESDRUN_H
3 #define ALIESDRUN_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 //-------------------------------------------------------------------------
8 //                     Implementation Class AliESDRun
9 //   Run by run data
10 //   for the ESD   
11 //   Origin: Christian Klein-Boesing, CERN, Christian.Klein-Boesing@cern.ch 
12 //-------------------------------------------------------------------------
13
14 #include <TObject.h>
15 #include <TObjArray.h>
16 #include <TString.h>
17
18 class TGeoHMatrix;
19 class AliESDVertex;
20
21 class AliESDRun: public TObject {
22 public:
23
24   enum StatusBits {kBInfoStored = BIT(14), kUniformBMap = BIT(15), kConvSqrtSHalfGeV = BIT(16)};
25
26
27   AliESDRun();
28   AliESDRun(const AliESDRun& esd);
29   AliESDRun& operator=(const AliESDRun& esd);
30   virtual void Copy(TObject &obj) const; // Interface for using TOBject::Copy()
31   virtual ~AliESDRun();
32
33   Bool_t  InitMagneticField() const;
34   Int_t   GetRunNumber() const {return fRunNumber;}
35   void    SetRunNumber(Int_t n) {fRunNumber=n;}
36   void    SetMagneticField(Float_t mf){fMagneticField = mf;}
37   Double_t GetMagneticField() const {return fMagneticField;}
38   UInt_t   GetPeriodNumber() const {return fPeriodNumber;}
39   void    SetPeriodNumber(Int_t n) {fPeriodNumber=n;}
40   void    Reset();
41   void    Print(const Option_t *opt=0) const;
42   void    SetDiamond(const AliESDVertex *vertex);
43   void    SetTriggerClass(const char*name, Int_t index);
44   void    SetCurrentL3(Float_t cur)    {fCurrentL3 = cur;}
45   void    SetCurrentDip(Float_t cur)   {fCurrentDip = cur;}
46   void    SetBeamEnergy(Float_t be)    {fBeamEnergy = be;}
47   void    SetBeamType(const char* bt)  {fBeamType = bt;}
48   void    SetBeamEnergyIsSqrtSHalfGeV(Bool_t v=kTRUE) {SetBit(kConvSqrtSHalfGeV,v);}
49   void    SetDetectorsInDAQ(UInt_t detmask) { fDetInDAQ = detmask; }
50   void    SetDetectorsInReco(UInt_t detmask) { fDetInReco = detmask; }
51
52   Bool_t  IsBeamEnergyIsSqrtSHalfGeV() const {return TestBit(kConvSqrtSHalfGeV);}  
53   Double_t GetDiamondX() const {return fDiamondXY[0];}
54   Double_t GetDiamondY() const {return fDiamondXY[1];}
55   Double_t GetDiamondZ() const {return fDiamondZ;}
56   Double_t GetSigma2DiamondX() const {return fDiamondCovXY[0];}
57   Double_t GetSigma2DiamondY() const {return fDiamondCovXY[2];}
58   Double_t GetSigma2DiamondZ() const {return fDiamondSig2Z;}
59   void GetDiamondCovXY(Float_t cov[3]) const {
60     for(Int_t i=0;i<3;i++) cov[i]=fDiamondCovXY[i]; return;
61   }
62   const char* GetTriggerClass(Int_t index) const;
63   TString     GetActiveTriggerClasses() const;
64   TString     GetFiredTriggerClasses(ULong64_t mask) const;
65   Bool_t      IsTriggerClassFired(ULong64_t mask, const char *name) const;
66   Float_t     GetCurrentL3()               const {return fCurrentL3;}
67   Float_t     GetCurrentDip()              const {return fCurrentDip;}
68   Float_t     GetBeamEnergy()              const {return IsBeamEnergyIsSqrtSHalfGeV() ? fBeamEnergy : fBeamEnergy/2;}
69   const char* GetBeamType()                const {return fBeamType.Data();}
70   UInt_t      GetDetectorsInDAQ()         const {return fDetInDAQ; }
71   UInt_t      GetDetectorsInReco()         const {return fDetInReco; }
72  
73   void    SetPHOSMatrix(TGeoHMatrix*matrix, Int_t i) {
74     if ((i >= 0) && (i < kNPHOSMatrix)) fPHOSMatrix[i] = matrix;
75   }
76   const TGeoHMatrix* GetPHOSMatrix(Int_t i) const {
77     return ((i >= 0) && (i < kNPHOSMatrix)) ? fPHOSMatrix[i] : NULL;
78   }
79         
80   void    SetEMCALMatrix(TGeoHMatrix*matrix, Int_t i) {
81         if ((i >= 0) && (i < kNEMCALMatrix)) fEMCALMatrix[i] = matrix;
82   }
83   const TGeoHMatrix* GetEMCALMatrix(Int_t i) const {
84         return ((i >= 0) && (i < kNEMCALMatrix)) ? fEMCALMatrix[i] : NULL;
85   }
86         
87   enum {kNTriggerClasses = 50};
88   enum {kNPHOSMatrix = 5};
89   enum {kNEMCALMatrix = 12};
90   enum {kT0spreadSize = 4};
91   //
92   Double_t   GetMeanIntensity(int beam,int btp)     const 
93   { return (beam>=0&&beam<2&&btp>=0&&btp<2) ? fMeanBeamInt[beam][btp]:0;}
94   void       SetMeanIntensity(int beam,int btp, double v=-1) 
95   { if (beam>=0&&beam<2&&btp>=0&&btp<2) fMeanBeamInt[beam][btp]=v;}  
96   Double_t   GetMeanIntensityIntecting(int beam)    const {return GetMeanIntensity(beam,0);}
97   Double_t   GetMeanIntensityNonIntecting(int beam) const {return GetMeanIntensity(beam,1);}
98   // 
99   Float_t    GetT0spread(Int_t i) const {
100     return ((i >= 0)  && (i<kT0spreadSize)) ? fT0spread[i] : 0;}
101   void       SetT0spread(Int_t i, Float_t t);
102   void       SetT0spread(Float_t *t);
103         
104   void       SetCaloTriggerType(const Int_t* in) {for (int i = 0; i < 8; i++) fCaloTriggerType[i] = in[i];}
105   Int_t*     GetCaloTriggerType() {return fCaloTriggerType;}
106
107 private:
108   Float_t         fCurrentL3;       // signed current in the L3     (LHC convention: +current -> +Bz)
109   Float_t         fCurrentDip;      // signed current in the Dipole (LHC convention: +current -> -Bx)
110   Float_t         fBeamEnergy;      // beamEnergy entry from GRP
111   Double32_t      fMagneticField;   // Solenoid Magnetic Field in kG : for compatibility with AliMagF
112   Double32_t      fMeanBeamInt[2][2]; // mean intensity of interacting and non-intercting bunches per beam
113   Double32_t      fDiamondXY[2];    // Interaction diamond (x,y) in RUN
114   Double32_t      fDiamondCovXY[3]; // Interaction diamond covariance (x,y) in RUN
115   Double32_t      fDiamondZ;        // Interaction diamond (z) in RUN
116   Double32_t      fDiamondSig2Z;    // Interaction diamond sigma^2 (z) in RUN
117   UInt_t          fPeriodNumber;    // PeriodNumber
118   Int_t           fRunNumber;       // Run Number
119   Int_t           fRecoVersion;     // Version of reconstruction
120   TString         fBeamType;        // beam type from GRP
121   TObjArray       fTriggerClasses;  // array of TNamed containing the names of the active trigger classes
122   UInt_t          fDetInDAQ;        // Detector mask for detectors in datataking
123   UInt_t          fDetInReco;       // Detector mask for detectors in reconstruction
124   TGeoHMatrix*    fPHOSMatrix[kNPHOSMatrix]; //PHOS module position and orientation matrices
125   TGeoHMatrix*    fEMCALMatrix[kNEMCALMatrix]; //EMCAL supermodule position and orientation matrices
126   Float_t         fT0spread[kT0spreadSize];     // spread of time distributions on T0A, T0C, (T0A+T0C)/2, (T0A-T0C)/2
127   Int_t           fCaloTriggerType[8]; // Calorimeter trigger type
128         
129   ClassDef(AliESDRun,11)
130 };
131
132 #endif