ATLAS Offline Software
Loading...
Searching...
No Matches
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
18namespace DerivationFramework {
19
21 const std::string& n,
22 const IInterface* p) :
23 base_class(t,n,p),
25 m_collName("xAODTriggerTowers")
26 {
27 declareProperty("TriggerTowerContainer",m_collName);
28 declareProperty("adcThreshold",m_adcThreshold);
29 }
30
32 {
33 ATH_MSG_VERBOSE("initialize() ...");
34 return StatusCode::SUCCESS;
35 }
36
38 {
39 return StatusCode::SUCCESS;
40 }
41
43 {
44 bool acceptEvent(false);
45
46 // check for triggertowers
48
49 // Retrieve data
50 const xAOD::TriggerTowerContainer* triggertowers(nullptr);
51 CHECK( evtStore()->retrieve( triggertowers , m_collName ), false );
52
53 if( !triggertowers ) {
54 ATH_MSG_ERROR("Couldn't retrieve triggertower container with key: " << m_collName);
55 return false;
56 }
57 // LOOP OVER TRIGGERTOWERS
58 int adcvalue(0);
59 for (xAOD::TriggerTowerContainer::const_iterator eIt = triggertowers->begin(); eIt!=triggertowers->end(); ++eIt) {
60 for(int i=0; i<5; i++){
61 adcvalue = (*eIt)->adc()[i];
62 if(adcvalue > m_adcThreshold){
63 acceptEvent = true;
64 return acceptEvent;
65 }
66 }
67 }
68
69 } // check for trigger towers
70
71 return acceptEvent;
72 }
73
74} // end of namespace
75
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define CHECK(...)
Evaluate an expression and check for errors.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
SaturatedTriggerTower(const std::string &t, const std::string &n, const IInterface *p)
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114
THE reconstruction tool.
TriggerTowerContainer_v2 TriggerTowerContainer
Define the latest version of the TriggerTower container.