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

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

◆ ATLAS_NOT_THREAD_SAFE() [2/3]

StatusCode FixLArElecCalib::fix17 ATLAS_NOT_THREAD_SAFE ( const LArOnOffIdMapping cabling)

Definition at line 447 of file FixLArElecCalib.cxx.

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

◆ ATLAS_NOT_THREAD_SAFE() [3/3]

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

Definition at line 588 of file FixLArElecCalib.cxx.

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