ATLAS Offline Software
SaturatedTriggerTower.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SaturatedTriggerTower.cxx, (c) ATLAS Detector software
8 // Author: Ben Allen (benjamin.william.allen@cern.ch)
9 // Adapted heavily from code originally written by
10 // James Catmore (james.catmore@cern.ch)
11 //
12 
15 #include <vector>
16 #include <string>
17 
18 namespace DerivationFramework {
19 
21  const std::string& n,
22  const IInterface* p) :
23  AthAlgTool(t,n,p),
24  m_adcThreshold(0),
25  m_collName("xAODTriggerTowers")
26  {
27  declareInterface<DerivationFramework::ISkimmingTool>(this);
28  declareProperty("TriggerTowerContainer",m_collName);
29  declareProperty("adcThreshold",m_adcThreshold);
30  }
31 
33  {
34  ATH_MSG_VERBOSE("initialize() ...");
35  return StatusCode::SUCCESS;
36  }
37 
39  {
40  return StatusCode::SUCCESS;
41  }
42 
44  {
45  bool acceptEvent(false);
46 
47  // check for triggertowers
48  if (evtStore()->contains<xAOD::TriggerTowerContainer>( m_collName )) {
49 
50  // Retrieve data
51  const xAOD::TriggerTowerContainer* triggertowers(nullptr);
52  CHECK( evtStore()->retrieve( triggertowers , m_collName ), false );
53 
54  if( !triggertowers ) {
55  ATH_MSG_ERROR("Couldn't retrieve triggertower container with key: " << m_collName);
56  return false;
57  }
58  // LOOP OVER TRIGGERTOWERS
59  int adcvalue(0);
60  for (xAOD::TriggerTowerContainer::const_iterator eIt = triggertowers->begin(); eIt!=triggertowers->end(); ++eIt) {
61  for(int i=0; i<5; i++){
62  adcvalue = (*eIt)->adc()[i];
63  if(adcvalue > m_adcThreshold){
64  acceptEvent = true;
65  return acceptEvent;
66  }
67  }
68  }
69 
70  } // check for trigger towers
71 
72  return acceptEvent;
73  }
74 
75 } // end of namespace
76 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
DerivationFramework::SaturatedTriggerTower::initialize
StatusCode initialize()
Definition: SaturatedTriggerTower.cxx:32
TriggerTowerContainer.h
DerivationFramework::SaturatedTriggerTower::m_collName
std::string m_collName
Definition: SaturatedTriggerTower.h:29
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
DerivationFramework::SaturatedTriggerTower::SaturatedTriggerTower
SaturatedTriggerTower(const std::string &t, const std::string &n, const IInterface *p)
Definition: SaturatedTriggerTower.cxx:20
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::SaturatedTriggerTower::m_adcThreshold
int m_adcThreshold
Definition: SaturatedTriggerTower.h:28
DerivationFramework::SaturatedTriggerTower::finalize
StatusCode finalize()
Definition: SaturatedTriggerTower.cxx:38
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DerivationFramework::SaturatedTriggerTower::eventPassesFilter
virtual bool eventPassesFilter() const
Check that the current event passes this filter.
Definition: SaturatedTriggerTower.cxx:43
AthAlgTool
Definition: AthAlgTool.h:26
SaturatedTriggerTower.h
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.