]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnCutESDPrimary.cxx
fixed sig.segv
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutESDPrimary.cxx
CommitLineData
b68ef516 1//
2// Class AliRsnCutESDPrimary
3//
4// General implementation of a single cut strategy, which can be:
5// - a value contained in a given interval [--> IsBetween() ]
6// - a value equal to a given reference [--> MatchesValue()]
7//
8// In all cases, the reference value(s) is (are) given as data members
9// and each kind of cut requires a given value type (Int, UInt, Double),
10// but the cut check procedure is then automatized and chosen thanks to
11// an enumeration of the implemented cut types.
12// At the end, the user (or any other point which uses this object) has
13// to use the method IsSelected() to check if this cut has been passed.
14//
15// authors: Martin Vala (martin.vala@cern.ch)
16// Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
17//
b68ef516 18
19#include "AliRsnDaughter.h"
20#include "AliRsnCutESDPrimary.h"
21
22ClassImp(AliRsnCutESDPrimary)
23
24//_________________________________________________________________________________________________
25AliRsnCutESDPrimary::AliRsnCutESDPrimary() :
2dab9030 26 AliRsnCut(AliRsnCut::kDaughter),
27 fCuts()
b68ef516 28{
29//
30// Default constructor.
31//
32}
33
34//_________________________________________________________________________________________________
35AliRsnCutESDPrimary::AliRsnCutESDPrimary
36(const char *name) :
2dab9030 37 AliRsnCut(name, AliRsnCut::kDaughter, 0.0, 0.0),
38 fCuts()
b68ef516 39{
40//
41// Main constructor.
42//
43}
44
45//_________________________________________________________________________________________________
2dab9030 46Bool_t AliRsnCutESDPrimary::IsSelected(TObject *obj1, TObject* /*obj2*/)
b68ef516 47{
48//
49// Cut checker.
50//
51
52 // coherence check
2dab9030 53 AliRsnDaughter *daughter = dynamic_cast<AliRsnDaughter*>(obj1);
54 if (!daughter) return kFALSE;
55
b68ef516 56 // retrieve the TPC signal
2dab9030 57 AliESDtrack *esdTrack = daughter->GetRefESDtrack();
58 if (!esdTrack)
59 {
b68ef516 60 AliError("ESD information unavailable");
61 return kTRUE;
62 }
63
64 // check cut
65 return fCuts.IsSelected(esdTrack);
66}