ATLAS Offline Software
FakeLArOFCs.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 
10 FakeLArOFCs::FakeLArOFCs(const std::string & name, ISvcLocator * pSvcLocator):
11  AthAlgorithm(name, pSvcLocator)
12 {
13  declareProperty("MaxSample",m_maxSample=2);
14  declareProperty("NSample",m_NSample=5);
15  declareProperty("OFCKey",m_keyOFC="LArOFC");
16 }
17 
19 
20 
22  const LArOnlineID* onlineHelper = nullptr;
23  ATH_CHECK( detStore()->retrieve(onlineHelper, "LArOnlineID") );
24 
25  std::vector<std::vector<float> > aVec(25);
26  for (int i=0;i<m_NSample;i++)
27  if (i==m_maxSample)
28  aVec[0].push_back(1);
29  else
30  aVec[0].push_back(0);
31 
32  std::vector< std::vector<float> > bVec(25); //Stays zero-size;
33  LArOFCComplete* larOFCComplete=new LArOFCComplete();
34  for(int igain=0; igain<3; igain++) {
35  for (HWIdentifier ch_id : onlineHelper->channel_range()) {
36  larOFCComplete->set(ch_id,(int)igain,aVec,bVec);
37  }
38  }//End loop over gains.
39  ATH_CHECK( detStore()->record(larOFCComplete,m_keyOFC) );
40  const ILArOFC* iLArOFC=larOFCComplete;
41  ATH_CHECK (detStore()->symLink(larOFCComplete,iLArOFC) );
42  return StatusCode::SUCCESS;
43 }
44 
46 {return StatusCode::SUCCESS;}
47 
49 {return StatusCode::SUCCESS;}
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArOFCComplete::set
void set(const HWIdentifier &CellID, int gain, const std::vector< std::vector< float > > &vOFC_a, const std::vector< std::vector< float > > &vOFC_b, float timeOffset=0, float timeBinWidth=25./24.)
Definition: LArOFCComplete.cxx:17
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
FakeLArOFCs::FakeLArOFCs
FakeLArOFCs(const std::string &name, ISvcLocator *pSvcLocator)
Definition: FakeLArOFCs.cxx:10
FakeLArOFCs.h
FakeLArOFCs::m_keyOFC
std::string m_keyOFC
Definition: FakeLArOFCs.h:21
HWIdentifier
Definition: HWIdentifier.h:13
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
FakeLArOFCs::initialize
StatusCode initialize()
Definition: FakeLArOFCs.cxx:21
LArOnlineID_Base::channel_range
id_range channel_range() const
Definition: LArOnlineID_Base.cxx:1932
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArOFCComplete.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
WriteCellNoiseToCool.igain
igain
Definition: WriteCellNoiseToCool.py:338
AthAlgorithm
Definition: AthAlgorithm.h:47
FakeLArOFCs::~FakeLArOFCs
~FakeLArOFCs()
Definition: FakeLArOFCs.cxx:18
ILArOFC
Definition: ILArOFC.h:14
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LArOnlineID
Definition: LArOnlineID.h:20
FakeLArOFCs::m_maxSample
short m_maxSample
Definition: FakeLArOFCs.h:20
FakeLArOFCs::m_NSample
short m_NSample
Definition: FakeLArOFCs.h:20
FakeLArOFCs::execute
StatusCode execute()
Definition: FakeLArOFCs.cxx:45
LArOFCComplete
This class implements the ILArOFC interface.
Definition: LArOFCComplete.h:25
LArOnlineID.h
FakeLArOFCs::finalize
StatusCode finalize()
Definition: FakeLArOFCs.cxx:48