]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITS.h
Set suchthat fModules is not written to the root file. Definde AliITSmodule
[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 #include <TObjArray.h> // used in inline function GetModule.
13
14 #include "AliDetector.h"
15
16 class TString;
17 class TTree;
18 class TFile;
19
20 class AliITSDetType;
21 class AliITSsimulation;
22 class AliITSClusterFinder;
23 class AliITSsegmentation;
24 class AliITSresponse;
25 class AliITShit;
26 class AliITSgeom;
27 class AliITSdigit;
28 class AliITSRecPoint;
29 class AliITSRawCluster;
30 class AliITSmodule;
31 class AliITStrack;
32 class AliITSRad; 
33
34 const Int_t kNTYPES=3;
35
36
37 class AliITS : public AliDetector {
38
39   public:
40                     AliITS();
41                     AliITS(const char *name, const char *title);
42     virtual        ~AliITS();
43     AliITS(AliITS &source);
44     AliITS & operator=(AliITS &source);
45
46     virtual void   AddHit(Int_t track, Int_t *vol, Float_t *hits);
47     virtual void   AddRealDigit(Int_t branch, Int_t *digits);
48     virtual void   AddSimDigit(Int_t branch, AliITSdigit *d);
49     virtual void   AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,Int_t* tracks,Int_t *hits,Float_t* trkcharges); 
50     //
51     virtual void   AddCluster(Int_t branch, AliITSRawCluster *c);
52     virtual void   AddRecPoint(const AliITSRecPoint &p);
53
54     virtual void   ResetDigits();                   // depending on how the
55     virtual void   ResetDigits(Int_t branch);       // tree will be filled only
56     virtual void   ResetClusters();                 // one of the methods in 
57     virtual void   ResetClusters(Int_t branch);     // the pair will be kept
58     virtual void   ResetRecPoints();
59
60     // get geometry version - detailed (major) or coarse (minor)
61     virtual Int_t  GetMajorVersion(){return -1;}
62     virtual Int_t  GetMinorVersion(){return -1;}
63     void GetGeometryVersion(Int_t &a,Int_t &b) 
64                    {a = GetMajorVersion();b=GetMinorVersion();return;}
65     virtual Int_t  IsVersion() const {return 1;}
66     virtual Int_t  DistancetoPrimitive(Int_t px, Int_t py);
67     virtual void   Init();
68     virtual void   SetDefaults();
69     virtual void   SetDefaultSimulation();
70     virtual void   SetDefaultClusterFinders();
71     // create separate tree for clusters - declustering refining
72     virtual  void  MakeTreeC(Option_t *option="C");
73     void           GetTreeC(Int_t event);
74     virtual void   MakeBranch(Option_t *opt=" ", char *file=0);
75     void           SetTreeAddress();
76     virtual void   SetEUCLID(Bool_t euclid=1) {fEuclidOut = euclid;}
77     virtual void   StepManager() {}
78     // sort hits by module
79     virtual void   InitModules(Int_t size,Int_t &nmodules);  
80     virtual void   FillModules(Int_t evnt,Int_t bgrev,
81                        Int_t nmodules,Option_t *opt,Text_t *filename);
82     virtual void   ClearModules();
83     // Digitisation
84     virtual void   SDigits2Digits();  
85     void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
86                  Option_t *add, Option_t *det, Text_t *filename);
87     // Reconstruct hits
88     void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det);
89     // Fast simulation of space points from hits
90     void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
91                  Option_t *add, Option_t *det, Text_t *filename);
92
93     // Write digits into raw data format
94     virtual void Digits2RawData() {}
95     // Decode raw data and store digits
96     virtual void RawData2Digits() {}
97
98     // Configuration Methods (per detector type )
99     // Set response 
100     virtual void   SetResponseModel(Int_t id, AliITSresponse *response);
101     // Set segmentation 
102     virtual void   SetSegmentationModel(Int_t id, AliITSsegmentation *seg);
103     // Set simulation - temporary 
104     virtual void   SetSimulationModel(Int_t id, AliITSsimulation *sim);
105     // Set reconstruction 
106     virtual void   SetReconstructionModel(Int_t id, AliITSClusterFinder *rec);
107     // Set class names for digit and rec point 
108     virtual void   SetClasses(Int_t id, const char *digit, const char *cluster);
109
110
111     // Getters
112     // ITS geometry functions
113     virtual AliITSgeom  *GetITSgeom() const {return fITSgeom;}
114     // return pointer to the array of modules
115     virtual TObjArray   *GetModules() const {return fITSmodules;}
116     // return pointer to a particular module
117     AliITSmodule *GetModule(Int_t index) {return (AliITSmodule *)
118                                               (fITSmodules->At(index));}
119
120     // Return pointers to digits 
121     TObjArray            *Dtype() {return fDtype;}
122     Int_t                *Ndtype() {return fNdtype;}
123     virtual TClonesArray *DigitsAddress(Int_t id) 
124                    {return ((TClonesArray *) (*fDtype)[id]);}
125     // Return pointers to clusters 
126     TObjArray            *Ctype() {return fCtype;}
127     Int_t                *Nctype() {return fNctype;}
128     virtual TClonesArray *ClustersAddress(Int_t id) 
129                    {return ((TClonesArray *) (*fCtype)[id]);}
130
131     // Return pointer to rec points 
132     TClonesArray  *RecPoints()   {return fRecPoints;}
133
134     // Return pointer to DetType #id
135     AliITSDetType  *DetType(Int_t id);
136     //Int_t           NDetTypes() {return fNDetTypes;}
137
138     // Return pointer to the tree of clusters
139     TTree          *TreeC() {return fTreeC;}
140
141
142     // tracking
143
144     AliITStrack Tracking(AliITStrack &track, AliITStrack *reference, TObjArray *fpoints, Int_t **vettid,
145          Bool_t flagvert,  AliITSRad *rl );  
146
147     void DoTracking(Int_t evNumber, Int_t min_t, Int_t max_t, TFile *file, Bool_t flagvert);
148
149  protected:
150
151     AliITSgeom *fITSgeom;      // Pointer to ITS geometry
152     TObjArray  *fITSmodules;   //! Pointer to ITS modules
153     Bool_t      fEuclidOut;    // Flag to write geometry in euclid format
154     Int_t       fIdN;          // the number of layers
155     Int_t      *fIdSens;       //[fIdN] layer identifier
156 //    TObjArray  *fIdName;       // array of volume Id names
157     TString    *fIdName;       //[fIdN] layer identifier
158     //
159     Int_t          fNDetTypes;   // Number of detector types
160     TObjArray     *fDetTypes;    // List of detector types
161
162     TObjArray     *fDtype;       // List of digits
163     Int_t         *fNdtype;      //[fNDetTypes] Num. of digits per type of det. 
164     TObjArray     *fCtype;       // List of clusters
165     Int_t         *fNctype;      //[fNDetTypes] Num. of clust. per type of det.
166
167     TClonesArray  *fRecPoints;   // List of reconstructed points
168     Int_t          fNRecPoints;  // Number of rec points
169     TTree         *fTreeC;       // Tree for raw clusters
170
171
172     ClassDef(AliITS,1) // Base class for ITS
173 };
174
175 #endif