]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSPlaneEff.h
- Protection added for null or empty input chains
[u/mrichter/AliRoot.git] / ITS / AliITSPlaneEff.h
1 #ifndef ALIITSPLANEEFF_H
2 #define ALIITSPLANEEFF_H
3 /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 #include <TObject.h>
7 #include <TString.h>
8 #include "AliLog.h"
9
10 class AliITSsegmentation;
11 class TF1;
12 class AliITSgeom;
13
14 ////////////////////////////////////////////////////
15 //                                                //
16 // ITS virtual base class for Plane Efficiency    //
17 // Origin: Giuseppe.Bruno@ba.infn.it              //
18 //                                                //
19 ////////////////////////////////////////////////////
20
21 /* $Id$ */
22
23 class AliITSPlaneEff : public TObject {
24  public:
25  
26     AliITSPlaneEff();// Default constructor
27     // Standard constructor
28     //AliITSPlaneEff(AliITSDetTypeSim *dettyp);
29     virtual ~AliITSPlaneEff(){;};
30     // copy constructor. See detector specific implementation.
31     AliITSPlaneEff(const AliITSPlaneEff &source);
32     // Assignment operator. See detector specific implementation.
33     virtual AliITSPlaneEff& operator=(const AliITSPlaneEff &source);
34     // Simple way to add another class (i.e. statistics). 
35     //AliITSPlaneEff& operator +=( const AliITSPlaneEff &){return *this};
36     // Average Plane efficiency (including dead/noisy)
37     Int_t   GetRunNumber() const {return fRunNumber;}
38     void    SetRunNumber(Int_t n) {fRunNumber=n;}
39     //
40     Double_t PlaneEff(Int_t nfound,Int_t ntried) const;     
41     Double_t ErrPlaneEff(Int_t nfound,Int_t ntried) const; 
42     virtual void GetPlaneEff(Int_t nfound,Int_t ntried,Double_t &eff, Double_t &err) const
43         {eff=PlaneEff(nfound,ntried); err=ErrPlaneEff(nfound,ntried); return;};
44     // Plane efficiency for active  detector (excluding dead/noisy channels)
45     virtual Double_t LivePlaneEff(UInt_t) const
46        {AliWarning("This method gives just a rough estimate of the live-Det Efficiency!"); 
47         return -1.;};
48     virtual Double_t ErrLivePlaneEff(UInt_t) const
49        {AliError("This method must be implemented in a derived class"); return -1.;};
50     // Compute the fraction of Live detector
51     virtual Double_t GetFracLive(const UInt_t) const
52        {AliError("This method must be implemented in a derived class"); return -1.;}; 
53     // Compute the fraction of Bad (i.e. dead + noisy) detector 
54     virtual Double_t GetFracBad(const UInt_t) const
55        {AliError("This method must be implemented in a derived class"); return -1.;}; 
56     // Update the Counting of the plane efficiency
57     virtual Bool_t UpDatePlaneEff(const Bool_t, const UInt_t) 
58        {AliError("This method must be implemented in a derived class"); return kFALSE;};
59     // Estimate of the number of tracks needed for measuring efficiency within RelErr
60     virtual Int_t GetNTracksForGivenEff(Double_t eff, Double_t RelErr) const;
61     void SetDefaultStorage(const char* uri);
62     // Write into the data base 
63     virtual Bool_t WriteIntoCDB() const
64        {AliError("This method must be implemented in a derived class"); return kFALSE;};
65     virtual Bool_t ReadFromCDB()
66        {AliError("This method must be implemented in a derived class"); return kFALSE;};
67     virtual Bool_t AddFromCDB()
68        {AliError("This method must be implemented in a derived class"); return kFALSE;};
69
70  protected:
71
72     void InitCDB();
73     virtual void Copy(TObject &obj) const;
74     void NotImplemented(const char *method) const {if(gDebug>0)
75          Warning(method,"This method is not implemented for this sub-class");}
76     Int_t       fRunNumber;     //! run number (to access CDB)
77     TString     fCDBUri;        //! Uri of the default CDB storage
78     Bool_t      fInitCDBCalled; //! flag to check if CDB storages are already initialized
79    
80  private:
81     //Int_t*    fFound;         // number of associated clusters into a given block (e.g. SPD 1200 chip)
82     //Int_t*    fTries;         // number of exspected  clusters into a given block (e.g. SPD 1200 chip)
83     //Int_t     fRunNumber;     // run number (to access CDB)
84
85     ClassDef(AliITSPlaneEff,1) // ITS Plane Efficiency virtual base class 
86 };
87 #endif