]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSmodule.h
Corrected initialization
[u/mrichter/AliRoot.git] / ITS / AliITSmodule.h
CommitLineData
58005f18 1#ifndef ALIITSMODULE_H
2#define ALIITSMODULE_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7d62fb64 7///////////////////////////////////////////////////////////////////////
8// //
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 //
14// //
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 //
18// //
19///////////////////////////////////////////////////////////////////////
58005f18 20
3bd79107 21#include <TObject.h>
22#include <TObjArray.h>
608f25d8 23#include <TArrayI.h> // used in inline functions GetHitTrackIndex,GetHitHitIndex, and GetHitTrackAndHitIndex.
58005f18 24
3bd79107 25class AliITS;
26class AliITShit;
ff61221e 27
3bd79107 28
29class AliITSmodule:public TObject{
58005f18 30
58005f18 31
3bd79107 32 public:
58005f18 33 //________________________________________________________________
34 //
35 // Constructors and deconstructor
36 //________________________________________________________________
3bd79107 37 //
58005f18 38 AliITSmodule(); // default constructor
3bd79107 39 AliITSmodule(Int_t index); //index in TObjectArray in ITS object
40 virtual ~AliITSmodule();
58005f18 41
42 //________________________________________________________________
43 //
3bd79107 44 // Position managenent (id's getters)
58005f18 45 //________________________________________________________________
46 //
3bd79107 47
48 Int_t GetIndex() const {
49 // get index
50 return fIndex;
51 }
52 void GetID(Int_t &lay,Int_t &lad,Int_t &det);
53 Int_t GetLayer() {
54 // get layer
55 Int_t i,j,k;GetID(i,j,k);return i;
56 }
57 Int_t GetLadder(){
58 // get ladder
59 Int_t i,j,k;GetID(i,j,k);return j;
60 }
61 Int_t GetDet(){
62 // get det
63 Int_t i,j,k;GetID(i,j,k);return k;
64 }
58005f18 65 //________________________________________________________________
66 //
3bd79107 67 // Hits management
58005f18 68 //________________________________________________________________
69 //
3bd79107 70 Int_t GetNhits() const {
71 // get num of hits
72 return fHitsM->GetEntriesFast();
73 }
74 AliITS *GetITS() const {
75 // get ITS
76 return fITS;
77 }
78 TObjArray *GetHits() const {
79 // get hits
80 return fHitsM;
81 }
82 AliITShit *GetHit(Int_t i) {
58005f18 83 // returns pointer to array (TClonesArray) of pointers to hits
3bd79107 84 return (AliITShit*)fHitsM->At(i);
85 }
58005f18 86 // Adds pointer of hit belonging to this module
87 // and returns number of hits in this module
3bd79107 88 Int_t AddHit(AliITShit *hit,Int_t TrackIndex,Int_t HitIndex);
7e3ded1b 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
93 // the module.
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
100 // through a volume.
101 Bool_t MedianHitG(AliITShit *h1,AliITShit *h2,
102 Float_t &x,Float_t &y,Float_t &z);
3bd79107 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);
7e3ded1b 106 // Computes mean local location from hits that make up a track passing
107 // through a volume.
108 Bool_t MedianHitL(AliITShit *h1,AliITShit *h2,
7d62fb64 109 Float_t &x,Float_t &y,Float_t &z) const;
ac74f489 110 void MedianHitL(Int_t,AliITShit *,AliITShit *,Float_t &,Float_t &,
111 Float_t &){};
475c592b 112 Double_t PathLength(AliITShit *itsHit1, AliITShit *itsHit2);
3bd79107 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,
117 Int_t &flag);
475c592b 118 void PathLength(Float_t x,Float_t y,Float_t z,Int_t status,
3bd79107 119 Int_t &nseg,Float_t &x1,Float_t &y1,Float_t &z1,
7d62fb64 120 Float_t &dx1,Float_t &dy1, Float_t &dz1,Int_t &flag) const;
3bd79107 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,
123 Double_t &de);
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,
135 Double_t &de);
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.
145
146 protected:
147 AliITSmodule(const AliITSmodule &source);
148 AliITSmodule& operator=(const AliITSmodule &source);
58005f18 149 //________________________________________________________________
150 //
151 // Data members
152 //________________________________________________________________
153 //
3bd79107 154 AliITS *fITS; // Pointer to ITS detector
0b2d41b4 155 Int_t fIndex; //Index of this module in ITSmodules TObjectArray
3bd79107 156 TObjArray *fHitsM; // Pointer to list of hits on this module
0b2d41b4 157 TArrayI *fTrackIndex; // track index
158 TArrayI *fHitIndex; // hit index
3bd79107 159
2bffff54 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.
58005f18 162};
163
164#endif
3bd79107 165
166
167