ATLAS Offline Software
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 
20 namespace LVL1 {
21 
22 Run2CPMTowerMaker::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 
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 
LVL1::Run2CPMTowerMaker::Run2CPMTowerMaker
Run2CPMTowerMaker(const std::string &name, ISvcLocator *pSvcLocator)
Definition: Run2CPMTowerMaker.cxx:22
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::Run2CPMTowerMaker::m_CPMTowerTool
ToolHandle< LVL1::IL1CPMTowerTools > m_CPMTowerTool
Definition: Run2CPMTowerMaker.h:78
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
LVL1::Run2CPMTowerMaker::initialize
StatusCode initialize()
the initialise() method is called at the start of processing, so we set up any histograms etc.
Definition: Run2CPMTowerMaker.cxx:29
LVL1::Run2CPMTowerMaker::execute
StatusCode execute()
Definition: Run2CPMTowerMaker.cxx:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthAlgorithm
Definition: AthAlgorithm.h:47
TrigConf::name
Definition: HLTChainList.h:35
LVL1::Run2CPMTowerMaker::m_triggerTowerKey
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerKey
locations within the TES to store collections of JEs
Definition: Run2CPMTowerMaker.h:81
CPMTower_ClassDEF.h
Run2CPMTowerMaker.h
DEBUG
#define DEBUG
Definition: page_access.h:11
LVL1::Run2CPMTowerMaker::m_cpmTowerKey
SG::WriteHandleKey< CPMTCollection > m_cpmTowerKey
Definition: Run2CPMTowerMaker.h:82