ATLAS Offline Software
Loading...
Searching...
No Matches
LArFebTimeOffset2Ntuple.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
7
9
10LArFebTimeOffset2Ntuple::LArFebTimeOffset2Ntuple(const std::string & name, ISvcLocator * pSvcLocator) :
11 LArCond2NtupleBase(name,pSvcLocator) {
12
13 declareProperty("Gain",m_gain=0);
14 declareProperty("ContainerKey",m_inputContainer="FebTimeOffset");
15
16 m_ntTitle="FebTimeOffsets";
17 m_ntpath="/NTUPLES/FILE1/FEBTIME";
18}
19
21
22
24
25 //m_ntTitle="TimeDiffs";
26 //m_ntpath=std::string("/NTUPLES/FILE1/TIMEDIFF");
28}
29
30StatusCode LArFebTimeOffset2Ntuple::stop ATLAS_NOT_THREAD_SAFE () {
31
32 //std::cout << detStore()->dump() << std::endl;
33 NTuple::Item<float> offset;
34 NTuple::Item<long> gain;
35
36
37 m_nt->addItem("gain",gain,0,3).ignore();
38 m_nt->addItem("offset",offset,-5000,5000).ignore();
39
40 const LArFEBTimeOffset* feboffsets;
41 //if (detStore()->retrieve(feboffsets,m_inputContainer).isFailure()) {
42 if (detStore()->retrieve(feboffsets).isFailure()) {
43 ATH_MSG_ERROR( "Failed to retrieve LArFEBTimeOffset with key " << m_inputContainer );
44 return StatusCode::FAILURE;
45 }
46
47 const float novalue=-99999;
48 (const_cast<LArFEBTimeOffset*>(feboffsets))->setDefaultReturnValue(novalue);
49
50
51 for (const HWIdentifier fid: m_onlineId->feb_range()) {
52 offset=feboffsets->TimeOffset(fid);
53
54 //FIXME: The PhysWave shifter fills 0 for all not-present FEBs.
55 if (offset!=0 && offset!=novalue) {
56 gain=m_gain;
57 fillFromIdentifier(fid);
58
59 StatusCode sc=ntupleSvc()->writeRecord(m_nt);
60 if (sc!=StatusCode::SUCCESS) {
61 ATH_MSG_ERROR( "writeRecord failed" );
62 return StatusCode::FAILURE;
63 }
64 }//end if have value
65 } // end loop over feb identifiers
66
67 return StatusCode::SUCCESS;
68}
#define ATH_MSG_ERROR(x)
StatusCode LArFebTimeOffset2Ntuple::stop ATLAS_NOT_THREAD_SAFE()
Install fatal handler with default options.
static Double_t sc
INTupleSvc * ntupleSvc()
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
LArCond2NtupleBase(const std::string &name, ISvcLocator *pSvcLocator)
float TimeOffset(const HWIdentifier fId) const
virtual ~LArFebTimeOffset2Ntuple()
virtual StatusCode initialize() override
LArFebTimeOffset2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)