3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
10 #include <TArrayI.h> // used in inline functions GetHitTrackIndex,GetHitHitIndex, and GetHitTrackAndHitIndex.
16 class AliITSmodule:public TObject{
18 //________________________________________________________________
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
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
30 //________________________________________________________________
34 //________________________________________________________________
36 // Constructors and deconstructor
37 //________________________________________________________________
39 AliITSmodule(); // default constructor
40 AliITSmodule(Int_t index); //index in TObjectArray in ITS object
41 virtual ~AliITSmodule();
43 //________________________________________________________________
45 // Position managenent (id's getters)
46 //________________________________________________________________
49 Int_t GetIndex() const {
53 void GetID(Int_t &lay,Int_t &lad,Int_t &det);
56 Int_t i,j,k;GetID(i,j,k);return i;
60 Int_t i,j,k;GetID(i,j,k);return j;
64 Int_t i,j,k;GetID(i,j,k);return k;
66 //________________________________________________________________
69 //________________________________________________________________
71 Int_t GetNhits() const {
73 return fHitsM->GetEntriesFast();
75 AliITS *GetITS() const {
79 TObjArray *GetHits() const {
83 AliITShit *GetHit(Int_t i) {
84 // returns pointer to array (TClonesArray) of pointers to hits
85 return (AliITShit*)fHitsM->At(i);
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 void MedianHitG(Int_t index, Float_t hitx1,Float_t hity1,Float_t hitz1,
91 Float_t hitx2,Float_t hity2,Float_t hitz2, Float_t &xMg,
92 Float_t &yMg, Float_t &zMg);
93 void MedianHitL(Int_t index, AliITShit *itsHit1, AliITShit *itsHit2,
94 Float_t &xMl, Float_t &yMl, Float_t &zMl);
95 Double_t PathLength(Int_t index, AliITShit *itsHit1, AliITShit *itsHit2);
96 Int_t GetHitTrackIndex(Int_t i) {
97 // get hit track index
98 return fTrackIndex->At(i);
100 Int_t GetHitHitIndex(Int_t i) {
101 // return the hit index number in TreeH for the given sorted hit in the module.
102 return fHitIndex->At(i);
104 void GetHitTrackAndHitIndex(Int_t i,Int_t &TrackIndex,Int_t &HitIndex) {
105 // return the hit index number for the given hit. Hits are kept on
106 // file according to their track index and hit index numbers.
107 TrackIndex = fTrackIndex->At(i);HitIndex = fHitIndex->At(i);
109 // returns both the track and hit index numbers for the given hit. Hits
110 // are kept on file according to their track index and hit index numbers.
111 void MedianHit(Int_t index, Float_t xg,Float_t yg,Float_t zg,
112 Int_t status,Float_t &xMg, Float_t &yMg, Float_t &zMg,
114 void PathLength(Int_t index,Float_t x,Float_t y,Float_t z,Int_t status,
115 Int_t &nseg,Float_t &x1,Float_t &y1,Float_t &z1,
116 Float_t &dx1,Float_t &dy1, Float_t &dz1,Int_t &flag);
117 Bool_t LineSegmentL(Int_t hindex,Double_t &a,Double_t &b,
118 Double_t &c,Double_t &d,Double_t &e,Double_t &f,
120 Bool_t LineSegmentL(Int_t hindex,Double_t &a,Double_t &b,
121 Double_t &c,Double_t &d,Double_t &e,Double_t &f,
122 Double_t &de,Int_t &track);
123 // if returns kTRUE; gives the parameterization of the line segment
124 // from this step. x=a+b*t, y=c+d*t, and z=e+f*t for 0.0t<=1.0 and the
125 // energy lost during this step all in the local detector coordinates.
126 // if returns kFALSE; this is a begining step and no energy loss has
127 // occured. This step is used to set up the next steps. Do not use
128 // this parameterization.
129 Bool_t LineSegmentG(Int_t hindex,Double_t &a,Double_t &b,
130 Double_t &c,Double_t &d,Double_t &e,Double_t &f,
132 Bool_t LineSegmentG(Int_t hindex,Double_t &a,Double_t &b,
133 Double_t &c,Double_t &d,Double_t &e,Double_t &f,
134 Double_t &de,Int_t &track);
135 // if returns kTRUE; gives the parameterization of the line segment
136 // from this step. x=a+b*t, y=c+d*t, and z=e+f*t for 0.0t<=1.0 and the
137 // energy lost during this step all in the global detector coordinates.
138 // if returns kFALSE; this is a begining step and no energy loss has
139 // occured. This step is used to set up the next steps. Do not use
140 // this parameterization.
143 AliITSmodule(const AliITSmodule &source);
144 AliITSmodule& operator=(const AliITSmodule &source);
145 //________________________________________________________________
148 //________________________________________________________________
150 AliITS *fITS; // Pointer to ITS detector
151 Int_t fIndex; //Index of this module in ITSmodules TObjectArray
152 TObjArray *fHitsM; // Pointer to list of hits on this module
153 TArrayI *fTrackIndex; // track index
154 TArrayI *fHitIndex; // hit index
156 ClassDef(AliITSmodule,1) // Copy the hits into a more useful order