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 */
7 #include "AliITSPlaneEff.h"
9 ///////////////////////////////////////////
11 // ITS Plane Efficiency class //
13 // Origin: Giuseppe.Bruno@ba.infn.it //
14 ///////////////////////////////////////////
18 class AliITSPlaneEffSPD : public AliITSPlaneEff {
20 AliITSPlaneEffSPD(); // default constructor
21 virtual ~AliITSPlaneEffSPD(); // destructror
23 AliITSPlaneEffSPD(const AliITSPlaneEffSPD &source);
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));};
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)
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;}
65 virtual void Copy(TObject &obj) const;
66 Int_t GetMissingTracksForGivenEff(Double_t eff, Double_t RelErr, UInt_t im, UInt_t ic) const;
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
72 UInt_t GetKey(const UInt_t mod, const UInt_t chip) const; // unique key to locate the basic
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;
80 ClassDef(AliITSPlaneEffSPD,1) // SPD Plane Efficiency class