TrigMultiTrkHypo.h 4.8 KB
Newer Older
1
/*
2
  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
4
5
6
*/

/**************************************************************************
 **
7
 **   File: Trigger/TrigHypothesis/TrigBphysHypo/TrigMultiTrkHypo.h
8
 **
9
 **   Description: multi-track hypothesis algorithm
10
11
12
 **
 **   Author: H. Russell
 **
13
 **************************************************************************/
14

15
16
#ifndef TRIG_TrigMultiTrkHypo_H
#define TRIG_TrigMultiTrkHypo_H
17
18
19
20
21
22
23

// standard stuff
#include <string>
// general athena stuff
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/IToolSvc.h"
#include "GaudiKernel/StatusCode.h"
24
25
#include "xAODMuon/MuonContainer.h"

26
27
28
29
30
31
32
33
#include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "AthViews/View.h"
#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h"

#include "DecisionHandling/TrigCompositeUtils.h"

34
#include "TrigMultiTrkHypoTool.h"
35
36
37
38
#include "TrigBphysHelperUtilsTool.h"

#include "DecisionHandling/HypoBase.h"

39
#include "Constants.h"
40

Charles Burton's avatar
Charles Burton committed
41
42
#include "AthenaMonitoringKernel/Monitored.h"
#include "AthenaMonitoringKernel/GenericMonitoringTool.h"
43

44
45
46
#include "TrkVKalVrtFitter/TrkVKalVrtFitter.h"
#include "InDetConversionFinderTools/VertexPointEstimator.h"

47

48
class TrigMultiTrkHypo: public ::HypoBase  {
49
50
  enum { MaxNumberTools = 20 };
  public:
51
52
    TrigMultiTrkHypo(const std::string & name, ISvcLocator* pSvcLocator);
    ~TrigMultiTrkHypo();
53
54
55
56
57

    virtual StatusCode  initialize() override;
   virtual StatusCode  execute( const EventContext& context ) const override;
   virtual StatusCode  finalize() override;

58
59
60
61
  protected:
   //The vertexing tool is not reentrant so this algorithm cannot be used reentrantly
   bool isReEntrant() const override { return false; }

62
63
  private:

64
65
    TrigMultiTrkHypo();
    ToolHandleArray< TrigMultiTrkHypoTool > m_hypoTools {this, "HypoTools", {}, "Tools to perform selection"};
66
67
68
69
70
71

	bool passNTracks(int nObjMin,
                 const std::vector<float> & ptObjMin,
  				 const std::vector<ElementLink<xAOD::TrackParticleContainer> > & inputTrkVec,
                 std::vector<ElementLink<xAOD::TrackParticleContainer> > & outputTrkVec,
                 float mindR) const;
72

73
74
75
76
77
    SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackParticleContainerKey{ this,
        "trackCollectionKey",         // property name
        "Tracks",                     // default value of StoreGate key
        "input TrackParticle container name"};

78
79
80
81
82
    SG::ReadHandleKey<xAOD::MuonContainer> m_muonContainerKey{ this,
        "MuonCollectionKey",         // property name
        "CBCombinedMuon",                     // default value of StoreGate key
        "input EF Muon container name"};

83
84
85
86
87
88
    SG::WriteHandleKey<xAOD::TrigBphysContainer> m_bphysObjContKey{ this,
        "bphysCollectionKey",         // property name
        "TrigBphysContainer",         // default value of StoreGate key
        "Output TrigBphysContainer name"};

  static bool sortTracks(ElementLink<xAOD::TrackParticleContainer> &l1, ElementLink<xAOD::TrackParticleContainer> &l2)
89
  {
90
91
92
    return (*l1)->pt() > (*l2)->pt();
  }

93
94
95
96
97
  xAOD::TrigBphys* fit(const std::vector<ElementLink<xAOD::TrackParticleContainer>>& tracklist) const;

  ToolHandle<InDet::VertexPointEstimator> m_vertexPointEstimator{this, "VertexPointEstimator", "", "find starting point for the vertex fitter"};
  ToolHandle<Trk::TrkVKalVrtFitter> m_vertexFitter{this, "VertexFitter", "", "VKalVrtFitter tool to fit tracks into the common vertex"};
  std::unique_ptr<Trk::IVKalState> m_vertexFitterState;
98
99
100
101
102
103
104
105
106
107

  Gaudi::Property<int> m_nTrk { this, "nTrk",2,"Number of tracks in the vertex"};
  Gaudi::Property<int> m_nTrkQ { this, "nTrkCharge",-1,"sum of track charges"}; // if negative - no cut
  Gaudi::Property<std::vector<double>> m_trkMasses {this, "trackMasses", {105.6583745,105.6583745}, "track masses for vertex reco (one per track!)"};
  Gaudi::Property<std::vector<float>> m_ptTrkMin { this, "trkPtThresholds", {3650, 3650} ,"minimum track pTs (one per track, sorted descending!)"};

  Gaudi::Property<std::vector<float>> m_nTrkMassMin { this, "nTrackMassMin", {0},"list of mins for nTrk mass windows"}; // both min+max need to be defined
  Gaudi::Property<std::vector<float>> m_nTrkMassMax { this, "nTrackMassMax", {100000},"list of maxes for nTrk mass windows"};

  Gaudi::Property<float> m_mindR { this, "overlapdR",0.01 ,"Minimum dR between tracks (overlap removal)"};
108
109
110
111
112

  Gaudi::Property<int> m_particleType { this, "particleType", 0, "Types of particles to use. 0 = tracks, 1 = EF Muons, 2 = tbd..."};

  Gaudi::Property<std::string> m_trigLevelString { this, "trigLevelString", "", "Trigger Level to set for created TrigBphys objects."};

113
  ToolHandle< GenericMonitoringTool > m_monTool { this, "MonTool", "", "Monitoring tool" };
114

115
  xAOD::TrigBphys::levelType m_trigLevel;
116
117
118

};

119
#endif  // TRIG_TrigMultiTrkHypo_H