ATLAS Offline Software
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 148 of file FixLArElecCalib.h.

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

◆ 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 219 of file FixLArElecCalib.h.

220 {
221  // read in the file
222 
223  const T * container_c = nullptr;
224  ATH_CHECK( detStore()->retrieve(container_c) );
225 
226  T* container = const_cast<T*>(container_c);
227 
228  typedef typename T::LArCondObj CONDOBJ ;
229 
230  if ( filename == "") { ATH_MSG_ERROR("No input filename "); return StatusCode::FAILURE; }
231  ATH_CHECK( ReadFileAll(filename, cabling, withGain,nvar) );
232 
233  int ngain=1;
234  if (withGain) ngain=3;
235  for (int igain = 0;igain<ngain;++igain){
236  VROW_t::iterator it = m_cache[igain].begin();
237  VROW_t::iterator it_e = m_cache[igain].end();
238 
239  int n=0;
240  for( ;it!=it_e;++it) {
241  HWIdentifier hid = (*it).first;
242 
243  if(!hid.is_valid()) {
244  ATH_MSG_WARNING(" Not valid hid: 0x" <<hid.getString() );
245  continue;
246  }
247 
248  const CONDOBJ& u = container->get(hid,igain);
249 
250  if( u.isEmpty() ) {
251  ATH_MSG_WARNING(" Not existing conditions data, adding new one " );
252  CONDOBJ t ;
253  set_object(t,(*it).second) ;
254  container->setPdata(hid,t,igain);
255  } else {
256  print_object(" Old object = ",u);
257 
258  CONDOBJ& u2 = const_cast<CONDOBJ&>(u);
259  set_object(u2,(*it).second) ;
260  }
261 
262  const CONDOBJ& u3 = container->get(hid,igain);
263  print_object(" New object = ",u3);
264 
265  ++n;
266  }
267  ATH_MSG_INFO( " done for gain ="<<igain<<" with "<<n<<" objects");
268 
269  }// gain
270 
271  ATH_MSG_INFO(" done with "<<filename );
272  return StatusCode::SUCCESS;
273 }
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:396
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