LCOV - code coverage report
Current view: top level - ITS/ITSbase - AliITSDriftSpeedSDD.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 10 18 55.6 %
Date: 2016-06-14 17:26:59 Functions: 7 20 35.0 %

          Line data    Source code
       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             : 
      20             : class AliITSDriftSpeedSDD : public TObject {
      21             :  public:
      22             :   AliITSDriftSpeedSDD();
      23             :   AliITSDriftSpeedSDD(Int_t ev, UInt_t timest, Int_t deg, Double_t *coeff);
      24             :   AliITSDriftSpeedSDD(const AliITSDriftSpeedSDD& drSpeed);
      25             :   AliITSDriftSpeedSDD& operator=(const AliITSDriftSpeedSDD& drSpeed); 
      26           0 :   virtual ~AliITSDriftSpeedSDD(){};
      27             : 
      28         358 :   static Float_t DefaultDriftSpeed() {return fgkDriftSpeedDefault;}
      29             :   virtual Bool_t IsEqual(const TObject *obj) const 
      30           0 :     {return fEvNum == ((AliITSDriftSpeedSDD*)obj)->fEvNum;}
      31        1230 :   virtual Bool_t      IsSortable() const { return kTRUE; }
      32             :   virtual Int_t       Compare(const TObject *obj) const 
      33        3444 :     {if(fEvNum<((AliITSDriftSpeedSDD*)obj)->fEvNum) return -1;
      34        3444 :     else if(fEvNum>((AliITSDriftSpeedSDD*)obj)->fEvNum) return 1;
      35        1722 :     else return 0; }
      36             : 
      37             :   void PrintDriftSpeedParameters() const;
      38           0 :   void SetDegreeofPoly(Int_t deg) {fPolDeg = deg>fgkMaxPolDeg ? fgkMaxPolDeg : deg;}
      39           0 :   Int_t GetDegreeofPoly() const {return fPolDeg;}
      40        4292 :   Int_t GetEventNumber() const {return fEvNum;}
      41           0 :   UInt_t GetEventTimestamp() const {return fTimestamp;}
      42           0 :   Float_t GetDriftSpeedParameter(Int_t i) const {return fDriftSpeedParam[i];}
      43           0 :   void    SetDriftSpeedParameter(Int_t i,Float_t par)  {if (i<=fPolDeg) fDriftSpeedParam[i] = par;}
      44             :   Double_t GetDriftSpeedAtAnode(Double_t nAnode) const{
      45        4292 :     Double_t drSpeed=fDriftSpeedParam[fgkMaxPolDeg];
      46       25752 :     for(Int_t i=fgkMaxPolDeg-1; i>=0; --i) drSpeed=fDriftSpeedParam[i]+nAnode*drSpeed;
      47        2146 :     return drSpeed;
      48             :   }
      49           0 :   static UShort_t GetMaxPolDeg() {return fgkMaxPolDeg;}
      50             : 
      51             :  protected:
      52             :   static const Float_t fgkDriftSpeedDefault; // default for drift speed
      53             :   static const UShort_t fgkMaxPolDeg=5; // max. degree of the poly fit
      54             : 
      55             :   Int_t fEvNum;  // event number of injector event
      56             :   UInt_t fTimestamp; // event timestamp
      57             :   Char_t fPolDeg;    // degree of the ploy fit to drift speed vs. anode
      58             :                      // saved as char since 1 byte is enough
      59             :   Float_t fDriftSpeedParam[fgkMaxPolDeg+1];  // coefficients of the poly fit
      60       15724 :   ClassDef(AliITSDriftSpeedSDD,4);
      61             : };
      62             : #endif

Generated by: LCOV version 1.11