]>
Commit | Line | Data |
---|---|---|
451f5018 | 1 | #ifndef ALIITSUSIMULATION_H |
2 | #define ALIITSUSIMULATION_H | |
3 | /************************************************************************** | |
4 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * * | |
6 | * Author: The ALICE Off-line Project. * | |
7 | * Contributors are mentioned in the code where appropriate. * | |
8 | * * | |
9 | * Permission to use, copy, modify and distribute this software and its * | |
10 | * documentation strictly for non-commercial purposes is hereby granted * | |
11 | * without fee, provided that the above copyright notice appears in all * | |
12 | * copies and that both the copyright notice and this permission notice * | |
13 | * appear in the supporting documentation. The authors make no claims * | |
14 | * about the suitability of this software for any purpose. It is * | |
15 | * provided "as is" without express or implied warranty. * | |
16 | **************************************************************************/ | |
17 | ||
18 | #include <TObject.h> | |
19 | #include "AliITSUSensMap.h" | |
20 | #include "AliITSsegmentation.h" | |
c92b1537 | 21 | #include "AliMathBase.h" |
fbcb7a55 | 22 | #include <TArrayS.h> |
451f5018 | 23 | |
24 | class AliITSCalibration; | |
25 | class AliITSUSimuParam; | |
26 | class AliITSUModule; | |
27 | class TRandom; | |
28 | class TSegCollection; | |
29ad4146 | 29 | class AliITSUParamList; |
451f5018 | 30 | |
31 | // This is the base class for ITS detector signal simulations. Data members | |
32 | // include are a pointer to the detectors specific response and segmentation | |
33 | // classes. See the detector specific implementations for the propper code. | |
34 | // The detector-specific implementations are responsible for processing detector type, | |
35 | // which still may have different segmentations! | |
36 | // Note: the detector specific objects (segmentation, calib, etc.) are not owned | |
37 | // by the object but set externaly | |
38 | ||
39 | class AliITSUSimulation : public TObject | |
40 | { | |
41 | public: | |
b2679935 | 42 | enum {kMaxROCycleAccept=126}; // flag for read-out cycle to discard |
43 | // | |
451f5018 | 44 | AliITSUSimulation(); |
45 | AliITSUSimulation(AliITSUSimuParam* sim, AliITSUSensMap* map); | |
46 | virtual ~AliITSUSimulation() {} | |
47 | AliITSUSimulation(const AliITSUSimulation &source); | |
48 | AliITSUSimulation& operator=(const AliITSUSimulation &source); | |
49 | virtual void Init() = 0; | |
50 | // | |
b2679935 | 51 | void UpdateMapSignal(UInt_t col,UInt_t row, Int_t trk,Int_t ht,Double_t signal, Int_t roCycle=0); |
52 | void UpdateMapNoise(UInt_t col,UInt_t row, Double_t noise, Int_t roCycle=0); | |
29ad4146 | 53 | virtual void InitSimulationModule(AliITSUModule* mod, Int_t ev, AliITSsegmentation* seg, AliITSUParamList* resp); |
451f5018 | 54 | // |
55 | // Hits -> SDigits | |
c92b1537 | 56 | virtual void SDigitiseModule() = 0; |
451f5018 | 57 | virtual void FinishSDigitiseModule() = 0; |
58 | virtual Bool_t AddSDigitsToModule( TSeqCollection *pItemArray, Int_t mask ); | |
59 | // | |
60 | // Hits -> Digits | |
c92b1537 | 61 | virtual void DigitiseModule() = 0; |
451f5018 | 62 | virtual void CreateFastRecPoints(AliITSUModule *,Int_t,TRandom *,TClonesArray* /*recp*/) {} |
63 | // | |
c92b1537 | 64 | // readout phase (strobe, timing etc) generation |
0ebc85cf | 65 | virtual void GenerateReadOutCycleOffset() {} |
c92b1537 | 66 | // |
451f5018 | 67 | AliITSCalibration* GetCalibDead() const {return fCalibDead;} |
68 | AliITSCalibration* GetCalibNoisy() const {return fCalibNoisy;} | |
69 | AliITSsegmentation* GetSegmentation() const {return fSeg;} | |
c92b1537 | 70 | AliITSUSimuParam* GetSimuParam() const {return fSimuParam;} |
71 | AliITSUSensMap* GetMap() const {return fSensMap;} | |
72 | AliITSUModule* GetModule() const {return fModule;} | |
29ad4146 | 73 | AliITSUParamList* GetResponseParam() const {return fResponseParam;} |
451f5018 | 74 | Int_t GetEvent() const {return fEvent;} |
75 | Bool_t GetDebug(Int_t level=1) const {return fDebug>=level;} | |
c92b1537 | 76 | |
451f5018 | 77 | // |
78 | void SetCalibDead(AliITSCalibration *calib) {fCalibDead = calib;} | |
79 | void SetCalibNoisy(AliITSCalibration *calib) {fCalibNoisy = calib;} | |
b2679935 | 80 | void SetSegmentation(AliITSsegmentation *seg) {fSeg = seg; if (seg&&fSensMap) fSensMap->SetDimensions(seg->Npz(),seg->Npx(),2*kMaxROCycleAccept);} |
c92b1537 | 81 | void SetSimuParam(AliITSUSimuParam *sp) {fSimuParam = sp;} |
29ad4146 | 82 | virtual void SetResponseParam(AliITSUParamList* resp) {fResponseParam = resp;} |
c92b1537 | 83 | void SetMap(AliITSUSensMap *p) {fSensMap = p;} |
84 | void SetModule(AliITSUModule* mod) {fModule=mod;} | |
451f5018 | 85 | void SetEvent(Int_t evnt) {fEvent=evnt;} |
86 | void SetDebug(Int_t level=5) {fDebug=level;} | |
87 | void SetNoDebug() {fDebug=0;} | |
88 | void ClearMap() {fSensMap->Clear();} | |
89 | // | |
90 | static Int_t GenOrderedSample(UInt_t nmax,UInt_t ngen,TArrayI &vals,TArrayI &ind); | |
91 | // | |
c92b1537 | 92 | static Double_t GausInt1D(Double_t sig,Double_t a,Double_t b); |
93 | static Double_t GausInt2D(Double_t sig0,Double_t a0,Double_t b0, | |
94 | Double_t sig1,Double_t a1,Double_t b1); | |
95 | // | |
451f5018 | 96 | protected: |
97 | AliITSsegmentation *fSeg; //! segmentation | |
98 | AliITSCalibration *fCalibDead; //! dead channels | |
99 | AliITSCalibration *fCalibNoisy; //! noisy channels | |
c92b1537 | 100 | AliITSUSensMap *fSensMap; //! sensor map for hits manipulations |
101 | AliITSUSimuParam *fSimuParam; //! simulation parameters | |
29ad4146 | 102 | AliITSUParamList *fResponseParam; //! response parameterization data |
c92b1537 | 103 | AliITSUModule *fModule; //! module being processed |
451f5018 | 104 | Int_t fEvent; //! event number being processed |
105 | Int_t fDebug; //! debug flag | |
fbcb7a55 | 106 | Bool_t fCyclesID[2*kMaxROCycleAccept]; //! status of RO cycles |
451f5018 | 107 | |
108 | ClassDef(AliITSUSimulation,1) // Simulation base class | |
109 | ||
110 | }; | |
111 | ||
c92b1537 | 112 | //_____________________________________________________________________________ |
113 | inline Double_t AliITSUSimulation::GausInt1D(Double_t sig,Double_t a,Double_t b) | |
114 | { | |
115 | // calculate gaussian integral from a to b (with respecto to mean) | |
116 | const Double_t kRoot2 = 1.414213562; // Sqrt(2). | |
117 | double sp = 1.0/(sig*kRoot2); | |
118 | return 0.5*TMath::Abs( AliMathBase::ErfcFast(sp*a) - AliMathBase::ErfcFast(sp*b) ); | |
119 | } | |
120 | ||
121 | //_____________________________________________________________________________ | |
122 | inline Double_t AliITSUSimulation::GausInt2D(Double_t sig0,Double_t a0,Double_t b0, | |
123 | Double_t sig1,Double_t a1,Double_t b1) | |
124 | { | |
125 | // calculate gaussian 2D integral from x0 to x1 (with respect to mean) | |
126 | const Double_t kRoot2 = 1.414213562; // Sqrt(2). | |
127 | double sp0 = 1.0/(sig0*kRoot2); | |
128 | double sp1 = 1.0/(sig1*kRoot2); | |
129 | return 0.25*TMath::Abs( (AliMathBase::ErfcFast(sp0*a0) - AliMathBase::ErfcFast(sp0*b0)) * | |
130 | (AliMathBase::ErfcFast(sp1*a1) - AliMathBase::ErfcFast(sp1*b1))); | |
131 | } | |
132 | ||
451f5018 | 133 | #endif |