Integrating the Cooked Matrix tracker into the commom reconstruction framework
[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
852af72e 13#include <TObjArray.h> // used in inline function GetChip.
451f5018 14#include "AliDetector.h"
15#include "AliITSTrigger.h"
451f5018 16#include "AliITSUGeomTGeo.h"
17
18class TString;
19class TTree;
20class AliITSUSDigit;
21class AliITSUSimulation;
22class AliITSsegmentation;
852af72e 23class AliITSUChip;
451f5018 24class AliITSCalibration;
25class AliITSUHit;
451f5018 26class AliITSdigit;
27class AliDigitizationInput;
28class AliITSUSensMap;
29class AliITSUSimuParam;
29ad4146 30class AliITSUParamList;
451f5018 31
32class AliITSU : public AliDetector {
33
34 public:
35 //
36 // number detector types
852af72e 37 enum {kNChipTypes = AliITSUGeomTGeo::kNChipTypes};
451f5018 38 //
39 //================= Standard Classes ===============================
40 AliITSU(); // Default creator.
41 AliITSU(const char *title, Int_t nlayers); // extended standard Creator
42 virtual ~AliITSU(); // destructor
43 virtual Int_t IsVersion() const {return 11;}
44
45 //===================== Simulation Geometry ========================
46 // get geometry version - detailed (major) or coarse (minor)
47 virtual Int_t GetMajorVersion() const {return -1;}
48 virtual Int_t GetMinorVersion() const {return -1;}
49 virtual void GetGeometryVersion(Int_t &a,Int_t &b) const {a = GetMajorVersion();b=GetMinorVersion();return;}
50 virtual void SetEUCLID(Bool_t euclid=kTRUE) {fEuclidOut = euclid;}
51 virtual Bool_t GetEUCLID()const {return fEuclidOut;}
52 //-------------------- Geometry Transformations --------------------
53
54 // ITS geometry functions From Simulation
55 AliITSUGeomTGeo* GetITSGeomTGeo() const {return fGeomTGeo;}
852af72e 56 //RS AliITSgeom* GetITSgeom() const {return fChipTypeSim->GetITSgeom();}
57 //RS void SetITSgeom(AliITSgeom *geom) {fChipTypeSim->SetITSgeom(geom);}
58 // return pointer to the array of chips
451f5018 59
852af72e 60 AliITSUChip * GetChip(Int_t index) {return (AliITSUChip*)fChipHits->UncheckedAt(index);}
451f5018 61 AliITSUSimuParam* GetSimuParam() const {return fSimuParam;}
62
63 //================ Necessary general Classes =======================
64 virtual void Init();
65 virtual AliLoader* MakeLoader(const char* topfoldername);
66 virtual void MakeBranch(Option_t *opt=" ");
67 virtual void MakeBranchS(const char* fl);
68 virtual void MakeBranchD(const char* file);
69 virtual void MakeBranchInTreeD(TTree* treeD, const char* file=0);
70 virtual void SetTreeAddress();
c92b1537 71 virtual AliITSUSimulation* GetSimulationModel(Int_t lr) {return (AliITSUSimulation*)fSimModelLr[lr];}
72 virtual AliITSsegmentation* GetSegmentation(Int_t lr) {return (AliITSsegmentation*)fSegModelLr[lr];}
29ad4146 73 virtual AliITSUParamList* GetResponseParam(Int_t lr) {return (AliITSUParamList*)fResponseLr[lr];}
451f5018 74 //=================== Hits =========================================
75 virtual void StepManager() {} // See Step Manager for specific geometry.
852af72e 76 //------------ sort hits by chip for Digitisation ----------------
77 virtual void FillChips(Int_t bgrev, Option_t *opt, const char *filename);
78 virtual void FillChips(TTree *treeH, Int_t mask = 0);
79 virtual void ClearChips();
451f5018 80 virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
81 void InitSimulation();
82 //
83 // Trigger
84 // virtual AliTriggerDetector* CreateTriggerDetector() const;
85
86 AliDigitizer* CreateDigitizer(AliDigitizationInput* manager) const;
87 virtual void SDigits2Digits();
88 virtual void Hits2Digits();
89 virtual void Hits2SDigits();
90 virtual void Hits2Digits(Int_t evNumber,Int_t bgrev,Option_t *option, const char *filename);
91 virtual void Hits2SDigits(Int_t evNumber,Int_t bgrev,Option_t *option,const char *filename);
92
93 virtual void ResetSDigits() {if (fSDigits) fSDigits->Clear();}
94 virtual void ResetDigits();
95 virtual void ResetDigits(Int_t branch);
96 virtual void AddSumDigit(AliITSUSDigit &sdig);
97 virtual void AddSimDigit(Int_t branch, AliITSdigit *d);
98 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);
99 TObjArray* GetDigits() const {return fDetDigits;}
100 TClonesArray *DigitsAddress(Int_t id) {return fDetDigits ? (TClonesArray*)fDetDigits->At(id) : 0;}
101 //Fast simulation
102 virtual void Hits2FastRecPoints(Int_t bgrev,Option_t *opr, const char *filename);
103 virtual Int_t Hits2Clusters(TTree *in, TTree *out);
104 virtual void CheckLabels(Int_t lab[3]) const;
105
106 //===================== Raw Data IO ================================
107 // Write digits into raw data format
108 virtual void Digits2Raw();
109 virtual Bool_t Raw2SDigits(AliRawReader*);
110
111 //===================== FO signals ================================
112 // Write FO signals in UserInfo of SDigits/Digits tree
113 void WriteFOSignals();
114
115 void SetRunNumber(Int_t rn=0) {fRunNumber = rn;}
116 Int_t GetNLayers() const {return fNLayers;}
117 Int_t GetRunNumber() const {return fRunNumber;}
118 Bool_t IsSimInitDone() const {return fSimInitDone;}
119
120 protected:
121 void InitArrays();
852af72e 122 const char* GetDigitClassName(Int_t i) {return Form("AliITSUDigit%s",AliITSUGeomTGeo::GetChipTypeName(i));}
123 const char* GetChipTypeName(Int_t i) {return AliITSUGeomTGeo::GetChipTypeName(i);}
451f5018 124
125 protected:
126 //================== Data Members ==================================
127 Bool_t fEuclidOut; // Flag to write geometry in euclid format
128 Int_t fNLayers; // the number of layers
129 Int_t *fIdSens; //[fNLayers] layer identifier
130 TString *fLayerName; //[fNLayers] layer identifier
131 Bool_t fTiming; // flag to turn on/off timers.
02d6eccc 132 AliITSUGeomTGeo* fGeomTGeo; // access to geometry details
133 AliITSUSimuParam* fSimuParam; //!simulation parameters
852af72e 134 TClonesArray** fModA; //! Used by Raw2SDigits (one TC per chip)
451f5018 135 TClonesArray* fpSDigits; //! Branch address to build SD from raw data
136 TClonesArray* fSDigits; //! Branch address to build SD
137 TClonesArray* fDetHits; //! array of full detector hits
852af72e 138 TObjArray* fChipHits; //! chip's hits container in (pointers on the fDetHits)
451f5018 139 TObjArray* fDetDigits; //! AliDetector has TClonesArray fDigits, avoid same name
02d6eccc 140 AliITSUSensMap* fSensMap; //! sensor map for digitization
451f5018 141 //
c92b1537 142 AliITSUSimulation **fSimModelLr; //! simulation objects per layer
143 AliITSsegmentation **fSegModelLr; //! segmentation objects per layar
29ad4146 144 AliITSUParamList **fResponseLr; //! response parameters for each layer
451f5018 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