-#ifndef RICH_H
-#define RICH_H
-////////////////////////////////////////////////
-// Manager and hits classes for set:RICH //
-////////////////////////////////////////////////
-
-#include "AliDetector.h"
-#include "AliHit.h"
+#ifndef AliRICH_h
+#define AliRICH_h
-class AliRICH : public AliDetector {
-
-protected:
- Int_t fNmips; //Number of mips in RICH
- Int_t fNckovs; //Number of cerenkovs in RICH
- Int_t fNpadhits; //Number of pad hits in RICH
-
- TClonesArray *fMips; //List of mips
- TClonesArray *fCkovs; //List of cerenkovs
- TClonesArray *fPadhits; //List of Padhits
-
- Float_t fChslope; //Charge slope
- Float_t fAlphaFeed; //Feed-back coefficient
- Float_t fSxcharge; //Charge slope along x
- Int_t fIritri; //Trigger flag
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
-public:
- AliRICH();
- AliRICH(const char *name, const char *title);
- virtual ~AliRICH();
- virtual void AddHit(Int_t, Int_t*, Float_t*);
- virtual void AddMipHit(Int_t, Int_t*, Float_t*);
- virtual void AddCkovHit(Int_t, Int_t*, Float_t*);
- virtual void AddPadHit(Int_t, Int_t*, Float_t*);
- virtual void BuildGeometry();
- virtual void CreateGeometry() {}
- virtual void CreateMaterials() {}
- Int_t DistancetoPrimitive(Int_t px, Int_t py);
- inline virtual int GetNmips() {return fNmips;}
- inline virtual int GetNckovs() {return fNckovs;}
- inline virtual int GetNpadhits() {return fNpadhits;}
- virtual Int_t IsVersion() const =0;
- virtual void Init();
- inline TClonesArray *Mips() {return fMips;}
- inline TClonesArray *Ckovs() {return fCkovs;}
- inline TClonesArray *Padhits() {return fPadhits;}
- void FinishEvent(void){;}
- virtual void MakeBranch(Option_t *);
- void SetTreeAddress(void);
- virtual void StepManager();
- virtual void PreTrack();
-
- virtual void SetSP(Float_t chslope){ fChslope=chslope;}
- virtual void SetFEED(Float_t alphafeed){fAlphaFeed=alphafeed;}
- virtual void SetSIGM(Float_t sxcharge){fSxcharge=sxcharge;}
- virtual void SetTRIG(Int_t iritri) {fIritri=iritri;}
- virtual void ResetHits();
- virtual void UpdateMipHit(Float_t*);
- virtual void RichIntegration();
- virtual void AnodicWires(Float_t &);
- virtual void GetChargeMip(Float_t &);
- virtual void GetCharge(Float_t &);
- virtual void FeedBack(Float_t *, Float_t );
- virtual Float_t FMathieson(Float_t , Float_t );
-
- ClassDef(AliRICH,1) // Base class for RICH
-};
+/* $Id$ */
-class AliRICHv1 : public AliRICH {
-
-public:
- AliRICHv1();
- AliRICHv1(const char *name, const char *title);
- virtual ~AliRICHv1();
- virtual void CreateGeometry();
- virtual void CreateMaterials();
- virtual Int_t IsVersion() const {return 1;}
- virtual void DrawModule();
-
-
- ClassDef(AliRICHv1,1) // RICH version 1
-};
-//_____________________________________________________________________________
-class AliRICHhit: public AliHit {
-public:
- Int_t fVolume[2]; //array of volumes
-
- //Pad informations
- Int_t fFirstpad; //First index in padhits
- Int_t fLastpad; //Last index in padhits
-
- //Hit information
- Int_t fModule; //Module number
- Float_t fTheta; //Theta of the particle generating the hit
-
- Float_t fArrivaltime;// Time of hit.
- Int_t fPart; //Particle type
-
- // we don't know what is this for :
- Int_t fFeed; //Type of feedback (origin of charge deposition)
-
-public:
- AliRICHhit() {}
- AliRICHhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits,
- Int_t fNpadhits);
- virtual ~AliRICHhit(){}
-
- void SetLastpad(Int_t lastpad){fLastpad=lastpad;}
-
- ClassDef(AliRICHhit,1) // Hits for set RICH
-};
+#include <TObjArray.h>
+#include <TClonesArray.h>
+#include <AliDetector.h>
+#include <AliHit.h>
+#include <AliDigit.h>
+#include "AliRICHConst.h"
+#include "AliRICHChamber.h"
+
+static const int kNCH=7;
+
+class TFile;
+
+class AliRICHSDigit;
+class AliRICHRawCluster;
+class AliRICHRecHit1D;
+class AliRICHRecHit3D;
+class AliRICHClusterFinder;
+class AliRICHDetect;
+class AliRICHChamber;
+class AliRICHCerenkov;
+class AliSegmentation;
+class AliRICHResponse;
+class AliRICHGeometry;
+class AliRICHMerger;
-//_____________________________________________________________________________
-class AliRICHmip: public AliRICHhit
+
+
+class AliRICHhit : public AliHit
{
public:
- // Hit information keep
- Float_t fPhi; //Phi of the particle generating the hit
- Float_t fPs; //Momentum of the particle generating the hit
- Float_t fQ; //Charge of the particle
-
- // Generated cerenkov information (Z of generation stored in fZ of AliHit)
- Int_t fFirstCkov; //Index in the ckov TcloneArray of the first generated
- Int_t fLastCkov; //Here the last.
-
-public:
- AliRICHmip() {}
- AliRICHmip(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits,
- Int_t fNckovs, Int_t fNpadhits);
- virtual ~AliRICHmip() {}
-
- Float_t GetZ() { return fZ;}
- void SetX(Float_t x) { fX = x; }
- void SetY(Float_t y) { fY = y; }
- void SetZ(Float_t z) { fZ = z; }
- void SetLastCkov(Int_t last){ fLastCkov = last; }
- void SetModule(Int_t module){ fModule = module;}
- void SetTheta(Float_t theta){ fTheta = theta; }
- void SetPhi(Float_t phi) { fPhi = phi; }
-
- ClassDef(AliRICHmip,1) //Mip hits for RICH
-};
-
-//_____________________________________________________________________________
-class AliRICHckov: public AliRICHhit
+ inline AliRICHhit();
+ inline AliRICHhit(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *hits);
+ virtual ~AliRICHhit() {;}
+
+ Int_t Chamber() {return fChamber;}
+ Float_t Particle() {return fParticle;}
+ Float_t Theta() {return fTheta;}
+ Float_t Phi() {return fPhi;}
+ Float_t Tlength() {return fTlength;}
+ Float_t Eloss() {return fEloss;}
+ Float_t Loss() {return fLoss;}
+ Float_t PHfirst() {return fPHfirst;}
+ Float_t PHlast() {return fPHlast;}
+ Float_t MomX() {return fMomX;}
+ Float_t MomY() {return fMomY;}
+ Float_t MomZ() {return fMomZ;}
+ Float_t CerenkovAngle() {return fMomX;}
+ Float_t MomFreoX() {return fMomX;}
+ Float_t MomFreoY() {return fMomY;}
+ Float_t MomFreoZ() {return fMomZ;}
+protected:
+ Int_t fChamber; // Chamber number
+ Float_t fParticle; // Geant3 particle type
+ Float_t fTheta ; // Incident theta angle in degrees
+ Float_t fPhi ; // Incident phi angle in degrees
+ Float_t fTlength; // Track length inside the chamber
+ Float_t fEloss; // ionisation energy loss in gas
+ Float_t fPHfirst; // first padhit
+ Float_t fPHlast; // last padhit
+ Float_t fLoss; // did it hit the freon?
+ Float_t fMomX; // x Momentum at photochatode entry point
+ Float_t fMomY; // y Momentum at photochatode entry point
+ Float_t fMomZ; // z Momentum at photochatode entry point
+ Float_t fNPads; // Pads hit
+ Float_t fCerenkovAngle; // Dummy cerenkov angle
+ Float_t fMomFreoX; // x Momentum at freon entry point
+ Float_t fMomFreoY; // y Momentum at freon entry point
+ Float_t fMomFreoZ; // z Momentum at freon entry point
+
+ ClassDef(AliRICHhit,1) //RICH hit class
+};//class AliRICHhit
+//______________________________________________________________________________
+AliRICHhit::AliRICHhit()
+ :AliHit()
+{//default ctor
+ fChamber=-1;
+ fParticle=fTheta=fPhi=fTlength=fEloss=fPHfirst=fPHlast=fLoss=-1;
+ fMomX=fMomY=fMomZ=fNPads=fCerenkovAngle=fMomFreoX=fMomFreoY=fMomFreoZ=-1;
+}//AliRICHhit::default ctor
+//______________________________________________________________________________
+AliRICHhit::AliRICHhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
+ AliHit(shunt, track)
+{//ctor
+ fChamber=vol[0];
+ fParticle=hits[0];
+ fX=hits[1];
+ fY=hits[2];
+ fZ=hits[3];
+ fTheta=hits[4];
+ fPhi=hits[5];
+ fTlength=hits[6];
+ fEloss=hits[7];
+ fPHfirst=(Int_t) hits[8];
+ fPHlast=(Int_t) hits[9];
+ fLoss=hits[13];
+ fMomX=hits[14];
+ fMomY=hits[15];
+ fMomZ=hits[16];
+ fNPads=hits[17];
+ fCerenkovAngle=hits[18];
+ fMomFreoX=hits[19];
+ fMomFreoY=hits[20];
+ fMomFreoZ=hits[21];
+}//AliRICHhit::ctor
+//______________________________________________________________________________
+//______________________________________________________________________________
+//______________________________________________________________________________
+class AliRICHCerenkov: public AliHit
{
public:
- // Hit information keep
- Float_t fEnergy; //Photon energy
- Int_t fStop; //Stop mechanism (cut, threshold, ...)
-
- //Parent info
- Int_t fParent; //Index in array of mips of parent which generatethis
+ inline AliRICHCerenkov();
+ inline AliRICHCerenkov(Int_t fIshunt, Int_t track, Int_t *vol, Float_t *Cerenkovs);
+ virtual ~AliRICHCerenkov() {;}
public:
- AliRICHckov() {}
- AliRICHckov(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits,
- Int_t fNmips, Int_t fNpadhits);
- virtual ~AliRICHckov() {}
-
- ClassDef(AliRICHckov,1) //Cerenkov hits for RICH
-};
-
-//_____________________________________________________________________________
-class AliRICHpadhit: public AliHit
+ Int_t fChamber; // Chamber number
+ Float_t fTheta ; // Incident theta angle in degrees
+ Float_t fPhi ; // Incident phi angle in degrees
+ Float_t fTlength; // Track length inside the chamber
+ Float_t fEloss; // ionisation energy loss in gas
+ Int_t fPHfirst; // first padhit
+ Int_t fPHlast; // last padhit
+ Int_t fCMother; // index of mother particle
+ Float_t fLoss; // nature of particle loss
+ Float_t fIndex; // Index of photon
+ Float_t fProduction; // Point of production
+ Float_t fMomX; // Local Momentum
+ Float_t fMomY; // Local Momentum
+ Float_t fMomZ; // Local Momentum
+ Float_t fNPads; // Pads hit
+ Float_t fCerenkovAngle; // Cerenkov Angle
+
+ ClassDef(AliRICHCerenkov,1) //RICH cerenkov class
+};//class AliRICHCerenkov
+//______________________________________________________________________________
+AliRICHCerenkov::AliRICHCerenkov()
+{//ctor
+ fChamber=-1;
+ fX=fY=fZ=fTheta=fPhi=fTlength=fEloss=-1;
+ fPHfirst=fPHlast=fCMother=-1;
+ fLoss=fIndex=fProduction=fMomX=fMomY=fMomZ=fNPads=fCerenkovAngle=-1;
+}//AliRICHCerenkov::ctor
+//______________________________________________________________________________
+AliRICHCerenkov::AliRICHCerenkov(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
+ :AliHit(shunt, track)
+{//ctor
+ fChamber=vol[0];
+ fX=hits[1];
+ fY=hits[2];
+ fZ=hits[3];
+ fTheta=hits[4];
+ fPhi=hits[5];
+ fTlength=hits[6];
+ fEloss=hits[7];
+ fPHfirst=(Int_t) hits[8];
+ fPHlast=(Int_t) hits[9];
+ fCMother=Int_t(hits[10]);
+ fIndex = hits[11];
+ fProduction = hits[12];
+ fLoss=hits[13];
+ fMomX=hits[14];
+ fMomY=hits[15];
+ fMomZ=hits[16];
+ fNPads=hits[17];
+ fCerenkovAngle=hits[18];
+}//AliRICHCerenkov::ctor
+//______________________________________________________________________________
+//______________________________________________________________________________
+//______________________________________________________________________________
+class AliRICHdigit :public AliDigit
{
public:
- Int_t fVolume[2]; //array of volumes
-
- // Hit information
- Int_t fX; //Integer x position in pad
- Int_t fY; //Integer y position in pad
- Int_t fModule; //Module number
- // Particle info
- Int_t fParentMip; //Parent particle
- Int_t fParentCkov; //Parent CKOV
- // physics info
- Int_t fProd; //Production mechanism
- Float_t fCharge; //Charge deposited
-
+ AliRICHdigit() {fPadX=fPadY=fChamber=fAdc=fTracks[0]=fTracks[1]=fTracks[2]=-1;}
+ inline AliRICHdigit(Int_t iC,Int_t iX,Int_t iY,Int_t iAdc,Int_t iT1,Int_t iT2,Int_t iT3);
+ virtual ~AliRICHdigit() {;}
+ Int_t C() const{return fChamber;}
+ Int_t X() const{return fPadX;}
+ Int_t Y() const{return fPadY;}
+ Int_t Adc() const{return fAdc;}
+protected:
+ Int_t fChamber; //module number
+ Int_t fPadX; //pad number along X
+ Int_t fPadY; //pad number along Y
+ Int_t fAdc; //ADC value
+ ClassDef(AliRICHdigit,1) //RICH digit class
+};//class AliRICHdigit
+//______________________________________________________________________________
+AliRICHdigit::AliRICHdigit(Int_t iC,Int_t iX,Int_t iY,Int_t iAdc,Int_t iT0,Int_t iT1,Int_t iT2)
+{
+ fChamber=iC;fPadX=iX;fPadY=iY;fAdc=iAdc;
+ fTracks[0]=iT0;fTracks[1]=iT1;fTracks[2]=iT2;
+}//AliRICHdigit::ctor
+//______________________________________________________________________________
+//______________________________________________________________________________
+//______________________________________________________________________________
+class AliRICH : public AliDetector
+{
public:
- AliRICHpadhit(){}
- AliRICHpadhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits,
- Int_t fNmips,Int_t fNckovs);
- virtual ~AliRICHpadhit() {}
+ AliRICH();
+ AliRICH(const char *name, const char *title);
+ AliRICH(const AliRICH& RICH):AliDetector(RICH) {;}
+ virtual ~AliRICH();
+
+ AliRICH& operator=(const AliRICH&) {return *this;}
+ virtual Int_t IsVersion() const =0;
+
+ inline void AddHit(Int_t track, Int_t *vol, Float_t *hits);//virtual
+ inline void AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs);
+ inline void AddSDigit(Int_t iC,Int_t iX,Int_t iY,Int_t iAdc,Int_t iT0,Int_t iT1=-1,Int_t iT2=-1);
+ void AddDigits(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits);
+ void AddRawCluster(Int_t id, const AliRICHRawCluster& cluster);
+ void AddRecHit1D(Int_t id, Float_t* rechit, Float_t* photons, Int_t* padsx, Int_t* padsy);
+ void AddRecHit3D(Int_t id, Float_t* rechit, Float_t omega, Float_t theta, Float_t phi);
+ inline void ResetHits(); //virtual
+ inline void ResetSDigits(); //virtual
+ void ResetDigits(); //virtual
+ void ResetRawClusters();
+ void ResetRecHits1D();
+ void ResetRecHits3D();
+ virtual void FindClusters(Int_t nev);
+ void Hits2SDigits(); //virtual
+ void Hits2SDigits(Int_t iEventN);
+ void Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss,Int_t id, ResponseType res);
+ virtual void SDigits2Digits();
+ virtual void Digits2Reco();
+
+ virtual void CreateMaterials(); //GEANT materials definition
+ Float_t AbsoCH4(Float_t x);
+ Float_t Fresnel(Float_t ene,Float_t pdoti, Bool_t pola);
+ virtual void BuildGeometry(); //TNode ROOT variant for event display
+ virtual void CreateGeometry(); //GEANT volumes tree for simulation
+ virtual void StepManager()=0;
+
+ Int_t DistancetoPrimitive(Int_t /*px*/, Int_t /*py*/) {return 9999;}
+
+ virtual void MakeBranch(Option_t *opt=" ");
+ virtual void MakeBranchInTreeD(TTree *treeD, const char *file=0);
+ virtual void SetTreeAddress();
+
+
+
+ AliRICHSDigit* FirstPad(AliRICHhit *hit, TClonesArray *clusters);
+ AliRICHSDigit* NextPad(TClonesArray *clusters);
+
+
+ void SetGeometryModel(Int_t iChamberN, AliRICHGeometry *pRICHGeo) { GetChamber(iChamberN)->SetGeometryModel(pRICHGeo);}
+ AliRICHGeometry* GetGeometryModel(Int_t iChamberN=0) const{return GetChamber(iChamberN)->GetGeometryModel();}
+ void SetSegmentationModel(Int_t iChamberN, AliSegmentation *pAliSeg) { GetChamber(iChamberN)->SetSegmentationModel(pAliSeg);}
+ AliSegmentation* GetSegmentationModel(Int_t iChamberN=0) const{return GetChamber(iChamberN)->GetSegmentationModel();}
+ void SetResponseModel(Int_t iChamberN, AliRICHResponse *pRICHRes) { GetChamber(iChamberN)->SetResponseModel(pRICHRes);}
+ AliRICHResponse* GetResponseModel(Int_t iChamberN) const{return GetChamber(iChamberN)->GetResponseModel();}
+ void SetReconstructionModel(Int_t iChamberN, AliRICHClusterFinder *pRICHReco){GetChamber(iChamberN)->SetReconstructionModel(pRICHReco);}
+
+//kir virtual void SetMerger(AliRICHMerger* thisMerger) {fMerger=thisMerger;}
+ AliRICHChamber& Chamber(Int_t id) {return *((AliRICHChamber *) (*fChambers)[id]);}
+ AliRICHChamber* GetChamber(Int_t iChamberN) const{return (AliRICHChamber*) (*fChambers)[iChamberN];}
- ClassDef(AliRICHpadhit,1) //Pad hits for RICH
-};
+ TObjArray *Dchambers() {return fDchambers;}
+ TObjArray *RecHits3D() const{return fRecHits3D;}
+ TObjArray *RecHits1D() const{return fRecHits1D;}
+ Int_t *Ndch() {return fNdch;}
+ Int_t *Nrechits1D() {return fNrechits1D;}
+ Int_t *Nrechits3D() {return fNrechits3D;}
+ TClonesArray *SDigits() const{return fSDigits;}
+ TClonesArray *Cerenkovs() const{return fCerenkovs;}
+ TClonesArray *DigitsAddress(Int_t id) {return ((TClonesArray *) (*fDchambers)[id]);}
+ TClonesArray *RecHitsAddress1D(Int_t id) const{return ((TClonesArray *) (*fRecHits1D)[id]);}
+ TClonesArray *RecHitsAddress3D(Int_t id) const{return ((TClonesArray *) (*fRecHits3D)[id]);}
+ TClonesArray *RawClustAddress(Int_t id) const{return ((TClonesArray *) (*fRawClusters)[id]);}
-#endif
+ void DiagnosticsFE(Int_t evNumber1=0,Int_t evNumber2=0); // Full events
+ void DiagnosticsSE(Int_t diaglevel,Int_t evNumber1=0,Int_t evNumber2=0); // Single events
+
+ virtual void Print(Option_t *option)const; // Prints debug information
+
+protected:
+ TObjArray *fChambers; //! List of RICH chambers
+ Int_t fNsdigits; //Current number of sdigits
+ Int_t fNcerenkovs; //Current number of cerenkovs
+ TClonesArray *fSDigits; //! List of sdigits
+ TObjArray *fDchambers; //! Array of lists of digits
+ TClonesArray *fCerenkovs; //! List of cerenkovs
+ Int_t fNdch[kNCH]; //Array of current numbers of digits
+ TObjArray *fRawClusters; // !List of raw clusters
+ TObjArray *fRecHits1D; // !List of rec. hits
+ TObjArray *fRecHits3D; // !List of rec. hits
+ Int_t fNrawch[kNCH]; //Array of current numbers of raw clusters
+ Int_t fNrechits1D[kNCH]; //Array of current numbers of rec hits 1D
+ Int_t fNrechits3D[kNCH]; //Array of current numbers of rec hits 3D
+ Int_t fCkovNumber; // Number of Cerenkov photons
+ Int_t fFreonProd; // Cerenkovs produced in freon
+ Int_t fFeedbacks; // Number of feedback photons
+//kir Int_t fCkovQuarz; // Cerenkovs crossing quartz
+//kir Int_t fCkovGap; // Cerenkovs crossing gap
+//kir Int_t fCkovCsi; // Cerenkovs crossing csi
+//kir Int_t fLostRfreo; // Cerenkovs reflected in freon
+//kir Int_t fLostRquar; // Cerenkovs reflected in quartz
+//kir Int_t fLostAfreo; // Cerenkovs absorbed in freon
+//kir Int_t fLostAquarz; // Cerenkovs absorbed in quartz
+//kir Int_t fLostAmeta; // Cerenkovs absorbed in methane
+//kir Int_t fLostCsi; // Cerenkovs below csi quantum efficiency
+//kir Int_t fLostWires; // Cerenkovs lost in wires
+//kir Float_t fMipx; // x coord. of MIP
+//kir Float_t fMipy; // y coord. of MIP
+//kir Int_t fLostFresnel; // Cerenkovs lost by Fresnel reflection
+//kir Text_t *fFileName; //! File with background hits
+//kir AliRICHMerger *fMerger; //! pointer to merger
+
+ ClassDef(AliRICH,2) //Main RICH class
+};//class AliRICH
+//______________________________________________________________________________
+void AliRICH::AddHit(Int_t track, Int_t *vol, Float_t *hits)
+{//Adds the current hit to the RICH hits list
+ TClonesArray &tmp=*fHits;
+ new(tmp[fNhits++])AliRICHhit(fIshunt,track,vol,hits);
+}
+//______________________________________________________________________________
+void AliRICH::AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs)
+{//Adds the current RICH cerenkov hit to the Cerenkovs list
+ TClonesArray &tmp=*fCerenkovs;
+ new(tmp[fNcerenkovs++]) AliRICHCerenkov(fIshunt,track,vol,cerenkovs);
+}
+//______________________________________________________________________________
+void AliRICH::ResetHits()
+{//Resets hits and cerenkovs
+ AliDetector::ResetHits();
+ fNcerenkovs = 0;
+ if(fCerenkovs)fCerenkovs->Clear();
+}
+//______________________________________________________________________________
+void AliRICH::AddSDigit(Int_t iC,Int_t iX,Int_t iY,Int_t iAdc,Int_t iT0,Int_t iT1,Int_t iT2)
+{//Adds the current Sdigit to the RICH list of Sdigits
+ TClonesArray &tmp = *fSDigits;
+ new(tmp[fNsdigits++])AliRICHdigit(iC,iX,iY,iAdc,iT0,iT1,iT2);
+}
+//______________________________________________________________________________
+void AliRICH::ResetSDigits()
+{//Resets sdigits
+ fNsdigits=0;
+ if(fSDigits)fSDigits->Clear();
+}
+//______________________________________________________________________________
+#endif