AliRoot Core  ee782a0 (ee782a0)
AliLHCData.h
Go to the documentation of this file.
1 #ifndef ALILHCDATA_H
2 #define ALILHCDATA_H
3 
4 /********************************************************************************
5 * *
6 * AliLHCData: summary of the LHC related information from LHC DIP. *
7 * Created from the TMap provided by the AliLHCReader with optional beginning *
8 * *
9 * The data are (wrapped in the AliLHCDipValT): *
10 * made of TimeStamp (double) and array of values *
11 * *
12 * Multiple entries for each type of data are possible. To obtaine number of *
13 * records (with distinct timestamp) for give type od records use: *
14 * int GetNBunchConfigMeasured(int beam) (with beam=0,1) etc. *
15 * *
16 * To get i-th entry, use brec= AliLHCDipValI* GetBunchConfigMeasured(bm,i); *
17 * Note: exact type of templated AliLHCDipValT pointer depends on the record *
18 * type, concult getters to know it. *
19 * *
20 * Then, once the pointer is obtained, details can be accessed: *
21 * int nBunches = brec->GetSize(); *
22 * for (int i=0;i<nBunches;i++) printf("Bunch#%d: %d\n",i,(*brec)[i]); *
23 * *
24 * ATTENTION: Bunch RFBucked is NEGATIVE for bunches interacting at IR2 *
25 * *
26 * *
27 * *
28 * Author: ruben.shahoyan@cern.ch *
29 * *
30 ********************************************************************************/
31 
32 #include "AliLHCDipValT.h"
33 #include "TObject.h"
34 class TObjArray;
35 //class AliLHCDipValT;
36 
37 class AliDCSArray;
38 class TString;
39 class TMap;
40 class AliLHCReader;
41 class TGraph;
42 
43 class AliLHCData : public TObject
44 {
45  public:
46  enum {kStart,kNStor};
49  enum Proj_t {kX,kY};
53  enum {kMaxBSlots = 3564, kOffsBeam1=346, kOffsBeam2 = 3019, kY2015 = 1420070400};
54  enum {kMarginSOR = 60*60*24*30, // use margin of 30 days for SOR, when looking for the 1st record
55  kMarginEOR = 60*15}; // use margin of 15 min for EOR, when looking for the last record
56  //
68  //
77  //
78  //le
79  public:
80  //
82  AliLHCData(const TMap* dcsMap, double tmin=0, double tmax=1.e10);
83  AliLHCData(const Char_t* dcsFile, double tmin=0, double tmax=1.e10);
84  virtual ~AliLHCData() {}
85  //
86  Bool_t FillData(const TMap* dcsMap, double tmin=0, double tmax=1.e20);
87  Bool_t FillData(const Char_t* dcsFile, double tmin=0, double tmax=1.e20);
88  Double_t GetTMin() const {return fTMin;}
89  Double_t GetTMax() const {return fTMax;}
90  Int_t GetFillNumber() const {return fFillNumber;}
91  void SetFillNumber(Int_t fill) {fFillNumber = fill;}
92  void SetTMin(Double_t t) {fTMin = t<0?0:(t>1e10?1e10:t);}
93  void SetTMax(Double_t t) {fTMax = t<0?0:(t>1e10?1e10:t);}
94  Bool_t IsRun2() const {return fTMin>kY2015;}
95  //
96  virtual void Print(const Option_t *opt="") const;
97  TGraph* ExportGraph(Int_t *coord, Int_t elID=0) const;
98  //
99  Int_t GetNBunchConfigMeasured(int bm) const {return GoodPairID(bm)?fBunchConfMeas[bm][kNStor]:-1;}
100  Int_t GetNBunchConfigDeclared(int bm) const {return GoodPairID(bm)?fBunchConfDecl[bm][kNStor]:-1;}
101  Int_t GetNBunchLengths(int bm) const {return GoodPairID(bm)?fBunchLengths[bm][kNStor]:-1;}
102  Int_t GetNTotalIntensity(int bm) const {return GoodPairID(bm)?fIntensTotal[bm][kNStor]:-1;}
103  Int_t GetNTotalIntensityAv(int bm) const {return GoodPairID(bm)?fIntensTotalAv[bm][kNStor]:-1;}
104  Int_t GetNIntensityPerBunch(int bm) const {return GoodPairID(bm)?fIntensPerBunch[bm][kNStor]:-1;}
105  Int_t GetNEmittanceH(int bm) const {return GoodPairID(bm)?fEmittanceH[bm][kNStor]:-1;}
106  Int_t GetNEmittanceV(int bm) const {return GoodPairID(bm)?fEmittanceV[bm][kNStor]:-1;}
107  Int_t GetNBeamSigmaH(int bm) const {return GoodPairID(bm)?fBeamSigmaH[bm][kNStor]:-1;}
108  Int_t GetNBeamSigmaV(int bm) const {return GoodPairID(bm)?fBeamSigmaV[bm][kNStor]:-1;}
109  //
110  Int_t GetNLuminosityTotal(int lr) const {return GoodPairID(lr)?fLuminTotal[lr][kNStor]:-1;}
111  Int_t GetNLuminosityPerBunch(int lr) const {return GoodPairID(lr)?fLuminPerBC[lr][kNStor]:-1;}
112  Int_t GetNLuminosityAcqMode(int lr) const {return GoodPairID(lr)?fLuminAcqMode[lr][kNStor]:-1;}
113  Int_t GetNCrossingAngle(int lr) const {return GoodPairID(lr)?fCrossAngle[lr][kNStor]:-1;}
114  //
115  Int_t GetNInjectionScheme() const {return fRCInjScheme[kNStor];}
116  Int_t GetNRCBetaStar() const {return fRCBeta[kNStor];}
117  Int_t GetNRCAngleH() const {return fRCAngH[kNStor];}
118  Int_t GetNRCAngleV() const {return fRCAngV[kNStor];}
119  //
120  Int_t GetNLumiAlice() const {return fLumiAlice[kNStor];}
122  Int_t GetNLumiAliceBunch() const {return fLumiAliceBbB[kNStor];}
123  Int_t GetNLumiAliceSrc() const {return fLumiAliceSrc[kNStor];}
126  //
127  Int_t GetNBckgAlice(int bg) const {return (bg>-1&&bg<kNBGs) ? fBckgAlice[bg][kNStor] : -1;}
128  //
129  Int_t GetNBPTXdeltaTB1B2() const {return fBPTXdTB1B2[kNStor];}
130  Int_t GetNBPTXdeltaTRMSB1B2() const {return fBPTXdTRMSB1B2[kNStor];}
131  Int_t GetNBPTXPhase(int bm) const {return GoodPairID(bm)?fBPTXPhase[bm][kNStor]:-1;}
132  Int_t GetNBPTXPhaseRMS(int bm) const {return GoodPairID(bm)?fBPTXPhaseRMS[bm][kNStor]:-1;}
133  Int_t GetNBPTXPhaseShift(int bm) const {return GoodPairID(bm)?fBPTXPhaseShift[bm][kNStor]:-1;}
134  //
135  //
136  Int_t GetNCollimatorJawPos(int coll,int jaw) const;
137  //
138  AliLHCDipValI* GetBunchConfigMeasured(int bm, int i=0) const;
139  AliLHCDipValF* GetBunchLengths(int bm, int i=0) const;
140  AliLHCDipValI* GetBunchConfigDeclared(int bm, int i=0) const;
141  AliLHCDipValF* GetTotalIntensity(int bm, int i=0) const;
142  AliLHCDipValF* GetTotalIntensityAv(int bm, int i=0) const;
143  AliLHCDipValF* GetIntensityPerBunch(int bm, int i=0) const;
144  AliLHCDipValF* GetEmittanceH(int bm, int i=0) const;
145  AliLHCDipValF* GetEmittanceV(int bm, int i=0) const;
146  AliLHCDipValF* GetBeamSigmaH(int bm, int i=0) const;
147  AliLHCDipValF* GetBeamSigmaV(int bm, int i=0) const;
148  AliLHCDipValF* GetLuminosityTotal(int lr, int i=0) const;
149  AliLHCDipValF* GetLuminosityPerBunch(int lr, int i=0) const;
150  AliLHCDipValI* GetLuminosityAcqMode(int lr, int i=0) const;
151  AliLHCDipValF* GetCrossAngle(int lr, int i=0) const;
152  AliLHCDipValC* GetInjectionScheme(int i=0) const;
153  AliLHCDipValF* GetRCBetaStar(int i=0) const;
154  AliLHCDipValF* GetRCAngleH(int i=0) const;
155  AliLHCDipValF* GetRCAngleV(int i=0) const;
156  AliLHCDipValF* GetCollimJawPos(int coll, int jaw, int i=0) const;
157  //
158  AliLHCDipValF* GetLumiAlice(int i=0) const;
159  AliLHCDipValF* GetLumiAliceSBDelivered(int i=0) const;
160  AliLHCDipValF* GetLumiAliceBunch(int i=0) const;
161  AliLHCDipValF* GetBckgAlice(int bg, int i=0) const;
162 
163  AliLHCDipValC* GetLumiAliceSrc(int i=0) const;
165  AliLHCDipValI* GetLHCBetaStarActive(int i=0) const;
166 
167  //
168  AliLHCDipValF* GetBPTXdeltaTB1B2(int i=0) const;
169  AliLHCDipValF* GetBPTXdeltaTRMSB1B2(int i=0) const;
170  AliLHCDipValF* GetBPTXPhase(int bm, int i=0) const;
171  AliLHCDipValF* GetBPTXPhaseRMS(int bm, int i=0) const;
172  AliLHCDipValF* GetBPTXPhaseShift(int bm, int i=0) const;
173  //
174  Float_t GetLumiAlice(Double_t tstamp) const;
175  Float_t GetLumiAliceSBDelivered(Double_t tstamp) const;
176  Float_t GetBckgAlice(Int_t bg,Double_t tstamp) const;
177  //
178  // Float_t GetLumiInstAlice(Double_t tstamp) const;
179  // Float_t GetBckgInstAlice(Double_t tstamp) const;
180  //
181  void FlagInteractingBunches(const Int_t beam1[2],const Int_t beam2[2]);
182  TObject* FindRecValidFor(int start,int nrec, double tstamp) const;
183  Int_t FindEntryValidFor(int start,int nrec, double tstamp) const;
184  AliLHCDipValI* GetBunchConfigMeasured(int beam,double tstamp) const;
185  AliLHCDipValI* GetBunchConfigDeclared(int beam,double tstamp) const;
186  Int_t GetNInteractingBunchesMeasured(int i=0) const;
187  Int_t GetNInteractingBunchesDeclared(int i=0) const;
188  Int_t IsPilotPresent(int i=0) const;
189  //
190  // return array with beginning [0] and number of records for corresponding info (in the fData)
191  const Int_t* GetOffsBunchConfigMeasured(int bm) const {return GoodPairID(bm)?fBunchConfMeas[bm]:0;}
192  const Int_t* GetOffsBunchConfigDeclared(int bm) const {return GoodPairID(bm)?fBunchConfDecl[bm]:0;}
193  const Int_t* GetOffsBunchLengths(int bm) const {return GoodPairID(bm)?fBunchLengths[bm]:0;}
194  const Int_t* GetOffsTotalIntensity(int bm) const {return GoodPairID(bm)?fIntensTotal[bm]:0;}
195  const Int_t* GetOffsTotalIntensityAv(int bm) const {return GoodPairID(bm)?fIntensTotalAv[bm]:0;}
196  const Int_t* GetOffsIntensityPerBunch(int bm) const {return GoodPairID(bm)?fIntensPerBunch[bm]:0;}
197  const Int_t* GetOffsEmittanceH(int bm) const {return GoodPairID(bm)?fEmittanceH[bm]:0;}
198  const Int_t* GetOffsEmittanceV(int bm) const {return GoodPairID(bm)?fEmittanceV[bm]:0;}
199  const Int_t* GetOffsBeamSigmaH(int bm) const {return GoodPairID(bm)?fBeamSigmaH[bm]:0;}
200  const Int_t* GetOffsBeamSigmaV(int bm) const {return GoodPairID(bm)?fBeamSigmaV[bm]:0;}
201  //
202  const Int_t* GetOffsLuminosityTotal(int lr) const {return GoodPairID(lr)?fLuminTotal[lr]:0;}
203  const Int_t* GetOffsLuminosityPerBunch(int lr) const {return GoodPairID(lr)?fLuminPerBC[lr]:0;}
204  const Int_t* GetOffsLuminosityAcqMode(int lr) const {return GoodPairID(lr)?fLuminAcqMode[lr]:0;}
205  const Int_t* GetOffsCrossingAngle(int lr) const {return GoodPairID(lr)?fCrossAngle[lr]:0;}
206  //
207  const Int_t* GetOffsInjectionScheme() const {return fRCInjScheme;}
208  const Int_t* GetOffsRCBetaStar() const {return fRCBeta;}
209  const Int_t* GetOffsRCAngleH() const {return fRCAngH;}
210  const Int_t* GetOffsRCAngleV() const {return fRCAngV;}
211  //
212  const Int_t* GetOffsLumiAlice() const {return fLumiAlice;}
213  const Int_t* GetOffsLumiAliceSBDelivered() const {return fLumiAliceStB;}
214  const Int_t* GetOffsLumiAliceBunch() const {return fLumiAliceBbB;}
215  const Int_t* GetOffsBckgAlice(int bg) const {return (bg>-1&&bg<kNBGs) ? fBckgAlice[bg] : 0;}
216  //
217  const Int_t* GetOffsBPTXdeltaTB1B2() const {return fBPTXdTB1B2;}
218  const Int_t* GetOffsBPTXdeltaTRMSB1B2() const {return fBPTXdTRMSB1B2;}
219  const Int_t* GetOffsBPTXPhase(int bm) const {return GoodPairID(bm)?fBPTXPhase[bm]:0;}
220  const Int_t* GetOffsBPTXPhaseRMS(int bm) const {return GoodPairID(bm)?fBPTXPhaseRMS[bm]:0;}
221  const Int_t* GetOffsBPTXPhaseShift(int bm) const {return GoodPairID(bm)?fBPTXPhaseShift[bm]:0;}
222  //
223  const Int_t* GetOffsCollimatorJawPos(int coll,int jaw) const;
224  //
225  const TObjArray& GetData() const {return fData;}
226  //
227  // analysis methods
228  Int_t GetMeanIntensity(int beamID, Double_t &colliding, Double_t &noncolliding, const TObjArray* bcmasks=0) const;
229  Int_t GetBCId(int bucket, int beamID) const;
230  //
231  // for retrofitting, these methods has to be public
232  // void FillLumiAliceOFL(Int_t nrec, Int_t* time, Double_t* val);
233  // void FillBckgAliceOFL(Int_t nrec, Int_t* time, Double_t* val);
234 
235  protected:
236  //
237  Bool_t FillData(double tmin=0, double tmax=1.e20);
238  virtual void Clear(const Option_t *opt="");
239  void PrintAux(Bool_t full,const Int_t refs[2],const Option_t *opt="") const;
240  TObjArray* GetDCSEntry(const char* key,int &entry,int &last,double tmin,double tmax) const;
241  Int_t FillScalarRecord( int refs[2], const char* rec, const char* recErr=0, Double_t maxAbsVal=1.e30);
242  Int_t FillScalarRecordInt(int refs[2], const char* rec, Int_t maxAbsVal=0x7fffffff);
243  Int_t FillBunchConfig( int refs[2], const char* rec);
244  Int_t FillStringRecord( int refs[2], const char* rec);
245  Int_t FillAcqMode( int refs[2], const char* rec);
246  Int_t FillBunchInfo( int refs[2], const char* rec,int ibm, Bool_t inRealSlots, Double_t maxAbsVal=1.e30);
247  Int_t FillBCLuminosities(int refs[2], const char* rec, const char* recErr, Int_t useBeam, Double_t maxAbsVal=1.e30);
248  //
249  Int_t ExtractInt(AliDCSArray* dcsArray,Int_t el) const;
250  Double_t ExtractDouble(AliDCSArray* dcsArray,Int_t el) const;
251  TString& ExtractString(AliDCSArray* dcsArray) const;
252  AliLHCData(const AliLHCData& src) : TObject(src),fTMin(0),fTMax(0),fFillNumber(0),fData(0),fkFile2Process(0),fkMap2Process(0) { /*dummy*/ }
253  AliLHCData& operator=(const AliLHCData& ) { /*dummy*/ return *this;}
254  Int_t TimeDifference(double v1,double v2,double tol=0.9) const;
255  Bool_t IzZero(double val, double tol=1e-16) const {return TMath::Abs(val)<tol;}
256  Bool_t GoodPairID(int beam) const;
257  //
258  protected:
259  //
260  Double_t fTMin; // selection timeMin
261  Double_t fTMax; // selection timeMax
262  Int_t fFillNumber; // fill number : kFillNum
263  //
264  //---------------- Last index gives: 0 - beginning of the records in fData, 1 - number of records
265  //
266  // infrormation from RunControl
267  Int_t fRCInjScheme[2]; // active injection scheme : String |kRCInjScheme
268  Int_t fRCBeta[2]; // target beta : Float |kRCBeta
269  Int_t fRCAngH[2]; // horisontal angle : Float |kRCCrossAng
270  Int_t fRCAngV[2]; // vertical angle : Float |kRCVang
271  Int_t fBunchConfDecl[2][2]; // declared beam configuration : Float |kBunchConf
272  //
273  // measured information
274  Int_t fBunchConfMeas[2][2]; // measured beam configuration : Int |kBunchLgtFillB
275  Int_t fBunchLengths[2][2]; // measured beam lenghts : Float |kBunchLgt
276  Int_t fIntensTotal[2][2]; // total beam intensities : Float |kIntTot
277  Int_t fIntensTotalAv[2][2]; // total beam intensities from bunch averages : Float |kIntTotAv
278  Int_t fIntensPerBunch[2][2]; // bunch-by-bunch intensities : Float |kIntBunchAv
279  //
280  Int_t fCrossAngle[2][2]; // crossing angle at IP2 and its error : Float |kLimCrossAng, kLumCrossAngErr
281  Int_t fEmittanceH[2][2]; // beam H emittances : Float |kBeamSzEmittH
282  Int_t fEmittanceV[2][2]; // beam V emittances : Float |kBeamSzEmittV
283  Int_t fBeamSigmaH[2][2]; // beam H sigma and error : Float |kBeamSzSigH,kBeamSzSigHErr
284  Int_t fBeamSigmaV[2][2]; // beam V sigma and error : Float |kBeamSzSigV,kBeamSzSigVErr
285  //
286  Int_t fLuminTotal[2][2]; // total luminosity at IP2 and its error : Float |kLumTot, kLumTotErr
287  Int_t fLuminPerBC[2][2]; // luminosity at IP2 for each BC and its error : Float |kLumBunch,kLumBunchErr
288  Int_t fLuminAcqMode[2][2]; // luminosity acquisition mode : Int |kLumAcqMode
289  //
290  // here we will store the luminosity and the background measured by Alice. We store the value integrated from the start of fill.
291  // the inst. value can be obtained as its derivative
292  Int_t fLumiAlice[2]; // luminosity measured by Alice, Total_Inst : Float |kALILumiTotalInst
293  Int_t fLumiAliceStB[2]; // luminosity measured by Alice, Deli.StabBeam : Float |kALILumiTotalDeliveredStabBeam
294  Int_t fLumiAliceBbB[2]; // luminosity measured by Alice, B-by-B : Float |kALILumiBunchInst
295  Int_t fLumiAliceSrc[2]; // Alice luminosity source name : String |kALILumiSourceName
296  Int_t fLHCBetaStarTargetOptic[2]; // beta* leveling target : String |kLHCBetaStarTargetOptic
297  Int_t fLHCBetaStarActive[2]; // Flag for beta* leveling : Int |kLHCBetaStarActive
298  //
299  Int_t fBckgAlice[kNBGs][2]; // backgrounds measured by Alice : Float |kALIBackground1,2,3
300  //
301  Int_t fBPTXdTB1B2[2]; // BPTX_deltaT_B1_B2 : Float |kBPTXdeltaTB1B2,
302  Int_t fBPTXdTRMSB1B2[2]; // BPTX_deltaTRMS_B1_B2 : Float |kBPTXdeltaTRMSB1B2,
303  Int_t fBPTXPhase[2][2]; // BPTX_Phase_B1, and BPTX_Phase_B2 : Float |kBPTXPhase
304  Int_t fBPTXPhaseRMS[2][2]; // BPTX_PhaseRMS_B1, and BPTX_PhaseRMS_B2 : Float |kBPTXPhaseRMS
305  Int_t fBPTXPhaseShift[2][2]; // BPTX_Phase_Shift_B1 and BPTX_Phase_Shift_B2 : Float |kBPTXPhaseShift
306  //
307  Int_t fCollimators[kNCollimators][kNJaws][2];// collimator jaws positions : Float |kCollPos
308  //
309  TObjArray fData; // single storage for various records
310  //
311  static const Char_t *fgkDCSNames[]; // beam related DCS names to extract
312  static const Char_t *fgkDCSColNames[]; // collimators to extract
313  static const Char_t *fgkDCSColJaws[]; // names of collimator pieces
314  //
315  private:
316  // non-persistent objects used at the filling time
317  const Char_t* fkFile2Process;
318  const TMap* fkMap2Process;
319 
320  ClassDef(AliLHCData,5)
321 };
322 
323 
324 //_____________________________________________________________________________
325 inline Int_t AliLHCData::GetNCollimatorJawPos(int coll,int jaw) const {// get n records
326  return (coll>=0&&coll<kNCollimators&&jaw>=0&&jaw<kNJaws)? fCollimators[coll][jaw][kNStor]:0;
327 }
328 
329 inline const Int_t* AliLHCData::GetOffsCollimatorJawPos(int coll,int jaw) const { // offset array
330  return (coll>=0&&coll<kNCollimators&&jaw>=0&&jaw<kNJaws)? fCollimators[coll][jaw]:0;
331 }
332 
333 inline AliLHCDipValI* AliLHCData::GetBunchConfigMeasured(int bm, int i) const { // get record
334  return (GoodPairID(bm) && i>=0 && i<fBunchConfMeas[bm][kNStor]) ? (AliLHCDipValI*)fData[fBunchConfMeas[bm][kStart]+i]:0;
335 }
336 
337 inline AliLHCDipValF* AliLHCData::GetBunchLengths(int bm, int i) const { // get record
338  return (GoodPairID(bm) && i>=0 && i<fBunchLengths[bm][kNStor]) ? (AliLHCDipValF*)fData[fBunchLengths[bm][kStart]+i]:0;
339 }
340 
341 inline AliLHCDipValI* AliLHCData::GetBunchConfigDeclared(int bm, int i) const { // get record
342  return (GoodPairID(bm) && i>=0 && i<fBunchConfDecl[bm][kNStor]) ? (AliLHCDipValI*)fData[fBunchConfDecl[bm][kStart]+i]:0;
343 }
344 
345 inline AliLHCDipValF* AliLHCData::GetTotalIntensity(int bm, int i) const { // get record
346  return (GoodPairID(bm) && i>=0 && i<fIntensTotal[bm][kNStor]) ? (AliLHCDipValF*)fData[fIntensTotal[bm][kStart]+i]:0;
347 }
348 
349 inline AliLHCDipValF* AliLHCData::GetTotalIntensityAv(int bm, int i) const { // get record
350  return (GoodPairID(bm) && i>=0 && i<fIntensTotalAv[bm][kNStor]) ? (AliLHCDipValF*)fData[fIntensTotalAv[bm][kStart]+i]:0;
351 }
352 
353 inline AliLHCDipValF* AliLHCData::GetIntensityPerBunch(int bm, int i) const { // get record
354  return (GoodPairID(bm) && i>=0 && i<fIntensPerBunch[bm][kNStor]) ? (AliLHCDipValF*)fData[fIntensPerBunch[bm][kStart]+i]:0;
355 }
356 
357 inline AliLHCDipValF* AliLHCData::GetEmittanceH(int bm, int i) const { // get record
358  return (GoodPairID(bm) && i>=0 && i<fEmittanceH[bm][kNStor]) ? (AliLHCDipValF*)fData[fEmittanceH[bm][kStart]+i]:0;
359 }
360 
361 inline AliLHCDipValF* AliLHCData::GetEmittanceV(int bm, int i) const { // get record
362  return (GoodPairID(bm) && i>=0 && i<fEmittanceV[bm][kNStor]) ? (AliLHCDipValF*)fData[fEmittanceV[bm][kStart]+i]:0;
363 }
364 
365 inline AliLHCDipValF* AliLHCData::GetBeamSigmaH(int bm, int i) const { // get record
366  return (GoodPairID(bm) && i>=0 && i<fBeamSigmaH[bm][kNStor]) ? (AliLHCDipValF*)fData[fBeamSigmaH[bm][kStart]+i]:0;
367 }
368 
369 inline AliLHCDipValF* AliLHCData::GetBeamSigmaV(int bm, int i) const { // get record
370  return (GoodPairID(bm) && i>=0 && i<fBeamSigmaV[bm][kNStor]) ? (AliLHCDipValF*)fData[fBeamSigmaV[bm][kStart]+i]:0;
371 }
372 
373 inline AliLHCDipValF* AliLHCData::GetLuminosityTotal(int lr, int i) const { // get record
374  return (GoodPairID(lr) && i>=0 && i<fLuminTotal[lr][kNStor]) ? (AliLHCDipValF*)fData[fLuminTotal[lr][kStart]+i]:0;
375 }
376 
377 inline AliLHCDipValF* AliLHCData::GetLuminosityPerBunch(int lr, int i) const { // get record
378  return (GoodPairID(lr) && i>=0 && i<fLuminPerBC[lr][kNStor]) ? (AliLHCDipValF*)fData[fLuminPerBC[lr][kStart]+i]:0;
379 }
380 
381 inline AliLHCDipValI* AliLHCData::GetLuminosityAcqMode(int lr, int i) const { // get record
382  return (GoodPairID(lr) && i>=0 && i<fLuminAcqMode[lr][kNStor]) ? (AliLHCDipValI*)fData[fLuminAcqMode[lr][kStart]+i]:0;
383 }
384 
385 inline AliLHCDipValF* AliLHCData::GetCrossAngle(int lr, int i) const { // get record
386  return (GoodPairID(lr) && i>=0 && i<fCrossAngle[lr][kNStor]) ? (AliLHCDipValF*)fData[fCrossAngle[lr][kStart]+i]:0;
387 }
388 
389 inline AliLHCDipValC* AliLHCData::GetInjectionScheme(int i) const { // get record
390  return (i>=0 && i<fRCInjScheme[kNStor]) ? (AliLHCDipValC*)fData[fRCInjScheme[kStart]+i]:0;
391 }
392 
393 inline AliLHCDipValF* AliLHCData::GetRCBetaStar(int i) const { // get record
394  return (i>=0 && i<fRCBeta[kNStor]) ? (AliLHCDipValF*)fData[fRCBeta[kStart]+i]:0;
395 }
396 
397 inline AliLHCDipValF* AliLHCData::GetRCAngleH(int i) const { // get record
398  return (i>=0 && i<fRCAngH[kNStor]) ? (AliLHCDipValF*)fData[fRCAngH[kStart]+i]:0;
399 }
400 
401 inline AliLHCDipValF* AliLHCData::GetRCAngleV(int i) const { // get record
402  return (i>=0 && i<fRCAngV[kNStor]) ? (AliLHCDipValF*)fData[fRCAngV[kStart]+i]:0;
403 }
404 
405 inline AliLHCDipValF* AliLHCData::GetCollimJawPos(int coll, int jaw, int i) const { // get record
406  return (coll>=0 && coll<kNCollimators && jaw>=0 && jaw<kNJaws &&
407  i>=0 && i<fCollimators[coll][jaw][kNStor]) ? (AliLHCDipValF*)fData[fCollimators[coll][jaw][kStart]+i]:0;
408 }
409 
410 inline AliLHCDipValF* AliLHCData::GetLumiAlice(int i) const { // get record on integrated luminosity
411  return (i>=0 && i<fLumiAlice[kNStor]) ? (AliLHCDipValF*)fData[fLumiAlice[kStart]+i]:0;
412 }
413 
414 inline AliLHCDipValC* AliLHCData::GetLumiAliceSrc(int i) const { // get record
415  return (i>=0 && i<fLumiAliceSrc[kNStor]) ? (AliLHCDipValC*)fData[fLumiAliceSrc[kStart]+i]:0;
416 }
417 
418 inline AliLHCDipValC* AliLHCData::GetLHCBetaStarTargetOptic(int i) const { // get record
420 }
421 
422 inline AliLHCDipValI* AliLHCData::GetLHCBetaStarActive(int i) const { // get record
424 }
425 
426 
427 inline AliLHCDipValF* AliLHCData::GetLumiAliceSBDelivered(int i) const { // get record on st.beam delivered luminosity
428  return (i>=0 && i<fLumiAliceStB[kNStor]) ? (AliLHCDipValF*)fData[fLumiAliceStB[kStart]+i]:0;
429 }
430 
431 inline AliLHCDipValF* AliLHCData::GetLumiAliceBunch(int i) const { // get record on b-by-b luminosity
432  return (i>=0 && i<fLumiAliceBbB[kNStor]) ? (AliLHCDipValF*)fData[fLumiAliceBbB[kStart]+i]:0;
433 }
434 
435 inline AliLHCDipValF* AliLHCData::GetBckgAlice(int bg, int i) const { // get record on integrated background
436  return (bg>=0&&bg<kNBGs&&i>=0&&i<fBckgAlice[bg][kNStor]) ? (AliLHCDipValF*)fData[fBckgAlice[bg][kStart]+i]:0;
437 }
438 
439 inline AliLHCDipValF* AliLHCData::GetBPTXdeltaTB1B2(int i) const { // get record
440  return (i>=0 && i<fBPTXdTB1B2[kNStor]) ? (AliLHCDipValF*)fData[fBPTXdTB1B2[kStart]+i]:0;
441 }
442 
443 inline AliLHCDipValF* AliLHCData::GetBPTXdeltaTRMSB1B2(int i) const { // get record
444  return (i>=0 && i<fBPTXdTRMSB1B2[kNStor]) ? (AliLHCDipValF*)fData[fBPTXdTRMSB1B2[kStart]+i]:0;
445 }
446 
447 inline AliLHCDipValF* AliLHCData::GetBPTXPhase(int bm, int i) const { // get record
448  return (GoodPairID(bm) && i>=0 && i<fBPTXPhase[bm][kNStor]) ? (AliLHCDipValF*)fData[fBPTXPhase[bm][kStart]+i]:0;
449 }
450 
451 inline AliLHCDipValF* AliLHCData::GetBPTXPhaseRMS(int bm, int i) const { // get record
452  return (GoodPairID(bm) && i>=0 && i<fBPTXPhaseRMS[bm][kNStor]) ? (AliLHCDipValF*)fData[fBPTXPhaseRMS[bm][kStart]+i]:0;
453 }
454 
455 inline AliLHCDipValF* AliLHCData::GetBPTXPhaseShift(int bm, int i) const { // get record
456  return (GoodPairID(bm) && i>=0 && i<fBPTXPhaseShift[bm][kNStor]) ? (AliLHCDipValF*)fData[fBPTXPhaseShift[bm][kStart]+i]:0;
457 }
458 
459 inline Float_t AliLHCData::GetLumiAlice(Double_t tStamp) const { // get closest in time value on integrated luminosity
461  return idx<0 ? -1 : ((AliLHCDipValF*)fData[fLumiAlice[kStart]+idx])->GetValue();
462 }
463 
464 inline Float_t AliLHCData::GetLumiAliceSBDelivered(Double_t tStamp) const { // get closest in time value on delivered luminosity
466  return idx<0 ? -1 : ((AliLHCDipValF*)fData[fLumiAliceStB[kStart]+idx])->GetValue();
467 }
468 
469 inline Float_t AliLHCData::GetBckgAlice(int bg,Double_t tStamp) const { // get closest in time value on integrated bckg
470  if (bg<0||bg>=kNBGs) return 0;
471  int idx = FindEntryValidFor(fBckgAlice[bg][kStart],fBckgAlice[bg][kNStor],tStamp);
472  return idx<0 ? -1 : ((AliLHCDipValF*)fData[fBckgAlice[bg][kStart]+idx])->GetValue();
473 }
474 
475 
476 
477 inline Int_t AliLHCData::FindEntryValidFor(int start,int nrec, double tstamp) const
478 {
479  // find index of record within this limits valid for given tstamp (i.e. the last one before or equal to tstamp)
480  int idx;
481  for (idx=0;idx<nrec;idx++) {
482  if (TimeDifference(tstamp,((AliLHCDipValI*)fData[start+idx])->GetTimeStamp())<=0) break;
483  }
484  return (idx<nrec) ? idx : nrec-1;
485 }
486 
487 
488 inline Int_t AliLHCData::GetBCId(int bucket, int beamID) const
489 {
490  Int_t offs = beamID==0 ? kOffsBeam1:kOffsBeam2;
491  if (IsRun2()) offs -= 2; // constants were changed (Martino)
492  return (TMath::Abs(bucket)/10 + offs)%kMaxBSlots;
493 }
494 
495 
496 
497 #endif
Int_t fIntensTotal[2][2]
Definition: AliLHCData.h:276
Int_t GetNBunchConfigDeclared(int bm) const
Definition: AliLHCData.h:100
Int_t TimeDifference(double v1, double v2, double tol=0.9) const
Definition: AliLHCData.cxx:325
void SetTMin(Double_t t)
Definition: AliLHCData.h:92
AliLHCDipValF * GetEmittanceV(int bm, int i=0) const
Definition: AliLHCData.h:361
const TObjArray & GetData() const
Definition: AliLHCData.h:225
Int_t fBPTXdTRMSB1B2[2]
Definition: AliLHCData.h:302
AliLHCDipValF * GetBckgAlice(int bg, int i=0) const
Definition: AliLHCData.h:435
AliLHCDipValF * GetRCBetaStar(int i=0) const
Definition: AliLHCData.h:393
AliLHCDipValF * GetBPTXdeltaTRMSB1B2(int i=0) const
Definition: AliLHCData.h:443
AliLHCDipValF * GetTotalIntensity(int bm, int i=0) const
Definition: AliLHCData.h:345
TObject * FindRecValidFor(int start, int nrec, double tstamp) const
Definition: AliLHCData.cxx:361
const Int_t * GetOffsLuminosityAcqMode(int lr) const
Definition: AliLHCData.h:204
AliLHCDipValF * GetBunchLengths(int bm, int i=0) const
Definition: AliLHCData.h:337
Int_t fLHCBetaStarTargetOptic[2]
Definition: AliLHCData.h:296
Double_t fTMax
Definition: AliLHCData.h:261
Int_t fRCAngH[2]
Definition: AliLHCData.h:269
Int_t fIntensPerBunch[2][2]
Definition: AliLHCData.h:278
Int_t fCrossAngle[2][2]
Definition: AliLHCData.h:280
#define TObjArray
Int_t GetNLumiAlice() const
Definition: AliLHCData.h:120
Int_t GetNLHCBetaStarActive() const
Definition: AliLHCData.h:125
AliLHCDipValF * GetBeamSigmaV(int bm, int i=0) const
Definition: AliLHCData.h:369
Bool_t FillData(const TMap *dcsMap, double tmin=0, double tmax=1.e20)
Definition: AliLHCData.cxx:128
TObjArray fData
Definition: AliLHCData.h:309
Int_t GetNBPTXPhase(int bm) const
Definition: AliLHCData.h:131
static const Char_t * fgkDCSColJaws[]
Definition: AliLHCData.h:313
Int_t GetNBeamSigmaH(int bm) const
Definition: AliLHCData.h:107
virtual void Print(const Option_t *opt="") const
Definition: AliLHCData.cxx:816
AliLHCDipValF * GetLumiAliceSBDelivered(int i=0) const
Definition: AliLHCData.h:427
Int_t fLuminAcqMode[2][2]
Definition: AliLHCData.h:288
Int_t IsPilotPresent(int i=0) const
Int_t fLumiAliceBbB[2]
Definition: AliLHCData.h:294
const Int_t * GetOffsBckgAlice(int bg) const
Definition: AliLHCData.h:215
Int_t fBeamSigmaV[2][2]
Definition: AliLHCData.h:284
const Int_t * GetOffsBunchLengths(int bm) const
Definition: AliLHCData.h:193
AliLHCDipValF * GetEmittanceH(int bm, int i=0) const
Definition: AliLHCData.h:357
const Char_t * fkFile2Process
Definition: AliLHCData.h:317
Int_t fIntensTotalAv[2][2]
Definition: AliLHCData.h:277
Double_t GetTMin() const
Definition: AliLHCData.h:88
Int_t fLuminTotal[2][2]
Definition: AliLHCData.h:286
const Int_t * GetOffsLuminosityTotal(int lr) const
Definition: AliLHCData.h:202
Int_t FillScalarRecord(int refs[2], const char *rec, const char *recErr=0, Double_t maxAbsVal=1.e30)
Definition: AliLHCData.cxx:375
static const Char_t * fgkDCSColNames[]
Definition: AliLHCData.h:312
const Int_t * GetOffsLumiAliceSBDelivered() const
Definition: AliLHCData.h:213
AliLHCDipValF * GetLumiAliceBunch(int i=0) const
Definition: AliLHCData.h:431
Int_t GetNLuminosityTotal(int lr) const
Definition: AliLHCData.h:110
Int_t GetNBPTXPhaseShift(int bm) const
Definition: AliLHCData.h:133
const Int_t * GetOffsRCAngleH() const
Definition: AliLHCData.h:209
Int_t GetNBPTXdeltaTRMSB1B2() const
Definition: AliLHCData.h:130
const Int_t * GetOffsBPTXPhase(int bm) const
Definition: AliLHCData.h:219
Int_t fBPTXPhase[2][2]
Definition: AliLHCData.h:303
AliLHCDipValI * GetBunchConfigDeclared(int bm, int i=0) const
Definition: AliLHCData.h:341
Int_t GetNRCBetaStar() const
Definition: AliLHCData.h:116
const Int_t * GetOffsEmittanceV(int bm) const
Definition: AliLHCData.h:198
Int_t fLuminPerBC[2][2]
Definition: AliLHCData.h:287
AliLHCData(const AliLHCData &src)
Definition: AliLHCData.h:252
AliLHCDipValF * GetCrossAngle(int lr, int i=0) const
Definition: AliLHCData.h:385
Int_t GetNEmittanceH(int bm) const
Definition: AliLHCData.h:105
const Int_t * GetOffsLumiAliceBunch() const
Definition: AliLHCData.h:214
Int_t GetNLuminosityPerBunch(int lr) const
Definition: AliLHCData.h:111
Int_t FillScalarRecordInt(int refs[2], const char *rec, Int_t maxAbsVal=0x7fffffff)
Definition: AliLHCData.cxx:443
const Int_t * GetOffsEmittanceH(int bm) const
Definition: AliLHCData.h:197
Bool_t bg
Definition: RunAnaESD.C:6
Int_t fRCAngV[2]
Definition: AliLHCData.h:270
AliLHCDipValF * GetBPTXPhase(int bm, int i=0) const
Definition: AliLHCData.h:447
Int_t fBPTXPhaseShift[2][2]
Definition: AliLHCData.h:305
AliLHCDipValF * GetIntensityPerBunch(int bm, int i=0) const
Definition: AliLHCData.h:353
AliLHCDipValI * GetLHCBetaStarActive(int i=0) const
Definition: AliLHCData.h:422
Int_t fRCBeta[2]
Definition: AliLHCData.h:268
AliLHCDipValF * GetBeamSigmaH(int bm, int i=0) const
Definition: AliLHCData.h:365
Int_t FillBCLuminosities(int refs[2], const char *rec, const char *recErr, Int_t useBeam, Double_t maxAbsVal=1.e30)
Definition: AliLHCData.cxx:648
AliLHCDipValF * GetCollimJawPos(int coll, int jaw, int i=0) const
Definition: AliLHCData.h:405
const Int_t * GetOffsIntensityPerBunch(int bm) const
Definition: AliLHCData.h:196
Int_t GetNBPTXdeltaTB1B2() const
Definition: AliLHCData.h:129
AliLHCDipValC * GetLHCBetaStarTargetOptic(int i=0) const
Definition: AliLHCData.h:418
Int_t fLumiAlice[2]
Definition: AliLHCData.h:292
const Int_t * GetOffsCrossingAngle(int lr) const
Definition: AliLHCData.h:205
AliLHCDipValF * GetTotalIntensityAv(int bm, int i=0) const
Definition: AliLHCData.h:349
Int_t GetNInjectionScheme() const
Definition: AliLHCData.h:115
const Int_t * GetOffsRCBetaStar() const
Definition: AliLHCData.h:208
Int_t fBeamSigmaH[2][2]
Definition: AliLHCData.h:283
Double_t fTMin
Definition: AliLHCData.h:260
AliLHCData & operator=(const AliLHCData &)
Definition: AliLHCData.h:253
AliLHCDipValF * GetLuminosityPerBunch(int lr, int i=0) const
Definition: AliLHCData.h:377
Int_t GetNCrossingAngle(int lr) const
Definition: AliLHCData.h:113
void FlagInteractingBunches(const Int_t beam1[2], const Int_t beam2[2])
static const Char_t * fgkDCSNames[]
Definition: AliLHCData.h:311
const Int_t * GetOffsBPTXdeltaTB1B2() const
Definition: AliLHCData.h:217
AliLHCDipValF * GetLuminosityTotal(int lr, int i=0) const
Definition: AliLHCData.h:373
Int_t GetNTotalIntensityAv(int bm) const
Definition: AliLHCData.h:103
Int_t fBPTXdTB1B2[2]
Definition: AliLHCData.h:301
virtual void Clear(const Option_t *opt="")
Int_t GetNLumiAliceSBDelivered() const
Definition: AliLHCData.h:121
Int_t GetNBeamSigmaV(int bm) const
Definition: AliLHCData.h:108
AliLHCDipValI * GetLuminosityAcqMode(int lr, int i=0) const
Definition: AliLHCData.h:381
Int_t FillBunchConfig(int refs[2], const char *rec)
Definition: AliLHCData.cxx:481
const Int_t * GetOffsInjectionScheme() const
Definition: AliLHCData.h:207
void rec(const char *filename="raw.root")
Definition: rec.C:1
Int_t fEmittanceV[2][2]
Definition: AliLHCData.h:282
const Int_t * GetOffsLuminosityPerBunch(int lr) const
Definition: AliLHCData.h:203
Int_t GetFillNumber() const
Definition: AliLHCData.h:90
AliLHCDipValF * GetBPTXPhaseRMS(int bm, int i=0) const
Definition: AliLHCData.h:451
Int_t GetNCollimatorJawPos(int coll, int jaw) const
Definition: AliLHCData.h:325
Int_t FillStringRecord(int refs[2], const char *rec)
Definition: AliLHCData.cxx:555
Int_t fLHCBetaStarActive[2]
Definition: AliLHCData.h:297
AliLHCDipValI * GetBunchConfigMeasured(int bm, int i=0) const
Definition: AliLHCData.h:333
Int_t GetNLumiAliceBunch() const
Definition: AliLHCData.h:122
Int_t fLumiAliceSrc[2]
Definition: AliLHCData.h:295
Int_t fBunchConfDecl[2][2]
Definition: AliLHCData.h:271
Int_t GetNEmittanceV(int bm) const
Definition: AliLHCData.h:106
Int_t GetNBunchConfigMeasured(int bm) const
Definition: AliLHCData.h:99
Int_t GetNInteractingBunchesDeclared(int i=0) const
TObjArray * GetDCSEntry(const char *key, int &entry, int &last, double tmin, double tmax) const
Definition: AliLHCData.cxx:267
const Int_t * GetOffsCollimatorJawPos(int coll, int jaw) const
Definition: AliLHCData.h:329
Int_t fBPTXPhaseRMS[2][2]
Definition: AliLHCData.h:304
Double_t GetTMax() const
Definition: AliLHCData.h:89
Int_t GetBCId(int bucket, int beamID) const
Definition: AliLHCData.h:488
Int_t GetNIntensityPerBunch(int bm) const
Definition: AliLHCData.h:104
const Int_t * GetOffsBunchConfigMeasured(int bm) const
Definition: AliLHCData.h:191
AliLHCDipValC * GetLumiAliceSrc(int i=0) const
Definition: AliLHCData.h:414
const Int_t * GetOffsTotalIntensity(int bm) const
Definition: AliLHCData.h:194
Bool_t GoodPairID(int beam) const
Definition: AliLHCData.cxx:337
Int_t GetNRCAngleH() const
Definition: AliLHCData.h:117
AliLHCDipValF * GetBPTXPhaseShift(int bm, int i=0) const
Definition: AliLHCData.h:455
AliLHCDipValF * GetLumiAlice(int i=0) const
Definition: AliLHCData.h:410
Int_t GetNLuminosityAcqMode(int lr) const
Definition: AliLHCData.h:112
AliLHCDipValC * GetInjectionScheme(int i=0) const
Definition: AliLHCData.h:389
const TMap * fkMap2Process
name of DCS file
Definition: AliLHCData.h:318
Int_t GetNInteractingBunchesMeasured(int i=0) const
Int_t fFillNumber
Definition: AliLHCData.h:262
Int_t fBunchLengths[2][2]
Definition: AliLHCData.h:275
Int_t FillBunchInfo(int refs[2], const char *rec, int ibm, Bool_t inRealSlots, Double_t maxAbsVal=1.e30)
Definition: AliLHCData.cxx:588
const Int_t * GetOffsLumiAlice() const
Definition: AliLHCData.h:212
const Int_t * GetOffsBPTXPhaseRMS(int bm) const
Definition: AliLHCData.h:220
Int_t GetMeanIntensity(int beamID, Double_t &colliding, Double_t &noncolliding, const TObjArray *bcmasks=0) const
Int_t fBunchConfMeas[2][2]
Definition: AliLHCData.h:274
const Int_t * GetOffsBPTXdeltaTRMSB1B2() const
Definition: AliLHCData.h:218
const Int_t * GetOffsBeamSigmaH(int bm) const
Definition: AliLHCData.h:199
Int_t GetNTotalIntensity(int bm) const
Definition: AliLHCData.h:102
Int_t GetNBckgAlice(int bg) const
Definition: AliLHCData.h:127
virtual ~AliLHCData()
Definition: AliLHCData.h:84
Int_t GetNLumiAliceSrc() const
Definition: AliLHCData.h:123
Int_t ExtractInt(AliDCSArray *dcsArray, Int_t el) const
Definition: AliLHCData.cxx:752
const Int_t * GetOffsBeamSigmaV(int bm) const
Definition: AliLHCData.h:200
Int_t fBckgAlice[kNBGs][2]
Definition: AliLHCData.h:299
const Int_t * GetOffsBPTXPhaseShift(int bm) const
Definition: AliLHCData.h:221
Int_t GetNBPTXPhaseRMS(int bm) const
Definition: AliLHCData.h:132
Double_t ExtractDouble(AliDCSArray *dcsArray, Int_t el) const
Definition: AliLHCData.cxx:773
const Int_t * GetOffsBunchConfigDeclared(int bm) const
Definition: AliLHCData.h:192
Int_t GetNRCAngleV() const
Definition: AliLHCData.h:118
Bool_t IsRun2() const
Definition: AliLHCData.h:94
AliLHCDipValF * GetBPTXdeltaTB1B2(int i=0) const
Definition: AliLHCData.h:439
AliLHCDipValF * GetRCAngleV(int i=0) const
Definition: AliLHCData.h:401
Int_t fEmittanceH[2][2]
Definition: AliLHCData.h:281
Int_t FillAcqMode(int refs[2], const char *rec)
Definition: AliLHCData.cxx:521
Int_t GetNLHCBetaStarTargetOptic() const
Definition: AliLHCData.h:124
void SetTMax(Double_t t)
Definition: AliLHCData.h:93
AliLHCDipValF * GetRCAngleH(int i=0) const
Definition: AliLHCData.h:397
Int_t FindEntryValidFor(int start, int nrec, double tstamp) const
Definition: AliLHCData.h:477
const Int_t * GetOffsRCAngleV() const
Definition: AliLHCData.h:210
void SetFillNumber(Int_t fill)
Definition: AliLHCData.h:91
Bool_t IzZero(double val, double tol=1e-16) const
Definition: AliLHCData.h:255
Int_t fLumiAliceStB[2]
Definition: AliLHCData.h:293
Int_t GetNBunchLengths(int bm) const
Definition: AliLHCData.h:101
TString & ExtractString(AliDCSArray *dcsArray) const
Definition: AliLHCData.cxx:796
TGraph * ExportGraph(Int_t *coord, Int_t elID=0) const
Int_t fCollimators[kNCollimators][kNJaws][2]
Definition: AliLHCData.h:307
Int_t fRCInjScheme[2]
Definition: AliLHCData.h:267
const Int_t * GetOffsTotalIntensityAv(int bm) const
Definition: AliLHCData.h:195
void PrintAux(Bool_t full, const Int_t refs[2], const Option_t *opt="") const