|
ATLAS Offline Software
|
fix electronic calibration constants for SC
More...
#include <FixLArElecSCCalib.h>
|
| FixLArElecSCCalib (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~FixLArElecSCCalib () |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | stop () override |
|
void | print (const HWIdentifier &hwid, const LArOnlineID_Base *onlineID, const CaloCell_Base_ID *caloCellID, const Identifier *id=nullptr, std::vector< HWIdentifier > *calibIDs=nullptr, std::ostream &out=std::cout) |
|
StatusCode | fix1 () |
|
StatusCode | fix2 (const LArOnOffIdMapping *cabling, const LArCalibLineMapping *cl) |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
fix electronic calibration constants for SC
@based on FixLArElecCalib from Hong Ma hma@b.nosp@m.nl.g.nosp@m.ov This should be used with FixLArElecSCCalib_jobOptions.py to write a new POOL file.
Implemented fixes:
- Flag = 1 scale values for Pedestals and Ramps by factor
- Flag = 2 create calib. line mapping for SC
Definition at line 29 of file FixLArElecSCCalib.h.
◆ StoreGateSvc_t
◆ FixLArElecSCCalib()
FixLArElecSCCalib::FixLArElecSCCalib |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~FixLArElecSCCalib()
FixLArElecSCCalib::~FixLArElecSCCalib |
( |
| ) |
|
|
virtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode FixLArElecSCCalib::execute |
( |
| ) |
|
|
overridevirtual |
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
virtual StatusCode FixLArElecSCCalib::finalize |
( |
| ) |
|
|
inlineoverridevirtual |
◆ fix1()
StatusCode FixLArElecSCCalib::fix1 |
( |
| ) |
|
Definition at line 116 of file FixLArElecSCCalib.cxx.
126 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
127 spec->extend(
"Pedestal",
"blob");
128 spec->extend(
"PedestalRMS",
"blob");
129 spec->extend<
unsigned>(
"version");
136 (*attrList)[
"version"].setValue(0U);
139 blobPed.resize(hashMax*
sizeof(
float));
140 blobRMS.resize(hashMax*
sizeof(
float));
141 float* pblobPed=
static_cast<float*
>(blobPed.startingAddress());
142 float* pblobRMS=
static_cast<float*
>(blobRMS.startingAddress());
144 for (
unsigned hs=0;
hs<hashMax;++
hs) {
153 collPed->add(
gain,*attrList);
156 if (
sc.isFailure()) {
157 ATH_MSG_ERROR(
"Failed to record CondAttrListCollection for pedestal " );
168 spec =
new coral::AttributeListSpecification();
169 spec->extend(
"RampVec",
"blob");
170 spec->extend<
unsigned>(
"nPoints");
171 spec->extend<
unsigned>(
"version");
175 std::vector<float> defaultRamp={0.0,1.0};
181 for (
unsigned hs=0;
hs<hashMax && nPoints==0;++
hs) {
184 nPoints=rampref.size();
188 return StatusCode::FAILURE;
191 defaultRamp.resize(nPoints,0.0);
192 ATH_MSG_DEBUG(
"Gain " <<
gain <<
": Found a ramp polynom of degree " << nPoints <<
" in input data" );
194 (*attrList)[
"version"].setValue(0U);
196 (*attrList)[
"nPoints"].setValue(nPoints);
197 blobRamp.resize(hashMax*
sizeof(
float)*nPoints);
198 float* pblobRamp=
static_cast<float*
>(blobRamp.startingAddress());
200 for (
unsigned hs=0;
hs<hashMax;++
hs) {
204 if (rampVec.size()>=nPoints) {
205 for (
size_t i=0;
i<nPoints;++
i) {
211 message <<
"Polynom degree doesn't match. Expect " << nPoints <<
", got " << rampVec.size() <<
".";
212 for (
size_t i=0;
i<nPoints;++
i) {
213 pblobRamp[nPoints*
hs+
i]=defaultRamp[
i];
219 coll->add(
gain,*attrList);
221 sc=
detStore()->record(coll,
"/LAR/ElecCalibMCSC/Ramp");
222 if (
sc.isFailure()) {
223 ATH_MSG_ERROR(
"Failed to record CondAttrListCollection for ramp " );
224 return StatusCode::FAILURE;
227 ATH_MSG_INFO(
"Converted Ramps to inline storage. Total number of channels " <<
n );
228 ATH_MSG_INFO(
"Number of channels filled with default ramp {0,1} " << nDefault <<
" (including disconnected)" );
230 return StatusCode::SUCCESS;
◆ fix2()
Definition at line 233 of file FixLArElecSCCalib.cxx.
239 coral::AttributeListSpecification* spec_calib =
new coral::AttributeListSpecification();
240 spec_calib->extend(
"OnlineHashToCalibIds",
"blob");
241 spec_calib->extend<
unsigned>(
"version");
242 auto al_calib = std::make_unique<AthenaAttributeList>(*spec_calib);
244 (*al_calib)[
"version"].setValue(0U);
245 blobCalib.resize(onlHashMax*
sizeof(
uint32_t)*5);
248 spec_calib->release();
249 spec_calib =
nullptr;
255 std::vector<unsigned> calibHist(17,0);
256 unsigned calibHistMax=0;
258 std::ofstream
outfile(
"SCIdentifiers.txt");
260 outfile <<
"hash id bec pn FT SL chan id calo pn sampl reg eta phi calib" << std::endl;
262 for (
uint32_t onlHash=0;onlHash<onlHashMax;++onlHash) {
264 const std::vector<HWIdentifier>& calibIDs_tmp=
cl->calibSlotLine(hwid);
265 std::vector<HWIdentifier> calibIDs;
266 for (
unsigned i=0;
i<calibIDs_tmp.size(); ++
i) {
267 if(
std::find(calibIDs.begin(), calibIDs.end(), calibIDs_tmp[
i]) == calibIDs.end()) calibIDs.push_back(calibIDs_tmp[
i]);
273 if ((pLArIdBase ==
nullptr) or (pCaloCellBase==
nullptr)){
274 ATH_MSG_ERROR(
"dynamic_cast failed in FixLArElecSCCalib::fix2");
275 return StatusCode::FAILURE;
277 if (
cabling->isOnlineConnected(hwid)) {
278 id=
cabling->cnvToIdentifier(hwid);
279 print(hwid,pLArIdBase, pCaloCellBase,&
id,&calibIDs,
outfile);
281 print(hwid,pLArIdBase, pCaloCellBase,
nullptr,&calibIDs,
outfile);
283 const size_t nCalibLines=calibIDs.size();
284 if (nCalibLines > calibHistMax ) calibHistMax=nCalibLines;
285 if(calibHistMax > 17) {
286 ATH_MSG_ERROR(
"Too much calib lines, adjust please !!!" << calibHistMax);
287 return StatusCode::FAILURE;
289 (calibHist[nCalibLines])++;
290 pBlobCalib[calibIndex++]=nCalibLines;
291 for(
uint32_t iCalib=0;iCalib<nCalibLines;++iCalib)
292 pBlobCalib[calibIndex++]=calibIDs[iCalib].get_identifier32().get_compact();
294 blobCalib.resize(calibIndex*
sizeof(
uint32_t));
298 msg(MSG::INFO) <<
"nCalib[i] ";
299 for (
unsigned j=0;j<17;++j)
300 msg() << calibHist[j] <<
"/";
302 ATH_CHECK(
detStore()->record(std::move(al_calib),
"/LAR/IdentifierOfl/CalibIdMap_SC"));
303 return StatusCode::SUCCESS;
◆ initialize()
StatusCode FixLArElecSCCalib::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ print()
Definition at line 306 of file FixLArElecSCCalib.cxx.
311 << onlineID->
pos_neg(hwid) <<
" "
313 << onlineID->
slot(hwid) <<
" "
314 << onlineID->
channel(hwid) <<
" : ";
316 out << std::hex <<
"0x" <<
id->get_identifier32().get_compact() << std::dec <<
" "
318 << caloCellID->
pos_neg(*
id) <<
" "
320 << caloCellID->
region(*
id) <<
" "
321 << caloCellID->
eta(*
id) <<
" "
322 << caloCellID->
phi(*
id) <<
" ";
325 out <<
" disconnected ";
328 for (
size_t i=0;
i<calibIDs->size();++
i) {
329 out << std::hex <<
"0x" << calibIDs->at(
i).get_identifier32().get_compact() <<
" ";
334 out << std::dec << std::endl;
◆ renounce()
◆ renounceArray()
◆ stop()
StatusCode FixLArElecSCCalib::stop |
( |
| ) |
|
|
overridevirtual |
Definition at line 91 of file FixLArElecSCCalib.cxx.
96 case 1:
return fix1();
102 return StatusCode::FAILURE;
108 return StatusCode::FAILURE;
112 default:
return StatusCode::SUCCESS;
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_cablingKeySC
◆ m_CLKeySC
◆ m_detStore
◆ m_em_idhelper
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_fcal_idhelper
◆ m_fixFactor
double FixLArElecSCCalib::m_fixFactor = 0.0 |
|
private |
◆ m_fixFlag
int FixLArElecSCCalib::m_fixFlag |
|
private |
◆ m_hec_idhelper
◆ m_infile
std::string FixLArElecSCCalib::m_infile |
|
private |
◆ m_online_idhelper
◆ m_scell_idhelper
◆ m_sem_idhelper
◆ m_sfcal_idhelper
◆ m_shec_idhelper
◆ m_sonline_idhelper
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
std::string find(const std::string &s)
return a remapped string
const LArHEC_ID * m_hec_idhelper
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
const CaloCell_SuperCell_ID * m_scell_idhelper
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
std::vector< SG::VarHandleKeyArray * > m_vhka
const std::string & key() const
Return the StoreGate ID for the referenced object.
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
This class is a collection of AttributeLists where each one is associated with a channel number....
value_type get_compact() const
Get the compact id.
StatusCode fix2(const LArOnOffIdMapping *cabling, const LArCalibLineMapping *cl)
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
const LArHEC_SuperCell_ID * m_shec_idhelper
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
::StatusCode StatusCode
StatusCode definition for legacy code.
const LArEM_SuperCell_ID * m_sem_idhelper
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
int sub_calo(const Identifier id) const
returns an int taken from SUBCALO enum and describing the subCalo to which the Id belongs.
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
const LArEM_ID * m_em_idhelper
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Helper for the Liquid Argon Calorimeter cell identifiers.
void print(const HWIdentifier &hwid, const LArOnlineID_Base *onlineID, const CaloCell_Base_ID *caloCellID, const Identifier *id=nullptr, std::vector< HWIdentifier > *calibIDs=nullptr, std::ostream &out=std::cout)
size_type channelHashMax(void) const
Define channel hash tables max size.
SG::ReadCondHandleKey< LArCalibLineMapping > m_CLKeySC
StatusCode initialize(bool used=true)
int phi(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
virtual RampRef_t ADC2DAC(const HWIdentifier &CellID, int gain) const
const LArFCAL_SuperCell_ID * m_sfcal_idhelper
DataObjIDColl m_extendedExtraObjects
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
#define ATH_MSG_WARNING(x)
std::vector< value_type > asVector() const
Convert back to a vector.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
const LArFCAL_ID * m_fcal_idhelper
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
const LArOnlineID * m_online_idhelper
Helper base class for offline cell identifiers.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Proxy for accessing a range of float values like a vector.
const LArOnline_SuperCellID * m_sonline_idhelper