|
ATLAS Offline Software
|
#include <LArHVCorrToSCHVCorr.h>
|
| LArHVCorrToSCHVCorr (const std::string &name, ISvcLocator *pSvcLocator) |
| Constructor with parameters: More...
|
|
virtual | ~LArHVCorrToSCHVCorr ()=default |
| Destructor: More...
|
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | stop () override |
|
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 |
|
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_cablingKeySC {this,"SCCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"} |
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"} |
|
SG::ReadCondHandleKey< ILArHVScaleCorr > | m_contKey {this,"ContainerKey","LArHVScaleCorr","SG Key of regular cells HV scale corr object"} |
|
SG::WriteCondHandleKey< LArHVCorr > | m_outKey {this,"OutputKey","LARSCHVScaleCorr","SG Key of produced SC HV scale corr object"} |
|
StringProperty | m_folderName {this, "OutputFolder", "/LAR/ElecCalibFlatSC/HVScaleCorr", "Output folder for CondAttrListCollection"} |
|
StringProperty | m_weightsName {this, "PhysicsWeights", "TrigT1CaloCalibUtils/HVcorrPhysicsWeights.txt", "File with layer weights"} |
|
ToolHandle< ICaloSuperCellIDTool > | m_scidTool {this, "CaloSuperCellIDTool", "CaloSuperCellIDTool"} |
|
DataObjIDColl | m_extendedExtraObjects |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 21 of file LArHVCorrToSCHVCorr.h.
◆ StoreGateSvc_t
◆ LArHVCorrToSCHVCorr()
LArHVCorrToSCHVCorr::LArHVCorrToSCHVCorr |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~LArHVCorrToSCHVCorr()
virtual LArHVCorrToSCHVCorr::~LArHVCorrToSCHVCorr |
( |
| ) |
|
|
virtualdefault |
◆ 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()
virtual StatusCode LArHVCorrToSCHVCorr::execute |
( |
| ) |
|
|
inlineoverridevirtual |
◆ 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();
◆ getWeight()
Definition at line 183 of file LArHVCorrToSCHVCorr.cxx.
185 int reg = hecID->
region(
id);
189 case -2:
if(reg==0) ttbin=-16-
eta;
else ttbin=-27-2*
eta;
if(ttbin==-33) ttbin=-32;
break;
190 case 2:
if(reg==0) ttbin=15+
eta;
else ttbin=25+2*
eta;
192 if(ttbin!=0 && wmap.find(ttbin) != wmap.end()){
194 return wmap[ttbin][hecID->
sampling(
id)];
◆ initialize()
StatusCode LArHVCorrToSCHVCorr::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.
◆ renounce()
◆ renounceArray()
◆ stop()
StatusCode LArHVCorrToSCHVCorr::stop |
( |
| ) |
|
|
overridevirtual |
Definition at line 40 of file LArHVCorrToSCHVCorr.cxx.
44 const EventContext& ctx = Gaudi::Hive::currentContext();
46 if(!hvHdl.isValid()) {
48 return StatusCode::FAILURE;
59 return StatusCode::FAILURE;
66 return StatusCode::FAILURE;
77 std::ifstream
fin(
file.c_str());
80 return StatusCode::FAILURE;
84 float em0,em1,em2,em3,em4;
85 float had0,had1,had2,had3;
86 std::map<int,std::vector<float> > wmap;
87 while (std::getline(
fin,
line)){
88 int nread = sscanf(
line.c_str(),
"%d %f %f %f %f %f %f %f %f %f",
89 &ttbin,&em0,&em1,&em2,&em3,&em4,&had0,&had1,&had2,&had3);
90 if(nread != 10)
continue;
91 wmap[ttbin]=std::vector<float>{had0,had1,had2,had3};
98 coral::AttributeListSpecification*
spec =
new coral::AttributeListSpecification();
99 spec->extend(
"HVScaleCorr",
"blob");
100 spec->extend<
unsigned>(
"version");
103 attrList[
"version"].setValue(0U);
113 float *pHV=
static_cast<float*
>(hvBlob.startingAddress());
114 std::vector<float> vScale;
121 unsigned nFilledIds=0;
122 unsigned nTotalIds=0;
123 for (
unsigned i=0;
i < hashMax; ++
i) {
127 const std::vector<Identifier> &cellIds=
m_scidTool->superCellToOfflineID(scId);
128 if (cellIds.empty()) {
129 ATH_MSG_ERROR(
"Got empty vector of cell ids for super cell id 0x"
131 return StatusCode::FAILURE;
140 hvcorr +=
weight * hvHdl->HVScaleCorr(
cabling->createSignalChannelID(cellId));
143 if(wsum>0.) hvcorr /= wsum;
147 pHV[onlSCID->
channel_Hash(cablingSC->createSignalChannelID(scId))]=hvcorr;
156 coll->
add(0,attrList);
158 ATH_MSG_INFO(
"Total number of SuperCells:" << nTotalIds <<
", filled:" << nFilledIds);
163 writeHandle.addDependency (fullRange);
164 writeHandle.addDependency(hvHdl);
165 writeHandle.addDependency(cablingHdl);
166 writeHandle.addDependency(cablingHdlSC);
168 auto scHvCorr = std::make_unique<LArHVCorr>(std::move(vScale), cablingSC, calosccellID);
169 if (writeHandle.record(std::move(scHvCorr)).isFailure()) {
171 <<
" with EventRange " << writeHandle.getRange() <<
" into Conditions Store");
172 return StatusCode::FAILURE;
174 ATH_MSG_INFO(
"Recorded new " << writeHandle.key() <<
" with range " << writeHandle.getRange() <<
" into Conditions Store");
176 if(
detStore()->symLink(scHvCorr.get(), imscale).isFailure()) {
177 ATH_MSG_WARNING(
"Could not symlink " << writeHandle.key() <<
" to ILArHVScaleCorr");
180 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_cablingKey
◆ m_cablingKeySC
◆ m_contKey
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_folderName
StringProperty LArHVCorrToSCHVCorr::m_folderName {this, "OutputFolder", "/LAR/ElecCalibFlatSC/HVScaleCorr", "Output folder for CondAttrListCollection"} |
|
private |
◆ m_outKey
◆ m_scidTool
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_weightsName
StringProperty LArHVCorrToSCHVCorr::m_weightsName {this, "PhysicsWeights", "TrigT1CaloCalibUtils/HVcorrPhysicsWeights.txt", "File with layer weights"} |
|
private |
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 eta(const Identifier id) const
return eta [0,9] outer part [0,3] inner part
ToolHandle< ICaloSuperCellIDTool > m_scidTool
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
value_type get_compact() const
Get the compact id.
Helper class for LArHEC offline identifiers.
SG::ReadCondHandleKey< ILArHVScaleCorr > m_contKey
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
This class is a collection of AttributeLists where each one is associated with a channel number....
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
StringProperty m_weightsName
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Helper class for offline supercell identifiers.
::StatusCode StatusCode
StatusCode definition for legacy code.
StringProperty m_folderName
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.
bool is_lar_hec(Identifier id) const
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
size_type channelHashMax(void) const
Define channel hash tables max size.
StatusCode initialize(bool used=true)
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
float getWeight(const LArHEC_ID *hecID, const Identifier &id, std::map< int, std::vector< float > > &wmap)
DataObjIDColl m_extendedExtraObjects
#define ATH_MSG_WARNING(x)
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
int pos_neg(const Identifier id) const
return pos_neg -2 (C side) or 2 (A side)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
SG::WriteCondHandleKey< LArHVCorr > m_outKey
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
int region(const Identifier id) const
return region [0,1]
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size