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 <fstream>
#include "TTree.h"
#include "TFile.h"
#include "AthenaPoolUtilities/AthenaAttributeList.h"
#include "CoralBase/Blob.h"

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.

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 158 of file FixLArElecCalib.cxx.

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

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

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