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