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