ATLAS Offline Software
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 
10 LArFebTimeOffset2Ntuple::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 
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 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArFebTimeOffset2Ntuple::initialize
virtual StatusCode initialize() override
Definition: LArFebTimeOffset2Ntuple.cxx:23
LArFEBTimeOffset.h
LArFebTimeOffset2Ntuple::m_inputContainer
std::string m_inputContainer
Definition: LArFebTimeOffset2Ntuple.h:26
LArFEBTimeOffset
Definition: LArFEBTimeOffset.h:13
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArFebTimeOffset2Ntuple.h
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
HWIdentifier
Definition: HWIdentifier.h:13
LArCond2NtupleBase::initialize
StatusCode initialize()
Definition: LArCond2NtupleBase.cxx:33
LArCond2NtupleBase
Definition: LArCond2NtupleBase.h:32
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArFebTimeOffset2Ntuple::m_gain
int m_gain
Definition: LArFebTimeOffset2Ntuple.h:27
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArCond2NtupleBase::m_ntpath
std::string m_ntpath
Definition: LArCond2NtupleBase.h:65
LArFebTimeOffset2Ntuple::LArFebTimeOffset2Ntuple
LArFebTimeOffset2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
Definition: LArFebTimeOffset2Ntuple.cxx:10
LArFEBTimeOffset::TimeOffset
float TimeOffset(const HWIdentifier fId) const
Definition: LArFEBTimeOffset.h:33
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LArCond2NtupleBase::m_ntTitle
std::string m_ntTitle
Definition: LArCond2NtupleBase.h:65
ATLAS_NOT_THREAD_SAFE
StatusCode LArFebTimeOffset2Ntuple::stop ATLAS_NOT_THREAD_SAFE()
Install fatal handler with default options.
Definition: LArFebTimeOffset2Ntuple.cxx:30
LArFebTimeOffset2Ntuple::~LArFebTimeOffset2Ntuple
virtual ~LArFebTimeOffset2Ntuple()
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
ntupleSvc
INTupleSvc * ntupleSvc()
Definition: ServiceAccessor.h:14
LArOnlineID.h