fixed the tainted variables
[u/mrichter/AliRoot.git] / ITS / AliITS.h
CommitLineData
3bd79107 1#ifndef ALIITS_H
2#define ALIITS_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
58005f18 8////////////////////////////////////////////////////////////////////////
3bd79107 9// Manager class for set: ITS //
58005f18 10////////////////////////////////////////////////////////////////////////
fe4da5cc 11
7e932df0 12
143d1056 13#include <TObjArray.h> // used in inline function GetModule.
fe4da5cc 14#include "AliDetector.h"
e628c711 15#include "AliITSTrigger.h"
7e932df0 16#include "AliITSDetTypeSim.h"
7d62fb64 17
de82972f 18
d5da1ecf 19class TString;
20class TTree;
7d62fb64 21class AliITSpListItem;
3bd79107 22class AliITSsimulation;
de82972f 23class AliITSsegmentation;
0b5bf101 24
fcf95fc7 25class AliITSCalibration;
de82972f 26class AliITShit;
27class AliITSgeom;
28class AliITSdigit;
de82972f 29class AliITSmodule;
aacedc3e 30class AliDigitizer;
31class AliRunDigitizer;
27a043b1 32
de82972f 33
3bd79107 34class AliITS : public AliDetector {
58005f18 35
2aea926d 36 public:
37 //================= Standard Classes ===============================
38 AliITS(); // Default creator.
012f0f4c 39 AliITS(const Char_t *title); // standard Creator
40 AliITS(const char *name, const char *title); // extended standard Creator
2aea926d 41 virtual ~AliITS(); // destructor
2aea926d 42 virtual Int_t IsVersion() const {return 1;}
2aea926d 43
44 //===================== Simulation Geometry ========================
e8189707 45 // get geometry version - detailed (major) or coarse (minor)
93f82b23 46 virtual Int_t GetMajorVersion() const {return -1;}
47 virtual Int_t GetMinorVersion() const {return -1;}
7d62fb64 48 virtual void GetGeometryVersion(Int_t &a,Int_t &b) const
2aea926d 49 {a = GetMajorVersion();b=GetMinorVersion();return;}
41b19549 50 virtual void SetEUCLID(Bool_t euclid=kTRUE) {fEuclidOut = euclid;}
a8e8915c 51 virtual Bool_t GetEUCLID()const {return fEuclidOut;}
2aea926d 52 //-------------------- Geometry Transformations --------------------
7d62fb64 53
7e932df0 54 // ITS geometry functions From Simulation
7d62fb64 55 AliITSgeom* GetITSgeom() const {return fDetTypeSim->GetITSgeom();}
56 void SetITSgeom(AliITSgeom *geom) {fDetTypeSim->SetITSgeom(geom);}
7e932df0 57 // return pointer to the array of modules
7d62fb64 58 TObjArray *GetModules(){return fITSmodules;}
3bd79107 59
7d62fb64 60 AliITSmodule *GetModule(Int_t index){
61 return (AliITSmodule*)(fITSmodules->At(index));}
c8af5b8f 62 virtual void SetSimuParam(AliITSSimuParam *sp){
63 fSimuParam=sp;
64 fDetTypeSim->SetSimuParam(sp);
65 }
66 AliITSSimuParam* GetSimuParam() const {return fSimuParam;}
7d62fb64 67
68 virtual void SetDetTypeSim(AliITSDetTypeSim* dts) {fDetTypeSim=dts;}
69 AliITSDetTypeSim* GetDetTypeSim() const {return fDetTypeSim;}
88cb7938 70 //================ Necessary general Classes =======================
2aea926d 71 virtual void Init();
88cb7938 72 virtual AliLoader* MakeLoader(const char* topfoldername);
2aea926d 73 virtual void SetDefaults();
74 virtual void SetDefaultSimulation();
88cb7938 75 virtual void MakeBranch(Option_t *opt=" ");
7d62fb64 76 virtual void MakeBranchS(const char* fl);
77 virtual void MakeBranchD(const char* file);
78 virtual void MakeBranchInTreeD(TTree* treeD, const char* file=0);
2aea926d 79 virtual void SetTreeAddress();
7d62fb64 80 //---------- Configuration Methods (per detector type) -------------
7d8046e8 81 // Determines which ITS subdetectors will be processed. Effects
82 // digitization, and Reconstruction only.
83 void SetDetectors(Option_t *opt="All"){fOpt = opt;}
84 // Returns the list of ITS subdetectors that will be processed.
85 Option_t* GetDetectors(){return fOpt;}
7d62fb64 86
fcf95fc7 87 // Set calibration
88 virtual void SetCalibrationModel(Int_t dettype, AliITSCalibration *cal){
89 fDetTypeSim->SetCalibrationModel(dettype,cal);}
7e932df0 90 // Set segmentation for Simulation
7e932df0 91 virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg){
7d62fb64 92 fDetTypeSim->SetSegmentationModel(id,seg);}
7e932df0 93 // Set simulation
94 virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim){
7d62fb64 95 fDetTypeSim->SetSimulationModel(id,sim);}
7e932df0 96 // Set simulation
97 virtual AliITSsimulation* GetSimulationModel(Int_t id){
7d62fb64 98 return fDetTypeSim->GetSimulationModel(id);}
2aea926d 99 //=================== Hits =========================================
100 virtual void StepManager() {} // See Step Manager for specific geometry.
2aea926d 101 //------------ sort hits by module for Digitisation ----------------
023ae34b 102 virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,
103 Option_t *opt, const char *filename);
6f5308d9 104 virtual Bool_t InitModules(Int_t size,Int_t &nmodules);
7e932df0 105 virtual void FillModules(TTree *treeH, Int_t mask = 0);
7d62fb64 106 virtual void ClearModules(){if(fITSmodules) fITSmodules->Delete();}
107 virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
fcf95fc7 108 // Trigger
ad7f2bfa 109 virtual AliTriggerDetector* CreateTriggerDetector() const;
2aea926d 110
c92eb8ad 111 AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
ef7ff1f9 112 virtual void UpdateInternalGeometry();
7d62fb64 113 virtual void SDigitsToDigits(Option_t *opt="All");
114 virtual void SDigits2Digits(){SDigitsToDigits("All");}
115 virtual void Hits2Digits();
116 virtual void Hits2SDigits();
117 virtual void Hits2PreDigits();
118 virtual void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size,
119 Option_t *option,Option_t *opt,
120 const char *filename);
121 virtual void HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size,
122 Option_t *option,Option_t *opt,
123 const char *filename);
2aea926d 124 void HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size,
aacedc3e 125 Option_t *add, Option_t *det, const char *filename)
e68a8906 126 {HitsToPreDigits(evNumber,bgrev,size,add,det,filename);}
7d62fb64 127
128 virtual void ResetDigits();
129 virtual void ResetDigits(Int_t branch);
130 virtual void AddSumDigit(AliITSpListItem &sdig);
023ae34b 131 virtual void AddSimDigit(Int_t branch, AliITSdigit *d);
7d62fb64 132 virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
83ec5e27 133 Int_t* tracks,Int_t *hits,Float_t* trkcharges,
134 Int_t sigexpanded=-1000);
7d62fb64 135 TObjArray* GetDigits() const {return fDetTypeSim->GetDigits();}
136 Int_t* GetNDigitArray() const {return fDetTypeSim->GetNDigitArray();}
023ae34b 137 TClonesArray *DigitsAddress(Int_t id) {
138 return fDetTypeSim->DigitsAddress(id);}
7d62fb64 139 //Fast simulation
140 virtual void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size,
141 Option_t *add, Option_t *det, const char *filename);
142 virtual Int_t Hits2Clusters(TTree *in, TTree *out);
7d62fb64 143 virtual void CheckLabels(Int_t lab[3]) const;
7e932df0 144
145 //===================== Raw Data IO ================================
146 // Write digits into raw data format
0b5bf101 147 virtual void Digits2Raw();
148 virtual Bool_t Raw2SDigits(AliRawReader*);
149
7e932df0 150
2aea926d 151 protected:
7d62fb64 152 static const Int_t fgkNTYPES=3; //number of detector types
2aea926d 153 //================== Data Members ==================================
7d62fb64 154 AliITSDetTypeSim *fDetTypeSim; //detector type for simulation
e0fc0305 155 Bool_t fEuclidOut; // Flag to write geometry in euclid format
7d8046e8 156 Option_t *fOpt; //! Detector option ="All" unless changed.
e0fc0305 157 Int_t fIdN; // the number of layers
2aea926d 158 Int_t *fIdSens; //[fIdN] layer identifier
159 TString *fIdName; //[fIdN] layer identifier
7d62fb64 160 TObjArray *fITSmodules; //! Pointer to ITS modules
012f0f4c 161 Bool_t fTiming; // flag to turn on/off timers.
c8af5b8f 162 AliITSSimuParam* fSimuParam; //simulation parameters
afbc83e9 163 TClonesArray** fModA; //! Used by Raw2SDigits (one TC per module)
164 TClonesArray* fpSDigits; //! Branch address to build SD from raw data
e939a978 165
166 private:
167 AliITS(const AliITS &source); // copy constructor. Not to be used!
168 AliITS& operator=(const AliITS &source); // = operator. Not to be used!
afbc83e9 169 ClassDef(AliITS,9) // Base class for ITS
7d62fb64 170
fe4da5cc 171};
3bd79107 172
fe4da5cc 173#endif