83 #include "Gaudi/Property.h"
84 #include "GaudiKernel/IToolSvc.h"
109 #include "CoralBase/Blob.h"
113 m_em_idhelper(nullptr),
114 m_hec_idhelper(nullptr),
115 m_fcal_idhelper(nullptr),
116 m_online_idhelper(nullptr),
117 m_sem_idhelper(nullptr),
118 m_shec_idhelper(nullptr),
119 m_sonline_idhelper(nullptr),
120 m_scell_idhelper(nullptr)
140 return StatusCode::SUCCESS;
145 const EventContext& ctx = Gaudi::Hive::currentContext();
155 return StatusCode::SUCCESS;
162 const EventContext& ctx = Gaudi::Hive::currentContext();
167 ATH_MSG_ERROR(
"Do not have cabling mapping from key " << m_cablingKey.key() );
168 return StatusCode::FAILURE;
174 return StatusCode::FAILURE;
213 return fix18(clCont);
215 return StatusCode::SUCCESS;
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;
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;
447 if(m_g4Phys==
"QGSP_EMV"){
448 filename =
"fsampl_1302_qgsp-emv.txt";
451 if( m_g4Phys==
"QGSP_BERT"){
452 filename =
"fsampl_1303_qgsp-bert.txt";
456 return StatusCode::FAILURE;
464 return StatusCode::SUCCESS;
470 return updateEM_DACuAMeV(
"dac2ua_ua2mev_rel13.txt",
cabling );
475 float fsampl_fcal1,fsampl_fcal2,fsampl_fcal3;
476 float fsampl_hec1,fsampl_hec2;
478 if(m_g4Phys==
"QGSP_EMV"){
480 fsampl_hec2=0.021775;
484 fsampl_fcal1=0.01366;
485 fsampl_fcal2=0.00854;
486 fsampl_fcal3=0.01107;
493 if( m_g4Phys==
"QGSP_BERT"){
498 fsampl_fcal1=0.01591;
499 fsampl_fcal2=0.01144;
500 fsampl_fcal3=0.01405;
509 return StatusCode::FAILURE;
524 for (;
it!=it_e;++
it){
527 if( (*it).isEmpty() )
continue;
528 if(!
cabling->isOnlineConnected(hid)){
537 if(m_hec_idhelper->is_lar_hec(
id)){
539 int sam = m_hec_idhelper->sampling(
id);
542 t2.m_fSampl = fsampl_hec1;
545 t2.m_fSampl = fsampl_hec2;
553 if(m_fcal_idhelper->is_lar_fcal(
id)){
555 int sam = m_fcal_idhelper->module(
id);
558 t2.m_fSampl = fsampl_fcal1;
561 t2.m_fSampl = fsampl_fcal2;
564 t2.m_fSampl = fsampl_fcal3;
578 return StatusCode::SUCCESS;
600 return StatusCode::FAILURE;
616 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
622 id = m_em_idhelper->channel_id(
det,samp,reg,
eta,0);
626 std::string id_str = m_online_idhelper->print_to_string(hid);
646 return StatusCode::SUCCESS;
666 return StatusCode::FAILURE;
676 float dac2ua0, ua2mev0,attenuation,dac2ua,ua2mev;
678 dac2ua0>>ua2mev0>>attenuation>>dac2ua>>ua2mev )
690 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
696 id = m_em_idhelper->channel_id(
det,samp,reg,
eta,0);
701 std::string id_str = m_online_idhelper->print_to_string(hid);
702 std::string id_str_off = m_em_idhelper->print_to_string(
id);
740 return StatusCode::SUCCESS;
772 for (;
it!=it_e;++
it)
775 if( (*it).isEmpty() )
continue;
778 if(!m_fcal_idhelper->is_lar_fcal(
id))
continue;
780 if(
cabling->isOnlineConnected(hid)){
784 << m_online_idhelper->print_to_string(hid) );
792 " Number of connected and disconnected = " <<nconn<<
" " <<ndisc );
799 std::string
filename(
"FCal_noise_minbias.txt");
806 return StatusCode::FAILURE;
813 for(
int i = 0;
i<11;++
i){
820 float vol,noise_p,noise_h, noise_m,noise_l;
822 while (
infile>>str_id >>vol>>noise_p>>noise_h>>noise_m>>noise_l )
824 const char* ch_id = str_id.c_str();
825 if(ch_id[0] !=
'A') {
831 std::sscanf(ch_id,
"A%d.%d.%d", &
mod,&
phi,&
eta);
844 ATH_MSG_INFO(
" minBiasRMS, old new "<<
t2.m_MinBiasRMS<<
" " <<noise_p);
845 t2.m_MinBiasRMS = noise_p;
866 return StatusCode::SUCCESS;
887 return StatusCode::FAILURE;
906 if (
det==1 && samp==1 && reg==0 &&
eta==0 ){
914 id = m_em_idhelper->channel_id(
det,samp,reg,
eta,0);
918 id = m_hec_idhelper->channel_id(
det,samp,reg,
eta,0);
929 ATH_MSG_INFO(
" online id = "<<m_online_idhelper->print_to_string(hid));
949 return StatusCode::SUCCESS;
984 for (;
it!=it_e;++
it)
987 if( (*it).isEmpty() )
continue;
990 if(!m_fcal_idhelper->is_lar_fcal(
id))
continue;
992 if(
cabling->isOnlineConnected(hid)){
998 << m_online_idhelper->print_to_string(hid) );
1006 " Number of connected and disconnected = " <<nconn<<
" " <<ndisc );
1013 std::string
filename(
"FCal_noise_minbias_adc2mev.txt");
1019 return StatusCode::FAILURE;
1026 for(
int i = 0;
i<27;++
i){
1033 float vol,noise_p,noise_h, noise_m,noise_l;
1034 float ramp_val,ua2MeV_val,dac2uA_val;
1036 while (
infile>>str_id >>vol>>noise_p >> noise_h>>noise_m>>noise_l
1039 const char* ch_id = str_id.c_str();
1041 if(str_id.substr(0,1)!=std::string(
"A")){
1047 sscanf(ch_id,
"A%d.%d.%d", &
mod,&
phi,&
eta);
1088 ua2MeV0.
m_data=ua2MeV_val;
1091 dac2ua0.
m_data = dac2uA_val;
1096 return StatusCode::SUCCESS;
1106 if( m_g4Phys==
"QGSP_BERT"){
1107 filename =
"fsampl_1303_qgsp-bert.txt";
1111 return StatusCode::FAILURE;
1115 return StatusCode::SUCCESS;
1126 ATH_CHECK( update_EM_HEC<LArNoiseMC>(
"noise_em.txt",
"noise_hec.txt",
cabling,
true, 1 ) );
1127 ATH_CHECK( update_EM_HEC<LArAutoCorrMC>(
"",
"autocorr_hec.txt",
cabling,
true, 4 ) );
1129 ATH_CHECK( update_EM_HEC<LArAutoCorrMC>(
"autocorr_em.txt",
"",
cabling,
true,5) );
1130 ATH_CHECK( update_EM_HEC<LArRampMC>(
"ramp_em.txt",
"ramp_hec.txt",
cabling,
true, 1 ) );
1131 ATH_CHECK( update_EM_HEC<LAruA2MeVMC>(
"ua2mev_em.txt",
"ua2mev_hec.txt",
cabling,
false, 1 ) );
1132 ATH_CHECK( update_EM_HEC<LArDAC2uAMC>(
"dac2ua_em.txt",
"dac2ua_hec.txt",
cabling,
false, 1 ) );
1133 ATH_CHECK( update_EM_HEC<LArShape32MC>(
"shape_em.txt",
"shape_hec.txt",
cabling,
true, 64 ) );
1134 ATH_CHECK( update_EM_HEC<LArMphysOverMcalMC>(
"mphys_em.txt",
"",
cabling,
true, 1 ) );
1138 return StatusCode::SUCCESS;
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;
1221 return StatusCode::FAILURE;
1234 int det=0,samp=0,reg=0,
eta=0;
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;
1294 ATH_MSG_ERROR (
"for LArNoiseMC, size of vector = "<<
v.size() <<
" differs from one");
1308 for (
unsigned int i =0 ;
i<
obj.m_vAutoCorr.size();++
i)
1309 msg()<<
" " <<
obj.m_vAutoCorr[
i];
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());
1335 for (
unsigned int i =0 ;
i<
obj.m_vRamp.size();++
i)
1336 msg()<<
" " <<
obj.m_vRamp[
i];
1349 obj.m_vRamp.resize(3);
1351 obj.m_vRamp[1]=
v[0];
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];
1379 if (
v.size()!=64 &&
v.size()!=32 )
1381 ATH_MSG_ERROR (
"for LArShape32MC, size of vector = "<<
v.size());
1385 unsigned int size = 32;
1389 for(
unsigned int i=0;
i<
size;++
i){
1391 if(
v.size() == 64 )
obj.m_vShapeDer[
i]=
v[
i+
size];
else obj.m_vShapeDer[
i]=0.;
1414 ATH_MSG_ERROR(
"for LArSingleFloatP, size of vector = "<<
v.size() );
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 ;
1539 for(;
it!=it_e;++
it){
1568 for( ;
it!=it_e;++
it){
1572 if(
u.m_data> -990.)
1591 return StatusCode::SUCCESS;
1599 std::vector<float> fcal_autoCorr[3][3] ;
1600 fcal_autoCorr[0][0] = {-0.01, -0.30, -0.09, 0.08};
1601 fcal_autoCorr[0][1] = { 0.01, -0.07, -0.01, 0.03};
1602 fcal_autoCorr[0][2] = { 0.2, 0.2, 0.2, 0.2};
1603 fcal_autoCorr[1][0] = { -0.02, -0.31, -0.06, 0.06};
1604 fcal_autoCorr[1][1] = { 0.0, -0.08, -0.01, 0.02};
1605 fcal_autoCorr[1][2] = { 0.02, 0.01, 0.02, 0.02};
1606 fcal_autoCorr[2][0] = { -0.03, -0.31, -0.05, 0.07};
1607 fcal_autoCorr[2][1] = { 0.01, -0.07, -0.01, 0.02};
1608 fcal_autoCorr[2][2] = { 0.02, 0.02, 0.02, 0.02};
1625 for (;
it!=it_e;++
it)
1629 if( (*it).isEmpty() )
continue;
1632 if(! m_fcal_idhelper->is_lar_fcal(
id))
continue ;
1633 int module = m_fcal_idhelper->module(
id) - 1;
1636 <<
u.m_vAutoCorr[0]<<
" "
1637 <<
u.m_vAutoCorr[1]<<
" "
1638 <<
u.m_vAutoCorr[2]<<
" "
1639 <<
u.m_vAutoCorr[3]<<
" " );
1654 " Number of entries modified = " <<
n );
1657 return StatusCode::SUCCESS;
1675 for (;
it!=it_e;++
it)
1678 if( (*it).isEmpty() )
continue;
1681 if(!m_fcal_idhelper->is_lar_fcal(
id))
continue;
1683 if( !
cabling->isOnlineConnected(hid)){
1685 << m_online_idhelper->print_to_string(hid) );
1698 float ramp_high = ramp0.
m_vRamp[1];
1700 ramp1.
m_vRamp.assign ({0, ramp_high*9.96f});
1701 ramp2.
m_vRamp.assign ({0, ramp_high*9.96f*9.67f});
1712 return StatusCode::SUCCESS;
1721 ATH_CHECK( update_EM_HEC<LArRampMC>(
"",
"ramp_hec_june2008.txt",
cabling,
true, 1 ) );
1722 return StatusCode::SUCCESS;
1731 ToolHandle<ICaloSuperCellIDTool> scidtool(
"CaloSuperCellIDTool");
1732 if ( scidtool.retrieve().isFailure() ) {
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);
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");
1751 for(
size_t i = 0;
i < channel_size ;
i++) {
1754 if ( ! isEM )
continue;
1755 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1757 scidset.insert(SCID);
1761 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;
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";
1791 bool secondOutSlot=
false;
1793 if ( (samp==1) && (reg==5) ) secondOutSlot=
true;
1804 if ( secondOutSlot ) {
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]++;
1812 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1813 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1815 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1816 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1822 of <<
" " << onl_hash <<
" " << off_hash;
1830 of <<
"Hash check. Onl : " << min_onl_hash <<
" " << max_onl_hash;
1831 of <<
"; Off : " << min_off_hash <<
" " << max_off_hash << std::endl;;
1835 min_onl_hash = 999999;
1837 min_off_hash = 999999;
1839 std::ofstream of1(
"AllChannels_HEC.txt");
1841 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;
1842 for(
size_t i = 0;
i < channel_size ;
i++) {
1845 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1846 if ( scidset.find(SCID) == scidset.end() )
1847 scidset.insert(SCID);
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";
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) ) {
1886 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1887 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1889 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1890 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1896 of1 <<
" " << onl_hash <<
" " << off_hash;
1904 min_onl_hash = 999999;
1906 min_off_hash = 999999;
1908 std::ofstream of3(
"AllChannels_FCAL.txt");
1910 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;
1911 for(
size_t i = 0;
i < channel_size ;
i++) {
1914 Identifier SCID = scidtool->offlineToSuperCellID(chid);
1915 if ( scidset.find(SCID) == scidset.end() )
1916 scidset.insert(SCID);
1927 of3 << std::dec <<
"\t" << feedthrough <<
"\t" << slot;
1928 of3 <<
"\t" << bar_ec <<
" " << pos_neg <<
"\t\t" << samp <<
"\t";
1932 if ( (feedthrough==6) && (bar_ec==1) && (slot>9) ) {
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]++;
1940 if ( onl_hash > max_onl_hash ) max_onl_hash = onl_hash;
1941 if ( onl_hash < min_onl_hash ) min_onl_hash = onl_hash;
1943 if ( off_hash > max_off_hash ) max_off_hash = off_hash;
1944 if ( off_hash < min_off_hash ) min_off_hash = off_hash;
1950 of3 <<
" " << onl_hash <<
" " << off_hash;
1957 of3 <<
"Hash check. Onl : " << min_onl_hash <<
" " << max_onl_hash;
1958 of3 <<
"; Off : " << min_off_hash <<
" " << max_off_hash << std::endl;;
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);
1969 (*al_onOff)[
"version"].setValue(0U);
1970 blobOnOff.resize(onlHashMax*
sizeof(
uint32_t));
1975 for(
size_t ii=0;ii<onlHashMax;ii++) {
1976 if (OrderOnlHash_OffID[ii] != 0) {
1977 pBlobOnOff[ii]=OrderOnlHash_OffID[ii];
1981 pBlobOnOff[ii]=emptyId;
1984 ATH_MSG_INFO (
"HashMax=" << onlHashMax <<
", connected=" << nConn );
1986 ATH_CHECK(
detStore()->record(std::move(al_onOff),
"/LAR/IdentifierOfl/OnOffIdMap_SC") );
1988 hashes <<
"idx \t Off2OnlId \t Onl2OffId" << std::endl;
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] << std::endl;
1994 return StatusCode::SUCCESS;
2005 std::unique_ptr<LArMinBiasMC> minbias = std::make_unique<LArMinBiasMC>();
2006 ATH_CHECK( minbias->setGroupingType(
"Single",
msg()) );
2008 std::unique_ptr<LArMinBiasAverageMC> minbias_av = std::make_unique<LArMinBiasAverageMC>();
2009 ATH_CHECK( minbias_av->setGroupingType(
"Single",
msg()) );
2012 std::unique_ptr<TFile>
fin= std::make_unique<TFile>(
"ntuple_av.root");
2013 TTree *tin=
dynamic_cast<TTree*
>(
fin->Get(
"m_tree"));
2016 return StatusCode::FAILURE;
2027 TBranch *b_identifier;
2034 tin->SetMakeClass(1);
2035 tin->SetBranchAddress(
"ncell", &
ncell, &b_ncell);
2036 tin->SetBranchAddress(
"identifier",
identifier, &b_identifier);
2037 tin->SetBranchAddress(
"layer",
layer, &b_layer);
2038 tin->SetBranchAddress(
"region", region, &b_region);
2039 tin->SetBranchAddress(
"ieta", ieta, &b_ieta);
2040 tin->SetBranchAddress(
"eta",
eta, &b_eta);
2041 tin->SetBranchAddress(
"average",
average, &b_average);
2042 tin->SetBranchAddress(
"rms",
rms, &b_rms);
2066 return StatusCode::SUCCESS;
2079 std::unique_ptr<LArMinBiasAverageMC> minbias_av = std::make_unique<LArMinBiasAverageMC>();
2080 ATH_CHECK( minbias_av->setGroupingType(
"Single",
msg()) );
2083 std::unique_ptr<TFile>
fin= std::make_unique<TFile>(
m_infile.value().c_str());
2084 TTree *tin=
dynamic_cast<TTree*
>(
fin->Get(
"m_tree"));
2087 return StatusCode::FAILURE;
2091 std::vector<int>
layer(2862);
2092 std::vector<int> region(2862);
2093 std::vector<int> ieta(2862);
2094 std::vector<float>
eta(2862);
2095 std::vector<double>
average(2862);
2096 std::vector<double>
rms(2862);
2098 TBranch *b_identifier;
2105 tin->SetMakeClass(1);
2106 tin->SetBranchAddress(
"ncell", &
ncell, &b_ncell);
2107 tin->SetBranchAddress(
"identifier",
identifier.data(), &b_identifier);
2108 tin->SetBranchAddress(
"layer",
layer.data(), &b_layer);
2109 tin->SetBranchAddress(
"region", region.data(), &b_region);
2110 tin->SetBranchAddress(
"ieta", ieta.data(), &b_ieta);
2111 tin->SetBranchAddress(
"eta",
eta.data(), &b_eta);
2112 tin->SetBranchAddress(
"average",
average.data(), &b_average);
2113 tin->SetBranchAddress(
"rms",
rms.data(), &b_rms);
2122 float fsampl = larfSampl->
FSAMPL(hid);
2133 return StatusCode::SUCCESS;
2154 for(;
it!=it_e;++
it){
2171 return StatusCode::SUCCESS;
2178 std::string onOffIdKey=
"/LAR/Identifier/OnOffIdMap";
2181 if (
sc.isFailure()) {
2182 ATH_MSG_ERROR(
"Failed to read AthenaAttributeList with key " << onOffIdKey);
2183 return StatusCode::FAILURE;
2186 unsigned nChan=blobOnOff.size()/
sizeof(
uint32_t);
2190 if (nChan!=m_online_idhelper->channelHashMax()) {
2191 ATH_MSG_WARNING(
"Number of channels read from DB (" << nChan <<
") does not match online hash max ("
2192 <<m_online_idhelper->channelHashMax() <<
")");
2193 nChan=
std::min(nChan,
static_cast<unsigned int>(m_online_idhelper->channelHashMax()));
2195 std::vector<std::pair<unsigned int, unsigned int> > swapindex(8, std::make_pair(nChan+10,nChan+10));
2197 for (
unsigned i=0;
i<nChan;++
i) {
2199 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) {
2200 if(m_online_idhelper->channel(hwid)>=96 && m_online_idhelper->channel(hwid)<=103) swapindex[m_online_idhelper->channel(hwid)-96].first=
i;
2201 if(m_online_idhelper->channel(hwid)>=112 && m_online_idhelper->channel(hwid)<=129) swapindex[m_online_idhelper->channel(hwid)-112].second=
i;
2204 for(
unsigned i=0;
i<8; ++
i) {
2207 for(
unsigned i=0;
i<8; ++
i) {
2209 if (swapindex[
i].
first > nChan || swapindex[
i].
second > nChan ) {
2211 return StatusCode::FAILURE;
2213 uint32_t id = pBlobOnOff[swapindex[
i].first];
2214 pBlobOnOff[swapindex[
i].first] = pBlobOnOff[swapindex[
i].second];
2215 pBlobOnOff[swapindex[
i].second] =
id;
2220 return StatusCode::SUCCESS;
2228 ATH_CHECK( update_All<LArShape32MC>(m_infile.value(),
cabling,
true, 32 ) );
2230 return StatusCode::SUCCESS;
2239 coral::AttributeListSpecification* spec_calib =
new coral::AttributeListSpecification();
2240 spec_calib->extend(
"OnlineHashToCalibIds",
"blob");
2241 spec_calib->extend<
unsigned>(
"version");
2242 std::unique_ptr<AthenaAttributeList> al_calib = std::make_unique<AthenaAttributeList>(*spec_calib);
2244 (*al_calib)[
"version"].setValue(0U);
2245 blobCalib.resize(onlHashMax*
sizeof(
uint32_t)*4);
2247 spec_calib->release();
2249 spec_calib =
nullptr;
2252 size_t calibIndex=0;
2256 for (
unsigned i=0;
i<onlHashMax;++
i) {
2259 const std::vector<HWIdentifier>& calibIDs=
cabling->calibSlotLine(hwid);
2260 const size_t nCalibLines=calibIDs.size();
2263 if(nCalibLines > 1) {
2265 return StatusCode::FAILURE;
2267 if(nCalibLines==0) {
2268 pBlobCalib[calibIndex++]=0;
2275 return StatusCode::FAILURE;
2278 pBlobCalib[calibIndex++]=1;
2282 pBlobCalib[calibIndex++]=nCalibLines;
2283 for(
uint32_t iCalib=0;iCalib<nCalibLines;++iCalib)
2284 pBlobCalib[calibIndex++]=calibIDs[iCalib].get_identifier32().get_compact();
2287 blobCalib.resize(calibIndex*
sizeof(
uint32_t));
2291 ATH_CHECK(
detStore()->record(std::move(al_calib),
"/LAR/Identifier/CalibIdMap_EMF"));
2293 return StatusCode::SUCCESS;