The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::Example::TinyExperiment::CheckerAlg Class Reference

Comparison of Reconstructed Tracks and MCTracks. More...

Inheritance diagram for Gaudi::Example::TinyExperiment::CheckerAlg:
Collaboration diagram for Gaudi::Example::TinyExperiment::CheckerAlg:

Public Member Functions

 CheckerAlg (const std::string &name, ISvcLocator *pSvcLocator)
void operator() (MCTracks const &mcTracks, Tracks const &tracks) const override

Private Member Functions

bool almostEqual (float a, float b) const

Private Attributes

Gaudi::Property< float > m_maxDeltaTheta
Gaudi::Accumulators::Counter n_foundTracks { this, "Number of Tracks properly reconstructed" }
Gaudi::Accumulators::Counter n_ghostTracks { this, "Number of ghost Tracks" }
Gaudi::Accumulators::Counter n_duplicatedTracks { this, "Number of Tracks reconstructed twice" }
Gaudi::Accumulators::Counter n_lostTracks { this, "Number of Tracks missing after reconstruction" }

Detailed Description

Comparison of Reconstructed Tracks and MCTracks.

Definition at line 25 of file CheckerAlg.cpp.

Constructor & Destructor Documentation

◆ CheckerAlg()

Gaudi::Example::TinyExperiment::CheckerAlg::CheckerAlg ( const std::string & name,
ISvcLocator * pSvcLocator )
inline

Definition at line 27 of file CheckerAlg.cpp.

28 : Consumer(
29 name, pSvcLocator,
30 { KeyValue{ "MCTracksLocation", "/Event/MCTracks" }, KeyValue{ "TracksLocation", "/Event/Tracks" } } ) {}
details::Consumer< Signature, Traits_, details::isLegacy< Traits_ > > Consumer
Definition Consumer.h:47

Member Function Documentation

◆ almostEqual()

bool Gaudi::Example::TinyExperiment::CheckerAlg::almostEqual ( float a,
float b ) const
inlineprivate

Definition at line 58 of file CheckerAlg.cpp.

58{ return std::abs( a - b ) <= m_maxDeltaTheta; }
Gaudi::Property< float > m_maxDeltaTheta
Gaudi::ParticleID abs(const Gaudi::ParticleID &p)
Return the absolute value for a PID.
Definition ParticleID.h:191

◆ operator()()

void Gaudi::Example::TinyExperiment::CheckerAlg::operator() ( MCTracks const & mcTracks,
Tracks const & tracks ) const
inlineoverride

Definition at line 32 of file CheckerAlg.cpp.

32 {
33 for ( auto const& track : tracks ) {
34 MCTracks selection;
35 selection.reserve( 10 );
36 std::copy_if( mcTracks.begin(), mcTracks.end(), std::back_inserter( selection ),
37 [track, this]( MCTrack mcTrack ) { return almostEqual( track.theta, mcTrack.theta ); } );
38 if ( selection.size() == 0 ) {
40 } else {
42 }
43 }
44 for ( auto const& mcTrack : mcTracks ) {
45 Tracks selection;
46 selection.reserve( 10 );
47 std::copy_if( tracks.begin(), tracks.end(), std::back_inserter( selection ),
48 [mcTrack, this]( Track track ) { return almostEqual( track.theta, mcTrack.theta ); } );
49 if ( selection.size() == 0 ) {
51 } else if ( selection.size() > 1 ) {
53 }
54 }
55 }
Gaudi::Accumulators::Counter n_duplicatedTracks
Gaudi::Accumulators::Counter n_lostTracks
Gaudi::Accumulators::Counter n_foundTracks
Gaudi::Accumulators::Counter n_ghostTracks
std::vector< MCTrack > MCTracks
Definition MCTrack.h:28
std::vector< Track > Tracks
Definition Track.h:28

Member Data Documentation

◆ m_maxDeltaTheta

Gaudi::Property<float> Gaudi::Example::TinyExperiment::CheckerAlg::m_maxDeltaTheta
private
Initial value:
{ this, "DeltaThetaMax", 0.001,
"(Relative) maximum delta theta to consider 2 tracks as identical" }

Definition at line 60 of file CheckerAlg.cpp.

60 { this, "DeltaThetaMax", 0.001,
61 "(Relative) maximum delta theta to consider 2 tracks as identical" };

◆ n_duplicatedTracks

Gaudi::Accumulators::Counter Gaudi::Example::TinyExperiment::CheckerAlg::n_duplicatedTracks { this, "Number of Tracks reconstructed twice" }
mutableprivate

Definition at line 64 of file CheckerAlg.cpp.

64{ this, "Number of Tracks reconstructed twice" };

◆ n_foundTracks

Gaudi::Accumulators::Counter Gaudi::Example::TinyExperiment::CheckerAlg::n_foundTracks { this, "Number of Tracks properly reconstructed" }
mutableprivate

Definition at line 62 of file CheckerAlg.cpp.

62{ this, "Number of Tracks properly reconstructed" };

◆ n_ghostTracks

Gaudi::Accumulators::Counter Gaudi::Example::TinyExperiment::CheckerAlg::n_ghostTracks { this, "Number of ghost Tracks" }
mutableprivate

Definition at line 63 of file CheckerAlg.cpp.

63{ this, "Number of ghost Tracks" };

◆ n_lostTracks

Gaudi::Accumulators::Counter Gaudi::Example::TinyExperiment::CheckerAlg::n_lostTracks { this, "Number of Tracks missing after reconstruction" }
mutableprivate

Definition at line 65 of file CheckerAlg.cpp.

65{ this, "Number of Tracks missing after reconstruction" };

The documentation for this class was generated from the following file: