]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITS.h
2f2ef676535b085e6630ca8faadeb87da2de7d19
[u/mrichter/AliRoot.git] / ITS / AliITS.h
1 #ifndef ALIITS_H
2 #define ALIITS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ////////////////////////////////////////////////////////////////////////
9 //           Manager class for set: ITS                               //
10 ////////////////////////////////////////////////////////////////////////
11
12
13 #include "AliDetector.h"
14
15 class TObjArray;
16 class TString;
17 class TTree;
18
19 class AliITSDetType;
20 class AliITSsimulation;
21 class AliITSClusterFinder;
22 class AliITSsegmentation;
23 class AliITSresponse;
24 class AliITShit;
25 class AliITSgeom;
26 class AliITSdigit;
27 class AliITSRecPoint;
28 class AliITSRawCluster;
29 class AliITSmodule;
30
31
32
33
34 class AliITS : public AliDetector {
35
36   public:
37                     AliITS();
38                     AliITS(const char *name, const char *title);
39     virtual        ~AliITS();
40     AliITS(AliITS &source);
41     AliITS & operator=(AliITS &source);
42
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); 
47     //
48     virtual void   AddCluster(Int_t branch, AliITSRawCluster *c);
49     virtual void   AddRecPoint(const AliITSRecPoint &p);
50
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();
56
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     virtual Int_t  DistancetoPrimitive(Int_t px, Int_t py);
62     virtual void   Init();
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();
78     // Digitisation
79     void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
80                  Option_t *add, Option_t *det, Text_t *filename);
81     // Reconstruct hits
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);
86
87     // Write digits into raw data format
88     virtual void Digits2RawData() {}
89     // Decode raw data and store digits
90     virtual void RawData2Digits() {}
91
92     // Configuration Methods (per detector type )
93     // Set response 
94     virtual void   SetResponseModel(Int_t id, AliITSresponse *response);
95     // Set segmentation 
96     virtual void   SetSegmentationModel(Int_t id, AliITSsegmentation *seg);
97     // Set simulation - temporary 
98     virtual void   SetSimulationModel(Int_t id, AliITSsimulation *sim);
99     // Set reconstruction 
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);
103
104
105     // Getters
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));}
113
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]);}
124
125     // Return pointer to rec points 
126     TClonesArray  *RecPoints()   {return fRecPoints;}
127
128     // Return pointer to DetType #id
129     AliITSDetType  *DetType(Int_t id);
130     //Int_t           NDetTypes() {return fNDetTypes;}
131
132     // Return pointer to the tree of clusters
133     TTree          *TreeC() {return fTreeC;}
134
135
136  protected:
137
138     static const Int_t fgkNTYPES;          // Number of detector types
139
140     AliITSgeom  *fITSgeom;                   // Pointer to ITS geometry
141     TObjArray   *fITSmodules;                // Pointer to ITS modules
142
143     Bool_t fEuclidOut;                       // Flag to write out geometry 
144                                              // in euclid format
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
150     //
151     //
152
153     // Int_t             fNDetTypes;           //Number of detector types
154     TObjArray            *fDetTypes;           // List of detector types
155
156     TObjArray            *fDtype;              //[fgkNTYPES]  List of digits
157     Int_t                *fNdtype;             //[fgkNTYPES] Number of digits per type of
158                                                // detector 
159     TObjArray            *fCtype;              //[fgkNTYPES] List of clusters
160     Int_t                *fNctype;             //[fgkNTYPES] Number of clusters per type
161                                                // of detector
162
163     TClonesArray         *fRecPoints;          // List of reconstructed points
164     Int_t                 fNRecPoints;         // Number of rec points
165     TTree                *fTreeC;              // Tree for raw clusters
166
167
168     ClassDef(AliITS,1) // Base class for ITS
169 };
170
171 #endif