ATLAS Offline Software
Loading...
Searching...
No Matches
LArFillDSPConfig.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
10
12// Public methods:
14
15// Constructors
17LArFillDSPConfig::LArFillDSPConfig( const std::string& name,
18 ISvcLocator* pSvcLocator ) :
19 ::AthAlgorithm( name, pSvcLocator ),
20 m_onlineID(nullptr)
21{
22 declareProperty("Foldername",m_folderName="/LAR/Configuraton/DSPConfiguration");
23 declareProperty("Dump",m_dump=true);
24 declareProperty("isLowMu",m_lowmu=false);
25}
26
27// Destructor
30
31// Athena Algorithm's Hooks
34{
35 return StatusCode::SUCCESS;
36}
37
39
40
41 StatusCode sc=detStore()->retrieve(m_onlineID);
42 if (sc.isFailure()) {
43 ATH_MSG_ERROR( "Failed to get LArOnlineID" );
44 return sc;
45 }
46
47 const unsigned nFebs=m_onlineID->febHashMax();
48
49
50 LArDSPConfigWrite larDSPConfig;
51
52 for (unsigned iFeb=0;iFeb<nFebs;++iFeb) {
53 const HWIdentifier febId=m_onlineID->feb_Id(iFeb);
54 //bool useMGRampIntercept=(m_onlineID->isEMBchannel(febId) || m_onlineID->isEMECchannel(febId));
55 bool useMGRampIntercept=(m_onlineID->isEMBchannel(febId) || m_onlineID->isEMECOW(febId) );
56 if(m_lowmu) {
57 if(m_onlineID->isFCALchannel(febId)) useMGRampIntercept=true;
58 }
59 uint8_t peakSample=2;
60 if (m_onlineID->isHECchannel(febId)) peakSample=1; //HEC: peak-sample=1
61 larDSPConfig.set(iFeb,peakSample,useMGRampIntercept);
62 }
63
64
65 std::unique_ptr<AthenaAttributeList> pAttrList(larDSPConfig.attributeList());
66 ATH_CHECK(detStore()->record(std::move(pAttrList),m_folderName));
67 ATH_MSG_INFO( "Successfully recorded AthenaAttributeList containing DSP configuration for " << nFebs << " Febs" );
68
69 if (m_dump) {
70 //Crosscheck:
71 const AthenaAttributeList* attrList_read=nullptr;
72 ATH_CHECK(detStore()->retrieve(attrList_read,m_folderName));
73
74 LArDSPConfig config(attrList_read);
75
76 for (auto fit= m_onlineID->feb_begin();fit!=m_onlineID->feb_end();++fit) {
77 unsigned ps=config.peakSample(*fit);
78 bool ic=config.useMGRampIntercept(*fit);
79 std::cout << "FEB " << m_onlineID->channel_name(*fit) << ": peakSample=" << ps << " useMGIntercept=" << ic << std::endl;
80 }
81 }
82 return StatusCode::SUCCESS;
83}
84
85
86
87
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
static Double_t sc
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
An AttributeList represents a logical row of attributes in a metadata table.
void set(const IdentifierHash febId, const uint8_t peakSample, const bool useMGRampIntercept)
std::unique_ptr< AthenaAttributeList > attributeList()
virtual StatusCode stop()
LArFillDSPConfig()
Default constructor:
std::string m_folderName
StatusCode initialize()
const LArOnlineID * m_onlineID
virtual ~LArFillDSPConfig()
Destructor: