]>
Commit | Line | Data |
---|---|---|
b0f5e3fc | 1 | #ifndef ALIITSSIMULATIONSPD_H |
2 | #define ALIITSSIMULATIONSPD_H | |
5bfe44ce | 3 | |
8e2f60b2 | 4 | /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * |
c7a4dac0 | 5 | * See cxx source for full Copyright notice */ |
b0f5e3fc | 6 | |
8e2f60b2 | 7 | /* $Id$ */ |
8 | ||
590d15ee | 9 | //////////////////////////////////////////////////////////// |
10 | // Simulation class for SPD // | |
11 | //////////////////////////////////////////////////////////// | |
12 | ||
5bfe44ce | 13 | #include "TObjArray.h" |
14 | #include "AliITSsimulation.h" | |
fcf95fc7 | 15 | #include "AliITSCalibrationSPD.h" |
c7a4dac0 | 16 | #include "AliITSsegmentationSPD.h" |
b0f5e3fc | 17 | |
590d15ee | 18 | class TH1F; |
b0f5e3fc | 19 | class AliITSmodule; |
590d15ee | 20 | class AliITSresponseSPD; |
b0f5e3fc | 21 | |
22 | //------------------------------------------------------------------- | |
23 | ||
24 | class AliITSsimulationSPD : public AliITSsimulation { | |
5bfe44ce | 25 | public: |
26 | AliITSsimulationSPD(); | |
27 | // AliITSsimulationSPD(AliITSsegmentation *seg,AliITSCalibration *res); | |
8ba39da9 | 28 | AliITSsimulationSPD(AliITSDetTypeSim *dettyp); |
5bfe44ce | 29 | virtual ~AliITSsimulationSPD(); |
30 | // copy constructor | |
31 | AliITSsimulationSPD(const AliITSsimulationSPD &source); | |
32 | // ass. operator | |
33 | AliITSsimulationSPD& operator=(const AliITSsimulationSPD &s); | |
5402d9ca | 34 | virtual AliITSsimulation& operator=(const AliITSsimulation &source); |
c7a4dac0 | 35 | // Initilizes the variables |
aacedc3e | 36 | void Init(); |
b0f5e3fc | 37 | |
5bfe44ce | 38 | // General User calling routines |
39 | // Initilize simulation for a specific event and module | |
40 | void InitSimulationModule(Int_t module, Int_t event); | |
41 | // Finish and write S Digitization | |
3a97c582 | 42 | void FinishSDigitiseModule(); |
5bfe44ce | 43 | // From hits to Digits, without creating SDigits |
44 | void DigitiseModule(AliITSmodule *mod,Int_t,Int_t); | |
45 | ||
46 | // More or less Internal Routines | |
47 | // Create S Digits from specific module | |
48 | void SDigitiseModule(AliITSmodule *mod, Int_t mask, Int_t event); | |
49 | // Write S Digits to the tree of SDigits. | |
50 | void WriteSDigits(); | |
51 | // fill pList from hits, charge sharing, diffusion, coupling | |
52 | void HitToSDigit(AliITSmodule *mod); | |
53 | // fill pList from hits, charge sharing, diffusion, coupling (faster method optimized by Bjorne) | |
54 | void HitToSDigitFast(AliITSmodule *mod); | |
55 | // Removes dead pixels from pList | |
56 | void RemoveDeadPixels(AliITSmodule *mod); | |
57 | // Take pList of signals and apply noise... create Digis | |
590d15ee | 58 | void FrompListToDigits(); |
5bfe44ce | 59 | // |
c7a4dac0 | 60 | void CreateHistograms(); |
5bfe44ce | 61 | void FillHistograms(Int_t ix,Int_t iz,Double_t v=1.0); |
c7a4dac0 | 62 | void ResetHistograms(); |
5bfe44ce | 63 | TH1F* GetHistogram(Int_t i){return (TH1F*)(fHis->At(i));}// get histogram |
64 | TObjArray* GetHistArray() {return fHis;}// get hist array | |
65 | TString& GetHistName(){return fSPDname;} | |
66 | void SetHistName(TString &n){fSPDname = n;} | |
67 | // | |
68 | // For backwards compatibility | |
69 | void SDigitsToDigits(){ FinishSDigitiseModule();}; | |
70 | void HitToDigit(AliITSmodule *mod){ | |
590d15ee | 71 | // Standard interface to DigitiseModule Inputs: AliITSmodule *mod Pointer to this module |
5bfe44ce | 72 | DigitiseModule(mod,GetModuleNumber(),0);}; |
b0f5e3fc | 73 | |
c7a4dac0 | 74 | private: |
5bfe44ce | 75 | void SpreadCharge(Double_t x0,Double_t z0,Int_t ix0,Int_t iz0, |
76 | Double_t el,Double_t sig,Int_t t,Int_t hi); | |
77 | void SpreadChargeAsym(Double_t x0,Double_t z0,Int_t ix0,Int_t iz0, | |
78 | Double_t el,Double_t sigx,Double_t sigz,Int_t t,Int_t hi); | |
79 | void UpdateMapSignal(Int_t ix,Int_t iz,Int_t trk,Int_t ht,Double_t signal){ | |
80 | // This function adds a signal to the pList from the pList class | |
590d15ee | 81 | // Inputs: iz column number ix row number trk track number ht hit number signal signal strength |
5bfe44ce | 82 | GetMap()->AddSignal(iz,ix,trk,ht,GetModuleNumber(),signal);}; |
83 | void UpdateMapNoise(Int_t ix,Int_t iz,Float_t noise){ | |
84 | // This function adds noise to data in the MapA2 as well as the pList | |
590d15ee | 85 | // Inputs: iz column number ix row number noise electronic noise generated by FrompListToDigits |
5bfe44ce | 86 | GetMap()->AddNoise(iz,ix,GetModuleNumber(),noise);} |
87 | // Get a pointer to the segmentation object | |
88 | virtual AliITSsegmentation* GetSegmentationModel(Int_t /*dt*/){return fDetType->GetSegmentationModel(0);} | |
89 | // set pointer to segmentation objec | |
90 | virtual void SetSegmentationModel(Int_t /*dt*/, AliITSsegmentation *seg){fDetType->SetSegmentationModel(0,seg);} | |
91 | // Bari-Salerno Coupling parameters | |
92 | // "New" coupling routine Tiziano Virgili | |
590d15ee | 93 | void SetCoupling(Int_t col,Int_t row,Int_t ntrack,Int_t idhit); |
5bfe44ce | 94 | // "Old" coupling routine Rocco Caliandro |
590d15ee | 95 | void SetCouplingOld(Int_t col, Int_t row,Int_t ntrack,Int_t idhit); |
c7a4dac0 | 96 | // Getters for data kept in fSegmentation and fResponse. |
97 | // Returns the Threshold in electrons | |
5bfe44ce | 98 | Double_t GetThreshold(){ |
99 | Double_t th,sig;AliITSCalibrationSPD* res=(AliITSCalibrationSPD*)GetCalibrationModel(GetModuleNumber()); | |
100 | res->Thresholds(th,sig);return th;}; | |
c7a4dac0 | 101 | // Returns the couplings Columb and Row. |
aacedc3e | 102 | void GetCouplings(Double_t &cc,Double_t &cr){ |
fcf95fc7 | 103 | AliITSCalibrationSPD* res = (AliITSCalibrationSPD*)GetCalibrationModel(GetModuleNumber()); |
5bfe44ce | 104 | res->GetCouplingParam(cc,cr);}; |
c7a4dac0 | 105 | // Returns the number of pixels in x |
5bfe44ce | 106 | Int_t GetNPixelsX(){return GetSegmentationModel(0)->Npx();}; |
c7a4dac0 | 107 | // Returns the number of pixels in z |
5bfe44ce | 108 | Int_t GetNPixelsZ(){return GetSegmentationModel(0)->Npz();}; |
b0f5e3fc | 109 | |
5bfe44ce | 110 | TObjArray *fHis; //! just in case for histogramming |
111 | TString fSPDname; //! Histogram name | |
112 | Int_t fCoupling; // Sets the coupling to be used. | |
113 | // ==1 use SetCoupling, ==2 use SetCouplingOld | |
5bfe44ce | 114 | ClassDef(AliITSsimulationSPD,2) // Simulation of SPD clusters |
b0f5e3fc | 115 | }; |
5bfe44ce | 116 | #endif |