ATLAS Offline Software
Functions
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. More...
 
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.

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

◆ ATLAS_NOT_THREAD_SAFE() [2/3]

StatusCode FixLArElecCalib::fix17 ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping cabling)

Definition at line 440 of file FixLArElecCalib.cxx.

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

◆ ATLAS_NOT_THREAD_SAFE() [3/3]

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

Definition at line 581 of file FixLArElecCalib.cxx.

581  {
582 
583  ATH_MSG_INFO ( " in updateEMfSampl() " );
584 
585  // this method updates the EM fSample, assuming symmetry.
586  // input is the text file.
587 
588  const LArfSamplMC * fsampl_c = nullptr;
589  ATH_CHECK( detStore()->retrieve(fsampl_c) );
590  LArfSamplMC* fsampl = const_cast<LArfSamplMC*>(fsampl_c);
591 
592  // read in the file
593 
594  ATH_MSG_INFO(" opening file "<< filename );
595  std::ifstream infile( filename.c_str() );
596  if(! infile.good() )
597  {
598  ATH_MSG_ERROR(" fail to open file ");
599  return StatusCode::FAILURE;
600  }
601  int det,samp,reg,eta;
602  float value ;
603  int n = 0;
604  while ( infile>>det>>samp>>reg>>eta>>value )
605  {
606  ++n;
607  ATH_MSG_INFO(" det,samp,reg,eta,value="
608  <<det<<" "
609  <<samp<<" "
610  <<reg<<" "
611  <<eta<<" "
612  <<value<<" " );
613 
614  Identifier id ;
615  if ( det==1 && samp==1 && reg==0 && eta==0 ){
616  // eta=0 for strip, not connected, but keep it
617  // Removed disconnected channels: 03/2016 RDS
618  // ATH_MSG_INFO(" disconnected strip ");
619  // id = m_em_idhelper->disc_channel_id(det,samp,reg,eta,0);
620  }else
621  id = m_em_idhelper->channel_id(det,samp,reg,eta,0);
622 
623  HWIdentifier hid = cabling->createSignalChannelID(id);
624  const LArfSamplComplete::LArCondObj & t = fsampl->get(hid,0);
625  std::string id_str = m_online_idhelper->print_to_string(hid);
626  ATH_MSG_INFO(" online id = "<<id_str);
627 
628  if( t.isEmpty() )
629  {
630  ATH_MSG_ERROR(" No existing conditions data " );
631  ATH_MSG_ERROR( m_em_idhelper->print_to_string(id) );
632  // return StatusCode::FAILURE ;
633  continue ;
634  }
635  ATH_MSG_INFO(" Old fsampl = "<< t.m_fSampl<< " " );
636 
638  t2.m_fSampl = value ;
639 
640  const LArfSamplComplete::LArCondObj & t3 = fsampl->get(hid,0);
641  ATH_MSG_INFO(" New fSampl = "<< t3.m_fSampl<< " " );
642  }
643 
644  ATH_MSG_INFO(" Number of entries changes = " <<n );
645  return StatusCode::SUCCESS;
646 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
run.infile
string infile
Definition: run.py:13
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
LUCID_EventTPCnv_Dict::t3
std::vector< LUCID_RawData_p1 > t3
Definition: LUCID_EventTPCnvDict.h:28
LArCalibLineMapping
Definition: LArCalibLineMapping.h:17
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
athena.value
value
Definition: athena.py:124
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HWIdentifier
Definition: HWIdentifier.h:13
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:727
LArConditionsContainer::get
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
get data with online identifier
LArfSamplMC
Implementation of the interface ILArfSampl for MC Derives from LArfSamplComplete, and implements the ...
Definition: LArfSamplMC.h:23
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
LArfSamplP
c-struct reproducing the structure of the persistent data
Definition: LArfSamplP.h:20
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:23
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
Identifier
Definition: IdentifierFieldParser.cxx:14