Add tools in RichMenu
[u/mrichter/AliRoot.git] / RICH / AliRICH.h
CommitLineData
2f614988 1#ifndef AliRICH_h
2#define AliRICH_h
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
0fe8fa07 6#include <AliDetector.h>
853634d3 7#include <TClonesArray.h>
1c349ae5 8#include <TObjArray.h>
9#include <TVector.h>
d4c94996 10#include <TVector3.h>
1c349ae5 11
3582c1f9 12#include "AliRICHDigitizer.h"
cb8189e7 13#include "AliRICHParam.h"
0fe8fa07 14#include "AliRICHCluster.h"
15#include "AliRICHHit.h"
d4c94996 16
c021cb15 17//__________________AliRICH_________________________________________________________________________
e42a7b46 18class AliESD;
3ea9cb08 19
2f614988 20class AliRICH : public AliDetector
21{
2f614988 22public:
a25b3368 23//ctor & dtor
853634d3 24 AliRICH();
af3d25a6 25 AliRICH(const char *name, const char *title);
d4c94996 26 AliRICH(const AliRICH& RICH):AliDetector(RICH) {;} //copy ctor
853634d3 27 virtual ~AliRICH();
dfb4e77d 28
942194a4 29 AliRICH& operator=(const AliRICH&) {return *this;}
d4c94996 30//framework part
e42a7b46 31 virtual Int_t IsVersion() const =0; //interface from
32 virtual void StepManager() =0; //interface from AliMC
33 virtual void Hits2SDigits(); //interface from AliSimulation
d3eb6079 34 virtual void Digits2Raw(); //interface from AliSimulation
e42a7b46 35 virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* man) const {return new AliRICHDigitizer(man);} //interface from AliSimulation
e42a7b46 36 virtual void SetTreeAddress(); //interface from AliLoader
37 virtual void MakeBranch(Option_t *opt=" "); //interface from AliLoader
38 virtual void CreateMaterials(); //interface from AliMC
39 virtual void CreateGeometry(); //interface from AliMC
0fe8fa07 40 virtual void BuildGeometry(); //interface
41 virtual void Print(Option_t *option="") const; //prints current RICH status
42//private part
d3eb6079 43 void GeomPadPanelFrame()const; //defines PPF geometry
44 void GeomAmpGap() const; //defines gap geometry + anod wires
45 void GeomRadiators() const; //defines radiators geometry
46 void GeomSandBox() const; //defines sandbox geometry
47 void GeomRadioSrc() const; //defines radio source geometry
48 void GeomAerogel() const; //defines aerogel geometry
a25b3368 49 static Float_t Fresnel(Float_t ene,Float_t pdoti, Bool_t pola); //deals with Fresnel absorption
0fe8fa07 50
51 AliRICHHit* Hit (Int_t tid )const; //first hit of given TID
52 inline void HitAdd (Int_t c,Int_t tid,TVector3 in,TVector3 out,Double_t e=0); //add new hit
53 inline void HitsCreate ( ); //create hits container
54 void HitsPrint (Int_t iEvent=0 )const; //prints hits
55
56 TClonesArray* SDigits ( )const{return fSdigits;} //pointer to sdigits list
57 inline void SDigitAdd (Int_t c,TVector pad,Double_t q,Int_t pid,Int_t tid ) ; //add new sdigit
58 inline void SDigitsCreate ( ) ; //create sdigits container
59 void SDigitsReset ( ) {fNsdigits=0; if(fSdigits) fSdigits ->Clear();} //clean a list of sdigits
60 void SDigitsPrint (Int_t iEvent=0 )const; //prints sdigits
61
62 using AliDetector::Digits;
63 TClonesArray* Digits (Int_t iC )const{return fDigs ? (TClonesArray *)fDigs->At(iC-1):0;}
64 inline void DigitAdd (Int_t c,TVector pad,int q,int cfm,int *tid ) ; //add new digit
65 inline void DigitsCreate ( ) ; //create digits
66 void DigitsReset ( ) {if(fDigs)for(int i=0;i<kNchambers;i++){fDigs->At(i)->Clear();fNdigs[i]=0;}} //virtual
67 void DigitsPrint (Int_t iEvent=0 )const; //prints digits
68
69 TClonesArray* Clusters (Int_t iC )const{if(fClus) return (TClonesArray *)fClus->At(iC-1);else return 0;}
70 inline void ClusterAdd (AliRICHCluster &cl ) ; //add new cluster
71 inline void ClustersCreate( ) ; //create clusters container
72 void ClustersReset ( ) {if(fClus)for(int i=0;i<kNchambers;i++){fClus ->At(i)->Clear();fNclus[i]=0;}}
73 void ClustersPrint (Int_t iEvent=0 )const; //prints a list of clusters for a given event
c23b3bc0 74
75 void OccupancyPrint(Int_t iEvent=0 )const;
0fe8fa07 76
77 AliRICHChamber* C(Int_t iC) const{return fParam->C(iC);} //provides pointer to a given chamber
78 AliRICHParam* P() const{return fParam;} //provides pointer to a RICH params
a25b3368 79 AliRICH* R() {return this;} //provides pointer to RICH main object
80 TVector Counters() const{return fCounters;} //provides a set of counters
81 void ControlPlots(); //creates ~/RCP.root with a set of QA plots
0fe8fa07 82 void Display()const; //Display event
83 void DisplayEvent(Int_t,Int_t)const; //Display event
84 static Int_t Nparticles(Int_t iPid,Int_t iEventN,AliRunLoader *pRunLoader); //counts total number of particle with iPid
a25b3368 85 void PrintTracks (Int_t iEvent=0); //prints a list of tracks for a given event
d3eb6079 86 void CheckPR ()const; //utility-> run staff for stack ??????
56030c8d 87 void ReadESD(Int_t iEventN, Int_t iChamber)const;
88 void DrawRing(TVector3 entrance,TVector3 vectorTrack,Double_t thetaCer)const;
89
c60862bf 90protected:
d3eb6079 91 enum EMedia {kAir=1,kRoha,kSiO2,kC6F14,kCH4,kCsI,kGridCu,kOpSiO2,kGap,kAl,kGlass,kCu,kW,kSteel,kPerpex,kSr90,kMylar,kGel,kReflector};
a25b3368 92 enum ECounters {kStepManager=0,kCerProdTot,kCerProdRad,kCerKillTot,kCerKillRad,kCerKillRef,kEleProdTot};
0fe8fa07 93 AliRICHParam *fParam; //main RICH parametrization
a25b3368 94 //fHits and fDigits belong to AliDetector
95 TClonesArray *fSdigits; //! list of sdigits
96 Int_t fNsdigits; //! current number of sdigits
84365c70 97
0fe8fa07 98 TObjArray *fDigs; //! each chamber holds it's one lists of digits
99 Int_t fNdigs[7]; //! array of current numbers of digits
84365c70 100
0fe8fa07 101 TObjArray *fClus; //! each chamber holds it's one lists of clusters
102 Int_t fNclus[7]; //! array of current numbers of raw clusters
84365c70 103
a25b3368 104 TVector fCounters; //Particle history counters, explanation in StepManager()
105
0fe8fa07 106 ClassDef(AliRICH,9) //Main RICH class
c60862bf 107};//class AliRICH
ed3ceb24 108
c1863e3c 109//__________________________________________________________________________________________________
0fe8fa07 110void AliRICH::HitsCreate()
c60862bf 111{
112 if(fHits) return;
998b831f 113 AliDebug(1,"creating hits container.");
0fe8fa07 114 fHits=new TClonesArray("AliRICHHit",10000); fNhits=0;
543d5224 115}
c60862bf 116//__________________________________________________________________________________________________
0fe8fa07 117void AliRICH::HitAdd(Int_t c,Int_t tid,TVector3 i3,TVector3 o3,Double_t eloss)
a25b3368 118{
119//add new RICH hit to the list of hits
120 TClonesArray &tmp=*fHits;
0fe8fa07 121 new(tmp[fNhits++])AliRICHHit(c,tid,i3,o3,eloss);
a25b3368 122}//AddHit()
123//__________________________________________________________________________________________________
0fe8fa07 124void AliRICH::SDigitsCreate()
125{
126 if(fSdigits) return;
127 AliDebug(1,"creating sdigits container.");
128 fSdigits=new TClonesArray("AliRICHDigit",10000); fNsdigits=0;
129}
130//__________________________________________________________________________________________________
131void AliRICH::SDigitAdd(Int_t c,TVector pad,Double_t q,Int_t pid,Int_t tid)
e42a7b46 132{
133 Int_t cfm;
ed3ceb24 134 switch(pid){
e42a7b46 135 case 50000050: cfm=1000000;break;//cerenkov
136 case 50000051: cfm=1000; break;//feedback
137 default: cfm=1; break;//mip
ed3ceb24 138 }
0fe8fa07 139 TClonesArray &tmp=*fSdigits; new(tmp[fNsdigits++])AliRICHDigit(c,pad,q,cfm,tid,-1,-1);
e42a7b46 140}
d4c94996 141//__________________________________________________________________________________________________
0fe8fa07 142void AliRICH::DigitsCreate()
a25b3368 143{
0fe8fa07 144 if(fDigs) return;
145 AliDebug(1,"creating digits containers.");
146 fDigs = new TObjArray(kNchambers);
147 for(Int_t i=0;i<kNchambers;i++) {fDigs->AddAt(new TClonesArray("AliRICHDigit",10000), i); fNdigs[i]=0;}
148}
149//__________________________________________________________________________________________________
150void AliRICH::DigitAdd(int c,TVector pad,int q,int cfm,int *tid)
151{
152 TClonesArray &tmp=*((TClonesArray*)fDigs->At(c-1));
153 new(tmp[fNdigs[c-1]++])AliRICHDigit(c,pad,q,cfm,tid[0],tid[1],tid[2]);
a25b3368 154}
155//__________________________________________________________________________________________________
0fe8fa07 156void AliRICH::ClustersCreate()
157{
158 if(fClus) return;
159 AliDebug(1,"creating clusters containers.");
160 fClus = new TObjArray(kNchambers);
161 for(Int_t i=0;i<kNchambers;i++) {fClus->AddAt(new TClonesArray("AliRICHCluster",10000), i); fNclus[i]=0;}
162}
163//__________________________________________________________________________________________________
164void AliRICH::ClusterAdd(AliRICHCluster &cl)
a25b3368 165{
0fe8fa07 166 Int_t c=cl.C()-1;TClonesArray &tmp=*((TClonesArray*)fClus->At(c));
167 new(tmp[fNclus[c]++])AliRICHCluster(cl);
a25b3368 168}
0fe8fa07 169//__________________________________________________________________________________________________
c60862bf 170#endif//#ifndef AliRICH_h