Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
fix electronic calibration constants for MC.
More...
#include <FixLArElecCalib.h>
|
| FixLArElecCalib (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~FixLArElecCalib ()=default |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
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. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
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 (const std::string &msg, const LArNoiseMC::LArCondObj &obj) |
|
void | set_object (LArNoiseMC::LArCondObj &obj, const std::vector< float > &v) |
|
void | print_object (const std::string &msg, const LArAutoCorrMC::LArCondObj &obj) |
|
void | set_object (LArAutoCorrMC::LArCondObj &obj, const std::vector< float > &v) |
|
void | print_object (const std::string &msg, const LArRampMC::LArCondObj &obj) |
|
void | set_object (LArRampMC::LArCondObj &obj, const std::vector< float > &v) |
|
void | print_object (const std::string &msg, const LArShape32MC::LArCondObj &obj) |
|
void | set_object (LArShape32MC::LArCondObj &obj, const std::vector< float > &v) |
|
void | print_object (const std::string &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 > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"} |
|
SG::ReadCondHandleKey< LArCalibLineMapping > | m_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_ID * | m_em_idhelper |
|
const LArHEC_ID * | m_hec_idhelper |
|
const LArFCAL_ID * | m_fcal_idhelper |
|
const LArOnlineID * | m_online_idhelper |
|
const LArEM_SuperCell_ID * | m_sem_idhelper |
|
const LArHEC_SuperCell_ID * | m_shec_idhelper |
|
const LArOnline_SuperCellID * | m_sonline_idhelper |
|
const CaloCell_SuperCell_ID * | m_scell_idhelper |
|
VROW_t | m_cache [3] |
|
DataObjIDColl | m_extendedExtraObjects |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
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:
- Flag = 1 Replacing values for barrel in LArDAC2uAMC Input barrel_dac2ua_oct06.txt
- Flag=2 fix FCAL conditions data for new mapping in release 13.
- 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
- Flag=4 replace uA2MeV DAC2uA with that in dac2ua_ua2mev_rel13.txt
- 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 38 of file FixLArElecCalib.h.
◆ ROW_t
◆ StoreGateSvc_t
◆ VROW_t
◆ FixLArElecCalib()
FixLArElecCalib::FixLArElecCalib |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~FixLArElecCalib()
virtual FixLArElecCalib::~FixLArElecCalib |
( |
| ) |
|
|
virtualdefault |
◆ addMphysOverMcal()
Definition at line 1424 of file FixLArElecCalib.cxx.
1431 std::unique_ptr<LArMphysOverMcalMC> mphys = std::make_unique<LArMphysOverMcalMC>();
1437 std::string
filename(
"FCal_noise_minbias_adc2mev.txt");
1444 return StatusCode::FAILURE;
1451 for(
int i = 0;
i<27;++
i){
1458 float vol,noise_p,noise_h, noise_m,noise_l;
1459 float ramp_val,ua2MeV_val,dac2uA_val;
1461 while (
infile>>str_id >>vol>>noise_p >> noise_h>>noise_m>>noise_l
1464 const char* ch_id = str_id.c_str();
1466 if(str_id.substr(0,1)!=std::string(
"A")){
1472 sscanf(ch_id,
"A%d.%d.%d", &
mod,&
phi,&
eta);
1494 bool withGain=
false;
1496 std::string hec_filename(
"mphys_hec.txt");
1517 ATH_MSG_ERROR(
" Number of HEC channel added "<<
n <<
" per gain ");
1518 return StatusCode::SUCCESS ;
◆ ATLAS_NOT_THREAD_SAFE() [1/20]
StatusCode fix15 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE |
( |
| ) |
|
◆ ATLAS_NOT_THREAD_SAFE() [2/20]
StatusCode fix16 FixLArElecCalib::ATLAS_NOT_THREAD_SAFE |
( |
| ) |
|
◆ ATLAS_NOT_THREAD_SAFE() [3/20]
StatusCode fixDACuAMeV FixLArElecCalib::ATLAS_NOT_THREAD_SAFE |
( |
| ) |
|
|
private |
◆ ATLAS_NOT_THREAD_SAFE() [4/20]
virtual StatusCode stop FixLArElecCalib::ATLAS_NOT_THREAD_SAFE |
( |
| ) |
|
|
overridevirtual |
◆ ATLAS_NOT_THREAD_SAFE() [5/20]
◆ ATLAS_NOT_THREAD_SAFE() [6/20]
◆ ATLAS_NOT_THREAD_SAFE() [7/20]
◆ ATLAS_NOT_THREAD_SAFE() [8/20]
◆ ATLAS_NOT_THREAD_SAFE() [9/20]
◆ ATLAS_NOT_THREAD_SAFE() [10/20]
◆ ATLAS_NOT_THREAD_SAFE() [11/20]
◆ ATLAS_NOT_THREAD_SAFE() [12/20]
◆ ATLAS_NOT_THREAD_SAFE() [13/20]
◆ ATLAS_NOT_THREAD_SAFE() [14/20]
◆ ATLAS_NOT_THREAD_SAFE() [15/20]
◆ 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]
◆ ATLAS_NOT_THREAD_SAFE() [18/20]
◆ ATLAS_NOT_THREAD_SAFE() [19/20]
StatusCode updateEM_DACuAMeV 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() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode FixLArElecCalib::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 144 of file FixLArElecCalib.cxx.
146 const EventContext& ctx = Gaudi::Hive::currentContext();
156 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
virtual StatusCode FixLArElecCalib::finalize |
( |
| ) |
|
|
inlineoverridevirtual |
◆ fix1()
Definition at line 219 of file FixLArElecCalib.cxx.
227 const LArEM_ID* em_idhelper =
nullptr;
234 SmartIF<IToolSvc> toolSvc{Gaudi::svcLocator()->service(
"ToolSvc")};
242 std::ifstream
infile(
"barrel_dac2ua_oct06.txt") ;
246 return StatusCode::FAILURE;
264 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
291 return StatusCode::SUCCESS;
◆ fix12()
Definition at line 2004 of file FixLArElecCalib.cxx.
2012 std::unique_ptr<LArMinBiasMC> minbias = std::make_unique<LArMinBiasMC>();
2013 ATH_CHECK( minbias->setGroupingType(
"Single",
msg()) );
2015 std::unique_ptr<LArMinBiasAverageMC> minbias_av = std::make_unique<LArMinBiasAverageMC>();
2016 ATH_CHECK( minbias_av->setGroupingType(
"Single",
msg()) );
2019 std::unique_ptr<TFile>
fin= std::make_unique<TFile>(
"ntuple_av.root");
2020 TTree *tin=
dynamic_cast<TTree*
>(
fin->Get(
"m_tree"));
2030 TBranch *b_identifier;
2037 tin->SetMakeClass(1);
2038 tin->SetBranchAddress(
"ncell", &
ncell, &b_ncell);
2039 tin->SetBranchAddress(
"identifier",
identifier, &b_identifier);
2040 tin->SetBranchAddress(
"layer",
layer, &b_layer);
2041 tin->SetBranchAddress(
"region", region, &b_region);
2042 tin->SetBranchAddress(
"ieta", ieta, &b_ieta);
2043 tin->SetBranchAddress(
"eta",
eta, &b_eta);
2044 tin->SetBranchAddress(
"average",
average, &b_average);
2045 tin->SetBranchAddress(
"rms",
rms, &b_rms);
2069 return StatusCode::SUCCESS;
◆ fix13()
Definition at line 1733 of file FixLArElecCalib.cxx.
1738 ToolHandle<ICaloSuperCellIDTool> scidtool(
"CaloSuperCellIDTool");
1739 if ( scidtool.retrieve().isFailure() ) {
1743 std::set<Identifier> scidset;
1744 std::map<HWIdentifier,int> sslot_schannel_idx;
1745 std::vector<unsigned int> OrderOnlHash_OffID;
1746 std::vector<unsigned int> OrderOffHash_OnlID;
1747 OrderOnlHash_OffID.resize(40000,0);
1748 OrderOffHash_OnlID.resize(40000,0);
1751 unsigned int min_onl_hash = 999999;
1752 unsigned int max_onl_hash = 0;
1753 unsigned int min_off_hash = 999999;
1754 unsigned int max_off_hash = 0;
1755 std::ofstream
hashes(
"AllHashChannels_All.txt");
1756 std::ofstream of(
"AllChannels_EM.txt");
1758 for(
size_t i = 0;
i < channel_size ;
i++) {
1761 if ( ! isEM )
continue;
1762 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1764 scidset.insert(SCID);
1768 of <<
"Off ID\t\tSCID\t\tOnl ID\t\tFT\tslot\tB-E pos_neg\tSamp\teta\tphi\tFEB_ID\t\tSHWID\t" << std::endl;
1789 sprintf(etaChar,
"%5.4f",
eta);
1790 sprintf(phiChar,
"%5.4f",
phi);
1791 of << std::dec <<
"\t" << feedthrough <<
"\t" << slot;
1792 of <<
"\t" << bar_ec <<
" " << pos_neg <<
"\t\t" << samp <<
"\t";
1793 of << etaChar <<
" " << phiChar <<
"\t0x";
1798 bool secondOutSlot=
false;
1800 if ( (samp==1) && (reg==5) ) secondOutSlot=
true;
1811 if ( secondOutSlot ) {
1814 if ( sslot_schannel_idx.find(sfeb_id) == sslot_schannel_idx.end() )
1815 sslot_schannel_idx[sfeb_id]=0;
1816 else sslot_schannel_idx[sfeb_id]++;
1819 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1820 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1822 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1823 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1829 of <<
" " << onl_hash <<
" " << off_hash;
1837 of <<
"Hash check. Onl : " << min_onl_hash <<
" " << max_onl_hash;
1838 of <<
"; Off : " << min_off_hash <<
" " << max_off_hash << std::endl;;
1842 min_onl_hash = 999999;
1844 min_off_hash = 999999;
1846 std::ofstream of1(
"AllChannels_HEC.txt");
1848 of1 <<
"Off ID\t\tSCID\t\tOnl ID\t\tFT\tslot\tB-E pos_neg\tSamp\teta\tphi\tFEB_ID\t\tSHWID\t" << std::endl;
1849 for(
size_t i = 0;
i < channel_size ;
i++) {
1852 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1853 if ( scidset.find(SCID) == scidset.end() )
1854 scidset.insert(SCID);
1875 sprintf(etaChar,
"%5.4f",
eta);
1876 sprintf(phiChar,
"%5.4f",
phi);
1877 of1 << std::dec <<
"\t" << feedthrough <<
"\t" << slot;
1878 of1 <<
"\t" << bar_ec <<
" " << pos_neg <<
"\t\t" << samp <<
"\t";
1879 of1 << etaChar <<
" " << phiChar <<
"\t0x";
1884 if ( sslot_schannel_idx.find(sfeb_id) == sslot_schannel_idx.end() )
1885 sslot_schannel_idx[sfeb_id]=0;
1886 else sslot_schannel_idx[sfeb_id]++;
1887 if ( (feedthrough==6) && (bar_ec==1) && (slot>9) ) {
1893 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1894 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1896 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1897 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1903 of1 <<
" " << onl_hash <<
" " << off_hash;
1911 min_onl_hash = 999999;
1913 min_off_hash = 999999;
1915 std::ofstream of3(
"AllChannels_FCAL.txt");
1917 of3 <<
"Off ID\t\tSCID\t\tOnl ID\t\tFT\tslot\tB-E pos_neg\tSamp\teta\tphi\tFEB_ID\t\tSHWID\t" << std::endl;
1918 for(
size_t i = 0;
i < channel_size ;
i++) {
1921 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1922 if ( scidset.find(SCID) == scidset.end() )
1923 scidset.insert(SCID);
1934 of3 << std::dec <<
"\t" << feedthrough <<
"\t" << slot;
1935 of3 <<
"\t" << bar_ec <<
" " << pos_neg <<
"\t\t" << samp <<
"\t";
1939 if ( (feedthrough==6) && (bar_ec==1) && (slot>9) ) {
1942 if ( sslot_schannel_idx.find(sfeb_id) == sslot_schannel_idx.end() )
1943 sslot_schannel_idx[sfeb_id]=0;
1944 else sslot_schannel_idx[sfeb_id]++;
1947 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1948 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1950 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1951 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1957 of3 <<
" " << onl_hash <<
" " << off_hash;
1964 of3 <<
"Hash check. Onl : " << min_onl_hash <<
" " << max_onl_hash;
1965 of3 <<
"; Off : " << min_off_hash <<
" " << max_off_hash << std::endl;;
1971 coral::AttributeListSpecification *spec_onOff =
new coral::AttributeListSpecification();
1972 spec_onOff->extend(
"OnlineHashToOfflineId",
"blob");
1973 spec_onOff->extend<
unsigned>(
"version");
1974 std::unique_ptr<AthenaAttributeList> al_onOff = std::make_unique<AthenaAttributeList>(*spec_onOff);
1976 (*al_onOff)[
"version"].setValue(0U);
1977 blobOnOff.resize(onlHashMax*
sizeof(
uint32_t));
1982 for(
size_t ii=0;ii<onlHashMax;ii++) {
1983 if (OrderOnlHash_OffID[ii] != 0) {
1984 pBlobOnOff[ii]=OrderOnlHash_OffID[ii];
1988 pBlobOnOff[ii]=emptyId;
1991 ATH_MSG_INFO (
"HashMax=" << onlHashMax <<
", connected=" << nConn );
1993 ATH_CHECK(
detStore()->record(std::move(al_onOff),
"/LAR/IdentifierOfl/OnOffIdMap_SC") );
1995 hashes <<
"idx \t Off2OnlId \t Onl2OffId" << std::endl;
1996 for(
size_t ii=0;ii<40000;ii++)
1997 if ( (OrderOffHash_OnlID[ii] != 0) || ( OrderOnlHash_OffID[ii] != 0 ) )
1998 hashes << std::dec << ii << std::hex <<
" \t " << OrderOffHash_OnlID[ii] <<
" \t\t " << OrderOnlHash_OffID[ii] << std::endl;
2001 return StatusCode::SUCCESS;
◆ fix14()
Definition at line 2072 of file FixLArElecCalib.cxx.
2082 std::unique_ptr<LArMinBiasAverageMC> minbias_av = std::make_unique<LArMinBiasAverageMC>();
2083 ATH_CHECK( minbias_av->setGroupingType(
"Single",
msg()) );
2086 std::unique_ptr<TFile>
fin= std::make_unique<TFile>(
m_infile.value().c_str());
2087 TTree *tin=
dynamic_cast<TTree*
>(
fin->Get(
"m_tree"));
2097 TBranch *b_identifier;
2104 tin->SetMakeClass(1);
2105 tin->SetBranchAddress(
"ncell", &
ncell, &b_ncell);
2106 tin->SetBranchAddress(
"identifier",
identifier, &b_identifier);
2107 tin->SetBranchAddress(
"layer",
layer, &b_layer);
2108 tin->SetBranchAddress(
"region", region, &b_region);
2109 tin->SetBranchAddress(
"ieta", ieta, &b_ieta);
2110 tin->SetBranchAddress(
"eta",
eta, &b_eta);
2111 tin->SetBranchAddress(
"average",
average, &b_average);
2112 tin->SetBranchAddress(
"rms",
rms, &b_rms);
2121 float fsampl = larfSampl->
FSAMPL(hid);
2132 return StatusCode::SUCCESS;
◆ fix18()
Definition at line 2232 of file FixLArElecCalib.cxx.
2238 coral::AttributeListSpecification* spec_calib =
new coral::AttributeListSpecification();
2239 spec_calib->extend(
"OnlineHashToCalibIds",
"blob");
2240 spec_calib->extend<
unsigned>(
"version");
2241 std::unique_ptr<AthenaAttributeList> al_calib = std::make_unique<AthenaAttributeList>(*spec_calib);
2243 (*al_calib)[
"version"].setValue(0U);
2244 blobCalib.resize(onlHashMax*
sizeof(
uint32_t)*4);
2246 spec_calib->release();
2248 spec_calib =
nullptr;
2251 size_t calibIndex=0;
2255 for (
unsigned i=0;
i<onlHashMax;++
i) {
2258 const std::vector<HWIdentifier>& calibIDs=
cabling->calibSlotLine(hwid);
2259 const size_t nCalibLines=calibIDs.size();
2262 if(nCalibLines > 1) {
2264 return StatusCode::FAILURE;
2266 if(nCalibLines==0) {
2267 pBlobCalib[calibIndex++]=0;
2274 return StatusCode::FAILURE;
2277 pBlobCalib[calibIndex++]=1;
2281 pBlobCalib[calibIndex++]=nCalibLines;
2282 for(
uint32_t iCalib=0;iCalib<nCalibLines;++iCalib)
2283 pBlobCalib[calibIndex++]=calibIDs[iCalib].get_identifier32().get_compact();
2286 blobCalib.resize(calibIndex*
sizeof(
uint32_t));
2290 ATH_CHECK(
detStore()->record(std::move(al_calib),
"/LAR/Identifier/CalibIdMap_EMF"));
2292 return StatusCode::SUCCESS;
◆ fix2()
Definition at line 295 of file FixLArElecCalib.cxx.
309 SmartIF<IToolSvc> toolSvc{Gaudi::svcLocator()->service(
"ToolSvc")};
344 for (;
it!=it_e;++
it)
347 if( (*it).isEmpty() )
continue;
348 if(
cabling->isOnlineConnected(hid)){
369 " Number of entries removed = " <<
n );
374 hid_mod[0] = online_idhelper->
channel_Id(1,1,6,1,33);
375 hid_mod[1] = online_idhelper->
channel_Id(1,1,6,10,12);
376 hid_mod[2] = online_idhelper->
channel_Id(1,1,6,14,12);
379 std::vector<Identifier>::const_iterator
it= fcal_idhelper->
fcal_begin();
380 std::vector<Identifier>::const_iterator it_e= fcal_idhelper->
fcal_end();
387 int phi = fcal_idhelper->
phi(
id);
397 if (!rampP.
isEmpty()) continue ;
438 return StatusCode::SUCCESS;
◆ initialize()
StatusCode FixLArElecCalib::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ print_object() [1/5]
◆ print_object() [2/5]
◆ print_object() [3/5]
◆ print_object() [4/5]
Definition at line 1357 of file FixLArElecCalib.cxx.
1364 for (
unsigned int i =0 ;
i<
obj.m_vShape.size();++
i)
1365 msg()<<
" " <<
obj.m_vShape[
i];
1369 for (
unsigned int i =0 ;
i<
obj.m_vShapeDer.size();++
i)
1370 msg()<<
" " <<
obj.m_vShapeDer[
i];
◆ print_object() [5/5]
◆ ReadFile()
StatusCode FixLArElecCalib::ReadFile |
( |
const std::string & |
filename, |
|
|
const LArOnOffIdMapping * |
cabling, |
|
|
bool |
EM, |
|
|
bool |
withGain, |
|
|
int |
nvar |
|
) |
| |
|
private |
Definition at line 1142 of file FixLArElecCalib.cxx.
1149 return StatusCode::FAILURE;
1178 std::vector<float> vfl;
1181 for (
int i=0;
i<nvar;++
i)
1195 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
1211 return StatusCode::SUCCESS;
◆ ReadFileAll()
Definition at line 1214 of file FixLArElecCalib.cxx.
1221 return StatusCode::FAILURE;
1242 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
1249 }
else if (
first == 3) {
1251 }
else if (
first == 4) {
1256 for (
int i=0;i<nvar;++i) infile>>
x;
1260 std::vector<float> vfl;
1262 for (
int i=0;
i<nvar;++
i)
1268 <<
first<<
" " <<
det<<
" " <<samp<<
" " <<reg<<
" " <<
eta<<
" " );
1278 return StatusCode::SUCCESS;
◆ renounce()
◆ renounceArray()
◆ set_object() [1/5]
Definition at line 1315 of file FixLArElecCalib.cxx.
1319 ATH_MSG_ERROR(
"for LArAutoCorrMC, size of vector = "<<
v.size()<<
" is less then 4" );
1323 obj.m_vAutoCorr.resize(4);
1324 std::copy_n(
v.begin(), 4,
obj.m_vAutoCorr.begin());
◆ set_object() [2/5]
◆ set_object() [3/5]
◆ set_object() [4/5]
◆ set_object() [5/5]
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ update_DAC2uA()
StatusCode FixLArElecCalib::update_DAC2uA |
( |
const std::string & |
em_filename, |
|
|
const std::string & |
hec_filename |
|
) |
| |
|
private |
◆ updateVHKA()
◆ m_cablingKey
◆ m_cache
VROW_t FixLArElecCalib::m_cache[3] |
|
private |
◆ m_CLKey
◆ m_detStore
◆ m_em_idhelper
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_fcal_idhelper
◆ m_fixFlag
IntegerProperty FixLArElecCalib::m_fixFlag {this, "FixFlag", 1, "which fix to apply"} |
|
private |
◆ m_g4Phys
StringProperty FixLArElecCalib::m_g4Phys {this, "G4Phys", "", "which physics list to use"} |
|
private |
◆ m_hec_idhelper
◆ m_infile
StringProperty FixLArElecCalib::m_infile {this, "InputFile", "", "name of inpput file"} |
|
private |
◆ m_online_idhelper
◆ m_scell_idhelper
◆ m_sem_idhelper
◆ m_shec_idhelper
◆ m_sonline_idhelper
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
int phi(const Identifier id) const
return phi according to :
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
void setPdata(const HWIdentifier id, const T &payload, unsigned int gain=0)
put payload in persistent data
IntegerProperty m_fixFlag
Implementation of the interface ILAruA2MeV for MC Derives from LAruA2MeVComplete, and implements the ...
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
int eta(const Identifier id) const
return eta [0,9] outer part [0,3] inner part
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.
Scalar phi() const
phi method
bool is_lar_fcal(Identifier id) const
Implementation of the interface ILArRamp for MC Derives from LArRampComplete, and implements the phi-...
int pos_neg(const Identifier id) const
pos_neg : +/- 2 (A/C side)
unsigned int value() const
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
bool is_em_endcap_outer(const Identifier id) const
test if the id belongs to the EM Endcap outer wheel
IdentifierHash region_hash(Identifier regionId) const
Convert a connected region Identifier to a hash code.
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::vector< LUCID_RawData_p1 > t3
Identifier region_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
Declaration of const iterator.
Persistent data for LArRamp Copied from LAr.
c-struct reproducing the structure of the persistent data
void set(const HWIdentifier &CellID, float vMinBiasAverage)
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
std::vector< SG::VarHandleKeyArray * > m_vhka
int module(const Identifier id) const
module [1,3]
int region(const Identifier id) const
return region according to :
int sampling(const Identifier id) const
return sampling according to :
const LArOnline_SuperCellID * m_sonline_idhelper
HWIdentifier calib_module_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Build calibration module identifier from fields.
const LArHEC_ID * m_hec_idhelper
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
const LArFCAL_ID * m_fcal_idhelper
const std::string & key() const
Return the StoreGate ID for the referenced object.
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
Identifier region_id(const ExpandedIdentifier &exp_id) const
region identifier for a channel from ExpandedIdentifier
Identifier channel_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
value_type get_compact() const
Get the compact id.
const LArHEC_SuperCell_ID * m_shec_idhelper
int eta(const Identifier id) const
return eta according to :
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
unsigned int totalNumberOfConditions() const
Statistics: total number of conditions.
int phi(const Identifier id) const
phi [0,15]
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
virtual StatusCode sysInitialize() override
Override sysInitialize.
Implementation of the interface ILArMinBias for MC Derives from LArMinBiasComplete,...
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
const LArEM_ID * m_em_idhelper
const LArEM_SuperCell_ID * m_sem_idhelper
float etaGranularity(const IdentifierHash regHash) const
Return the eta granularity of a region, or NOT_VALID.
::StatusCode StatusCode
StatusCode definition for legacy code.
c-struct reproducing the structure of the persistent data
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
get data with online identifier
virtual const float & FSAMPL(const HWIdentifier &id) const =0
Implementation of the interface ILArfSampl for MC Derives from LArfSamplComplete, and implements the ...
Identifier channel_id(const ExpandedIdentifier &exp_id) const
cell identifier for a channel from ExpandedIdentifier
const LArOnlineID * m_online_idhelper
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
bool is_lar_hec(Identifier id) const
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
This class implements the ILArShape interface.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.
float eta0(const IdentifierHash regHash) const
Return the minimum eta of region, or NOT_VALID.
size_type channelHashMax(void) const
Define channel hash tables max size.
Identifier channel_id(const ExpandedIdentifier &exp_id) const
channel identifier for a channel from ExpandedIdentifier
StatusCode initialize(bool used=true)
bool isCalibration(const HWIdentifier id) const
bool isEMBchannel(const HWIdentifier id) const
bool is_em_endcap_inner(const Identifier id) const
test if the id belongs to the EM Endcap inner wheel
id_iterator fcal_begin(void) const
begin iterator over full set of Fcal Identifiers for channels
DataObjIDColl m_extendedExtraObjects
c-struct reproducing the structure of the persistent data
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
c-struct reproducing the structure of the persistent data
float phi0(const IdentifierHash regHash) const
Return the minimum phi of region, or NOT_VALID.
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
StatusCode fix13(const LArOnOffIdMapping *cabling)
#define ATH_MSG_WARNING(x)
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
std::pair< HWIdentifier, std::vector< float > > ROW_t
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
StatusCode ReadFile(const std::string &filename, const LArOnOffIdMapping *cabling, bool EM, bool withGain, int nvar)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Implementation of the interface ILArDAC2uA for MC Derives from LArDAC2uAComplete, and implements the ...
AthAlgorithm()
Default constructor:
Helper class for LArEM offline identifiers.
float phiGranularity(const IdentifierHash regHash) const
Return the phi granularity of a region, or NOT_VALID.
id_iterator fcal_end(void) const
end iterator over full set of Fcal Identifiers for channels
SG::ReadCondHandleKey< LArCalibLineMapping > m_CLKey
unsigned long long size_type
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Implementation of the interface ILArNoise for MC Derives from LArNoiseComplete, and implements the ph...
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
Helper class for LArFCAL offline identifiers.
HWIdentifier calib_channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create calibration channel identifiers from fields
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
IdentifierHash region_hash(Identifier regionId) const
Convert a connected region Identifier to a hash code.
Implementation of the interface ILArAutoCorr for MC Derives from LArAutoCorrComplete,...
void set(const HWIdentifier &CellID, float vMinBiasRMS)
bool is_em_endcap(const Identifier id) const
test if the id belongs to the EM Endcap
int phi(const Identifier id) const
return phi[0,63] outer part [0,31] inner part
const CaloCell_SuperCell_ID * m_scell_idhelper