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