]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSsimulationSDD.h
First prototype of a class for bad channel treatment in the tracker (F. Prino)
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSDD.h
CommitLineData
b0f5e3fc 1#ifndef ALIITSSIMULATIONSDD_H
2#define ALIITSSIMULATIONSDD_H
8a33ae9e 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
88cb7938 5
fcf95fc7 6
8a33ae9e 7/* $Id$ */
1ca7869b 8
8ba39da9 9////////////////////////////////////////////////////////////
10// Simulation class for SDD //
11////////////////////////////////////////////////////////////
12
b0f5e3fc 13#include <TNtuple.h>
b0f5e3fc 14#include "AliITSsimulation.h"
b0f5e3fc 15
1ca7869b 16class TH1F;
17class TFile;
1ca7869b 18class TArrayI;
19class TArrayF;
e8189707 20class AliITS;
c7a4dac0 21class AliITSpList;
e8189707 22class AliITSMap;
23class AliITSMapA1;
24class AliITSMapA2;
b0f5e3fc 25class AliITSetfSDD;
c7a4dac0 26class AliITSsegmentationSDD;
fcf95fc7 27class AliITSCalibration;
28class AliITSCalibrationSDD;
b0f5e3fc 29
b0f5e3fc 30class AliITSsimulationSDD : public AliITSsimulation {
aacedc3e 31 public:
8a33ae9e 32 AliITSsimulationSDD(); // default constructor
33 //Standard Constructor
8ba39da9 34 AliITSsimulationSDD(AliITSDetTypeSim* dettyp);
f45f6658 35 // Copy operator
7537d03c 36 AliITSsimulationSDD(const AliITSsimulationSDD &source);
8a33ae9e 37 virtual ~AliITSsimulationSDD(); // Destructor
f45f6658 38 // = operator
d2f55a22 39 AliITSsimulationSDD& operator=(const AliITSsimulationSDD &source);
85f5e9c2 40 // virtual AliITSsimulation& operator=(const AliITSsimulation &source);
c7a4dac0 41 // Initilize variables for this simulation
aacedc3e 42 void Init();
8a33ae9e 43
8ba39da9 44 // Get a pointer to the segmentation object
45 virtual AliITSsegmentation* GetSegmentationModel(Int_t /*dt*/){return fDetType->GetSegmentationModel(1);}
46 // set pointer to segmentation object
47 virtual void SetSegmentationModel(Int_t /*dt*/, AliITSsegmentation *seg){fDetType->SetSegmentationModel(1,seg);}
8a33ae9e 48
49 // set the scale size factor for the smples in FFT
50 virtual void SetScaleFourier(Int_t scale=4) {fScaleSize=scale;}
51 Int_t ScaleFourier() const {return fScaleSize;} // returns the scale factor
52 // set perpendicular tracks flag
53 virtual void SetPerpendTracksFlag(Bool_t flag=kFALSE) {fFlag=flag;}
54 // returns perpendicular track flag.
55 Bool_t PerpendTracksFlag() const {return fFlag;}
50d05d7b 56 // set crosstalk flag
57 virtual void SetCrosstalkFlag(Bool_t flag=kFALSE) {fCrosstalkFlag=flag;}
58 // return crosstalk flag
59 Bool_t CrosstalkFlag() const {return fCrosstalkFlag;}
20f3f947 60 void FastFourierTransform(Double_t *real, Double_t *imag, Int_t direction);
aacedc3e 61 virtual Int_t Convert10to8(Int_t signal) const;//10 to 8 bit SDD compresion
8a33ae9e 62 virtual void Compress2D(); // Applies 2D compresion algorithm
8a33ae9e 63 virtual void StoreAllDigits(); // if No compresion run this.
8a33ae9e 64 // returns baseline and noise for a given anode i.
f45f6658 65 //virtual void GetAnodeBaseline(Int_t i,Double_t &baseline,Double_t &noise) const;
8a33ae9e 66 // local implementation of ITS->AddDigit. Specific for SDD
67 virtual void AddDigit(Int_t i, Int_t j, Int_t signal);
8a33ae9e 68
5683bd96 69 // add baseline, noise, gain, electronics and ADC saturation effects
70 void ChargeToSignal(Int_t mod,Bool_t bAddNoise=kFALSE, Bool_t bAddGain=kTRUE);
50d05d7b 71 // add crosstalk effect
8ba39da9 72 void ApplyCrosstalk(Int_t mod);
50d05d7b 73
74 // create maps to build the lists of tracks for each summable digit
75 void InitSimulationModule( Int_t module, Int_t event );
76 // clear maps
77 void ClearMaps();
c7a4dac0 78 // Summable Digitses a SDD module
79 void SDigitiseModule(AliITSmodule *mod,Int_t md,Int_t ev);
48058160 80 // Add Summable digits to module maps.
81 Bool_t AddSDigitsToModule( TClonesArray *pItemArray, Int_t mask );
50d05d7b 82 // digitize module from the sum of summable digits.
83 void FinishSDigitiseModule();
c7a4dac0 84 // Writes summable digits
50d05d7b 85 void WriteSDigits();
c7a4dac0 86 // Introduces electronics effects and does zero-suppresion if required
50d05d7b 87 void FinishDigits();
8a33ae9e 88 // Digitses a SDD module
89 void DigitiseModule(AliITSmodule *mod,Int_t md,Int_t ev);
c7a4dac0 90 // Spread charge in a SDD module
50d05d7b 91 void HitsToAnalogDigits(AliITSmodule *mod);
8a33ae9e 92 // Sorts tracks for the 3 most highly contributed one to be added to digit.
aacedc3e 93 //void SortTracks(Int_t *tracks,Float_t *charges,Int_t *hits
94 // Int_t ntracks);
8a33ae9e 95 // collects and returns the fired SDD cells (uses AliITSMapA2...).
50d05d7b 96 //void ListOfFiredCells(Int_t *arg,Double_t timeAmplitude,TObjArray *list,
aacedc3e 97 // TClonesArray *padr);
8a33ae9e 98
99 // Creates histograms of maps for debugging
100 void CreateHistograms(Int_t scale);
101 // Fills histograms of maps for debugging
102 void FillHistograms();
103 // Resets histograms of maps for debugging
104 void ResetHistograms();
105 // Get the pointer to the array of histograms
106 TObjArray* GetHistArray() {return fHis;}
8a33ae9e 107 void WriteToFile(TFile *fp);// Writes the histograms to a file
108 // Get's histogram of a particular anode.
109 TH1F *GetAnode(Int_t wing, Int_t anode);
110
8a33ae9e 111 // sets DoFFT value.
112 void SetDoFFT(Int_t doFFT=1) {fDoFFT=doFFT;}
113
114 // Print SSD simulation Parameters
d2f55a22 115 virtual void PrintStatus() const;
8a33ae9e 116
aacedc3e 117 private:
f45f6658 118 // virtual void GetBaseline(Int_t mod); // read baseline values from a file
8a33ae9e 119 // Variables and pointers for local use only. Not Streamed out.
120 AliITS *fITS; //! local pointer to ITS
8a33ae9e 121 AliITSMapA2 *fHitMap2; //! local pointer to map of signals
48058160 122 AliITSMapA2 *fHitSigMap2; //! local pointer to map of signals
123 AliITSMapA2 *fHitNoiMap2; //! local pointer to map of signals
8a33ae9e 124 AliITSetfSDD *fElectronics; //! local pointer to electronics simulation
125 Double_t *fInZR; //! [fScaleSize*fMaxNofSamples] input of the
126 // real part of FFT
127 Double_t *fInZI; //! [fScaleSize*fMaxNofSamples]
128 // input of the imaginary part of FFT
129 Double_t *fOutZR; //! [fScaleSize*fMaxNofSamples]
130 // output of the real part of FFT
131 Double_t *fOutZI; //! [fScaleSize*fMaxNofSamples]
132 // output of the imaginary part of FFT
43217ad9 133 Bool_t *fAnodeFire; //! [#of anodes] Flag if there is a signal
8a33ae9e 134
135 TObjArray *fHis; // just in case for histogramming
8a33ae9e 136 Bool_t fFlag; // Flag used to simulate perpendicular tracks
50d05d7b 137 Bool_t fCrosstalkFlag; // Flag used to apply the crosstalk effect
8a33ae9e 138 Int_t fDoFFT; // Flag used to switch off electronics when 0
139 Int_t fNofMaps; // Number of anodes used ( 1-2*nanodes per wing )
140 Int_t fMaxNofSamples;// Number of time samples
141 Int_t fScaleSize; // scale size factor for the samples in FFT
95d1e92f 142
20f3f947 143 ClassDef(AliITSsimulationSDD,3) // Simulation of SDD clusters
8a33ae9e 144
b0f5e3fc 145};
146#endif