Jpp  15.0.4
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JBind2nd.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JBIND2ND__
2 #define __JTRIGGER__JBIND2ND__
3 
4 #include <functional>
5 
6 #include "JTrigger/JMatch.hh"
7 
8 
9 /**
10  * \author mdejong
11  */
12 
13 namespace JTRIGGER {}
14 namespace JPP { using namespace JTRIGGER; }
15 
16 namespace JTRIGGER {
17 
18 
19  /**
20  * Auxiliary class to convert binary JMatch operator and given hit to unary match operator.
21  *
22  * This class is equivalent to the STD binder2nd class but it uses references to the JMatch
23  * interface rather than copies of a derived class.
24  */
25  template <class JHit_t>
26  class JBinder2nd :
27  public std::unary_function<JHit_t, bool>
28  {
29  public:
30  /**
31  * Constructor.
32  *
33  * \param __match match operator
34  * \param __second second hit
35  */
36  JBinder2nd(const JMatch<JHit_t>& __match,
37  const JHit_t& __second) :
38  match (__match),
39  second(__second)
40  {}
41 
42 
43  /**
44  * Unary match operator.
45  *
46  * \param first first hit
47  * \return true if first and second hit match; else false
48  */
49  inline bool operator()(const JHit_t& first) const
50  {
51  return match(first, second);
52  }
53 
54 
55  protected:
57  const JHit_t& second;
58  };
59 
60 
61  /**
62  * Auxiliary method to create JBinder2nd object.
63  *
64  * \param match match operator
65  * \param second second hit
66  * \return JBinder2nd
67  */
68  template <class JHit_t>
69  inline JBinder2nd<JHit_t>
70  JBind2nd(const JMatch<JHit_t>& match, const JHit_t& second)
71  {
72  return JBinder2nd<JHit_t>(match, second);
73  }
74 }
75 
76 #endif
JBinder2nd(const JMatch< JHit_t > &__match, const JHit_t &__second)
Constructor.
Definition: JBind2nd.hh:36
bool operator()(const JHit_t &first) const
Unary match operator.
Definition: JBind2nd.hh:49
JBinder2nd< JHit_t > JBind2nd(const JMatch< JHit_t > &match, const JHit_t &second)
Auxiliary method to create JBinder2nd object.
Definition: JBind2nd.hh:70
Function object interface for hit matching.
Definition: JMatch.hh:25
Auxiliary class to convert binary JMatch operator and given hit to unary match operator.
Definition: JBind2nd.hh:26
const JHit_t & second
Definition: JBind2nd.hh:57
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Base class for match operations for cluster and hit-preprocessing methods.
const JMatch< JHit_t > & match
Definition: JBind2nd.hh:56