1) Added classes for digitization
[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;
27class AliITSgeom;
28class AliITSdigit;
29class AliDigitizationInput;
30class AliITSUSensMap;
31class AliITSUSimuParam;
32
33
34class AliITSU : public AliDetector {
35
36 public:
37 //
38 // number detector types
39 enum {kNDetTypes = AliITSUGeomTGeo::kNDetTypes};
40 //
41 //================= Standard Classes ===============================
42 AliITSU(); // Default creator.
43 AliITSU(const char *title, Int_t nlayers); // extended standard Creator
44 virtual ~AliITSU(); // destructor
45 virtual Int_t IsVersion() const {return 11;}
46
47 //===================== Simulation Geometry ========================
48 // get geometry version - detailed (major) or coarse (minor)
49 virtual Int_t GetMajorVersion() const {return -1;}
50 virtual Int_t GetMinorVersion() const {return -1;}
51 virtual void GetGeometryVersion(Int_t &a,Int_t &b) const {a = GetMajorVersion();b=GetMinorVersion();return;}
52 virtual void SetEUCLID(Bool_t euclid=kTRUE) {fEuclidOut = euclid;}
53 virtual Bool_t GetEUCLID()const {return fEuclidOut;}
54 //-------------------- Geometry Transformations --------------------
55
56 // ITS geometry functions From Simulation
57 AliITSUGeomTGeo* GetITSGeomTGeo() const {return fGeomTGeo;}
58 //RS AliITSgeom* GetITSgeom() const {return fDetTypeSim->GetITSgeom();}
59 //RS void SetITSgeom(AliITSgeom *geom) {fDetTypeSim->SetITSgeom(geom);}
60 // return pointer to the array of modules
61
62 AliITSUModule * GetModule(Int_t index) {return (AliITSUModule*)fModuleHits->UncheckedAt(index);}
63 AliITSUSimuParam* GetSimuParam() const {return fSimuParam;}
64
65 //================ Necessary general Classes =======================
66 virtual void Init();
67 virtual AliLoader* MakeLoader(const char* topfoldername);
68 virtual void MakeBranch(Option_t *opt=" ");
69 virtual void MakeBranchS(const char* fl);
70 virtual void MakeBranchD(const char* file);
71 virtual void MakeBranchInTreeD(TTree* treeD, const char* file=0);
72 virtual void SetTreeAddress();
73 virtual AliITSUSimulation* GetSimulationModel(Int_t id) {return (AliITSUSimulation*)fSimulation->At(id/AliITSUGeomTGeo::kMaxSegmPerDetType);}
74 virtual AliITSsegmentation* GetSegmentation(Int_t id) {return (AliITSsegmentation*) fSegmentation->At(id);}
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();
123 const char* GetDigitClassName(Int_t i) {return Form("AliITSdigit%s",AliITSUGeomTGeo::GetDetTypeName(i));}
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.
133 AliITSUSimuParam* fSimuParam; //simulation parameters
134 AliITSUGeomTGeo* fGeomTGeo; // access to geometry details
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
141 AliITSUSensMap* fSensMap; //! sensor map for digitization
142 //
143 TObjArray *fSimulation; //! simulation objects per det.type
144 TObjArray *fSegmentation; //! segmentation objects per det.type (and segmentation)
145 TObjArray *fCalibration; //! calibration objects
146 Int_t fRunNumber; //! run number
147 Bool_t fSimInitDone; //! flag initialized simulation
148
149 private:
150 AliITSU(const AliITSU &source); // copy constructor. Not to be used!
151 AliITSU& operator=(const AliITSU &source); // = operator. Not to be used!
152 ClassDef(AliITSU,1) // Base class for ITS
153};
154
155#endif