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