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 ( void )
inline

Install fatal handler with default options.

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

Install fatal handler with default options.

Install fatal handler with default options.

getLorentzAngle() Read LorentzAngle from HIST and write out into local DB

getBSErrors() Read BSErrors from Monitoring HIST and write out into local DB

getEfficiency() Read Efficiency from Monitoring HIST and write out into local DB

getRawOccupancy() Read RawOccupancy from Monitoring HIST and write out into local DB

getNoiseOccupancy() Read NoiseOccupancy from HIST and write out into local DB

getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats

beginning of the loop of channels

bad bit newly found

known bad bit

for low noisy cells

for high noisy cells

0.01 is used to scale "PER" to the same order of magnitude to "SIG"

smaller deviation: distorted

checking TmaxAmp, Not mixed with MaxAmp and Width

channel information output

Only dead or distorted, or short known BCs are considered below.

index of bc

Definition at line 162 of file FixLArElecCalib.cxx.

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

445 {
446
447 ATH_MSG_INFO ( " in fix3() " );
448 std::string filename ;
449
450 // updated for 13.0.20
451 if(m_g4Phys=="QGSP_EMV"){
452 filename = "fsampl_1302_qgsp-emv.txt";
453 }
454 else
455 if( m_g4Phys=="QGSP_BERT"){
456 filename = "fsampl_1303_qgsp-bert.txt";
457 }
458 else {
459 ATH_MSG_ERROR ( " wrong option "<<m_g4Phys );
460 return StatusCode::FAILURE;
461 }
462
463 // Fix3 is for updating the FCAL conditions data after IdFix7
464 // Input should be MC Conditions data with DetDescrVersion=ATLAS-DC3-05
465
466 ATH_CHECK( updateEMfSampl(filename, cabling ) );
467 ATH_CHECK( updateHADfSampl(cabling) );
468 return StatusCode::SUCCESS;
469}
#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 586 of file FixLArElecCalib.cxx.

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