Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb
Rec
Merge requests
!3304
remove LokiProtoParticles
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
remove LokiProtoParticles
remove-loki-protoparticles
into
master
Overview
8
Commits
1
Pipelines
3
Changes
30
Merged
Gerhard Raven
requested to merge
remove-loki-protoparticles
into
master
2 years ago
Overview
8
Commits
1
Pipelines
3
Changes
30
Expand
0
0
Merge request reports
Compare
master
version 1
042711c5
2 years ago
master (base)
and
latest version
latest version
856f79f9
1 commit,
2 years ago
version 1
042711c5
1 commit,
2 years ago
30 files
+
49
−
5275
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
30
Search (e.g. *.vue) (Ctrl+P)
Phys/FlavourTagging/src/Features/LoKiWrapper.cpp
+
33
−
34
Options
@@ -8,16 +8,42 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
#include
"LoKiWrapper.h"
#include
"Event/Particle.h"
#include
"Gaudi/Property.h"
#include
"GaudiAlg/GaudiTool.h"
#include
"GaudiKernel/StatusCode.h"
#include
"LoKi/BasicFunctors.h"
#include
"LoKi/ProtoParticles.h"
#include
"LoKi/IHybridFactory.h"
#include
"LoKi/PhysTypes.h"
DECLARE_COMPONENT
(
LoKiWrapper
)
#include
<functional>
#include
<map>
#include
<string>
#include
<vector>
LoKiWrapper
::
LoKiWrapper
(
const
std
::
string
&
type
,
const
std
::
string
&
name
,
const
IInterface
*
interface
)
:
GaudiTool
(
type
,
name
,
interface
)
{
declareInterface
<
ILoKiWrapper
>
(
this
);
}
#include
"boost/algorithm/string/predicate.hpp"
#include
"ILoKiWrapper.h"
class
LoKiWrapper
:
public
extends
<
GaudiTool
,
ILoKiWrapper
>
{
public:
using
extends
::
extends
;
StatusCode
initialize
()
override
;
std
::
function
<
double
()
>
getFunctor
(
const
std
::
string
&
functorName
)
override
;
void
setOutlets
(
const
LHCb
::
Particle
*
const
*
pTaggingParticle
,
const
LHCb
::
Particle
*
const
*
pSignalCandidate
,
const
LHCb
::
RecVertex
*
const
*
pRecVertex
)
override
;
private:
LoKi
::
IHybridFactory
*
m_factory
=
nullptr
;
const
LHCb
::
Particle
*
const
*
m_pTaggingParticle
=
nullptr
;
const
LHCb
::
Particle
*
const
*
m_pSignalCandidate
=
nullptr
;
const
LHCb
::
RecVertex
*
const
*
m_pAssociatedVertex
=
nullptr
;
};
DECLARE_COMPONENT
(
LoKiWrapper
)
StatusCode
LoKiWrapper
::
initialize
()
{
auto
sc
=
GaudiTool
::
initialize
();
@@ -64,33 +90,6 @@ std::function<double()> LoKiWrapper::getFunctor( const std::string& functorName
return
[
vertexFunctor
,
this
]()
->
double
{
return
vertexFunctor
(
*
this
->
m_pAssociatedVertex
);
};
}
// only for testing
// @TODO: remove this and either find a way to implement these lokifunctors
// in a more general way or implement those inside feature_generator as
// custom functors.
LoKi
::
BasicFunctors
<
const
LHCb
::
ProtoParticle
*>::
PredicateFromPredicate
protoParticleFunctorB
=
LoKi
::
Constant
<
const
LHCb
::
ProtoParticle
*
,
bool
>
(
false
);
sc
=
m_factory
->
get
(
functorName
,
protoParticleFunctorB
);
if
(
sc
==
StatusCode
::
SUCCESS
)
{
if
(
msgLevel
(
MSG
::
DEBUG
)
)
debug
()
<<
"[LoKiWrapper::getFunctor] "
<<
"Initializing feature "
<<
functorName
<<
" as protoParticleFunctor."
<<
endmsg
;
return
[
protoParticleFunctorB
,
this
]()
->
double
{
return
protoParticleFunctorB
(
(
*
this
->
m_pTaggingParticle
)
->
proto
()
);
};
}
LoKi
::
BasicFunctors
<
const
LHCb
::
ProtoParticle
*>::
FunctionFromFunction
protoParticleFunctor
=
LoKi
::
Constant
<
const
LHCb
::
ProtoParticle
*
,
double
>
(
0
);
sc
=
m_factory
->
get
(
functorName
,
protoParticleFunctor
);
if
(
sc
==
StatusCode
::
SUCCESS
)
{
if
(
msgLevel
(
MSG
::
DEBUG
)
)
debug
()
<<
"[LoKiWrapper::getFunctor] "
<<
"Initializing feature "
<<
functorName
<<
" as protoParticleFunctor."
<<
endmsg
;
return
[
protoParticleFunctor
,
this
]()
->
double
{
return
protoParticleFunctor
(
(
*
this
->
m_pTaggingParticle
)
->
proto
()
);
};
}
if
(
msgLevel
(
MSG
::
FATAL
)
)
fatal
()
<<
"[LoKiWrapper::getFunctor] "
<<
"Feature "
<<
functorName
<<
" could not be initialized."
<<
endmsg
;
Loading