]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSPlaneEffSPD.h
Plane efficiency for SDD and SSD. Minor modifications for SPD (G. Bruno)
[u/mrichter/AliRoot.git] / ITS / AliITSPlaneEffSPD.h
1 #ifndef ALIITSPLANEEFFSPD_H
2 #define ALIITSPLANEEFFSPD_H
3 /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7 #include "AliITSPlaneEff.h"
8
9 ///////////////////////////////////////////
10 //                                       //
11 // ITS Plane Efficiency class            //
12 //       for SPD                         //
13 // Origin: Giuseppe.Bruno@ba.infn.it     //
14 ///////////////////////////////////////////
15
16 /* $Id$ */
17   
18 class AliITSPlaneEffSPD :  public AliITSPlaneEff {
19  public:
20     AliITSPlaneEffSPD(); // default constructor
21     virtual ~AliITSPlaneEffSPD(); // destructror
22     // copy constructor
23     AliITSPlaneEffSPD(const AliITSPlaneEffSPD &source);
24     // ass. operator
25     AliITSPlaneEffSPD& operator=(const AliITSPlaneEffSPD &s);
26     virtual AliITSPlaneEff& operator=(const AliITSPlaneEff &source);
27     // Simple way to add another class (i.e. statistics). 
28     AliITSPlaneEffSPD& operator +=( const AliITSPlaneEffSPD &add);
29     // Getters for average Plane efficiency (icluding dead/noisy)
30     Double_t PlaneEff(const UInt_t mod, const UInt_t chip) const;
31     Double_t ErrPlaneEff(const UInt_t mod, const UInt_t chip) const;
32     Double_t PlaneEff(const UInt_t key) const 
33         {return PlaneEff(GetModFromKey(key),GetChipFromKey(key));};
34     Double_t ErrPlaneEff(const UInt_t key) const 
35         {return ErrPlaneEff(GetModFromKey(key),GetChipFromKey(key));};
36     // Methods to update the Plane efficiency (specific of the SPD segmentation) 
37     Bool_t UpDatePlaneEff(const Bool_t Kfound, const UInt_t mod, const UInt_t chip);
38     virtual Bool_t UpDatePlaneEff(const Bool_t Kfound, const UInt_t key)
39         {return UpDatePlaneEff(Kfound,GetModFromKey(key),GetChipFromKey(key));};
40     //
41     enum {kNModule = 240}; // The number of modules
42     enum {kNChip = 5}; // The number of chips per module
43     enum {kNCol = 32}; // The number of columns per chip
44     enum {kNRow = 256}; // The number of rows per chip (and per module)
45 //
46 //  UInt_t GetChip(const UInt_t col) const; // get the chip number (from 0 to kNChip)
47 //  Plane efficiency for active  detector (excluding dead/noisy channels)
48 //  access to DB is needed
49     virtual Double_t LivePlaneEff(UInt_t key) const;
50     Double_t LivePlaneEff(const UInt_t mod, const UInt_t chip) const
51        {return LivePlaneEff(GetKey(mod,chip));};
52     virtual Double_t ErrLivePlaneEff(UInt_t key) const;
53     Double_t ErrLivePlaneEff(const UInt_t mod, const UInt_t chip) const
54        {return ErrLivePlaneEff(GetKey(mod,chip));};
55     // Compute the fraction of Live area (of the CHIP for the SPD)
56     virtual Double_t GetFracLive(const UInt_t key) const;
57     // Compute the fraction of bad (i.e. dead and noisy) area (of the CHIP for the SPD)
58     virtual Double_t GetFracBad(const UInt_t key) const;
59     virtual Bool_t WriteIntoCDB() const;
60     virtual Bool_t ReadFromCDB(); // this method reads Data Members (statistics) from DataBase
61     virtual Bool_t AddFromCDB()   // this method updates Data Members (statistics) from DataBase
62       {AliError("AddFromCDB: Still To be implemented"); return kFALSE;}
63
64  protected:
65     virtual void Copy(TObject &obj) const;
66     Int_t GetMissingTracksForGivenEff(Double_t eff, Double_t RelErr, UInt_t im, UInt_t ic) const;
67
68 // 
69     Int_t fFound[kNModule*kNChip];  // number of associated clusters in a given chip
70     Int_t fTried[kNModule*kNChip];  // number of tracks used for chip efficiency evaluation
71  private:
72     UInt_t GetKey(const UInt_t mod, const UInt_t chip) const; // unique key to locate the basic 
73                                                               // block of the SPD 
74     UInt_t GetModFromKey(const UInt_t key) const;
75     UInt_t GetChipFromKey(const UInt_t key) const;
76     UInt_t GetChipFromCol(const UInt_t col) const;  // get the chip number (from 0 to kNChip)
77     void GetModAndChipFromKey(const UInt_t key, UInt_t& mod, UInt_t& chip) const;
78     void GetDeadAndNoisyInChip(const UInt_t key, UInt_t& dead, UInt_t& noisy) const;
79
80     ClassDef(AliITSPlaneEffSPD,1) // SPD Plane Efficiency class
81 };
82 #endif
83