]>
Commit | Line | Data |
---|---|---|
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> |
16 | #include <TObjArray.h> | |
17 | #include <TClonesArray.h> | |
fe20e72f | 18 | #include "AliITSCalibration.h" |
cd2a0045 | 19 | #include "AliITSSimuParam.h" |
979b5a5f | 20 | #include "AliITSDDLModuleMapSDD.h" |
023ae34b | 21 | #include "AliITSLoader.h" |
fe20e72f | 22 | #include "AliITSgeom.h" |
3b9df642 | 23 | |
8ba39da9 | 24 | class TTree; |
25 | class AliCDBMetaData; | |
7d62fb64 | 26 | class AliITSdigit; |
27 | class AliITSmodule; | |
28 | class AliITSpListItem; | |
3b9df642 | 29 | class AliITSsimulation; |
30 | class AliITSsegmentation; | |
681e8104 | 31 | class AliITSresponse; |
3a4cb7b6 | 32 | class AliITSCalibrationSSD; |
88128115 | 33 | class AliITSGainSSDv2; |
34 | class AliITSBadChannelsSSDv2; | |
35 | class AliITSNoiseSSDv2; | |
3b9df642 | 36 | |
37 | class AliITSDetTypeSim : public TObject { | |
7d62fb64 | 38 | public: |
39 | ||
40 | AliITSDetTypeSim(); | |
41 | virtual ~AliITSDetTypeSim(); | |
42 | AliITSDetTypeSim(const AliITSDetTypeSim &source); | |
43 | AliITSDetTypeSim& operator=(const AliITSDetTypeSim &source); | |
023ae34b | 44 | AliITSgeom *GetITSgeom() const { |
45 | if(fLoader)return ((AliITSLoader*)fLoader)->GetITSgeom(); | |
46 | else return 0;} | |
47 | void SetITSgeom(AliITSgeom *geom); | |
7d62fb64 | 48 | |
49 | virtual void SetSimulationModel(Int_t dettype,AliITSsimulation *sim); | |
50 | virtual AliITSsimulation* GetSimulationModel(Int_t dettype); | |
51 | virtual AliITSsimulation* GetSimulationModelByModule(Int_t module); | |
52 | ||
53 | virtual void SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg); | |
54 | virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype); | |
55 | virtual AliITSsegmentation* GetSegmentationModelByModule(Int_t module); | |
56 | ||
fcf95fc7 | 57 | virtual void SetCalibrationModel(Int_t iMod,AliITSCalibration *resp); |
58 | virtual AliITSCalibration* GetCalibrationModel(Int_t iMod); | |
023ae34b | 59 | virtual AliITSresponse* GetResponse(Int_t dettype) { |
60 | return GetCalibrationModel( | |
61 | GetITSgeom()->GetStartDet(dettype))->GetResponse();} | |
cd2a0045 | 62 | |
63 | virtual void SetSimuParam(AliITSSimuParam* spar){ | |
64 | if(fSimuPar) delete fSimuPar; | |
65 | fSimuPar = new AliITSSimuParam(*spar); | |
66 | } | |
67 | virtual AliITSSimuParam* GetSimuParam() const {return fSimuPar;} | |
68 | ||
979b5a5f | 69 | virtual AliITSDDLModuleMapSDD* GetDDLModuleMapSDD()const { return fDDLMapSDD;} |
fcf95fc7 | 70 | TObjArray* GetCalibrationArray() const {return fCalibration;} |
7d62fb64 | 71 | TObjArray* GetSegmentation() const {return fSegmentation;} |
fcf95fc7 | 72 | void ResetCalibrationArray(); |
7d62fb64 | 73 | void ResetSegmentation(); |
74 | ||
023ae34b | 75 | virtual void SetLoader(AliITSLoader* loader); |
76 | AliITSLoader* GetLoader() const {return fLoader;} | |
7d62fb64 | 77 | |
78 | virtual void SetDefaults(); | |
79 | virtual void SetDefaultSimulation(); | |
8ba39da9 | 80 | virtual void SetRunNumber(Int_t rn=0){fRunNumber = rn;} |
81 | virtual Int_t GetRunNumber() const {return fRunNumber;} | |
7d62fb64 | 82 | virtual void SetTreeAddressS(TTree* treeS, Char_t* name); |
83 | virtual void SetTreeAddressD(TTree* treeD, Char_t* name); | |
84 | ||
7d62fb64 | 85 | virtual void SetDigits(TObjArray* digits) {fDigits=digits;} |
e6b4e6b9 | 86 | const TClonesArray* GetSDigits() const { return &fSDigits;} |
7d62fb64 | 87 | TObjArray* GetDigits() const {return fDigits;} |
88 | Int_t* GetNDigitArray() const {return fNDigits;} | |
023ae34b | 89 | TClonesArray *DigitsAddress(Int_t id) const { |
90 | return ((TClonesArray*)(*fDigits)[id]);} | |
e6b4e6b9 | 91 | virtual void ResetSDigits(){fNSDigits=0; fSDigits.Clear();} |
7d62fb64 | 92 | virtual void ResetDigits(); |
93 | virtual void ResetDigits(Int_t branch); | |
94 | virtual void SDigitsToDigits(Option_t *opt,Char_t* name); | |
95 | ||
96 | virtual void AddSumDigit(AliITSpListItem &sdig); | |
8ba39da9 | 97 | virtual void AddSimDigit(Int_t branch, AliITSdigit *d); |
98 | virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits, | |
83ec5e27 | 99 | Int_t* tracks,Int_t *hits,Float_t* trkcharges, |
100 | Int_t sigexpanded=-1000); | |
023ae34b | 101 | virtual void SetDigitClassName(Int_t i, Char_t* name) { |
102 | fDigClassName[i]=name;} | |
7d62fb64 | 103 | Char_t* GetDigitClassName(Int_t i) const {return fDigClassName[i];} |
8ba39da9 | 104 | void StoreCalibration(Int_t firstRun, Int_t lastRun, AliCDBMetaData &md); |
105 | ||
106 | protected: | |
fcf95fc7 | 107 | virtual void CreateCalibrationArray(); |
8ba39da9 | 108 | virtual Bool_t GetCalibration(); |
7d62fb64 | 109 | |
110 | private: | |
1964ae5f | 111 | void SetDefaultSegmentation(Int_t idet); // creates def segm. |
88128115 | 112 | |
113 | //conversion of the old SSD calibration objects tothe new ones | |
114 | void ReadOldSSDNoise(TObjArray *array, | |
115 | AliITSNoiseSSDv2 *noiseSSD); | |
116 | void ReadOldSSDBadChannels(TObjArray *array, | |
117 | AliITSBadChannelsSSDv2 *badChannelsSSD); | |
118 | void ReadOldSSDGain(TObjArray *array, | |
119 | AliITSGainSSDv2 *gainSSD); | |
120 | ||
8ba39da9 | 121 | static const Int_t fgkNdettypes; // number of different det. types |
122 | static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default | |
123 | static const Int_t fgkDefaultNModulesSDD; // Total numbers of SDD modules by default | |
124 | static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules by default | |
125 | Int_t fNMod[3]; // numbers of modules from different types | |
126 | ||
7d62fb64 | 127 | TObjArray *fSimulation; //! [NDet] |
128 | TObjArray *fSegmentation; //! [NDet] | |
fcf95fc7 | 129 | TObjArray *fCalibration; //! [NMod] |
3a4cb7b6 | 130 | AliITSCalibrationSSD* fSSDCalibration; //! SSD calibration object |
7d62fb64 | 131 | TObjArray *fPreProcess; //! [] e.g. Fill fHitModule with hits |
132 | TObjArray *fPostProcess; //! [] e.g. Wright Raw data | |
3b9df642 | 133 | Int_t fNSDigits; //! number of SDigits |
e6b4e6b9 | 134 | TClonesArray fSDigits; //! Summable digits |
7d62fb64 | 135 | Int_t* fNDigits; //! [NDet] number of Digits for det. |
023ae34b | 136 | Int_t fRunNumber; //! run number (to access DB) |
137 | TObjArray *fDigits; //! [NMod][NDigits] | |
cd2a0045 | 138 | AliITSSimuParam *fSimuPar; //! detector simulation parameters |
979b5a5f | 139 | AliITSDDLModuleMapSDD *fDDLMapSDD; //! mapping DDL/module -> SDD module number |
7d62fb64 | 140 | TString fHitClassName; //! String with Hit class name |
141 | TString fSDigClassName;//! String with SDigit class name. | |
142 | Char_t* fDigClassName[3]; //! String with digit class name. | |
023ae34b | 143 | AliITSLoader* fLoader; //! loader |
144 | Bool_t fFirstcall; //! flag | |
7d62fb64 | 145 | |
cd2a0045 | 146 | ClassDef(AliITSDetTypeSim,7) // ITS Simulation structure |
7d62fb64 | 147 | |
148 | }; | |
3b9df642 | 149 | |
3b9df642 | 150 | #endif |