ATLAS Offline Software
Loading...
Searching...
No Matches
LArFEBTemp2Ntuple.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
9#include "GaudiKernel/IToolSvc.h"
10
11LArFEBTemp2Ntuple::LArFEBTemp2Ntuple(const std::string& name, ISvcLocator* pSvcLocator)
12 : LArCond2NtupleBase(name, pSvcLocator)
13{
14 m_ntTitle = "FEB Temperatures";
15 m_ntpath = "/NTUPLES/FILE1/FEBTEMP";
16}
17
19= default;
20
22 StatusCode sc;
23 NTuple::Item<float> temp1;
24 NTuple::Item<float> temp2;
25
26 sc=m_nt->addItem("temp1",temp1,-1000.,5000.);
27 if (sc!=StatusCode::SUCCESS)
28 {ATH_MSG_ERROR( "addItem 'temp1' failed" );
29 return StatusCode::FAILURE;
30 }
31
32 sc=m_nt->addItem("temp2",temp2,-1000.,5000.);
33 if (sc!=StatusCode::SUCCESS)
34 {ATH_MSG_ERROR( "addItem 'temp2' failed" );
35 return StatusCode::FAILURE;
36 }
37
38 SmartIF<IToolSvc> toolSvc{Gaudi::svcLocator()->service("ToolSvc")};
39 if(!toolSvc.isValid()) {
40 ATH_MSG_ERROR( "Unable to retrieve IToolSvc");
41 return StatusCode::FAILURE;
42 }
43
44 ILArFEBTempTool *larFEBTempTool;
45 sc = toolSvc->retrieveTool("LArFEBTempTool", larFEBTempTool);
46 if (sc!=StatusCode::SUCCESS) {
47 ATH_MSG_ERROR( "Unable to retrieve LArFEBTempTool from ToolSvc" );
48 return StatusCode::FAILURE;
49 }
50
51 for (const HWIdentifier hwid: m_onlineId->channel_range()) {
52 FEBTemp tv = larFEBTempTool->getFebTemp(hwid);
53 ATH_MSG_DEBUG( hwid << " " << tv.size() );
54
55 if( !tv.empty() )
56 {
57 FEBTemp::const_iterator itb = tv.begin();
58 FEBTemp::const_iterator ite = tv.end();
59
60 for(;itb!=ite;++itb)
61 {
62 temp1 = (*itb).first;
63 temp2 = (*itb).second;
64
66
67 sc=ntupleSvc()->writeRecord(m_nt);
68
69 if (sc!=StatusCode::SUCCESS)
70 {
71 ATH_MSG_ERROR( "writeRecord failed" );
72 return StatusCode::FAILURE;
73 }
74 }
75 }
76 }
77
78 ATH_MSG_INFO( "LArFEBTemp2Ntuple has finished." );
79
80 return StatusCode::SUCCESS;
81
82}// end finalize-method.
83
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
std::vector< std::pair< float, float > > FEBTemp
static Double_t sc
INTupleSvc * ntupleSvc()
Interface for Tool to provide FEB TEMP DCS information.
virtual FEBTemp getFebTemp(const HWIdentifier &id)=0
const LArOnlineID_Base * m_onlineId
bool fillFromIdentifier(const HWIdentifier &id)
LArCond2NtupleBase(const std::string &name, ISvcLocator *pSvcLocator)
LArFEBTemp2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode stop() override