3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
7 ///////////////////////////////////////////////////////////////////////
9 // Class AliITSmodule //
10 // is a superclass for AliITSmoduleSSD, SPD and SDD. //
11 // The main function of modules is to simulate DIGITS from //
12 // GEANT HITS and produce POINTS from DIGITS //
13 // It also make fast simulation without use of DIGITS //
15 // created by: A.Boucham, W.Peryt, S.Radomski, P.Skowronski //
16 // R.Barbera, B. Batynia, B. Nilsen //
17 // ver. 1.0 CERN, 16.09.1999 //
19 ///////////////////////////////////////////////////////////////////////
22 #include <TObjArray.h>
23 #include <TArrayI.h> // used in inline functions GetHitTrackIndex,GetHitHitIndex, and GetHitTrackAndHitIndex.
29 class AliITSmodule:public TObject{
33 //________________________________________________________________
35 // Constructors and deconstructor
36 //________________________________________________________________
38 AliITSmodule(); // default constructor
39 AliITSmodule(Int_t index); //index in TObjectArray in ITS object
40 virtual ~AliITSmodule();
42 //________________________________________________________________
44 // Position managenent (id's getters)
45 //________________________________________________________________
48 Int_t GetIndex() const {
52 void GetID(Int_t &lay,Int_t &lad,Int_t &det);
55 Int_t i,j,k;GetID(i,j,k);return i;
59 Int_t i,j,k;GetID(i,j,k);return j;
63 Int_t i,j,k;GetID(i,j,k);return k;
65 //________________________________________________________________
68 //________________________________________________________________
70 Int_t GetNhits() const {
72 return fHitsM->GetEntriesFast();
74 AliITS *GetITS() const {
78 TObjArray *GetHits() const {
82 AliITShit *GetHit(Int_t i) {
83 // returns pointer to array (TClonesArray) of pointers to hits
84 return (AliITShit*)fHitsM->At(i);
86 // Adds pointer of hit belonging to this module
87 // and returns number of hits in this module
88 Int_t AddHit(AliITShit *hit,Int_t TrackIndex,Int_t HitIndex);
89 Int_t GetHitTrackIndex(Int_t i) {// get hit track index
90 return fTrackIndex->At(i);}
91 Int_t GetHitHitIndex(Int_t i) {
92 // return the hit index number in TreeH for the given sorted hit in
94 return fHitIndex->At(i);}
95 void GetHitTrackAndHitIndex(Int_t i,Int_t &TrackIndex,Int_t &HitIndex) {
96 // return the hit index number for the given hit. Hits are kept on
97 // file according to their track index and hit index numbers.
98 TrackIndex = fTrackIndex->At(i);HitIndex = fHitIndex->At(i);}
99 // Computes mean global location from hits that make up a track passing
101 Bool_t MedianHitG(AliITShit *h1,AliITShit *h2,
102 Float_t &x,Float_t &y,Float_t &z);
103 void MedianHitG(Int_t index, Float_t hitx1,Float_t hity1,Float_t hitz1,
104 Float_t hitx2,Float_t hity2,Float_t hitz2, Float_t &xMg,
105 Float_t &yMg, Float_t &zMg);
106 // Computes mean local location from hits that make up a track passing
108 Bool_t MedianHitL(AliITShit *h1,AliITShit *h2,
109 Float_t &x,Float_t &y,Float_t &z) const;
110 void MedianHitL(Int_t,AliITShit *,AliITShit *,Float_t &,Float_t &,
112 Double_t PathLength(const AliITShit *itsHit1,const AliITShit *itsHit2);
113 // returns both the track and hit index numbers for the given hit. Hits
114 // are kept on file according to their track index and hit index numbers.
115 void MedianHit(Int_t index, Float_t xg,Float_t yg,Float_t zg,
116 Int_t status,Float_t &xMg, Float_t &yMg, Float_t &zMg,
118 void PathLength(Float_t x,Float_t y,Float_t z,Int_t status,
119 Int_t &nseg,Float_t &x1,Float_t &y1,Float_t &z1,
120 Float_t &dx1,Float_t &dy1, Float_t &dz1,Int_t &flag) const;
121 Bool_t LineSegmentL(Int_t hindex,Double_t &a,Double_t &b,
122 Double_t &c,Double_t &d,Double_t &e,Double_t &f,
124 Bool_t LineSegmentL(Int_t hindex,Double_t &a,Double_t &b,
125 Double_t &c,Double_t &d,Double_t &e,Double_t &f,
126 Double_t &de,Int_t &track);
127 // if returns kTRUE; gives the parameterization of the line segment
128 // from this step. x=a+b*t, y=c+d*t, and z=e+f*t for 0.0t<=1.0 and the
129 // energy lost during this step all in the local detector coordinates.
130 // if returns kFALSE; this is a begining step and no energy loss has
131 // occured. This step is used to set up the next steps. Do not use
132 // this parameterization.
133 Bool_t LineSegmentG(Int_t hindex,Double_t &a,Double_t &b,
134 Double_t &c,Double_t &d,Double_t &e,Double_t &f,
136 Bool_t LineSegmentG(Int_t hindex,Double_t &a,Double_t &b,
137 Double_t &c,Double_t &d,Double_t &e,Double_t &f,
138 Double_t &de,Int_t &track);
139 // if returns kTRUE; gives the parameterization of the line segment
140 // from this step. x=a+b*t, y=c+d*t, and z=e+f*t for 0.0t<=1.0 and the
141 // energy lost during this step all in the global detector coordinates.
142 // if returns kFALSE; this is a begining step and no energy loss has
143 // occured. This step is used to set up the next steps. Do not use
144 // this parameterization.
147 AliITSmodule(const AliITSmodule &source);
148 AliITSmodule& operator=(const AliITSmodule &source);
149 //________________________________________________________________
152 //________________________________________________________________
154 AliITS *fITS; // Pointer to ITS detector
155 Int_t fIndex; //Index of this module in ITSmodules TObjectArray
156 TObjArray *fHitsM; // Pointer to list of hits on this module
157 TArrayI *fTrackIndex; // track index
158 TArrayI *fHitIndex; // hit index
160 ClassDef(AliITSmodule,0) // Copy the hits into a more useful order
161 // Version set to zero so that we do not write out this class.