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