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