fix
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSU.h
CommitLineData
451f5018 1#ifndef ALIITSU_H
2#define ALIITSU_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id: AliITSU.h */
7
8////////////////////////////////////////////////////////////////////////
9// Manager class for set: ITS Upgrade //
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#include "AliITSUGeomTGeo.h"
18
19class TString;
20class TTree;
21class AliITSUSDigit;
22class AliITSUSimulation;
23class AliITSsegmentation;
24class AliITSUModule;
25class AliITSCalibration;
26class AliITSUHit;
451f5018 27class AliITSdigit;
28class AliDigitizationInput;
29class AliITSUSensMap;
30class AliITSUSimuParam;
c92b1537 31class AliParamList;
451f5018 32
33class AliITSU : public AliDetector {
34
35 public:
36 //
37 // number detector types
38 enum {kNDetTypes = AliITSUGeomTGeo::kNDetTypes};
39 //
40 //================= Standard Classes ===============================
41 AliITSU(); // Default creator.
42 AliITSU(const char *title, Int_t nlayers); // extended standard Creator
43 virtual ~AliITSU(); // destructor
44 virtual Int_t IsVersion() const {return 11;}
45
46 //===================== Simulation Geometry ========================
47 // get geometry version - detailed (major) or coarse (minor)
48 virtual Int_t GetMajorVersion() const {return -1;}
49 virtual Int_t GetMinorVersion() const {return -1;}
50 virtual void GetGeometryVersion(Int_t &a,Int_t &b) const {a = GetMajorVersion();b=GetMinorVersion();return;}
51 virtual void SetEUCLID(Bool_t euclid=kTRUE) {fEuclidOut = euclid;}
52 virtual Bool_t GetEUCLID()const {return fEuclidOut;}
53 //-------------------- Geometry Transformations --------------------
54
55 // ITS geometry functions From Simulation
56 AliITSUGeomTGeo* GetITSGeomTGeo() const {return fGeomTGeo;}
57 //RS AliITSgeom* GetITSgeom() const {return fDetTypeSim->GetITSgeom();}
58 //RS void SetITSgeom(AliITSgeom *geom) {fDetTypeSim->SetITSgeom(geom);}
59 // return pointer to the array of modules
60
61 AliITSUModule * GetModule(Int_t index) {return (AliITSUModule*)fModuleHits->UncheckedAt(index);}
62 AliITSUSimuParam* GetSimuParam() const {return fSimuParam;}
63
64 //================ Necessary general Classes =======================
65 virtual void Init();
66 virtual AliLoader* MakeLoader(const char* topfoldername);
67 virtual void MakeBranch(Option_t *opt=" ");
68 virtual void MakeBranchS(const char* fl);
69 virtual void MakeBranchD(const char* file);
70 virtual void MakeBranchInTreeD(TTree* treeD, const char* file=0);
71 virtual void SetTreeAddress();
c92b1537 72 virtual AliITSUSimulation* GetSimulationModel(Int_t lr) {return (AliITSUSimulation*)fSimModelLr[lr];}
73 virtual AliITSsegmentation* GetSegmentation(Int_t lr) {return (AliITSsegmentation*)fSegModelLr[lr];}
74 virtual AliParamList* GetResponseParam(Int_t lr) {return (AliParamList*)fResponseLr[lr];}
451f5018 75 //=================== Hits =========================================
76 virtual void StepManager() {} // See Step Manager for specific geometry.
77 //------------ sort hits by module for Digitisation ----------------
78 virtual void FillModules(Int_t bgrev, Option_t *opt, const char *filename);
79 virtual void FillModules(TTree *treeH, Int_t mask = 0);
80 virtual void ClearModules();
81 virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
82 void InitSimulation();
83 //
84 // Trigger
85 // virtual AliTriggerDetector* CreateTriggerDetector() const;
86
87 AliDigitizer* CreateDigitizer(AliDigitizationInput* manager) const;
88 virtual void SDigits2Digits();
89 virtual void Hits2Digits();
90 virtual void Hits2SDigits();
91 virtual void Hits2Digits(Int_t evNumber,Int_t bgrev,Option_t *option, const char *filename);
92 virtual void Hits2SDigits(Int_t evNumber,Int_t bgrev,Option_t *option,const char *filename);
93
94 virtual void ResetSDigits() {if (fSDigits) fSDigits->Clear();}
95 virtual void ResetDigits();
96 virtual void ResetDigits(Int_t branch);
97 virtual void AddSumDigit(AliITSUSDigit &sdig);
98 virtual void AddSimDigit(Int_t branch, AliITSdigit *d);
99 virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,Int_t* tracks,Int_t *hits,Float_t* trkcharges,Int_t sigexpanded=-1000);
100 TObjArray* GetDigits() const {return fDetDigits;}
101 TClonesArray *DigitsAddress(Int_t id) {return fDetDigits ? (TClonesArray*)fDetDigits->At(id) : 0;}
102 //Fast simulation
103 virtual void Hits2FastRecPoints(Int_t bgrev,Option_t *opr, const char *filename);
104 virtual Int_t Hits2Clusters(TTree *in, TTree *out);
105 virtual void CheckLabels(Int_t lab[3]) const;
106
107 //===================== Raw Data IO ================================
108 // Write digits into raw data format
109 virtual void Digits2Raw();
110 virtual Bool_t Raw2SDigits(AliRawReader*);
111
112 //===================== FO signals ================================
113 // Write FO signals in UserInfo of SDigits/Digits tree
114 void WriteFOSignals();
115
116 void SetRunNumber(Int_t rn=0) {fRunNumber = rn;}
117 Int_t GetNLayers() const {return fNLayers;}
118 Int_t GetRunNumber() const {return fRunNumber;}
119 Bool_t IsSimInitDone() const {return fSimInitDone;}
120
121 protected:
122 void InitArrays();
02d6eccc 123 const char* GetDigitClassName(Int_t i) {return Form("AliITSUDigit%s",AliITSUGeomTGeo::GetDetTypeName(i));}
451f5018 124 const char* GetDetTypeName(Int_t i) {return AliITSUGeomTGeo::GetDetTypeName(i);}
125
126 protected:
127 //================== Data Members ==================================
128 Bool_t fEuclidOut; // Flag to write geometry in euclid format
129 Int_t fNLayers; // the number of layers
130 Int_t *fIdSens; //[fNLayers] layer identifier
131 TString *fLayerName; //[fNLayers] layer identifier
132 Bool_t fTiming; // flag to turn on/off timers.
02d6eccc 133 AliITSUGeomTGeo* fGeomTGeo; // access to geometry details
134 AliITSUSimuParam* fSimuParam; //!simulation parameters
451f5018 135 TClonesArray** fModA; //! Used by Raw2SDigits (one TC per module)
136 TClonesArray* fpSDigits; //! Branch address to build SD from raw data
137 TClonesArray* fSDigits; //! Branch address to build SD
138 TClonesArray* fDetHits; //! array of full detector hits
139 TObjArray* fModuleHits; //! module's hits container in (pointers on the fDetHits)
140 TObjArray* fDetDigits; //! AliDetector has TClonesArray fDigits, avoid same name
02d6eccc 141 AliITSUSensMap* fSensMap; //! sensor map for digitization
451f5018 142 //
c92b1537 143 AliITSUSimulation **fSimModelLr; //! simulation objects per layer
144 AliITSsegmentation **fSegModelLr; //! segmentation objects per layar
145 AliParamList **fResponseLr; //! response parameters for each layer
451f5018 146 TObjArray *fCalibration; //! calibration objects
147 Int_t fRunNumber; //! run number
148 Bool_t fSimInitDone; //! flag initialized simulation
149
150 private:
151 AliITSU(const AliITSU &source); // copy constructor. Not to be used!
152 AliITSU& operator=(const AliITSU &source); // = operator. Not to be used!
153 ClassDef(AliITSU,1) // Base class for ITS
154};
155
156#endif