]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITS.h
Removing obsolete macros
[u/mrichter/AliRoot.git] / ITS / AliITS.h
CommitLineData
3bd79107 1#ifndef ALIITS_H
2#define ALIITS_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
58005f18 8////////////////////////////////////////////////////////////////////////
3bd79107 9// Manager class for set: ITS //
58005f18 10////////////////////////////////////////////////////////////////////////
fe4da5cc 11
143d1056 12#include <TObjArray.h> // used in inline function GetModule.
cd77595e 13#include <TBranch.h> // used in inline function SetHitsAddressBranch
3bd79107 14
9ad8b5dd 15#include "AliRun.h"
fe4da5cc 16#include "AliDetector.h"
54b8cf3b 17#include "AliITSDetType.h"
de82972f 18
d5da1ecf 19class TString;
20class TTree;
55b5a0b3 21class TFile;
fe4da5cc 22
54b8cf3b 23//class AliITSDetType;
3bd79107 24class AliITSsimulation;
25class AliITSClusterFinder;
de82972f 26class AliITSsegmentation;
27class AliITSresponse;
28class AliITShit;
29class AliITSgeom;
2aea926d 30class AliITSpListItem;
de82972f 31class AliITSdigit;
32class AliITSRecPoint;
33class AliITSRawCluster;
34class AliITSmodule;
27a043b1 35
a8a6107b 36const Int_t kNTYPES=3;
de82972f 37
3bd79107 38class AliITS : public AliDetector {
58005f18 39
2aea926d 40 public:
41 //================= Standard Classes ===============================
42 AliITS(); // Default creator.
43 AliITS(const char *name, const char *title); // standard Creator
44 virtual ~AliITS(); // destructor
45 AliITS(AliITS &source); // copy constructor. Not to be used!
46 AliITS& operator=(AliITS &source); // = operator. Not to be used!
47 virtual Int_t IsVersion() const {return 1;}
48 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
49
50 //===================== Simulation Geometry ========================
e8189707 51 // get geometry version - detailed (major) or coarse (minor)
2aea926d 52 virtual Int_t GetMajorVersion(){return -1;}
53 virtual Int_t GetMinorVersion(){return -1;}
54 virtual void GetGeometryVersion(Int_t &a,Int_t &b)
55 {a = GetMajorVersion();b=GetMinorVersion();return;}
56 virtual void SetEUCLID(Bool_t euclid=1) {fEuclidOut = euclid;}
57 //-------------------- Geometry Transformations --------------------
58 // ITS geometry functions
59 AliITSgeom *GetITSgeom() const {return fITSgeom;}
f91c3e58 60 // Sets ITS geometry ! be very careful using this function.
61 void SetITSgeom(AliITSgeom *geom) {fITSgeom = geom;}
2aea926d 62 // return pointer to the array of modules
63 TObjArray *GetModules() const {return fITSmodules;}
64 // return pointer to a particular module
65 AliITSmodule *GetModule(Int_t index) {return (AliITSmodule *)
66 (fITSmodules->At(index));}
3bd79107 67
2aea926d 68 //================ Nessesary general Classes =======================
69 virtual void Init();
70 virtual void SetDefaults();
71 virtual void SetDefaultSimulation();
72 virtual void SetDefaultClusterFinders();
73 virtual void MakeBranch(Option_t *opt=" ", const char *file=0);
74 virtual void SetTreeAddress();
cd77595e 75 // For a give branch from the treeH sets the TClonesArray address.
9ad8b5dd 76 virtual void SetHitsAddressBranch(TBranch *b){b->SetAddress(&fHits);}
2aea926d 77 // Return pointer to DetType #id
78 AliITSDetType *DetType(Int_t id);
79 //Int_t NDetTypes() {return fNDetTypes;}
80 //---------- Configuration Methods (per detector type) -------------
7d8046e8 81 // Determines which ITS subdetectors will be processed. Effects
82 // digitization, and Reconstruction only.
83 void SetDetectors(Option_t *opt="All"){fOpt = opt;}
84 // Returns the list of ITS subdetectors that will be processed.
85 Option_t* GetDetectors(){return fOpt;}
3bd79107 86 // Set response
2aea926d 87 virtual void SetResponseModel(Int_t id, AliITSresponse *response);
3bd79107 88 // Set segmentation
2aea926d 89 virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg);
3bd79107 90 // Set simulation - temporary
2aea926d 91 virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim);
54b8cf3b 92 // Set simulation - temporary
93 virtual AliITSsimulation* GetSimulationModel(Int_t id){
94 return ((AliITSDetType*)(fDetTypes->At(id)))->GetSimulationModel();}
3bd79107 95 // Set reconstruction
2aea926d 96 virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec);
3bd79107 97 // Set class names for digit and rec point
2aea926d 98 virtual void SetClasses(Int_t id, const char *digit, const char *cluster);
99
100 //=================== Hits =========================================
101 virtual void StepManager() {} // See Step Manager for specific geometry.
102 virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
103 //------------ sort hits by module for Digitisation ----------------
104 virtual void InitModules(Int_t size,Int_t &nmodules);
b4012daf 105 virtual void FillModules(TTree *treeH, Int_t mask = 0);
2aea926d 106 virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
107 Option_t *opt,Text_t *filename);
108 virtual void ClearModules();
109
110 //===================== Digitisation ===============================
111 void MakeBranchS(const char *file);
112 void SetTreeAddressS(TTree *treeS);
f91c3e58 113 TClonesArray * GetSDigits() { return fSDigits; }
9ad8b5dd 114 void MakeBranchInTreeD(TTree *treeD,const char *file=0);
115 void MakeBranchD(const char *file){
116 MakeBranchInTreeD(gAlice->TreeD(),file);}
2aea926d 117 void SetTreeAddressD(TTree *treeD);
118 void Hits2SDigits(); // Turn hits into SDigits
119 void Hits2PreDigits(); // Turn hits into SDigits
e0fc0305 120 void SDigits2Digits(){SDigitsToDigits("All");} // Turn SDigits to Digits
121 void SDigitsToDigits(Option_t *opt="All"); // Turn SDigits to Digits
2aea926d 122 void Hits2Digits(); // Turn hits straight into Digits.
123 //------------------ Internal functions ----------------------------
124 // Standard Hits To SDigits function
125 void HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size,
126 Option_t *add, Option_t *det, Text_t *filename);
127 // Standard Hits To SDigits function
128 void HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
129 Option_t *add, Option_t *det, Text_t *filename);
130 // Standard Hits To Digits function
131 void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
132 Option_t *add, Option_t *det, Text_t *filename);
133 void ResetSDigits(); // Resets the Summable digits.
134 void ResetDigits(); // depending on how the
135 void ResetDigits(Int_t branch); // tree will be filled only
136 void AddSumDigit(AliITSpListItem &sdig);
137 void AddRealDigit(Int_t branch, Int_t *digits);
138 void AddSimDigit(Int_t branch, AliITSdigit *d);
139 void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
140 Int_t* tracks,Int_t *hits,Float_t* trkcharges);
141 // Return pointers to digits
142 TObjArray *Dtype() {return fDtype;}
143 Int_t *Ndtype() {return fNdtype;}
144 TClonesArray *DigitsAddress(Int_t id)
145 {return ((TClonesArray *) (*fDtype)[id]);}
3bd79107 146
2aea926d 147 //===================== Raw Data IO ================================
148 // Write digits into raw data format
149 virtual void Digits2RawData() {}
150 // Decode raw data and store digits
151 virtual void RawData2Digits() {}
58005f18 152
2aea926d 153 //==================== Clusterization ==============================
154 // create separate tree for clusters - declustering refining
155 void MakeTreeC(Option_t *option="C");
156 void GetTreeC(Int_t event);
157 void AddCluster(Int_t branch, AliITSRawCluster *c);
158 void ResetClusters(); // one of the methods in
159 void ResetClusters(Int_t branch); // the pair will be kept
160 // Return pointer to the tree of clusters
161 TTree *TreeC() {return fTreeC;}
3bd79107 162 // Return pointers to clusters
2aea926d 163 TObjArray *Ctype() {return fCtype;}
164 Int_t *Nctype() {return fNctype;}
165 TClonesArray *ClustersAddress(Int_t id)
3bd79107 166 {return ((TClonesArray *) (*fCtype)[id]);}
167
2aea926d 168 //=================== Reconstruction ===============================
ff0e455e 169 void MakeBranchR(const char *file, Option_t *opt=" ");
170 void MakeBranchRF(const char *file){MakeBranchR(file,"Fast");}
2aea926d 171 void SetTreeAddressR(TTree *treeR);
172 void AddRecPoint(const AliITSRecPoint &p);
173 void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
174 Option_t *add, Option_t *det, Text_t *filename);
175 void Digits2Reco();
176 void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det);
177 void ResetRecPoints();
3bd79107 178 // Return pointer to rec points
179 TClonesArray *RecPoints() {return fRecPoints;}
3bd79107 180
2aea926d 181 protected:
182 //================== Data Members ==================================
183 AliITSgeom *fITSgeom; // Pointer to ITS geometry
e0fc0305 184 Bool_t fEuclidOut; // Flag to write geometry in euclid format
2aea926d 185 TObjArray *fITSmodules; //! Pointer to ITS modules
7d8046e8 186 Option_t *fOpt; //! Detector option ="All" unless changed.
3bd79107 187
e0fc0305 188 Int_t fIdN; // the number of layers
2aea926d 189 Int_t *fIdSens; //[fIdN] layer identifier
190 TString *fIdName; //[fIdN] layer identifier
3bd79107 191
e0fc0305 192 Int_t fNDetTypes; // Number of detector types
2aea926d 193 TObjArray *fDetTypes; // List of detector types
e8189707 194
e0fc0305 195 TClonesArray *fSDigits; // List of Summable digits.
2aea926d 196 Int_t fNSDigits; // Number of Summable Digits.
55b5a0b3 197
2aea926d 198 TObjArray *fDtype; // List of digits
199 Int_t *fNdtype; //[fNDetTypes] Num. of digits per type of det.
3bd79107 200
2aea926d 201 TObjArray *fCtype; // List of clusters
202 Int_t *fNctype; //[fNDetTypes] Num. of clust. per type of det.
ed9afcd2 203 TTree *fTreeC; //! Tree for raw clusters
3bd79107 204
2aea926d 205 TClonesArray *fRecPoints; // List of reconstructed points
206 Int_t fNRecPoints; // Number of rec points
3bd79107 207
ed9afcd2 208 ClassDef(AliITS,2) // Base class for ITS
fe4da5cc 209};
3bd79107 210
fe4da5cc 211#endif