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)
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.
101 // check matching and exit if one of them fails
102 // if true pair is required, this is taken into account:
103 // if both true pairs and correct decay tree is required,
104 // then we must be sure that also the true PID of daughters matches,
105 // instead if correct decay tree is not required this additional check is not done
106 if (!fPairDef->GetDef1()->MatchesDaughter(daughter1, fOnlyTrue && fCheckDecay)) return kFALSE;
107 if (!fPairDef->GetDef2()->MatchesDaughter(daughter2, fOnlyTrue && fCheckDecay)) return kFALSE;
109 // if matching is successful
110 // compute 4-momenta of daughters and mother
111 fMother.SetDaughters(daughter1, fPairDef->GetMass1(), daughter2, fPairDef->GetMass2());
113 // if required a true pair, check this here and eventually return a fail message
114 // this is done using the method AliRsnMother::CommonMother with 2 arguments
115 // passed by reference, where the real GEANT label of the particle is stored
116 // and one can check if these tracks are both really secondaries (ID >= 0)
118 Int_t m0, m1, common;
119 common = fMother.CommonMother(m0, m1);
120 if (m0 < 0 || m1 < 0) return kFALSE;
121 if (common != fPairDef->GetMotherPDG()) return kFALSE;
124 // point to first event as reference
125 // and checks the pair cuts,
126 // (done first because it is more likely
127 // that it is not passed and execution is faster)
128 AliRsnTarget::SwitchToFirst();
129 if (!fCutManager.PassMotherCuts(&fMother)) return kFALSE;
131 // cuts on track #1 & common
132 AliRsnTarget::SwitchToFirst();
133 if (!fCutManager.PassDaughter1Cuts(daughter1)) {
134 AliDebug(AliLog::kDebug + 2, "Specific cuts for track #1 not passed");
137 if (!fCutManager.PassCommonDaughterCuts(daughter1)) {
138 AliDebug(AliLog::kDebug + 2, "Common cuts for track #1 not passed");
142 // cuts on track #2 & common
143 AliRsnTarget::SwitchToSecond();
144 if (!fCutManager.PassDaughter2Cuts(daughter2)) {
145 AliDebug(AliLog::kDebug + 2, "Specific cuts for track #2 not passed");
148 if (!fCutManager.PassCommonDaughterCuts(daughter2)) {
149 AliDebug(AliLog::kDebug + 2, "Common cuts for track #2 not passed");
153 // if pair is accepted, increment counter
159 //_____________________________________________________________________________
160 void AliRsnPair::Compute()
163 // Virtual method to compute pair quantities of interest
166 AliWarning("Implement this method in derived classes");
169 //_____________________________________________________________________________
170 void AliRsnPair::Init(const char* /*prefix*/, TList* /*list*/)
173 // Virtual method to compute pair quantities of interest
176 AliWarning("Implement this method in derived classes");