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

fix electronic calibration constants for MC. More...

#include <FixLArElecCalib.h>

Inheritance diagram for FixLArElecCalib:

Public Member Functions

 FixLArElecCalib (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~FixLArElecCalib ()=default
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method.
virtual StatusCode finalize () override
virtual StatusCode stop ATLAS_NOT_THREAD_SAFE () override
StatusCode fix1 (const LArOnOffIdMapping *cabling)
StatusCode fix2 (const LArOnOffIdMapping *cabling)
StatusCode fix3 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode fix4 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode fix5 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode fix6 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode fix7 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode fix8 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode fix9 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode fix10 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode fix11 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode fix12 (const LArOnOffIdMapping *cabling)
StatusCode fix13 (const LArOnOffIdMapping *cabling)
StatusCode fix14 (const LArOnOffIdMapping *cabling)
StatusCode fix15 ATLAS_NOT_THREAD_SAFE ()
StatusCode fix16 ATLAS_NOT_THREAD_SAFE ()
StatusCode fix17 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode fix18 (const LArCalibLineMapping *clmap)
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
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 std::pair< HWIdentifier, std::vector< float > > ROW_t
typedef std::vector< ROW_tVROW_t
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode ReadFile (const std::string &filename, const LArOnOffIdMapping *cabling, bool EM, bool withGain, int nvar)
StatusCode ReadFileAll (const std::string &filename, const LArOnOffIdMapping *cabling, bool withGain, int nvar)
StatusCode update_DAC2uA (const std::string &em_filename, const std::string &hec_filename)
template<class T>
StatusCode update_EM_HEC ATLAS_NOT_THREAD_SAFE (const std::string &em_filename, const std::string &hec_filename, const LArOnOffIdMapping *cabling, bool withGain, int nvar)
template<class T>
StatusCode update_All ATLAS_NOT_THREAD_SAFE (const std::string &filename, const LArOnOffIdMapping *cabling, bool withGain, int nvar)
void print_object (std::string_view msg, const LArNoiseMC::LArCondObj &obj)
void set_object (LArNoiseMC::LArCondObj &obj, const std::vector< float > &v)
void print_object (std::string_view msg, const LArAutoCorrMC::LArCondObj &obj)
void set_object (LArAutoCorrMC::LArCondObj &obj, const std::vector< float > &v)
void print_object (std::string_view, const LArRampMC::LArCondObj &obj)
void set_object (LArRampMC::LArCondObj &obj, const std::vector< float > &v)
void print_object (std::string_view msg, const LArShape32MC::LArCondObj &obj)
void set_object (LArShape32MC::LArCondObj &obj, const std::vector< float > &v)
void print_object (std::string_view msg, const LArSingleFloatP &obj)
void set_object (LArSingleFloatP &obj, const std::vector< float > &v)
StatusCode addMphysOverMcal (const LArOnOffIdMapping *cabling)
StatusCode fixDACuAMeV ATLAS_NOT_THREAD_SAFE ()
StatusCode updateEMfSampl ATLAS_NOT_THREAD_SAFE (const std::string &filename, const LArOnOffIdMapping *cabling)
StatusCode updateMinBias ATLAS_NOT_THREAD_SAFE (const std::string &filename, const LArOnOffIdMapping *cabling)
StatusCode updateEM_DACuAMeV ATLAS_NOT_THREAD_SAFE (const std::string &filename, const LArOnOffIdMapping *cabling)
StatusCode updateHADfSampl ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
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_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
SG::ReadCondHandleKey< LArCalibLineMappingm_CLKey {this, "CalibLineKey", "LArCalibLineMap", "calib line key"}
IntegerProperty m_fixFlag {this, "FixFlag", 1, "which fix to apply"}
StringProperty m_g4Phys {this, "G4Phys", "", "which physics list to use"}
StringProperty m_infile {this, "InputFile", "", "name of inpput file"}
const LArEM_IDm_em_idhelper
const LArHEC_IDm_hec_idhelper
const LArFCAL_IDm_fcal_idhelper
const LArOnlineIDm_online_idhelper
const LArEM_SuperCell_IDm_sem_idhelper
const LArHEC_SuperCell_IDm_shec_idhelper
const LArOnline_SuperCellIDm_sonline_idhelper
const CaloCell_SuperCell_IDm_scell_idhelper
VROW_t m_cache [3]
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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

fix electronic calibration constants for MC.

Author
Hong Ma hma@b.nosp@m.nl.g.nosp@m.ov

Purpose: read in the LAr electronic calib data, and fix them ready to be written out again as a new version.

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

Implemented fixes:

  1. Flag = 1 Replacing values for barrel in LArDAC2uAMC Input barrel_dac2ua_oct06.txt
  2. Flag=2 fix FCAL conditions data for new mapping in release 13.
  3. Flag=3 replace fsampl for 4.8.2 June 13,2007: FCAL numbers updated by P. Krieger. Junly 10, 2007: updated the number for 13.0.20
  4. Flag=4 replace uA2MeV DAC2uA with that in dac2ua_ua2mev_rel13.txt
  5. Flag=5 replace FCAL noise and minbiasRMS from Sven Menke's new number for release 13.

6 Flag=6 replace All FCAL noise and ADC2DAC, uA2MeV and DAC2uA. <HG/MG> = 9.96 +/- 0.01 <MG/LG> = 9.67 +/- 0.01

7 Flag=7 replace sampling fraction for QGSP_BERT from 13.0.30.

8 Flag=8 replace EM/HEC autoCorr, noise, dac2ua, mphys, ramp, shape, ua2mev

9 Flag=9 fix FCAL AutoCorr

10 Flag=10 fix FCAL ramp. The scaling factor were inverted. Ramp_M = Ramp_H*9.96 Ramp_L = Ramp_H*9.96*9.67

11 Flag=11 Update HEC Ramp

12 Flag=12 Fill the LArMinBiasMC and LArMinBiasAverageMC from ntuple created by LArMinBiasAlg (in CaloCondPhysAlgs)
13 Flag=13 Filling the OnlOflMap for SC

14 Flag=14 Fill the LArMinBiasAverageMC type in LArPileupAverage folder for BCID correction from ntuple created by LArMinBiasAlg (in CaloCondPhysAlgs)

15 Flag=15 Scale the MinBiasAverage by constant

16 Flag=16 Fix the EMEC-A FT 7 slot 11 OnOfIdMap cable swap

17 Flag=17 replace All shape

18 Flag=18 Fix the calib. line mapping for the EMF, where all channels in EMB-A FT 0 has CL=channel

Definition at line 36 of file FixLArElecCalib.h.

Member Typedef Documentation

◆ ROW_t

typedef std::pair<HWIdentifier,std::vector<float> > FixLArElecCalib::ROW_t
private

Definition at line 127 of file FixLArElecCalib.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ VROW_t

typedef std::vector<ROW_t> FixLArElecCalib::VROW_t
private

Definition at line 128 of file FixLArElecCalib.h.

Constructor & Destructor Documentation

◆ FixLArElecCalib()

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

Definition at line 115 of file FixLArElecCalib.cxx.

115 :
116 AthAlgorithm(name,pSvcLocator),
117 m_em_idhelper(nullptr),
118 m_hec_idhelper(nullptr),
119 m_fcal_idhelper(nullptr),
120 m_online_idhelper(nullptr),
121 m_sem_idhelper(nullptr),
122 m_shec_idhelper(nullptr),
123 m_sonline_idhelper(nullptr),
124 m_scell_idhelper(nullptr)
125{
126
127}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
const LArOnline_SuperCellID * m_sonline_idhelper
const LArEM_SuperCell_ID * m_sem_idhelper
const LArHEC_ID * m_hec_idhelper
const LArOnlineID * m_online_idhelper
const LArFCAL_ID * m_fcal_idhelper
const CaloCell_SuperCell_ID * m_scell_idhelper
const LArEM_ID * m_em_idhelper
const LArHEC_SuperCell_ID * m_shec_idhelper

◆ ~FixLArElecCalib()

virtual FixLArElecCalib::~FixLArElecCalib ( )
virtualdefault

Member Function Documentation

◆ addMphysOverMcal()

StatusCode FixLArElecCalib::addMphysOverMcal ( const LArOnOffIdMapping * cabling)
private

Definition at line 1426 of file FixLArElecCalib.cxx.

1426 {
1427 // add the contain to DetStore.
1428 // fill 1 for all FCAL/HEC channels
1429
1430 ATH_MSG_INFO ( " addMphysOverMcal() " );
1431 // create LArMphysOverMcal with FCAL numbers = 1.
1432
1433 std::unique_ptr<LArMphysOverMcalMC> mphys = std::make_unique<LArMphysOverMcalMC>();
1434 mphys->setGroupingType(LArConditionsContainerBase::SingleGroup);
1435 ATH_CHECK( mphys->initialize() );
1436
1437 int n=0;
1438
1439 std::string filename("FCal_noise_minbias_adc2mev.txt");
1440
1441 std::ifstream infile(filename ) ;
1442
1443 if(! infile.good() )
1444 {
1445 ATH_MSG_ERROR(" fail to open file "<<filename);
1446 return StatusCode::FAILURE;
1447 }
1448
1449
1450 char s[200];
1451
1452 ATH_MSG_INFO("Opened FCAL file");
1453 for(int i = 0;i<27;++i){
1454 infile.getline(s,200);
1455 ATH_MSG_INFO(s);
1456 }
1457
1458 std::string str_id;
1459
1460 float vol,noise_p,noise_h, noise_m,noise_l;
1461 float ramp_val,ua2MeV_val,dac2uA_val;
1462 std::string channel_type;
1463 while ( infile>>str_id >>vol>>noise_p >> noise_h>>noise_m>>noise_l
1464 >>channel_type>> ramp_val>>ua2MeV_val>>dac2uA_val )
1465 {
1466 const char* ch_id = str_id.c_str();
1467
1468 if(str_id.substr(0,1)!=std::string("A")){
1469 ATH_MSG_INFO(" skipping string"<<str_id);
1470 continue;
1471 }
1472
1473 int mod,phi,eta;
1474 sscanf(ch_id, "A%d.%d.%d", &mod,&phi,&eta);
1475 if(phi>7){
1476 ATH_MSG_INFO(" skipping phi"<<str_id<<" phi="<<phi);
1477 continue;
1478 }
1479
1480 ++n;
1481
1482 ATH_MSG_INFO(" Setting channel "<<str_id);
1483 Identifier id = m_fcal_idhelper->channel_id(2,mod,eta,phi);
1484 HWIdentifier hid = cabling->createSignalChannelID(id);
1485
1487 t.m_data =1. ;
1488 mphys->setPdata(hid,t,0);
1489 mphys->setPdata(hid,t,1);
1490 mphys->setPdata(hid,t,2);
1491 }
1492
1493 ATH_MSG_INFO(" MphysOverMcal added "<<n<<" FCAL channels");
1494
1495 bool EM=false ;
1496 bool withGain=false;
1497 int nvar = 1;
1498 std::string hec_filename("mphys_hec.txt");
1499 ATH_CHECK( ReadFile(hec_filename,cabling,EM,withGain,nvar) );
1500
1501 int igain=0;
1502 n=0;
1503 for( ROW_t &it : m_cache[igain])
1504 {
1505 HWIdentifier hid = it.first;
1507 t.m_data =1. ;
1508 mphys->setPdata(hid,t,0);
1509 mphys->setPdata(hid,t,1);
1510 mphys->setPdata(hid,t,2);
1511 ++n;
1512
1513 }
1514
1515 ATH_CHECK( detStore()->record(std::move(mphys),"LArMphysOverMcal") );
1516
1517 ATH_MSG_ERROR(" Number of HEC channel added "<<n <<" per gain ");
1518 return StatusCode::SUCCESS ;
1519}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
const ServiceHandle< StoreGateSvc > & detStore() const
StatusCode ReadFile(const std::string &filename, const LArOnOffIdMapping *cabling, bool EM, bool withGain, int nvar)
std::pair< HWIdentifier, std::vector< float > > ROW_t

◆ ATLAS_NOT_THREAD_SAFE() [1/20]

StatusCode fixDACuAMeV FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( )
private

◆ ATLAS_NOT_THREAD_SAFE() [2/20]

StatusCode fix16 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( )

◆ ATLAS_NOT_THREAD_SAFE() [3/20]

StatusCode fix15 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( )

◆ ATLAS_NOT_THREAD_SAFE() [4/20]

virtual StatusCode stop FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( )
overridevirtual

◆ ATLAS_NOT_THREAD_SAFE() [5/20]

StatusCode updateHADfSampl FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)
private

◆ ATLAS_NOT_THREAD_SAFE() [6/20]

StatusCode fix17 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)

◆ ATLAS_NOT_THREAD_SAFE() [7/20]

StatusCode fix11 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)

◆ ATLAS_NOT_THREAD_SAFE() [8/20]

StatusCode fix10 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)

◆ ATLAS_NOT_THREAD_SAFE() [9/20]

StatusCode fix9 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)

◆ ATLAS_NOT_THREAD_SAFE() [10/20]

StatusCode fix8 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)

◆ ATLAS_NOT_THREAD_SAFE() [11/20]

StatusCode fix7 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)

◆ ATLAS_NOT_THREAD_SAFE() [12/20]

StatusCode fix6 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)

◆ ATLAS_NOT_THREAD_SAFE() [13/20]

StatusCode fix5 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)

◆ ATLAS_NOT_THREAD_SAFE() [14/20]

StatusCode fix4 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)

◆ ATLAS_NOT_THREAD_SAFE() [15/20]

StatusCode fix3 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping * cabling)

◆ ATLAS_NOT_THREAD_SAFE() [16/20]

template<class T>
StatusCode update_EM_HEC FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const std::string & em_filename,
const std::string & hec_filename,
const LArOnOffIdMapping * cabling,
bool withGain,
int nvar )
private

◆ ATLAS_NOT_THREAD_SAFE() [17/20]

StatusCode updateEM_DACuAMeV FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const std::string & filename,
const LArOnOffIdMapping * cabling )
private

◆ ATLAS_NOT_THREAD_SAFE() [18/20]

StatusCode updateMinBias FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const std::string & filename,
const LArOnOffIdMapping * cabling )
private

◆ ATLAS_NOT_THREAD_SAFE() [19/20]

StatusCode updateEMfSampl FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const std::string & filename,
const LArOnOffIdMapping * cabling )
private

◆ ATLAS_NOT_THREAD_SAFE() [20/20]

template<class T>
StatusCode update_All FixLArElecCalib::ATLAS_NOT_THREAD_SAFE ( const std::string & filename,
const LArOnOffIdMapping * cabling,
bool withGain,
int nvar )
private

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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 FixLArElecCalib::execute ( const EventContext & ctx)
overridevirtual

Execute method.

Implements AthAlgorithm.

Definition at line 147 of file FixLArElecCalib.cxx.

147 {
148
149 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey, ctx};
150 const LArOnOffIdMapping* cabling{*cablingHdl};
151 if(!cabling) {
152 ATH_MSG_WARNING( "Do not have cabling mapping from key " << m_cablingKey.key() );
153 }
154 if(m_fixFlag==13)
155 return fix13(cabling);
156
157 return StatusCode::SUCCESS;
158}
#define ATH_MSG_WARNING(x,...)
StatusCode fix13(const LArOnOffIdMapping *cabling)
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
IntegerProperty m_fixFlag

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

virtual StatusCode FixLArElecCalib::finalize ( )
inlineoverridevirtual

Definition at line 44 of file FixLArElecCalib.h.

44{return StatusCode::SUCCESS;}

◆ fix1()

StatusCode FixLArElecCalib::fix1 ( const LArOnOffIdMapping * cabling)

Definition at line 221 of file FixLArElecCalib.cxx.

221 {
222
223 ATH_MSG_INFO ( " in fix1() " );
224
225 // Fix1 is for updating the EM DAC2uA, assuming symmetry.
226 // Input should be MC Conditions data with DetDescrVersion=ATLAS-DC3-05
227
228 // Pointer to StoreGate
229 const LArEM_ID* em_idhelper = nullptr;
230 ATH_CHECK( detStore()->retrieve(em_idhelper) );
231
232 const LArOnlineID* online_idhelper = nullptr;
233 ATH_CHECK( detStore()->retrieve(online_idhelper) );
234
235 // retrieve DetDescrManager
236 SmartIF<IToolSvc> toolSvc{Gaudi::svcLocator()->service("ToolSvc")};
237 ATH_CHECK(toolSvc.isValid());
238
239 LArDAC2uAMC * dac2ua = nullptr;
240 ATH_CHECK( detStore()->retrieve(dac2ua) );
241
242 // read in the file
243
244 std::ifstream infile("barrel_dac2ua_oct06.txt") ;
245 if(! infile.good() )
246 {
247 ATH_MSG_ERROR(" fail to open file ");
248 return StatusCode::FAILURE;
249 }
250
251
252 int det,samp,reg,eta;
253 float value ;
254 int n = 0;
255 while ( infile>>det>>samp>>reg>>eta>>value )
256 {
257 ++n;
258 ATH_MSG_DEBUG(" det,samp,reg,eta,value="
259 <<det<<" "
260 <<samp<<" "
261 <<reg<<" "
262 <<eta<<" "
263 <<value<<" " );
264
265 Identifier id ;
266 if ( det==1 && samp==1 && reg==0 && eta==0 ){
267 // eta=0 for strip, not connected, but keep it
268 // Removed disconnected channels: 03/2016 RDS
269 // ATH_MSG_DEBUG(" disconnected strip ");
270 // id = em_idhelper->disc_channel_id(det,samp,reg,eta,0);
271 }else
272 id = em_idhelper->channel_id(det,samp,reg,eta,0);
273
274 HWIdentifier hid = cabling->createSignalChannelID(id);
275 LArDAC2uAComplete::LArCondObj & t = dac2ua->get(hid,0);
276 ATH_MSG_DEBUG(" online id = "<<online_idhelper->print_to_string(hid));
277
278 if( t.isEmpty() )
279 {
280 ATH_MSG_WARNING(" No existing conditions data " );
281 continue ;
282 }
283 ATH_MSG_DEBUG(" Old DAC2uA = "<< t.m_data<< " " );
284
285 t.m_data = value ;
286
287 const LArDAC2uAComplete::LArCondObj & t3 = dac2ua->get(hid,0);
288 ATH_MSG_DEBUG(" New DAC2uA = "<< t3.m_data << " " );
289
290 }
291
292 ATH_MSG_DEBUG(" Number of entries changes = " <<n );
293 return StatusCode::SUCCESS;
294}
#define ATH_MSG_DEBUG(x,...)
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
get data with online identifier
Identifier channel_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
std::vector< LUCID_RawData_p1 > t3

◆ fix12()

StatusCode FixLArElecCalib::fix12 ( const LArOnOffIdMapping * cabling)

Definition at line 1997 of file FixLArElecCalib.cxx.

1997 {
1998
1999 ATH_MSG_INFO ( " in fix12() " );
2000
2001 // Fix12 is for filling the MinBiasRMS and MinBiasAverage from ntuple
2002
2003 // Create new container
2004 std::unique_ptr<LArMinBiasMC> minbias = std::make_unique<LArMinBiasMC>();
2005 ATH_CHECK( minbias->setGroupingType("Single", msg()) );
2006 ATH_CHECK( minbias->initialize() );
2007 std::unique_ptr<LArMinBiasAverageMC> minbias_av = std::make_unique<LArMinBiasAverageMC>();
2008 ATH_CHECK( minbias_av->setGroupingType("Single", msg()) );
2009 ATH_CHECK( minbias_av->initialize() );
2010 //
2011 std::unique_ptr<TFile> fin= std::make_unique<TFile>("ntuple_av.root");
2012 TTree *tin=dynamic_cast<TTree*>(fin->Get("m_tree"));
2013 if (!tin) {
2014 ATH_MSG_ERROR("Can't read tree m_tree");
2015 return StatusCode::FAILURE;
2016 }
2017 const int nindex=1833;
2018 int ncell;
2019 std::vector<int> identifier(2862);
2020 std::vector<int> layer(2862);
2021 std::vector<int> region(2862);
2022 std::vector<int> ieta(2862);
2023 std::vector<float> eta(2862);
2024 std::vector<double> average(2862);
2025 std::vector<double> rms(2862);
2026 TBranch *b_ncell;
2027 TBranch *b_identifier;
2028 TBranch *b_layer;
2029 TBranch *b_region;
2030 TBranch *b_ieta;
2031 TBranch *b_eta;
2032 TBranch *b_average;
2033 TBranch *b_rms;
2034 tin->SetMakeClass(1);
2035 tin->SetBranchAddress("ncell", &ncell, &b_ncell);
2036 tin->SetBranchAddress("identifier", identifier.data(), &b_identifier);
2037 tin->SetBranchAddress("layer", layer.data(), &b_layer);
2038 tin->SetBranchAddress("region", region.data(), &b_region);
2039 tin->SetBranchAddress("ieta", ieta.data(), &b_ieta);
2040 tin->SetBranchAddress("eta", eta.data(), &b_eta);
2041 tin->SetBranchAddress("average", average.data(), &b_average);
2042 tin->SetBranchAddress("rms", rms.data(), &b_rms);
2043 tin->GetEntry(0);
2044
2045 if(ncell>nindex) ncell=nindex;
2046 for(int icell=0; icell<ncell; ++icell) {
2047
2048 Identifier32 id32(identifier[icell]);
2049 Identifier id(id32);
2050 HWIdentifier hid = cabling->createSignalChannelID(id);
2051
2052 minbias->set(hid, rms[icell]);
2053 minbias_av->set(hid, average[icell]);
2054
2055 }
2056
2057 ATH_MSG_INFO(" number of channels in intuple ="<<ncell);
2058
2059 ATH_MSG_INFO ( "Stored container " << minbias->totalNumberOfConditions() << " conditions, key LArMinBias " );
2060 ATH_CHECK( detStore()->record(std::move(minbias),"LArMinBias") );
2061 ATH_MSG_INFO ( "Stored container " << minbias_av->totalNumberOfConditions() << " conditions, key LArMinBiasAverage " );
2062 ATH_CHECK( detStore()->record(std::move(minbias_av),"LArMinBiasAverage") );
2063
2064 return StatusCode::SUCCESS;
2065}
@ layer
Definition HitInfo.h:79

◆ fix13()

StatusCode FixLArElecCalib::fix13 ( const LArOnOffIdMapping * cabling)

Definition at line 1726 of file FixLArElecCalib.cxx.

1726 {
1727
1728 ATH_MSG_INFO ( " in fix13() " );
1729 // update EM/HEC 7 data objects.
1730
1731 ToolHandle<ICaloSuperCellIDTool> scidtool("CaloSuperCellIDTool");
1732 if ( scidtool.retrieve().isFailure() ) {
1733 ATH_MSG_ERROR ( " Could not retrieve scitool " );
1734 }
1735
1736 std::set<Identifier> scidset;
1737 std::map<HWIdentifier,int> sslot_schannel_idx;
1738 std::vector<unsigned int> OrderOnlHash_OffID;
1739 std::vector<unsigned int> OrderOffHash_OnlID;
1740 OrderOnlHash_OffID.resize(40000,0);
1741 OrderOffHash_OnlID.resize(40000,0);
1742
1743 Identifier::size_type channel_size = m_em_idhelper->channel_hash_max();
1744 unsigned int min_onl_hash = 999999;
1745 unsigned int max_onl_hash = 0;
1746 unsigned int min_off_hash = 999999;
1747 unsigned int max_off_hash = 0;
1748 std::ofstream hashes("AllHashChannels_All.txt");
1749 std::ofstream of("AllChannels_EM.txt");
1750
1751 for(size_t i = 0; i < channel_size ; i++) {
1752 Identifier chid = m_em_idhelper->channel_id(i);
1753 bool isEM = ( m_em_idhelper->is_em_barrel( chid ) || m_em_idhelper->is_em_endcap( chid ) ) ;
1754 if ( ! isEM ) continue;
1755 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1756 if ( scidset.find(SCID) == scidset.end() && (m_scell_idhelper->calo_cell_hash( SCID ).value() < 99999) )
1757 scidset.insert(SCID);
1758 else continue;
1759 HWIdentifier hwid = cabling->createSignalChannelID(chid);
1760 if ( i == 0 ){
1761 of << "Off ID\t\tSCID\t\tOnl ID\t\tFT\tslot\tB-E pos_neg\tSamp\teta\tphi\tFEB_ID\t\tSHWID\t" << '\n';
1762 }
1763 of << chid.get_identifier32().get_compact() << "\t0x" <<
1764 SCID.get_identifier32().get_compact() << "\t0x" <<
1765 hwid.get_identifier32().get_compact() ;
1766 Identifier regId = m_em_idhelper->region_id( chid );
1767 int reg = m_em_idhelper->region( chid );
1768 IdentifierHash regHash = m_em_idhelper->region_hash( regId );
1769 int samp = m_em_idhelper->sampling( chid );
1770 int feedthrough = m_online_idhelper->feedthrough( hwid );
1771 int bar_ec = m_online_idhelper->barrel_ec( hwid );
1772 int pos_neg = m_online_idhelper->pos_neg( hwid );
1773 int slot = m_online_idhelper->slot( hwid );
1774 float etaG = m_em_idhelper->etaGranularity(regHash);
1775 float phiG = m_em_idhelper->phiGranularity(regHash);
1776 float eta0 = m_em_idhelper->eta0(regHash);
1777 float phi0 = m_em_idhelper->phi0(regHash);
1778 float eta = etaG*m_em_idhelper->eta( chid ) + eta0;
1779 float phi = phiG*m_em_idhelper->phi( chid ) + phi0;
1780 char etaChar[10];
1781 char phiChar[10];
1782 sprintf(etaChar,"%5.4f",eta);
1783 sprintf(phiChar,"%5.4f",phi);
1784 of << std::dec << "\t" << feedthrough << "\t" << slot;
1785 of << "\t" << bar_ec << " " << pos_neg << "\t\t" << samp << "\t";
1786 of << etaChar << " " << phiChar << "\t0x";
1787 HWIdentifier feb_id = m_online_idhelper->feb_Id(hwid);
1788 int sslot=1;
1789 bool InSlot= m_em_idhelper->is_em_endcap_inner ( chid );
1790 bool OutSlot= m_em_idhelper->is_em_endcap_outer ( chid ) ;
1791 bool secondOutSlot=false;
1792 if ( OutSlot ) {
1793 if ( (samp==1) && (reg==5) ) secondOutSlot=true;
1794 if ( (samp==2) && (reg==1) && ( m_em_idhelper->eta( chid )>=39 ) )
1795 secondOutSlot=true;
1796 if ( (samp==3) && (reg==0) && ( m_em_idhelper->eta( chid )>=18 ) )
1797 secondOutSlot=true;
1798 }
1799 HWIdentifier sfeb_id = m_sonline_idhelper->feb_Id(bar_ec,pos_neg,feedthrough,sslot);
1800
1801 if ( InSlot ) {
1802 sfeb_id = m_sonline_idhelper->feb_Id(bar_ec,pos_neg,feedthrough-1,sslot+1);
1803 }
1804 if ( secondOutSlot ) {
1805 sfeb_id = m_sonline_idhelper->feb_Id(bar_ec,pos_neg,feedthrough,sslot+1);
1806 }
1807 if ( sslot_schannel_idx.find(sfeb_id) == sslot_schannel_idx.end() )
1808 sslot_schannel_idx[sfeb_id]=0;
1809 else sslot_schannel_idx[sfeb_id]++;
1810 HWIdentifier shwid = m_sonline_idhelper->channel_Id(sfeb_id,sslot_schannel_idx[sfeb_id]);
1811 unsigned int onl_hash = m_sonline_idhelper->channel_Hash( shwid ).value();
1812 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1813 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1814 unsigned int off_hash = m_scell_idhelper->calo_cell_hash( SCID ).value();
1815 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1816 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1817 of << std::hex;
1818 of << feb_id.get_identifier32().get_compact();
1819 of << "\t0x" << shwid.get_identifier32().get_compact();
1820 of << " " << m_online_idhelper->channel_name(hwid) << " " << m_sonline_idhelper->channel_name(shwid);
1821 of << std::dec;
1822 of << " " << onl_hash << " " << off_hash;
1823 of << '\n';
1824
1825 if ( m_scell_idhelper->calo_cell_hash( SCID ).value() < 40000 )
1826 OrderOffHash_OnlID[m_scell_idhelper->calo_cell_hash( SCID ).value()] = shwid.get_identifier32().get_compact();
1827 if ( m_sonline_idhelper->channel_Hash( shwid ).value() < 40000 )
1828 OrderOnlHash_OffID[m_sonline_idhelper->channel_Hash( shwid ).value()] = SCID.get_identifier32().get_compact();
1829 }
1830 of << "Hash check. Onl : " << min_onl_hash << " " << max_onl_hash;
1831 of << "; Off : " << min_off_hash << " " << max_off_hash << '\n';;
1832 of.close();
1833
1834 channel_size = m_hec_idhelper->channel_hash_max();
1835 min_onl_hash = 999999;
1836 max_onl_hash = 0;
1837 min_off_hash = 999999;
1838 max_off_hash = 0;
1839 std::ofstream of1("AllChannels_HEC.txt");
1840
1841 of1 << "Off ID\t\tSCID\t\tOnl ID\t\tFT\tslot\tB-E pos_neg\tSamp\teta\tphi\tFEB_ID\t\tSHWID\t" << '\n';
1842 for(size_t i = 0; i < channel_size ; i++) {
1843 Identifier chid = m_hec_idhelper->channel_id(i);
1844 if ( ! ( m_hec_idhelper->is_lar_hec( chid ) ) ) continue;
1845 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1846 if ( scidset.find(SCID) == scidset.end() )
1847 scidset.insert(SCID);
1848 else continue;
1849 HWIdentifier hwid = cabling->createSignalChannelID(chid);
1850 of1 << chid.get_identifier32().get_compact() << "\t0x" <<
1851 SCID.get_identifier32().get_compact() << "\t0x" <<
1852 hwid.get_identifier32().get_compact() ;
1853 Identifier regId = m_hec_idhelper->region_id( chid );
1854 IdentifierHash regHash = m_hec_idhelper->region_hash( regId );
1855 int samp = m_hec_idhelper->sampling( chid );
1856 int feedthrough = m_online_idhelper->feedthrough( hwid );
1857 int bar_ec = m_online_idhelper->barrel_ec( hwid );
1858 int pos_neg = m_online_idhelper->pos_neg( hwid );
1859 int slot = m_online_idhelper->slot( hwid );
1860 float etaG = m_hec_idhelper->etaGranularity(regHash);
1861 float phiG = m_hec_idhelper->phiGranularity(regHash);
1862 float eta0 = m_hec_idhelper->eta0(regHash);
1863 float phi0 = m_hec_idhelper->phi0(regHash);
1864 float eta = etaG*m_hec_idhelper->eta( chid ) + eta0;
1865 float phi = phiG*m_hec_idhelper->phi( chid ) + phi0;
1866 char etaChar[10];
1867 char phiChar[10];
1868 sprintf(etaChar,"%5.4f",eta);
1869 sprintf(phiChar,"%5.4f",phi);
1870 of1 << std::dec << "\t" << feedthrough << "\t" << slot;
1871 of1 << "\t" << bar_ec << " " << pos_neg << "\t\t" << samp << "\t";
1872 of1 << etaChar << " " << phiChar << "\t0x";
1873 HWIdentifier feb_id = m_online_idhelper->feb_Id(hwid);
1874 int sslot=1;
1875 int subtract=0;
1876 HWIdentifier sfeb_id = m_sonline_idhelper->feb_Id(bar_ec,pos_neg,feedthrough,sslot);
1877 if ( sslot_schannel_idx.find(sfeb_id) == sslot_schannel_idx.end() )
1878 sslot_schannel_idx[sfeb_id]=0;
1879 else sslot_schannel_idx[sfeb_id]++;
1880 if ( (feedthrough==6) && (bar_ec==1) && (slot>9) ) {
1881 sfeb_id = m_sonline_idhelper->feb_Id(bar_ec,pos_neg,feedthrough,sslot+1);
1882 subtract=192;
1883 }
1884 HWIdentifier shwid = m_sonline_idhelper->channel_Id(sfeb_id,sslot_schannel_idx[sfeb_id]-subtract);
1885 unsigned int onl_hash = m_sonline_idhelper->channel_Hash( shwid ).value();
1886 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1887 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1888 unsigned int off_hash = m_scell_idhelper->calo_cell_hash( SCID ).value();
1889 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1890 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1891 of1 << std::hex;
1892 of1 << feb_id.get_identifier32().get_compact();
1893 of1 << "\t0x" << shwid.get_identifier32().get_compact();
1894 of1 << " " << m_online_idhelper->channel_name(hwid) << " " << m_sonline_idhelper->channel_name(shwid);
1895 of1 << std::dec;
1896 of1 << " " << onl_hash << " " << off_hash;
1897 of1 << '\n';
1898
1899 OrderOffHash_OnlID[m_scell_idhelper->calo_cell_hash( SCID ).value()] = shwid.get_identifier32().get_compact();
1900 OrderOnlHash_OffID[m_sonline_idhelper->channel_Hash( shwid ).value()] = SCID.get_identifier32().get_compact();
1901 }
1902
1903 channel_size = m_fcal_idhelper->channel_hash_max();
1904 min_onl_hash = 999999;
1905 max_onl_hash = 0;
1906 min_off_hash = 999999;
1907 max_off_hash = 0;
1908 std::ofstream of3("AllChannels_FCAL.txt");
1909
1910 of3 << "Off ID\t\tSCID\t\tOnl ID\t\tFT\tslot\tB-E pos_neg\tSamp\teta\tphi\tFEB_ID\t\tSHWID\t" << '\n';
1911 for(size_t i = 0; i < channel_size ; i++) {
1912 Identifier chid = m_fcal_idhelper->channel_id(i);
1913 if ( ! ( m_fcal_idhelper->is_lar_fcal( chid ) ) ) continue;
1914 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1915 if ( scidset.find(SCID) == scidset.end() )
1916 scidset.insert(SCID);
1917 else continue;
1918 HWIdentifier hwid = cabling->createSignalChannelID(chid);
1919 of3 << chid.get_identifier32().get_compact() << "\t0x" <<
1920 SCID.get_identifier32().get_compact() << "\t0x" <<
1921 hwid.get_identifier32().get_compact() ;
1922 int samp = 0;
1923 int feedthrough = m_online_idhelper->feedthrough( hwid );
1924 int bar_ec = m_online_idhelper->barrel_ec( hwid );
1925 int pos_neg = m_online_idhelper->pos_neg( hwid );
1926 int slot = m_online_idhelper->slot( hwid );
1927 of3 << std::dec << "\t" << feedthrough << "\t" << slot;
1928 of3 << "\t" << bar_ec << " " << pos_neg << "\t\t" << samp << "\t";
1929 HWIdentifier feb_id = m_online_idhelper->feb_Id(hwid);
1930 int sslot=1;
1931 HWIdentifier sfeb_id = m_sonline_idhelper->feb_Id(bar_ec,pos_neg,feedthrough,sslot);
1932 if ( (feedthrough==6) && (bar_ec==1) && (slot>9) ) {
1933 sfeb_id = m_sonline_idhelper->feb_Id(bar_ec,pos_neg,feedthrough,sslot+1);
1934 }
1935 if ( sslot_schannel_idx.find(sfeb_id) == sslot_schannel_idx.end() )
1936 sslot_schannel_idx[sfeb_id]=0;
1937 else sslot_schannel_idx[sfeb_id]++;
1938 HWIdentifier shwid = m_sonline_idhelper->channel_Id(sfeb_id,sslot_schannel_idx[sfeb_id]);
1939 unsigned int onl_hash = m_sonline_idhelper->channel_Hash( shwid ).value();
1940 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1941 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1942 unsigned int off_hash = m_scell_idhelper->calo_cell_hash( SCID ).value();
1943 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1944 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1945 of3 << std::hex;
1946 of3 << feb_id.get_identifier32().get_compact();
1947 of3 << "\t0x" << shwid.get_identifier32().get_compact();
1948 of3 << " " << m_online_idhelper->channel_name(hwid) << " " << m_sonline_idhelper->channel_name(shwid);
1949 of3 << std::dec;
1950 of3 << " " << onl_hash << " " << off_hash;
1951 of3 << '\n';
1952
1953 OrderOffHash_OnlID[m_scell_idhelper->calo_cell_hash( SCID ).value()] = shwid.get_identifier32().get_compact();
1954 OrderOnlHash_OffID[m_sonline_idhelper->channel_Hash( shwid ).value()] = SCID.get_identifier32().get_compact();
1955 }
1956
1957 of3 << "Hash check. Onl : " << min_onl_hash << " " << max_onl_hash;
1958 of3 << "; Off : " << min_off_hash << " " << max_off_hash << '\n';;
1959 of3.close();
1960
1961
1962
1963 const uint32_t onlHashMax=m_sonline_idhelper->channelHashMax();
1964 coral::AttributeListSpecification *spec_onOff = new coral::AttributeListSpecification();
1965 spec_onOff->extend("OnlineHashToOfflineId", "blob");
1966 spec_onOff->extend<unsigned>("version");
1967 std::unique_ptr<AthenaAttributeList> al_onOff = std::make_unique<AthenaAttributeList>(*spec_onOff);
1968 coral::Blob& blobOnOff=(*al_onOff)["OnlineHashToOfflineId"].data<coral::Blob>();
1969 (*al_onOff)["version"].setValue(0U);
1970 blobOnOff.resize(onlHashMax*sizeof(uint32_t));
1971 uint32_t* pBlobOnOff=static_cast<uint32_t*>(blobOnOff.startingAddress());
1972 unsigned nConn=0;
1973
1974 const uint32_t emptyId=Identifier().get_identifier32().get_compact();
1975 for(size_t ii=0;ii<onlHashMax;ii++) {
1976 if (OrderOnlHash_OffID[ii] != 0) {
1977 pBlobOnOff[ii]=OrderOnlHash_OffID[ii];
1978 nConn++;
1979 }
1980 else
1981 pBlobOnOff[ii]=emptyId;
1982 }
1983
1984 ATH_MSG_INFO ( "HashMax=" << onlHashMax << ", connected=" << nConn );
1985
1986 ATH_CHECK( detStore()->record(std::move(al_onOff),"/LAR/IdentifierOfl/OnOffIdMap_SC") );
1987
1988 hashes << "idx \t Off2OnlId \t Onl2OffId" << '\n';
1989 for(size_t ii=0;ii<40000;ii++)
1990 if ( (OrderOffHash_OnlID[ii] != 0) || ( OrderOnlHash_OffID[ii] != 0 ) )
1991 hashes << std::dec << ii << std::hex << " \t " << OrderOffHash_OnlID[ii] << " \t\t " << OrderOnlHash_OffID[ii] << '\n';
1992 hashes.close();
1993
1994 return StatusCode::SUCCESS;
1995}
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.
setEventNumber uint32_t

◆ fix14()

StatusCode FixLArElecCalib::fix14 ( const LArOnOffIdMapping * cabling)

Definition at line 2067 of file FixLArElecCalib.cxx.

2067 {
2068
2069 ATH_MSG_INFO ( " in fix14() " );
2070
2071 // Fix14 is for filling the LArPileupAverage from ntuple
2072
2073 const ILArfSampl* larfSampl = nullptr;
2074 ATH_CHECK( detStore()->retrieve(larfSampl,"") );
2075 // Will try to regenerate from scratch
2076 // Create new container
2077 std::unique_ptr<LArMinBiasAverageMC> minbias_av = std::make_unique<LArMinBiasAverageMC>();
2078 ATH_CHECK( minbias_av->setGroupingType("Single", msg()) );
2079 ATH_CHECK( minbias_av->initialize() );
2080 //
2081 std::unique_ptr<TFile> fin= std::make_unique<TFile>(m_infile.value().c_str());
2082 TTree *tin=dynamic_cast<TTree*>(fin->Get("m_tree"));
2083 if (!tin) {
2084 ATH_MSG_ERROR("Can't read tree m_tree");
2085 return StatusCode::FAILURE;
2086 }
2087 int ncell;
2088 std::vector<int> identifier(2862);
2089 std::vector<int> layer(2862);
2090 std::vector<int> region(2862);
2091 std::vector<int> ieta(2862);
2092 std::vector<float> eta(2862);
2093 std::vector<double> average(2862);
2094 std::vector<double> rms(2862);
2095 TBranch *b_ncell;
2096 TBranch *b_identifier;
2097 TBranch *b_layer;
2098 TBranch *b_region;
2099 TBranch *b_ieta;
2100 TBranch *b_eta;
2101 TBranch *b_average;
2102 TBranch *b_rms;
2103 tin->SetMakeClass(1);
2104 tin->SetBranchAddress("ncell", &ncell, &b_ncell);
2105 tin->SetBranchAddress("identifier", identifier.data(), &b_identifier);
2106 tin->SetBranchAddress("layer", layer.data(), &b_layer);
2107 tin->SetBranchAddress("region", region.data(), &b_region);
2108 tin->SetBranchAddress("ieta", ieta.data(), &b_ieta);
2109 tin->SetBranchAddress("eta", eta.data(), &b_eta);
2110 tin->SetBranchAddress("average", average.data(), &b_average);
2111 tin->SetBranchAddress("rms", rms.data(), &b_rms);
2112 tin->GetEntry(0);
2113
2114
2115 for(int icell=0; icell<ncell; ++icell) {
2116
2117 Identifier32 id32(identifier[icell]);
2118 Identifier id(id32);
2119 HWIdentifier hid = cabling->createSignalChannelID(id);
2120 float fsampl = larfSampl->FSAMPL(hid);
2121 minbias_av->set(hid, 6.31*average[icell]/fsampl);
2122
2123 }
2124
2125 ATH_MSG_INFO(" number of channels in intuple ="<<ncell);
2126
2127 ATH_MSG_INFO ( "Stored container " << minbias_av->totalNumberOfConditions() << " conditions, key LArPileupAverage " );
2128 ATH_CHECK( detStore()->record(std::move(minbias_av),"LArPileupAverage") );
2129
2130 return StatusCode::SUCCESS;
2131}
StringProperty m_infile
virtual const float & FSAMPL(const HWIdentifier &id) const =0

◆ fix18()

StatusCode FixLArElecCalib::fix18 ( const LArCalibLineMapping * clmap)

Definition at line 2230 of file FixLArElecCalib.cxx.

2230 {
2231
2232 ATH_MSG_INFO ( " in fix18() " );
2233
2234 const uint32_t onlHashMax=m_online_idhelper->channelHashMax();
2235
2236 coral::AttributeListSpecification* spec_calib = new coral::AttributeListSpecification();
2237 spec_calib->extend("OnlineHashToCalibIds", "blob");
2238 spec_calib->extend<unsigned>("version");
2239 std::unique_ptr<AthenaAttributeList> al_calib = std::make_unique<AthenaAttributeList>(*spec_calib);
2240 coral::Blob& blobCalib=(*al_calib)["OnlineHashToCalibIds"].data<coral::Blob>();
2241 (*al_calib)["version"].setValue(0U);
2242 blobCalib.resize(onlHashMax*sizeof(uint32_t)*4); //Bigger than necessary
2243
2244 spec_calib->release();
2245 // cppcheck-suppress memleak
2246 spec_calib = nullptr;
2247
2248 uint32_t* pBlobCalib=static_cast<uint32_t*>(blobCalib.startingAddress());
2249 size_t calibIndex=0;
2250
2251
2252 // loop over all online hashes
2253 for (unsigned i=0;i<onlHashMax;++i) {
2254 const HWIdentifier hwid = m_online_idhelper->channel_Id(IdentifierHash(i));
2255
2256 const std::vector<HWIdentifier>& calibIDs=cabling->calibSlotLine(hwid);
2257 const size_t nCalibLines=calibIDs.size();
2258
2259 if (m_online_idhelper->isEMBchannel(hwid) && m_online_idhelper->pos_neg(hwid) == 1 && m_online_idhelper->feedthrough(hwid) == 0 ) { // EMB-A FT 0
2260 if(nCalibLines > 1) { //should not be in our channels
2261 ATH_MSG_ERROR("Wrong number of CL in our channels");
2262 return StatusCode::FAILURE;
2263 }
2264 if(nCalibLines==0) {
2265 pBlobCalib[calibIndex++]=0;
2266 } else {
2267 const HWIdentifier cmodule = m_online_idhelper->calib_module_Id(calibIDs[0]);
2268 const HWIdentifier newcl = m_online_idhelper->calib_channel_Id(cmodule, m_online_idhelper->channel(hwid) );
2269 if(!m_online_idhelper->isCalibration(newcl)) {
2270 ATH_MSG_ERROR("Something wrong, new CL not a calibration");
2271 ATH_MSG_ERROR("Channel: "<<hwid.get_identifier32().get_compact()<<" old CL: "<< calibIDs[0].get_identifier32().get_compact()<<" new CL: "<<newcl.get_identifier32().get_compact());
2272 return StatusCode::FAILURE;
2273 }
2274 ATH_MSG_INFO("Channel: "<<hwid.get_identifier32().get_compact()<<" old CL: "<< calibIDs[0].get_identifier32().get_compact()<<" new CL: "<<newcl.get_identifier32().get_compact());
2275 pBlobCalib[calibIndex++]=1;
2276 pBlobCalib[calibIndex++]=newcl.get_identifier32().get_compact();
2277 }
2278 } else {
2279 pBlobCalib[calibIndex++]=nCalibLines;
2280 for(uint32_t iCalib=0;iCalib<nCalibLines;++iCalib)
2281 pBlobCalib[calibIndex++]=calibIDs[iCalib].get_identifier32().get_compact();
2282 }
2283 }
2284 blobCalib.resize(calibIndex*sizeof(uint32_t)); //Size down to actual size
2285 ATH_MSG_INFO( "BlobSize CalibId:" << calibIndex);
2286
2287 // and now record the blob to SG
2288 ATH_CHECK(detStore()->record(std::move(al_calib),"/LAR/Identifier/CalibIdMap_EMF"));
2289
2290 return StatusCode::SUCCESS;
2291}

◆ fix2()

StatusCode FixLArElecCalib::fix2 ( const LArOnOffIdMapping * cabling)

Definition at line 297 of file FixLArElecCalib.cxx.

297 {
298
299 ATH_MSG_INFO ( " in fix2() " );
300
301 // Fix2 is for updating the FCAL conditions data after IdFix7
302 // Input should be MC Conditions data with DetDescrVersion=ATLAS-DC3-05
303
304 const LArFCAL_ID* fcal_idhelper = nullptr;
305 ATH_CHECK( detStore()->retrieve(fcal_idhelper) );
306
307 const LArOnlineID* online_idhelper = nullptr;
308 ATH_CHECK( detStore()->retrieve(online_idhelper) );
309
310 // retrieve DetDescrManager
311 SmartIF<IToolSvc> toolSvc{Gaudi::svcLocator()->service("ToolSvc")};
312 ATH_CHECK(toolSvc.isValid());
313
314 LArDAC2uAMC * dac2ua = nullptr;
315 ATH_CHECK( detStore()->retrieve(dac2ua) );
316
317 LAruA2MeVMC * ua2mev = nullptr;
318 ATH_CHECK( detStore()->retrieve(ua2mev) );
319
320 LArRampMC * ramp = nullptr;
321 ATH_CHECK( detStore()->retrieve(ramp) );
322
323 LArShape32MC * shape = nullptr;
324 ATH_CHECK( detStore()->retrieve(shape) );
325
326 LArNoiseMC * noise = nullptr;
327 ATH_CHECK( detStore()->retrieve(noise) );
328
329 LArfSamplMC * fsampl = nullptr;
330 ATH_CHECK( detStore()->retrieve(fsampl) );
331
332 LArMinBiasMC * minbias = nullptr;
333 ATH_CHECK( detStore()->retrieve(minbias) );
334
335 LArAutoCorrMC * ac = nullptr;
336 ATH_CHECK( detStore()->retrieve(ac) );
337
338
339 for( unsigned int gain=0;gain<3;++gain)
340 {
341 // loop over all the old data
343 LArRampMC::ConditionsMapIterator it_e = ramp->end(gain);
344
345 int n=0;
346 for (; it!=it_e;++it)
347 {
348 HWIdentifier hid = it.channelId();
349 if( (*it).isEmpty() ) continue;
350 if(cabling->isOnlineConnected(hid)){
351 continue;
352 }else
353 {
354 ATH_MSG_DEBUG(" unconnected channel"
355 << online_idhelper->print_to_string(hid) );
356 ac->get(hid,gain) = LArAutoCorrComplete::LArCondObj();
357 ramp->get(hid,gain) = LArRampComplete::LArCondObj();
358 shape->get(hid,gain) = LArShape32MC::LArCondObj();
359 noise->get(hid,gain) = LArNoiseComplete::LArCondObj();
360 if(gain==0){
361 dac2ua->get(hid,gain) = LArDAC2uAComplete::LArCondObj();
362 ua2mev->get(hid,gain) = LAruA2MeVComplete::LArCondObj();
363 fsampl->get(hid,gain) = LArfSamplComplete::LArCondObj();
364 minbias->get(hid,gain) = LArMinBiasComplete::LArCondObj();
365 }
366 ++n ;
367 }
368
369 }
370 ATH_MSG_DEBUG(" Gain="<<gain<<
371 " Number of entries removed = " <<n );
372 }
373
374
375 HWIdentifier hid_mod[3];
376 hid_mod[0] = online_idhelper->channel_Id(1,1,6,1,33);
377 hid_mod[1] = online_idhelper->channel_Id(1,1,6,10,12);
378 hid_mod[2] = online_idhelper->channel_Id(1,1,6,14,12);
379
380 // loop over all FCAL channels
381 std::vector<Identifier>::const_iterator it= fcal_idhelper->fcal_begin();
382 std::vector<Identifier>::const_iterator it_e= fcal_idhelper->fcal_end();
383 int n = 0;
384 for(;it!=it_e; ++it)
385 {
386 Identifier id = *it;
387 int pn = fcal_idhelper->pos_neg(id);
388 if(pn!=2) continue;
389 int phi = fcal_idhelper->phi(id);
390 if (phi>7) continue;
391
392 int module = fcal_idhelper->module(id)-1;
393
394 HWIdentifier hid = cabling->createSignalChannelID(id);
395
396 for(unsigned int gain = 0;gain<3;++gain){
397
398 LArRampComplete::LArCondObj& rampP = ramp->get(hid,gain) ;
399 if (!rampP.isEmpty()) continue ;
400
401 ATH_MSG_DEBUG(" channel needs repair "
402 << online_idhelper->print_to_string(hid) );
403 ATH_MSG_DEBUG ( fcal_idhelper->print_to_string(id) );
404 ATH_MSG_DEBUG ( "module = "<<module );
405
406 ++n;
407
408 LArRampComplete::LArCondObj ramp_std = ramp->get(hid_mod[module],gain) ;
409 ramp->setPdata(hid,ramp_std,gain);
410
411 LArAutoCorrComplete::LArCondObj ac_std = ac->get(hid_mod[module],gain) ;
412 ac->setPdata(hid,ac_std,gain);
413
414 LArShape32MC::LArCondObj shape_std = shape->get(hid_mod[module],gain) ;
415 shape->setPdata(hid,shape_std,gain);
416
417 LArNoiseComplete::LArCondObj noise_std = noise->get(hid_mod[module],gain) ;
418 noise->setPdata(hid,noise_std,gain);
419
420 if(gain==0){
421
422 LAruA2MeVComplete::LArCondObj ua2mev_std = ua2mev->get(hid_mod[module],gain) ;
423 ua2mev->setPdata(hid,ua2mev_std,gain);
424
425 LArDAC2uAComplete::LArCondObj dac2ua_std = dac2ua->get(hid_mod[module],gain) ;
426 dac2ua->setPdata(hid,dac2ua_std,gain);
427
428 LArfSamplComplete::LArCondObj fsampl_std = fsampl->get(hid_mod[module],gain) ;
429 fsampl->setPdata(hid,fsampl_std,gain);
430
431 LArMinBiasComplete::LArCondObj minbias_std = minbias->get(hid_mod[module],gain) ;
432 minbias->setPdata(hid,minbias_std,gain);
433
434 }
435
436 }
437 }
438
439 ATH_MSG_DEBUG( " Number of entries fixed " <<n );
440 return StatusCode::SUCCESS;
441}
void setPdata(const HWIdentifier id, const T &payload, unsigned int gain=0)
put payload in persistent data
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
id_iterator fcal_end() const
end iterator over full set of Fcal Identifiers for channels
id_iterator fcal_begin() const
begin iterator over full set of Fcal Identifiers for channels
int phi(const Identifier id) const
phi [0,15]
int pos_neg(const Identifier id) const
pos_neg : +/- 2 (A/C side)
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
bool isEmpty() const
Definition LArRampP1.h:29

◆ initialize()

StatusCode FixLArElecCalib::initialize ( )
overridevirtual

Definition at line 129 of file FixLArElecCalib.cxx.

129 {
130 ATH_MSG_INFO ( " in initialize " );
131
132 ATH_CHECK( detStore()->retrieve(m_em_idhelper) );
133 ATH_CHECK( detStore()->retrieve(m_hec_idhelper) );
134 ATH_CHECK( detStore()->retrieve(m_fcal_idhelper) );
135 ATH_CHECK( detStore()->retrieve(m_sem_idhelper) );
136 ATH_CHECK( detStore()->retrieve(m_shec_idhelper) );
137 ATH_CHECK( detStore()->retrieve(m_online_idhelper) );
138 ATH_CHECK( detStore()->retrieve(m_sonline_idhelper) );
139 ATH_CHECK( detStore()->retrieve(m_scell_idhelper) );
140
141 ATH_CHECK( m_cablingKey.initialize() );
142 ATH_CHECK( m_CLKey.initialize() );
143
144 return StatusCode::SUCCESS;
145}
SG::ReadCondHandleKey< LArCalibLineMapping > m_CLKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::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< Gaudi::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_object() [1/5]

void FixLArElecCalib::print_object ( std::string_view msg,
const LArAutoCorrMC::LArCondObj & obj )
private

Definition at line 1303 of file FixLArElecCalib.cxx.

1304{
1305 if( obj.isEmpty()){
1306 ATH_MSG_INFO(" LArAutoCorrMC " << s << " is empty" );
1307 }else
1308 {
1309 msg()<<MSG::DEBUG<<" LArAutoCorrMC" << s ;
1310 for (unsigned int i =0 ; i<obj.m_vAutoCorr.size();++i)
1311 msg()<< " " << obj.m_vAutoCorr[i];
1312 msg()<<endmsg;
1313 }
1314 return ;
1315}
#define endmsg

◆ print_object() [2/5]

void FixLArElecCalib::print_object ( std::string_view msg,
const LArNoiseMC::LArCondObj & obj )
private

Definition at line 1283 of file FixLArElecCalib.cxx.

1284{
1285 if( obj.isEmpty()){
1286 ATH_MSG_INFO(" LArNoiseMC " << msg << " is empty" );
1287 }else
1288 ATH_MSG_DEBUG(" LArNoiseMC" << msg << obj.m_Noise );
1289 return ;
1290}

◆ print_object() [3/5]

void FixLArElecCalib::print_object ( std::string_view msg,
const LArShape32MC::LArCondObj & obj )
private

Definition at line 1359 of file FixLArElecCalib.cxx.

1360{
1361 if( obj.isEmpty()){
1362 ATH_MSG_INFO(" LArShape32MC " << s << " is empty" );
1363 }else
1364 {
1365 msg()<<MSG::DEBUG<<" LArShape" << s ;
1366 for (unsigned int i =0 ; i<obj.m_vShape.size();++i)
1367 msg()<< " " << obj.m_vShape[i];
1368 msg()<<endmsg;
1369
1370 msg()<<MSG::DEBUG<<" LArShapeDer" << s ;
1371 for (unsigned int i =0 ; i<obj.m_vShapeDer.size();++i)
1372 msg()<< " " << obj.m_vShapeDer[i];
1373 msg()<<endmsg;
1374 }
1375 return ;
1376}

◆ print_object() [4/5]

void FixLArElecCalib::print_object ( std::string_view msg,
const LArSingleFloatP & obj )
private

Definition at line 1403 of file FixLArElecCalib.cxx.

1404{
1405 if( obj.isEmpty()){
1406 ATH_MSG_INFO(" LArSingleFloatP " << msg << " is empty" );
1407 }else
1408 ATH_MSG_DEBUG(" LArSingleFloatP " << msg << obj.m_data );
1409 return ;
1410}

◆ print_object() [5/5]

void FixLArElecCalib::print_object ( std::string_view s,
const LArRampMC::LArCondObj & obj )
private

Definition at line 1330 of file FixLArElecCalib.cxx.

1331{
1332 if( obj.isEmpty()){
1333 ATH_MSG_INFO(" LArRampMC " << s << " is empty" );
1334 }else
1335 {
1336 msg()<<MSG::DEBUG<<" LArRampMC" << s ;
1337 for (unsigned int i =0 ; i<obj.m_vRamp.size();++i)
1338 msg()<< " " << obj.m_vRamp[i];
1339 msg()<<endmsg;
1340 }
1341 return ;
1342}

◆ ReadFile()

StatusCode FixLArElecCalib::ReadFile ( const std::string & filename,
const LArOnOffIdMapping * cabling,
bool EM,
bool withGain,
int nvar )
private

Definition at line 1144 of file FixLArElecCalib.cxx.

1144 {
1145
1146 std::ifstream infile(filename) ;
1147
1148 if(! infile.good() )
1149 {
1150 ATH_MSG_ERROR(" fail to open file "<<filename );
1151 return StatusCode::FAILURE;
1152 }
1153
1154 ATH_MSG_INFO(" Opened file "<<filename );
1155
1156 m_cache[0].clear();
1157 m_cache[1].clear();
1158 m_cache[2].clear();
1159
1160 char s[200];
1161 infile.getline(s,200);
1162 ATH_MSG_INFO(" first line of the file "<<s);
1163
1164 int det=2;
1165 int samp,reg,eta;
1166 int first;
1167 while ( infile>>first )
1168 {
1169 if (EM) {
1170 det = first;
1171 infile>>samp>>reg>>eta;
1172 }else
1173 {
1174 samp=first;
1175 infile>>reg>>eta;
1176 }
1177
1178 int gain=0;
1179 if(withGain) infile>>gain ;
1180 std::vector<float> vfl;
1181 float x;
1182
1183 for (int i=0;i<nvar;++i)
1184 {
1185 infile>>x;
1186 vfl.push_back(x);
1187 }
1188 ATH_MSG_DEBUG(" det,samp,reg,eta,values="
1189 <<det<<" "
1190 <<samp<<" "
1191 <<reg<<" "
1192 <<eta<<" " );
1193
1194 Identifier id ;
1195 if (EM)
1196 {
1197 if ( det==1 && samp==1 && reg==0 && eta==0 ){
1198 // eta=0 for strip, not connected, but keep it
1199 // Removed disconnected channels: 03/2016 RDS
1200 ATH_MSG_DEBUG(" disconnected strip ");
1201 }else
1202 id = m_em_idhelper->channel_id(det,samp,reg,eta,0);
1203 }else //HEC
1204 {
1205 id = m_hec_idhelper->channel_id(2,samp,reg,eta,0);
1206 }
1207 HWIdentifier hid = cabling->createSignalChannelID(id);
1208
1209 if (gain >= 0 && gain < 3)
1210 m_cache[gain].push_back(ROW_t(hid,vfl));
1211 }
1212
1213 return StatusCode::SUCCESS;
1214}
#define x
bool first
Definition DeMoScan.py:534

◆ ReadFileAll()

StatusCode FixLArElecCalib::ReadFileAll ( const std::string & filename,
const LArOnOffIdMapping * cabling,
bool withGain,
int nvar )
private

Definition at line 1216 of file FixLArElecCalib.cxx.

1216 {
1217
1218 std::ifstream infile(filename) ;
1219
1220 if(! infile.good() )
1221 {
1222 ATH_MSG_ERROR(" fail to open file "<<filename );
1223 return StatusCode::FAILURE;
1224 }
1225
1226 ATH_MSG_INFO(" Opened file "<<filename );
1227
1228 m_cache[0].clear();
1229 m_cache[1].clear();
1230 m_cache[2].clear();
1231
1232 char s[200];
1233 infile.getline(s,200);
1234 ATH_MSG_INFO(" first line of the file "<<s);
1235
1236 int det=0,samp=0,reg=0,eta=0;
1237 int first=0;
1238 while ( infile>>first>>samp>>reg>>eta ) {
1239 Identifier id ;
1240 int gain=0;
1241 float x;
1242 if(first <= 2) { // Calo 0,1,2 is EM
1243 det = first+1;
1244 if ( det==1 && samp==1 && reg==0 && eta==0 ){
1245 // eta=0 for strip, not connected, but keep it
1246 // Removed disconnected channels: 03/2016 RDS
1247 ATH_MSG_DEBUG(" disconnected strip ");
1248 // id = m_em_idhelper->disc_channel_id(det,samp,reg,eta,0);
1249 }else
1250 id = m_em_idhelper->channel_id(det,samp,reg,eta,0);
1251 } else if (first == 3) { // HEC
1252 id = m_hec_idhelper->channel_id(2,samp,reg,eta,0);
1253 } else if (first == 4) { // FCAL
1254 id = m_fcal_idhelper->channel_id(2,samp+1,eta,0);
1255 } else {
1256 ATH_MSG_WARNING(" Wrong calo number "<<first<<" skipping !!!");
1257 if(withGain) infile>>gain ;
1258 for (int i=0;i<nvar;++i) infile>>x;
1259 continue;
1260 }
1261 if(withGain) infile>>gain ;
1262 std::vector<float> vfl;
1263
1264 for (int i=0;i<nvar;++i)
1265 {
1266 infile>>x;
1267 vfl.push_back(x);
1268 }
1269 ATH_MSG_DEBUG(" first, det,samp,reg,eta,values="
1270 <<first<<" " <<det<<" " <<samp<<" " <<reg<<" " <<eta<<" " );
1271
1272 HWIdentifier hid = cabling->createSignalChannelID(id);
1273
1274 if (gain >= 0 && gain < 3) m_cache[gain].push_back(ROW_t(hid,vfl));
1275 else {
1276 ATH_MSG_WARNING(" Wrong gain " <<gain<<" skipping !");
1277 }
1278 }// while
1279
1280 return StatusCode::SUCCESS;
1281}

◆ 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< Gaudi::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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ set_object() [1/5]

void FixLArElecCalib::set_object ( LArAutoCorrMC::LArCondObj & obj,
const std::vector< float > & v )
private

Definition at line 1317 of file FixLArElecCalib.cxx.

1318{
1319 if (v.size()<4 )
1320 {
1321 ATH_MSG_ERROR( "for LArAutoCorrMC, size of vector = "<< v.size()<<" is less then 4" );
1322 return ;
1323 }
1324
1325 obj.m_vAutoCorr.resize(4);
1326 std::copy_n(v.begin(), 4, obj.m_vAutoCorr.begin());
1327 return;
1328}

◆ set_object() [2/5]

void FixLArElecCalib::set_object ( LArNoiseMC::LArCondObj & obj,
const std::vector< float > & v )
private

Definition at line 1292 of file FixLArElecCalib.cxx.

1293{
1294 if (v.size()!=1)
1295 {
1296 ATH_MSG_ERROR ("for LArNoiseMC, size of vector = "<< v.size() <<" differs from one");
1297 return ;
1298 }
1299 obj.m_Noise = v[0];
1300 return;
1301}

◆ set_object() [3/5]

void FixLArElecCalib::set_object ( LArRampMC::LArCondObj & obj,
const std::vector< float > & v )
private

Definition at line 1344 of file FixLArElecCalib.cxx.

1345{
1346 if (v.size()!=1 )
1347 {
1348 ATH_MSG_ERROR ("for LArRampMC, size of vector = "<< v.size());
1349 return ;
1350 }
1351 obj.m_vRamp.resize(3);
1352 obj.m_vRamp[0]=0;
1353 obj.m_vRamp[1]=v[0];
1354 obj.m_vRamp[2]=0;
1355
1356 return;
1357}

◆ set_object() [4/5]

void FixLArElecCalib::set_object ( LArShape32MC::LArCondObj & obj,
const std::vector< float > & v )
private

Definition at line 1378 of file FixLArElecCalib.cxx.

1379{
1380
1381 if (v.size()!=64 && v.size()!=32 )
1382 {
1383 ATH_MSG_ERROR ("for LArShape32MC, size of vector = "<< v.size());
1384 return ;
1385 }
1386
1387 unsigned int size = 32;
1388 obj.m_vShape.resize(size);
1389 obj.m_vShapeDer.resize(size);
1390
1391 for(unsigned int i=0;i<size;++i){
1392 obj.m_vShape[i]=v[i];
1393 if(v.size() == 64 ) obj.m_vShapeDer[i]=v[i+size]; else obj.m_vShapeDer[i]=0.;
1394 }
1395
1396 return;
1397}
size_t size() const
Number of registered mappings.

◆ set_object() [5/5]

void FixLArElecCalib::set_object ( LArSingleFloatP & obj,
const std::vector< float > & v )
private

Definition at line 1412 of file FixLArElecCalib.cxx.

1413{
1414 if (v.size()!=1)
1415 {
1416 ATH_MSG_ERROR( "for LArSingleFloatP, size of vector = "<< v.size() );
1417 return ;
1418 }
1419 obj.m_data = v[0];
1420 return;
1421}

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::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< Gaudi::Algorithm > >.

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

Definition at line 60 of file AthCommonAlgorithm.cxx.

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

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::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.

◆ update_DAC2uA()

StatusCode FixLArElecCalib::update_DAC2uA ( const std::string & em_filename,
const std::string & hec_filename )
private

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 }

Member Data Documentation

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> FixLArElecCalib::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 68 of file FixLArElecCalib.h.

68{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_cache

VROW_t FixLArElecCalib::m_cache[3]
private

Definition at line 130 of file FixLArElecCalib.h.

◆ m_CLKey

SG::ReadCondHandleKey<LArCalibLineMapping> FixLArElecCalib::m_CLKey {this, "CalibLineKey", "LArCalibLineMap", "calib line key"}
private

Definition at line 69 of file FixLArElecCalib.h.

69{this, "CalibLineKey", "LArCalibLineMap", "calib line key"};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_em_idhelper

const LArEM_ID* FixLArElecCalib::m_em_idhelper
private

Definition at line 118 of file FixLArElecCalib.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fcal_idhelper

const LArFCAL_ID* FixLArElecCalib::m_fcal_idhelper
private

Definition at line 120 of file FixLArElecCalib.h.

◆ m_fixFlag

IntegerProperty FixLArElecCalib::m_fixFlag {this, "FixFlag", 1, "which fix to apply"}
private

Definition at line 71 of file FixLArElecCalib.h.

71{this, "FixFlag", 1, "which fix to apply"};

◆ m_g4Phys

StringProperty FixLArElecCalib::m_g4Phys {this, "G4Phys", "", "which physics list to use"}
private

Definition at line 72 of file FixLArElecCalib.h.

72{this, "G4Phys", "", "which physics list to use"};

◆ m_hec_idhelper

const LArHEC_ID* FixLArElecCalib::m_hec_idhelper
private

Definition at line 119 of file FixLArElecCalib.h.

◆ m_infile

StringProperty FixLArElecCalib::m_infile {this, "InputFile", "", "name of inpput file"}
private

Definition at line 73 of file FixLArElecCalib.h.

73{this, "InputFile", "", "name of inpput file"};

◆ m_online_idhelper

const LArOnlineID* FixLArElecCalib::m_online_idhelper
private

Definition at line 121 of file FixLArElecCalib.h.

◆ m_scell_idhelper

const CaloCell_SuperCell_ID* FixLArElecCalib::m_scell_idhelper
private

Definition at line 125 of file FixLArElecCalib.h.

◆ m_sem_idhelper

const LArEM_SuperCell_ID* FixLArElecCalib::m_sem_idhelper
private

Definition at line 122 of file FixLArElecCalib.h.

◆ m_shec_idhelper

const LArHEC_SuperCell_ID* FixLArElecCalib::m_shec_idhelper
private

Definition at line 123 of file FixLArElecCalib.h.

◆ m_sonline_idhelper

const LArOnline_SuperCellID* FixLArElecCalib::m_sonline_idhelper
private

Definition at line 124 of file FixLArElecCalib.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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