Removing the module from the list of modules in the destructor
[u/mrichter/AliRoot.git] / STEER / AliModule.h
CommitLineData
aee8290b 1#ifndef ALIMODULE_H
2#define ALIMODULE_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
e2afb3b6 8#include "Riostream.h"
9
94de3818 10#include "TAttLine.h"
11#include "TAttMarker.h"
e2afb3b6 12#include "TNamed.h"
13
65fb704d 14#include "AliRndm.h"
94de3818 15
94de3818 16class TClonesArray;
17class TBrowser;
18class TArrayI;
2ab0c725 19class TFile;
8494b010 20
65fb704d 21class AliModule : public TNamed , public TAttLine, public TAttMarker,
22 public AliRndm {
8494b010 23public:
24
25 // Creators - distructors
26 AliModule(const char* name, const char *title);
27 AliModule();
aee8290b 28 AliModule(const AliModule &mod);
8494b010 29 virtual ~AliModule();
30
31 // Inline functions
94de3818 32 virtual int GetNdigits() const {return 0;}
33 virtual int GetNhits() const {return 0;}
02ca2762 34 virtual TArrayI *GetIdtmed() const {return fIdtmed;}
35 virtual TList *Histograms() const {return fHistograms;}
36 virtual TList *Nodes() const {return fNodes;}
94de3818 37 virtual TClonesArray *Digits() const {return 0;}
38 virtual TClonesArray *Hits() const {return 0;}
39 virtual TObjArray *Points() const {return 0;}
40 virtual Int_t GetIshunt() const {return 0;}
7103de83 41 virtual void SetIshunt(Int_t) {}
02ca2762 42 virtual Bool_t IsActive() const {return fActive;}
b21a3d1a 43 virtual Bool_t IsFolder() const {return kTRUE;}
7103de83 44 virtual Int_t& LoMedium() {return fLoMedium;}
45 virtual Int_t& HiMedium() {return fHiMedium;}
65fb704d 46 virtual Int_t GetDebug() const {return fDebug;}
47 virtual void SetDebug(Int_t deb=0) {fDebug=deb;}
8494b010 48
49 // Module composition
aee8290b 50 virtual void AliMaterial(Int_t imat, const char* name, Float_t a,
51 Float_t z, Float_t dens, Float_t radl,
52 Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const;
53 virtual void AliGetMaterial(Int_t imat, char* name, Float_t &a,
54 Float_t &z, Float_t &dens, Float_t &radl,
116cbefd 55 Float_t &absl) const;
aee8290b 56 virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
57 Float_t *z, Float_t dens, Int_t nlmat,
58 Float_t *wmat) const;
59 virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
60 Int_t isvol, Int_t ifield, Float_t fieldm,
61 Float_t tmaxfd, Float_t stemax, Float_t deemax,
62 Float_t epsil, Float_t stmin, Float_t *ubuf=0,
63 Int_t nbuf=0) const;
64 virtual void AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
65 Float_t theta2, Float_t phi2, Float_t theta3,
66 Float_t phi3) const;
8494b010 67
68 // Virtual methods
69 virtual void BuildGeometry() {};
70 virtual Int_t IsVersion() const =0;
71
72 // Other methods
dda5e866 73 virtual void AddDigit(Int_t*, Int_t*){
74 Error("AddDigit","Digits cannot be added to module %s\n",fName.Data());}
75 virtual void AddHit(Int_t, Int_t*, Float_t *) {
76 Error("AddDigit","Hits cannot be added to module %s\n",fName.Data());}
2ab0c725 77 virtual void Hits2SDigits() {}
78 virtual void SDigits2Digits() {}
fe961a91 79 virtual void Digits2Reco() {}
2ab0c725 80 virtual void Digits2Raw() {}
81 virtual void Raw2Digits() {}
7103de83 82 virtual void Browse(TBrowser *) {}
8494b010 83 virtual void CreateGeometry() {}
84 virtual void CreateMaterials() {}
85 virtual void Disable();
116cbefd 86 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) const;
8494b010 87 virtual void Enable();
7103de83 88 virtual void PreTrack(){}
89 virtual void PostTrack(){}
90 virtual void FinishEvent() {}
8494b010 91 virtual void FinishRun() {}
24de2263 92 virtual void FinishPrimary() {}
e2afb3b6 93 virtual void RemapTrackHitIDs(Int_t *) {}
94 virtual void RemapTrackReferencesIDs(Int_t *) {} //remaping track references MI
24de2263 95
dda5e866 96 //virtual void Hits2Digits() {}
8494b010 97 virtual void Init() {}
98 virtual void LoadPoints(Int_t ) {}
e2afb3b6 99 virtual void MakeBranch(Option_t *, const char* =0 ) {}
100 virtual void MakeBranchTR(Option_t * =" ", const char * =0 ){}
8494b010 101 virtual void Paint(Option_t *) {}
102 virtual void ResetDigits() {}
2ab0c725 103 virtual void ResetSDigits() {}
8494b010 104 virtual void ResetHits() {}
aab9c8d5 105 virtual void ResetTrackReferences() {}
8494b010 106 virtual void ResetPoints() {}
107 virtual void SetTreeAddress() {}
108 virtual void SetTimeGate(Float_t) {}
94de3818 109 virtual Float_t GetTimeGate() const {return 1.e10;}
8494b010 110 virtual void StepManager() {}
3f754d83 111 virtual void DisableStepManager() {fEnable = kFALSE;}
116cbefd 112 virtual Bool_t StepManagerIsEnabled() const {return fEnable;}
8918e700 113 virtual void SetBufferSize(Int_t) {}
65fb704d 114 virtual Float_t ZMin() const;
115 virtual Float_t ZMax() const;
aee8290b 116 virtual void SetEuclidFile(char *material,char *geometry=0);
117 virtual void ReadEuclid(const char *filnam, char *topvol);
118 virtual void ReadEuclidMedia(const char *filnam);
e2afb3b6 119 AliModule& operator=(const AliModule &mod)
120 {mod.Copy(*this); return (*this);}
8494b010 121
aee8290b 122protected:
e2afb3b6 123 void Copy(AliModule &mod) const;
124
aee8290b 125 // Data members
126
2ab0c725 127 TString fEuclidMaterial; //!Name of the Euclid file for materials (if any)
128 TString fEuclidGeometry; //!Name of the Euclid file for geometry (if any)
aee8290b 129
2ab0c725 130 TArrayI *fIdtmed; //!List of tracking medium numbers
131 TArrayI *fIdmate; //!List of material numbers
132 Int_t fLoMedium; //!Minimum tracking medium ID for this Module
133 Int_t fHiMedium; //!Maximum tracking medium ID for this Module
aee8290b 134
135 Bool_t fActive; //Detector activity flag
136 TList *fHistograms; //List of histograms
137 TList *fNodes; //List of geometry nodes
65fb704d 138 Int_t fDebug; //Debug flag
3f754d83 139 Bool_t fEnable; //StepManager enabling flag
99225a57 140 ClassDef(AliModule,2) //Base class for ALICE Modules
8494b010 141};
142#endif