//-------------------------------------------------------------------------
// Class AliRsnDaughter
-//
+// ----------------------
// A simple object which describes a reconstructed track
// with some references to its related generated particle
// and some facilities which could help in composing its
#include <Riostream.h>
#include <TParticle.h>
-#include <TParticlePDG.h>
+#include <TString.h>
#include "AliESDtrack.h"
#include "AliRsnDaughter.h"
//--------------------------------------------------------------------------------------------------------
AliRsnDaughter::AliRsnDaughter()
+{
//
// Default constructor.
// Its unique argument defines how many PID weights are allowed.
// Actually, it should be the same as AliESDtrack::kSPECIES (=5).
-//
-{
+//
fSign = (Char_t)0;
fPDG = (UShort_t)0;
fIndex = (UShort_t)0;
}
//--------------------------------------------------------------------------------------------------------
AliRsnDaughter::AliRsnDaughter(const AliRsnDaughter ©) : TObject(copy)
+{
//
// Copy constructor
//
-{
fSign = copy.fSign;
fPDG = copy.fPDG;
fIndex = copy.fIndex;
}
//--------------------------------------------------------------------------------------------------------
Bool_t AliRsnDaughter::Adopt(const AliESDtrack* esdTrack, Bool_t checkITSRefit)
+{
//
// Copies reconstructed data from an AliESDtrack:
//
// - if the passed label is negative, track is considered as "fake", and
// this info is kept to allow fake tracks exclusion when doing analysis
//
-{
// check for refit in the ITS (if requested)
if (checkITSRefit) {
if ( !(esdTrack->GetStatus() & AliESDtrack::kITSrefit) ) {
}
//--------------------------------------------------------------------------------------------------------
Bool_t AliRsnDaughter::Adopt(TParticle* particle)
+{
//
// Copies data from a generated particle:
//
// When an AliRsnDaughter is copied from a TParticle, it is
// considered always good for analysis and never fake.
//
-{
// get particle sign form the sign of PDG code
Int_t pdg = particle->GetPdgCode();
if (TMath::Abs(pdg) < 20) {
return kTRUE;
}
//--------------------------------------------------------------------------------------------------------
-AliRsnDaughter operator+(AliRsnDaughter t1, AliRsnDaughter t2)
+void AliRsnDaughter::Print(Option_t *option) const
+{
+//
+// Print informations about track.
+// All options are used to add some specifical information as required:
+// "S" --> charge sign
+// "L" --> track label
+// "I" --> assigned PID (PDG code)
+// "T" --> true PDG code
+// "V" --> coordinates of track vertex
+// "P" --> coordinates of track momentum
+// "M" --> mother label
+// "N" --> mother PDG code
+// "W" --> ESD PID weights
+//
+
+ TString output("Track info: ");
+ TString opt(option);
+ opt.ToUpper();
+
+ if (opt.Contains("S")) {
+ output.Append(Form("sign = %d -- ", (Int_t)fSign));
+ }
+ if (opt.Contains("L")) {
+ output.Append(Form("label = %d -- ", fLabel));
+ }
+ if (opt.Contains("I")) {
+ output.Append(Form("PDG = %d -- ", fPDG));
+ }
+ if (opt.Contains("T")) {
+ output.Append(Form("true PDG = %d -- ", fTruePDG));
+ }
+ if (opt.Contains("V")) {
+ output.Append(Form("v = %f, %f, %f -- ", fV[0], fV[1], fV[2]));
+ }
+ if (opt.Contains("P")) {
+ output.Append(Form("p = %f, %f, %f -- ", fP[0], fP[1], fP[2]));
+ }
+ if (opt.Contains("M")) {
+ output.Append(Form("mum = %d -- ", fMother));
+ }
+ if (opt.Contains("N")) {
+ output.Append(Form("mum PDG = %d -- ", fMotherPDG));
+ }
+ if (opt.Contains("W")) {
+ output.Append(Form("PID wgts (e, mu, pi, K, p) = %f, %f, %f, %f, %f", fPIDwgt[0], fPIDwgt[1], fPIDwgt[2], fPIDwgt[3], fPIDwgt[4]));
+ }
+
+ cout << output.Data() << endl;
+}
+//--------------------------------------------------------------------------------------------------------
+AliRsnDaughter AliRsnDaughter::Sum(AliRsnDaughter t1, AliRsnDaughter t2)
+{
//
-// Sum operator overloading.
// Builds a new AliRsnDaughter object with the sum of momenta of two particles.
//
-{
// create new AliRsnDaughter with default useless values for datamembers
AliRsnDaughter out;
}
// compute total 4-momentum
- Double_t Etot = t1.GetEnergy() + t2.GetEnergy();
+ Double_t etot = t1.GetEnergy() + t2.GetEnergy();
Double_t pxTot = t1.GetPx() + t2.GetPx();
Double_t pyTot = t1.GetPy() + t2.GetPy();
Double_t pzTot = t1.GetPz() + t2.GetPz();
- Double_t mass = TMath::Sqrt(Etot*Etot - pxTot*pxTot - pyTot*pyTot - pzTot*pzTot);
+ Double_t mass = TMath::Sqrt(etot*etot - pxTot*pxTot - pyTot*pyTot - pzTot*pzTot);
//TLorentzVector v1 = track1.Get4Momentum();
//TLorentzVector v2 = track2.Get4Momentum();