1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 ////////////////////////////////////////////////////////////////////////////////
18 // This class is a simple set of definitions which are used to select among
19 // all daughter candidates in term of the object type (track, V0, cascade),
20 // charge and eventually PID.
21 // The PID assigned to the definition is the one which is 'assigned' to the
22 // candidate daughter for whatever implies a mass hypothesis. When MC is
23 // available and one requires this, thie PID is also used to select only the
24 // daughters which are of that species in MC.
26 // NOTE: charge is a single character. If one wants to select a well-defined
27 // charge, he must use '+', '-' or '0', while any other character is
28 // interpreted as 'no charge selection'.
30 // authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it)
31 // M. Vala (martin.vala@cern.ch)
33 ////////////////////////////////////////////////////////////////////////////////
36 #include "AliRsnDaughterDef.h"
38 ClassImp(AliRsnDaughterDef)
41 //_____________________________________________________________________________
42 AliRsnDaughterDef::AliRsnDaughterDef() :
44 fPID(AliRsnDaughter::kUnknown),
47 fRefType(AliRsnDaughter::kNoType)
50 // This version of constructor leaves everything undefined:
51 // this will cause all daughters to be accepted.
55 //_____________________________________________________________________________
56 AliRsnDaughterDef::AliRsnDaughterDef(AliRsnDaughter::ESpecies type, Char_t sign) :
59 fMass(AliRsnDaughter::SpeciesMass(type)),
61 fRefType(AliRsnDaughter::RefType(type))
64 // This version of constructor initializes the PID type
65 // and the charge (optional, leave 2nd argument to default to include both),
66 // and calls 'SetPID()' to assign the object type accordingly.
70 //_____________________________________________________________________________
71 AliRsnDaughterDef::AliRsnDaughterDef(EPARTYPE type, Char_t sign) :
73 fPID(AliRsnDaughter::FromAliPID(type)),
74 fMass(AliRsnDaughter::SpeciesMass(AliRsnDaughter::FromAliPID(type))),
76 fRefType(AliRsnDaughter::RefType(AliRsnDaughter::FromAliPID(type)))
79 // This version of constructor initializes the PID type
80 // and the charge (optional, leave 2nd argument to default to include both),
81 // and calls 'SetPID()' to assign the object type accordingly.
85 //_____________________________________________________________________________
86 AliRsnDaughterDef::AliRsnDaughterDef(AliRsnDaughter::ERefType refType, Char_t sign) :
88 fPID(AliRsnDaughter::kUnknown),
94 // This version of constructor initializes the object type
95 // and the charge (optional, leave 2nd argument to default to include both),
96 // and leaves the PID type undefined.
97 // This is useful when one is interested in all tracks/V0s/cascades without
98 // requiring them to be identified as a certain species, but if one then requires
99 // an object linked to this definition to compute a rapidity or a transverse mass,
100 // this will not work.
104 //_____________________________________________________________________________
105 AliRsnDaughterDef::AliRsnDaughterDef(const AliRsnDaughterDef ©) :
107 fOnlyTrue(copy.fOnlyTrue),
110 fCharge(copy.fCharge),
111 fRefType(copy.fRefType)
114 // Copy constructor has standard behavior.
118 //_____________________________________________________________________________
119 const AliRsnDaughterDef& AliRsnDaughterDef::operator=(const AliRsnDaughterDef ©)
122 // Assignment operator has standard behavior.
125 fOnlyTrue = copy.fOnlyTrue;
127 fCharge = copy.fCharge;
129 fRefType = copy.fRefType;
134 //_____________________________________________________________________________
135 Bool_t AliRsnDaughterDef::MatchesDaughter(AliRsnDaughter *checked)
138 // Checks if the argument matches the definitions, by combining the other
139 // inline methods, and using the same philosophy.
140 // The only exception is for the PID matching, which can be disabled
141 // by second argument. In this case, a track is considered matched
142 // if it is matched just in object type and charge.
145 Bool_t chargeMatch = MatchesCharge(checked);
146 Bool_t objMatch = MatchesRefType(checked);
147 Bool_t pidMatch = (fOnlyTrue ? MatchesPID(checked) : kTRUE);
149 // return the AND of all
150 return (chargeMatch && objMatch && pidMatch);