]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITS.h
New version of ITS for the TDR
[u/mrichter/AliRoot.git] / ITS / AliITS.h
1 #ifndef ITS_H
2 #define ITS_H
3 ////////////////////////////////////////////////////////////////////////
4 //           Manager and hits classes for set: ITS                    //
5 ////////////////////////////////////////////////////////////////////////
6
7 #include "TObjArray.h"
8 #include "AliDetector.h"
9 #include "AliITSgeom.h"
10 #include "AliITSdigit.h"
11 #include "AliITSmodule.h"
12
13 class AliITS : public AliDetector {
14 ////////////////////////////////////////////////////////////////////////
15 //
16 //      An overview of the basic philosophy of the ITS code development
17 // and analysis is show in the figure below.
18 //Begin_Html
19 /*
20 <img src="figures/ITS_Analysis_schema.gif">
21 </pre>
22 <br clear=left>
23 <font size=+2 color=red>
24 <p>Roberto Barbera is in charge of the ITS Offline code (1999).
25 <a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
26 </font>
27 <pre>
28 */
29 //End_Html
30 //
31 // Version: 0
32 // Written by Rene Brun, Federico Carminati, and Roberto Barbera
33 //
34 // Version: 1
35 // Modified and documented by Bjorn S. Nilsen
36 // July 11 1999
37 //
38 // AliITS is the general base class for the ITS. Also see AliDetector for
39 // futher information.
40 //
41 // Data members:
42 //
43 // AliITSgeom *fITSgeom
44 //     All of the geometry information about the active volumes that
45 // make up the ITS are described in the AliITSgeom class. This includes
46 // the transformation functions between the local and global coordinate
47 // systems and the like. See the full description found in the AliITSgeom
48 // class. Here in the AliITS class is kept the pointer to the geometry
49 // used in the simulations or that thought to be the correct one for the
50 // data. Until a more general class is define and a more appropriate
51 // place is found to keep this geometry information, it is kept here in
52 // AliITS.
53 //
54 // TObjArray *fITSpoints
55 //     This is a pointer to the points, to be used by the tracking algorithms
56 // for example, found in the detectors of the ITS. To allow for the most
57 // general points structure it is defined to be a pointer to a TObjArray where
58 // each array element would be one point found in the ITS detectors. An
59 // Addpoints function is defined below. By default an array of 16 TObjects are
60 // defined during the initialization of AliITS. This is automatically expanded
61 // when necessary by the Addpoints function.
62 //
63 // Bool_t fEuclidOut
64 //     This is a flag used to indicate that an Euclid compatible CAD
65 // file will be created upon the creation of the ITS Monte Carlo
66 // geometry definition, in the function CreatGeometry. If fEuclidOut is
67 // true, then a file called ITSgeometry.euc will be created.
68 //
69 // Int_t fIdN
70 //     This variable contains the number of layers defined in the ITS
71 // geometry. It is primarily used as a size indicator for fIdSens and
72 // fIdName described below. In general the number of layers, ladders, or
73 // detectors should be gotten from the AliITSgeom functions. Upon
74 // creating the AliITS object it is set to zero.
75 //
76 // Int_t *fIdSens
77 //     This is a pointer to an array containing the Monte Carlo volume
78 // numbers for the different layers of the ITS. These numbers are needed
79 // by the StepManager function to determine what layer a hit was on. It
80 // is sized and initialized in the Init function and the AliITSv? Init
81 // function, called after a call to CreateGeometry. Upon creating the
82 // AliITS object it points to zero. This variable is made a pointer
83 // in order to keep the maximum flexibility at this level of the code.
84 //
85 // char **fIdName
86 //     This is a pointer to an array of characters containing the names of
87 // the different ITS layers as defined in the Monte Carlo geometry data-
88 // base. It is sized and filled in the AliITSv? Init function, called
89 // after a call to CreatGeometry. Upon creating the AliITS object it
90 // points to zero. This variable is make a pointer in order to keep the
91 // maximum flexibility at this level of the code.
92 //
93 // Member Functions:
94 //
95 // AliITS()
96 //     The default constructor of the AliITS class. In addition to
97 // creating the AliITS class it zeros the variables fIshunt (a member
98 // of AliDetector class), fEuclidOut, and fIdN, and zeros the pointers
99 // fITSpoints, fIdSens, and fIdName. The AliDetector default constructor
100 // is also called.
101 //
102 // AliITS(const char *name, const char *title)
103 //     The constructor of the AliITS class. In addition to creating the
104 // AliITS class, it allocates memory for the TClonesArrays fHits and
105 // fDigits, and for the TObjArray fITSpoints. It also zeros the variables
106 // fIshunt (a member of AliDetector class), fEuclidOut, and fIdN, and zeros
107 // the pointers fIdSens and fIdName. To help in displaying hits via the ROOT
108 // macro display.C AliITS also sets the marker color to red. The variables
109 // passes with this constructor, const char *name and *title, are used by
110 // the constructor of AliDetector class. See AliDetector class for a
111 // description of these parameters and its constructor functions.
112 //
113 // ~AliITS()
114 //     The default destructor of the AliITS class. In addition to deleting
115 // the AliITS class it deletes the memory pointed to by the fHits, fDigits,
116 // fIdSens, fIdName, and fITSpoints.
117 //
118 // AddHit(Int_t track, Int_t *vol, Float_t *hits)
119 //     The function to add information to the AliITShit class. See the
120 // AliITShit class for a full description. This function allocates the
121 // necessary new space for the hit information and passes the variable
122 // track, and the pointers *vol and *hits to the AliITShit constructor
123 // function.
124 //
125 // AddDigit(Int_t *track, Int_t *digits)
126 //     The function to add information to the AliITSdigits class. See the
127 // AliITSdigits class for a full description. This function allocates the
128 // necessary new space for the digits information and passes the pointers
129 // *track and *digits to the AliITSdigits constructor function.
130 //
131 // BuildGeometry()
132 //     This function builds a simple ITS geometry used by the ROOT macro
133 // display.C. In general the geometry as coded is wrong.
134 //
135 // CreateGeometry()
136 //     This function builds the detailed geometry used by the Geant
137 // Monte Carlo. As defined here it is a dummy routine to be replaced
138 // by the version coded up in AliITSv? where the specific geometry to
139 // be used by the simulation is defined. See the definition of AliITSv5
140 // or the other routines for a complete definition.
141 //
142 // CreateMaterials()
143 //     This function defines the default materials used in the Geant
144 // Monte Carlo simulations. In general it is automatically replaced by
145 // the CreatMaterials routine defined in AliITSv?. Should the function
146 // CreateMaterials not exist for the geometry version you are using this
147 // one is used. See the definition found in AliITSv5 or the other routine
148 // for a complete definition.
149 //
150 // IsVersion()
151 //     Returns the version number of the AliITS class. At present it is
152 // version 1.
153 //
154 // DistancetoPrimitive(Int_t x, Int_t y)
155 //     A dummy routine used by the ROOT macro display.C to allow for the
156 // use of the mouse (pointing device) in the macro. In general this should
157 // never be called. If it is it returns the number 9999 for any value of
158 // x and y.
159 //
160 // Init()
161 //     This routine initializes the AliITS class. It is intended to be called
162 // from the Init function in AliITSv?. Besides displaying a banner
163 // indicating that it has been called it initializes the array fIdSens.
164 // Therefore it should be called after a call to CreateGeometry.
165 //
166 // MakeBranch(Option_t *Opt=" ")
167 //     Creates the TTree branch where the class AliITS is kept.
168 //
169 // SetEUCLID(bool_t euclid=1)
170 //     Sets the flag fEuclidOut to true (default) of false (euclid=0).
171 // By setting or clearing the fEuclidOut flag you can controls whether
172 // or not a euclid formatted output file of the ITS geometry is written.
173 // If fEuclidOut is set true then a file called ITSgeometry.euc will be
174 // written after the ITS geometry is defined in the Monte Carlo. If
175 // fEuclidOut is set false then no file is created.
176 //
177 // StepManager()
178 //     Dummy routine which is replaced by the routine StepManager() defined
179 // in AliITSv?. If no such routine exist then this routine returns zero.
180 // See AliITSv? for a detailed description of the step manager routines.
181 //
182 // GetITSgeom()
183 //     Returns the value of the pointer fITSgeom. This is used to get
184 // access to the ITS geometry stored in the file. See AliITSgeom for a
185 // full description of the geometry package.
186 //
187 // GetITSpoints()
188 //     Returns the value of the pointer fITSpoints. This is used to get
189 // access to the ITS cluster objects, if filled, stored in the file. See
190 // AliITSCluster for a full description of the cluster data.
191 ////////////////////////////////////////////////////////////////////////
192  protected:
193     AliITSgeom  *fITSgeom;    // Pointer to ITS geometry
194     TObjArray   *fITSmodules; // Pointer to ITS modules
195     // Defined here since it doesn't have a place in AliDetector like fDigit
196     TObjArray   *fITSpoints;  // Pointer to ITS points
197
198     Bool_t fEuclidOut; // Flag to write out geometry in euclid format
199     Int_t  fIdN; // the number of layers
200     Int_t  *fIdSens; char **fIdName;   //layer identifier
201     // Geometry and Stepmanager version numbers used.
202     Int_t fMajorVersion,fMinorVersion;
203
204   public:
205                           AliITS();
206                           AliITS(const char *name, const char *title);
207            virtual        ~AliITS();
208
209            virtual void   AddHit(Int_t, Int_t*, Float_t*);
210            virtual void   AddDigit(Int_t*, Int_t*);
211            virtual Int_t  AddDigit(AliITSdigit *d);
212 //         virtual void   AddPoint(); // yet to be defined
213
214            virtual void   BuildGeometry();
215            virtual void   CreateGeometry() {};
216            virtual void   CreateMaterials();
217
218     inline virtual TObjArray* GetModules() {return fITSmodules;}
219     inline virtual TObjArray* GetPoints(){return fITSpoints;}
220
221     inline void GetGeometryVersion(Int_t &a,Int_t &b)
222       {a = fMajorVersion;b=fMinorVersion;return;}
223     inline virtual Int_t  IsVersion() {return 1;}
224                    Int_t  DistancetoPrimitive(Int_t px, Int_t py);
225            virtual void   Init();
226            virtual void   MakeBranch(Option_t *opt=" ");
227     inline virtual void   SetEUCLID(Bool_t euclid=1){fEuclidOut = euclid;}
228            virtual void   StepManager()=0;
229     //
230     // ITS geometry functions
231     inline virtual AliITSgeom *GetITSgeom(){return fITSgeom;}
232     inline virtual TObjArray  *GetITSpoints(){return fITSpoints;}
233
234     ClassDef(AliITS,1)
235 };
236 #endif