ATLAS Offline Software
Loading...
Searching...
No Matches
Run2CPMTowerMaker.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// Run2CPMTowerMaker class Implementation
7// ================================================
8//
9//
10//
11
12#include <cmath>
13
14// This algorithm includes
15#include "Run2CPMTowerMaker.h"
17
18
19
20namespace LVL1 {
21
22Run2CPMTowerMaker::Run2CPMTowerMaker( const std::string& name, ISvcLocator* pSvcLocator )
23 : AthAlgorithm( name, pSvcLocator ),
24 m_CPMTowerTool("LVL1::L1CPMTowerTools/L1CPMTowerTools") {}
25
26
30{
31 ATH_CHECK( m_CPMTowerTool.retrieve() );
32 ATH_CHECK(m_triggerTowerKey.initialize());
33 ATH_CHECK(m_cpmTowerKey.initialize());
34 return StatusCode::SUCCESS ;
35}
36
37
47
48
50{
51 ATH_MSG_DEBUG ( "Executing" ) ;
52
53 // Vectors to store CPMTs in
54 auto CPMTs = SG::makeHandle(m_cpmTowerKey);
55 auto vectorOfCPMTs = std::make_unique<CPMTCollection>();
56 auto cpmtAuxVector = std::make_unique<CPMTAuxCollection>();
57 vectorOfCPMTs->setStore(cpmtAuxVector.get());
58
59 // Retrieve TriggerTowers from StoreGate
60 auto vectorOfTTs = SG::makeHandle(m_triggerTowerKey);
61 ATH_CHECK(vectorOfTTs.isValid());
62 // Fill a DataVector of CPMTowers using L1CPMTowerTools
63 m_CPMTowerTool->makeCPMTowers(vectorOfTTs.get(), vectorOfCPMTs.get(), true);
64 ATH_MSG_DEBUG( vectorOfCPMTs->size()<<" CPMTowers have been generated") ;
65
66 if (msgLvl(MSG::DEBUG)) {
67 ATH_MSG_DEBUG ( "Formed " << vectorOfCPMTs->size() << " CPM Towers " ) ;
68
70 for (itCPMT = vectorOfCPMTs->begin(); itCPMT != vectorOfCPMTs->end(); ++itCPMT)
71 ATH_MSG_DEBUG("CPMT has coords (" << (*itCPMT)->eta() <<", "<< (*itCPMT)->phi() << ") and energies : "
72 << (*itCPMT)->emEnergy() <<", "<< (*itCPMT)->hadEnergy() <<" (Em,Had)" );
73 }
74 ATH_CHECK(CPMTs.record(std::move(vectorOfCPMTs), std::move(cpmtAuxVector)));
75
76 return StatusCode::SUCCESS;
77
78}//end execute
79
80} // end of namespace bracket
81
82
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
bool msgLvl(const MSG::Level lvl) const
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
SG::WriteHandleKey< CPMTCollection > m_cpmTowerKey
Run2CPMTowerMaker(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize()
the initialise() method is called at the start of processing, so we set up any histograms etc.
ToolHandle< LVL1::IL1CPMTowerTools > m_CPMTowerTool
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerKey
locations within the TES to store collections of JEs
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())