]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITS.h
bae6046c7a1a63e66adff14dd95165c8ff00d3d8
[u/mrichter/AliRoot.git] / ITS / AliITS.h
1 #ifndef ALIITS_H
2 #define ALIITS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ////////////////////////////////////////////////////////////////////////
9 //           Manager class for set: ITS                               //
10 ////////////////////////////////////////////////////////////////////////
11
12 #include <TObjArray.h> // used in inline function GetModule.
13
14 #include "AliDetector.h"
15
16 class TString;
17 class TTree;
18 class TFile;
19
20 class AliITSDetType;
21 class AliITSsimulation;
22 class AliITSClusterFinder;
23 class AliITSsegmentation;
24 class AliITSresponse;
25 class AliITShit;
26 class AliITSgeom;
27 class AliITSdigit;
28 class AliITSRecPoint;
29 class AliITSRawCluster;
30 class AliITSmodule;
31 class AliITStrack;
32
33
34
35 class AliITS : public AliDetector {
36
37   public:
38                     AliITS();
39                     AliITS(const char *name, const char *title);
40     virtual        ~AliITS();
41     AliITS(AliITS &source);
42     AliITS & operator=(AliITS &source);
43
44     virtual void   AddHit(Int_t track, Int_t *vol, Float_t *hits);
45     virtual void   AddRealDigit(Int_t branch, Int_t *digits);
46     virtual void   AddSimDigit(Int_t branch, AliITSdigit *d);
47     virtual void   AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,Int_t* tracks,Int_t *hits,Float_t* trkcharges); 
48     //
49     virtual void   AddCluster(Int_t branch, AliITSRawCluster *c);
50     virtual void   AddRecPoint(const AliITSRecPoint &p);
51
52     virtual void   ResetDigits();                   // depending on how the
53     virtual void   ResetDigits(Int_t branch);       // tree will be filled only
54     virtual void   ResetClusters();                 // one of the methods in 
55     virtual void   ResetClusters(Int_t branch);     // the pair will be kept
56     virtual void   ResetRecPoints();
57
58     // get geometry version - detailed (major) or coarse (minor)
59     void GetGeometryVersion(Int_t &a,Int_t &b) const 
60                    {a = fMajorVersion;b=fMinorVersion;return;}
61     virtual Int_t  IsVersion() const {return 1;}
62     virtual Int_t  DistancetoPrimitive(Int_t px, Int_t py);
63     virtual void   Init();
64     virtual void   SetDefaults();
65     virtual void   SetDefaultSimulation();
66     virtual void   SetDefaultClusterFinders();
67     // create separate tree for clusters - declustering refining
68     virtual  void  MakeTreeC(Option_t *option="C");
69     void           GetTreeC(Int_t event);
70     virtual void   MakeBranch(Option_t *opt=" ");
71     void           SetTreeAddress();
72     virtual void   SetEUCLID(Bool_t euclid=1) {fEuclidOut = euclid;}
73     virtual void   StepManager() {}
74     // sort hits by module
75     virtual void   InitModules(Int_t size,Int_t &nmodules);  
76     virtual void   FillModules(Int_t evnt,Int_t bgrev,
77                        Int_t nmodules,Option_t *opt,Text_t *filename);
78     virtual void   ClearModules();
79     // Digitisation
80     void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
81                  Option_t *add, Option_t *det, Text_t *filename);
82     // Reconstruct hits
83     void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det);
84     // Fast simulation of space points from hits
85     void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
86                  Option_t *add, Option_t *det, Text_t *filename);
87
88     // Write digits into raw data format
89     virtual void Digits2RawData() {}
90     // Decode raw data and store digits
91     virtual void RawData2Digits() {}
92
93     // Configuration Methods (per detector type )
94     // Set response 
95     virtual void   SetResponseModel(Int_t id, AliITSresponse *response);
96     // Set segmentation 
97     virtual void   SetSegmentationModel(Int_t id, AliITSsegmentation *seg);
98     // Set simulation - temporary 
99     virtual void   SetSimulationModel(Int_t id, AliITSsimulation *sim);
100     // Set reconstruction 
101     virtual void   SetReconstructionModel(Int_t id, AliITSClusterFinder *rec);
102     // Set class names for digit and rec point 
103     virtual void   SetClasses(Int_t id, const char *digit, const char *cluster);
104
105
106     // Getters
107     // ITS geometry functions
108     virtual AliITSgeom  *GetITSgeom() const {return fITSgeom;}
109     // return pointer to the array of modules
110     virtual TObjArray   *GetModules() const {return fITSmodules;}
111     // return pointer to a particular module
112     AliITSmodule *GetModule(Int_t index) {return (AliITSmodule *)
113                                               (fITSmodules->At(index));}
114
115     // Return pointers to digits 
116     TObjArray            *Dtype() {return fDtype;}
117     Int_t                *Ndtype() {return fNdtype;}
118     virtual TClonesArray *DigitsAddress(Int_t id) 
119                    {return ((TClonesArray *) (*fDtype)[id]);}
120     // Return pointers to clusters 
121     TObjArray            *Ctype() {return fCtype;}
122     Int_t                *Nctype() {return fNctype;}
123     virtual TClonesArray *ClustersAddress(Int_t id) 
124                    {return ((TClonesArray *) (*fCtype)[id]);}
125
126     // Return pointer to rec points 
127     TClonesArray  *RecPoints()   {return fRecPoints;}
128
129     // Return pointer to DetType #id
130     AliITSDetType  *DetType(Int_t id);
131     //Int_t           NDetTypes() {return fNDetTypes;}
132
133     // Return pointer to the tree of clusters
134     TTree          *TreeC() {return fTreeC;}
135
136
137     // tracking
138
139     AliITStrack Tracking(AliITStrack &track, AliITStrack *reference, TObjArray *fpoints, Int_t **vettid,
140          Bool_t flagvert );  
141
142     void DoTracking(Int_t evNumber, Int_t min_t, Int_t max_t, TFile *file, Bool_t flagvert);
143
144  protected:
145
146     static const Int_t fgkNTYPES;  // Number of detector types
147     AliITSgeom *fITSgeom;      // Pointer to ITS geometry
148     TObjArray  *fITSmodules;   //! Pointer to ITS modules
149     Bool_t      fEuclidOut;    // Flag to write geometry in euclid format
150     Int_t       fIdN;          // the number of layers
151     Int_t      *fIdSens;       //[fIdN] layer identifier
152 //    TObjArray  *fIdName;       // array of volume Id names
153     TString  *fIdName;       //[fIdN] layer identifier
154     // Geometry and Stepmanager version numbers used.
155     Int_t fMajorVersion;      // detailed and coarse(minor) versions
156     Int_t fMinorVersion;      // detailed and coarse(minor) versions
157     //
158     // Int_t       fNDetTypes;   // Number of detector types
159     TObjArray     *fDetTypes;    // List of detector types
160
161     TObjArray     *fDtype;       //[fgkNTYPES]  List of digits
162     Int_t         *fNdtype;      //[fgkNTYPES] Num. of digits per type of det. 
163     TObjArray     *fCtype;       //[fgkNTYPES] List of clusters
164     Int_t         *fNctype;      //[fgkNTYPES] Num. of clust. per type of det.
165
166     TClonesArray  *fRecPoints;   // List of reconstructed points
167     Int_t          fNRecPoints;  // Number of rec points
168     TTree         *fTreeC;       // Tree for raw clusters
169
170
171     ClassDef(AliITS,1) // Base class for ITS
172 };
173
174 #endif