Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Functions
FixLArElecCalib.h File Reference
#include "AthenaBaseComps/AthAlgorithm.h"
#include "CxxUtils/checker_macros.h"
#include "Identifier/HWIdentifier.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "LArCabling/LArOnOffIdMapping.h"
#include "LArRecConditions/LArCalibLineMapping.h"
#include <string>
#include "LArRawConditions/LArDAC2uAMC.h"
#include "LArRawConditions/LArShape32MC.h"
#include "LArRawConditions/LAruA2MeVMC.h"
#include "LArRawConditions/LArfSamplMC.h"
#include "LArRawConditions/LArMinBiasMC.h"
#include "LArRawConditions/LArNoiseMC.h"
#include "LArRawConditions/LArRampMC.h"
#include "LArRawConditions/LArAutoCorrMC.h"
#include "LArRawConditions/LArMphysOverMcalMC.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FixLArElecCalib
 fix electronic calibration constants for MC. More...
 

Functions

template<class T >
StatusCode FixLArElecCalib::update_EM_HEC ATLAS_NOT_THREAD_SAFE (const std::string &em_filename, const std::string &hec_filename, const LArOnOffIdMapping *cabling, bool withGain, int nvar)
 
template<class T >
StatusCode FixLArElecCalib::update_All ATLAS_NOT_THREAD_SAFE (const std::string &filename, const LArOnOffIdMapping *cabling, bool withGain, int nvar)
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/2]

template<class T >
StatusCode FixLArElecCalib::update_EM_HEC ATLAS_NOT_THREAD_SAFE ( const std::string &  em_filename,
const std::string &  hec_filename,
const LArOnOffIdMapping cabling,
bool  withGain,
int  nvar 
)

Definition at line 147 of file FixLArElecCalib.h.

148 {
149  // read in the file
150 
151  const T * container_c = nullptr;
152  ATH_CHECK( detStore()->retrieve(container_c) );
153 
154  T* container = const_cast<T*>(container_c);
155 
156  typedef typename T::LArCondObj CONDOBJ ;
157 
158  for (int i=0; i<2;++i)
159  { // EM and HEC
160  if( i==0 )
161  {
162  if ( em_filename == "") continue ;
163  bool EM=true;
164  ATH_CHECK( ReadFile(em_filename,cabling,EM,withGain,nvar) );
165  }
166  if( i==1 )
167  {
168  if ( hec_filename == "") continue ;
169  bool EM=false ;
170  ATH_CHECK( ReadFile(hec_filename,cabling,EM,withGain,nvar) );
171  }
172 
173 
174  int ngain=1;
175  if (withGain) ngain=3;
176  for (int igain = 0;igain<ngain;++igain){
177  VROW_t::iterator it = m_cache[igain].begin();
178  VROW_t::iterator it_e = m_cache[igain].end();
179 
180  int n=0;
181  for( ;it!=it_e;++it)
182  {
183  HWIdentifier hid = (*it).first;
184 
185  const CONDOBJ& u = container->get(hid,igain);
186 
187  if( u.isEmpty() )
188  {
189  ATH_MSG_WARNING(" No existing conditions data, adding new one " );
190  CONDOBJ t ;
191  set_object(t,(*it).second) ;
192  container->setPdata(hid,t,igain);
193  }
194  else
195  {
196  print_object(" Old object = ",u);
197 
198  CONDOBJ& u2 = const_cast<CONDOBJ&>(u);
199  set_object(u2,(*it).second) ;
200  }
201 
202  const CONDOBJ& u3 = container->get(hid,igain);
203  print_object(" New object = ",u3);
204 
205  ++n;
206  }
207  ATH_MSG_INFO( " done for gain ="<<igain<<" with "<<n<<" objects");
208 
209  }// gain
210  }// EM HEC
211 
212  ATH_MSG_INFO(" done with EM "<<em_filename<<" and HEC" <<hec_filename );
213  return StatusCode::SUCCESS;
214 }

◆ ATLAS_NOT_THREAD_SAFE() [2/2]

template<class T >
StatusCode FixLArElecCalib::update_All ATLAS_NOT_THREAD_SAFE ( const std::string &  filename,
const LArOnOffIdMapping cabling,
bool  withGain,
int  nvar 
)

Definition at line 218 of file FixLArElecCalib.h.

219 {
220  // read in the file
221 
222  const T * container_c = nullptr;
223  ATH_CHECK( detStore()->retrieve(container_c) );
224 
225  T* container = const_cast<T*>(container_c);
226 
227  typedef typename T::LArCondObj CONDOBJ ;
228 
229  if ( filename == "") { ATH_MSG_ERROR("No input filename "); return StatusCode::FAILURE; }
230  ATH_CHECK( ReadFileAll(filename, cabling, withGain,nvar) );
231 
232  int ngain=1;
233  if (withGain) ngain=3;
234  for (int igain = 0;igain<ngain;++igain){
235  VROW_t::iterator it = m_cache[igain].begin();
236  VROW_t::iterator it_e = m_cache[igain].end();
237 
238  int n=0;
239  for( ;it!=it_e;++it) {
240  HWIdentifier hid = (*it).first;
241 
242  if(!hid.is_valid()) {
243  ATH_MSG_WARNING(" Not valid hid: 0x" <<hid.getString() );
244  continue;
245  }
246 
247  const CONDOBJ& u = container->get(hid,igain);
248 
249  if( u.isEmpty() ) {
250  ATH_MSG_WARNING(" Not existing conditions data, adding new one " );
251  CONDOBJ t ;
252  set_object(t,(*it).second) ;
253  container->setPdata(hid,t,igain);
254  } else {
255  print_object(" Old object = ",u);
256 
257  CONDOBJ& u2 = const_cast<CONDOBJ&>(u);
258  set_object(u2,(*it).second) ;
259  }
260 
261  const CONDOBJ& u3 = container->get(hid,igain);
262  print_object(" New object = ",u3);
263 
264  ++n;
265  }
266  ATH_MSG_INFO( " done for gain ="<<igain<<" with "<<n<<" objects");
267 
268  }// gain
269 
270  ATH_MSG_INFO(" done with "<<filename );
271  return StatusCode::SUCCESS;
272 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
skel.it
it
Definition: skel.GENtoEVGEN.py:407
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HWIdentifier
Definition: HWIdentifier.h:13
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Ringer::EM
@ EM
Definition: CaloRingsDefs.h:19
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
WriteCellNoiseToCool.igain
igain
Definition: WriteCellNoiseToCool.py:338
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
PlotCalibFromCool.ngain
ngain
Definition: PlotCalibFromCool.py:565
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35