// obtain digits at the end of each event
//
- static Float_t primKinEn, xImpact, yImpact, sFlag;
+ static Float_t primKinEn=0., xImpact=0., yImpact=0., sFlag=0.;
+ static Int_t pcPDGcode;
AliZDCHit *newquad, *curprimquad;
newquad = new AliZDCHit(fIshunt, track, vol, hits);
if(fNhits==0){
// First hit -> setting flag for primary or secondary particle
Int_t primary = gAlice->GetMCApp()->GetPrimary(track);
+ //
if(track != primary){
newquad->SetSFlag(1); // SECONDARY particle entering the ZDC
}
primKinEn = newquad->GetPrimKinEn();
xImpact = newquad->GetXImpact();
yImpact = newquad->GetYImpact();
+ pcPDGcode = newquad->GetPDGCode();
}
else{
newquad->SetPrimKinEn(primKinEn);
newquad->SetXImpact(xImpact);
newquad->SetYImpact(yImpact);
newquad->SetSFlag(sFlag);
+ newquad->SetPDGCode(pcPDGcode);
}
Int_t j;
fSFlag(0),
fLightPMQ(0.),
fLightPMC(0.),
- fEnergy(0.)
+ fEnergy(0.),
+ fPDGCode(0)
{
//
fSFlag(hits[6]),
fLightPMQ(hits[7]),
fLightPMC(hits[8]),
- fEnergy(hits[9])
+ fEnergy(hits[9]),
+ fPDGCode(hits[10])
{
//
fSFlag(oldhit.GetSFlag()),
fLightPMQ(oldhit.GetLightPMQ()),
fLightPMC(oldhit.GetLightPMC()),
- fEnergy(oldhit.GetEnergy())
+ fEnergy(oldhit.GetEnergy()),
+ fPDGCode(oldhit.GetPDGCode())
{
// Copy constructor
fX = oldhit.X();
void AliZDCHit::Print(Option_t *) const
{
// Print method
- printf(" -> HIT: vol[0] = %d vol[1] = %d Track: %d \n"
- " Primary E = %f, Ximpact = %f, Yimpact = %f, SFlag = %f\n"
- " PMQLight = %f, PMCLight = %f, Deposited E = %f\n ",
- fVolume[0],fVolume[1],fTrack,fPrimKinEn,fXImpact,fYImpact,
+ printf("\t ZDC HIT: det = %d tow = %d track %d pcPDGcode %d\n"
+ "\t Primary E = %f, Ximpact = %f, Yimpact = %f, SFlag = %f\n"
+ "\t PMQLight = %f, PMCLight = %f, Deposited E = %f\n ",
+ fVolume[0],fVolume[1],fTrack,fPDGCode,fPrimKinEn,fXImpact,fYImpact,
fSFlag,fLightPMQ,fLightPMC,fEnergy);
}
// Getters
virtual Int_t GetVolume(Int_t i) const {return fVolume[i];}
+ virtual Int_t GetPDGCode() const {return fPDGCode;}
virtual Float_t GetPrimKinEn() const {return fPrimKinEn;}
virtual Float_t GetXImpact() const {return fXImpact;}
virtual Float_t GetYImpact() const {return fYImpact;}
virtual Float_t GetEnergy() const {return fEnergy;}
// Setters
+ virtual void SetVolume(Int_t i, Float_t val) {fVolume[i]=val;}
+ virtual void SetPDGCode(Int_t code) {fPDGCode=code;}
virtual void SetLightPMQ(Float_t value) {fLightPMQ=value;}
virtual void SetLightPMC(Float_t value) {fLightPMC=value;}
virtual void SetSFlag(Float_t value) {fSFlag=value;}
Float_t fLightPMQ; //Cerenkov light produced in each quadrant
Float_t fLightPMC; //Cerenkov light seen by the common PM
Float_t fEnergy; //Total energy deposited in eV
+ Int_t fPDGCode; //PDG code of particle in the ZDC
- ClassDef(AliZDCHit,1) // Hits for the Zero Degree Calorimeters
+ ClassDef(AliZDCHit,2) // Hits for the Zero Degree Calorimeters
};
#endif
#include <TTree.h>
#include <TVirtualMC.h>
#include <TGeoManager.h>
+#include <TParticle.h>
// --- AliRoot classes
#include "AliConst.h"
//
// Routine called at every step in the Zero Degree Calorimeters
//
- Int_t j, vol[2], ibeta=0, ialfa, ibe, nphe;
- Float_t x[3], xdet[3], destep, hits[10], m, ekin, um[3], ud[3], be, out;
- //Float_t radius;
- Float_t xalic[3], z, guiEff;
+ Int_t j, vol[2]={0,0}, ibeta=0, ialfa=0, ibe=0, nphe=0;
+ Float_t hits[11], x[3], xdet[3], um[3], ud[3];
+ Float_t m=0., ekin=0., destep=0., be=0., out=0.;
// Parametrization for light guide uniformity
- // -> OBSOLETE!!!! For guide tilted @ 46 degrees
- //Float_t guiPar[4]={0.31,-0.0004,0.0197,0.7958};
// NEW!!! Light guide tilted @ 51 degrees
Float_t guiPar[4]={0.31,-0.0006305,0.01337,0.8895};
Double_t s[3], p[3];
const char *knamed;
//
- for (j=0;j<10;j++) hits[j]=-999.;
+ for(j=0;j<11;j++) hits[j]=-999.;
//
// --- This part is for no shower developement in beam pipe and TDI
// If particle interacts with beam pipe or TDI -> return
hits[7] = 0;
hits[8] = 0;
hits[9] = 0;
+ //
+ Int_t curTrackN = gAlice->GetMCApp()->GetCurrentTrackNumber();
+ TParticle *part = (gAlice->GetMCApp())->Particle(curTrackN);
+ hits[10] = part->GetPdgCode();
+ //printf("\t PDGCode = %d\n", part->GetPdgCode());
- AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
+ AddHit(curTrackN, vol, hits);
if(fNoShower==1){
//printf("\t VolName %s -> det %d quad %d - x = %f, y = %f, z = %f\n",
if(ibe>fNbep) ibe=fNbep;
out = charge*charge*fTablep[ibeta][ialfa][ibe];
gMC->TrackPosition(s[0],s[1],s[2]);
- for(j=0; j<=2; j++){
+ Float_t xalic[3];
+ for(j=0; j<3; j++){
xalic[j] = s[j];
}
// z-coordinate from ZEM front face
// NB-> fPosZEM[2]+fZEMLength = -1000.+2*10.3 = 979.69 cm
- z = -xalic[2]+fPosZEM[2]+2*fZEMLength-xalic[1];
+ Float_t z = -xalic[2]+fPosZEM[2]+2*fZEMLength-xalic[1];
// z = xalic[2]-fPosZEM[2]-fZEMLength-xalic[1]*(TMath::Tan(45.*kDegrad));
// printf("\n fPosZEM[2]+2*fZEMLength = %f", fPosZEM[2]+2*fZEMLength);
- guiEff = guiPar[0]*(guiPar[1]*z*z+guiPar[2]*z+guiPar[3]);
+ Float_t guiEff = guiPar[0]*(guiPar[1]*z*z+guiPar[2]*z+guiPar[3]);
out = out*guiEff;
nphe = gRandom->Poisson(out);
// printf(" out*guiEff = %f nphe = %d", out, nphe);