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