Line data Source code
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 : #include <AliTimeStamp.h>
18 :
19 : class TGeoHMatrix;
20 : class AliESDVertex;
21 :
22 : class AliESDRun: public TObject {
23 : public:
24 :
25 : enum StatusBits {kBInfoStored = BIT(14), kUniformBMap = BIT(15), kConvSqrtSHalfGeV = BIT(16)};
26 :
27 :
28 : AliESDRun();
29 : AliESDRun(const AliESDRun& esd);
30 : AliESDRun& operator=(const AliESDRun& esd);
31 : virtual void Copy(TObject &obj) const; // Interface for using TOBject::Copy()
32 : virtual ~AliESDRun();
33 :
34 : Bool_t InitMagneticField() const;
35 278 : Int_t GetRunNumber() const {return fRunNumber;}
36 32 : void SetRunNumber(Int_t n) {fRunNumber=n;}
37 32 : void SetMagneticField(Float_t mf){fMagneticField = mf;}
38 7246 : Double_t GetMagneticField() const {return fMagneticField;}
39 48 : UInt_t GetPeriodNumber() const {return fPeriodNumber;}
40 16 : void SetPeriodNumber(Int_t n) {fPeriodNumber=n;}
41 : void Reset();
42 : void Print(const Option_t *opt=0) const;
43 : void SetDiamond(const AliESDVertex *vertex);
44 : void SetTriggerClass(const char*name, Int_t index);
45 32 : void SetCurrentL3(Float_t cur) {fCurrentL3 = cur;}
46 32 : void SetCurrentDip(Float_t cur) {fCurrentDip = cur;}
47 32 : void SetBeamEnergy(Float_t be) {fBeamEnergy = be;}
48 32 : void SetBeamType(const char* bt) {fBeamType = bt;}
49 16 : void SetBeamEnergyIsSqrtSHalfGeV(Bool_t v=kTRUE) {SetBit(kConvSqrtSHalfGeV,v);}
50 32 : void SetDetectorsInDAQ(UInt_t detmask) { fDetInDAQ = detmask; }
51 32 : void SetDetectorsInReco(UInt_t detmask) { fDetInReco = detmask; }
52 64 : void SetCTPStart(const AliTimeStamp* t) { if (t) fCTPStart = *t;}
53 0 : Bool_t IsBeamEnergyIsSqrtSHalfGeV() const {return TestBit(kConvSqrtSHalfGeV);}
54 16 : Double_t GetDiamondX() const {return fDiamondXY[0];}
55 16 : Double_t GetDiamondY() const {return fDiamondXY[1];}
56 16 : Double_t GetDiamondZ() const {return fDiamondZ;}
57 0 : Double_t GetSigma2DiamondX() const {return fDiamondCovXY[0];}
58 0 : Double_t GetSigma2DiamondY() const {return fDiamondCovXY[2];}
59 32 : Double_t GetSigma2DiamondZ() const {return fDiamondSig2Z;}
60 : void GetDiamondCovXY(Float_t cov[3]) const {
61 80 : for(Int_t i=0;i<3;i++) cov[i]=fDiamondCovXY[i]; return;
62 : }
63 : const char* GetTriggerClass(Int_t index) const;
64 : TString GetActiveTriggerClasses() const;
65 : TString GetFiredTriggerClasses(ULong64_t mask) const;
66 : TString GetFiredTriggerClassesNext50(ULong64_t mask) const;
67 : TString GetFiredTriggerClasses(ULong64_t mask,ULong64_t mask2) const;
68 : void PrintAllTriggerClasses() const;
69 : Bool_t IsTriggerClassFired(ULong64_t mask, const char *name) const;
70 : Bool_t IsTriggerClassFiredNext50(ULong64_t mask, const char *name) const;
71 : Bool_t IsTriggerClassFired(ULong64_t mask, ULong64_t mask2,const char *name) const;
72 0 : Float_t GetCurrentL3() const {return fCurrentL3;}
73 16 : Float_t GetCurrentDip() const {return fCurrentDip;}
74 0 : Float_t GetBeamEnergy() const {return IsBeamEnergyIsSqrtSHalfGeV() ? fBeamEnergy : fBeamEnergy/2;}
75 0 : const char* GetBeamType() const {return (fBeamType=="Pb-Pb") ? "A-A":fBeamType.Data();}
76 64 : void SetBeamParticle(Int_t az, Int_t ibeam) {fBeamParticle[ibeam] = az;}
77 0 : Int_t GetBeamParticle(Int_t ibeam) const {return fBeamParticle[ibeam];}
78 0 : Int_t GetBeamParticleA(Int_t ibeam) const {return fBeamParticle[ibeam]/1000;}
79 0 : Int_t GetBeamParticleZ(Int_t ibeam) const {return fBeamParticle[ibeam]%1000;}
80 :
81 20 : UInt_t GetDetectorsInDAQ() const {return fDetInDAQ; }
82 20 : UInt_t GetDetectorsInReco() const {return fDetInReco; }
83 0 : const AliTimeStamp& GetCTPStart() const {return fCTPStart;}
84 :
85 : void SetPHOSMatrix(TGeoHMatrix*matrix, Int_t i) {
86 30 : if ((i >= 0) && (i < kNPHOSMatrix)) fPHOSMatrix[i] = matrix;
87 10 : }
88 : const TGeoHMatrix* GetPHOSMatrix(Int_t i) const {
89 64 : return ((i >= 0) && (i < kNPHOSMatrix)) ? fPHOSMatrix[i] : NULL;
90 : }
91 :
92 : void SetEMCALMatrix(TGeoHMatrix*matrix, Int_t i) {
93 90 : if ((i >= 0) && (i < kNEMCALMatrix)) fEMCALMatrix[i] = matrix;
94 30 : }
95 : const TGeoHMatrix* GetEMCALMatrix(Int_t i) const {
96 144 : return ((i >= 0) && (i < kNEMCALMatrix)) ? fEMCALMatrix[i] : NULL;
97 : }
98 :
99 : enum {kNTriggerClasses = 100};
100 : enum {kNPHOSMatrix = 5};
101 : enum {kNEMCALMatrix = 22};
102 : enum {kT0spreadSize = 4};
103 : //
104 : Double_t GetMeanIntensity(int beam,int btp) const
105 0 : { return (beam>=0&&beam<2&&btp>=0&&btp<2) ? fMeanBeamInt[beam][btp]:0;}
106 : void SetMeanIntensity(int beam,int btp, double v=-1)
107 256 : { if (beam>=0&&beam<2&&btp>=0&&btp<2) fMeanBeamInt[beam][btp]=v;}
108 0 : Double_t GetMeanIntensityIntecting(int beam) const {return GetMeanIntensity(beam,0);}
109 0 : Double_t GetMeanIntensityNonIntecting(int beam) const {return GetMeanIntensity(beam,1);}
110 : //
111 : Float_t GetT0spread(Int_t i) const {
112 128 : return ((i >= 0) && (i<kT0spreadSize)) ? fT0spread[i] : 0;}
113 : void SetT0spread(Int_t i, Float_t t);
114 : void SetT0spread(Float_t *t);
115 :
116 0 : void SetCaloTriggerType(const Int_t* in) {for (int i = 0; i < 15; i++) fCaloTriggerType[i] = in[i];}
117 : void SetCaloTriggerType(int i, const Int_t* in) {
118 0 : if (i) {for (int i = 0; i < 19; i++) fCaloTriggerTypeNew[i] = in[i];}
119 0 : else {for (int i = 0; i < 15; i++) fCaloTriggerType[i] = in[i];}
120 0 : }
121 :
122 4 : Int_t* GetCaloTriggerType() {return fCaloTriggerType;}
123 0 : Int_t* GetCaloTriggerType(int i) {return ((i)?fCaloTriggerTypeNew:fCaloTriggerType);}
124 :
125 1056 : void SetVZEROEqFactors(Float_t factors[64]) {for (Int_t i = 0; i < 64; ++i) fVZEROEqFactors[i] = factors[i];}
126 16 : const Float_t* GetVZEROEqFactors() const {return fVZEROEqFactors;}
127 0 : Float_t GetVZEROEqFactors(Int_t i) const {return fVZEROEqFactors[i];}
128 :
129 : private:
130 : Float_t fCurrentL3; // signed current in the L3 (LHC convention: +current -> +Bz)
131 : Float_t fCurrentDip; // signed current in the Dipole (LHC convention: +current -> -Bx)
132 : Float_t fBeamEnergy; // beamEnergy entry from GRP
133 : Double32_t fMagneticField; // Solenoid Magnetic Field in kG : for compatibility with AliMagF
134 : Double32_t fMeanBeamInt[2][2]; // mean intensity of interacting and non-intercting bunches per beam
135 : Double32_t fDiamondXY[2]; // Interaction diamond (x,y) in RUN
136 : Double32_t fDiamondCovXY[3]; // Interaction diamond covariance (x,y) in RUN
137 : Double32_t fDiamondZ; // Interaction diamond (z) in RUN
138 : Double32_t fDiamondSig2Z; // Interaction diamond sigma^2 (z) in RUN
139 : UInt_t fPeriodNumber; // PeriodNumber
140 : Int_t fRunNumber; // Run Number
141 : Int_t fRecoVersion; // Version of reconstruction
142 : Int_t fBeamParticle[2]; // A*1000+Z for each beam particle
143 : TString fBeamType; // beam type from GRP
144 : TObjArray fTriggerClasses; // array of TNamed containing the names of the active trigger classes
145 : UInt_t fDetInDAQ; // Detector mask for detectors in datataking
146 : UInt_t fDetInReco; // Detector mask for detectors in reconstruction
147 : TGeoHMatrix* fPHOSMatrix[kNPHOSMatrix]; //PHOS module position and orientation matrices
148 : TGeoHMatrix* fEMCALMatrix[kNEMCALMatrix]; //EMCAL supermodule position and orientation matrices
149 : Float_t fT0spread[kT0spreadSize]; // spread of time distributions on T0A, T0C, (T0A+T0C)/2, (T0A-T0C)/2
150 : Int_t fCaloTriggerType[15]; // Calorimeter trigger type
151 : Float_t fVZEROEqFactors[64]; // V0 channel equalization factors for event-plane reconstruction
152 : Int_t fCaloTriggerTypeNew[19]; // Calorimeter trigger type
153 : AliTimeStamp fCTPStart; // CTP start time stamp, to allow extraction of event trigger time
154 :
155 1540 : ClassDef(AliESDRun,17)
156 : };
157 :
158 : #endif
|