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