]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnCutESDPrimary.cxx
Update TPCCEda to write output file in parts (to avoid too big files produced in...
[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() :
32992791 26 AliRsnCut(),
2dab9030 27 fCuts()
b68ef516 28{
29//
30// Default constructor.
31//
32992791 32
33 SetTargetType(AliRsnTarget::kDaughter);
b68ef516 34}
35
36//_________________________________________________________________________________________________
37AliRsnCutESDPrimary::AliRsnCutESDPrimary
38(const char *name) :
2dab9030 39 AliRsnCut(name, AliRsnCut::kDaughter, 0.0, 0.0),
40 fCuts()
b68ef516 41{
42//
43// Main constructor.
44//
45}
46
47//_________________________________________________________________________________________________
32992791 48Bool_t AliRsnCutESDPrimary::IsSelected(TObject *object)
b68ef516 49{
50//
51// Cut checker.
52//
53
54 // coherence check
32992791 55 if (!TargetOK(object)) return kFALSE;
2dab9030 56
b68ef516 57 // retrieve the TPC signal
32992791 58 AliRsnDaughter *daughter = dynamic_cast<AliRsnDaughter*>(object);
2dab9030 59 AliESDtrack *esdTrack = daughter->GetRefESDtrack();
60 if (!esdTrack)
61 {
b68ef516 62 AliError("ESD information unavailable");
63 return kTRUE;
64 }
65
66 // check cut
67 return fCuts.IsSelected(esdTrack);
68}