]>
Commit | Line | Data |
---|---|---|
a84c4b15 | 1 | #ifndef ALIITSSIMULATIONPIXUPG_H |
2 | #define ALIITSSIMULATIONPIXUPG_H | |
3 | ||
4 | /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | //////////////////////////////////////////////////////////// | |
8 | // Simulation class for upgrade pixels // | |
9 | //////////////////////////////////////////////////////////// | |
10 | ||
11 | #include "TObjArray.h" | |
12 | #include "AliITSsimulation.h" | |
13 | #include "AliITSsegmentationPixUpg.h" | |
14 | #include "AliITSDetTypeSimUpg.h" | |
15 | ||
16 | class TH1F; | |
17 | class AliITSmodule; | |
18 | ||
19 | //------------------------------------------------------------------- | |
20 | ||
21 | class AliITSsimulationPixUpg : public AliITSsimulation { | |
22 | public: | |
23 | AliITSsimulationPixUpg(); | |
24 | AliITSsimulationPixUpg(AliITSDetTypeSimUpg *dettyp); | |
25 | virtual ~AliITSsimulationPixUpg(); | |
26 | AliITSsimulationPixUpg(const AliITSsimulationPixUpg &source); | |
27 | AliITSsimulationPixUpg& operator=(const AliITSsimulationPixUpg &s); | |
28 | void Init(); | |
29 | // | |
30 | // General User calling routines | |
31 | // Initilize simulation for a specific event and module | |
32 | void InitSimulationModule(Int_t module, Int_t event); | |
33 | // Finish and write S Digitization | |
34 | void FinishSDigitiseModule(); | |
35 | // From hits to Digits, without creating SDigits | |
36 | void DigitiseModule(AliITSmodule *mod,Int_t,Int_t); | |
37 | // | |
38 | // More or less Internal Routines | |
39 | // Create S Digits from specific module | |
40 | void SDigitiseModule(AliITSmodule *mod, Int_t mask, Int_t event); | |
41 | // Write S Digits to the tree of SDigits. | |
42 | void WriteSDigits(); | |
43 | // fill pList from hits, charge sharing, diffusion, coupling | |
44 | void HitToSDigit(AliITSmodule *mod); | |
45 | // fill pList from hits, charge sharing, diffusion, coupling (faster method optimized by Bjorne) | |
46 | void HitToSDigitFast(AliITSmodule *mod); | |
47 | // Adds noisy pixels to pList | |
48 | void AddNoisyPixels(); | |
49 | // Removes dead pixels from pList | |
50 | void RemoveDeadPixels(); | |
51 | // Take pList of signals and apply noise... create Digits | |
52 | void FrompListToDigits(); | |
53 | // This set the Lorentz drift of Electrons and Holes: by deafult equal weights to Electrons and Holes | |
54 | void SetLorentzDrift(Bool_t b=kFALSE) | |
55 | {fLorentz=b; if(fLorentz) SetTanLorAngle();}; | |
56 | // This function set the relative contribution between holes and electrons: use 0<=WeightHole<=1 | |
57 | Bool_t SetTanLorAngle(Double_t WeightHole=1.0); | |
58 | // Getter for the Lorentz angle | |
59 | Double_t GetTanLorAngle() const {return fTanLorAng;}; | |
60 | // | |
61 | void CreateHistograms(); | |
62 | void FillHistograms(Int_t ix,Int_t iz,Double_t v=1.0); | |
63 | void ResetHistograms(); | |
64 | TH1F* GetHistogram(Int_t i){return (TH1F*)(fHistos->At(i));}// get histogram | |
65 | TObjArray* GetHistArray() {return fHistos;}// get hist array | |
66 | TString& GetHistName(){return fHistName;} | |
67 | void SetHistName(TString &n){fHistName = n;} | |
68 | // | |
69 | // For backwards compatibility | |
70 | void SDigitsToDigits(){ FinishSDigitiseModule();}; | |
71 | void HitToDigit(AliITSmodule *mod){ | |
72 | // Standard interface to DigitiseModule Inputs: AliITSmodule *mod Pointer to this module | |
73 | DigitiseModule(mod,GetModuleNumber(),0);}; | |
74 | ||
75 | // This sets fStrobe flag and allows generating the strobe and applying it to select hits | |
76 | void SetStrobeGeneration(Bool_t b=kFALSE) {fStrobe=b;}; | |
77 | void GenerateStrobePhase(); | |
78 | ||
79 | private: | |
80 | void SpreadCharge(Double_t x0,Double_t z0,Int_t ix0,Int_t iz0, | |
81 | Double_t el,Double_t sig,Double_t ld,Int_t t,Int_t hi); | |
82 | void SpreadChargeAsym(Double_t x0,Double_t z0,Int_t ix0,Int_t iz0, | |
83 | Double_t el,Double_t sigx,Double_t sigz,Double_t ld,Int_t t,Int_t hi); | |
84 | void UpdateMapSignal(Int_t ix,Int_t iz,Int_t trk,Int_t ht,Double_t signal){ | |
85 | // This function adds a signal to the pList from the pList class | |
86 | // Inputs: iz column number ix row number trk track number ht hit number signal signal strength | |
87 | GetMap()->AddSignal(iz,ix,trk,ht,GetModuleNumber(),signal);}; | |
88 | void UpdateMapNoise(Int_t ix,Int_t iz,Float_t noise){ | |
89 | // This function adds noise to data in the MapA2 as well as the pList | |
90 | // Inputs: iz column number ix row number noise electronic noise generated by FrompListToDigits | |
91 | GetMap()->AddNoise(iz,ix,GetModuleNumber(),noise);} | |
92 | // Get a pointer to the segmentation object | |
93 | virtual AliITSsegmentation* GetSegmentationModel(Int_t /*dt*/){return fDetType->GetSegmentationModel(AliITSDetTypeSimUpg::kDetPixUpg);} | |
94 | // set pointer to segmentation objec | |
95 | virtual void SetSegmentationModel(Int_t /*dt*/, AliITSsegmentation *seg){fDetType->SetSegmentationModel(AliITSDetTypeSimUpg::kDetPixUpg,seg);} | |
96 | // Bari-Salerno Coupling parameters | |
97 | // "New" coupling routine Tiziano Virgili | |
98 | void SetCoupling(Int_t col,Int_t row,Int_t ntrack,Int_t idhit); | |
99 | // "Old" coupling routine Rocco Caliandro | |
100 | void SetCouplingOld(Int_t col, Int_t row,Int_t ntrack,Int_t idhit); | |
101 | // Getters for data kept in fSegmentation and fResponse. | |
102 | // Returns the Threshold in electrons | |
103 | Double_t GetThreshold(){ | |
104 | Double_t th,sig;AliITSSimuParam* simpar = fDetType->GetSimuParam(); | |
105 | simpar->SPDThresholds(GetModuleNumber(),th,sig);return th;}; | |
106 | // Returns the couplings Columb and Row. | |
107 | void GetCouplings(Double_t &cc,Double_t &cr){ | |
108 | AliITSSimuParam* simpar = fDetType->GetSimuParam(); | |
109 | simpar->GetSPDCouplingParam(cc,cr);}; | |
110 | // Returns the number of pixels in x | |
111 | Int_t GetNPixelsX(){return GetSegmentationModel(-1)->Npx();}; | |
112 | // Returns the number of pixels in z | |
113 | Int_t GetNPixelsZ(){return GetSegmentationModel(-1)->Npz();}; | |
114 | ||
115 | TObjArray *fHistos; //! just in case for histogramming | |
116 | TString fHistName; //! Histogram name | |
117 | Int_t fCoupling; // Sets the coupling to be used. | |
118 | // ==1 use SetCoupling, ==2 use SetCouplingOld | |
119 | Bool_t fLorentz; // kTRUE if Lorentz drift has been allowed | |
120 | Double_t fTanLorAng; //! Tangent of the Lorentz Angle (weighted average for hole and electrons) | |
121 | Bool_t fStrobe; // kTRUE if readout strobe with proper phase applied to select hits | |
122 | Int_t fStrobeLenght; // Strobe signal lenght in units of 25 ns | |
123 | Double_t fStrobePhase; // The phase of the strobe signal with respect to the trigger | |
124 | ClassDef(AliITSsimulationPixUpg,1) // Simulation of pixel clusters | |
125 | }; | |
126 | #endif |