BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/DecayChain/include/DecayChain/Element/LabeledCandidate.h
Go to the documentation of this file.
1#ifndef DCHAIN_LABELEDCANDIDATE_H
2#define DCHAIN_LABELEDCANDIDATE_H
3// -*- C++ -*-
4//
5// Package: DChain
6// Module: LabeledCandidate
7//
8// Description: pairing of subclass of Candidate and Conjugation::Label
9//
10// Usage:
11// <usage>
12//
13// Author: Simon Patton
14// Created: Wed Sep 18 14:47:30 EDT 1996
15// $Id: LabeledCandidate.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $: LabeledCandidate.h,v 1.6
16// 1997/08/19 23:01:45 sjp Exp $
17//
18// Revision history
19//
20// $Log: LabeledCandidate.h,v $
21// Revision 1.1.1.1 2009/03/03 06:06:56 maqm
22// first import of DecayChain
23//
24// Revision 1.1 2006/01/11 20:28:08 cdj
25// massive class renaming, addition of [] for selection and unit tests
26//
27//
28
29// system include files
30
31// user include files
32#include "DecayChain/Element/ReferenceHolder.h"
33#include "DecayChain/Element/conjugation.h" // enumerator
34
35// forward declarations
36namespace dchain {
37 template <class CandidateClass> class LabeledCandidate {
38 // friend classses and functions
39
40 public:
41 // constants, enums and typedefs
42
43 // Constructors and destructor
46 : m_pointer( aOtherLabeled.m_pointer ), m_label( aOtherLabeled.m_label ) {}
47 virtual ~LabeledCandidate() {}
48
49 // assignment operator(s)
50 const LabeledCandidate&
52 m_pointer = aOtherLabeled.m_pointer;
53 m_label = aOtherLabeled.m_label;
54 return ( *this );
55 }
56
57 // member functions
58
59 // const member functions
60 // note: The following function can NOT be virtual as its return type changes
61 // for CandidateClasses
62 const CandidateClass& operator()() const { return ( *m_pointer ); }
63
64 //
65 const CandidateClass& labeledClass() const { return ( *m_pointer ); }
66
67 conjugation::Label label() const { return ( m_label ); }
68
69 bool operator==( const conjugation::Label& aLabel ) const { return ( aLabel == m_label ); }
70
71 bool operator!=( const conjugation::Label& aLabel ) const { return ( aLabel != m_label ); }
72
73 // static member functions
74
75 protected:
76 // Constructors and destructor
77 template <class THolder>
78 LabeledCandidate( THolder aCandidateClass, const conjugation::Label aLabel )
79 : m_pointer( aCandidateClass ), m_label( aLabel ) {}
80
81 // protected member functions
82 CandidateClass* pointer() { return m_pointer.pointer(); }
83
84 // protected const member functions
85 const CandidateClass* pointer() const { return ( m_pointer.pointer() ); }
86
87 private:
88 // Constructors and destructor
89
90 // private member functions
91
92 // private const member functions
93
94 // data members
96 conjugation::Label m_label;
97
98 // static data members
99 };
100} // namespace dchain
101
102#endif /* DCHAIN_LABELEDCANDIDATE_H */
LabeledCandidate(THolder aCandidateClass, const conjugation::Label aLabel)
const LabeledCandidate & operator=(const LabeledCandidate< CandidateClass > &aOtherLabeled)
LabeledCandidate(const LabeledCandidate< CandidateClass > &aOtherLabeled)