]>
Commit | Line | Data |
---|---|---|
799c6677 | 1 | #ifndef ALILHCDATA_H\r |
2 | #define ALILHCDATA_H\r | |
3 | \r | |
4 | /********************************************************************************\r | |
5 | * *\r | |
6 | * AliLHCData: summary of the LHC related information from LHC DIP. *\r | |
7 | * Created from the TMap provided by the AliLHCReader with optional beginning *\r | |
8 | * *\r | |
9 | * The data are (wrapped in the AliLHCDipValT): *\r | |
10 | * made of TimeStamp (double) and array of values *\r | |
11 | * *\r | |
12 | * Multiple entries for each type of data are possible. To obtaine number of *\r | |
13 | * records (with distinct timestamp) for give type od records use: *\r | |
14 | * int GetNBunchConfigMeasured(int beam) (with beam=0,1) etc. *\r | |
15 | * *\r | |
16 | * To get i-th entry, use brec= AliLHCDipValI* GetBunchConfigMeasured(bm,i); *\r | |
17 | * Note: exact type of templated AliLHCDipValT pointer depends on the record *\r | |
18 | * type, concult getters to know it. *\r | |
19 | * *\r | |
20 | * Then, once the pointer is obtained, details can be accessed: *\r | |
21 | * int nBunches = brec->GetSize(); *\r | |
22 | * for (int i=0;i<nBunches;i++) printf("Bunch#%d: %d\n",i,(*brec)[i]); *\r | |
23 | * *\r | |
24 | * ATTENTION: Bunch RFBucked is NEGATIVE for bunches interacting at IR2 *\r | |
25 | * *\r | |
26 | * *\r | |
27 | * *\r | |
28 | * Author: ruben.shahoyan@cern.ch *\r | |
29 | * *\r | |
30 | ********************************************************************************/\r | |
31 | \r | |
32 | #include "AliLHCDipValT.h"\r | |
33 | #include "TObject.h"\r | |
34 | class TObjArray;\r | |
35 | //class AliLHCDipValT;\r | |
36 | \r | |
37 | class AliDCSArray;\r | |
38 | class TString;\r | |
39 | class TMap;\r | |
bab62329 | 40 | class AliLHCReader;\r |
46d3b556 | 41 | class TGraph;\r |
799c6677 | 42 | \r |
43 | class AliLHCData : public TObject\r | |
44 | {\r | |
45 | public:\r | |
46 | enum {kStart,kNStor};\r | |
47 | enum BeamID_t {kBeam1,kBeam2};\r | |
48 | enum Proj_t {kX,kY};\r | |
49 | enum Side_t {kLeft,kRight};\r | |
50 | enum Collim_t {kTCTVB4L2, kTCTVB4R2, kTCLIA4R2, kNCollimators};\r | |
51 | enum ColJaw_t {kGapDn,kGapUp,kLeftDn,kLeftUp,kRightDn,kRightUp,kNJaws};\r | |
2af04ffd | 52 | enum {kMaxBSlots = 3564, kOffsBeam1=346, kOffsBeam2 = 3019};\r |
0e9ab7ce | 53 | enum {kMarginSOR = 60*60*24*30, // use margin of 30 days for SOR, when looking for the 1st record\r |
54 | kMarginEOR = 60*15}; // use margin of 15 min for EOR, when looking for the last record\r | |
799c6677 | 55 | //\r |
56 | enum {kIntTot,kIntTotAv,kIntBunchAv,\r | |
57 | kLumAcqMode,kLumTot,kLumTotErr,kLumBunch,kLumBunchErr,kLumCrossAng,kLumCrossAngErr,\r | |
58 | kBunchConf,kFillNum,kBunchLgtNB,kBunchLgt,kBunchLgtFillB,\r | |
59 | kRCInjSch,kRCBeta,kRCCrossAng,kRCVang,\r | |
60 | kBeamSzAcqMode,kBeamSzSigH,kBeamSzSigV,kBeamSzEmittH,kBeamSzEmittV,kBeamSzSigHErr,kBeamSzSigVErr,\r | |
46d3b556 | 61 | kCollPos,kLumiAlice,kBckgAlice\r |
62 | ,kNRecordTypes};\r | |
799c6677 | 63 | //\r |
64 | //le\r | |
65 | public:\r | |
66 | //\r | |
339fbe23 | 67 | AliLHCData() : fTMin(0),fTMax(1e10),fFillNumber(0),fData(0),fkFile2Process(0),fkMap2Process(0) {Clear();}\r |
0e9ab7ce | 68 | AliLHCData(const TMap* dcsMap, double tmin=0, double tmax=1.e10);\r |
69 | AliLHCData(const Char_t* dcsFile, double tmin=0, double tmax=1.e10);\r | |
799c6677 | 70 | virtual ~AliLHCData() {}\r |
71 | //\r | |
bab62329 | 72 | Bool_t FillData(const TMap* dcsMap, double tmin=0, double tmax=1.e20);\r |
73 | Bool_t FillData(const Char_t* dcsFile, double tmin=0, double tmax=1.e20);\r | |
799c6677 | 74 | Double_t GetTMin() const {return fTMin;}\r |
75 | Double_t GetTMax() const {return fTMax;}\r | |
76 | Int_t GetFillNumber() const {return fFillNumber;}\r | |
77 | void SetFillNumber(Int_t fill) {fFillNumber = fill;}\r | |
78 | void SetTMin(Double_t t) {fTMin = t<0?0:(t>1e10?1e10:t);}\r | |
79 | void SetTMax(Double_t t) {fTMax = t<0?0:(t>1e10?1e10:t);}\r | |
41ff94a3 | 80 | //\r |
799c6677 | 81 | virtual void Print(const Option_t *opt="") const;\r |
46d3b556 | 82 | TGraph* ExportGraph(Int_t *coord, Int_t elID=0) const;\r |
799c6677 | 83 | //\r |
84 | Int_t GetNBunchConfigMeasured(int bm) const {return GoodPairID(bm)?fBunchConfMeas[bm][kNStor]:-1;}\r | |
85 | Int_t GetNBunchConfigDeclared(int bm) const {return GoodPairID(bm)?fBunchConfDecl[bm][kNStor]:-1;}\r | |
86 | Int_t GetNBunchLengths(int bm) const {return GoodPairID(bm)?fBunchLengths[bm][kNStor]:-1;}\r | |
87 | Int_t GetNTotalIntensity(int bm) const {return GoodPairID(bm)?fIntensTotal[bm][kNStor]:-1;}\r | |
88 | Int_t GetNTotalIntensityAv(int bm) const {return GoodPairID(bm)?fIntensTotalAv[bm][kNStor]:-1;}\r | |
89 | Int_t GetNIntensityPerBunch(int bm) const {return GoodPairID(bm)?fIntensPerBunch[bm][kNStor]:-1;}\r | |
90 | Int_t GetNEmittanceH(int bm) const {return GoodPairID(bm)?fEmittanceH[bm][kNStor]:-1;}\r | |
91 | Int_t GetNEmittanceV(int bm) const {return GoodPairID(bm)?fEmittanceV[bm][kNStor]:-1;}\r | |
92 | Int_t GetNBeamSigmaH(int bm) const {return GoodPairID(bm)?fBeamSigmaH[bm][kNStor]:-1;}\r | |
93 | Int_t GetNBeamSigmaV(int bm) const {return GoodPairID(bm)?fBeamSigmaV[bm][kNStor]:-1;}\r | |
94 | //\r | |
95 | Int_t GetNLuminosityTotal(int lr) const {return GoodPairID(lr)?fLuminTotal[lr][kNStor]:-1;}\r | |
96 | Int_t GetNLuminosityPerBunch(int lr) const {return GoodPairID(lr)?fLuminPerBC[lr][kNStor]:-1;}\r | |
97 | Int_t GetNLuminosityAcqMode(int lr) const {return GoodPairID(lr)?fLuminAcqMode[lr][kNStor]:-1;}\r | |
98 | Int_t GetNCrossingAngle(int lr) const {return GoodPairID(lr)?fCrossAngle[lr][kNStor]:-1;}\r | |
99 | //\r | |
100 | Int_t GetNInjectionScheme() const {return fRCInjScheme[kNStor];}\r | |
101 | Int_t GetNRCBetaStar() const {return fRCBeta[kNStor];}\r | |
102 | Int_t GetNRCAngleH() const {return fRCAngH[kNStor];}\r | |
103 | Int_t GetNRCAngleV() const {return fRCAngV[kNStor];}\r | |
104 | //\r | |
46d3b556 | 105 | Int_t GetNLumiAlice() const {return fLumiAlice[kNStor];}\r |
106 | Int_t GetNBckgAlice() const {return fBckgAlice[kNStor];}\r | |
107 | //\r | |
799c6677 | 108 | Int_t GetNCollimatorJawPos(int coll,int jaw) const;\r |
109 | //\r | |
110 | AliLHCDipValI* GetBunchConfigMeasured(int bm, int i=0) const;\r | |
a1063d3a | 111 | AliLHCDipValF* GetBunchLengths(int bm, int i=0) const;\r |
799c6677 | 112 | AliLHCDipValI* GetBunchConfigDeclared(int bm, int i=0) const;\r |
a1063d3a | 113 | AliLHCDipValF* GetTotalIntensity(int bm, int i=0) const;\r |
114 | AliLHCDipValF* GetTotalIntensityAv(int bm, int i=0) const;\r | |
115 | AliLHCDipValF* GetIntensityPerBunch(int bm, int i=0) const;\r | |
116 | AliLHCDipValF* GetEmittanceH(int bm, int i=0) const;\r | |
117 | AliLHCDipValF* GetEmittanceV(int bm, int i=0) const;\r | |
118 | AliLHCDipValF* GetBeamSigmaH(int bm, int i=0) const;\r | |
119 | AliLHCDipValF* GetBeamSigmaV(int bm, int i=0) const;\r | |
120 | AliLHCDipValF* GetLuminosityTotal(int lr, int i=0) const;\r | |
121 | AliLHCDipValF* GetLuminosityPerBunch(int lr, int i=0) const;\r | |
799c6677 | 122 | AliLHCDipValI* GetLuminosityAcqMode(int lr, int i=0) const;\r |
a1063d3a | 123 | AliLHCDipValF* GetCrossAngle(int lr, int i=0) const;\r |
799c6677 | 124 | AliLHCDipValC* GetInjectionScheme(int i=0) const;\r |
a1063d3a | 125 | AliLHCDipValF* GetRCBetaStar(int i=0) const;\r |
126 | AliLHCDipValF* GetRCAngleH(int i=0) const; \r | |
127 | AliLHCDipValF* GetRCAngleV(int i=0) const; \r | |
128 | AliLHCDipValF* GetCollimJawPos(int coll, int jaw, int i=0) const;\r | |
799c6677 | 129 | //\r |
46d3b556 | 130 | AliLHCDipValF* GetLumiAliceRecord(int i=0) const; \r |
131 | AliLHCDipValF* GetBckgAliceRecord(int i=0) const; \r | |
132 | //\r | |
133 | Float_t GetLumiAlice(Double_t tstamp) const;\r | |
134 | Float_t GetBckgAlice(Double_t tstamp) const;\r | |
135 | //\r | |
136 | Float_t GetLumiInstAlice(Double_t tstamp) const;\r | |
137 | Float_t GetBckgInstAlice(Double_t tstamp) const;\r | |
138 | //\r | |
3760aa6b | 139 | void FlagInteractingBunches(const Int_t beam1[2],const Int_t beam2[2]);\r |
799c6677 | 140 | TObject* FindRecValidFor(int start,int nrec, double tstamp) const;\r |
46d3b556 | 141 | Int_t FindEntryValidFor(int start,int nrec, double tstamp) const;\r |
799c6677 | 142 | AliLHCDipValI* GetBunchConfigMeasured(int beam,double tstamp) const;\r |
143 | AliLHCDipValI* GetBunchConfigDeclared(int beam,double tstamp) const;\r | |
144 | Int_t GetNInteractingBunchesMeasured(int i=0) const;\r | |
145 | Int_t GetNInteractingBunchesDeclared(int i=0) const;\r | |
146 | Int_t IsPilotPresent(int i=0) const;\r | |
147 | //\r | |
148 | // return array with beginning [0] and number of records for corresponding info (in the fData)\r | |
149 | const Int_t* GetOffsBunchConfigMeasured(int bm) const {return GoodPairID(bm)?fBunchConfMeas[bm]:0;}\r | |
150 | const Int_t* GetOffsBunchConfigDeclared(int bm) const {return GoodPairID(bm)?fBunchConfDecl[bm]:0;}\r | |
151 | const Int_t* GetOffsBunchLengths(int bm) const {return GoodPairID(bm)?fBunchLengths[bm]:0;}\r | |
152 | const Int_t* GetOffsTotalIntensity(int bm) const {return GoodPairID(bm)?fIntensTotal[bm]:0;}\r | |
153 | const Int_t* GetOffsTotalIntensityAv(int bm) const {return GoodPairID(bm)?fIntensTotalAv[bm]:0;}\r | |
154 | const Int_t* GetOffsIntensityPerBunch(int bm) const {return GoodPairID(bm)?fIntensPerBunch[bm]:0;}\r | |
155 | const Int_t* GetOffsEmittanceH(int bm) const {return GoodPairID(bm)?fEmittanceH[bm]:0;}\r | |
156 | const Int_t* GetOffsEmittanceV(int bm) const {return GoodPairID(bm)?fEmittanceV[bm]:0;}\r | |
157 | const Int_t* GetOffsBeamSigmaH(int bm) const {return GoodPairID(bm)?fBeamSigmaH[bm]:0;}\r | |
158 | const Int_t* GetOffsBeamSigmaV(int bm) const {return GoodPairID(bm)?fBeamSigmaV[bm]:0;}\r | |
159 | //\r | |
160 | const Int_t* GetOffsLuminosityTotal(int lr) const {return GoodPairID(lr)?fLuminTotal[lr]:0;}\r | |
161 | const Int_t* GetOffsLuminosityPerBunch(int lr) const {return GoodPairID(lr)?fLuminPerBC[lr]:0;}\r | |
162 | const Int_t* GetOffsLuminosityAcqMode(int lr) const {return GoodPairID(lr)?fLuminAcqMode[lr]:0;}\r | |
163 | const Int_t* GetOffsCrossingAngle(int lr) const {return GoodPairID(lr)?fCrossAngle[lr]:0;}\r | |
164 | //\r | |
165 | const Int_t* GetOffsInjectionScheme() const {return fRCInjScheme;}\r | |
166 | const Int_t* GetOffsRCBetaStar() const {return fRCBeta;}\r | |
167 | const Int_t* GetOffsRCAngleH() const {return fRCAngH;}\r | |
168 | const Int_t* GetOffsRCAngleV() const {return fRCAngV;}\r | |
46d3b556 | 169 | const Int_t* GetOffsLumiAlice() const {return fLumiAlice;}\r |
170 | const Int_t* GetOffsBckgAlice() const {return fBckgAlice;}\r | |
799c6677 | 171 | //\r |
172 | const Int_t* GetOffsCollimatorJawPos(int coll,int jaw) const;\r | |
173 | //\r | |
174 | const TObjArray& GetData() const {return fData;}\r | |
175 | //\r | |
3d84ad67 | 176 | // analysis methods\r |
2af04ffd | 177 | Int_t GetMeanIntensity(int beamID, Double_t &colliding, Double_t &noncolliding, const TObjArray* bcmasks=0) const;\r |
178 | static Int_t GetBCId(int bucket, int beamID) {return (TMath::Abs(bucket)/10 + (beamID==0 ? kOffsBeam1:kOffsBeam2))%kMaxBSlots;}\r | |
3d84ad67 | 179 | //\r |
46d3b556 | 180 | // for retrofitting, these methods has to be public\r |
181 | void FillLumiAlice(Int_t nrec, Int_t* time, Double_t* val);\r | |
182 | void FillBckgAlice(Int_t nrec, Int_t* time, Double_t* val);\r | |
183 | \r | |
184 | \r | |
799c6677 | 185 | protected:\r |
186 | //\r | |
bab62329 | 187 | Bool_t FillData(double tmin=0, double tmax=1.e20);\r |
188 | virtual void Clear(const Option_t *opt="");\r | |
189 | void PrintAux(Bool_t full,const Int_t refs[2],const Option_t *opt="") const;\r | |
0e9ab7ce | 190 | TObjArray* GetDCSEntry(const char* key,int &entry,int &last,double tmin,double tmax) const;\r |
5ef3791d | 191 | Int_t FillScalarRecord( int refs[2], const char* rec, const char* recErr=0, Double_t maxAbsVal=1.e30);\r |
bab62329 | 192 | Int_t FillBunchConfig( int refs[2], const char* rec);\r |
193 | Int_t FillStringRecord( int refs[2], const char* rec);\r | |
194 | Int_t FillAcqMode( int refs[2], const char* rec);\r | |
5ef3791d | 195 | Int_t FillBunchInfo( int refs[2], const char* rec,int ibm, Bool_t inRealSlots, Double_t maxAbsVal=1.e30);\r |
196 | Int_t FillBCLuminosities(int refs[2], const char* rec, const char* recErr, Int_t useBeam, Double_t maxAbsVal=1.e30);\r | |
799c6677 | 197 | //\r |
198 | Int_t ExtractInt(AliDCSArray* dcsArray,Int_t el) const;\r | |
199 | Double_t ExtractDouble(AliDCSArray* dcsArray,Int_t el) const;\r | |
200 | TString& ExtractString(AliDCSArray* dcsArray) const;\r | |
46d3b556 | 201 | AliLHCData(const AliLHCData& src) : TObject(src),fTMin(0),fTMax(0),fFillNumber(0),fData(0),fkFile2Process(0),fkMap2Process(0) { /*dummy*/ }\r |
799c6677 | 202 | AliLHCData& operator=(const AliLHCData& ) { /*dummy*/ return *this;}\r |
203 | Int_t TimeDifference(double v1,double v2,double tol=0.9) const;\r | |
204 | Bool_t IzZero(double val, double tol=1e-16) const {return TMath::Abs(val)<tol;}\r | |
205 | Bool_t GoodPairID(int beam) const;\r | |
206 | //\r | |
207 | protected:\r | |
208 | //\r | |
209 | Double_t fTMin; // selection timeMin\r | |
210 | Double_t fTMax; // selection timeMax\r | |
211 | Int_t fFillNumber; // fill number : kFillNum\r | |
212 | //\r | |
213 | //---------------- Last index gives: 0 - beginning of the records in fData, 1 - number of records\r | |
214 | //\r | |
215 | // infrormation from RunControl\r | |
216 | Int_t fRCInjScheme[2]; // active injection scheme : String |kRCInjScheme\r | |
217 | Int_t fRCBeta[2]; // target beta : Float |kRCBeta\r | |
218 | Int_t fRCAngH[2]; // horisontal angle : Float |kRCCrossAng\r | |
219 | Int_t fRCAngV[2]; // vertical angle : Float |kRCVang\r | |
220 | Int_t fBunchConfDecl[2][2]; // declared beam configuration : Float |kBunchConf \r | |
221 | //\r | |
222 | // measured information\r | |
223 | Int_t fBunchConfMeas[2][2]; // measured beam configuration : Int |kBunchLgtFillB\r | |
224 | Int_t fBunchLengths[2][2]; // measured beam lenghts : Float |kBunchLgt\r | |
225 | Int_t fIntensTotal[2][2]; // total beam intensities : Float |kIntTot\r | |
226 | Int_t fIntensTotalAv[2][2]; // total beam intensities from bunch averages : Float |kIntTotAv\r | |
227 | Int_t fIntensPerBunch[2][2]; // bunch-by-bunch intensities : Float |kIntBunchAv\r | |
228 | //\r | |
229 | Int_t fCrossAngle[2][2]; // crossing angle at IP2 and its error : Float |kLimCrossAng, kLumCrossAngErr\r | |
230 | Int_t fEmittanceH[2][2]; // beam H emittances : Float |kBeamSzEmittH\r | |
231 | Int_t fEmittanceV[2][2]; // beam V emittances : Float |kBeamSzEmittV\r | |
232 | Int_t fBeamSigmaH[2][2]; // beam H sigma and error : Float |kBeamSzSigH,kBeamSzSigHErr\r | |
233 | Int_t fBeamSigmaV[2][2]; // beam V sigma and error : Float |kBeamSzSigV,kBeamSzSigVErr\r | |
234 | //\r | |
235 | Int_t fLuminTotal[2][2]; // total luminosity at IP2 and its error : Float |kLumTot, kLumTotErr\r | |
236 | Int_t fLuminPerBC[2][2]; // luminosity at IP2 for each BC and its error : Float |kLumBunch,kLumBunchErr\r | |
46d3b556 | 237 | Int_t fLuminAcqMode[2][2]; // luminosity acquisition mode : Int |kLumAcqMode\r |
238 | //\r | |
239 | // here we will store the luminosity and the background measured by Alice. We store the value integrated from the start of fill.\r | |
240 | // the inst. value can be obtained as its derivative\r | |
241 | Int_t fLumiAlice[2]; // luminosity measured by Alice : Float |kLumiAlice\r | |
242 | Int_t fBckgAlice[2]; // background measured by Alice : Float |kLumiAlice\r | |
799c6677 | 243 | //\r |
244 | Int_t fCollimators[kNCollimators][kNJaws][2];// collimator jaws positions : Float |kCollPos\r | |
245 | //\r | |
246 | TObjArray fData; // single storage for various records\r | |
247 | //\r | |
248 | static const Char_t *fgkDCSNames[]; // beam related DCS names to extract\r | |
249 | static const Char_t *fgkDCSColNames[]; // collimators to extract\r | |
250 | static const Char_t *fgkDCSColJaws[]; // names of collimator pieces\r | |
bab62329 | 251 | //\r |
252 | private:\r | |
253 | // non-persistent objects used at the filling time\r | |
339fbe23 | 254 | const Char_t* fkFile2Process; //! name of DCS file\r |
255 | const TMap* fkMap2Process; //! DCS map to process \r | |
799c6677 | 256 | \r |
46d3b556 | 257 | ClassDef(AliLHCData,3)\r |
799c6677 | 258 | };\r |
259 | \r | |
260 | \r | |
261 | //_____________________________________________________________________________\r | |
262 | inline Int_t AliLHCData::GetNCollimatorJawPos(int coll,int jaw) const {// get n records\r | |
263 | return (coll>=0&&coll<kNCollimators&&jaw>=0&&jaw<kNJaws)? fCollimators[coll][jaw][kNStor]:0;\r | |
264 | }\r | |
265 | \r | |
266 | inline const Int_t* AliLHCData::GetOffsCollimatorJawPos(int coll,int jaw) const { // offset array\r | |
267 | return (coll>=0&&coll<kNCollimators&&jaw>=0&&jaw<kNJaws)? fCollimators[coll][jaw]:0;\r | |
268 | }\r | |
269 | \r | |
270 | inline AliLHCDipValI* AliLHCData::GetBunchConfigMeasured(int bm, int i) const { // get record\r | |
3760aa6b | 271 | return (GoodPairID(bm) && i>=0 && i<fBunchConfMeas[bm][kNStor]) ? (AliLHCDipValI*)fData[fBunchConfMeas[bm][kStart]+i]:0;\r |
799c6677 | 272 | }\r |
273 | \r | |
a1063d3a | 274 | inline AliLHCDipValF* AliLHCData::GetBunchLengths(int bm, int i) const { // get record\r |
275 | return (GoodPairID(bm) && i>=0 && i<fBunchLengths[bm][kNStor]) ? (AliLHCDipValF*)fData[fBunchLengths[bm][kStart]+i]:0;\r | |
799c6677 | 276 | }\r |
277 | \r | |
278 | inline AliLHCDipValI* AliLHCData::GetBunchConfigDeclared(int bm, int i) const { // get record\r | |
3760aa6b | 279 | return (GoodPairID(bm) && i>=0 && i<fBunchConfDecl[bm][kNStor]) ? (AliLHCDipValI*)fData[fBunchConfDecl[bm][kStart]+i]:0;\r |
799c6677 | 280 | }\r |
281 | \r | |
a1063d3a | 282 | inline AliLHCDipValF* AliLHCData::GetTotalIntensity(int bm, int i) const { // get record\r |
283 | return (GoodPairID(bm) && i>=0 && i<fIntensTotal[bm][kNStor]) ? (AliLHCDipValF*)fData[fIntensTotal[bm][kStart]+i]:0;\r | |
799c6677 | 284 | }\r |
285 | \r | |
a1063d3a | 286 | inline AliLHCDipValF* AliLHCData::GetTotalIntensityAv(int bm, int i) const { // get record\r |
287 | return (GoodPairID(bm) && i>=0 && i<fIntensTotalAv[bm][kNStor]) ? (AliLHCDipValF*)fData[fIntensTotalAv[bm][kStart]+i]:0;\r | |
799c6677 | 288 | }\r |
289 | \r | |
a1063d3a | 290 | inline AliLHCDipValF* AliLHCData::GetIntensityPerBunch(int bm, int i) const { // get record\r |
291 | return (GoodPairID(bm) && i>=0 && i<fIntensPerBunch[bm][kNStor]) ? (AliLHCDipValF*)fData[fIntensPerBunch[bm][kStart]+i]:0;\r | |
799c6677 | 292 | }\r |
293 | \r | |
a1063d3a | 294 | inline AliLHCDipValF* AliLHCData::GetEmittanceH(int bm, int i) const { // get record\r |
295 | return (GoodPairID(bm) && i>=0 && i<fEmittanceH[bm][kNStor]) ? (AliLHCDipValF*)fData[fEmittanceH[bm][kStart]+i]:0;\r | |
799c6677 | 296 | }\r |
297 | \r | |
a1063d3a | 298 | inline AliLHCDipValF* AliLHCData::GetEmittanceV(int bm, int i) const { // get record\r |
299 | return (GoodPairID(bm) && i>=0 && i<fEmittanceV[bm][kNStor]) ? (AliLHCDipValF*)fData[fEmittanceV[bm][kStart]+i]:0;\r | |
799c6677 | 300 | }\r |
301 | \r | |
a1063d3a | 302 | inline AliLHCDipValF* AliLHCData::GetBeamSigmaH(int bm, int i) const { // get record\r |
303 | return (GoodPairID(bm) && i>=0 && i<fBeamSigmaH[bm][kNStor]) ? (AliLHCDipValF*)fData[fBeamSigmaH[bm][kStart]+i]:0;\r | |
799c6677 | 304 | }\r |
305 | \r | |
a1063d3a | 306 | inline AliLHCDipValF* AliLHCData::GetBeamSigmaV(int bm, int i) const { // get record\r |
307 | return (GoodPairID(bm) && i>=0 && i<fBeamSigmaV[bm][kNStor]) ? (AliLHCDipValF*)fData[fBeamSigmaV[bm][kStart]+i]:0;\r | |
799c6677 | 308 | }\r |
309 | \r | |
a1063d3a | 310 | inline AliLHCDipValF* AliLHCData::GetLuminosityTotal(int lr, int i) const { // get record\r |
311 | return (GoodPairID(lr) && i>=0 && i<fLuminTotal[lr][kNStor]) ? (AliLHCDipValF*)fData[fLuminTotal[lr][kStart]+i]:0;\r | |
799c6677 | 312 | }\r |
313 | \r | |
a1063d3a | 314 | inline AliLHCDipValF* AliLHCData::GetLuminosityPerBunch(int lr, int i) const { // get record\r |
315 | return (GoodPairID(lr) && i>=0 && i<fLuminPerBC[lr][kNStor]) ? (AliLHCDipValF*)fData[fLuminPerBC[lr][kStart]+i]:0;\r | |
799c6677 | 316 | }\r |
317 | \r | |
318 | inline AliLHCDipValI* AliLHCData::GetLuminosityAcqMode(int lr, int i) const { // get record\r | |
3760aa6b | 319 | return (GoodPairID(lr) && i>=0 && i<fLuminAcqMode[lr][kNStor]) ? (AliLHCDipValI*)fData[fLuminAcqMode[lr][kStart]+i]:0;\r |
799c6677 | 320 | }\r |
321 | \r | |
a1063d3a | 322 | inline AliLHCDipValF* AliLHCData::GetCrossAngle(int lr, int i) const { // get record\r |
323 | return (GoodPairID(lr) && i>=0 && i<fCrossAngle[lr][kNStor]) ? (AliLHCDipValF*)fData[fCrossAngle[lr][kStart]+i]:0;\r | |
799c6677 | 324 | }\r |
325 | \r | |
326 | inline AliLHCDipValC* AliLHCData::GetInjectionScheme(int i) const { // get record\r | |
3760aa6b | 327 | return (i>=0 && i<fRCInjScheme[kNStor]) ? (AliLHCDipValC*)fData[fRCInjScheme[kStart]+i]:0;\r |
799c6677 | 328 | }\r |
329 | \r | |
a1063d3a | 330 | inline AliLHCDipValF* AliLHCData::GetRCBetaStar(int i) const { // get record\r |
331 | return (i>=0 && i<fRCBeta[kNStor]) ? (AliLHCDipValF*)fData[fRCBeta[kStart]+i]:0;\r | |
799c6677 | 332 | }\r |
333 | \r | |
a1063d3a | 334 | inline AliLHCDipValF* AliLHCData::GetRCAngleH(int i) const { // get record\r |
335 | return (i>=0 && i<fRCAngH[kNStor]) ? (AliLHCDipValF*)fData[fRCAngH[kStart]+i]:0;\r | |
799c6677 | 336 | }\r |
337 | \r | |
a1063d3a | 338 | inline AliLHCDipValF* AliLHCData::GetRCAngleV(int i) const { // get record\r |
339 | return (i>=0 && i<fRCAngV[kNStor]) ? (AliLHCDipValF*)fData[fRCAngV[kStart]+i]:0;\r | |
799c6677 | 340 | }\r |
341 | \r | |
a1063d3a | 342 | inline AliLHCDipValF* AliLHCData::GetCollimJawPos(int coll, int jaw, int i) const { // get record\r |
799c6677 | 343 | return (coll>=0 && coll<kNCollimators && jaw>=0 && jaw<kNJaws && \r |
a1063d3a | 344 | i>=0 && i<fCollimators[coll][jaw][kNStor]) ? (AliLHCDipValF*)fData[fCollimators[coll][jaw][kStart]+i]:0;\r |
799c6677 | 345 | }\r |
346 | \r | |
46d3b556 | 347 | inline AliLHCDipValF* AliLHCData::GetLumiAliceRecord(int i) const { // get record on integrated luminosity\r |
348 | return (i>=0 && i<fLumiAlice[kNStor]) ? (AliLHCDipValF*)fData[fLumiAlice[kStart]+i]:0;\r | |
349 | }\r | |
350 | \r | |
351 | inline AliLHCDipValF* AliLHCData::GetBckgAliceRecord(int i) const { // get record on integrated background\r | |
352 | return (i>=0 && i<fBckgAlice[kNStor]) ? (AliLHCDipValF*)fData[fBckgAlice[kStart]+i]:0;\r | |
353 | }\r | |
354 | \r | |
355 | inline Float_t AliLHCData::GetLumiAlice(Double_t tStamp) const { // get closest in time value on integrated luminosity\r | |
356 | int idx = FindEntryValidFor(fLumiAlice[kStart],fLumiAlice[kNStor],tStamp);\r | |
357 | return idx<0 ? -1 : ((AliLHCDipValF*)fData[fLumiAlice[kStart]+idx])->GetValue();\r | |
358 | }\r | |
359 | \r | |
360 | inline Float_t AliLHCData::GetBckgAlice(Double_t tStamp) const { // get closest in time value on integrated bckg\r | |
361 | int idx = FindEntryValidFor(fBckgAlice[kStart],fBckgAlice[kNStor],tStamp);\r | |
362 | return idx<0 ? -1 : ((AliLHCDipValF*)fData[fBckgAlice[kStart]+idx])->GetValue();\r | |
363 | }\r | |
364 | \r | |
365 | inline Int_t AliLHCData::FindEntryValidFor(int start,int nrec, double tstamp) const\r | |
366 | {\r | |
367 | // find index of record within this limits valid for given tstamp (i.e. the last one before or equal to tstamp)\r | |
368 | int idx;\r | |
369 | for (idx=0;idx<nrec;idx++) {\r | |
370 | if (TimeDifference(tstamp,((AliLHCDipValI*)fData[start+idx])->GetTimeStamp())<=0) break;\r | |
371 | }\r | |
372 | return (idx<nrec) ? idx : nrec-1;\r | |
373 | }\r | |
799c6677 | 374 | \r |
375 | #endif\r |