]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSPlaneEffSSD.h
added slewing correction by data
[u/mrichter/AliRoot.git] / ITS / AliITSPlaneEffSSD.h
index 493bfbcdc37a4da314e8b3779488c6f35c479410..03971e7a2c7325eb92d37ad524e24afcb344179b 100644 (file)
@@ -7,6 +7,8 @@
 #include <TH2I.h>
 #include "AliITSPlaneEff.h"
 
+class AliCDBId;
+
 ///////////////////////////////////////////
 //                                       //
 // ITS Plane Efficiency class            //
@@ -24,12 +26,15 @@ class AliITSPlaneEffSSD :  public AliITSPlaneEff {
     AliITSPlaneEffSSD(const AliITSPlaneEffSSD &source);
     // ass. operator
     AliITSPlaneEffSSD& operator=(const AliITSPlaneEffSSD &s);
-    virtual AliITSPlaneEff& operator=(const AliITSPlaneEff &source);
+    //    virtual AliITSPlaneEff& operator=(const AliITSPlaneEff &source);
     // Simple way to add another class (i.e. statistics). 
     AliITSPlaneEffSSD& operator +=( const AliITSPlaneEffSSD &add);
     // Getters for average Plane efficiency (icluding dead/noisy)
     Double_t PlaneEff(const UInt_t mod) const;
     Double_t ErrPlaneEff(const UInt_t mod) const;
+    // Getters for fFound[] and fTried[]
+    Int_t GetFound(const UInt_t key) const;
+    Int_t GetTried(const UInt_t key) const;
     // Methods to update the Plane efficiency (specific of the SSD segmentation) 
     Bool_t UpDatePlaneEff(const Bool_t Kfound, const UInt_t mod);
     //
@@ -37,11 +42,6 @@ class AliITSPlaneEffSSD :  public AliITSPlaneEff {
     enum {kNChip = 6}; // The number of chips per side of a module (2 sides: 12 chips)
     enum {kNSide = 2}; // The number of sides of a module (p and n side)
     enum {kNStrip = 128}; // The number of strips per chip (in a module 2*768 strips)
-    //
-    enum {kNHisto = kNModule}; // The number of histograms: module by module.
-    //enum {kNclu = 3};          // Build specific histos of residuals up to cluster size kNclu.
-                               // If you change them, then you must change implementation of
-                               // the method FillHistos.
 //
 //  Plane efficiency for active  detector (excluding dead/noisy channels)
 //  access to DB is needed
@@ -53,8 +53,8 @@ class AliITSPlaneEffSSD :  public AliITSPlaneEff {
     virtual Double_t GetFracBad(const UInt_t mod) const;
     virtual Bool_t WriteIntoCDB() const;
     virtual Bool_t ReadFromCDB(); // this method reads Data Members (statistics) from DataBase
-    virtual Bool_t AddFromCDB()   // this method updates Data Members (statistics) from DataBase
-      {AliError("AddFromCDB: Still To be implemented"); return kFALSE;}
+    Bool_t AddFromCDB(AliCDBId *cdbId);   // this method updates Data Members (statistics) from DataBase
+    virtual Bool_t AddFromCDB() {AliCDBId *cdbId=0; return  AddFromCDB(cdbId);}
    // method to locate a basic block from Detector Local coordinate (to be used in tracking)
    // see file cxx for numbering convention.
    // here idet runs from 0 to 747 for layer 4 and from 0 to 949 for layer 5
@@ -64,36 +64,45 @@ class AliITSPlaneEffSSD :  public AliITSPlaneEff {
     Bool_t GetBlockBoundaries(const UInt_t key,Float_t& xmn,Float_t& xmx,Float_t& zmn,Float_t& zmx) const;
   // Methods for dealing with auxiliary histograms
     // method to set on/off the creation/updates of histograms (Histos are created/destroyed)
-    void   SetCreateHistos(Bool_t his=kFALSE)
+    virtual void   SetCreateHistos(Bool_t his=kFALSE)
          {fHis=his; if(fHis) {DeleteHistos(); InitHistos();} else DeleteHistos(); return; }
-    Bool_t FillHistos(UInt_t key, Bool_t found, Float_t trackXZ[2], Float_t clusterXZ[2], Int_t ctXZ[2]);
-    Bool_t WriteHistosToFile(TString filename="PlaneEffSSDHistos.root",Option_t* option = "RECREATE");
-    Bool_t ReadHistosFromFile(TString filename="PlaneEffSSDHistos.root"); // histos must exist already !
+    virtual Bool_t FillHistos(UInt_t key, Bool_t found, Float_t *track, Float_t *cluster, Int_t *ctype,Float_t*);
+    virtual Bool_t WriteHistosToFile(TString filename="PlaneEffSSDHistos.root",Option_t* option = "RECREATE");
+    virtual Bool_t ReadHistosFromFile(TString filename="PlaneEffSSDHistos.root"); // histos must exist already !
                                                                           // This method increases the
                                                                           // statistics of histos by adding
                                                                           // those of the input file.
+    UInt_t GetKey(const UInt_t mod) const; // unique key to locate the basic
+                                           // block of the SSD (the module itself)
  protected:
     virtual void Copy(TObject &obj) const;
-    void CopyHistos(AliITSPlaneEffSSD& target) const; // copy only histograms to target
     Int_t GetMissingTracksForGivenEff(Double_t eff, Double_t RelErr, UInt_t im) const;
+    UInt_t GetModFromKey(const UInt_t key) const;
+    void GetBadInModule(const UInt_t mod, UInt_t& bad) const;
 
 // 
     Int_t fFound[kNModule];  // number of associated clusters in a given module
     Int_t fTried[kNModule];  // number of tracks used for module efficiency evaluation
+//
+ private:
+    enum {kNHisto = kNModule}; // The number of histograms: module by module.
+    //enum {kNclu = 3};          // Build specific histos of residuals up to cluster size kNclu.
+                               // If you change them, then you must change implementation of
+                               // the method FillHistos.
+    virtual void InitHistos();    // create histos by allocating memory for them
+    virtual void DeleteHistos();  // deletete histos (memory is freed)
+    void CopyHistos(AliITSPlaneEffSSD& target) const; // copy only histograms to target
 //
     TH1F **fHisResX; //! histos with residual distribution (track-cluster) along local X (r-phi)
     TH1F **fHisResZ; //! histos with residual distribution (track-cluster) along local Z
     TH2F **fHisResXZ; //! 2-d histos with residual distribution (track-cluster) along local X and Z
     TH2I **fHisClusterSize; //! histos with cluster-size distribution
- private:
-    UInt_t GetKey(const UInt_t mod) const; // unique key to locate the basic 
-                                           // block of the SSD (the module itself)
-    UInt_t GetModFromKey(const UInt_t key) const;
-    void GetBadInModule(const UInt_t mod, UInt_t& bad) const;
-    void InitHistos();
-    void DeleteHistos();
-
-    ClassDef(AliITSPlaneEffSSD,2) // SSD Plane Efficiency class
+    TH1F **fHisTrackErrX; //! histos with track prediction error on Local X
+    TH1F **fHisTrackErrZ; //! histos with track prediction error on Local Z
+    TH1F **fHisClusErrX; //! histos with Local_X cluster error
+    TH1F **fHisClusErrZ; //! histos with Local_Z cluster error
+//
+    ClassDef(AliITSPlaneEffSSD,3) // SSD Plane Efficiency class
 };
 //
 inline UInt_t AliITSPlaneEffSSD::Nblock() const {return kNModule;}
@@ -112,5 +121,13 @@ zmn=-kconv*kDzDefault/2.; zmx=kconv*kDzDefault/2.;
 return kTRUE;
 }
 //
+inline Int_t AliITSPlaneEffSSD::GetFound(const UInt_t key) const {
+ if(key>=kNModule) {AliWarning("GetFound: you asked for a non existing key"); return -1;}
+ return fFound[key];
+}
+inline Int_t AliITSPlaneEffSSD::GetTried(const UInt_t key) const {
+ if(key>=kNModule) {AliWarning("GetTried: you asked for a non existing key"); return -1;}
+ return fTried[key];
+}
+//
 #endif
-