Transition to NewIO
[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;
88cb7938 20class TTree;
21class AliLoader;
2cad796f 22class AliTrackReference;
8494b010 23
88cb7938 24
65fb704d 25class AliModule : public TNamed , public TAttLine, public TAttMarker,
26 public AliRndm {
8494b010 27public:
28
29 // Creators - distructors
30 AliModule(const char* name, const char *title);
31 AliModule();
aee8290b 32 AliModule(const AliModule &mod);
8494b010 33 virtual ~AliModule();
34
35 // Inline functions
94de3818 36 virtual int GetNdigits() const {return 0;}
37 virtual int GetNhits() const {return 0;}
02ca2762 38 virtual TArrayI *GetIdtmed() const {return fIdtmed;}
39 virtual TList *Histograms() const {return fHistograms;}
40 virtual TList *Nodes() const {return fNodes;}
94de3818 41 virtual TClonesArray *Digits() const {return 0;}
42 virtual TClonesArray *Hits() const {return 0;}
43 virtual TObjArray *Points() const {return 0;}
44 virtual Int_t GetIshunt() const {return 0;}
7103de83 45 virtual void SetIshunt(Int_t) {}
02ca2762 46 virtual Bool_t IsActive() const {return fActive;}
b21a3d1a 47 virtual Bool_t IsFolder() const {return kTRUE;}
7103de83 48 virtual Int_t& LoMedium() {return fLoMedium;}
49 virtual Int_t& HiMedium() {return fHiMedium;}
65fb704d 50 virtual Int_t GetDebug() const {return fDebug;}
51 virtual void SetDebug(Int_t deb=0) {fDebug=deb;}
8494b010 52
53 // Module composition
aee8290b 54 virtual void AliMaterial(Int_t imat, const char* name, Float_t a,
55 Float_t z, Float_t dens, Float_t radl,
56 Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const;
57 virtual void AliGetMaterial(Int_t imat, char* name, Float_t &a,
88cb7938 58 Float_t &z, Float_t &dens, Float_t &radl,
59 Float_t &absl) const;
aee8290b 60 virtual void AliMixture(Int_t imat, const char *name, Float_t *a,
88cb7938 61 Float_t *z, Float_t dens, Int_t nlmat,
62 Float_t *wmat) const;
aee8290b 63 virtual void AliMedium(Int_t numed, const char *name, Int_t nmat,
88cb7938 64 Int_t isvol, Int_t ifield, Float_t fieldm,
65 Float_t tmaxfd, Float_t stemax, Float_t deemax,
66 Float_t epsil, Float_t stmin, Float_t *ubuf=0,
67 Int_t nbuf=0) const;
aee8290b 68 virtual void AliMatrix(Int_t &nmat, Float_t theta1, Float_t phi1,
88cb7938 69 Float_t theta2, Float_t phi2, Float_t theta3,
70 Float_t phi3) const;
8494b010 71
72 // Virtual methods
73 virtual void BuildGeometry() {};
74 virtual Int_t IsVersion() const =0;
88cb7938 75
76
8494b010 77 // Other methods
dda5e866 78 virtual void AddDigit(Int_t*, Int_t*){
79 Error("AddDigit","Digits cannot be added to module %s\n",fName.Data());}
80 virtual void AddHit(Int_t, Int_t*, Float_t *) {
81 Error("AddDigit","Hits cannot be added to module %s\n",fName.Data());}
2ab0c725 82 virtual void Hits2SDigits() {}
83 virtual void SDigits2Digits() {}
fe961a91 84 virtual void Digits2Reco() {}
2ab0c725 85 virtual void Digits2Raw() {}
86 virtual void Raw2Digits() {}
7103de83 87 virtual void Browse(TBrowser *) {}
8494b010 88 virtual void CreateGeometry() {}
89 virtual void CreateMaterials() {}
90 virtual void Disable();
116cbefd 91 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) const;
8494b010 92 virtual void Enable();
7103de83 93 virtual void PreTrack(){}
94 virtual void PostTrack(){}
95 virtual void FinishEvent() {}
8494b010 96 virtual void FinishRun() {}
24de2263 97 virtual void FinishPrimary() {}
8494b010 98 virtual void Init() {}
99 virtual void LoadPoints(Int_t ) {}
88cb7938 100
101
102
103 virtual void MakeBranch(Option_t * opt =" ") {}
104 virtual void MakeTree(Option_t *) {}//skowron
105
106 virtual AliLoader* MakeLoader(const char* topfoldername);//skowron
107 virtual AliLoader* GetLoader() const {return 0x0;} //skowron
108
109
8494b010 110 virtual void Paint(Option_t *) {}
111 virtual void ResetDigits() {}
2ab0c725 112 virtual void ResetSDigits() {}
8494b010 113 virtual void ResetHits() {}
114 virtual void ResetPoints() {}
2cad796f 115 virtual void SetTreeAddress();
8494b010 116 virtual void SetTimeGate(Float_t) {}
94de3818 117 virtual Float_t GetTimeGate() const {return 1.e10;}
8494b010 118 virtual void StepManager() {}
3f754d83 119 virtual void DisableStepManager() {fEnable = kFALSE;}
116cbefd 120 virtual Bool_t StepManagerIsEnabled() const {return fEnable;}
8918e700 121 virtual void SetBufferSize(Int_t) {}
65fb704d 122 virtual Float_t ZMin() const;
123 virtual Float_t ZMax() const;
aee8290b 124 virtual void SetEuclidFile(char *material,char *geometry=0);
88cb7938 125 virtual void ReadEuclid(const char *filnam, char *topvol);
126 virtual void ReadEuclidMedia(const char *filnam);
2cad796f 127// Track reference related
128 TClonesArray *TrackReferences() const {return fTrackReferences;}
129 virtual void RemapTrackHitIDs(Int_t *) {}
130 virtual void RemapTrackReferencesIDs(Int_t *map); //remaping track references MI
131 virtual void ResetTrackReferences();
88cb7938 132 virtual void AddTrackReference(Int_t label);
2cad796f 133 virtual AliTrackReference * FirstTrackReference(Int_t track);
134 virtual AliTrackReference * NextTrackReference();
88cb7938 135 virtual void MakeBranchTR(Option_t *opt=" ");
136 TTree* TreeTR(); //shorcut method for accessing treeTR from folder
2cad796f 137
138//
e2afb3b6 139 AliModule& operator=(const AliModule &mod)
140 {mod.Copy(*this); return (*this);}
8494b010 141
aee8290b 142protected:
e2afb3b6 143 void Copy(AliModule &mod) const;
144
aee8290b 145 // Data members
146
2ab0c725 147 TString fEuclidMaterial; //!Name of the Euclid file for materials (if any)
148 TString fEuclidGeometry; //!Name of the Euclid file for geometry (if any)
aee8290b 149
2ab0c725 150 TArrayI *fIdtmed; //!List of tracking medium numbers
151 TArrayI *fIdmate; //!List of material numbers
152 Int_t fLoMedium; //!Minimum tracking medium ID for this Module
153 Int_t fHiMedium; //!Maximum tracking medium ID for this Module
aee8290b 154
155 Bool_t fActive; //Detector activity flag
156 TList *fHistograms; //List of histograms
157 TList *fNodes; //List of geometry nodes
65fb704d 158 Int_t fDebug; //Debug flag
3f754d83 159 Bool_t fEnable; //StepManager enabling flag
2388c363 160 TClonesArray *fTrackReferences; //!list of track references - for one primary track only -MI
2cad796f 161 Int_t fMaxIterTrackRef; //!for track refernce iterator routines
162 Int_t fCurrentIterTrackRef; //!for track refernce iterator routines
88cb7938 163 ClassDef(AliModule,4) //Base class for ALICE Modules
8494b010 164};
165#endif