ATLAS Offline Software
Loading...
Searching...
No Matches
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
10FakeLArOFCs::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;}
#define ATH_CHECK
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
FakeLArOFCs(const std::string &name, ISvcLocator *pSvcLocator)
short m_maxSample
Definition FakeLArOFCs.h:20
StatusCode finalize()
short m_NSample
Definition FakeLArOFCs.h:20
StatusCode execute()
std::string m_keyOFC
Definition FakeLArOFCs.h:21
StatusCode initialize()
This class implements the ILArOFC interface.
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.)
id_range channel_range() const