2 // *** Class AliRsnPair ***
4 // "Core" method for defining the work on a pari of particles.
5 // For one analysis, one must setup one of this for each pair he wants to analyze,
6 // adding to it all analysis which he desires to do.
7 // Here he defines the cuts, and the particle types and charges, and can add
8 // functions which do different operations on the same pair, and some binning
9 // with respect to some kinematic variables (eta, momentum)
11 // authors: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
12 // M. Vala (email: martin.vala@cern.ch)
19 #include "AliRsnMother.h"
20 #include "AliRsnCutSet.h"
22 #include "AliRsnPair.h"
26 //_____________________________________________________________________________
27 AliRsnPair::AliRsnPair(const char *name, AliRsnPairDef *def) :
34 fCutManager(Form("cutMgr_%s", name)),
38 // Default constructor
42 //_____________________________________________________________________________
43 AliRsnPair::AliRsnPair(const AliRsnPair& copy) :
45 fOnlyTrue(copy.fOnlyTrue),
46 fCheckDecay(copy.fCheckDecay),
47 fIsMixed(copy.fIsMixed),
49 fPairDef(copy.fPairDef),
50 fCutManager(copy.fCutManager),
54 // Default constructor
58 //_____________________________________________________________________________
59 AliRsnPair& AliRsnPair::operator=(const AliRsnPair& copy)
61 fOnlyTrue = copy.fOnlyTrue;
62 fCheckDecay = copy.fCheckDecay;
63 fIsMixed = copy.fIsMixed;
65 fPairDef = copy.fPairDef;
66 fMother = copy.fMother;
67 fCutManager = copy.fCutManager;
72 //_____________________________________________________________________________
73 AliRsnPair::~AliRsnPair()
80 //_____________________________________________________________________________
81 void AliRsnPair::Print(Option_t* /*option*/) const
84 // Prints info about pair
88 //_____________________________________________________________________________
89 Bool_t AliRsnPair::Fill
90 (AliRsnDaughter *daughter1, AliRsnDaughter *daughter2, Bool_t refFirst)
93 // Checks that first argument matches definitions for first daughter
94 // and the same for second argument, where the order is defined by
95 // the AliRsnPairDef data member.
96 // If the matching is successful, the AliRsnMother data member is
97 // initialized using the mass hypotheses defined here and the momenta
98 // in the passed daughters.
99 // The third argument is necessary to choose which one of the possible two
100 // events owning the two daughter will be used as reference.
103 // check matching and exit if one of them fails
104 // if true pair is required, this is taken into account:
105 // if both true pairs and correct decay tree is required,
106 // then we must be sure that also the true PID of daughters matches,
107 // instead if correct decay tree is not required this additional check is not done
108 if (!fPairDef->GetDef1()->MatchesDaughter(daughter1, fOnlyTrue && fCheckDecay)) return kFALSE;
109 if (!fPairDef->GetDef2()->MatchesDaughter(daughter2, fOnlyTrue && fCheckDecay)) return kFALSE;
111 // if matching is successful
112 // compute 4-momenta of daughters and mother
113 fMother.SetDaughter(0, daughter1);
114 fMother.SetDaughter(1, daughter2);
115 fMother.ComputeSum(fPairDef->GetMass1(), fPairDef->GetMass2());
117 // assign reference event
118 if (refFirst) fMother.SetRefEvent(daughter1->GetOwnerEvent()); else fMother.SetRefEvent(daughter2->GetOwnerEvent());
120 // if required a true pair, check this here and eventually return a fail message
121 // this is done using the method AliRsnMother::CommonMother with 2 arguments
122 // passed by reference, where the real GEANT label of the particle is stored
123 // and one can check if these tracks are both really secondaries (ID >= 0)
125 Int_t m0, m1, common;
126 common = fMother.CommonMother(m0, m1);
127 if (m0 < 0 || m1 < 0) return kFALSE;
128 if (common != fPairDef->GetMotherPDG()) return kFALSE;
131 // point to first event as reference
132 // and checks the pair cuts,
133 // (done first because it is more likely
134 // that it is not passed and execution is faster)
135 if (!fCutManager.PassMotherCuts(&fMother)) return kFALSE;
137 // cuts on track #1 & common
138 if (!fCutManager.PassDaughter1Cuts(daughter1)) {
139 AliDebug(AliLog::kDebug + 2, "Specific cuts for track #1 not passed");
142 if (!fCutManager.PassCommonDaughterCuts(daughter1)) {
143 AliDebug(AliLog::kDebug + 2, "Common cuts for track #1 not passed");
147 // cuts on track #2 & common
148 if (!fCutManager.PassDaughter2Cuts(daughter2)) {
149 AliDebug(AliLog::kDebug + 2, "Specific cuts for track #2 not passed");
152 if (!fCutManager.PassCommonDaughterCuts(daughter2)) {
153 AliDebug(AliLog::kDebug + 2, "Common cuts for track #2 not passed");
157 // if pair is accepted, increment counter
163 //_____________________________________________________________________________
164 void AliRsnPair::Compute()
167 // Virtual method to compute pair quantities of interest
170 AliWarning("Implement this method in derived classes");
173 //_____________________________________________________________________________
174 void AliRsnPair::Init(const char* /*prefix*/, TList* /*list*/)
177 // Virtual method to compute pair quantities of interest
180 AliWarning("Implement this method in derived classes");