]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSsimulationSPD.h
- AliITSQASPDDataMakerRec.cxx
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSPD.h
CommitLineData
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
85f5e9c2 7/* $Id$ */
8e2f60b2 8
590d15ee 9////////////////////////////////////////////////////////////
10// Simulation class for SPD //
11////////////////////////////////////////////////////////////
12
5bfe44ce 13#include "TObjArray.h"
14#include "AliITSsimulation.h"
c7a4dac0 15#include "AliITSsegmentationSPD.h"
b0f5e3fc 16
590d15ee 17class TH1F;
b0f5e3fc 18class AliITSmodule;
2ae37d58 19//class AliITSresponseSPD;
b0f5e3fc 20
21//-------------------------------------------------------------------
22
23class AliITSsimulationSPD : public AliITSsimulation {
5bfe44ce 24 public:
25 AliITSsimulationSPD();
26 // AliITSsimulationSPD(AliITSsegmentation *seg,AliITSCalibration *res);
8ba39da9 27 AliITSsimulationSPD(AliITSDetTypeSim *dettyp);
5bfe44ce 28 virtual ~AliITSsimulationSPD();
29 // copy constructor
30 AliITSsimulationSPD(const AliITSsimulationSPD &source);
31 // ass. operator
32 AliITSsimulationSPD& operator=(const AliITSsimulationSPD &s);
85f5e9c2 33 // virtual AliITSsimulation& operator=(const AliITSsimulation &source);
c7a4dac0 34 // Initilizes the variables
aacedc3e 35 void Init();
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);
a4005be7 56 // Take pList of signals and apply noise... create Digits
590d15ee 57 void FrompListToDigits();
a4005be7 58 // This set the Lorentz drift of Electrons and Holes: by deafult equal weights to Electrons and Holes
59 void SetLorentzDrift(Bool_t b=kFALSE)
60 {fLorentz=b; if(fLorentz) SetTanLorAngle();};
61 // This function set the relative contribution between holes and electrons: use 0<=WeightHole<=1
62 Bool_t SetTanLorAngle(Double_t WeightHole=0.5);
63 // Getter for the Lorentz angle
64 Double_t GetTanLorAngle(){return fTanLorAng;};
5bfe44ce 65 //
c7a4dac0 66 void CreateHistograms();
5bfe44ce 67 void FillHistograms(Int_t ix,Int_t iz,Double_t v=1.0);
c7a4dac0 68 void ResetHistograms();
5bfe44ce 69 TH1F* GetHistogram(Int_t i){return (TH1F*)(fHis->At(i));}// get histogram
70 TObjArray* GetHistArray() {return fHis;}// get hist array
71 TString& GetHistName(){return fSPDname;}
72 void SetHistName(TString &n){fSPDname = n;}
73 //
74 // For backwards compatibility
75 void SDigitsToDigits(){ FinishSDigitiseModule();};
76 void HitToDigit(AliITSmodule *mod){
590d15ee 77 // Standard interface to DigitiseModule Inputs: AliITSmodule *mod Pointer to this module
5bfe44ce 78 DigitiseModule(mod,GetModuleNumber(),0);};
b0f5e3fc 79
c7a4dac0 80 private:
5bfe44ce 81 void SpreadCharge(Double_t x0,Double_t z0,Int_t ix0,Int_t iz0,
a4005be7 82 Double_t el,Double_t sig,Double_t ld,Int_t t,Int_t hi);
5bfe44ce 83 void SpreadChargeAsym(Double_t x0,Double_t z0,Int_t ix0,Int_t iz0,
a4005be7 84 Double_t el,Double_t sigx,Double_t sigz,Double_t ld,Int_t t,Int_t hi);
5bfe44ce 85 void UpdateMapSignal(Int_t ix,Int_t iz,Int_t trk,Int_t ht,Double_t signal){
86 // This function adds a signal to the pList from the pList class
590d15ee 87 // Inputs: iz column number ix row number trk track number ht hit number signal signal strength
5bfe44ce 88 GetMap()->AddSignal(iz,ix,trk,ht,GetModuleNumber(),signal);};
89 void UpdateMapNoise(Int_t ix,Int_t iz,Float_t noise){
90 // This function adds noise to data in the MapA2 as well as the pList
590d15ee 91 // Inputs: iz column number ix row number noise electronic noise generated by FrompListToDigits
5bfe44ce 92 GetMap()->AddNoise(iz,ix,GetModuleNumber(),noise);}
93 // Get a pointer to the segmentation object
94 virtual AliITSsegmentation* GetSegmentationModel(Int_t /*dt*/){return fDetType->GetSegmentationModel(0);}
95 // set pointer to segmentation objec
96 virtual void SetSegmentationModel(Int_t /*dt*/, AliITSsegmentation *seg){fDetType->SetSegmentationModel(0,seg);}
97 // Bari-Salerno Coupling parameters
98 // "New" coupling routine Tiziano Virgili
590d15ee 99 void SetCoupling(Int_t col,Int_t row,Int_t ntrack,Int_t idhit);
5bfe44ce 100 // "Old" coupling routine Rocco Caliandro
590d15ee 101 void SetCouplingOld(Int_t col, Int_t row,Int_t ntrack,Int_t idhit);
c7a4dac0 102 // Getters for data kept in fSegmentation and fResponse.
103 // Returns the Threshold in electrons
5bfe44ce 104 Double_t GetThreshold(){
bb292d31 105 Double_t th,sig;AliITSSimuParam* simpar = fDetType->GetSimuParam();
106 simpar->SPDThresholds(GetModuleNumber(),th,sig);return th;};
c7a4dac0 107 // Returns the couplings Columb and Row.
aacedc3e 108 void GetCouplings(Double_t &cc,Double_t &cr){
bb292d31 109 AliITSSimuParam* simpar = fDetType->GetSimuParam();
110 simpar->GetSPDCouplingParam(cc,cr);};
c7a4dac0 111 // Returns the number of pixels in x
5bfe44ce 112 Int_t GetNPixelsX(){return GetSegmentationModel(0)->Npx();};
c7a4dac0 113 // Returns the number of pixels in z
5bfe44ce 114 Int_t GetNPixelsZ(){return GetSegmentationModel(0)->Npz();};
b0f5e3fc 115
5bfe44ce 116 TObjArray *fHis; //! just in case for histogramming
117 TString fSPDname; //! Histogram name
118 Int_t fCoupling; // Sets the coupling to be used.
119 // ==1 use SetCoupling, ==2 use SetCouplingOld
a4005be7 120 Bool_t fLorentz; // kTRUE if Lorentz drift has been allowed
121 Double_t fTanLorAng; //! Tangent of the Lorentz Angle (weighted average for hole and electrons)
122 ClassDef(AliITSsimulationSPD,3) // Simulation of SPD clusters
b0f5e3fc 123};
5bfe44ce 124#endif
a4005be7 125