]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSPlaneEffSDD.h
Change to take into account the different format of in subversion when compared...
[u/mrichter/AliRoot.git] / ITS / AliITSPlaneEffSDD.h
1 #ifndef ALIITSPLANEEFFSDD_H
2 #define ALIITSPLANEEFFSDD_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 SDD                         //
13 // Origin: Giuseppe.Bruno@ba.infn.it     //
14 ///////////////////////////////////////////
15
16 /* $Id$ */
17   
18 class AliITSPlaneEffSDD :  public AliITSPlaneEff {
19  public:
20     AliITSPlaneEffSDD(); // default constructor
21     virtual ~AliITSPlaneEffSDD(); // destructror
22     // copy constructor
23     AliITSPlaneEffSDD(const AliITSPlaneEffSDD &source);
24     // ass. operator
25     AliITSPlaneEffSDD& operator=(const AliITSPlaneEffSDD &s);
26     virtual AliITSPlaneEff& operator=(const AliITSPlaneEff &source);
27     // Simple way to add another class (i.e. statistics). 
28     AliITSPlaneEffSDD& operator +=( const AliITSPlaneEffSDD &add);
29     // Getters for average Plane efficiency (icluding dead/noisy)
30     Double_t PlaneEff(const UInt_t mod, const UInt_t chip, 
31                       const UInt_t wing, const UInt_t subw=0) const;
32     Double_t ErrPlaneEff(const UInt_t mod, const UInt_t chip,
33                          const UInt_t wing, const UInt_t subw=0) const;
34     Double_t PlaneEff(const UInt_t key) const 
35        {return PlaneEff(GetModFromKey(key),GetChipFromKey(key),
36                         GetWingFromKey(key),GetSubWingFromKey(key));};
37     Double_t ErrPlaneEff(const UInt_t key) const 
38        {return ErrPlaneEff(GetModFromKey(key),GetChipFromKey(key),
39                            GetWingFromKey(key),GetSubWingFromKey(key));};
40     // Methods to update the Plane efficiency (specific of the SDD segmentation) 
41     Bool_t UpDatePlaneEff(const Bool_t Kfound, const UInt_t mod, 
42                           const UInt_t chip, const UInt_t wing, const UInt_t subw=0);
43     virtual Bool_t UpDatePlaneEff(const Bool_t Kfound, const UInt_t key)
44       {return UpDatePlaneEff(Kfound,GetModFromKey(key),GetChipFromKey(key),
45                              GetWingFromKey(key),GetSubWingFromKey(key));};
46     //
47     enum {kNModule = 260}; // The number of modules (i.e. detector 7.25*7.53 cm^2)
48     enum {kNChip = 4}; // The number of chips per half module (i.e. per wing, in total 4+4 chips)
49     enum {kNWing = 2}; // The number of wings (this is hardware division of the module) 
50     enum {kNSubWing = 1}; // Eventually sub-divide each wing (by 2 ?) to account for different 
51                           // efficiencies due to different drift times.  
52     enum {kNAnode = 64};   // Number of channels/chip (i.e. anodes per chip)
53     enum {kNTimeBin = 72};   // granularity along drift direction (i.e. segmentation in r-phi)
54 //
55 //  Plane efficiency for active  detector (excluding dead/noisy channels)
56 //  access to DB is needed
57     virtual Double_t LivePlaneEff(UInt_t key) const;
58     Double_t LivePlaneEff(const UInt_t mod, const UInt_t chip, 
59                           const UInt_t wing, const UInt_t subw=0) const
60        {return LivePlaneEff(GetKey(mod,chip,wing,subw));};
61     virtual Double_t ErrLivePlaneEff(UInt_t key) const;
62     Double_t ErrLivePlaneEff(const UInt_t mod, const UInt_t chip,
63                              const UInt_t wing, const UInt_t subw=0) const
64        {return ErrLivePlaneEff(GetKey(mod,chip,wing,subw));};
65     // Compute the fraction of Live area (of the CHIP/SubWing for the SDD)
66     virtual Double_t GetFracLive(const UInt_t key) const;
67     // Compute the fraction of bad (i.e. dead and noisy) area (of the CHIP/SubWing for the SDD)
68     virtual Double_t GetFracBad(const UInt_t key) const;
69     virtual Bool_t WriteIntoCDB() const;
70     virtual Bool_t ReadFromCDB(); // this method reads Data Members (statistics) from DataBase
71     virtual Bool_t AddFromCDB()   // this method updates Data Members (statistics) from DataBase
72       {AliError("AddFromCDB: Still To be implemented"); return kFALSE;}
73
74  protected:
75     virtual void Copy(TObject &obj) const;
76     Int_t GetMissingTracksForGivenEff(Double_t eff, Double_t RelErr, 
77                                       UInt_t im, UInt_t ic, UInt_t iw,  UInt_t isw=0) const;
78 // 
79     Int_t fFound[kNModule*kNChip*kNWing*kNSubWing]; // number of associated clusters in a given block
80     Int_t fTried[kNModule*kNChip*kNWing*kNSubWing]; // number of tracks used for efficiency evaluation
81  private:
82     UInt_t GetKey(const UInt_t mod, const UInt_t chip,           // unique key to locate the 
83                   const UInt_t wing, const UInt_t subw=0) const; // basic block of the SDD
84     UInt_t GetModFromKey(const UInt_t key) const;
85     UInt_t GetChipFromKey(const UInt_t key) const;
86     UInt_t GetWingFromKey(const UInt_t key) const;
87     UInt_t GetSubWingFromKey(const UInt_t key) const;
88     // getters for chip and wing numbers, given the anode number [0,511]
89     UInt_t ChipFromAnode(const UInt_t anode) const; // return the chip number (from 0 to kNChip-1)
90     UInt_t WingFromAnode(const UInt_t anode) const; // return the wing number (from 0 to kNWing-1)
91     void   ChipAndWingFromAnode(const UInt_t anode,UInt_t& chip,UInt_t& wing) const; 
92     //
93     void GetAllFromKey(const UInt_t key, UInt_t& mod, UInt_t& chip, 
94                        UInt_t& wing, UInt_t& subw) const;
95     void GetBadInBlock(const UInt_t key, UInt_t& bad) const;
96
97     ClassDef(AliITSPlaneEffSDD,1) // SDD Plane Efficiency class
98 };
99 #endif
100