cleaned up and improved some warnings during digitization. For SDD improved
[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.
3bd79107 13
fe4da5cc 14#include "AliDetector.h"
de82972f 15
d5da1ecf 16class TString;
17class TTree;
55b5a0b3 18class TFile;
fe4da5cc 19
e8189707 20class AliITSDetType;
3bd79107 21class AliITSsimulation;
22class AliITSClusterFinder;
de82972f 23class AliITSsegmentation;
24class AliITSresponse;
25class AliITShit;
26class AliITSgeom;
2aea926d 27class AliITSpListItem;
de82972f 28class AliITSdigit;
29class AliITSRecPoint;
30class AliITSRawCluster;
31class AliITSmodule;
27a043b1 32
a8a6107b 33const Int_t kNTYPES=3;
de82972f 34
3bd79107 35class AliITS : public AliDetector {
58005f18 36
2aea926d 37 public:
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);
46
47 //===================== Simulation Geometry ========================
e8189707 48 // get geometry version - detailed (major) or coarse (minor)
2aea926d 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));}
3bd79107 62
2aea926d 63 //================ Nessesary general Classes =======================
64 virtual void Init();
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) -------------
3bd79107 74 // Set response
2aea926d 75 virtual void SetResponseModel(Int_t id, AliITSresponse *response);
3bd79107 76 // Set segmentation
2aea926d 77 virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg);
3bd79107 78 // Set simulation - temporary
2aea926d 79 virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim);
3bd79107 80 // Set reconstruction
2aea926d 81 virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec);
3bd79107 82 // Set class names for digit and rec point
2aea926d 83 virtual void SetClasses(Int_t id, const char *digit, const char *cluster);
84
85 //=================== Hits =========================================
86 virtual void StepManager() {} // See Step Manager for specific geometry.
87 virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
88 //------------ sort hits by module for Digitisation ----------------
89 virtual void InitModules(Int_t size,Int_t &nmodules);
90 virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
91 Option_t *opt,Text_t *filename);
92 virtual void ClearModules();
93
94 //===================== Digitisation ===============================
95 void MakeBranchS(const char *file);
96 void SetTreeAddressS(TTree *treeS);
97 void MakeBranchD(const char *file);
98 void SetTreeAddressD(TTree *treeD);
99 void Hits2SDigits(); // Turn hits into SDigits
100 void Hits2PreDigits(); // Turn hits into SDigits
101 void SDigits2Digits(); // Turn SDigits to Digits
102 void Hits2Digits(); // Turn hits straight into Digits.
103 //------------------ Internal functions ----------------------------
104 // Standard Hits To SDigits function
105 void HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size,
106 Option_t *add, Option_t *det, Text_t *filename);
107 // Standard Hits To SDigits function
108 void HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
109 Option_t *add, Option_t *det, Text_t *filename);
110 // Standard Hits To Digits function
111 void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
112 Option_t *add, Option_t *det, Text_t *filename);
113 void ResetSDigits(); // Resets the Summable digits.
114 void ResetDigits(); // depending on how the
115 void ResetDigits(Int_t branch); // tree will be filled only
116 void AddSumDigit(AliITSpListItem &sdig);
117 void AddRealDigit(Int_t branch, Int_t *digits);
118 void AddSimDigit(Int_t branch, AliITSdigit *d);
119 void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
120 Int_t* tracks,Int_t *hits,Float_t* trkcharges);
121 // Return pointers to digits
122 TObjArray *Dtype() {return fDtype;}
123 Int_t *Ndtype() {return fNdtype;}
124 TClonesArray *DigitsAddress(Int_t id)
125 {return ((TClonesArray *) (*fDtype)[id]);}
3bd79107 126
2aea926d 127 //===================== Raw Data IO ================================
128 // Write digits into raw data format
129 virtual void Digits2RawData() {}
130 // Decode raw data and store digits
131 virtual void RawData2Digits() {}
58005f18 132
2aea926d 133 //==================== Clusterization ==============================
134 // create separate tree for clusters - declustering refining
135 void MakeTreeC(Option_t *option="C");
136 void GetTreeC(Int_t event);
137 void AddCluster(Int_t branch, AliITSRawCluster *c);
138 void ResetClusters(); // one of the methods in
139 void ResetClusters(Int_t branch); // the pair will be kept
140 // Return pointer to the tree of clusters
141 TTree *TreeC() {return fTreeC;}
3bd79107 142 // Return pointers to clusters
2aea926d 143 TObjArray *Ctype() {return fCtype;}
144 Int_t *Nctype() {return fNctype;}
145 TClonesArray *ClustersAddress(Int_t id)
3bd79107 146 {return ((TClonesArray *) (*fCtype)[id]);}
147
2aea926d 148 //=================== Reconstruction ===============================
149 void MakeBranchR(const char *file);
150 void SetTreeAddressR(TTree *treeR);
151 void AddRecPoint(const AliITSRecPoint &p);
152 void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
153 Option_t *add, Option_t *det, Text_t *filename);
154 void Digits2Reco();
155 void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det);
156 void ResetRecPoints();
3bd79107 157 // Return pointer to rec points
158 TClonesArray *RecPoints() {return fRecPoints;}
3bd79107 159
2aea926d 160 protected:
161 //================== Data Members ==================================
162 AliITSgeom *fITSgeom; // Pointer to ITS geometry
163 Bool_t fEuclidOut; // Flag to write geometry in euclid format
164 TObjArray *fITSmodules; //! Pointer to ITS modules
3bd79107 165
2aea926d 166 Int_t fIdN; // the number of layers
167 Int_t *fIdSens; //[fIdN] layer identifier
168 TString *fIdName; //[fIdN] layer identifier
3bd79107 169
2aea926d 170 Int_t fNDetTypes; // Number of detector types
171 TObjArray *fDetTypes; // List of detector types
e8189707 172
2aea926d 173// TObjArray *fSDigits; // List of Summable digits.
174 TClonesArray *fSDigits; // List of Summable digits.
175 Int_t fNSDigits; // Number of Summable Digits.
55b5a0b3 176
2aea926d 177 TObjArray *fDtype; // List of digits
178 Int_t *fNdtype; //[fNDetTypes] Num. of digits per type of det.
3bd79107 179
2aea926d 180 TObjArray *fCtype; // List of clusters
181 Int_t *fNctype; //[fNDetTypes] Num. of clust. per type of det.
182 TTree *fTreeC; // Tree for raw clusters
3bd79107 183
2aea926d 184 TClonesArray *fRecPoints; // List of reconstructed points
185 Int_t fNRecPoints; // Number of rec points
3bd79107 186
187 ClassDef(AliITS,1) // Base class for ITS
fe4da5cc 188};
3bd79107 189
fe4da5cc 190#endif