]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSDetTypeSim.h
New Class' to A) separate out the simulation from the reconstruction. and
[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
10/**********************************************************************
11 * This class contains all of the "external" information needed to do *
12 * detector specific simulations for the ITS. *
13 **********************************************************************/
14#include <TObject.h>
15#include <TObjArray.h>
16#include <TClonesArray.h>
17
18#include "AliITSgeom.h"
19
20class AliITSsimulation;
21class AliITSsegmentation;
22class AliITSresponce;
23
24class AliITSDetTypeSim : public TObject {
25 public:
26 AliITSDetTypeSim(); // Default constructor
27 virtual ~AliITSDetTypeSim(); // Proper Destructor
28 virtual AliITSDetTypeSim(const AliITSDetTypeSim &source);
29
30 // AliITSgeom related functions
31 // Return the pointer to the AliITSgeom object for simulation
32 AliITSgeom *GetITSgeom() const{return fGeom;}
33 // Set the pointer to the AliITSgeom object for simulation
34 void SetITSgeom(AliITSgeom *geom){fGeom=geom;}
35
36 // AliITSmodule related functions
37 // Return Pointer to array of hits by module number
38 TObjArray *GetModules(){return fHitModule;}
39 // Return Pointer to hits for a specific module number
40 AliITSmodule *GetModule(Int_t index){
41 return (AliITSmodule*)(fHitModule->At(index));}
42
43 // AliITSsimulation related functions
44 // Set the simulation model for a give type of detector
45 virtual void SetSimulationModel(Int_t dettype,AliITSsimulation *sim){
46 if(fSimulation==0) fSimulation = new TObjArray();
47 if(fSimulation->At(dettype)!=0) delete fSimulation->At(dettype);
48 fSimulation->AddAt(sim,dettype);}
49 // Return the simulation model for a give detector type
50 virtual AliITSsimulation* GetSimulationModel(Int_t dettype){
51 if(fSimulation==0) return 0; return fSimulation->At(dettype);}
52 // Return the simulation model for a given module (checks AliITSgeom)
53 virtual AliITSsimulation* GetSimulationModelByModule(Int_t module){
54 if(fGeom==0) return 0;
55 return GetSimulationModel(fGeom->GetModuleType(module));}
56
57 // AliITSsegmentation related functions
58 // Set the segmentation model for a give type of detector
59 virtual void SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){
60 if(fSegmentation==0) fSegmentation = new TObjArray();
61 if(fSegmentation->At(dettype)!=0) delete fSegmentation->At(dettype);
62 fSegmentation->AddAt(seg,dettype);}
63 // Return the segmentation model for a give detector type
64 virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype){
65 if(fSegmentation==0) return 0; return fSegmentation->At(dettype);}
66 // Return the segmentation model for a given module (checks AliITSgeom)
67 virtual AliITSsegmentation* GetSegmentationModelByModule(Int_t module){
68 if(fGeom==0) return 0;
69 return GetSegmentationModel(fGeom->GetModuleType(module));}
70
71 // AliITSresponse related functions
72 // Set the response model for a give module
73 virtual void SetResponseModel(Int_t module,AliITSresponse *resp){
74 if(fResponse==0) fResponse = new TObjArray();
75 if(fResponse->At(module)!=0) delete fResponse->At(module);
76 fResponse->AddAt(resp,module);}
77 // Return the response model for a give detector type
78 virtual AliITSresponse* GetResponseModel(Int_t module){
79 if(fResponse==0) return 0; return fResponse->At(module);}
80
81 // Sorted hit info
82 virtual void InitModules(Int_t size,Int_t &nmodules);
83 virtual void FillModules(TTree *treeH, Int_t mask = 0);
84 virtual void ClearModules(){if(fHitModule) fHitModule->Delete();};
85
86 // TClonesArray of Hits related functions
87 virtual void ResetHits(){fNhits=0;if(fHits!=0) fHits->Clear();}
88
89 // TClonesArray of SDigits related functions
90 virtual void ResetSDigits(){fNSDigits=0;if(fSDigits!=0) fSDigits->Clear();}
91
92 // TClonesArray of SDigits related functions
93 virtual void ResetDigits(){fNDigits=0;if(fDigits!=0) fDigits->Clear();}
94
95 private:
96 AliITSgeom *fGeom; //
97 TObjArray *fSimulation; // [NDet]
98 TObjArray *fSegmentation; // [NDet]
99 TObjArray *fResponse; // [NMod]
100 TObjArray *fPreProcess; // [] e.g. Fill fHitModule with hits
101 TObjArray *fPostProcess; // [] e.g. Wright Raw data
102 TObjArray *fHitModule; //! [NMod][Nhits]
103 Int_t fNhits; //! number of hits
104 TClonesArray *fHits; //! Local pointer to hits
105 Int_t fNSDigits; //! number of SDigits
106 TClonesArray *fSDigits; //! [NMod][NSDigits]
107 Int_t fNDigits; //! number of Digits
108 TClonesArray *fDigits; //! [NMod][NDigits]
109 TString fHitClassName; // String with Hit class name
110 TString fSDigClassName;// String with SDigit class name.
111 TString fDigClassName; // String with digit class name.
112
113 ClassDef(AliITSDetTypeSim,1) // ITS Simulation structure
114}
115#endif