- fixing warnings/coverity
[u/mrichter/AliRoot.git] / ITS / AliITSDriftSpeedSDD.h
CommitLineData
18da6e54 1#ifndef ALIITSDRIFTSPEEDSDD_H
2#define ALIITSDRIFTSPEEDSDD_H
3/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8///////////////////////////////////////////////////////////////////
9// //
10// Class for SDD drift speed extracted from injector triggers //
11// drift speed dependence on anode number is parametrized via //
12// a polynomial function (3rd degree by default, max. 5th degree)//
13// Origin: F.Prino, Torino, prino@to.infn.it //
14// //
15///////////////////////////////////////////////////////////////////
16
17#include<TObject.h>
18#include<TMath.h>
19
20class AliITSDriftSpeedSDD : public TObject {
21 public:
22 AliITSDriftSpeedSDD();
4c1bcb5e 23 AliITSDriftSpeedSDD(Int_t ev, UInt_t timest, Int_t deg, Double_t *coeff);
18da6e54 24 AliITSDriftSpeedSDD(const AliITSDriftSpeedSDD& drSpeed);
25 virtual ~AliITSDriftSpeedSDD(){};
26
253e68a0 27 static Float_t DefaultDriftSpeed() {return fgkDriftSpeedDefault;}
18da6e54 28 virtual Bool_t IsEqual(const TObject *obj) const
29 {return fEvNum == ((AliITSDriftSpeedSDD*)obj)->fEvNum;}
30 virtual Bool_t IsSortable() const { return kTRUE; }
31 virtual Int_t Compare(const TObject *obj) const
32 {if(fEvNum<((AliITSDriftSpeedSDD*)obj)->fEvNum) return -1;
33 else if(fEvNum>((AliITSDriftSpeedSDD*)obj)->fEvNum) return 1;
34 else return 0; }
35
36 void PrintDriftSpeedParameters() const;
37
915c0469 38 Int_t GetDegreeofPoly() const {return fPolDeg;}
18da6e54 39 Int_t GetEventNumber() const {return fEvNum;}
40 UInt_t GetEventTimestamp() const {return fTimestamp;}
ab516493 41 Float_t GetDriftSpeedParameter(Int_t i) const {return fDriftSpeedParam[i];}
4c1bcb5e 42 Double_t GetDriftSpeedAtAnode(Double_t nAnode) const{
43 Double_t drSpeed=fDriftSpeedParam[fgkMaxPolDeg];
44 for(Int_t i=fgkMaxPolDeg-1; i>=0; --i) drSpeed=fDriftSpeedParam[i]+nAnode*drSpeed;
18da6e54 45 return drSpeed;
46 }
7a8c5708 47 static UShort_t GetMaxPolDeg() {return fgkMaxPolDeg;}
18da6e54 48
49 protected:
253e68a0 50 static const Float_t fgkDriftSpeedDefault; // default for drift speed
ab516493 51 static const UShort_t fgkMaxPolDeg=5; // max. degree of the poly fit
253e68a0 52
18da6e54 53 Int_t fEvNum; // event number of injector event
54 UInt_t fTimestamp; // event timestamp
ab516493 55 Char_t fPolDeg; // degree of the ploy fit to drift speed vs. anode
56 // saved as char since 1 byte is enough
57 Float_t fDriftSpeedParam[fgkMaxPolDeg+1]; // coefficients of the poly fit
253e68a0 58 ClassDef(AliITSDriftSpeedSDD,4);
18da6e54 59};
60#endif