]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSmodule.h
Boost method added.
[u/mrichter/AliRoot.git] / ITS / AliITSmodule.h
1 #ifndef ALIITSMODULE_H
2 #define ALIITSMODULE_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 #include <TObject.h>
9 #include <TObjArray.h>
10 #include <TArrayI.h>  // used in inline functions GetHitTrackIndex,GetHitHitIndex, and GetHitTrackAndHitIndex.
11
12 class AliITS;
13 class AliITShit;
14
15
16 class AliITSmodule:public TObject{
17
18 //________________________________________________________________
19 //
20 //  Class AliITSmodule 
21 //  is a superclass for AliITSmoduleSSD, SPD and SDD.
22 //  The main function of modules is to simulate DIGITS from  
23 //  GEANT HITS and produce POINTS from DIGITS
24 //  It also make fast simulation without use of DIGITS
25 //
26 //  created by: A.Boucham, W.Peryt, S.Radomski, P.Skowronski
27 //              R.Barbera, B. Batynia, B. Nilsen
28 //  ver. 1.0    CERN, 16.09.1999  
29 // 
30 //________________________________________________________________
31 //
32
33  public:
34     //________________________________________________________________
35     //
36     // Constructors and deconstructor
37     //________________________________________________________________
38     // 
39     AliITSmodule();             // default constructor
40     AliITSmodule(Int_t index);  //index in TObjectArray in ITS object
41     virtual ~AliITSmodule();
42
43     //________________________________________________________________
44     //
45     // Position managenent (id's getters)
46     //________________________________________________________________
47     //
48
49     Int_t GetIndex()  const { 
50       // get index
51       return fIndex;
52     }
53     void  GetID(Int_t &lay,Int_t &lad,Int_t &det);
54     Int_t GetLayer() {
55       // get layer
56       Int_t i,j,k;GetID(i,j,k);return i;
57     }
58     Int_t GetLadder(){
59       // get ladder
60       Int_t i,j,k;GetID(i,j,k);return j;
61     }
62     Int_t GetDet(){
63       // get det
64       Int_t i,j,k;GetID(i,j,k);return k;
65     }
66     //________________________________________________________________
67     //
68     // Hits management
69     //________________________________________________________________
70     //
71     Int_t GetNhits()   const { 
72       // get num of hits
73       return fHitsM->GetEntriesFast();
74     }
75     AliITS *GetITS() const { 
76       // get ITS
77       return fITS;
78     }
79     TObjArray *GetHits() const { 
80       // get hits
81       return fHitsM; 
82     }
83     AliITShit *GetHit(Int_t i) { 
84     // returns pointer to array (TClonesArray) of pointers to hits
85       return (AliITShit*)fHitsM->At(i);
86     }
87     // Adds pointer of hit belonging to this module
88     // and returns number of hits in this module
89     Int_t  AddHit(AliITShit *hit,Int_t TrackIndex,Int_t HitIndex);
90     Int_t GetHitTrackIndex(Int_t i) {// get hit track index
91         return fTrackIndex->At(i);}
92     Int_t GetHitHitIndex(Int_t i) { 
93         // return the hit index number in TreeH for the given sorted hit in
94         // the module.
95         return fHitIndex->At(i);}
96     void GetHitTrackAndHitIndex(Int_t i,Int_t &TrackIndex,Int_t &HitIndex) {
97     // return the hit index number for the given hit. Hits are kept on
98     // file according to their track index and hit index numbers.
99       TrackIndex = fTrackIndex->At(i);HitIndex = fHitIndex->At(i);}
100     // Computes mean global location from hits that make up a track passing
101     // through a volume.
102     Bool_t MedianHitG(AliITShit *h1,AliITShit *h2,
103                       Float_t &x,Float_t &y,Float_t &z);
104     void MedianHitG(Int_t index, Float_t hitx1,Float_t hity1,Float_t hitz1, 
105                     Float_t hitx2,Float_t hity2,Float_t hitz2, Float_t &xMg, 
106                     Float_t &yMg, Float_t &zMg);
107     // Computes mean local location from hits that make up a track passing
108     // through a volume.
109     Bool_t MedianHitL(AliITShit *h1,AliITShit *h2,
110                       Float_t &x,Float_t &y,Float_t &z);
111     void MedianHitL(Int_t index, AliITShit *itsHit1, AliITShit *itsHit2, 
112                     Float_t &xMl, Float_t &yMl, Float_t &zMl){};
113     Double_t PathLength(Int_t index, AliITShit *itsHit1, AliITShit *itsHit2);
114     // returns both the track and hit index numbers for the given hit. Hits
115     // are kept on file according to their track index and hit index numbers.
116     void MedianHit(Int_t index, Float_t xg,Float_t yg,Float_t zg,
117                    Int_t status,Float_t &xMg, Float_t &yMg, Float_t &zMg,
118                                    Int_t &flag);
119     void PathLength(Int_t index,Float_t x,Float_t y,Float_t z,Int_t status,
120                     Int_t &nseg,Float_t &x1,Float_t &y1,Float_t &z1,
121                     Float_t &dx1,Float_t &dy1, Float_t &dz1,Int_t &flag);
122     Bool_t LineSegmentL(Int_t hindex,Double_t &a,Double_t &b, 
123                         Double_t &c,Double_t &d,Double_t &e,Double_t &f,
124                         Double_t &de);
125     Bool_t LineSegmentL(Int_t hindex,Double_t &a,Double_t &b,
126                         Double_t &c,Double_t &d,Double_t &e,Double_t &f,
127                         Double_t &de,Int_t &track);
128     // if returns kTRUE; gives the parameterization of the line segment
129     // from this step. x=a+b*t, y=c+d*t, and z=e+f*t for 0.0t<=1.0 and the
130     // energy lost during this step all in the local detector coordinates.
131     // if returns kFALSE; this is a begining step and no energy loss has
132     // occured. This step is used to set up the next steps. Do not use
133     // this parameterization.
134     Bool_t LineSegmentG(Int_t hindex,Double_t &a,Double_t &b,
135                         Double_t &c,Double_t &d,Double_t &e,Double_t &f,
136                         Double_t &de);
137     Bool_t LineSegmentG(Int_t hindex,Double_t &a,Double_t &b,
138                         Double_t &c,Double_t &d,Double_t &e,Double_t &f,
139                         Double_t &de,Int_t &track);
140     // if returns kTRUE; gives the parameterization of the line segment
141     // from this step. x=a+b*t, y=c+d*t, and z=e+f*t for 0.0t<=1.0 and the
142     // energy lost during this step all in the global detector coordinates.
143     // if returns kFALSE; this is a begining step and no energy loss has
144     // occured. This step is used to set up the next steps. Do not use
145     // this parameterization.
146
147  protected:
148     AliITSmodule(const AliITSmodule &source); 
149     AliITSmodule& operator=(const AliITSmodule &source); 
150     //________________________________________________________________
151     //
152     // Data members
153     //________________________________________________________________
154     //
155     AliITS       *fITS;       // Pointer to ITS detector
156     Int_t         fIndex;      //Index of this module in ITSmodules TObjectArray
157     TObjArray    *fHitsM;     // Pointer to list of hits on this module
158     TArrayI      *fTrackIndex; // track index
159     TArrayI      *fHitIndex; // hit index
160
161     ClassDef(AliITSmodule,0) // Copy the hits into a more useful order
162         // Version set to zero so that we do not write out this class.
163 };
164
165 #endif
166
167
168