]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITS.h
Posible memory leak fixed. Changes AliITSpList destructor. Not clear if
[u/mrichter/AliRoot.git] / ITS / AliITS.h
index 5da33cc75a862eb57d57c676ed2f2fb3a5333ffa..db83fe6e688f5499db263d485f31312083b25f97 100644 (file)
@@ -10,7 +10,9 @@
 ////////////////////////////////////////////////////////////////////////
 
 #include <TObjArray.h> // used in inline function GetModule.
+#include <TBranch.h>   // used in inline function SetHitsAddressBranch
 
+#include "AliRun.h"
 #include "AliDetector.h"
 
 class TString;
@@ -54,6 +56,8 @@ class AliITS : public AliDetector {
     //-------------------- Geometry Transformations --------------------
     // ITS geometry functions
     AliITSgeom   *GetITSgeom() const {return fITSgeom;}
+    // Sets ITS geometry ! be very careful using this function.
+    void   SetITSgeom(AliITSgeom *geom) {fITSgeom = geom;}
     // return pointer to the array of modules
     TObjArray    *GetModules() const {return fITSmodules;}
     // return pointer to a particular module
@@ -67,6 +71,8 @@ class AliITS : public AliDetector {
     virtual void SetDefaultClusterFinders();
     virtual void MakeBranch(Option_t *opt=" ", const char *file=0);
     virtual void SetTreeAddress();
+    // For a give branch from the treeH sets the TClonesArray address.
+    virtual void SetHitsAddressBranch(TBranch *b){b->SetAddress(&fHits);}
     // Return pointer to DetType #id
     AliITSDetType *DetType(Int_t id);
     //Int_t           NDetTypes() {return fNDetTypes;}
@@ -99,11 +105,15 @@ class AliITS : public AliDetector {
     //===================== Digitisation ===============================
     void MakeBranchS(const char *file);
     void SetTreeAddressS(TTree *treeS);
-    void MakeBranchD(const char *file);
+    TClonesArray * GetSDigits() { return fSDigits; }
+    void MakeBranchInTreeD(TTree *treeD,const char *file=0);
+    void MakeBranchD(const char *file){
+       MakeBranchInTreeD(gAlice->TreeD(),file);}
     void SetTreeAddressD(TTree *treeD);
     void Hits2SDigits(); // Turn hits into SDigits
     void Hits2PreDigits(); // Turn hits into SDigits
-    void SDigits2Digits(); // Turn SDigits to Digits
+    void SDigits2Digits(){SDigitsToDigits("All");} // Turn SDigits to Digits
+    void SDigitsToDigits(Option_t *opt="All"); // Turn SDigits to Digits
     void Hits2Digits(); // Turn hits straight into Digits.
     //------------------ Internal functions ----------------------------
     // Standard Hits To SDigits function
@@ -165,19 +175,18 @@ class AliITS : public AliDetector {
  protected:
     //================== Data Members ==================================
     AliITSgeom   *fITSgeom;    // Pointer to ITS geometry
-    Bool_t       fEuclidOut;   // Flag to write geometry in euclid format
+    Bool_t        fEuclidOut;  // Flag to write geometry in euclid format
     TObjArray    *fITSmodules; //! Pointer to ITS modules
     Option_t     *fOpt;        //! Detector option ="All" unless changed.
 
-    Int_t        fIdN;         // the number of layers
+    Int_t         fIdN;        // the number of layers
     Int_t        *fIdSens;     //[fIdN] layer identifier
     TString      *fIdName;     //[fIdN] layer identifier
 
-    Int_t        fNDetTypes;   // Number of detector types
+    Int_t         fNDetTypes;  // Number of detector types
     TObjArray    *fDetTypes;   // List of detector types
 
-//    TObjArray    *fSDigits;    // List of Summable digits.
-    TClonesArray  *fSDigits;   // List of Summable digits.
+    TClonesArray  *fSDigits;    // List of Summable digits.
     Int_t         fNSDigits;   // Number of Summable Digits.
 
     TObjArray    *fDtype;      // List of digits