Follow PB requested that, for the time being, TRD info is not used to update
[u/mrichter/AliRoot.git] / ITS / AliITSDetTypeSim.h
CommitLineData
3b9df642 1#ifndef ALIITSDETTYPESIM_H
2#define ALIITSDETTYPESIM_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/*
7$Id$
8*/
9
7d62fb64 10/////////////////////////////////////////////////////////////////////////
11// * This class contains all of the "external" information needed to do//
12// * detector specific simulations for the ITS. //
13/////////////////////////////////////////////////////////////////////////
14
3b9df642 15#include <TObject.h>
023ae34b 16#include "AliITSLoader.h"
ef665f5e 17#include "AliITSSimuParam.h"
ad7f2bfa 18#include "AliITSFOGeneratorSPD.h"
3b9df642 19
ef665f5e 20class TObjArray;
21class TClonesArray;
8ba39da9 22class TTree;
23class AliCDBMetaData;
7d62fb64 24class AliITSdigit;
25class AliITSmodule;
26class AliITSpListItem;
3b9df642 27class AliITSsimulation;
28class AliITSsegmentation;
681e8104 29class AliITSresponse;
3a4cb7b6 30class AliITSCalibrationSSD;
88128115 31class AliITSGainSSDv2;
32class AliITSBadChannelsSSDv2;
33class AliITSNoiseSSDv2;
dfd6be22 34class AliITSresponseSDD;
ef665f5e 35class AliITSDDLModuleMapSDD;
36class AliITSCalibration;
37class AliITSgeom;
ad7f2bfa 38class AliITSFOSignalsSPD;
39class AliITSTriggerConditions;
3b9df642 40
41class AliITSDetTypeSim : public TObject {
7d62fb64 42 public:
43
44 AliITSDetTypeSim();
45 virtual ~AliITSDetTypeSim();
46 AliITSDetTypeSim(const AliITSDetTypeSim &source);
47 AliITSDetTypeSim& operator=(const AliITSDetTypeSim &source);
023ae34b 48 AliITSgeom *GetITSgeom() const {
49 if(fLoader)return ((AliITSLoader*)fLoader)->GetITSgeom();
50 else return 0;}
51 void SetITSgeom(AliITSgeom *geom);
7d62fb64 52
53 virtual void SetSimulationModel(Int_t dettype,AliITSsimulation *sim);
ef665f5e 54 virtual AliITSsimulation* GetSimulationModel(Int_t dettype) const;
55 virtual AliITSsimulation* GetSimulationModelByModule(Int_t module) const;
7d62fb64 56
57 virtual void SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg);
ef665f5e 58 virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype) const;
59 virtual AliITSsegmentation* GetSegmentationModelByModule(Int_t module) const;
7d62fb64 60
fcf95fc7 61 virtual void SetCalibrationModel(Int_t iMod,AliITSCalibration *resp);
ad7f2bfa 62 virtual void SetSPDNoisyModel(Int_t iMod, AliITSCalibration *cal);
63
ef665f5e 64 virtual AliITSCalibration* GetCalibrationModel(Int_t iMod) const;
ad7f2bfa 65 virtual AliITSCalibration* GetSPDNoisyModel(Int_t iMod) const;
66 virtual AliITSTriggerConditions* GetTriggerConditions();
ef665f5e 67
68 virtual void SetSimuParam(const AliITSSimuParam* spar){
cd2a0045 69 if(fSimuPar) delete fSimuPar;
70 fSimuPar = new AliITSSimuParam(*spar);
71 }
72 virtual AliITSSimuParam* GetSimuParam() const {return fSimuPar;}
73
979b5a5f 74 virtual AliITSDDLModuleMapSDD* GetDDLModuleMapSDD()const { return fDDLMapSDD;}
dfd6be22 75 virtual AliITSresponseSDD* GetResponseSDD() const { return fRespSDD;}
fcf95fc7 76 TObjArray* GetCalibrationArray() const {return fCalibration;}
7d62fb64 77 TObjArray* GetSegmentation() const {return fSegmentation;}
fcf95fc7 78 void ResetCalibrationArray();
7d62fb64 79 void ResetSegmentation();
80
023ae34b 81 virtual void SetLoader(AliITSLoader* loader);
82 AliITSLoader* GetLoader() const {return fLoader;}
7d62fb64 83
84 virtual void SetDefaults();
85 virtual void SetDefaultSimulation();
8ba39da9 86 virtual void SetRunNumber(Int_t rn=0){fRunNumber = rn;}
87 virtual Int_t GetRunNumber() const {return fRunNumber;}
a6e0ebfe 88 virtual void SetTreeAddressS(TTree* treeS, const Char_t* name);
89 virtual void SetTreeAddressD(TTree* treeD, const Char_t* name);
7d62fb64 90
7d62fb64 91 virtual void SetDigits(TObjArray* digits) {fDigits=digits;}
e6b4e6b9 92 const TClonesArray* GetSDigits() const { return &fSDigits;}
7d62fb64 93 TObjArray* GetDigits() const {return fDigits;}
94 Int_t* GetNDigitArray() const {return fNDigits;}
023ae34b 95 TClonesArray *DigitsAddress(Int_t id) const {
96 return ((TClonesArray*)(*fDigits)[id]);}
e6b4e6b9 97 virtual void ResetSDigits(){fNSDigits=0; fSDigits.Clear();}
7d62fb64 98 virtual void ResetDigits();
99 virtual void ResetDigits(Int_t branch);
a6e0ebfe 100 virtual void SDigitsToDigits(Option_t *opt, Char_t* name);
7d62fb64 101
102 virtual void AddSumDigit(AliITSpListItem &sdig);
ef665f5e 103 virtual void AddSimDigit(Int_t branch, const AliITSdigit *d);
8ba39da9 104 virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
83ec5e27 105 Int_t* tracks,Int_t *hits,Float_t* trkcharges,
106 Int_t sigexpanded=-1000);
a6e0ebfe 107 virtual void SetDigitClassName(Int_t i, const Char_t* name) {
ef665f5e 108 fkDigClassName[i]=name;}
109 const Char_t* GetDigitClassName(Int_t i) const {return fkDigClassName[i];}
8ba39da9 110
ad7f2bfa 111 virtual void ResetFOSignals() {fFOGenerator.ResetSignals();}
112 virtual void ProcessSPDDigitForFastOr(UInt_t module, UInt_t colM, UInt_t rowM);
113 virtual void ProcessNoiseForFastOr() {fFOGenerator.ProcessNoise();}
114 virtual AliITSFOSignalsSPD* GetFOSignals() {return fFOGenerator.GetFOSignals();}
115 virtual void WriteFOSignals();
cf8425ac 116 virtual Float_t GetAverageGainSDD() const {
117 if(fAveGainSDD>0.) return fAveGainSDD;
118 else return 1.;
119 }
ad7f2bfa 120
121
8ba39da9 122 protected:
fcf95fc7 123 virtual void CreateCalibrationArray();
8ba39da9 124 virtual Bool_t GetCalibration();
7d62fb64 125
126 private:
1964ae5f 127 void SetDefaultSegmentation(Int_t idet); // creates def segm.
88128115 128
129 //conversion of the old SSD calibration objects tothe new ones
ef665f5e 130 void ReadOldSSDNoise(const TObjArray *array,
88128115 131 AliITSNoiseSSDv2 *noiseSSD);
ef665f5e 132 void ReadOldSSDBadChannels(const TObjArray *array,
88128115 133 AliITSBadChannelsSSDv2 *badChannelsSSD);
ef665f5e 134 void ReadOldSSDGain(const TObjArray *array,
88128115 135 AliITSGainSSDv2 *gainSSD);
136
8ba39da9 137 static const Int_t fgkNdettypes; // number of different det. types
138 static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
139 static const Int_t fgkDefaultNModulesSDD; // Total numbers of SDD modules by default
140 static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules by default
8ba39da9 141
7d62fb64 142 TObjArray *fSimulation; //! [NDet]
143 TObjArray *fSegmentation; //! [NDet]
fcf95fc7 144 TObjArray *fCalibration; //! [NMod]
3a4cb7b6 145 AliITSCalibrationSSD* fSSDCalibration; //! SSD calibration object
ad7f2bfa 146 TObjArray *fSPDNoisy; //! [fgkDefaultNModulesSPD]
3b9df642 147 Int_t fNSDigits; //! number of SDigits
e6b4e6b9 148 TClonesArray fSDigits; //! Summable digits
7d62fb64 149 Int_t* fNDigits; //! [NDet] number of Digits for det.
023ae34b 150 Int_t fRunNumber; //! run number (to access DB)
151 TObjArray *fDigits; //! [NMod][NDigits]
cd2a0045 152 AliITSSimuParam *fSimuPar; //! detector simulation parameters
979b5a5f 153 AliITSDDLModuleMapSDD *fDDLMapSDD; //! mapping DDL/module -> SDD module number
dfd6be22 154 AliITSresponseSDD *fRespSDD; //! SDD response parameters
cf8425ac 155 Float_t fAveGainSDD; //! Average gain of SDD good anodes
ef665f5e 156 const Char_t* fkDigClassName[3]; //! String with digit class name.
023ae34b 157 AliITSLoader* fLoader; //! loader
158 Bool_t fFirstcall; //! flag
ad7f2bfa 159 AliITSFOGeneratorSPD fFOGenerator; //! Fast-OR generator object
160 AliITSTriggerConditions* fTriggerConditions; //! Trigger conditions
161
e7c6b057 162 ClassDef(AliITSDetTypeSim,14) // ITS Simulation structure
7d62fb64 163
164};
3b9df642 165
3b9df642 166#endif