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 ////////////////////////////////////////////////////////////////////////
13 #include "AliDetector.h"
17 class AliITSsimulation;
18 class AliITSClusterFinder;
19 class AliITSsegmentation;
25 class AliITSRawCluster;
34 class AliITS : public AliDetector {
38 AliITS(const char *name, const char *title);
40 AliITS(AliITS &source);
41 AliITS & operator=(AliITS &source);
43 virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
44 virtual void AddRealDigit(Int_t branch, Int_t *digits);
45 virtual void AddSimDigit(Int_t branch, AliITSdigit *d);
46 virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,Int_t* tracks,Int_t *hits,Float_t* trkcharges);
48 virtual void AddCluster(Int_t branch, AliITSRawCluster *c);
49 virtual void AddRecPoint(const AliITSRecPoint &p);
51 virtual void ResetDigits(); // depending on how the
52 virtual void ResetDigits(Int_t branch); // tree will be filled only
53 virtual void ResetClusters(); // one of the methods in
54 virtual void ResetClusters(Int_t branch); // the pair will be kept
55 virtual void ResetRecPoints();
57 // get geometry version - detailed (major) or coarse (minor)
58 void GetGeometryVersion(Int_t &a,Int_t &b) const
59 {a = fMajorVersion;b=fMinorVersion;return;}
60 virtual Int_t IsVersion() const {return 1;}
61 Int_t DistancetoPrimitive(Int_t px, Int_t py);
63 virtual void SetDefaults();
64 virtual void SetDefaultSimulation();
65 virtual void SetDefaultClusterFinders();
66 // create separate tree for clusters - declustering refining
67 virtual void MakeTreeC(Option_t *option="C");
68 void GetTreeC(Int_t event);
69 virtual void MakeBranch(Option_t *opt=" ");
70 void SetTreeAddress();
71 virtual void SetEUCLID(Bool_t euclid=1) {fEuclidOut = euclid;}
72 virtual void StepManager() {}
73 // sort hits by module
74 virtual void InitModules(Int_t size,Int_t &nmodules);
75 virtual void FillModules(Int_t evnt,Int_t bgrev,
76 Int_t nmodules,Option_t *opt,Text_t *filename);
77 virtual void ClearModules();
79 void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
80 Option_t *add, Option_t *det, Text_t *filename);
82 void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det);
83 // Fast simulation of space points from hits
84 void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
85 Option_t *add, Option_t *det, Text_t *filename);
87 // Write digits into raw data format
88 virtual void Digits2RawData() {}
89 // Decode raw data and store digits
90 virtual void RawData2Digits() {}
92 // Configuration Methods (per detector type )
94 virtual void SetResponseModel(Int_t id, AliITSresponse *response);
96 virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg);
97 // Set simulation - temporary
98 virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim);
100 virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec);
101 // Set class names for digit and rec point
102 virtual void SetClasses(Int_t id, const char *digit, const char *cluster);
106 // ITS geometry functions
107 virtual AliITSgeom *GetITSgeom() const {return fITSgeom;}
108 // return pointer to the array of modules
109 virtual TObjArray *GetModules() const {return fITSmodules;}
110 // return pointer to a particular module
111 AliITSmodule *GetModule(Int_t index) {return (AliITSmodule *)
112 (fITSmodules->At(index));}
114 // Return pointers to digits
115 TObjArray *Dtype() {return fDtype;}
116 Int_t *Ndtype() {return fNdtype;}
117 virtual TClonesArray *DigitsAddress(Int_t id)
118 {return ((TClonesArray *) (*fDtype)[id]);}
119 // Return pointers to clusters
120 TObjArray *Ctype() {return fCtype;}
121 Int_t *Nctype() {return fNctype;}
122 virtual TClonesArray *ClustersAddress(Int_t id)
123 {return ((TClonesArray *) (*fCtype)[id]);}
125 // Return pointer to rec points
126 TClonesArray *RecPoints() {return fRecPoints;}
128 // Return pointer to DetType #id
129 AliITSDetType *DetType(Int_t id);
130 //Int_t NDetTypes() {return fNDetTypes;}
132 // Return pointer to the tree of clusters
133 TTree *TreeC() {return fTreeC;}
138 static const Int_t fgkNTYPES; // Number of detector types
140 AliITSgeom *fITSgeom; // Pointer to ITS geometry
141 TObjArray *fITSmodules; // Pointer to ITS modules
143 Bool_t fEuclidOut; // Flag to write out geometry
145 Int_t fIdN; // the number of layers
146 Int_t *fIdSens; //[fIdN] layer identifier
147 TString *fIdName; //[fIdN] layer identifier
148 // Geometry and Stepmanager version numbers used.
149 Int_t fMajorVersion,fMinorVersion; //detailed and coarse(minor) versions
153 // Int_t fNDetTypes; //Number of detector types
154 TObjArray *fDetTypes; // List of detector types
156 TObjArray *fDtype; //[fgkNTYPES] List of digits
157 Int_t *fNdtype; //[fgkNTYPES] Number of digits per type of
159 TObjArray *fCtype; //[fgkNTYPES] List of clusters
160 Int_t *fNctype; //[fgkNTYPES] Number of clusters per type
163 TClonesArray *fRecPoints; // List of reconstructed points
164 Int_t fNRecPoints; // Number of rec points
165 TTree *fTreeC; // Tree for raw clusters
168 ClassDef(AliITS,1) // Base class for ITS