Coding rule violations corrected.
[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$ */
58005f18 7
3bd79107 8#include <TObject.h>
9#include <TObjArray.h>
608f25d8 10#include <TArrayI.h> // used in inline functions GetHitTrackIndex,GetHitHitIndex, and GetHitTrackAndHitIndex.
58005f18 11
3bd79107 12class AliITS;
13class AliITShit;
ff61221e 14
3bd79107 15
16class AliITSmodule:public TObject{
58005f18 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
3bd79107 33 public:
58005f18 34 //________________________________________________________________
35 //
36 // Constructors and deconstructor
37 //________________________________________________________________
3bd79107 38 //
58005f18 39 AliITSmodule(); // default constructor
3bd79107 40 AliITSmodule(Int_t index); //index in TObjectArray in ITS object
41 virtual ~AliITSmodule();
58005f18 42
43 //________________________________________________________________
44 //
3bd79107 45 // Position managenent (id's getters)
58005f18 46 //________________________________________________________________
47 //
3bd79107 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 }
58005f18 66 //________________________________________________________________
67 //
3bd79107 68 // Hits management
58005f18 69 //________________________________________________________________
70 //
3bd79107 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) {
58005f18 84 // returns pointer to array (TClonesArray) of pointers to hits
3bd79107 85 return (AliITShit*)fHitsM->At(i);
86 }
58005f18 87 // Adds pointer of hit belonging to this module
88 // and returns number of hits in this module
3bd79107 89 Int_t AddHit(AliITShit *hit,Int_t TrackIndex,Int_t HitIndex);
7e3ded1b 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);
3bd79107 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);
7e3ded1b 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);
ac74f489 111 void MedianHitL(Int_t,AliITShit *,AliITShit *,Float_t &,Float_t &,
112 Float_t &){};
3bd79107 113 Double_t PathLength(Int_t index, AliITShit *itsHit1, AliITShit *itsHit2);
3bd79107 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);
58005f18 150 //________________________________________________________________
151 //
152 // Data members
153 //________________________________________________________________
154 //
3bd79107 155 AliITS *fITS; // Pointer to ITS detector
0b2d41b4 156 Int_t fIndex; //Index of this module in ITSmodules TObjectArray
3bd79107 157 TObjArray *fHitsM; // Pointer to list of hits on this module
0b2d41b4 158 TArrayI *fTrackIndex; // track index
159 TArrayI *fHitIndex; // hit index
3bd79107 160
2bffff54 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.
58005f18 163};
164
165#endif
3bd79107 166
167
168