83 #include "Gaudi/Property.h"
84 #include "GaudiKernel/IToolSvc.h"
109 #include "CoralBase/Blob.h"
114 m_em_idhelper(nullptr),
115 m_hec_idhelper(nullptr),
116 m_fcal_idhelper(nullptr),
117 m_online_idhelper(nullptr),
118 m_sem_idhelper(nullptr),
119 m_shec_idhelper(nullptr),
120 m_sfcal_idhelper(nullptr),
121 m_sonline_idhelper(nullptr),
122 m_scell_idhelper(nullptr)
147 return StatusCode::SUCCESS;
152 const EventContext& ctx = Gaudi::Hive::currentContext();
162 return StatusCode::SUCCESS;
169 const EventContext& ctx = Gaudi::Hive::currentContext();
174 ATH_MSG_WARNING(
"Do not have cabling mapping from key " << m_cablingKey.key() );
180 return StatusCode::FAILURE;
219 return fix18(clCont);
221 return StatusCode::SUCCESS;
233 const LArEM_ID* em_idhelper =
nullptr;
240 SmartIF<IToolSvc> toolSvc{Gaudi::svcLocator()->service(
"ToolSvc")};
248 std::ifstream
infile(
"barrel_dac2ua_oct06.txt") ;
252 return StatusCode::FAILURE;
270 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
297 return StatusCode::SUCCESS;
315 SmartIF<IToolSvc> toolSvc{Gaudi::svcLocator()->service(
"ToolSvc")};
350 for (;
it!=it_e;++
it)
353 if( (*it).isEmpty() )
continue;
354 if(
cabling->isOnlineConnected(hid)){
375 " Number of entries removed = " <<
n );
380 hid_mod[0] = online_idhelper->
channel_Id(1,1,6,1,33);
381 hid_mod[1] = online_idhelper->
channel_Id(1,1,6,10,12);
382 hid_mod[2] = online_idhelper->
channel_Id(1,1,6,14,12);
385 std::vector<Identifier>::const_iterator
it= fcal_idhelper->
fcal_begin();
386 std::vector<Identifier>::const_iterator it_e= fcal_idhelper->
fcal_end();
393 int phi = fcal_idhelper->
phi(
id);
403 if (!rampP.
isEmpty()) continue ;
444 return StatusCode::SUCCESS;
453 if(m_g4Phys==
"QGSP_EMV"){
454 filename =
"fsampl_1302_qgsp-emv.txt";
457 if( m_g4Phys==
"QGSP_BERT"){
458 filename =
"fsampl_1303_qgsp-bert.txt";
462 return StatusCode::FAILURE;
470 return StatusCode::SUCCESS;
476 return updateEM_DACuAMeV(
"dac2ua_ua2mev_rel13.txt",
cabling );
481 float fsampl_fcal1,fsampl_fcal2,fsampl_fcal3;
482 float fsampl_hec1,fsampl_hec2;
484 if(m_g4Phys==
"QGSP_EMV"){
486 fsampl_hec2=0.021775;
490 fsampl_fcal1=0.01366;
491 fsampl_fcal2=0.00854;
492 fsampl_fcal3=0.01107;
499 if( m_g4Phys==
"QGSP_BERT"){
504 fsampl_fcal1=0.01591;
505 fsampl_fcal2=0.01144;
506 fsampl_fcal3=0.01405;
515 return StatusCode::FAILURE;
530 for (;
it!=it_e;++
it){
533 if( (*it).isEmpty() )
continue;
534 if(!
cabling->isOnlineConnected(hid)){
543 if(m_hec_idhelper->is_lar_hec(
id)){
545 int sam = m_hec_idhelper->sampling(
id);
548 t2.m_fSampl = fsampl_hec1;
551 t2.m_fSampl = fsampl_hec2;
559 if(m_fcal_idhelper->is_lar_fcal(
id)){
561 int sam = m_fcal_idhelper->module(
id);
564 t2.m_fSampl = fsampl_fcal1;
567 t2.m_fSampl = fsampl_fcal2;
570 t2.m_fSampl = fsampl_fcal3;
584 return StatusCode::SUCCESS;
606 return StatusCode::FAILURE;
622 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
628 id = m_em_idhelper->channel_id(
det,samp,reg,
eta,0);
632 std::string id_str = m_online_idhelper->print_to_string(hid);
652 return StatusCode::SUCCESS;
672 return StatusCode::FAILURE;
682 float dac2ua0, ua2mev0,attenuation,dac2ua,ua2mev;
684 dac2ua0>>ua2mev0>>attenuation>>dac2ua>>ua2mev )
696 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
702 id = m_em_idhelper->channel_id(
det,samp,reg,
eta,0);
707 std::string id_str = m_online_idhelper->print_to_string(hid);
708 std::string id_str_off = m_em_idhelper->print_to_string(
id);
746 return StatusCode::SUCCESS;
778 for (;
it!=it_e;++
it)
781 if( (*it).isEmpty() )
continue;
784 if(!m_fcal_idhelper->is_lar_fcal(
id))
continue;
786 if(
cabling->isOnlineConnected(hid)){
790 << m_online_idhelper->print_to_string(hid) );
798 " Number of connected and disconnected = " <<nconn<<
" " <<ndisc );
805 std::string
filename(
"FCal_noise_minbias.txt");
812 return StatusCode::FAILURE;
819 for(
int i = 0;
i<11;++
i){
826 float vol,noise_p,noise_h, noise_m,noise_l;
828 while (
infile>>str_id >>vol>>noise_p>>noise_h>>noise_m>>noise_l )
830 const char* ch_id = str_id.c_str();
831 if(ch_id[0] !=
'A') {
837 std::sscanf(ch_id,
"A%d.%d.%d", &
mod,&
phi,&
eta);
850 ATH_MSG_INFO(
" minBiasRMS, old new "<<
t2.m_MinBiasRMS<<
" " <<noise_p);
851 t2.m_MinBiasRMS = noise_p;
872 return StatusCode::SUCCESS;
893 return StatusCode::FAILURE;
912 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
920 id = m_em_idhelper->channel_id(
det,samp,reg,
eta,0);
924 id = m_hec_idhelper->channel_id(
det,samp,reg,
eta,0);
935 ATH_MSG_INFO(
" online id = "<<m_online_idhelper->print_to_string(hid));
955 return StatusCode::SUCCESS;
990 for (;
it!=it_e;++
it)
993 if( (*it).isEmpty() )
continue;
996 if(!m_fcal_idhelper->is_lar_fcal(
id))
continue;
998 if(
cabling->isOnlineConnected(hid)){
1004 << m_online_idhelper->print_to_string(hid) );
1012 " Number of connected and disconnected = " <<nconn<<
" " <<ndisc );
1019 std::string
filename(
"FCal_noise_minbias_adc2mev.txt");
1025 return StatusCode::FAILURE;
1032 for(
int i = 0;
i<27;++
i){
1039 float vol,noise_p,noise_h, noise_m,noise_l;
1040 float ramp_val,ua2MeV_val,dac2uA_val;
1042 while (
infile>>str_id >>vol>>noise_p >> noise_h>>noise_m>>noise_l
1045 const char* ch_id = str_id.c_str();
1047 if(str_id.substr(0,1)!=std::string(
"A")){
1053 sscanf(ch_id,
"A%d.%d.%d", &
mod,&
phi,&
eta);
1094 ua2MeV0.
m_data=ua2MeV_val;
1097 dac2ua0.
m_data = dac2uA_val;
1102 return StatusCode::SUCCESS;
1112 if( m_g4Phys==
"QGSP_BERT"){
1113 filename =
"fsampl_1303_qgsp-bert.txt";
1117 return StatusCode::FAILURE;
1121 return StatusCode::SUCCESS;
1132 ATH_CHECK( update_EM_HEC<LArNoiseMC>(
"noise_em.txt",
"noise_hec.txt",
cabling,
true, 1 ) );
1133 ATH_CHECK( update_EM_HEC<LArAutoCorrMC>(
"",
"autocorr_hec.txt",
cabling,
true, 4 ) );
1135 ATH_CHECK( update_EM_HEC<LArAutoCorrMC>(
"autocorr_em.txt",
"",
cabling,
true,5) );
1136 ATH_CHECK( update_EM_HEC<LArRampMC>(
"ramp_em.txt",
"ramp_hec.txt",
cabling,
true, 1 ) );
1137 ATH_CHECK( update_EM_HEC<LAruA2MeVMC>(
"ua2mev_em.txt",
"ua2mev_hec.txt",
cabling,
false, 1 ) );
1138 ATH_CHECK( update_EM_HEC<LArDAC2uAMC>(
"dac2ua_em.txt",
"dac2ua_hec.txt",
cabling,
false, 1 ) );
1139 ATH_CHECK( update_EM_HEC<LArShape32MC>(
"shape_em.txt",
"shape_hec.txt",
cabling,
true, 64 ) );
1140 ATH_CHECK( update_EM_HEC<LArMphysOverMcalMC>(
"mphys_em.txt",
"",
cabling,
true, 1 ) );
1144 return StatusCode::SUCCESS;
1155 return StatusCode::FAILURE;
1184 std::vector<float> vfl;
1187 for (
int i=0;
i<nvar;++
i)
1201 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
1217 return StatusCode::SUCCESS;
1227 return StatusCode::FAILURE;
1248 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
1255 }
else if (
first == 3) {
1257 }
else if (
first == 4) {
1262 for (
int i=0;i<nvar;++i) infile>>
x;
1266 std::vector<float> vfl;
1268 for (
int i=0;
i<nvar;++
i)
1274 <<
first<<
" " <<
det<<
" " <<samp<<
" " <<reg<<
" " <<
eta<<
" " );
1284 return StatusCode::SUCCESS;
1300 ATH_MSG_ERROR (
"for LArNoiseMC, size of vector = "<<
v.size() <<
" differs from one");
1314 for (
unsigned int i =0 ;
i<
obj.m_vAutoCorr.size();++
i)
1315 msg()<<
" " <<
obj.m_vAutoCorr[
i];
1325 ATH_MSG_ERROR(
"for LArAutoCorrMC, size of vector = "<<
v.size()<<
" is less then 4" );
1329 obj.m_vAutoCorr.resize(4);
1330 std::copy_n(
v.begin(), 4,
obj.m_vAutoCorr.begin());
1341 for (
unsigned int i =0 ;
i<
obj.m_vRamp.size();++
i)
1342 msg()<<
" " <<
obj.m_vRamp[
i];
1355 obj.m_vRamp.resize(3);
1357 obj.m_vRamp[1]=
v[0];
1370 for (
unsigned int i =0 ;
i<
obj.m_vShape.size();++
i)
1371 msg()<<
" " <<
obj.m_vShape[
i];
1375 for (
unsigned int i =0 ;
i<
obj.m_vShapeDer.size();++
i)
1376 msg()<<
" " <<
obj.m_vShapeDer[
i];
1385 if (
v.size()!=64 &&
v.size()!=32 )
1387 ATH_MSG_ERROR (
"for LArShape32MC, size of vector = "<<
v.size());
1391 unsigned int size = 32;
1395 for(
unsigned int i=0;
i<
size;++
i){
1397 if(
v.size() == 64 )
obj.m_vShapeDer[
i]=
v[
i+
size];
else obj.m_vShapeDer[
i]=0.;
1420 ATH_MSG_ERROR(
"for LArSingleFloatP, size of vector = "<<
v.size() );
1437 std::unique_ptr<LArMphysOverMcalMC> mphys = std::make_unique<LArMphysOverMcalMC>();
1443 std::string
filename(
"FCal_noise_minbias_adc2mev.txt");
1450 return StatusCode::FAILURE;
1457 for(
int i = 0;
i<27;++
i){
1464 float vol,noise_p,noise_h, noise_m,noise_l;
1465 float ramp_val,ua2MeV_val,dac2uA_val;
1467 while (
infile>>str_id >>vol>>noise_p >> noise_h>>noise_m>>noise_l
1470 const char* ch_id = str_id.c_str();
1472 if(str_id.substr(0,1)!=std::string(
"A")){
1478 sscanf(ch_id,
"A%d.%d.%d", &
mod,&
phi,&
eta);
1500 bool withGain=
false;
1502 std::string hec_filename(
"mphys_hec.txt");
1523 ATH_MSG_ERROR(
" Number of HEC channel added "<<
n <<
" per gain ");
1524 return StatusCode::SUCCESS ;
1545 for(;
it!=it_e;++
it){
1574 for( ;
it!=it_e;++
it){
1578 if(
u.m_data> -990.)
1597 return StatusCode::SUCCESS;
1605 std::vector<float> fcal_autoCorr[3][3] ;
1606 fcal_autoCorr[0][0] = {-0.01, -0.30, -0.09, 0.08};
1607 fcal_autoCorr[0][1] = { 0.01, -0.07, -0.01, 0.03};
1608 fcal_autoCorr[0][2] = { 0.2, 0.2, 0.2, 0.2};
1609 fcal_autoCorr[1][0] = { -0.02, -0.31, -0.06, 0.06};
1610 fcal_autoCorr[1][1] = { 0.0, -0.08, -0.01, 0.02};
1611 fcal_autoCorr[1][2] = { 0.02, 0.01, 0.02, 0.02};
1612 fcal_autoCorr[2][0] = { -0.03, -0.31, -0.05, 0.07};
1613 fcal_autoCorr[2][1] = { 0.01, -0.07, -0.01, 0.02};
1614 fcal_autoCorr[2][2] = { 0.02, 0.02, 0.02, 0.02};
1631 for (;
it!=it_e;++
it)
1635 if( (*it).isEmpty() )
continue;
1638 if(! m_fcal_idhelper->is_lar_fcal(
id))
continue ;
1639 int module = m_fcal_idhelper->module(
id) - 1;
1642 <<
u.m_vAutoCorr[0]<<
" "
1643 <<
u.m_vAutoCorr[1]<<
" "
1644 <<
u.m_vAutoCorr[2]<<
" "
1645 <<
u.m_vAutoCorr[3]<<
" " );
1660 " Number of entries modified = " <<
n );
1663 return StatusCode::SUCCESS;
1681 for (;
it!=it_e;++
it)
1684 if( (*it).isEmpty() )
continue;
1687 if(!m_fcal_idhelper->is_lar_fcal(
id))
continue;
1689 if( !
cabling->isOnlineConnected(hid)){
1691 << m_online_idhelper->print_to_string(hid) );
1704 float ramp_high = ramp0.
m_vRamp[1];
1706 std::vector<float> v_m ;
1708 v_m.push_back(ramp_high*9.96);
1711 std::vector<float> v_l ;
1713 v_l.push_back(ramp_high*9.96*9.67);
1725 return StatusCode::SUCCESS;
1734 ATH_CHECK( update_EM_HEC<LArRampMC>(
"",
"ramp_hec_june2008.txt",
cabling,
true, 1 ) );
1735 return StatusCode::SUCCESS;
1744 ToolHandle<ICaloSuperCellIDTool> scidtool(
"CaloSuperCellIDTool");
1745 if ( scidtool.retrieve().isFailure() ) {
1749 std::set<Identifier> scidset;
1750 std::map<HWIdentifier,int> sslot_schannel_idx;
1751 std::vector<unsigned int> OrderOnlHash_OffID;
1752 std::vector<unsigned int> OrderOffHash_OnlID;
1753 OrderOnlHash_OffID.resize(40000,0);
1754 OrderOffHash_OnlID.resize(40000,0);
1757 unsigned int min_onl_hash = 999999;
1758 unsigned int max_onl_hash = 0;
1759 unsigned int min_off_hash = 999999;
1760 unsigned int max_off_hash = 0;
1761 std::ofstream
hashes(
"AllHashChannels_All.txt");
1762 std::ofstream of(
"AllChannels_EM.txt");
1764 for(
size_t i = 0;
i < channel_size ;
i++) {
1767 if ( ! isEM )
continue;
1768 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1770 scidset.insert(SCID);
1774 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;
1795 sprintf(etaChar,
"%5.4f",
eta);
1796 sprintf(phiChar,
"%5.4f",
phi);
1797 of << std::dec <<
"\t" << feedthrough <<
"\t" << slot;
1798 of <<
"\t" << bar_ec <<
" " << pos_neg <<
"\t\t" << samp <<
"\t";
1799 of << etaChar <<
" " << phiChar <<
"\t0x";
1804 bool secondOutSlot=
false;
1806 if ( (samp==1) && (reg==5) ) secondOutSlot=
true;
1817 if ( secondOutSlot ) {
1820 if ( sslot_schannel_idx.find(sfeb_id) == sslot_schannel_idx.end() )
1821 sslot_schannel_idx[sfeb_id]=0;
1822 else sslot_schannel_idx[sfeb_id]++;
1825 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1826 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1828 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1829 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1835 of <<
" " << onl_hash <<
" " << off_hash;
1843 of <<
"Hash check. Onl : " << min_onl_hash <<
" " << max_onl_hash;
1844 of <<
"; Off : " << min_off_hash <<
" " << max_off_hash << std::endl;;
1848 min_onl_hash = 999999;
1850 min_off_hash = 999999;
1852 std::ofstream of1(
"AllChannels_HEC.txt");
1854 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;
1855 for(
size_t i = 0;
i < channel_size ;
i++) {
1858 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1859 if ( scidset.find(SCID) == scidset.end() )
1860 scidset.insert(SCID);
1881 sprintf(etaChar,
"%5.4f",
eta);
1882 sprintf(phiChar,
"%5.4f",
phi);
1883 of1 << std::dec <<
"\t" << feedthrough <<
"\t" << slot;
1884 of1 <<
"\t" << bar_ec <<
" " << pos_neg <<
"\t\t" << samp <<
"\t";
1885 of1 << etaChar <<
" " << phiChar <<
"\t0x";
1890 if ( sslot_schannel_idx.find(sfeb_id) == sslot_schannel_idx.end() )
1891 sslot_schannel_idx[sfeb_id]=0;
1892 else sslot_schannel_idx[sfeb_id]++;
1893 if ( (feedthrough==6) && (bar_ec==1) && (slot>9) ) {
1899 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1900 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1902 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1903 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1909 of1 <<
" " << onl_hash <<
" " << off_hash;
1917 min_onl_hash = 999999;
1919 min_off_hash = 999999;
1921 std::ofstream of3(
"AllChannels_FCAL.txt");
1923 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;
1924 for(
size_t i = 0;
i < channel_size ;
i++) {
1927 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1928 if ( scidset.find(SCID) == scidset.end() )
1929 scidset.insert(SCID);
1940 of3 << std::dec <<
"\t" << feedthrough <<
"\t" << slot;
1941 of3 <<
"\t" << bar_ec <<
" " << pos_neg <<
"\t\t" << samp <<
"\t";
1945 if ( (feedthrough==6) && (bar_ec==1) && (slot>9) ) {
1948 if ( sslot_schannel_idx.find(sfeb_id) == sslot_schannel_idx.end() )
1949 sslot_schannel_idx[sfeb_id]=0;
1950 else sslot_schannel_idx[sfeb_id]++;
1953 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1954 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1956 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1957 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1963 of3 <<
" " << onl_hash <<
" " << off_hash;
1970 of3 <<
"Hash check. Onl : " << min_onl_hash <<
" " << max_onl_hash;
1971 of3 <<
"; Off : " << min_off_hash <<
" " << max_off_hash << std::endl;;
1977 coral::AttributeListSpecification *spec_onOff =
new coral::AttributeListSpecification();
1978 spec_onOff->extend(
"OnlineHashToOfflineId",
"blob");
1979 spec_onOff->extend<
unsigned>(
"version");
1980 std::unique_ptr<AthenaAttributeList> al_onOff = std::make_unique<AthenaAttributeList>(*spec_onOff);
1982 (*al_onOff)[
"version"].setValue(0U);
1983 blobOnOff.resize(onlHashMax*
sizeof(
uint32_t));
1988 for(
size_t ii=0;ii<onlHashMax;ii++) {
1989 if (OrderOnlHash_OffID[ii] != 0) {
1990 pBlobOnOff[ii]=OrderOnlHash_OffID[ii];
1994 pBlobOnOff[ii]=emptyId;
1997 ATH_MSG_INFO (
"HashMax=" << onlHashMax <<
", connected=" << nConn );
1999 ATH_CHECK(
detStore()->record(std::move(al_onOff),
"/LAR/IdentifierOfl/OnOffIdMap_SC") );
2001 hashes <<
"idx \t Off2OnlId \t Onl2OffId" << std::endl;
2002 for(
size_t ii=0;ii<40000;ii++)
2003 if ( (OrderOffHash_OnlID[ii] != 0) || ( OrderOnlHash_OffID[ii] != 0 ) )
2004 hashes << std::dec << ii << std::hex <<
" \t " << OrderOffHash_OnlID[ii] <<
" \t\t " << OrderOnlHash_OffID[ii] << std::endl;
2007 return StatusCode::SUCCESS;
2018 std::unique_ptr<LArMinBiasMC> minbias = std::make_unique<LArMinBiasMC>();
2019 ATH_CHECK( minbias->setGroupingType(
"Single",
msg()) );
2021 std::unique_ptr<LArMinBiasAverageMC> minbias_av = std::make_unique<LArMinBiasAverageMC>();
2022 ATH_CHECK( minbias_av->setGroupingType(
"Single",
msg()) );
2025 std::unique_ptr<TFile>
fin= std::make_unique<TFile>(
"ntuple_av.root");
2026 TTree *tin=
dynamic_cast<TTree*
>(
fin->Get(
"m_tree"));
2036 TBranch *b_identifier;
2043 tin->SetMakeClass(1);
2044 tin->SetBranchAddress(
"ncell", &
ncell, &b_ncell);
2045 tin->SetBranchAddress(
"identifier",
identifier, &b_identifier);
2046 tin->SetBranchAddress(
"layer",
layer, &b_layer);
2047 tin->SetBranchAddress(
"region", region, &b_region);
2048 tin->SetBranchAddress(
"ieta", ieta, &b_ieta);
2049 tin->SetBranchAddress(
"eta",
eta, &b_eta);
2050 tin->SetBranchAddress(
"average",
average, &b_average);
2051 tin->SetBranchAddress(
"rms",
rms, &b_rms);
2075 return StatusCode::SUCCESS;
2088 std::unique_ptr<LArMinBiasAverageMC> minbias_av = std::make_unique<LArMinBiasAverageMC>();
2089 ATH_CHECK( minbias_av->setGroupingType(
"Single",
msg()) );
2092 std::unique_ptr<TFile>
fin= std::make_unique<TFile>(
"ntuple_av.root");
2093 TTree *tin=
dynamic_cast<TTree*
>(
fin->Get(
"m_tree"));
2103 TBranch *b_identifier;
2110 tin->SetMakeClass(1);
2111 tin->SetBranchAddress(
"ncell", &
ncell, &b_ncell);
2112 tin->SetBranchAddress(
"identifier",
identifier, &b_identifier);
2113 tin->SetBranchAddress(
"layer",
layer, &b_layer);
2114 tin->SetBranchAddress(
"region", region, &b_region);
2115 tin->SetBranchAddress(
"ieta", ieta, &b_ieta);
2116 tin->SetBranchAddress(
"eta",
eta, &b_eta);
2117 tin->SetBranchAddress(
"average",
average, &b_average);
2118 tin->SetBranchAddress(
"rms",
rms, &b_rms);
2127 float fsampl = larfSampl->
FSAMPL(hid);
2138 return StatusCode::SUCCESS;
2159 for(;
it!=it_e;++
it){
2176 return StatusCode::SUCCESS;
2183 std::string onOffIdKey=
"/LAR/Identifier/OnOffIdMap";
2186 if (
sc.isFailure()) {
2187 ATH_MSG_ERROR(
"Failed to read AthenaAttributeList with key " << onOffIdKey);
2188 return StatusCode::FAILURE;
2191 unsigned nChan=blobOnOff.size()/
sizeof(
uint32_t);
2195 if (nChan!=m_online_idhelper->channelHashMax()) {
2196 ATH_MSG_WARNING(
"Number of channels read from DB (" << nChan <<
") does not match online hash max ("
2197 <<m_online_idhelper->channelHashMax() <<
")");
2198 nChan=
std::min(nChan,
static_cast<unsigned int>(m_online_idhelper->channelHashMax()));
2200 std::vector<std::pair<unsigned int, unsigned int> > swapindex(8, std::make_pair(nChan+10,nChan+10));
2202 for (
unsigned i=0;
i<nChan;++
i) {
2204 if(m_online_idhelper->isEMECchannel(hwid) && m_online_idhelper->pos_neg(hwid) == 1 && m_online_idhelper->feedthrough(hwid) == 7 && m_online_idhelper->slot(hwid) == 11) {
2205 if(m_online_idhelper->channel(hwid)>=96 && m_online_idhelper->channel(hwid)<=103) swapindex[m_online_idhelper->channel(hwid)-96].first=
i;
2206 if(m_online_idhelper->channel(hwid)>=112 && m_online_idhelper->channel(hwid)<=129) swapindex[m_online_idhelper->channel(hwid)-112].second=
i;
2209 for(
unsigned i=0;
i<8; ++
i) {
2212 for(
unsigned i=0;
i<8; ++
i) {
2214 if (swapindex[
i].
first > nChan || swapindex[
i].
second > nChan ) {
2216 return StatusCode::FAILURE;
2218 uint32_t id = pBlobOnOff[swapindex[
i].first];
2219 pBlobOnOff[swapindex[
i].first] = pBlobOnOff[swapindex[
i].second];
2220 pBlobOnOff[swapindex[
i].second] =
id;
2225 return StatusCode::SUCCESS;
2235 return StatusCode::SUCCESS;
2244 coral::AttributeListSpecification* spec_calib =
new coral::AttributeListSpecification();
2245 spec_calib->extend(
"OnlineHashToCalibIds",
"blob");
2246 spec_calib->extend<
unsigned>(
"version");
2247 std::unique_ptr<AthenaAttributeList> al_calib = std::make_unique<AthenaAttributeList>(*spec_calib);
2249 (*al_calib)[
"version"].setValue(0U);
2250 blobCalib.resize(onlHashMax*
sizeof(
uint32_t)*4);
2252 spec_calib->release();
2254 spec_calib =
nullptr;
2257 size_t calibIndex=0;
2261 for (
unsigned i=0;
i<onlHashMax;++
i) {
2264 const std::vector<HWIdentifier>& calibIDs=
cabling->calibSlotLine(hwid);
2265 const size_t nCalibLines=calibIDs.size();
2268 if(nCalibLines > 1) {
2270 return StatusCode::FAILURE;
2272 if(nCalibLines==0) {
2273 pBlobCalib[calibIndex++]=0;
2280 return StatusCode::FAILURE;
2283 pBlobCalib[calibIndex++]=1;
2287 pBlobCalib[calibIndex++]=nCalibLines;
2288 for(
uint32_t iCalib=0;iCalib<nCalibLines;++iCalib)
2289 pBlobCalib[calibIndex++]=calibIDs[iCalib].get_identifier32().get_compact();
2292 blobCalib.resize(calibIndex*
sizeof(
uint32_t));
2296 ATH_CHECK(
detStore()->record(std::move(al_calib),
"/LAR/Identifier/CalibIdMap_EMF"));
2298 return StatusCode::SUCCESS;