]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSsimulationSPDdubna.h
Continuation of TFlukaGeo based on TGeo.
[u/mrichter/AliRoot.git] / ITS / AliITSsimulationSPDdubna.h
CommitLineData
409f8c84 1#ifndef ALIITSSIMULATIONSPDDUBNA_H
2#define ALIITSSIMULATIONSPDDUBNA_H
3
f74211b0 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
aacedc3e 7#include "TH1F.h"
8#include "TObjArray.h"
9
409f8c84 10#include "AliITSsimulation.h"
aacedc3e 11#include "AliITSresponseSPD.h"
12e7c97c 12#include "AliITSsegmentationSPD.h"
409f8c84 13
409f8c84 14class AliITSmodule;
15
16//-------------------------------------------------------------------
17
18class AliITSsimulationSPDdubna : public AliITSsimulation {
f74211b0 19 public:
20 AliITSsimulationSPDdubna();
aacedc3e 21 AliITSsimulationSPDdubna(AliITSsegmentation *seg,AliITSresponse *res,
22 Int_t cup=1);
f74211b0 23 virtual ~AliITSsimulationSPDdubna();
12e7c97c 24 // copy constructor
25 AliITSsimulationSPDdubna(const AliITSsimulationSPDdubna &source);
26 // ass. operator
27 AliITSsimulationSPDdubna& operator=(const AliITSsimulationSPDdubna &s);
28 // Initilizes the variables
aacedc3e 29 void Init();
409f8c84 30
aacedc3e 31 // General User calling routines
32 // Initilize simulation for a specific event and module
f74211b0 33 void InitSimulationModule(Int_t module, Int_t event);
aacedc3e 34 // Finish and write S Digitization
35 void FinishSDigitiseModule();
36 // From hits to Digits, without creating SDigits
37 void DigitiseModule(AliITSmodule *mod,Int_t,Int_t);
38
39 // More or less Internal Routines
40 // Create S Digits from specific module
f74211b0 41 void SDigitiseModule(AliITSmodule *mod, Int_t mask, Int_t event);
aacedc3e 42 // Write S Digits to the tree of SDigits.
12e7c97c 43 void WriteSDigits();
aacedc3e 44 // fill pList from hits, charge sharing, diffusion, coupling
12e7c97c 45 void HitToSDigit(AliITSmodule *mod);
aacedc3e 46 // Take pList of signals and apply noise... create Digis
47 void pListToDigits();
48 //
f74211b0 49 void CreateHistograms();
aacedc3e 50 void FillHistograms(Int_t ix,Int_t iz,Double_t v=1.0);
f74211b0 51 void ResetHistograms();
aacedc3e 52 TH1F* GetHistogram(Int_t i){return (TH1F*)(fHis->At(i));}// get histogram
12e7c97c 53 TObjArray* GetHistArray() {return fHis;}// get hist array
aacedc3e 54 TString& GetHistName(){return fSPDname;}
55 void SetHistName(TString &n){fSPDname = n;}
56 //
57 // For backwards compatibility
58 void SDigitsToDigits(){ FinishSDigitiseModule();};
59 void HitToDigit(AliITSmodule *mod){
60 // Standard interface to DigitiseModule
61 // Inputs:
62 // AliITSmodule *mod Pointer to this module
63 // Outputs:
64 // none.
65 // Return:
66 // none.
67 DigitiseModule(mod,GetModuleNumber(),0);};
409f8c84 68
f74211b0 69 private:
12e7c97c 70 void SpreadCharge(Double_t x0,Double_t z0,Int_t ix0,Int_t iz0,
71 Double_t el,Double_t sig,Int_t t,Int_t hi);
aacedc3e 72 void UpdateMapSignal(Int_t ix,Int_t iz,Int_t trk,Int_t ht,Double_t signal){
73 // This function adds a signal to the pList from the pList class
74 // Inputs:
75 // Int_t iz // row number
76 // Int_t ix // column number
77 // Int_t trk // track number
78 // Int_t ht // hit number
79 // Double_t signal // signal strength
80 // Outputs:
81 // none.
82 // Return:
83 // none
84 GetMap()->AddSignal(iz,ix,trk,ht,GetModuleNumber(),signal);};
85 void UpdateMapNoise(Int_t ix,Int_t iz,Float_t noise){
86 // This function adds noise to data in the MapA2 as well as the pList
87 // Inputs:
88 // Int_t iz // row number
89 // Int_t ix // column number
90 // Double_t ns // electronic noise generated by pListToDigits
91 // Outputs:
92 // none.
93 // Return:
94 // none
95 GetMap()->AddNoise(iz,ix,GetModuleNumber(),noise);};
f74211b0 96 AliITSsegmentationSPD* GetSeg(){ // Return pointer to Segmentation class
aacedc3e 97 return (AliITSsegmentationSPD*)fSegmentation;};
98 // Return pointer to Responce class
99 AliITSresponseSPD* GetResp(Int_t ix,Int_t iz){ // ix iz dummy for now
100 ix=iz; return (AliITSresponseSPD*)GetResponseModel();};
101 // Bari-Salerno Coupling parameters
102 // "New" coupling routine Tiziano Virgili
12e7c97c 103 void SetCoupling(Int_t row,Int_t col,Int_t ntrack,Int_t idhit);
aacedc3e 104 // "Old" coupling routine Rocco Caliandro
12e7c97c 105 void SetCouplingOld(Int_t row, Int_t col,Int_t ntrack,Int_t idhit);
106 // Getters for data kept in fSegmentation and fResponse.
107 // Returns the Threshold in electrons
aacedc3e 108 Double_t GetThreshold(Int_t ix,Int_t iz){
109 Double_t th,sig;GetResp(ix,iz)->Thresholds(th,sig);return th;};
12e7c97c 110 // Returns the couplings Columb and Row.
aacedc3e 111 void GetCouplings(Double_t &cc,Double_t &cr){
112 ((AliITSresponseSPD*)GetResp(0,0))->GetCouplingParam(cc,cr);};
12e7c97c 113 // Returns the number of pixels in x
aacedc3e 114 Int_t GetNPixelsX(){return GetSeg()->Npx();};
12e7c97c 115 // Returns the number of pixels in z
aacedc3e 116 Int_t GetNPixelsZ(){return GetSeg()->Npz();};
409f8c84 117
f74211b0 118 TObjArray *fHis; //! just in case for histogramming
aacedc3e 119 TString fSPDname; //! Histogram name
120 Int_t fCoupling; // Sets the coupling to be used.
121 // ==1 use SetCoupling, ==2 use SetCouplingOld
122 // with diffusion turned off (by constructor)
123 // ==3 use SetCoupling, ==4 use SetCouplingOld
124 // with diffusion, else no coupling.
125 ClassDef(AliITSsimulationSPDdubna,3) // Simulation of SPD clusters
f74211b0 126};
409f8c84 127#endif