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