LoKiProtoParticlesDict.h 6.67 KB
Newer Older
Marco Clemencic's avatar
Marco Clemencic committed
1
2
3
4
5
6
7
8
9
10
/*****************************************************************************\
* (c) Copyright 2000-2019 CERN for the benefit of the LHCb Collaboration      *
*                                                                             *
* This software is distributed under the terms of the GNU General Public      *
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING".   *
*                                                                             *
* In applying this licence, CERN does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization  *
* or submit itself to any jurisdiction.                                       *
\*****************************************************************************/
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
11
// ============================================================================
Gitlab CI's avatar
Gitlab CI committed
12
#ifndef DICT_LOKIPROTOPARTICLESDICT_H
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
13
14
15
16
#define DICT_LOKIPROTOPARTICLESDICT_H 1
// ============================================================================
// Include files
// ============================================================================
Gitlab CI's avatar
Gitlab CI committed
17
// Event
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
18
19
20
21
22
23
24
25
// ============================================================================
#include "Event/ProtoParticle.h"
// ============================================================================
// LoKi
// ============================================================================
#include "LoKi/Dicts.h"
#include "LoKi/Filters.h"
#include "LoKi/FuncOps.h"
Gitlab CI's avatar
Gitlab CI committed
26
27
#include "LoKi/MoreFunctions.h"
#include "LoKi/Operators.h"
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
28
29
#include "LoKi/PPTypes.h"
#include "LoKi/ProtoParticles.h"
Gitlab CI's avatar
Gitlab CI committed
30
#include "LoKi/Streamers.h"
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
31
// ============================================================================
Marco Clemencic's avatar
v12r2    
Marco Clemencic committed
32
33
/** @file
 *
Gitlab CI's avatar
Gitlab CI committed
34
 *  This file is a part of LoKi project -
Marco Clemencic's avatar
v12r2    
Marco Clemencic committed
35
36
37
 *    "C++ ToolKit  for Smart and Friendly Physics Analysis"
 *
 *  The package has been designed with the kind help from
Gitlab CI's avatar
Gitlab CI committed
38
39
 *  Galina PAKHLOVA and Sergey BARSUK.  Many bright ideas,
 *  contributions and advices from G.Raven, J.van Tilburg,
Marco Clemencic's avatar
v12r2    
Marco Clemencic committed
40
41
42
 *  A.Golutvin, P.Koppenburg have been used in the design.
 */
// ============================================================================
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
43

Gitlab CI's avatar
Gitlab CI committed
44
namespace LoKi {
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
45
  // ==========================================================================
Gitlab CI's avatar
Gitlab CI committed
46
  namespace Dicts {
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
47
48
    // ========================================================================
    template <>
Gitlab CI's avatar
Gitlab CI committed
49
    class CutCalls<LHCb::ProtoParticle> {
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
50
51
    private:
      // ======================================================================
Gitlab CI's avatar
Gitlab CI committed
52
53
      typedef LHCb::ProtoParticle                                        Type;
      typedef LoKi::BasicFunctors<const LHCb::ProtoParticle*>::Predicate Fun;
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
54
55
56
57
      // ======================================================================
    public:
      // ======================================================================
      // __call__
Gitlab CI's avatar
Gitlab CI committed
58
      static Fun::result_type __call__( const Fun& fun, const Type* o ) { return fun( o ); }
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
59
      // __call__
Gitlab CI's avatar
Gitlab CI committed
60
61
62
      static Fun::result_type __call__( const Fun& fun, const SmartRef<Type>& o ) { return fun( o ); }
      //
      // __call__ as filter
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
63
64
      //
      // __call__
Gitlab CI's avatar
Gitlab CI committed
65
      static Type::ConstVector __call__( const Fun& fun, const Type::ConstVector& o ) { return __rrshift__( fun, o ); }
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
66
      // __call__
Gitlab CI's avatar
Gitlab CI committed
67
      static Type::ConstVector __call__( const Fun& fun, const Type::Container* o ) { return __rrshift__( fun, o ); }
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
68
69
70
71
      // ======================================================================
    public:
      // ======================================================================
      // __rrshift__
Gitlab CI's avatar
Gitlab CI committed
72
73
74
75
76
      static Type::ConstVector __rrshift__( const Fun& fun, const Type::ConstVector& o ) {
        Type::ConstVector res;
        res.reserve( o.size() );
        LoKi::apply_filter( o.begin(), o.end(), fun, std::back_inserter( res ) );
        return res;
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
77
78
      }
      // __rrshift__
Gitlab CI's avatar
Gitlab CI committed
79
80
81
82
83
84
85
      static Type::ConstVector __rrshift__( const Fun& fun, const Type::Container* o ) {
        Type::ConstVector res;
        if ( 0 == o ) { return res; }
        res.reserve( o->size() );
        LoKi::apply_filter( o->begin(), o->end(), fun, std::back_inserter( res ) );
        return res;
      }
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
86
      // __rrshift__
Gitlab CI's avatar
Gitlab CI committed
87
      static Fun::result_type __rrshift__( const Fun& fun, const Type* o ) { return fun( o ); }
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
88
      // __rrshift__
Gitlab CI's avatar
Gitlab CI committed
89
      static Fun::result_type __rrshift__( const Fun& fun, const SmartRef<Type>& o ) { return fun( o ); }
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
90
91
92
      // ======================================================================
    public:
      // ======================================================================
Gitlab CI's avatar
Gitlab CI committed
93
      static LoKi::FunctorFromFunctor<const Type*, bool> __rshift__( const Fun& fun, const Fun& o ) { return fun >> o; }
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
94
      // ======================================================================
Gitlab CI's avatar
Gitlab CI committed
95
    };
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
96
    // ========================================================================
Gitlab CI's avatar
Gitlab CI committed
97
  } // namespace Dicts
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
98
  // ==========================================================================
Gitlab CI's avatar
Gitlab CI committed
99
} // namespace LoKi
Marco Clemencic's avatar
v15r0    
Marco Clemencic committed
100
// ============================================================================
Gitlab CI's avatar
Gitlab CI committed
101
namespace {
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
102
  // ==========================================================================
103
  struct LoKiProtoParticles_Instantiations {
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
104
    // ========================================================================
Gitlab CI's avatar
Gitlab CI committed
105
106
107
108
109
110
111
112
113
114
115
116
    // the basic functions
    LoKi::Dicts::Funcs<const LHCb::ProtoParticle*>  m_f1;
    LoKi::Dicts::VFuncs<const LHCb::ProtoParticle*> m_f2;
    // operators
    LoKi::Dicts::FuncOps<const LHCb::ProtoParticle*> m_o1;
    LoKi::Dicts::CutsOps<const LHCb::ProtoParticle*> m_o2;
    // streamers
    LoKi::Dicts::MapsOps<const LHCb::ProtoParticle*>   m_o3;
    LoKi::Dicts::PipeOps<const LHCb::ProtoParticle*>   m_o4;
    LoKi::Dicts::FunValOps<const LHCb::ProtoParticle*> m_o5;
    LoKi::Dicts::CutValOps<const LHCb::ProtoParticle*> m_o51;
    LoKi::Dicts::SourceOps<const LHCb::ProtoParticle*> m_fo7;
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
117
    // info
Gitlab CI's avatar
Gitlab CI committed
118
    LoKi::Dicts::InfoOps<const LHCb::ProtoParticle*> m_io;
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
119
    /// mathematics:
Gitlab CI's avatar
Gitlab CI committed
120
121
    LoKi::Dicts::FunCalls<LHCb::ProtoParticle> m_c1;
    LoKi::Dicts::CutCalls<LHCb::ProtoParticle> m_c2;
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
122
    // ========================================================================
Gitlab CI's avatar
Gitlab CI committed
123
124
125
    LoKi::Functors::Empty<const LHCb::ProtoParticle*> m_ss1;
    LoKi::Functors::Size<const LHCb::ProtoParticle*>  m_ss2;
    LoKi::Valid<const LHCb::ProtoParticle*>           m_ss3;
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
126
    // ========================================================================
Gitlab CI's avatar
Gitlab CI committed
127
  };
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
128
  // ==========================================================================
Gitlab CI's avatar
Gitlab CI committed
129
} // namespace
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
130
// ============================================================================
Gitlab CI's avatar
Gitlab CI committed
131
//                                                                      The END
Marco Clemencic's avatar
v11r0  
Marco Clemencic committed
132
133
// ============================================================================
#endif // DICT_LOKIPROTOPARTICLESDICT_H