]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/UPGRADE/AliITSUSimuParam.h
optimized mat.budget estimator macro
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUSimuParam.h
CommitLineData
451f5018 1#ifndef ALIITSUSIMUPARAM_H
2#define ALIITSUSIMUPARAM_H
3/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6
7///////////////////////////////////////////////////////////////////
8// //
9// Class to store the parameters used in the simulation ITS //
10// //
11///////////////////////////////////////////////////////////////////
12#include <TRandom.h>
13#include <TObject.h>
c92b1537 14#include <TObjArray.h>
451f5018 15#include <TMath.h>
29ad4146 16#include <TF1.h>
02d6eccc 17#include "AliMathBase.h"
29ad4146 18class AliITSUParamList;
451f5018 19
20class AliITSUSimuParam : public TObject {
21
22 public:
120e5202 23 enum {kNoCouplingPix,kOldCouplingPix,kNewCouplingPix,kMaxCouplingOptPix};
451f5018 24 //
25 AliITSUSimuParam();
344d4ff3 26 AliITSUSimuParam(UInt_t nLayers,UInt_t nPix);
451f5018 27 AliITSUSimuParam(const AliITSUSimuParam& simpar);
28 // assignment operator
29 AliITSUSimuParam& operator=(const AliITSUSimuParam& source);
30 ~AliITSUSimuParam();
344d4ff3 31 //
32 void SetNPix(Int_t np);
33 void SetNLayers(Int_t nl);
34 //
4fa9d550 35 Double_t ApplyPixBaselineAndNoise(UInt_t mod) const;
451f5018 36 Double_t CalcProbNoiseOverThreshold(UInt_t mod) const;
37 //
344d4ff3 38 void SetLrROCycleShift(Double_t v=0, Int_t lr=-1);
39 Double_t GetLrROCycleShift(Int_t lr) const {return fLrROCycleShift ? fLrROCycleShift[lr]:0;}
40 //
4fa9d550 41 void SetPixThreshold(Double_t thresh, Double_t sigma, int mod=-1);
42 void SetPixMinElToAdd(Double_t nel) {fPixMinElToAddDef = nel;}
43 void GetPixThreshold(UInt_t mod, Double_t& thresh, Double_t& sigma) const;
44 Double_t GetPixThreshold(UInt_t mod) const;
45 Double_t GetPixMinElToAdd() const {return fPixMinElToAddDef;}
451f5018 46 //
29ad4146 47 void SetPixFakeRate(Double_t frate) { fPixFakeRateDef = frate;}
48 Double_t GetPixFakeRate() const {return fPixFakeRateDef;}
49 //
50 void SetPixNoiseInAllMod(Bool_t ison) {fPixNoiseInAllMod = ison;}
51 Bool_t GetPixNoiseInAllMod() const {return fPixNoiseInAllMod;}
52 //
4fa9d550 53 void SetPixNoise(Double_t noise, Double_t baseline, Int_t mod=-1);
54 void GetPixNoise(UInt_t mod,Double_t &noise, Double_t &baseline) const;
451f5018 55 //
4fa9d550 56 void SetPixBiasVoltage(Double_t bias=18.182,Int_t mod=-1);
57 Double_t GetPixBiasVoltage(UInt_t mod) const;
344d4ff3 58 //
59 void SetGeVToCharge(Double_t gc=fgkNcompsDefault) {fGeVcharge = gc;}
29ad4146 60 Double_t GetGeVToCharge() const {return fGeVcharge;}
61 Double_t GeVToCharge(Double_t gev) const {return gev/fGeVcharge;}
451f5018 62 //
4fa9d550 63 void SetPixCouplingOption(UInt_t opt);
64 UInt_t GetPixCouplingOption() const {return fPixCouplOpt;}
451f5018 65
4fa9d550 66 void SetPixCouplingParam(Double_t col, Double_t row) {fPixCouplCol = col; fPixCouplRow = row;}
67 void GetPixCouplingParam(Double_t &col, Double_t &row) const {col = fPixCouplCol; row = fPixCouplRow;}
451f5018 68
4fa9d550 69 void SetPixLorentzDrift(Bool_t ison) {fPixLorentzDrift=ison;}
70 Bool_t GetPixLorentzDrift() const {return fPixLorentzDrift;}
71 void SetPixLorentzHoleWeight(Double_t weight) {fPixLorentzHoleWeight=weight;}
72 Double_t GetPixLorentzHoleWeight() const {return fPixLorentzHoleWeight;}
451f5018 73
4fa9d550 74 void SetPixAddNoisyFlag(Bool_t value) {fPixAddNoisyFlag = value;}
75 Bool_t GetPixAddNoisyFlag() const {return fPixAddNoisyFlag;}
76 void SetPixRemoveDeadFlag(Bool_t value) {fPixRemoveDeadFlag = value;}
77 Bool_t GetPixRemoveDeadFlag() const {return fPixRemoveDeadFlag;}
451f5018 78 //
29ad4146 79 Double_t LorentzAngleElectron(Double_t bz) const;
80 Double_t LorentzAngleHole(Double_t bz) const;
451f5018 81 //
344d4ff3 82 Int_t GetNRespFunParams() const {return fRespFunParam.GetEntriesFast();}
83 const AliITSUParamList* GetRespFunParams(Int_t i) const {return (const AliITSUParamList*)fRespFunParam[i];}
84 const AliITSUParamList* FindRespFunParams(Int_t detId) const;
29ad4146 85 void AddRespFunParam(AliITSUParamList* pr);
c92b1537 86 //
29ad4146 87 virtual void Print(Option_t *opt = "") const;
451f5018 88 //
89 static Double_t CalcProbNoiseOverThreshold(double base, double noise, double thresh);
90 static Double_t GenerateNoiseQFunction(double prob, double mean, double sigma);
91 //
92 protected:
93
344d4ff3 94 static const Float_t fgkPixBiasVoltageDefault;//default for fPixBiasVoltage
95 static const Float_t fgkPixThreshDefault; //default for fThresh
96 static const Float_t fgkPixMinElToAddDefault; // default min number of electrons to add to sdigit
97 static const Float_t fgkPixThrSigmaDefault; //default for fSigma
98 static const Float_t fgkPixCouplColDefault; //default for fPixCouplCol
99 static const Float_t fgkPixCouplRowDefault; //default for fPixCouplRow
100 static const Float_t fgkPixEccDiffDefault;//default for fPixEccDiff
101 static const Float_t fgkPixLorentzHoleWeightDefault;//default for fPixLorentzHoleWeight
102 static const UInt_t fgkPixCouplingOptDefault; // type of pixel Coupling (old or new)
103 static const Float_t fgkDOverVDefault; // default distance over voltage
104 static const Float_t fgkGeVtoChargeDefault; // default energy to ionize (free an electron) in GeV
105 static const Float_t fgkTDefault; // default temperature
106 static const Float_t fgkPixFakeRateDefault; // default monopix fake rate
852af72e 107 static const Bool_t fgkPixNoiseInAllMod; // default switch to add digital noise to every chip
29ad4146 108
344d4ff3 109 static const Float_t fgkNsigmasDefault; //default for fNsigmas
110 static const Int_t fgkNcompsDefault; //default for fNcomps
451f5018 111
112 private:
113 //
344d4ff3 114 Float_t fGeVcharge; // Energy to ionize (free an electron) in GeV
115 Float_t fDOverV; // The parameter d/v where d is the disance over which the the potential v is applied d/v [cm/volts]
116 Float_t fT; // The temperature of the Si in Degree K.
451f5018 117 //
344d4ff3 118 UInt_t fNLayers; // number of layers
119 UInt_t fNPix; // number of Pix type detectors
120 UInt_t fPixCouplOpt; // Pix Coupling Option
121 Float_t fPixCouplCol; // Pix Coupling parameter along the cols
122 Float_t fPixCouplRow; // Pix Coupling parameter along the rows
4fa9d550 123 Bool_t fPixLorentzDrift; // Flag to decide whether to simulate the Lorentz Drift or not in Pix
344d4ff3 124 Float_t fPixLorentzHoleWeight;// Lorentz Angle is computed for Pix as average of Hole and Electron
451f5018 125 // this parameter gives the relative weights between the two
4fa9d550 126 Bool_t fPixAddNoisyFlag; // Flag saying whether noisy pixels should be added to digits
127 Bool_t fPixRemoveDeadFlag; // Flag saying whether dead pixels should be removed from digits
451f5018 128 //
344d4ff3 129 Float_t fPixThreshDef; // Pix Threshold value
130 Float_t fPixThrSigmaDef; // Pix Threshold fluctuation
131 Float_t fPixBiasVoltageDef; // Bias Voltage for the Pix
132 Float_t fPixNoiseDef; // Pix electronic noise: sigma
133 Float_t fPixBaselineDef; // Pix electronic noise: baseline
134 Float_t fPixMinElToAddDef; // min number of electrons to add
135 Float_t fPixFakeRateDef; // Fake rate for the monopix
852af72e 136 Bool_t fPixNoiseInAllMod; // Add digital noise to every chip
451f5018 137 //
344d4ff3 138 Float_t* fLrROCycleShift; //[fNLayers] optional RO cycle shift for each layer (in fraction of RO cycle length if abs<1)
852af72e 139 // if abs>1, then each chip will have random phase
344d4ff3 140 Float_t* fPixThresh; //[fNPix] Pix Threshold value
141 Float_t* fPixThrSigma; //[fNPix] Pix Threshold fluctuation
142 Float_t* fPixBiasVoltage; //[fNPix] Bias Voltage for the Pix
143 Float_t* fPixSigma; //[fNPix] Pix threshold fluctuations spread
144 Float_t* fPixNoise; //[fNPix] Pix electronic noise: sigma
145 Float_t* fPixBaseline; //[fNPix] Pix electronic noise: baseline
451f5018 146 //
29ad4146 147 TObjArray fRespFunParam; // set of parameterizations for response function (AliITSUParamList)
451f5018 148
344d4ff3 149 ClassDef(AliITSUSimuParam,2); // ITSU simulataion params
451f5018 150};
151
451f5018 152
153#endif