3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ////////////////////////////////////////////////////////////////////////
9 // Manager class for set: ITS //
10 ////////////////////////////////////////////////////////////////////////
12 #include <TObjArray.h> // used in inline function GetModule.
14 #include "AliDetector.h"
21 class AliITSsimulation;
22 class AliITSClusterFinder;
23 class AliITSsegmentation;
27 class AliITSpListItem;
30 class AliITSRawCluster;
33 const Int_t kNTYPES=3;
35 class AliITS : public AliDetector {
38 //================= Standard Classes ===============================
39 AliITS(); // Default creator.
40 AliITS(const char *name, const char *title); // standard Creator
41 virtual ~AliITS(); // destructor
42 AliITS(AliITS &source); // copy constructor. Not to be used!
43 AliITS& operator=(AliITS &source); // = operator. Not to be used!
44 virtual Int_t IsVersion() const {return 1;}
45 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
47 //===================== Simulation Geometry ========================
48 // get geometry version - detailed (major) or coarse (minor)
49 virtual Int_t GetMajorVersion(){return -1;}
50 virtual Int_t GetMinorVersion(){return -1;}
51 virtual void GetGeometryVersion(Int_t &a,Int_t &b)
52 {a = GetMajorVersion();b=GetMinorVersion();return;}
53 virtual void SetEUCLID(Bool_t euclid=1) {fEuclidOut = euclid;}
54 //-------------------- Geometry Transformations --------------------
55 // ITS geometry functions
56 AliITSgeom *GetITSgeom() const {return fITSgeom;}
57 // return pointer to the array of modules
58 TObjArray *GetModules() const {return fITSmodules;}
59 // return pointer to a particular module
60 AliITSmodule *GetModule(Int_t index) {return (AliITSmodule *)
61 (fITSmodules->At(index));}
63 //================ Nessesary general Classes =======================
65 virtual void SetDefaults();
66 virtual void SetDefaultSimulation();
67 virtual void SetDefaultClusterFinders();
68 virtual void MakeBranch(Option_t *opt=" ", const char *file=0);
69 virtual void SetTreeAddress();
70 // Return pointer to DetType #id
71 AliITSDetType *DetType(Int_t id);
72 //Int_t NDetTypes() {return fNDetTypes;}
73 //---------- Configuration Methods (per detector type) -------------
74 // Determines which ITS subdetectors will be processed. Effects
75 // digitization, and Reconstruction only.
76 void SetDetectors(Option_t *opt="All"){fOpt = opt;}
77 // Returns the list of ITS subdetectors that will be processed.
78 Option_t* GetDetectors(){return fOpt;}
80 virtual void SetResponseModel(Int_t id, AliITSresponse *response);
82 virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg);
83 // Set simulation - temporary
84 virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim);
86 virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec);
87 // Set class names for digit and rec point
88 virtual void SetClasses(Int_t id, const char *digit, const char *cluster);
90 //=================== Hits =========================================
91 virtual void StepManager() {} // See Step Manager for specific geometry.
92 virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
93 //------------ sort hits by module for Digitisation ----------------
94 virtual void InitModules(Int_t size,Int_t &nmodules);
95 virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
96 Option_t *opt,Text_t *filename);
97 virtual void ClearModules();
99 //===================== Digitisation ===============================
100 void MakeBranchS(const char *file);
101 void SetTreeAddressS(TTree *treeS);
102 void MakeBranchD(const char *file);
103 void SetTreeAddressD(TTree *treeD);
104 void Hits2SDigits(); // Turn hits into SDigits
105 void Hits2PreDigits(); // Turn hits into SDigits
106 void SDigits2Digits(); // Turn SDigits to Digits
107 void Hits2Digits(); // Turn hits straight into Digits.
108 //------------------ Internal functions ----------------------------
109 // Standard Hits To SDigits function
110 void HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size,
111 Option_t *add, Option_t *det, Text_t *filename);
112 // Standard Hits To SDigits function
113 void HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
114 Option_t *add, Option_t *det, Text_t *filename);
115 // Standard Hits To Digits function
116 void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
117 Option_t *add, Option_t *det, Text_t *filename);
118 void ResetSDigits(); // Resets the Summable digits.
119 void ResetDigits(); // depending on how the
120 void ResetDigits(Int_t branch); // tree will be filled only
121 void AddSumDigit(AliITSpListItem &sdig);
122 void AddRealDigit(Int_t branch, Int_t *digits);
123 void AddSimDigit(Int_t branch, AliITSdigit *d);
124 void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
125 Int_t* tracks,Int_t *hits,Float_t* trkcharges);
126 // Return pointers to digits
127 TObjArray *Dtype() {return fDtype;}
128 Int_t *Ndtype() {return fNdtype;}
129 TClonesArray *DigitsAddress(Int_t id)
130 {return ((TClonesArray *) (*fDtype)[id]);}
132 //===================== Raw Data IO ================================
133 // Write digits into raw data format
134 virtual void Digits2RawData() {}
135 // Decode raw data and store digits
136 virtual void RawData2Digits() {}
138 //==================== Clusterization ==============================
139 // create separate tree for clusters - declustering refining
140 void MakeTreeC(Option_t *option="C");
141 void GetTreeC(Int_t event);
142 void AddCluster(Int_t branch, AliITSRawCluster *c);
143 void ResetClusters(); // one of the methods in
144 void ResetClusters(Int_t branch); // the pair will be kept
145 // Return pointer to the tree of clusters
146 TTree *TreeC() {return fTreeC;}
147 // Return pointers to clusters
148 TObjArray *Ctype() {return fCtype;}
149 Int_t *Nctype() {return fNctype;}
150 TClonesArray *ClustersAddress(Int_t id)
151 {return ((TClonesArray *) (*fCtype)[id]);}
153 //=================== Reconstruction ===============================
154 void MakeBranchR(const char *file);
155 void SetTreeAddressR(TTree *treeR);
156 void AddRecPoint(const AliITSRecPoint &p);
157 void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
158 Option_t *add, Option_t *det, Text_t *filename);
160 void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det);
161 void ResetRecPoints();
162 // Return pointer to rec points
163 TClonesArray *RecPoints() {return fRecPoints;}
166 //================== Data Members ==================================
167 AliITSgeom *fITSgeom; // Pointer to ITS geometry
168 Bool_t fEuclidOut; // Flag to write geometry in euclid format
169 TObjArray *fITSmodules; //! Pointer to ITS modules
170 Option_t *fOpt; //! Detector option ="All" unless changed.
172 Int_t fIdN; // the number of layers
173 Int_t *fIdSens; //[fIdN] layer identifier
174 TString *fIdName; //[fIdN] layer identifier
176 Int_t fNDetTypes; // Number of detector types
177 TObjArray *fDetTypes; // List of detector types
179 // TObjArray *fSDigits; // List of Summable digits.
180 TClonesArray *fSDigits; // List of Summable digits.
181 Int_t fNSDigits; // Number of Summable Digits.
183 TObjArray *fDtype; // List of digits
184 Int_t *fNdtype; //[fNDetTypes] Num. of digits per type of det.
186 TObjArray *fCtype; // List of clusters
187 Int_t *fNctype; //[fNDetTypes] Num. of clust. per type of det.
188 TTree *fTreeC; // Tree for raw clusters
190 TClonesArray *fRecPoints; // List of reconstructed points
191 Int_t fNRecPoints; // Number of rec points
193 ClassDef(AliITS,1) // Base class for ITS