]>
Commit | Line | Data |
---|---|---|
7356f978 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | //////////////////////////////////////////////////////////////////////////////// | |
17 | // | |
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. | |
25 | // | |
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'. | |
29 | // | |
30 | // authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it) | |
31 | // M. Vala (martin.vala@cern.ch) | |
32 | // | |
33 | //////////////////////////////////////////////////////////////////////////////// | |
465f48b2 | 34 | |
35 | #include "AliLog.h" | |
465f48b2 | 36 | #include "AliRsnDaughterDef.h" |
37 | ||
38 | ClassImp(AliRsnDaughterDef) | |
39 | ||
3a15c861 | 40 | |
41 | //_____________________________________________________________________________ | |
42 | AliRsnDaughterDef::AliRsnDaughterDef() : | |
7356f978 | 43 | fPID(AliRsnDaughter::kUnknown), |
3a15c861 | 44 | fMass(0.0), |
45 | fCharge(0), | |
7356f978 | 46 | fRefType(AliRsnDaughter::kNoType) |
3a15c861 | 47 | { |
48 | // | |
7356f978 | 49 | // This version of constructor leaves everything undefined: |
50 | // this will cause all daughters to be accepted. | |
3a15c861 | 51 | // |
52 | } | |
53 | ||
465f48b2 | 54 | //_____________________________________________________________________________ |
7356f978 | 55 | AliRsnDaughterDef::AliRsnDaughterDef(AliRsnDaughter::ESpecies type, Char_t sign) : |
56 | fPID(type), | |
465f48b2 | 57 | fMass(0.0), |
9ae306ed | 58 | fCharge(sign), |
7356f978 | 59 | fRefType(AliRsnDaughter::RefType(type)) |
465f48b2 | 60 | { |
61 | // | |
3a15c861 | 62 | // This version of constructor initializes the PID type |
7356f978 | 63 | // and the charge (optional, leave 2nd argument to default to include both), |
64 | // and calls 'SetPID()' to assign the object type accordingly. | |
465f48b2 | 65 | // |
7356f978 | 66 | } |
465f48b2 | 67 | |
7356f978 | 68 | //_____________________________________________________________________________ |
69 | AliRsnDaughterDef::AliRsnDaughterDef(EPARTYPE type, Char_t sign) : | |
70 | fPID(AliRsnDaughter::FromAliPID(type)), | |
71 | fMass(0.0), | |
72 | fCharge(sign), | |
73 | fRefType(AliRsnDaughter::RefType(AliRsnDaughter::FromAliPID(type))) | |
74 | { | |
75 | // | |
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. | |
79 | // | |
465f48b2 | 80 | } |
81 | ||
3a15c861 | 82 | //_____________________________________________________________________________ |
83 | AliRsnDaughterDef::AliRsnDaughterDef(AliRsnDaughter::ERefType refType, Char_t sign) : | |
7356f978 | 84 | fPID(AliRsnDaughter::kUnknown), |
3a15c861 | 85 | fMass(0.0), |
86 | fCharge(sign), | |
7356f978 | 87 | fRefType(refType) |
3a15c861 | 88 | { |
89 | // | |
7356f978 | 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. | |
3a15c861 | 97 | // |
98 | } | |
465f48b2 | 99 | |
100 | //_____________________________________________________________________________ | |
101 | AliRsnDaughterDef::AliRsnDaughterDef(const AliRsnDaughterDef ©) : | |
102 | TObject(copy), | |
7356f978 | 103 | fPID(copy.fPID), |
465f48b2 | 104 | fMass(copy.fMass), |
105 | fCharge(copy.fCharge), | |
7356f978 | 106 | fRefType(copy.fRefType) |
465f48b2 | 107 | { |
108 | // | |
7356f978 | 109 | // Copy constructor has standard behavior. |
465f48b2 | 110 | // |
111 | } | |
112 | ||
113 | //_____________________________________________________________________________ | |
114 | const AliRsnDaughterDef& AliRsnDaughterDef::operator=(const AliRsnDaughterDef ©) | |
115 | { | |
116 | // | |
7356f978 | 117 | // Assignment operator has standard behavior. |
465f48b2 | 118 | // |
119 | ||
120 | fMass = copy.fMass; | |
121 | fCharge = copy.fCharge; | |
122 | fPID = copy.fPID; | |
7356f978 | 123 | fRefType = copy.fRefType; |
465f48b2 | 124 | |
125 | return (*this); | |
126 | } | |
127 | ||
465f48b2 | 128 | //_____________________________________________________________________________ |
129 | Bool_t AliRsnDaughterDef::MatchesDaughter(AliRsnDaughter *checked, Bool_t truePID) | |
130 | { | |
131 | // | |
7356f978 | 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. | |
465f48b2 | 137 | // |
138 | ||
7356f978 | 139 | Bool_t chargeMatch = MatchesCharge(checked); |
140 | Bool_t objMatch = MatchesRefType(checked); | |
141 | Bool_t pidMatch = (truePID ? MatchesPID(checked) : kTRUE); | |
9ae306ed | 142 | |
143 | // return the AND of all | |
144 | return (chargeMatch && objMatch && pidMatch); | |
465f48b2 | 145 | } |