#define ALIITSSIMULATIONSDD_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+
/* $Id$ */
#include <TNtuple.h>
class TArrayI;
class TArrayF;
class AliITS;
+class AliITSpList;
class AliITSMap;
class AliITSMapA1;
class AliITSMapA2;
class AliITSetfSDD;
+class AliITSsegmentationSDD;
class AliITSInStream;
class AliITSresponse;
+class AliITSresponseSDD;
class AliITSsimulationSDD : public AliITSsimulation {
virtual ~AliITSsimulationSDD(); // Destructor
// = opporator
AliITSsimulationSDD& operator=(AliITSsimulationSDD &source);
+ // Initilize variables for this simulation
+ void Init(AliITSsegmentationSDD *seg,AliITSresponseSDD *resp);
// get the address of the array mapping the signal or pointers to arrays
- virtual AliITSMap* HitMap(Int_t i);
+// virtual AliITSMap* HitMap(Int_t i);
// set the scale size factor for the smples in FFT
virtual void SetScaleFourier(Int_t scale=4) {fScaleSize=scale;}
virtual void SetPerpendTracksFlag(Bool_t flag=kFALSE) {fFlag=flag;}
// returns perpendicular track flag.
Bool_t PerpendTracksFlag() const {return fFlag;}
+ // set crosstalk flag
+ virtual void SetCrosstalkFlag(Bool_t flag=kFALSE) {fCrosstalkFlag=flag;}
+ // return crosstalk flag
+ Bool_t CrosstalkFlag() const {return fCrosstalkFlag;}
// set compression parameters for 2D or 1D via response functions
void SetCompressParam();
// retrieve compression parameters for 2D or 1D
virtual void SetFileName(const char *filnam) {fFileName=filnam;}
// add baseline, noise, electronics and ADC saturation effects
- void ChargeToSignal();
+ void ChargeToSignal(Bool_t bAddNoise=kFALSE);
+ // add dead channels
+ void ApplyDeadChannels();
+ // add crosstalk effect
+ void ApplyCrosstalk();
+
+ // create maps to build the lists of tracks for each summable digit
+ void InitSimulationModule( Int_t module, Int_t event );
+ // clear maps
+ void ClearMaps();
+ // Summable Digitses a SDD module
+ void SDigitiseModule(AliITSmodule *mod,Int_t md,Int_t ev);
+ // Add Summable digits to module maps.
+ Bool_t AddSDigitsToModule( TClonesArray *pItemArray, Int_t mask );
+ // digitize module from the sum of summable digits.
+ void FinishSDigitiseModule();
+ // Writes summable digits
+ void WriteSDigits();
+ // Introduces electronics effects and does zero-suppresion if required
+ void FinishDigits();
// Digitses a SDD module
void DigitiseModule(AliITSmodule *mod,Int_t md,Int_t ev);
+ // Spread charge in a SDD module
+ void HitsToAnalogDigits(AliITSmodule *mod);
// Sorts tracks for the 3 most highly contributed one to be added to digit.
- void SortTracks(Int_t *tracks,Float_t *charges,Int_t *hits,Int_t ntracks);
+ //void SortTracks(Int_t *tracks,Float_t *charges,Int_t *hits,Int_t ntracks);
// collects and returns the fired SDD cells (uses AliITSMapA2...).
- void ListOfFiredCells(Int_t *arg,Double_t timeAmplitude,TObjArray *list,
- TClonesArray *padr);
+ //void ListOfFiredCells(Int_t *arg,Double_t timeAmplitude,TObjArray *list,
+ // TClonesArray *padr);
// Creates histograms of maps for debugging
void CreateHistograms(Int_t scale);
TObjArray* GetHistArray() {return fHis;}
// create a separate tree for background monitoring (2D)
virtual void MakeTreeB(Option_t *option="B")
- { fTreeB = new TNtuple("ntuple","2D backgr","nz:nl:nh:low:anode");}
+ { if(strstr(option,"B"))
+ fTreeB = new TNtuple("ntuple", "2D backgr","nz:nl:nh:low:anode");}
// presently a dummy routine use TreeB() instead
void GetTreeB(Int_t) { }
// Return pointer to TreeB
private:
// Variables and pointers for local use only. Not Streamed out.
AliITS *fITS; //! local pointer to ITS
- AliITSMapA1 *fHitMap1; //! local pointer to map of digits
+// AliITSMapA1 *fHitMap1; //! local pointer to map of digits
AliITSMapA2 *fHitMap2; //! local pointer to map of signals
+ AliITSMapA2 *fHitSigMap2; //! local pointer to map of signals
+ AliITSMapA2 *fHitNoiMap2; //! local pointer to map of signals
+// AliITSpList *fpList; //!
+// TObjArray *falist; //
+// TClonesArray *fpadr; //
AliITSInStream *fStream; //! input file stream
AliITSetfSDD *fElectronics; //! local pointer to electronics simulation
Double_t *fInZR; //! [fScaleSize*fMaxNofSamples] input of the
// output of the real part of FFT
Double_t *fOutZI; //! [fScaleSize*fMaxNofSamples]
// output of the imaginary part of FFT
+ Bool_t *fAnodeFire; //! [#of anodes] Flag if there is a signal
TObjArray *fHis; // just in case for histogramming
TArrayI fD; // decrease values for baseline eq.
TString fFileName; // File name for possible options above
Bool_t fFlag; // Flag used to simulate perpendicular tracks
Bool_t fCheckNoise; // Flag used to check the simulated noise
+ Bool_t fCrosstalkFlag; // Flag used to apply the crosstalk effect
Int_t fDoFFT; // Flag used to switch off electronics when 0
Int_t fNofMaps; // Number of anodes used ( 1-2*nanodes per wing )
Int_t fMaxNofSamples;// Number of time samples
Int_t fScaleSize; // scale size factor for the samples in FFT
- Int_t fModule; // in case bgr,noise,param,change module-by-mod.
- Int_t fEvent; // solely for output from bgr monitoring of 2D
+// Int_t fModule; //! in case bgr,noise,param,change module-by-mod.
+// Int_t fEvent; //! solely for output from bgr monitoring of 2D
ClassDef(AliITSsimulationSDD,1) // Simulation of SDD clusters