ATLAS Offline Software
CaloCondBlobFlt.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <iostream>
7 #include <cmath>
8 
9 //
10 //_____________________________________________________________
13 {
14  return (new CaloCondBlobFlt(blob));
15 }
16 //
17 //_____________________________________________________________
18 const CaloCondBlobFlt*
20 {
21  return (new CaloCondBlobFlt(blob));
22 }
23 
24 //
25 //_______________________________________________________________
28 {
29  //=== check for correct blob type
30  if(getBlobSize()){
32  throw CaloCond::TypeConflict("CaloCondBlobFlt::Ctor",getObjType(),CaloCondBlobFlt::getType());
33  }
34  }
35 }
36 
37 //
38 //_______________________________________________________________
41 {
42  //=== check for correct blob type
43  if(getBlobSize()){
45  throw CaloCond::TypeConflict("CaloCondBlobFlt::Ctor",getObjType(),CaloCondBlobFlt::getType());
46  }
47  }
48 }
49 
50 //
51 //______________________________________________________________
52 float
53 CaloCondBlobFlt::getCalib(unsigned int channel, unsigned int adc, float x, bool invert) const
54 {
55  //=== interpretation of data depends on the objVersion
56  if(getObjVersion()==1){
57  //=== Total noise parameterized as
58  //=== Sigma**2 = a**2 + b**2 * Lumi
59  float a = getData(channel,adc,0);
60  float b = getData(channel,adc,1);
61  if(invert){ x = (x*x - a*a) / (b*b) ;}
62  else { x = std::sqrt( a*a + b*b*x );}
63  }
64  else if (getObjVersion()==2) {
65  //== parameterization for pedestal = a + b*Lumi
66  float a = getData(channel,adc,0);
67  float b = getData(channel,adc,1);
68  if(invert){ x = (x - a) / (b) ;}
69  else { x = a+b*x;}
70  }
71  else{
72  throw CaloCond::VersionConflict("CaloCondBlobFlt::getCalib",getObjVersion());
73  }
74 
75  return x;
76 }
CaloCondBlobFlt::CaloCondBlobFlt
CaloCondBlobFlt(const coral::Blob &blob)
Ctor.
Definition: CaloCondBlobFlt.cxx:26
CaloCondBlobDat
Generic template class for storing a number of "T"s for each channel/gain.
Definition: CaloCondBlobDat.h:31
CaloCondBlobDat< float >::getData
float getData(const unsigned int channel, const unsigned int adc, const unsigned int idx) const
Returns a single T belonging to a channel/gain.
Definition: CaloCondBlobDat.h:134
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
CaloCondBlobFlt
Class for storing a number of floats (Flt) and functions on those.
Definition: CaloCondBlobFlt.h:29
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
CaloCondBlobBase::getBlobSize
long getBlobSize() const
Returns the BLOB size.
Definition: CaloCondBlobBase.h:65
CaloCondBlobBase::getObjType
uint16_t getObjType() const
Returns the BLOB object type.
Definition: CaloCondBlobBase.h:193
x
#define x
CaloCond::TypeConflict
Thrown if object type in BLOB does not agree with class type.
Definition: Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/Exception.h:84
CaloCondBlobFlt::getType
virtual uint16_t getType() const
Returns CaloCondType::FLT.
Definition: CaloCondBlobFlt.h:36
CaloCondBlobBase::getObjVersion
uint16_t getObjVersion() const
Returns the BLOB object version.
Definition: CaloCondBlobBase.h:203
CaloCond::VersionConflict
Thrown if object version in BLOB does not agree with class version.
Definition: Calorimeter/CaloCondBlobObjs/CaloCondBlobObjs/Exception.h:64
CaloCondBlobFlt::getCalib
float getCalib(unsigned int channel, unsigned int adc, float x, bool invert=false) const
Returns the calibrated energy for a given channel/gain and input energy.
Definition: CaloCondBlobFlt.cxx:53
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
CaloCondBlobFlt.h
a
TList * a
Definition: liststreamerinfos.cxx:10
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
CaloCondBlobFlt::getInstance
static CaloCondBlobFlt * getInstance(coral::Blob &blob)
Returns a pointer to a non-const CaloCondBlobFlt.
Definition: CaloCondBlobFlt.cxx:12
readCCLHist.float
float
Definition: readCCLHist.py:83
CaloCondBlobAlgs_fillNoiseFromASCII.blob
blob
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:96