Line data Source code
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 <TObjArray.h> // used in inline function GetModule.
14 : #include "AliDetector.h"
15 : #include "AliITSTrigger.h"
16 : #include "AliITSDetTypeSim.h"
17 :
18 :
19 : class TString;
20 : class TTree;
21 : class AliITSpListItem;
22 : class AliITSsimulation;
23 : class AliITSsegmentation;
24 :
25 : class AliITSCalibration;
26 : class AliITShit;
27 : class AliITSgeom;
28 : class AliITSdigit;
29 : class AliITSmodule;
30 : class AliDigitizationInput;
31 : class TArrayI;
32 :
33 : class AliITS : public AliDetector {
34 :
35 : public:
36 : enum {kSPD,kSDD,kSSD};
37 : enum {kMaxLabel=3141593}; // default track label assigned to digits/clusters
38 :
39 : //================= Standard Classes ===============================
40 : AliITS(); // Default creator.
41 : AliITS(const Char_t *title); // standard Creator
42 : AliITS(const char *name, const char *title); // extended standard Creator
43 : virtual ~AliITS(); // destructor
44 0 : virtual Int_t IsVersion() const {return 1;}
45 :
46 : //===================== Simulation Geometry ========================
47 : // get geometry version - detailed (major) or coarse (minor)
48 0 : virtual Int_t GetMajorVersion() const {return -1;}
49 0 : virtual Int_t GetMinorVersion() const {return -1;}
50 : virtual void GetGeometryVersion(Int_t &a,Int_t &b) const
51 0 : {a = GetMajorVersion();b=GetMinorVersion();return;}
52 0 : virtual void SetEUCLID(Bool_t euclid=kTRUE) {fEuclidOut = euclid;}
53 0 : virtual Bool_t GetEUCLID()const {return fEuclidOut;}
54 : //-------------------- Geometry Transformations --------------------
55 :
56 : // ITS geometry functions From Simulation
57 29154 : AliITSgeom* GetITSgeom() const {return fDetTypeSim->GetITSgeom();}
58 4 : void SetITSgeom(AliITSgeom *geom) {fDetTypeSim->SetITSgeom(geom);}
59 : // return pointer to the array of modules
60 0 : TObjArray *GetModules(){return fITSmodules;}
61 :
62 : AliITSmodule *GetModule(Int_t index){
63 24632 : return (AliITSmodule*)(fITSmodules->At(index));}
64 : virtual void SetSimuParam(AliITSSimuParam *sp){
65 0 : fSimuParam=sp;
66 0 : fDetTypeSim->SetSimuParam(sp);
67 0 : }
68 0 : AliITSSimuParam* GetSimuParam() const {return fSimuParam;}
69 :
70 0 : virtual void SetDetTypeSim(AliITSDetTypeSim* dts) {fDetTypeSim=dts;}
71 0 : AliITSDetTypeSim* GetDetTypeSim() const {return fDetTypeSim;}
72 : //================ Necessary general Classes =======================
73 : virtual void Init();
74 : virtual AliLoader* MakeLoader(const char* topfoldername);
75 : virtual void SetDefaults();
76 : virtual void SetDefaultSimulation();
77 : virtual void MakeBranch(Option_t *opt=" ");
78 : virtual void MakeBranchS(const char* fl);
79 : virtual void MakeBranchD(const char* file);
80 : virtual void MakeBranchInTreeD(TTree* treeD, const char* file=0);
81 : virtual void SetTreeAddress();
82 : //---------- Configuration Methods (per detector type) -------------
83 : // Determines which ITS subdetectors will be processed. Effects
84 : // digitization, and Reconstruction only.
85 2 : void SetDetectors(Option_t *opt="All"){fOpt = opt;}
86 : // Returns the list of ITS subdetectors that will be processed.
87 0 : Option_t* GetDetectors(){return fOpt;}
88 :
89 : // Set calibration
90 : virtual void SetCalibrationModel(Int_t dettype, AliITSCalibration *cal){
91 0 : fDetTypeSim->SetCalibrationModel(dettype,cal);}
92 : // Set segmentation for Simulation
93 : virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg){
94 0 : fDetTypeSim->SetSegmentationModel(id,seg);}
95 : // Set simulation
96 : virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim){
97 0 : fDetTypeSim->SetSimulationModel(id,sim);}
98 : // Set simulation
99 : virtual AliITSsimulation* GetSimulationModel(Int_t id){
100 0 : return fDetTypeSim->GetSimulationModel(id);}
101 : //=================== Hits =========================================
102 0 : virtual void StepManager() {} // See Step Manager for specific geometry.
103 : //------------ sort hits by module for Digitisation ----------------
104 : virtual void FillModules(Int_t /* evnt */,Int_t bgrev,Int_t /* nmodules */,
105 : Option_t *opt, const char *filename);
106 : virtual Bool_t InitModules(Int_t size,Int_t &nmodules);
107 : virtual void FillModules(TTree *treeH, Int_t mask = 0);
108 24 : virtual void ClearModules(){if(fITSmodules) fITSmodules->Delete();}
109 : virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
110 : // Trigger
111 : virtual AliTriggerDetector* CreateTriggerDetector() const;
112 :
113 : AliDigitizer* CreateDigitizer(AliDigitizationInput* digInput) const;
114 : virtual void UpdateInternalGeometry();
115 : virtual void SDigitsToDigits(Option_t *opt="All");
116 0 : virtual void SDigits2Digits(){SDigitsToDigits("All");}
117 : virtual void Hits2Digits();
118 : virtual void Hits2SDigits();
119 : virtual void Hits2PreDigits();
120 : virtual void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
121 : Option_t *option,Option_t *opt,
122 : const char *filename);
123 : virtual void HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
124 : Option_t *option,Option_t *opt,
125 : const char *filename);
126 : void HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size,
127 : Option_t *add, Option_t *det, const char *filename)
128 0 : {HitsToPreDigits(evNumber,bgrev,size,add,det,filename);}
129 :
130 : virtual void ResetDigits();
131 : virtual void ResetDigits(Int_t branch);
132 : virtual void AddSumDigit(AliITSpListItem &sdig);
133 : virtual void AddSimDigit(Int_t branch, AliITSdigit *d);
134 : virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
135 : Int_t* tracks,Int_t *hits,Float_t* trkcharges,
136 : Int_t sigexpanded=-1000);
137 24 : TObjArray* GetDigits() const {return fDetTypeSim->GetDigits();}
138 0 : Int_t* GetNDigitArray() const {return fDetTypeSim->GetNDigitArray();}
139 : TClonesArray *DigitsAddress(Int_t id) {
140 48 : return fDetTypeSim->DigitsAddress(id);}
141 : //Fast simulation
142 : virtual void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
143 : Option_t *add, Option_t *det, const char *filename);
144 : virtual Int_t Hits2Clusters(TTree *in, TTree *out);
145 : virtual void CheckLabels(Int_t lab[3]) const;
146 :
147 : //===================== Raw Data IO ================================
148 : // Write digits into raw data format
149 : virtual void Digits2Raw();
150 : virtual Bool_t Raw2SDigits(AliRawReader* rawReader);
151 :
152 : //===================== FO signals ================================
153 : // Write FO signals in UserInfo of SDigits/Digits tree
154 : void WriteFOSignals();
155 0 : void SetRawID2ClusID(const TArrayI* arr, Int_t iDet) { if (iDet>-1&&iDet<fgkNTYPES) fkRawID2ClusID[iDet] = arr;}
156 0 : const TArrayI* GetRawID2ClusID(Int_t iDet) const {return (iDet>-1&&iDet<fgkNTYPES) ? fkRawID2ClusID[iDet]:0;}
157 :
158 : protected:
159 : static const Int_t fgkNTYPES=3; //number of detector types
160 : //================== Data Members ==================================
161 : AliITSDetTypeSim *fDetTypeSim; //detector type for simulation
162 : Bool_t fEuclidOut; // Flag to write geometry in euclid format
163 : Option_t *fOpt; //! Detector option ="All" unless changed.
164 : Int_t fIdN; // the number of layers
165 : Int_t *fIdSens; //[fIdN] layer identifier
166 : TString *fIdName; //[fIdN] layer identifier
167 : TObjArray *fITSmodules; //! Pointer to ITS modules
168 : Bool_t fTiming; // flag to turn on/off timers.
169 : AliITSSimuParam* fSimuParam; //simulation parameters
170 : TClonesArray** fModA; //! Used by Raw2SDigits (one TC per module)
171 : TClonesArray* fpSDigits; //! Branch address to build SD from raw data
172 : const TArrayI* fkRawID2ClusID[fgkNTYPES]; //! optional array for SDigit->Cluster assingment in Raw2SDigit (for embedding)
173 : private:
174 : AliITS(const AliITS &source); // copy constructor. Not to be used!
175 : AliITS& operator=(const AliITS &source); // = operator. Not to be used!
176 130 : ClassDef(AliITS,9) // Base class for ITS
177 :
178 : };
179 :
180 : #endif
|