ATLAS Offline Software
TrigDecision.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /**********************************************************************************
6  * @Project: HLT
7  * @Package: TrigSteeringEvent
8  * @Class : TrigDecision
9  *
10  * @brief transient representation of all three trigger level information
11  *
12  * @author Nicolas Berger <Nicolas.Berger@cern.ch> - CERN
13  * @author Till Eifert <Till.Eifert@cern.ch> - U. of Geneva, Switzerland
14  * @author Ricardo Goncalo <Jose.Goncalo@cern.ch> - Royal Holloway, U. of London
15  * @author Fabrizio Salvatore <p.salvatore@cern.ch> - University of Sussex/
16  * - Royal Holloway, U. of London
17  *
18  * File and Version Information:
19  * $Id: TrigDecision.cxx,v 1.2 2009-02-05 18:04:30 tbold Exp $
20  **********************************************************************************/
21 
22 
24 
25 //#include "TrigSteering/Sequence.h"
26 
27 using namespace TrigDec;
28 
29 
31  : m_configMasterKey(0),
32  m_bgCode(0),
33  m_l2_result_ptr(0),
34  m_ef_result_ptr(0),
35  m_hlt_result_ptr(0)
36 {
37  // m_detailLevel = NONE;
38  // m_status = true;
39 }
40 
42  const HLT::HLTResult& l2Result,
43  const HLT::HLTResult& efResult,
44  uint32_t masterKey ) :
45  m_configMasterKey(masterKey),
46  m_bgCode(0),
47  m_l1_result(l1Result),
48  m_l2_result(l2Result),
49  m_ef_result(efResult),
50  m_l2_result_ptr(0),
51  m_ef_result_ptr(0),
52  m_hlt_result_ptr(0)
53 { }
54 
55 
57  const HLT::HLTResult& hltResult,
58  uint32_t masterKey ) :
59  m_configMasterKey(masterKey),
60  m_bgCode(0),
61  m_l1_result(l1Result),
62  // m_l2_result(0),
63  // m_ef_result(0),
64  m_hlt_result(hltResult),
65  m_l2_result_ptr(0),
66  m_ef_result_ptr(0),
67  m_hlt_result_ptr(0) { }
68 
69 
71  const DataLink<HLT::HLTResult>& l2Result,
72  const DataLink<HLT::HLTResult>& efResult,
73  uint32_t masterKey,
74  char bgCode)
75  : m_configMasterKey (masterKey),
76  m_bgCode(bgCode),
77  m_l1_result (l1Result),
78  m_l2_result (l2Result),
79  m_ef_result (efResult),
80  m_l2_result_ptr(nullptr),
81  m_ef_result_ptr(nullptr),
82  m_hlt_result_ptr(nullptr)
83 {
84 }
85 
86 
88 {
89  // resetCache();
90  // if pointers to HLT results pointers are set we own them (we need to handle od version)
91  if (m_l2_result_ptr)
92  delete m_l2_result_ptr;
93 
94  if (m_ef_result_ptr)
95  delete m_ef_result_ptr;
96 
97 
98  if (m_hlt_result_ptr)
99  delete m_hlt_result_ptr;
100 
101 }
102 
103 namespace {
104  static const HLT::HLTResult invalid_result;
105 }
106 
108  if (m_l2_result_ptr) // if we have ptr we should use it (old data 13.0.X and 14.0.0)
109  return *m_l2_result_ptr;
110  if (m_l2_result.isValid()) { // add protection against invalid DataLinks
111  return *m_l2_result; // this is data link, derefencing it means whole lot different thing
112  } else {
113  return invalid_result; // if DataLink invalid, return dummy HLTResult
114  }
115 }
116 
117 
119  if (m_ef_result_ptr) // if we have ptr we should use it (old data 13.0.X and 14.0.0)
120  return *m_ef_result_ptr;
121  if (m_ef_result.isValid()) { // add protection against invalid DataLinks
122  return *m_ef_result; // this is data link, derefencing it means whole lot different thing
123  } else {
124  return invalid_result; // if DataLink invalid, return dummy HLTResult
125  }
126 }
127 
128 
130  if (m_hlt_result_ptr) // if we have ptr we should use it (old data 13.0.X and 14.0.0)
131  return *m_hlt_result_ptr;
132  if (m_hlt_result.isValid()) { // add protection against invalid DataLinks
133  return *m_hlt_result; // this is data link, derefencing it means whole lot different thing
134  } else {
135  return invalid_result; // if DataLink invalid, return dummy HLTResult
136  }
137 }
138 
TrigDec::TrigDecision::TrigDecision
TrigDecision()
Definition: TrigDecision.cxx:30
TrigDec
Definition: ITrigDecisionCnvTool.h:18
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::bgCode
bgCode
Definition: TrigDecision_v1.cxx:39
TrigDec::TrigDecision::m_hlt_result_ptr
HLT::HLTResult * m_hlt_result_ptr
Definition: Trigger/TrigEvent/TrigDecisionEvent/TrigDecisionEvent/TrigDecision.h:115
TrigDec::TrigDecision::getHLTResult
const HLT::HLTResult & getHLTResult() const
Definition: TrigDecision.cxx:129
TrigDec::TrigDecision::m_ef_result_ptr
HLT::HLTResult * m_ef_result_ptr
Definition: Trigger/TrigEvent/TrigDecisionEvent/TrigDecisionEvent/TrigDecision.h:114
TrigDecision.h
TrigDec::TrigDecision::m_l2_result_ptr
HLT::HLTResult * m_l2_result_ptr
Definition: Trigger/TrigEvent/TrigDecisionEvent/TrigDecisionEvent/TrigDecision.h:113
TrigDec::TrigDecision::~TrigDecision
virtual ~TrigDecision()
Definition: TrigDecision.cxx:87
HLT::HLTResult
HLT::HLTResult is sumarising result of trigger decision evaluation (online/offline) It contains basic...
Definition: HLTResult.h:57
TrigDec::TrigDecision::m_hlt_result
DataLink< HLT::HLTResult > m_hlt_result
HLTResult of merged L2EF.
Definition: Trigger/TrigEvent/TrigDecisionEvent/TrigDecisionEvent/TrigDecision.h:111
LVL1CTP::Lvl1Result
Definition: Lvl1Result.h:32
TrigDec::TrigDecision::getEFResult
const HLT::HLTResult & getEFResult() const
Definition: TrigDecision.cxx:118
TrigDec::TrigDecision::m_ef_result
DataLink< HLT::HLTResult > m_ef_result
HLTResult of trigger level EF.
Definition: Trigger/TrigEvent/TrigDecisionEvent/TrigDecisionEvent/TrigDecision.h:110
TrigDec::TrigDecision::m_l2_result
DataLink< HLT::HLTResult > m_l2_result
HLTResult of trigger level 2.
Definition: Trigger/TrigEvent/TrigDecisionEvent/TrigDecisionEvent/TrigDecision.h:109
TrigDec::TrigDecision::getL2Result
const HLT::HLTResult & getL2Result() const
Definition: TrigDecision.cxx:107