Transition to NewIO
[u/mrichter/AliRoot.git] / RICH / AliRICH.h
CommitLineData
2f614988 1#ifndef AliRICH_h
2#define AliRICH_h
2e5f0f7b 3
3da30618 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
2e5f0f7b 9
fe4da5cc 10////////////////////////////////////////////////
11// Manager and hits classes for set:RICH //
12////////////////////////////////////////////////
c11ee6f0 13
14#include <TObjArray.h>
15#include <AliDetector.h>
16#include <AliRICHConst.h>
17#include <AliRICHChamber.h>
237c933d 18static const int kNCH=7;
fe4da5cc 19
2ab0c725 20class TFile;
fe4da5cc 21
237c933d 22class AliRICHHit;
b251a2b5 23class AliRICHSDigit;
2e5f0f7b 24class AliRICHRawCluster;
a4622d0f 25class AliRICHRecHit1D;
26class AliRICHRecHit3D;
2e5f0f7b 27class AliRICHClusterFinder;
28class AliRICHDetect;
29class AliRICHChamber;
30class AliRICHCerenkov;
a2f7eaf6 31class AliSegmentation;
2e5f0f7b 32class AliRICHResponse;
237c933d 33class AliRICHGeometry;
d8a72780 34class AliRICHMerger;
ddae0931 35
2f614988 36class AliRICH : public AliDetector
37{
38
c11ee6f0 39enum EDebugBits {kDebugStart=BIT(0),kDebugParam=BIT(1),kDebugHit=BIT(2),kDebugDigit=BIT(3),kDebugReco=BIT(4)}; // Debug flags
2f614988 40
41public:
c11ee6f0 42 AliRICH(); // default ctor
43 AliRICH(const char *name, const char *title); // named ctor
44 AliRICH(const AliRICH& RICH); // copy ctor
45 virtual ~AliRICH(); // dtor
46// Pure vituls methods
47 virtual Int_t IsVersion() const =0;
48// The following staff is defined in AliRICHChamber.cxx
49 virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
50 virtual void AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs);
51 virtual void AddSDigit(Int_t *clhits);
52 virtual void AddDigits(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits);
53 virtual void AddRawCluster(Int_t id, const AliRICHRawCluster& cluster);
54 virtual void AddRecHit1D(Int_t id, Float_t* rechit, Float_t* photons, Int_t* padsx, Int_t* padsy);
fb498b56 55 virtual void AddRecHit3D(Int_t id, Float_t* rechit, Float_t omega, Float_t theta, Float_t phi);
c11ee6f0 56
57 virtual void BuildGeometry(); // TNode ROOT variant for event display
58 virtual void CreateGeometry(); // GEANT volumes tree for simulation
59 virtual void CreateMaterials(); // GEANT materials definition
60 virtual Float_t AbsoCH4(Float_t x);
61 virtual Float_t Fresnel(Float_t ene,Float_t pdoti, Bool_t pola);
62 virtual void StepManager();
63 Int_t DistancetoPrimitive(Int_t px, Int_t py);
88cb7938 64 virtual void MakeBranch(Option_t *opt=" ");
c11ee6f0 65 virtual void MakeBranchInTreeD(TTree *treeD, const char *file=0);
66 void SetTreeAddress();
67 virtual void ResetHits();
68 virtual void ResetDigits();
69 virtual void ResetRawClusters();
70 virtual void ResetRecHits1D();
71 virtual void ResetRecHits3D();
72 virtual void FindClusters(Int_t nev,Int_t lastEntry);
2f614988 73// Converters
74 virtual void Hits2SDigits();
c11ee6f0 75 virtual Int_t Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss,Int_t id, ResponseType res);
2f614988 76 virtual void SDigits2Digits();
77 virtual void SDigits2Digits(Int_t nev, Int_t flag);
78 virtual void Digits2Reco();
c11ee6f0 79// Retrieve pad hits for a given Hit
80 virtual AliRICHSDigit* FirstPad(AliRICHHit *hit, TClonesArray *clusters);
81 virtual AliRICHSDigit* NextPad(TClonesArray *clusters);
82// inline methods
83 TClonesArray *SDigits() const{return fSDigits;}
84 TClonesArray *Cerenkovs() const{return fCerenkovs;}
2f614988 85
86// Models for chambers
c11ee6f0 87 virtual void SetGeometryModel(Int_t iChamberN, AliRICHGeometry *pRICHGeo) { GetChamber(iChamberN)->SetGeometryModel(pRICHGeo);}
88 AliRICHGeometry* GetGeometryModel(Int_t iChamberN=0) const{return GetChamber(iChamberN)->GetGeometryModel();}
2f614988 89
c11ee6f0 90 virtual void SetSegmentationModel(Int_t iChamberN, AliSegmentation *pAliSeg) { GetChamber(iChamberN)->SetSegmentationModel(pAliSeg);}
91 AliSegmentation* GetSegmentationModel(Int_t iChamberN=0) const{return GetChamber(iChamberN)->GetSegmentationModel();}
2f614988 92
c11ee6f0 93 virtual void SetResponseModel(Int_t iChamberN, AliRICHResponse *pRICHRes) { GetChamber(iChamberN)->SetResponseModel(pRICHRes);}
94 AliRICHResponse* GetResponseModel(Int_t iChamberN) const{return GetChamber(iChamberN)->GetResponseModel();}
2f614988 95
c11ee6f0 96 virtual void SetReconstructionModel(Int_t iChamberN, AliRICHClusterFinder *pRICHReco){GetChamber(iChamberN)->SetReconstructionModel(pRICHReco);}
2f614988 97// Debug staff
98 void SetDebugLevel(Int_t level) {fDebugLevel=level;}
99 Int_t GetDebugLevel() const{return fDebugLevel;}
100
101 void SetDebugStart() {fDebugLevel+=kDebugStart;} // Controls debug message at the entring point of methods
102 void ResetDebugStart() {fDebugLevel-=kDebugStart;} // Controls debug message at the entring point of methods
103 Bool_t IsDebugStart()const{return fDebugLevel&kDebugStart;} // Controls debug message at the entring point of methods
104
105 void SetDebugParam() {fDebugLevel+=kDebugParam;} // Controls debug printout for the parameters
106 void ResetDebugParam() {fDebugLevel-=kDebugParam;} // Controls debug printout for the parameters
107 Bool_t IsDebugParam()const{return fDebugLevel&kDebugParam;} // Controls debug printout for the parameters
108
109 void SetDebugHit() {fDebugLevel+=kDebugHit;} // Controls debug printout for hits
110 void ResetDebugHit() {fDebugLevel-=kDebugHit;} // Controls debug printout for hits
111 Bool_t IsDebugHit() const{return fDebugLevel&kDebugHit;} // Controls debug printout for hits
112
113 void SetDebugDigit() {fDebugLevel+=kDebugDigit;} // Controls debug printout for digits
114 void ResetDebugDigit() {fDebugLevel-=kDebugDigit;} // Controls debug printout for digits
115 Bool_t IsDebugDigit()const{return fDebugLevel&kDebugDigit;} // Controls debug printout for digits
116
117 void SetDebugReco() {fDebugLevel+=kDebugReco;} // Controls debug printout for reco
118 void ResetDebugReco() {fDebugLevel-=kDebugReco;} // Controls debug printout for reco
119 Bool_t IsDebugReco() const{return fDebugLevel&kDebugReco;} // Controls debug printout for reco
120
c11ee6f0 121
d8a72780 122 virtual void SetMerger(AliRICHMerger* thisMerger) {fMerger=thisMerger;}
ddae0931 123// Return reference to Chamber #id
34ead2dd 124 virtual AliRICHChamber& Chamber(Int_t id) {return *((AliRICHChamber *) (*fChambers)[id]);}
c11ee6f0 125 AliRICHChamber* GetChamber(Int_t iChamberN) const{return (AliRICHChamber*) (*fChambers)[iChamberN];}
ddae0931 126// Return pointers to digits
34ead2dd 127 TObjArray *Dchambers() {return fDchambers;}
128 Int_t *Ndch() {return fNdch;}
ddae0931 129 virtual TClonesArray *DigitsAddress(Int_t id) {return ((TClonesArray *) (*fDchambers)[id]);}
2e5f0f7b 130// Return pointers to rec. hits
c11ee6f0 131 TObjArray *RecHits1D() const{return fRecHits1D;}
132 Int_t *Nrechits1D() {return fNrechits1D;} // returns array
133 Int_t *Nrechits3D() {return fNrechits3D;} // returns array
134 virtual TClonesArray *RecHitsAddress1D(Int_t id) const{return ((TClonesArray *) (*fRecHits1D)[id]);}
135 TObjArray *RecHits3D() const{return fRecHits3D;}
136 virtual TClonesArray *RecHitsAddress3D(Int_t id) const{return ((TClonesArray *) (*fRecHits3D)[id]);}
137 virtual TClonesArray *RawClustAddress(Int_t id) const{return ((TClonesArray *) (*fRawClusters)[id]);}
237c933d 138// Assignment operator
c11ee6f0 139 AliRICH& operator=(const AliRICH& rhs);
52042918 140
c11ee6f0 141 virtual void DiagnosticsFE(Int_t evNumber1=0,Int_t evNumber2=0); // Full events
142 virtual void DiagnosticsSE(Int_t diaglevel,Int_t evNumber1=0,Int_t evNumber2=0); // Single events
143
144 inline virtual void Print(Option_t *option)const; // Prints debug information
2f614988 145
146protected:
88cb7938 147 TObjArray *fChambers; // !List of RICH chambers aka modules
c11ee6f0 148 Int_t fNSDigits; // Number of clusters
149 Int_t fNcerenkovs; // Number of cerenkovs
88cb7938 150 TClonesArray *fSDigits; // !List of clusters
151 TObjArray *fDchambers; // !List of digits
152 TClonesArray *fCerenkovs; // !List of cerenkovs
c11ee6f0 153 Int_t fNdch[kNCH]; // Number of digits
88cb7938 154 TObjArray *fRawClusters; // !List of raw clusters
155 TObjArray *fRecHits1D; // !List of rec. hits
156 TObjArray *fRecHits3D; // !List of rec. hits
c11ee6f0 157 Int_t fNrawch[kNCH]; // Number of raw clusters
158 Int_t fNrechits1D[kNCH]; // Number of rec hits
159 Int_t fNrechits3D[kNCH]; // Number of rec hits
160 Int_t fDebugLevel; // Source debugging level
161
162 Int_t fCkovNumber; // Number of Cerenkov photons
163 Int_t fCkovQuarz; // Cerenkovs crossing quartz
164 Int_t fCkovGap; // Cerenkovs crossing gap
165 Int_t fCkovCsi; // Cerenkovs crossing csi
166 Int_t fLostRfreo; // Cerenkovs reflected in freon
167 Int_t fLostRquar; // Cerenkovs reflected in quartz
168 Int_t fLostAfreo; // Cerenkovs absorbed in freon
169 Int_t fLostAquarz; // Cerenkovs absorbed in quartz
170 Int_t fLostAmeta; // Cerenkovs absorbed in methane
171 Int_t fLostCsi; // Cerenkovs below csi quantum efficiency
172 Int_t fLostWires; // Cerenkovs lost in wires
173 Int_t fFreonProd; // Cerenkovs produced in freon
174 Float_t fMipx; // x coord. of MIP
175 Float_t fMipy; // y coord. of MIP
176 Int_t fFeedbacks; // Number of feedback photons
177 Int_t fLostFresnel; // Cerenkovs lost by Fresnel reflection
d8a72780 178
179
2f614988 180// Background event for event mixing
181 Text_t *fFileName; //! File with background hits
182 AliRICHMerger *fMerger; //! pointer to merger
ddae0931 183
88cb7938 184 ClassDef(AliRICH,2) // Main RICH class
c11ee6f0 185};//class AliRICH
2f614988 186
187inline void AliRICH::Print(Option_t *option)const
188{
c11ee6f0 189 TObject::Print(option);
2f614988 190 if(IsDebugParam()){
c11ee6f0 191 GetGeometryModel(0)->Print(option);
192 GetSegmentationModel(0)->Print(option);
193 GetResponseModel(0)->Print(option);
2f614988 194 }
195}//inline void AliRICH::Print(Option_t *option)const
fe4da5cc 196
2f614988 197#endif