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() :
43 fPID(AliRsnDaughter::kUnknown),
46 fRefType(AliRsnDaughter::kNoType)
49 // This version of constructor leaves everything undefined:
50 // this will cause all daughters to be accepted.
54 //_____________________________________________________________________________
55 AliRsnDaughterDef::AliRsnDaughterDef(AliRsnDaughter::ESpecies type, Char_t sign) :
57 fMass(AliRsnDaughter::SpeciesMass(type)),
59 fRefType(AliRsnDaughter::RefType(type))
62 // This version of constructor initializes the PID type
63 // and the charge (optional, leave 2nd argument to default to include both),
64 // and calls 'SetPID()' to assign the object type accordingly.
68 //_____________________________________________________________________________
69 AliRsnDaughterDef::AliRsnDaughterDef(EPARTYPE type, Char_t sign) :
70 fPID(AliRsnDaughter::FromAliPID(type)),
71 fMass(AliRsnDaughter::SpeciesMass(AliRsnDaughter::FromAliPID(type))),
73 fRefType(AliRsnDaughter::RefType(AliRsnDaughter::FromAliPID(type)))
76 // This version of constructor initializes the PID type
77 // and the charge (optional, leave 2nd argument to default to include both),
78 // and calls 'SetPID()' to assign the object type accordingly.
82 //_____________________________________________________________________________
83 AliRsnDaughterDef::AliRsnDaughterDef(AliRsnDaughter::ERefType refType, Char_t sign) :
84 fPID(AliRsnDaughter::kUnknown),
90 // This version of constructor initializes the object type
91 // and the charge (optional, leave 2nd argument to default to include both),
92 // and leaves the PID type undefined.
93 // This is useful when one is interested in all tracks/V0s/cascades without
94 // requiring them to be identified as a certain species, but if one then requires
95 // an object linked to this definition to compute a rapidity or a transverse mass,
96 // this will not work.
100 //_____________________________________________________________________________
101 AliRsnDaughterDef::AliRsnDaughterDef(const AliRsnDaughterDef ©) :
105 fCharge(copy.fCharge),
106 fRefType(copy.fRefType)
109 // Copy constructor has standard behavior.
113 //_____________________________________________________________________________
114 const AliRsnDaughterDef& AliRsnDaughterDef::operator=(const AliRsnDaughterDef ©)
117 // Assignment operator has standard behavior.
121 fCharge = copy.fCharge;
123 fRefType = copy.fRefType;
128 //_____________________________________________________________________________
129 Bool_t AliRsnDaughterDef::MatchesDaughter(AliRsnDaughter *checked, Bool_t truePID)
132 // Checks if the argument matches the definitions, by combining the other
133 // inline methods, and using the same philosophy.
134 // The only exception is for the PID matching, which can be disabled
135 // by second argument. In this case, a track is considered matched
136 // if it is matched just in object type and charge.
139 Bool_t chargeMatch = MatchesCharge(checked);
140 Bool_t objMatch = MatchesRefType(checked);
141 Bool_t pidMatch = (truePID ? MatchesPID(checked) : kTRUE);
143 // return the AND of all
144 return (chargeMatch && objMatch && pidMatch);