ATLAS Offline Software
Loading...
Searching...
No Matches
FixLArElecCalib.cxx File Reference
#include "FixLArElecCalib.h"
#include "Gaudi/Property.h"
#include "GaudiKernel/IToolSvc.h"
#include "CaloIdentifier/CaloCell_SuperCell_ID.h"
#include "CaloIdentifier/LArEM_ID.h"
#include "LArIdentifier/LArOnlineID.h"
#include "LArIdentifier/LArOnline_SuperCellID.h"
#include "StoreGate/StoreGateSvc.h"
#include "LArRawConditions/LArDAC2uAMC.h"
#include "LArRawConditions/LArShape32MC.h"
#include "LArRawConditions/LAruA2MeVMC.h"
#include "LArRawConditions/LArfSamplMC.h"
#include "LArRawConditions/LArMinBiasMC.h"
#include "LArRawConditions/LArMinBiasAverageMC.h"
#include "LArRawConditions/LArNoiseMC.h"
#include "LArRawConditions/LArRampMC.h"
#include "LArRawConditions/LArAutoCorrMC.h"
#include "CaloDetDescr/ICaloSuperCellIDTool.h"
#include "TTree.h"
#include "TFile.h"
#include "AthenaPoolUtilities/AthenaAttributeList.h"
#include "CoralBase/Blob.h"
#include <fstream>
#include <cstdint>

Go to the source code of this file.

Functions

StatusCode FixLArElecCalib::stop ATLAS_NOT_THREAD_SAFE ()
 Install fatal handler with default options.
StatusCode FixLArElecCalib::fix3 ATLAS_NOT_THREAD_SAFE (const LArOnOffIdMapping *cabling)
StatusCode FixLArElecCalib::updateEMfSampl ATLAS_NOT_THREAD_SAFE (const std::string &filename, const LArOnOffIdMapping *cabling)

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/3]

StatusCode FixLArElecCalib::stop ATLAS_NOT_THREAD_SAFE ( )
inline

Install fatal handler with default options.

This is meant to be easy to call from python via ctypes.

Definition at line 160 of file FixLArElecCalib.cxx.

160 {
161
162 ATH_MSG_INFO ( " in stop " );
163
164 const EventContext& ctx = Gaudi::Hive::currentContext();
165
166 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey, ctx};
167 const LArOnOffIdMapping* cabling{*cablingHdl};
168 if(!cabling) {
169 ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKey.key() );
170 return StatusCode::FAILURE;
171 }
172 SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_CLKey, ctx};
173 const LArCalibLineMapping *clCont {*clHdl};
174 if(!clCont) {
175 ATH_MSG_ERROR( "Do not have calib line mapping !!!" );
176 return StatusCode::FAILURE;
177 }
178
179
180 if(m_fixFlag==1)
181 return fix1(cabling);
182 if(m_fixFlag==2)
183 return fix2(cabling);
184 if(m_fixFlag==3)
185 return fix3(cabling);
186 if(m_fixFlag==4)
187 return fix4(cabling);
188 if(m_fixFlag==5)
189 return fix5(cabling);
190 if(m_fixFlag==6)
191 return fix6(cabling);
192 if(m_fixFlag==7)
193 return fix7(cabling);
194 if(m_fixFlag==8)
195 return fix8(cabling);
196 if(m_fixFlag==9)
197 return fix9(cabling);
198 if(m_fixFlag==10)
199 return fix10(cabling);
200 if(m_fixFlag==11)
201 return fix11(cabling);
202 if(m_fixFlag==12)
203 return fix12(cabling);
204 if(m_fixFlag==13)
205 return fix13(cabling);
206 if(m_fixFlag==14)
207 return fix14(cabling);
208 if(m_fixFlag==15)
209 return fix15();
210 if(m_fixFlag==16)
211 return fix16();
212 if(m_fixFlag==17)
213 return fix17(cabling);
214 if(m_fixFlag==18)
215 return fix18(clCont);
216
217 return StatusCode::SUCCESS;
218
219}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)

◆ ATLAS_NOT_THREAD_SAFE() [2/3]

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

Definition at line 443 of file FixLArElecCalib.cxx.

443 {
444
445 ATH_MSG_INFO ( " in fix3() " );
446 std::string filename ;
447
448 // updated for 13.0.20
449 if(m_g4Phys=="QGSP_EMV"){
450 filename = "fsampl_1302_qgsp-emv.txt";
451 }
452 else
453 if( m_g4Phys=="QGSP_BERT"){
454 filename = "fsampl_1303_qgsp-bert.txt";
455 }
456 else {
457 ATH_MSG_ERROR ( " wrong option "<<m_g4Phys );
458 return StatusCode::FAILURE;
459 }
460
461 // Fix3 is for updating the FCAL conditions data after IdFix7
462 // Input should be MC Conditions data with DetDescrVersion=ATLAS-DC3-05
463
464 ATH_CHECK( updateEMfSampl(filename, cabling ) );
465 ATH_CHECK( updateHADfSampl(cabling) );
466 return StatusCode::SUCCESS;
467}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ ATLAS_NOT_THREAD_SAFE() [3/3]

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

Definition at line 584 of file FixLArElecCalib.cxx.

584 {
585
586 ATH_MSG_INFO ( " in updateEMfSampl() " );
587
588 // this method updates the EM fSample, assuming symmetry.
589 // input is the text file.
590
591 const LArfSamplMC * fsampl_c = nullptr;
592 ATH_CHECK( detStore()->retrieve(fsampl_c) );
593 LArfSamplMC* fsampl = const_cast<LArfSamplMC*>(fsampl_c);
594
595 // read in the file
596
597 ATH_MSG_INFO(" opening file "<< filename );
598 std::ifstream infile( filename);
599 if(! infile.good() )
600 {
601 ATH_MSG_ERROR(" fail to open file ");
602 return StatusCode::FAILURE;
603 }
604 int det,samp,reg,eta;
605 float value ;
606 int n = 0;
607 while ( infile>>det>>samp>>reg>>eta>>value )
608 {
609 ++n;
610 ATH_MSG_INFO(" det,samp,reg,eta,value="
611 <<det<<" "
612 <<samp<<" "
613 <<reg<<" "
614 <<eta<<" "
615 <<value<<" " );
616
617 Identifier id ;
618 if ( det==1 && samp==1 && reg==0 && eta==0 ){
619 // eta=0 for strip, not connected, but keep it
620 // Removed disconnected channels: 03/2016 RDS
621 // ATH_MSG_INFO(" disconnected strip ");
622 // id = m_em_idhelper->disc_channel_id(det,samp,reg,eta,0);
623 }else
624 id = m_em_idhelper->channel_id(det,samp,reg,eta,0);
625
626 HWIdentifier hid = cabling->createSignalChannelID(id);
627 const LArfSamplComplete::LArCondObj & t = fsampl->get(hid,0);
628 std::string id_str = m_online_idhelper->print_to_string(hid);
629 ATH_MSG_INFO(" online id = "<<id_str);
630
631 if( t.isEmpty() )
632 {
633 ATH_MSG_ERROR(" No existing conditions data " );
634 ATH_MSG_ERROR( m_em_idhelper->print_to_string(id) );
635 // return StatusCode::FAILURE ;
636 continue ;
637 }
638 ATH_MSG_INFO(" Old fsampl = "<< t.m_fSampl<< " " );
639
641 t2.m_fSampl = value ;
642
643 const LArfSamplComplete::LArCondObj & t3 = fsampl->get(hid,0);
644 ATH_MSG_INFO(" New fSampl = "<< t3.m_fSampl<< " " );
645 }
646
647 ATH_MSG_INFO(" Number of entries changes = " <<n );
648 return StatusCode::SUCCESS;
649}
Scalar eta() const
pseudorapidity method
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
get data with online identifier
Implementation of the interface ILArfSampl for MC Derives from LArfSamplComplete, and implements the ...
Definition LArfSamplMC.h:23
std::vector< ALFA_RawDataContainer_p1 > t2
std::vector< LUCID_RawData_p1 > t3