Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 159 of file FixLArElecCalib.cxx.

159  {
160 
161  ATH_MSG_INFO ( " in stop " );
162 
163  const EventContext& ctx = Gaudi::Hive::currentContext();
164 
165  SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey, ctx};
166  const LArOnOffIdMapping* cabling{*cablingHdl};
167  if(!cabling) {
168  ATH_MSG_WARNING( "Do not have cabling mapping from key " << m_cablingKey.key() );
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 }

◆ 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 }

◆ 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 }
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: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
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:24
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
Identifier
Definition: IdentifierFieldParser.cxx:14