Jpp  17.3.0
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 "JTrigger/JMatch.hh"
5 
6 
7 /**
8  * \author mdejong
9  */
10 
11 namespace JTRIGGER {}
12 namespace JPP { using namespace JTRIGGER; }
13 
14 namespace JTRIGGER {
15 
16 
17  /**
18  * Auxiliary class to convert binary JMatch operator and given hit to unary match operator.
19  *
20  * This class is equivalent to the STD binder2nd class but it uses references to the JMatch
21  * interface rather than copies of a derived class.
22  */
23  template <class JHit_t>
24  class JBinder2nd {
25  public:
26  /**
27  * Constructor.
28  *
29  * \param __match match operator
30  * \param __second second hit
31  */
32  JBinder2nd(const JMatch<JHit_t>& __match,
33  const JHit_t& __second) :
34  match (__match),
35  second(__second)
36  {}
37 
38 
39  /**
40  * Unary match operator.
41  *
42  * \param first first hit
43  * \return true if first and second hit match; else false
44  */
45  inline bool operator()(const JHit_t& first) const
46  {
47  return match(first, second);
48  }
49 
50 
51  protected:
53  const JHit_t& second;
54  };
55 
56 
57  /**
58  * Auxiliary method to create JBinder2nd object.
59  *
60  * \param match match operator
61  * \param second second hit
62  * \return JBinder2nd
63  */
64  template <class JHit_t>
65  inline JBinder2nd<JHit_t>
66  JBind2nd(const JMatch<JHit_t>& match, const JHit_t& second)
67  {
68  return JBinder2nd<JHit_t>(match, second);
69  }
70 }
71 
72 #endif
JBinder2nd(const JMatch< JHit_t > &__match, const JHit_t &__second)
Constructor.
Definition: JBind2nd.hh:32
bool operator()(const JHit_t &first) const
Unary match operator.
Definition: JBind2nd.hh:45
JBinder2nd< JHit_t > JBind2nd(const JMatch< JHit_t > &match, const JHit_t &second)
Auxiliary method to create JBinder2nd object.
Definition: JBind2nd.hh:66
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:24
const JHit_t & second
Definition: JBind2nd.hh:53
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:52