45 #include "AliESDMuonTrack.h"
49 #include "TDatabasePDG.h"
50 #include "TParticle.h"
54 #include <Riostream.h>
68 fTrackPythiaLine(-999),
75 fPgen.SetPxPyPzE(0.,0.,0.,0.);
76 fPrec.SetPxPyPzE(0.,0.,0.,0.);
77 for (Int_t i=0; i<3; i++) fXYZ[i]=-999;
78 for (Int_t npar = 0; npar < fgkNParentsMax; npar++){
79 fParentPDGCode[npar] = -1;
80 fParentPythiaLine[npar] = -1;
82 for (Int_t i = 0; i < 4; i++){
83 fQuarkPDGCode[i] = -1;
84 fQuarkPythiaLine[i] = -1;
91 fPrec(muonCopy.fPrec),
92 fIsTriggered(muonCopy.fIsTriggered),
93 fCharge(muonCopy.fCharge),
94 fChi2(muonCopy.fChi2),
95 fCentr(muonCopy.fCentr),
96 fPgen(muonCopy.fPgen),
97 fTrackPythiaLine(muonCopy.fTrackPythiaLine),
98 fTrackPDGCode(muonCopy.fTrackPDGCode),
99 fOscillation(muonCopy.fOscillation),
100 fNParents(muonCopy.fNParents),
101 fWeight(muonCopy.fWeight)
104 for (Int_t i=0; i<3; i++)
fXYZ[i]=muonCopy.
fXYZ[i];
109 for (Int_t i = 0; i < 4; i++){
119 fIsTriggered(kFALSE),
124 fTrackPythiaLine(-999),
126 fOscillation(kFALSE),
131 fPgen.SetPxPyPzE(0.,0.,0.,0.);
136 for (Int_t i = 0; i < 4; i++){
153 if (
this == &muonCopy)
return *
this;
156 TObject::operator=(muonCopy);
171 for (Int_t i=0; i<3; i++)
fXYZ[i]=muonCopy.
fXYZ[i];
176 for (Int_t i = 0; i < 4; i++){
190 AliError(
"The track must contain the parameters at vertex");
200 if (zvert!=-9999) xyz[2] = zvert;
207 Double_t mumass = TDatabasePDG::Instance()->GetParticle(13)->Mass();
208 Double_t thetaX = muonTrack->GetThetaX();
209 Double_t thetaY = muonTrack->GetThetaY();
210 Double_t tanthx = TMath::Tan(thetaX);
211 Double_t tanthy = TMath::Tan(thetaY);
212 Double_t pYZ = 1./TMath::Abs(muonTrack->GetInverseBendingMomentum());
213 Double_t pz = - pYZ / TMath::Sqrt(1.0 + tanthy * tanthy);
214 Double_t px = pz * tanthx;
215 Double_t py = pz * tanthy;
216 fCharge = Int_t(TMath::Sign(1.,muonTrack->GetInverseBendingMomentum()));
217 Double_t energy = TMath::Sqrt(mumass * mumass + px*px + py*py + pz*pz);
218 fPrec.SetPxPyPzE(px,py,pz,energy);
220 fXYZ[0] = muonTrack->GetNonBendingCoor();
221 fXYZ[1] = muonTrack->GetBendingCoor();
222 if (zvert==-9999)
fXYZ[2] = muonTrack->GetZ();
223 else fXYZ[2] = zvert;
225 fChi2 = muonTrack->GetChi2()/ (2.0 * muonTrack->GetNHit() - 5);
232 Double_t mumass = TDatabasePDG::Instance()->GetParticle(13)->Mass();
233 Double_t energy = TMath::Sqrt(mumass * mumass + px*px + py*py + pz*pz);
234 fPrec.SetPxPyPzE(px,py,pz,energy);
241 Int_t parents[10], parLine[10];
242 Int_t lineM = part->GetFirstMother();
245 Int_t status=-1, pdg=-1;
248 mother = stack->Particle(lineM);
249 pdg = mother->GetPdgCode();
251 if(pdg == 92 || pdg == 21 || TMath::Abs(pdg) < 10 ||
IsDiquark(pdg))
break;
252 parents[++countP] = pdg;
253 parLine[countP] = lineM;
254 status = mother->GetStatusCode();
256 lineM = mother->GetFirstMother();
259 for(
int i = 0; i <= countP; i++){
268 mother = stack->Particle(lineM);
269 pdg = mother->GetPdgCode();
273 lineM = mother->GetFirstMother();
279 for(
int par = 0; par < 4; par++){
288 AliWarning(Form(
"quark flavour of parent and that of quark do not correspond: %d %d --> correcting\n",
298 pdg = stack->Particle(++line)->GetPdgCode();
303 mother = stack->Particle(line);
304 pdg = mother->GetPdgCode();
307 line = mother->GetFirstMother();
317 for(
int pos = 1; pos < 4; pos++){
326 Int_t bMes0[2] = {511,531};
327 Bool_t answer = kFALSE;
328 for(
int i = 0; i < 2; i++){
329 if(TMath::Abs(intTest) == bMes0[i]){
342 Int_t
id=intTest%100000;
343 return (!((
id-
id%10)%110));
350 Int_t quark = TMath::Abs(pdg/100);
351 if(quark > 9) quark = quark/10;
361 TString options(opt);
364 if(options.Contains(
"H") || options.Contains(
"A")){
365 char *name=
new char[100];
366 TString pdg =
"", line =
"";
367 for(
int i = 3; i >= 0; i--){
386 printf(
"\nmuon's decay history:\n");
387 printf(
" PDG: %s\n", pdg.Data());
388 printf(
"line: %s\n", line.Data());
390 if(options.Contains(
"K") || options.Contains(
"A")){
394 TLorentzVector momRec = this->
GetPRec();
395 TLorentzVector momGen = this->
GetPGen();
396 printf(
"the track's charge is %d\n", charge);
397 printf(
"Primary vertex: Vx = %1.3f, Vy = %1.3f, Vz = %1.3f\n", vtx[0], vtx[1], vtx[2]);
398 printf(
"Generated: Px = %1.3f, Py = %1.3f, Pz = %1.3f\n", momGen.Px(), momGen.Py(), momGen.Pz());
399 printf(
"Reconstructed: Px = %1.3f, Py = %1.3f, Pz = %1.3f\n", momRec.Px(), momRec.Py(), momRec.Pz());
400 printf(
"Rec. variables: pT %1.3f, pseudo-rapidity %1.3f, theta %1.3f (%1.3f degree), phi %1.3f (%1.3f degree)\n",
401 momRec.Pt(), momRec.Eta(), momRec.Theta(), 180./TMath::Pi() * momRec.Theta(),
402 momRec.Phi(), 180./TMath::Pi() * momRec.Phi());
409 if (TMath::Abs(pdg)==211 ||
410 TMath::Abs(pdg)==321 ||
411 TMath::Abs(pdg)==213 ||
412 TMath::Abs(pdg)==311 ||
413 TMath::Abs(pdg)==313 ||
423 pdg = TMath::Abs(pdg);
424 if((pdg > 1000) && (pdg%100 < 10))
return kTRUE;
433 AliErrorStream() <<
"Index outside the array size." << std::endl;
442 AliErrorStream() <<
"Index outside the array size." << std::endl;
451 AliErrorStream() <<
"Index outside the array size." << std::endl;
460 AliErrorStream() <<
"Index outside the array size." << std::endl;
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
void FillFromAliMUONTrack(AliMUONTrack *trackReco, Double_t zvert=-9999)
Int_t fTrackPDGCode
pdg code of the rec. track (in general will be a muon)
TLorentzVector fPgen
4-momentum of the generated particle
void SetQuarkPDGCode(Int_t index, Int_t pdg)
Set pdg of the string [0], quarks/gluons [1,2], sometimes proton [3].
Int_t GetQuarkPythiaLine(Int_t index=0) const
Return line of Pythia output for string [0] and quarks [1,2], sometimes proton [3].
Int_t GetMatchTrigger(void) const
return 1,2,3 if track matches with trigger track, 0 if not
Bool_t IsB0(Int_t intTest) const
Double_t GetBendingCoor() const
return bending coordinate (cm)
TLorentzVector GetPRec() const
Return reconstructed 4-momentum.
AliMUONTrackLight & operator=(const AliMUONTrackLight &)
virtual ~AliMUONTrackLight()
Bool_t fOscillation
flag for oscillation
ClassImp(AliMUONTrackLight) AliMUONTrackLight
Bool_t IsDiquark(Int_t pdg) const
for(Int_t isec=54;isec< 71;isec+=1)
Double_t GetZ() const
return Z coordinate (cm)
void SetTriggered(Bool_t isTriggered)
Set flag for trigger.
Int_t fNParents
acually filled no. of fragmented parents
Track parameters in ALICE dimuon spectrometer.
Int_t GetTrackPythiaLine() const
Return line of Pythia output for string [0] and quarks [1,2], sometimes proton [3].
Double_t fChi2
chi2 / ndf in the MUON track fit
void SetVertex(Double_t *xyz)
Set primary vertex position from the ITS.
Double_t GetInverseBendingMomentum() const
return inverse bending momentum (GeV/c ** -1) times the charge (assumed forward motion) ...
Int_t fQuarkPDGCode[4]
pdg of the string [0], quarks/gluons [1,2], sometimes proton [3]
Int_t fParentPythiaLine[fgkNParentsMax]
line of Pythia output for hadronised parents & grandparents
Int_t fParentPDGCode[fgkNParentsMax]
hadronised parents and grandparents
Int_t GetQuarkPDGCode(Int_t index=0) const
Return pdg of the string [0], quarks/gluons [1,2], sometimes proton [3].
void SetParentPDGCode(Int_t index, Int_t pdg)
Set hadronised parents and grandparents.
void SetCharge(Int_t charge)
Set muon charge.
Double_t * GetVertex()
Return primary vertex position from the ITS.
Int_t fTrackPythiaLine
line of kin. stack where rec. track (in general, the muon) is stored
Bool_t IsMotherAResonance(Int_t index=0) const
void SetOscillation(Bool_t oscillation)
Set flag for oscillation.
Bool_t IsParentPionOrKaon(Int_t idParent=0)
Int_t GetParentFlavour(Int_t idParent=0) const
TLorentzVector fPrec
reconstructed 4-momentum
virtual void PrintInfo(const Option_t *opt)
Compact information for the muon generated tracks.
void SetPxPyPz(Double_t px, Double_t py, Double_t pz)
void FillFromESD(AliESDMuonTrack *muonTrack, Double_t zvert=-9999)
Double_t GetNonBendingCoor() const
return non bending coordinate (cm)
Int_t GetCharge() const
Return muon charge.
Int_t fQuarkPythiaLine[4]
line of Pythia output for string [0] and quarks [1,2], sometimes proton [3]
void SetParentPythiaLine(Int_t index, Int_t line)
Set line of Pythia output for hadronised parents & grandparents.
TLorentzVector GetPGen() const
Return 4-momentum of the generated particle.
Reconstructed track in ALICE dimuon spectrometer.
Double_t fXYZ[3]
primary vertex position from the ITS
Int_t GetParentPDGCode(Int_t index=0) const
Return hadronised parents and grandparents.
void FillMuonHistory(AliStack *stack, TParticle *part)
Int_t GetParentPythiaLine(Int_t index=0) const
Return line of Pythia output for hadronised parents & grandparents.
Int_t GetTrackPDGCode() const
Return pdg code of the rec. track (in general will be a muon)
void SetQuarkPythiaLine(Int_t index, Int_t line)
Set line of Pythia output for string [0] and quarks [1,2], sometimes proton [3].
Bool_t fIsTriggered
flag for trigger
static const Int_t fgkNParentsMax
maximum number of parents
AliMUONTrackParam * GetTrackParamAtVertex() const
return pointer to track parameters at vertex (can be 0x0)