Vertexing with tracks included (Andrea)
[u/mrichter/AliRoot.git] / TPC / AliTPC.h
... / ...
CommitLineData
1#ifndef ALITPC_H
2#define ALITPC_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////////////////////////////////////////////////
9// Manager class for TPC //
10////////////////////////////////////////////////
11
12class TFile;
13class TTree;
14#include <TMatrixFfwd.h>
15#include <TVector.h>
16
17class AliTPCDigitsArray;
18class AliTPCLoader;
19class AliTPCParam;
20class AliTPCTrackHits; // M.I. -MI4 old hits - to be removed later
21class AliTPCTrackHitsV2; // M.I.
22#include "AliDetector.h"
23#include "AliDigit.h"
24#include "AliHit.h"
25
26
27class AliTPC : public AliDetector {
28
29public:
30 AliTPC();
31 AliTPC(const char *name, const char *title);
32 AliTPC(const AliTPC& t);
33
34 virtual AliLoader* MakeLoader(const char* topfoldername);
35
36 virtual ~AliTPC();
37 virtual void AddHit(Int_t a1, Int_t *a2, Float_t *a3);
38 virtual void BuildGeometry();
39 virtual void CreateGeometry() {}
40 virtual void CreateMaterials();
41
42 virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
43 virtual void SDigits2Digits(){;} //MI change -cycling to production
44 virtual void SDigits2Digits2(Int_t eventnumber=0);
45
46 virtual void Hits2SDigits(); // MI - cycling around
47 virtual void Hits2SDigits2(Int_t eventnumber=0);
48
49 virtual void Hits2Digits();
50 virtual void Hits2Digits(Int_t eventnumber); //MI change
51 virtual void Hits2DigitsSector(Int_t isec); //MI change
52 virtual void Init();
53 virtual Int_t IsVersion() const =0;
54 virtual void Digits2Raw();
55 Int_t GetNsectors() const {return fNsectors;}
56 virtual void MakeBranch(Option_t *opt=" ");
57 virtual void ResetDigits();
58 virtual void SetSens(Int_t sens);
59 virtual void SetSide(Float_t side);
60
61
62 virtual void StepManager()=0;
63 virtual void DrawDetector() {}
64 AliTPCDigitsArray* GetDigitsArray() {return fDigitsArray;} //MI change
65 AliTPCParam *GetParam(){return fTPCParam;} // M.K, M.I changes
66 void SetParam(AliTPCParam *param){fTPCParam=param;} // M.K, M.I changes
67 void SetDigitsArray(AliTPCDigitsArray* param) {fDigitsArray=param;} //MI change
68
69// additional function neccesary for the new hits
70 virtual void MakeBranch2(Option_t *opt=" ", const char *file=0); //
71 virtual void SetTreeAddress();
72 virtual void SetTreeAddress2();
73 virtual void AddHit2(Int_t a1, Int_t *a2, Float_t *a3); //
74 virtual void ResetHits();
75 virtual void ResetHits2();
76 virtual AliHit* FirstHit(Int_t track);
77 virtual AliHit* NextHit();
78 virtual AliHit* FirstHit2(Int_t track);
79 virtual AliHit* NextHit2();
80 virtual void LoadPoints(Int_t dummy);
81 virtual void LoadPoints2(Int_t dummy);
82 virtual void LoadPoints3(Int_t dumy);
83 virtual void FinishPrimary();
84 virtual void RemapTrackHitIDs(Int_t *map);
85 void SetHitType(Int_t type){fHitType =type;} //set type of hit container
86 void SetDigitsSwitch(Int_t sw){fDigitsSwitch = sw;}
87 void SetDefSwitch(Int_t def){fDefaults = def;}
88 Float_t GetNoise(); //get Current noise
89 void GenerNoise(Int_t tablasize); // make noise table
90 Bool_t IsSectorActive(Int_t sec) const; // check if the sector is active
91 void SetActiveSectors(Int_t * sectors, Int_t n); //set active sectors
92 Int_t GetHitType() const {return fHitType;}
93 void SetActiveSectors(Int_t flag=0); //loop over al hits and set active only hitted sectors
94 Bool_t TrackInVolume(Int_t id,Int_t track); //return true if current track is in volume
95
96// static functions
97 static AliTPCParam* LoadTPCParam(TFile *file);
98protected:
99 Int_t fDefaults; // defaults switch
100 Int_t fSens; // ISENS
101 Int_t fNsectors; // Number of sectors in TPC
102 //MI changes
103 AliTPCDigitsArray * fDigitsArray; //! detector digit object
104 AliTPCParam *fTPCParam; // pointer to TPC parameters
105 AliTPCTrackHitsV2 *fTrackHits; //! hits for given track M.I.
106 // AliTPCTrackHits *fTrackHitsOld; //! hits for given track M.I. MIold -
107
108 Int_t fHitType; // if fNewHit = 1 old data structure if 2 new hits if 4 old MI stucture
109 // 3 both types
110 Int_t fDigitsSwitch; // digits type, 0->normal, 1->summable
111
112 //MK changes
113
114 Float_t fSide; // selects left(-1), right(+1), or both(0) sides of the TPC
115
116 private:
117 //
118 void SetDefaults();
119 void DigitizeRow(Int_t irow,Int_t isec,TObjArray **rowTriplet);
120 Float_t GetSignal(TObjArray *p1, Int_t ntr, TMatrixF *m1,
121 TMatrixF *m2,Int_t *IndexRange);
122 void GetList (Float_t label,Int_t np,TMatrixF *m,Int_t *IndexRange,
123 Float_t **pList);
124 void MakeSector(Int_t isec,Int_t nrows,TTree *TH,Stat_t ntracks,TObjArray **row);
125 void TransportElectron(Float_t *xyz, Int_t *index);
126 Int_t fCurrentIndex[4];// index[0] indicates coordinate system,
127 // index[1] sector number,
128 // index[2] pad row number
129 // index[3] pad row number for which signal is calculated
130 Int_t fNoiseDepth; //! noise table
131 Float_t * fNoiseTable; //! table with noise
132 Int_t fCurrentNoise; //! index of the noise in the noise table
133 Bool_t* fActiveSectors; //! bool indicating which sectors are active
134
135 ClassDef(AliTPC,12) // Time Projection Chamber class
136};
137
138
139//_____________________________________________________________________________
140
141class AliTPChit : public AliHit {
142public:
143 Int_t fSector; //sector number
144 Int_t fPadRow; //Pad Row number
145 Float_t fQ ; //charge
146 Float_t fTime; //hit time
147
148public:
149 AliTPChit() {fTime = 0.;}
150 AliTPChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
151 virtual ~AliTPChit() {}
152 void SetX(Float_t x){fX = x;}
153 void SetY(Float_t y){fY = y;}
154 void SetZ(Float_t z){fZ = z;}
155
156 Float_t Time() const {return fTime;}
157
158 ClassDef(AliTPChit,2) // Time Projection Chamber hits
159};
160
161
162#endif
163
164
165
166
167
168
169
170
171