#define AliHMPIDHit_h
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-
+//.
+// HMPID base class to produce hits
+//.
+//.
#include <AliHit.h> //base class
#include <TVector3.h> //ctor
-#include <TRandom.h> //QdcTot()
#include "AliHMPIDDigit.h" //QdcTot()
+#include <TRandom.h>
+
class AliHMPIDHit : public AliHit // TObject-AliHit-AliHMPIDHit
{
public:
AliHMPIDHit( ):AliHit( ),fCh(-1),fPid(-1 ),fQ(-1),fLx(0),fLy(0){} //default ctor
- AliHMPIDHit(Int_t c,Float_t &e,Int_t pid,Int_t tid,Float_t x,Float_t y,const TVector3 &p):AliHit(0,tid),fCh(c ),fPid(pid),fQ(0 ),fLx(x),fLy(y){QdcTot(e);fX=p.X();fY=p.Y();fZ=p.Z();}
- AliHMPIDHit(Int_t c,Float_t &e,Int_t pid,Int_t tid,Float_t x,Float_t y ):AliHit( ),fCh(c ),fPid(pid),fQ(0 ),fLx(x),fLy(y){QdcTot(e);fTrack=tid;}//manual ctor
+ AliHMPIDHit(Int_t c,Float_t &e,Int_t pid,Int_t tid,Float_t x,Float_t y,const TVector3 &p):AliHit(0,tid),fCh(c ),fPid(pid),fQ(0 ),fLx(x),fLy(y){e=QdcTot(e);fX=p.X();fY=p.Y();fZ=p.Z();}
+ AliHMPIDHit(Int_t c,Float_t &e,Int_t pid,Int_t tid,Float_t x,Float_t y ):AliHit( ),fCh(c ),fPid(pid),fQ(0 ),fLx(x),fLy(y){e=QdcTot(e);fTrack=tid;}//manual ctor
AliHMPIDHit(const AliHMPIDHit &h):AliHit(h),fCh(h.fCh),fPid(h.fPid),fQ(h.fQ),fLx(h.fLx),fLy(h.fLy) {}//copy ctor
virtual ~AliHMPIDHit() {}
//framework part
Float_t LorsY ( )const{return fLy; } //hit Y position in LORS, [cm]
Int_t Pid ( )const{return fPid; } //PID
Float_t Q ( )const{return fQ; } //total charge, [QDC]
- inline Float_t QdcTot (Float_t &e ); //calculate total charge of the hit
+ inline Float_t QdcTot (Float_t e ); //calculate total charge of the hit
Int_t Tid ( )const{return fTrack; } //TID
-
+ void SetQ (Float_t q ) {fQ=q; } //for debugging...
protected: //AliHit has fTrack,fX,fY,fZ
Int_t fCh; //Chamber
Int_t fPid; //PID
ClassDef(AliHMPIDHit,5) //HMPID hit class
};//class AliHMPIDhit
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Float_t AliHMPIDHit::QdcTot(Float_t &e)
+Float_t AliHMPIDHit::QdcTot(Float_t e)
{
// Samples total charge of the hit
// Arguments: e- hit energy [GeV] for mip Eloss for photon Etot
// Returns: total QDC
Int_t pc,px,py;
- AliHMPIDDigit::Lors2Pad(fLx,fLy,pc,px,py);
- Float_t y=AliHMPIDDigit::LorsY(pc,py);
+ AliHMPIDParam::Lors2Pad(fLx,fLy,pc,px,py);
+ if(py<0) fQ=0;
+ else {
+ Float_t y=AliHMPIDParam::LorsY(pc,py);
fLy=((y-fLy)>0)?y-0.2:y+0.2; //shift to the nearest anod wire
Float_t x=(fLx > 66.6)? fLx-66.6:fLx; //sagita is for PC (0-64) and not for chamber
Double_t rnd=gRandom->Rndm(); if(rnd==0) rnd=1e-12; //1e-12 is a protection against 0 from rndm
fQ-=qdcEle*TMath::Log(rnd);
}
- e=fQ;
+ }
return fQ;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++