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