ATLAS Offline Software
Loading...
Searching...
No Matches
FixLArElecSCCalib Class Reference

@based on FixLArElecCalib from Hong Ma hma@b.nosp@m.nl.g.nosp@m.ov More...

#include <FixLArElecSCCalib.h>

Inheritance diagram for FixLArElecSCCalib:
Collaboration diagram for FixLArElecSCCalib:

Public Member Functions

 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)
StatusCode fix3 (const LArOnOffIdMapping *cabling, const LArMCSym *sym)
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKeySC {this,"SCCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}
SG::ReadCondHandleKey< LArCalibLineMappingm_CLKeySC {this, "SCCalibLineKey", "LArCalibLineMapSC", "SG calib line key"}
SG::ReadCondHandleKey< LArMCSymm_mcSymKey { this, "MCSymKey", "LArMCSym", "SG Key of LArMCSym object" }
DoubleProperty m_fixFactor {this, "FixFactor", 0.0, "which factor to apply"}
IntegerProperty m_fixFlag {this, "FixFlag", 1, "which fix to run"}
StringProperty m_infile {this, "InputFile", "", "which file to read"}
const LArEM_SuperCell_IDm_sem_idhelper {}
const LArHEC_SuperCell_IDm_shec_idhelper {}
const LArFCAL_SuperCell_IDm_sfcal_idhelper {}
const LArOnline_SuperCellIDm_sonline_idhelper {}
const CaloCell_SuperCell_IDm_scell_idhelper {}
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

@based on FixLArElecCalib from Hong Ma hma@b.nosp@m.nl.g.nosp@m.ov

fix electronic calibration constants for SC

This should be used with FixLArElecSCCalib_jobOptions.py to write a new POOL file.

Implemented fixes:

  1. Flag = 1 scale values for Pedestals and Ramps by factor
  2. Flag = 2 create calib. line mapping for SC

Definition at line 26 of file FixLArElecSCCalib.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ FixLArElecSCCalib()

FixLArElecSCCalib::FixLArElecSCCalib ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 47 of file FixLArElecSCCalib.cxx.

47 :
48 AthAlgorithm(name,pSvcLocator){
49
50}
AthAlgorithm()
Default constructor:

◆ ~FixLArElecSCCalib()

FixLArElecSCCalib::~FixLArElecSCCalib ( )
virtual

Definition at line 52 of file FixLArElecSCCalib.cxx.

53{ }

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode FixLArElecSCCalib::execute ( )
overridevirtual

Definition at line 71 of file FixLArElecSCCalib.cxx.

71 {
72
73 ATH_MSG_INFO ( " in execute " );
74 return StatusCode::SUCCESS;
75}
#define ATH_MSG_INFO(x)

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ finalize()

virtual StatusCode FixLArElecSCCalib::finalize ( )
inlineoverridevirtual

Definition at line 34 of file FixLArElecSCCalib.h.

34{return StatusCode::SUCCESS;}

◆ fix1()

StatusCode FixLArElecSCCalib::fix1 ( )

Definition at line 117 of file FixLArElecSCCalib.cxx.

117 {
118
119 ATH_MSG_INFO ( " in fix1() " );
120
121 // Fix1 is for scaling the Pedestals and Rams
122 int n=0;
123
124 const LArPedestalSC *ped = nullptr;
125 CHECK(detStore()->retrieve(ped, "Pedestal_orig"));
126
127 coral::AttributeListSpecification* spec = new coral::AttributeListSpecification();
128 spec->extend("Pedestal", "blob");
129 spec->extend("PedestalRMS", "blob");
130 spec->extend<unsigned>("version");
131
132 CondAttrListCollection* collPed=new CondAttrListCollection(true);
133
134 unsigned gain=0;
135 unsigned hashMax=m_sonline_idhelper->channelHashMax();
136 coral::AttributeList* attrList = new coral::AttributeList(*spec);
137 (*attrList)["version"].setValue(0U);
138 coral::Blob& blobPed=(*attrList)["Pedestal"].data<coral::Blob>();
139 coral::Blob& blobRMS=(*attrList)["PedestalRMS"].data<coral::Blob>();
140 blobPed.resize(hashMax*sizeof(float));
141 blobRMS.resize(hashMax*sizeof(float));
142 float* pblobPed=static_cast<float*>(blobPed.startingAddress());
143 float* pblobRMS=static_cast<float*>(blobRMS.startingAddress());
144
145 for (unsigned hs=0;hs<hashMax;++hs) {
146 const HWIdentifier chid=m_sonline_idhelper->channel_Id(hs);
147 float p=ped->pedestal(chid,gain);
148 float rms=ped->pedestalRMS(chid,gain);
149
150 pblobPed[hs]=p*m_fixFactor;
151 pblobRMS[hs]=rms;
152 ++n;
153 }//end loop over hash ids
154 collPed->add(gain,*attrList);
155
156 StatusCode sc=detStore()->record(collPed,"/LAR/ElecCalibMCSC/Pedestal");
157 if (sc.isFailure()) {
158 ATH_MSG_ERROR( "Failed to record CondAttrListCollection for pedestal " );
159 return sc;
160 }
161
162 ATH_MSG_DEBUG(" Number of entries changes in pedestals = " <<n );
163
164 // Now ramp
165 n=0;
166 const LArRampSC *ramp = nullptr;
167 CHECK(detStore()->retrieve(ramp, "Ramp_orig"));
168
169 spec = new coral::AttributeListSpecification();
170 spec->extend("RampVec", "blob");
171 spec->extend<unsigned>("nPoints");
172 spec->extend<unsigned>("version");
173 CondAttrListCollection* coll=new CondAttrListCollection(true);
174
175
176 std::vector<float> defaultRamp={0.0,1.0};
177
178 gain=0;
179
180 unsigned nPoints=0;
181 unsigned nDefault=0;
182 for (unsigned hs=0;hs<hashMax && nPoints==0;++hs) {
183 const HWIdentifier chid=m_sonline_idhelper->channel_Id(hs);
184 const ILArRamp::RampRef_t rampref= ramp->ADC2DAC(chid,gain);
185 nPoints=rampref.size();
186 }
187 if (nPoints==0) {
188 ATH_MSG_ERROR( "All input Ramps for gain " << gain << " have 0 points!" );
189 return StatusCode::FAILURE;
190 }
191
192 defaultRamp.resize(nPoints,0.0); //fill remaining points if needed
193 ATH_MSG_DEBUG( "Gain " << gain << ": Found a ramp polynom of degree " << nPoints << " in input data" );
194 attrList = new coral::AttributeList(*spec);
195 (*attrList)["version"].setValue(0U);
196 coral::Blob& blobRamp=(*attrList)["RampVec"].data<coral::Blob>();
197 (*attrList)["nPoints"].setValue(nPoints);
198 blobRamp.resize(hashMax*sizeof(float)*nPoints);
199 float* pblobRamp=static_cast<float*>(blobRamp.startingAddress());
200
201 for (unsigned hs=0;hs<hashMax;++hs) {
202 const HWIdentifier chid=m_sonline_idhelper->channel_Id(hs);
203 std::vector<float> rampVec(ramp->ADC2DAC(chid,gain).asVector());
204
205 if (rampVec.size()>=nPoints) {
206 for (size_t i=0;i<nPoints;++i) {
207 pblobRamp[nPoints*hs+i]=rampVec[i]*m_fixFactor;
208 }
209 }
210 else {
211 std::stringstream message;
212 message <<"Polynom degree doesn't match. Expect " << nPoints << ", got " << rampVec.size() << ".";
213 for (size_t i=0;i<nPoints;++i) {
214 pblobRamp[nPoints*hs+i]=defaultRamp[i];
215 }
216 ++nDefault;
217 }
218 ++n;
219 }//end loop over hash ids
220 coll->add(gain,*attrList);
221
222 sc=detStore()->record(coll,"/LAR/ElecCalibMCSC/Ramp");
223 if (sc.isFailure()) {
224 ATH_MSG_ERROR( "Failed to record CondAttrListCollection for ramp " );
225 return StatusCode::FAILURE;
226 }
227
228 ATH_MSG_INFO( "Converted Ramps to inline storage. Total number of channels " << n );
229 ATH_MSG_INFO( "Number of channels filled with default ramp {0,1} " << nDefault << " (including disconnected)" );
230
231 return StatusCode::SUCCESS;
232}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
static Double_t sc
const ServiceHandle< StoreGateSvc > & detStore() const
DoubleProperty m_fixFactor
const LArOnline_SuperCellID * m_sonline_idhelper
LArVectorProxy RampRef_t
This class defines the interface for accessing Ramp @stereotype Interface.
Definition ILArRamp.h:31
virtual RampRef_t ADC2DAC(const HWIdentifier &CellID, int gain) const
Definition LArRampSC.cxx:26
std::vector< value_type > asVector() const
Convert back to a vector.
::StatusCode StatusCode
StatusCode definition for legacy code.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ fix2()

StatusCode FixLArElecSCCalib::fix2 ( const LArOnOffIdMapping * cabling,
const LArCalibLineMapping * cl )

Definition at line 234 of file FixLArElecSCCalib.cxx.

234 {
235
236 ATH_MSG_INFO ( " in fix2() " );
237
238 const uint32_t onlHashMax=m_sonline_idhelper->channelHashMax(); // all SC cells
239
240 coral::AttributeListSpecification* spec_calib = new coral::AttributeListSpecification();
241 spec_calib->extend("OnlineHashToCalibIds", "blob");
242 spec_calib->extend<unsigned>("version");
243 auto al_calib = std::make_unique<AthenaAttributeList>(*spec_calib);
244 coral::Blob& blobCalib=(*al_calib)["OnlineHashToCalibIds"].data<coral::Blob>();
245 (*al_calib)["version"].setValue(0U);
246 blobCalib.resize(onlHashMax*sizeof(uint32_t)*5); //Bigger than necessary
247 ATH_MSG_DEBUG("blobCalib size: "<<onlHashMax<<"*5");
248
249 spec_calib->release();
250 spec_calib = nullptr;
251
252 uint32_t* pBlobCalib=static_cast<uint32_t*>(blobCalib.startingAddress());
253
254 size_t calibIndex=0;
255
256 std::vector<unsigned> calibHist(17,0);
257 unsigned calibHistMax=0;
258
259 std::ofstream outfile("SCIdentifiers.txt");
260
261 outfile << "hash id bec pn FT SL chan id calo pn sampl reg eta phi calib" << std::endl;
262
263 for (uint32_t onlHash=0;onlHash<onlHashMax;++onlHash) {
264 const HWIdentifier hwid=m_sonline_idhelper->channel_Id(onlHash);
265 const std::vector<HWIdentifier>& calibIDs_tmp=cl->calibSlotLine(hwid);
266 std::vector<HWIdentifier> calibIDs;
267 for (unsigned i=0; i<calibIDs_tmp.size(); ++i) {
268 if(std::find(calibIDs.begin(), calibIDs.end(), calibIDs_tmp[i]) == calibIDs.end()) calibIDs.push_back(calibIDs_tmp[i]);
269 }
270 // deduplicate
271 Identifier id{};
272 auto pLArIdBase = dynamic_cast<const LArOnlineID_Base*>(m_sonline_idhelper);
273 auto pCaloCellBase = dynamic_cast<const CaloCell_Base_ID*>(m_scell_idhelper);
274 if ((pLArIdBase == nullptr) or (pCaloCellBase==nullptr)){
275 ATH_MSG_ERROR("dynamic_cast failed in FixLArElecSCCalib::fix2");
276 return StatusCode::FAILURE;
277 }
278 if (cabling->isOnlineConnected(hwid)) {
279 id=cabling->cnvToIdentifier(hwid);
280 print(hwid,pLArIdBase, pCaloCellBase,&id,&calibIDs,outfile);
281 } else {
282 print(hwid,pLArIdBase, pCaloCellBase,nullptr,&calibIDs,outfile);
283 }
284 const size_t nCalibLines=calibIDs.size();
285 if (nCalibLines > calibHistMax ) calibHistMax=nCalibLines;
286 if(calibHistMax > 17) {
287 ATH_MSG_ERROR( "Too much calib lines, adjust please !!!" << calibHistMax);
288 return StatusCode::FAILURE;
289 }
290 (calibHist[nCalibLines])++;
291 pBlobCalib[calibIndex++]=nCalibLines;
292 for(uint32_t iCalib=0;iCalib<nCalibLines;++iCalib)
293 pBlobCalib[calibIndex++]=calibIDs[iCalib].get_identifier32().get_compact();
294 }
295 blobCalib.resize(calibIndex*sizeof(uint32_t)); //Size down to actual size
296 outfile.close();
297 ATH_MSG_INFO( "calibHistMax: " << calibHistMax);
298 ATH_MSG_INFO( "BlobSize CalibId:" << calibIndex);
299 msg(MSG::INFO) << "nCalib[i] ";
300 for (unsigned j=0;j<17;++j)
301 msg() << calibHist[j] << "/";
302 msg() << endmsg;
303 ATH_CHECK(detStore()->record(std::move(al_calib),"/LAR/IdentifierOfl/CalibIdMap_SC"));
304 return StatusCode::SUCCESS;
305}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
MsgStream & msg() const
const CaloCell_SuperCell_ID * m_scell_idhelper
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)
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
setEventNumber uint32_t

◆ fix3()

StatusCode FixLArElecSCCalib::fix3 ( const LArOnOffIdMapping * cabling,
const LArMCSym * sym )

Definition at line 338 of file FixLArElecSCCalib.cxx.

338 {
339
340 ATH_MSG_INFO ( " in fix3() " );
341
342 // Fix3 is for filling the MinBias blob from ntuple
343
344 auto spec = new coral::AttributeListSpecification();
345 spec->extend("MinBias", "blob");
346 spec->extend<unsigned>("version");
347 auto coll=std::make_unique<CondAttrListCollection>(true);
348
349 auto specav = new coral::AttributeListSpecification();
350 specav->extend("MinBiasAverage", "blob");
351 specav->extend<unsigned>("version");
352 CondAttrListCollection* collav=new CondAttrListCollection(true);
353
354 unsigned hashMax=m_sonline_idhelper->channelHashMax();
355 coral::AttributeList attrList = coral::AttributeList(*spec);
356 attrList["version"].setValue(0U);
357 coral::Blob& blob = attrList["MinBias"].data<coral::Blob>();
358 blob.resize(hashMax*sizeof(float));
359 float* pblob=static_cast<float*>(blob.startingAddress());
360
361 coral::AttributeList attrListav = coral::AttributeList(*specav);
362 attrListav["version"].setValue(0U);
363 coral::Blob& blobav= attrListav["MinBiasAverage"].data<coral::Blob>();
364 blobav.resize(hashMax*sizeof(float));
365 float* pblobav=static_cast<float*>(blobav.startingAddress());
366
367 std::unique_ptr<TFile> fin= std::make_unique<TFile>(m_infile.value().c_str());
368 TTree *tin=dynamic_cast<TTree*>(fin->Get("m_tree"));
369 if (not tin) return StatusCode::FAILURE;
370 int ncell{};
371 int * identifier = new int[2862];
372 int * layer = new int[2862];
373 int * region = new int[2862];
374 int * ieta = new int[2862];
375 float * eta = new float[2862];
376 double * average = new double[2862];
377 double * rms = new double[2862];
378 TBranch *b_ncell{};
379 TBranch *b_identifier{};
380 TBranch *b_layer{};
381 TBranch *b_region{};
382 TBranch *b_ieta{};
383 TBranch *b_eta{};
384 TBranch *b_average{};
385 TBranch *b_rms{};
386 tin->SetMakeClass(1);
387 tin->SetBranchAddress("ncell", &ncell, &b_ncell);
388 tin->SetBranchAddress("identifier", identifier, &b_identifier);
389 tin->SetBranchAddress("layer", layer, &b_layer);
390 tin->SetBranchAddress("region", region, &b_region);
391 tin->SetBranchAddress("ieta", ieta, &b_ieta);
392 tin->SetBranchAddress("eta", eta, &b_eta);
393 tin->SetBranchAddress("average", average, &b_average);
394 tin->SetBranchAddress("rms", rms, &b_rms);
395 tin->GetEntry(0);
396
397
398 // read the ntuple (symmetrized)
399 std::map<Identifier, float> vmap, vmapav;
400 for(int icell=0; icell<ncell; ++icell) {
401
402 Identifier32 id32(identifier[icell]);
403 Identifier id(id32);
404 vmapav[id] = average[icell];
405 vmap[id] = rms[icell];
406
407 }
408 // now fill all SC
409 for (unsigned onlHash=0;onlHash<hashMax;++onlHash) {
410 const HWIdentifier hwid=m_sonline_idhelper->channel_Id(onlHash);
411 const Identifier id = cabling->cnvToIdentifier(hwid);
412 const HWIdentifier hwid2 = sym->ZPhiSymOfl(id);
413 const Identifier idsym = cabling->cnvToIdentifier(hwid2);
414 if (vmap.count(idsym)==0 || vmapav.count(idsym)==0) {
415 ATH_MSG_WARNING("Do not have sym value: "<<idsym.get_identifier32().get_compact()<<" "<<vmap[idsym]<<" "<<vmapav[idsym]);
416 } else {
417 pblob[onlHash] = vmap[idsym];
418 pblobav[onlHash] = vmapav[idsym];
419 }
420 }
421
422 coll->add(0,attrList);
423 collav->add(0,attrListav);
424
425 auto sz = coll->size();
426 ATH_CHECK(detStore()->record(std::move(coll),"/LAR/ElecCalibMCSC/MinBias"));
427 ATH_MSG_DEBUG("Stored coll with size "<<sz<<" into /LAR/ElecCalibMCSC/MinBias");
428
429 auto szav = collav->size();
430 ATH_CHECK(detStore()->record(collav,"/LAR/ElecCalibMCSC/MinBiasAverage"));
431 ATH_MSG_DEBUG("Stored coll with size "<<szav<<" into /LAR/ElecCalibMCSC/MinBiasAverage");
432
433 return StatusCode::SUCCESS;
434}
Scalar eta() const
pseudorapidity method
#define ATH_MSG_WARNING(x)
static Double_t sz
StringProperty m_infile
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
HWIdentifier ZPhiSymOfl(const Identifier notSymOffId) const
Find the symmetric HWID for an offline cell identifier.
Definition LArMCSym.h:48
@ layer
Definition HitInfo.h:79

◆ initialize()

StatusCode FixLArElecSCCalib::initialize ( )
overridevirtual

Definition at line 55 of file FixLArElecSCCalib.cxx.

55 {
56 ATH_MSG_INFO ( " in initialize " );
57
63
64 ATH_CHECK( m_cablingKeySC.initialize() );
65 ATH_CHECK( m_CLKeySC.initialize() );
66 ATH_CHECK( m_mcSymKey.initialize() );
67
68 return StatusCode::SUCCESS;
69}
SG::ReadCondHandleKey< LArCalibLineMapping > m_CLKeySC
const LArHEC_SuperCell_ID * m_shec_idhelper
const LArEM_SuperCell_ID * m_sem_idhelper
const LArFCAL_SuperCell_ID * m_sfcal_idhelper
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
SG::ReadCondHandleKey< LArMCSym > m_mcSymKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

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()

MsgStream & AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

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()

void FixLArElecSCCalib::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 )

Definition at line 307 of file FixLArElecSCCalib.cxx.

308 {
309 const IdentifierHash hwid_hash=onlineID->channel_Hash(hwid);
310 out << hwid_hash << " " << std::hex << "0x" << hwid.get_identifier32().get_compact() << std::dec << " "
311 << onlineID->barrel_ec(hwid) << " "
312 << onlineID->pos_neg(hwid) << " "
313 << onlineID->feedthrough(hwid) << " "
314 << onlineID->slot(hwid) << " "
315 << onlineID->channel(hwid) << " : ";
316 if (id) {
317 out << std::hex << "0x" << id->get_identifier32().get_compact() << std::dec << " "
318 << caloCellID->sub_calo(*id) << " "
319 << caloCellID->pos_neg(*id) << " "
320 << caloCellID->sampling(*id) << " "
321 << caloCellID->region(*id) << " "
322 << caloCellID->eta(*id) << " "
323 << caloCellID->phi(*id) << " ";
324 }
325 else
326 out << " disconnected ";
327
328 if(calibIDs){
329 for (size_t i=0;i<calibIDs->size();++i) {
330 out << std::hex << "0x" << calibIDs->at(i).get_identifier32().get_compact() << " ";
331 }
332 } else
333 out << " no calib ";
334
335 out << std::dec << std::endl;
336}
int phi(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
int sampling(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.
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
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...
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
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...

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ stop()

StatusCode FixLArElecSCCalib::stop ( )
overridevirtual

Definition at line 77 of file FixLArElecSCCalib.cxx.

77 {
78
79 ATH_MSG_INFO ( " in stop " );
80
81 switch(m_fixFlag) {
82 case 1: return fix1();
83 case 2: {
84 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKeySC};
85 const LArOnOffIdMapping* cabling{*cablingHdl};
86 if(!cabling) {
87 ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKeySC.key() );
88 return StatusCode::FAILURE;
89 }
90 SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_CLKeySC};
91 const LArCalibLineMapping *clCont {*clHdl};
92 if(!clCont) {
93 ATH_MSG_ERROR( "Do not have calib line mapping !!!" );
94 return StatusCode::FAILURE;
95 }
96 return fix2(cabling, clCont);
97 }
98 case 3: {
99 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKeySC};
100 const LArOnOffIdMapping* cabling{*cablingHdl};
101 if(!cabling) {
102 ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKeySC.key() );
103 return StatusCode::FAILURE;
104 }
105 SG::ReadCondHandle<LArMCSym> symHdl{m_mcSymKey};
106 const LArMCSym* sym{*symHdl};
107 if(!sym) {
108 ATH_MSG_ERROR( "Do not have MCSym from key " << m_mcSymKey.key() );
109 return StatusCode::FAILURE;
110 }
111 return fix3(cabling,sym);
112 }
113 default: return StatusCode::SUCCESS;
114 }
115}
StatusCode fix2(const LArOnOffIdMapping *cabling, const LArCalibLineMapping *cl)
IntegerProperty m_fixFlag
StatusCode fix3(const LArOnOffIdMapping *cabling, const LArMCSym *sym)

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_cablingKeySC

SG::ReadCondHandleKey<LArOnOffIdMapping> FixLArElecSCCalib::m_cablingKeySC {this,"SCCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}
private

Definition at line 46 of file FixLArElecSCCalib.h.

46{this,"SCCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"};

◆ m_CLKeySC

SG::ReadCondHandleKey<LArCalibLineMapping> FixLArElecSCCalib::m_CLKeySC {this, "SCCalibLineKey", "LArCalibLineMapSC", "SG calib line key"}
private

Definition at line 47 of file FixLArElecSCCalib.h.

47{this, "SCCalibLineKey", "LArCalibLineMapSC", "SG calib line key"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fixFactor

DoubleProperty FixLArElecSCCalib::m_fixFactor {this, "FixFactor", 0.0, "which factor to apply"}
private

Definition at line 52 of file FixLArElecSCCalib.h.

52{this, "FixFactor", 0.0, "which factor to apply"};

◆ m_fixFlag

IntegerProperty FixLArElecSCCalib::m_fixFlag {this, "FixFlag", 1, "which fix to run"}
private

Definition at line 53 of file FixLArElecSCCalib.h.

53{this, "FixFlag", 1, "which fix to run"} ;

◆ m_infile

StringProperty FixLArElecSCCalib::m_infile {this, "InputFile", "", "which file to read"}
private

Definition at line 54 of file FixLArElecSCCalib.h.

54{this, "InputFile", "", "which file to read"};

◆ m_mcSymKey

SG::ReadCondHandleKey<LArMCSym> FixLArElecSCCalib::m_mcSymKey { this, "MCSymKey", "LArMCSym", "SG Key of LArMCSym object" }
private

Definition at line 48 of file FixLArElecSCCalib.h.

49{ this, "MCSymKey", "LArMCSym", "SG Key of LArMCSym object" };

◆ m_scell_idhelper

const CaloCell_SuperCell_ID* FixLArElecSCCalib::m_scell_idhelper {}
private

Definition at line 60 of file FixLArElecSCCalib.h.

60{};

◆ m_sem_idhelper

const LArEM_SuperCell_ID* FixLArElecSCCalib::m_sem_idhelper {}
private

Definition at line 56 of file FixLArElecSCCalib.h.

56{};

◆ m_sfcal_idhelper

const LArFCAL_SuperCell_ID* FixLArElecSCCalib::m_sfcal_idhelper {}
private

Definition at line 58 of file FixLArElecSCCalib.h.

58{};

◆ m_shec_idhelper

const LArHEC_SuperCell_ID* FixLArElecSCCalib::m_shec_idhelper {}
private

Definition at line 57 of file FixLArElecSCCalib.h.

57{};

◆ m_sonline_idhelper

const LArOnline_SuperCellID* FixLArElecSCCalib::m_sonline_idhelper {}
private

Definition at line 59 of file FixLArElecSCCalib.h.

59{};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: