]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITS.h
Modifications associated with remerging the Ba/Sa and Dubna pixel simulations,
[u/mrichter/AliRoot.git] / ITS / AliITS.h
index 4fb231a2430a52bdc10a632a7a6310c5669d2aef..29aec99036f91604d814639dd896f3410d7a1b49 100644 (file)
@@ -12,7 +12,6 @@
 #include <TObjArray.h> // used in inline function GetModule.
 #include <TBranch.h>   // used in inline function SetHitsAddressBranch
 
-#include "AliRun.h"
 #include "AliLoader.h"
 #include "AliDetector.h"
 #include "AliITSDetType.h"
@@ -34,6 +33,9 @@ class AliITSdigit;
 class AliITSRecPoint;
 class AliITSRawCluster;
 class AliITSmodule;
+class AliVertexer;
+class AliDigitizer;
+class AliRunDigitizer;
 
 const Int_t kNTYPES=3;
 
@@ -47,7 +49,7 @@ class AliITS : public AliDetector {
     AliITS(const AliITS &source); // copy constructor. Not to be used!
     AliITS& operator=(AliITS &source); // = operator. Not to be used!
     virtual Int_t IsVersion() const {return 1;}
-    virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) const;
+    virtual Int_t DistancetoPrimitive(Int_t,Int_t) const{return 999;};
 
     //===================== Simulation Geometry ========================
     // get geometry version - detailed (major) or coarse (minor)
@@ -56,6 +58,7 @@ class AliITS : public AliDetector {
     virtual void  GetGeometryVersion(Int_t &a,Int_t &b) 
                           {a = GetMajorVersion();b=GetMinorVersion();return;}
     virtual void  SetEUCLID(Bool_t euclid=kTRUE) {fEuclidOut = euclid;}
+    virtual Bool_t GetEUCLID()const {return fEuclidOut;}
     //-------------------- Geometry Transformations --------------------
     // ITS geometry functions
     AliITSgeom   *GetITSgeom() const {return fITSgeom;}
@@ -78,7 +81,8 @@ class AliITS : public AliDetector {
     // For a given 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);
+    AliITSDetType *DetType(Int_t id){
+        return ((AliITSDetType*) fDetTypes->At(id));};
     //Int_t           NDetTypes() {return fNDetTypes;}
     //---------- Configuration Methods (per detector type) -------------
     // Determines which ITS subdetectors will be processed. Effects
@@ -87,18 +91,23 @@ class AliITS : public AliDetector {
     // Returns the list of ITS subdetectors that will be processed.
     Option_t* GetDetectors(){return fOpt;}
     // Set response 
-    virtual void SetResponseModel(Int_t id, AliITSresponse *response);
+    virtual void SetResponseModel(Int_t id, AliITSresponse *response){
+        ((AliITSDetType*) fDetTypes->At(id))->ResponseModel(response);};
     // Set segmentation 
-    virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg);
+    virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg){
+        ((AliITSDetType*) fDetTypes->At(id))->SegmentationModel(seg);};
     // Set simulation - temporary 
-    virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim);
+    virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim){
+        ((AliITSDetType*) fDetTypes->At(id))->SimulationModel(sim);};
     // Set simulation - temporary 
     virtual AliITSsimulation* GetSimulationModel(Int_t id){
        return ((AliITSDetType*)(fDetTypes->At(id)))->GetSimulationModel();}
     // Set reconstruction 
-    virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec);
+    virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec){
+        ((AliITSDetType*) fDetTypes->At(id))->ReconstructionModel(rec);};
     // Set class names for digit and rec point 
-    virtual void SetClasses(Int_t id, const char *digit, const char *cluster);
+    virtual void SetClasses(Int_t id, const char *digit, const char *cluster){
+        ((AliITSDetType*) fDetTypes->At(id))->ClassNames(digit,cluster);};
 
     //=================== Hits =========================================
     virtual void StepManager() {} // See Step Manager for specific geometry.
@@ -107,8 +116,8 @@ class AliITS : public AliDetector {
     virtual void InitModules(Int_t size,Int_t &nmodules);  
     virtual void FillModules(TTree *treeH, Int_t mask = 0);
     virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
-                            Option_t *opt,Text_t *filename);
-    virtual void ClearModules();
+                            Option_t *opt, const char *filename);
+    virtual void ClearModules(){if(fITSmodules) fITSmodules->Delete();};
 
     //===================== Digitisation ===============================
     void MakeBranchS(const char *file);
@@ -116,24 +125,30 @@ class AliITS : public AliDetector {
     TClonesArray * GetSDigits() { return fSDigits; }
     void MakeBranchInTreeD(TTree *treeD,const char *file=0);
     void MakeBranchD(const char *file){
-       MakeBranchInTreeD(gAlice->TreeD(),file);}
+       MakeBranchInTreeD(GetLoader()->TreeD(),file);}
     void SetTreeAddressD(TTree *treeD);
     void Hits2SDigits(); // Turn hits into SDigits
-    void Hits2PreDigits(); // Turn hits into SDigits
+    void Hits2PreDigits(){ // Turn hits into SDigits
+        HitsToPreDigits(fLoader->GetEvent(),
+            /*fLoader->GetRunLoader()->GetHeader()->GetEvent(),*/
+                        0,-1," ",fOpt," ");};
+    AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
     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
     void HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size,
-                 Option_t *add, Option_t *det, Text_t *filename);
+                       Option_t *add, Option_t *det, const char *filename)
+        {HitsToPreDigits(evNumber,bgrev,size,add,det,filename);};
     // Standard Hits To SDigits function
     void HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
-                 Option_t *add, Option_t *det, Text_t *filename);
+                 Option_t *add, Option_t *det, const char *filename);
     // Standard Hits To Digits function
     void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
-                 Option_t *add, Option_t *det, Text_t *filename);
-    void ResetSDigits();                  // Resets the Summable digits.
+                 Option_t *add, Option_t *det, const char *filename);
+    // Resets the Summable digits.
+    void ResetSDigits(){if(fSDigits) fSDigits->Clear();fNSDigits = 0;};
     void ResetDigits();                   // depending on how the
     void ResetDigits(Int_t branch);       // tree will be filled only
     void AddSumDigit(AliITSpListItem &sdig);
@@ -146,19 +161,19 @@ class AliITS : public AliDetector {
     Int_t        *Ndtype() {return fNdtype;}
     TClonesArray *DigitsAddress(Int_t id)
        {return ((TClonesArray *) (*fDtype)[id]);}
+    void SelectVertexer(TString sel=" "){fSelectedVertexer = sel;}
 
     //===================== Raw Data IO ================================
     // Write digits into raw data format
-    virtual void Digits2RawData() {}
-    // Decode raw data and store digits
-    virtual void RawData2Digits() {}
+    virtual void Digits2Raw();
 
     //==================== Clusterization ==============================
     // create separate tree for clusters - declustering refining
     void MakeTreeC(Option_t *option="C");
     void GetTreeC(Int_t event);
     void AddCluster(Int_t branch, AliITSRawCluster *c);
-    void ResetClusters();                 // one of the methods in 
+    // one of the methods in
+    void ResetClusters(){for(Int_t i=0;i<kNTYPES;i++ ) ResetClusters(i);}; 
     void ResetClusters(Int_t branch);     // the pair will be kept
     // Return pointers to clusters 
     TObjArray    *Ctype() {return fCtype;}
@@ -173,13 +188,13 @@ class AliITS : public AliDetector {
     void SetTreeAddressR(TTree *treeR);
     void AddRecPoint(const AliITSRecPoint &p);
     void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
-                 Option_t *add, Option_t *det, Text_t *filename);
-    void Digits2Reco();
+                 Option_t *add, Option_t *det, const char *filename);
+    void Digits2Reco(){DigitsToRecPoints(fLoader->GetEvent(),0,fOpt);};
     void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det);
-    void ResetRecPoints();
+    void ResetRecPoints(){if(fRecPoints) fRecPoints->Clear();fNRecPoints = 0;};
     // Return pointer to rec points 
     TClonesArray  *RecPoints()   {return fRecPoints;}
-     
+
  protected:
     //================== Data Members ==================================
     AliITSgeom   *fITSgeom;    // Pointer to ITS geometry
@@ -205,8 +220,9 @@ class AliITS : public AliDetector {
 
     TClonesArray *fRecPoints;  //! List of reconstructed points
     Int_t         fNRecPoints; // Number of rec points
+    TString fSelectedVertexer; // Vertexer selected in CreateVertexer
 
-    ClassDef(AliITS,3) // Base class for ITS
+    ClassDef(AliITS,4) // Base class for ITS
 };
 
 #endif