GetFlavourTaggingParticles.h 3.16 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*****************************************************************************\
* (c) Copyright 2000-2021 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.                                       *
\*****************************************************************************/
#pragma once

// from Gaudi
#include "GaudiAlg/Transformer.h"

// from LHCb
#include "DetDesc/DetectorElement.h"
#include "DetDesc/GenericConditionAccessorHolder.h"
#include "Event/Particle.h"
#include "Event/RecVertex.h"
#include "Kernel/IDistanceCalculator.h"
#include "Kernel/IRelatedPVFinder.h"

class GetFlavourTaggingParticles
    : public Gaudi::Functional::Transformer<LHCb::Particle::Selection(
26
                                                const LHCb::Particle::Range&, const LHCb::Particle::Range&,
27
28
29
30
31
32
33
34
35
36
                                                const LHCb::RecVertices&, const DetectorElement& ),
                                            LHCb::DetDesc::usesConditions<DetectorElement>> {
public:
  /// Standard constructor
  GetFlavourTaggingParticles( const std::string& name, ISvcLocator* pSvcLocator )
      : Transformer( name, pSvcLocator,
                     {KeyValue{"BCandidates", ""}, KeyValue{"TaggingParticles", ""}, KeyValue{"PrimaryVertices", ""},
                      KeyValue{"StandardGeometry", "/dd/Structure/LHCb"}},
                     KeyValue{"FlavourTaggingParticles", ""} ) {}

37
  LHCb::Particle::Selection operator()( const LHCb::Particle::Range& bCandidates,
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
                                        const LHCb::Particle::Range& taggingParticles,
                                        const LHCb::RecVertices&     primaryVertices,
                                        const DetectorElement& ) const override;

private:
  Gaudi::Property<double> m_minIpChi2{this, "MinIpChi2", 6.,
                                      "Tagging particle requirement: Minimum IPChi2 wrt to all PVs"};

  std::optional<double> calcMinIpChi2( const LHCb::Particle& part, const LHCb::RecVertices& vertices,
                                       const IGeometryInfo& geometry ) const;

  std::optional<double> calcIpChi2( const LHCb::Particle& part, const LHCb::VertexBase& vertex,
                                    const IGeometryInfo& geometry ) const;

  ToolHandle<IRelatedPVFinder> m_relatedPVTool{
      this, "RelatedPVFinderTool", "GenericParticle2PVRelator__p2PVWithIPChi2_OnlineDistanceCalculatorName_"};
  ToolHandle<IDistanceCalculator> m_distCalcTool{this, "DistanceCalculatorTool", "LoKi::TrgDistanceCalculator"};

  mutable Gaudi::Accumulators::SummingCounter<> m_inCount{this, "#InputParticles"};
  mutable Gaudi::Accumulators::SummingCounter<> m_outCount{this, "#OutputParticles"};
};