TauTruthMatchingAlg.cxx 1.26 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
26
27
28
29
30
31
32
33
34
35
/*
  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/

/// @author Nils Krumnack



//
// includes
//

#include <TauAnalysisAlgorithms/TauTruthMatchingAlg.h>

//
// method implementations
//

namespace CP
{
  TauTruthMatchingAlg ::
  TauTruthMatchingAlg (const std::string& name, 
                     ISvcLocator* pSvcLocator)
    : AnaAlgorithm (name, pSvcLocator)
    , m_matchingTool ("TauAnalysisTools::TauTruthMatchingTool", this)
  {
    declareProperty ("matchingTool", m_matchingTool, "the matching tool we apply");
  }



  StatusCode TauTruthMatchingAlg ::
  initialize ()
  {
    ANA_CHECK (m_matchingTool.retrieve());
36
    ANA_CHECK (m_tauHandle.initialize (m_systematicsList));
37
38
39
40
41
42
43
44
45
46
    ANA_CHECK (m_systematicsList.initialize());
    ANA_CHECK (m_preselection.initialize());
    return StatusCode::SUCCESS;
  }



  StatusCode TauTruthMatchingAlg ::
  execute ()
  {
47
48
    for (const auto& sys : m_systematicsList.systematicsVector())
    {
49
50
51
      const xAOD::TauJetContainer *taus = nullptr;
      ANA_CHECK (m_tauHandle.retrieve (taus, sys));
      for (const xAOD::TauJet *tau : *taus)
52
53
      {
        if (m_preselection.getBool (*tau))
54
        {
55
          m_matchingTool->applyTruthMatch (*tau);
56
        }
57
58
59
      }
    }
    return StatusCode::SUCCESS;
60
61
  }
}