|
ATLAS Offline Software
|
#include <LArOFCCondAlg.h>
|
| LArOFCCondAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~LArOFCCondAlg () override |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
AlgoTool to compute OFC on fly
- OFC are computed consistently with autocorrelation (by default (NMinBias=-1), these OFC are retrieved)
- possibility to retrieve OFC for a wanted luminosity (set by NMinBias, the number of minimum bias events per bunch-crossing) but they won't be consistent with autocorrelation anymore. slower since re-do calculation
- flag FromDB switches between "take OFC stored in DataBase" and "take OFC stored in datamembers (computed consistently from
LArAutoCorrTotal) or recomputed for a wanted luminosity"
Definition at line 42 of file LArOFCCondAlg.h.
◆ StoreGateSvc_t
◆ LArOFCCondAlg()
LArOFCCondAlg::LArOFCCondAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Definition at line 22 of file LArOFCCondAlg.cxx.
35 "Key to read LArOnOffIdMapping object");
37 "Key to read LArShape object");
39 "Key to read LArNoise object");
41 "Key to read LArPedestal object");
43 "Key to read LArAutoCorrTotal object");
45 "Key to write LArOFC object");
51 "First sample to use for in-time event on the full pulse shape");
◆ ~LArOFCCondAlg()
LArOFCCondAlg::~LArOFCCondAlg |
( |
| ) |
|
|
overridevirtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode LArOFCCondAlg::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 84 of file LArOFCCondAlg.cxx.
89 if (writeHandle.isValid()) {
92 << writeHandle.fullKey() <<
" is already valid.");
93 return StatusCode::SUCCESS;
102 larOnlineID = scidhelper;
106 larOnlineID = idhelper;
114 larOnOffIdMapping = *larOnOffIdMappingHdl;
115 if (larOnOffIdMapping ==
nullptr) {
116 ATH_MSG_ERROR(
"Failed to retrieve LArOnOffIdMapping object");
117 return StatusCode::FAILURE;
119 writeHandle.addDependency(larOnOffIdMappingHdl);
128 if (larShape ==
nullptr) {
130 return StatusCode::FAILURE;
132 writeHandle.addDependency(ShapeHdl);
136 larAutoCorrTotal= *AutoCorrTotalHdl;
137 if (larAutoCorrTotal ==
nullptr) {
139 return StatusCode::FAILURE;
141 writeHandle.addDependency(AutoCorrTotalHdl);
149 larNoise = *NoiseHdl;
150 if (larNoise ==
nullptr) {
152 return StatusCode::FAILURE;
154 writeHandle.addDependency(NoiseHdl);
157 larPedestal = *PedestalHdl;
158 if (larPedestal ==
nullptr) {
160 return StatusCode::FAILURE;
162 writeHandle.addDependency(PedestalHdl);
165 ATH_MSG_INFO(
"IOV found from intersection for LArOFCCondObj object: "
166 << writeHandle.getRange());
171 std::unique_ptr<LArOFC> larOFC =
172 std::make_unique<LArOFC>(larOnlineID, larOnOffIdMapping,
m_nGains);
174 std::vector<float> OFCa_tmp, OFCb_tmp;
188 unsigned int nsamples_shape = Shape.size();
193 int igain_autocorr = 0;
198 const std::vector<double>
AutoCorr =
201 unsigned int nsamples_AC_OFC = (1+((
int)(sqrt(1+8*
AutoCorr.size()))))/2;
203 const std::vector<double>& rmsSampl =
205 unsigned int nsamples2 = rmsSampl.size();
206 if (nsamples2 != nsamples_AC_OFC) {
218 unsigned int iBeginOfNSamples = firstSample;
219 if(nsamples_AC_OFC + iBeginOfNSamples > nsamples_shape)
233 <<chid<<
" at gain "<<
igain );
239 if(Shape.size()==0 || ShapeDer.size()==0 ||
AutoCorr.empty())
242 <<chid<<
" at gain "<<
igain );
246 if (Shape.size()!=ShapeDer.size()) {
247 ATH_MSG_ERROR(
"Got invalid shape object: Size=" << Shape.size() <<
", DerSize=" << ShapeDer.size());
248 return StatusCode::SUCCESS;
260 for(
l=0;
l<nsamples_AC_OFC;++
l) {
261 for(
c=0;
c<nsamples_AC_OFC;++
c) {
268 int index = i1*nsamples_AC_OFC - i1*(i1+1)/2 -(i1+1) + i2;
285 for(
l=0;
l<nsamples_AC_OFC;++
l)
287 ACinv_PS[
l]=0.; ACinv_PSD[
l]=0.;
288 for(
c=0;
c<nsamples_AC_OFC;++
c){
289 ACinv_PS[
l]+=ACinv(
l,
c)*Shape[
c+iBeginOfNSamples];
290 ACinv_PSD[
l]+=ACinv(
l,
c)*ShapeDer[
c+iBeginOfNSamples];
292 Q1+=Shape[
l+iBeginOfNSamples]*ACinv_PS[
l];
293 Q2+=ShapeDer[
l+iBeginOfNSamples]*ACinv_PSD[
l];
294 Q3+=ShapeDer[
l+iBeginOfNSamples]*ACinv_PS[
l];
296 float DELTA=Q1*Q2-Q3*Q3;
299 OFCa_tmp.resize(nsamples_AC_OFC);
300 for(
i=0;
i<nsamples_AC_OFC;++
i)
301 OFCa_tmp[
i]=(ACinv_PS[
i]*Q2-ACinv_PSD[
i]*Q3)/DELTA;
303 OFCb_tmp.resize(nsamples_AC_OFC);
304 for(
i=0;
i<nsamples_AC_OFC;++
i)
305 OFCb_tmp[
i]=(ACinv_PS[
i]*Q3-ACinv_PSD[
i]*Q1)/DELTA;
310 std::cout<<larOnlineID
313 std::cout<<
"Shape: ";
314 for(
c=0;
c<nsamples_shape;++
c)
315 std::cout<<Shape[
c]<<
" ";
316 std::cout<<std::endl;
317 std::cout<<
"ShapeDer: ";
318 for(
c=0;
c<nsamples_shape;++
c)
319 std::cout<<ShapeDer[
c]<<
" ";
320 std::cout<<std::endl;
321 for(
c=0;
c<nsamples_AC_OFC;++
c)
322 std::cout<<Shape[
c+iBeginOfNSamples]<<
" ";
323 std::cout<<
" <- "<<iBeginOfNSamples<<std::endl;
324 for(
i=0;
i<nsamples_AC_OFC;++
i) std::cout<<ACinv_PS[
i]<<
" ";
325 std::cout<<std::endl;
326 for(
i=0;
i<nsamples_AC_OFC;++
i) std::cout<<ACinv_PSD[
i]<<
" ";
327 std::cout<<std::endl;
328 std::cout<<
" Q1="<<Q1<<
" Q2="<<Q2<<
" Q3="<<Q3
329 <<
" DELTA="<<DELTA<<std::endl;
330 std::cout <<
" OFCa: ";
331 for(
i=0;
i<nsamples_AC_OFC;++
i)
332 std::cout<<(ACinv_PS[
i]*Q2-ACinv_PSD[
i]*Q3)/DELTA<<
" ";
333 std::cout<<std::endl;
335 bool stat = larOFC->
setOFC(hid,
igain, std::make_pair(OFCa_tmp, OFCb_tmp));
337 msg(MSG::ERROR) <<
"LArOFC::setOFC fails for gain " <<
igain <<
", hash " << hid <<
endmsg;
342 std::vector<float>
empty;
345 msg(MSG::ERROR) <<
"LArOFC::setOFC fails for gain " <<
igain <<
", hash " << hid <<
endmsg;
353 ATH_CHECK(writeHandle.record(std::move(larOFC)));
355 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ findTheNSamples()
unsigned int LArOFCCondAlg::findTheNSamples |
( |
ILArShape::ShapeRef_t |
Shape, |
|
|
unsigned int |
nsamples_AC_OFC, |
|
|
unsigned int |
nsamples_shape |
|
) |
| const |
|
private |
Definition at line 358 of file LArOFCCondAlg.cxx.
362 unsigned int i_ShapeMax=0;
364 for(
unsigned int i=0;
i<nsamples_shape;++
i)
367 if(
value>ShapeMax) { ShapeMax=
value; i_ShapeMax=
i; }
368 else if(value<0 && i>3)
break;
371 unsigned int tmp=
int(nsamples_AC_OFC/2.);
372 if(
tmp>i_ShapeMax)
return 0;
373 else return i_ShapeMax-
tmp;
◆ initialize()
StatusCode LArOFCCondAlg::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_Dump
bool LArOFCCondAlg::m_Dump |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_firstSample
unsigned int LArOFCCondAlg::m_firstSample |
|
private |
◆ m_isMC
bool LArOFCCondAlg::m_isMC |
|
private |
◆ m_isSuperCell
bool LArOFCCondAlg::m_isSuperCell |
|
private |
◆ m_LArAutoCorrTotalObjKey
◆ m_LArNoiseObjKey
◆ m_LArOFCObjKey
◆ m_LArOnOffIdMappingObjKey
◆ m_LArPedestalObjKey
◆ m_LArShapeObjKey
◆ m_nGains
size_t LArOFCCondAlg::m_nGains = 0UL |
|
private |
◆ m_Nminbias
float LArOFCCondAlg::m_Nminbias |
|
private |
◆ m_useHighestGainAutoCorr
bool LArOFCCondAlg::m_useHighestGainAutoCorr |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
SG::ReadCondHandleKey< ILArPedestal > m_LArPedestalObjKey
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
SG::WriteCondHandleKey< LArOFC > m_LArOFCObjKey
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
unsigned int m_firstSample
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const std::vector< double > autoCorrTotal(const IdentifierHash &hid, int gain, float Nminbias) const
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadCondHandleKey< LArOnOffIdMapping > m_LArOnOffIdMappingObjKey
bool isFCALchannel(const HWIdentifier id) const
bool m_useHighestGainAutoCorr
virtual StatusCode sysInitialize() override
Override sysInitialize.
id_range channel_range() const
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
SG::ReadCondHandleKey< ILArShape > m_LArShapeObjKey
SG::ReadCondHandleKey< ILArNoise > m_LArNoiseObjKey
virtual bool isHECchannel(const HWIdentifier id) const =0
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadCondHandleKey< LArAutoCorrTotal > m_LArAutoCorrTotalObjKey
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
const std::vector< double > samplRMS(const IdentifierHash &hid, int gain, float Nminbias) const
bool setOFC(const IdentifierHash &hid, const int gain, std::pair< std::vector< float >, std::vector< float >> ofcab)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Helper for the Liquid Argon Calorimeter cell identifiers.
StatusCode initialize(bool used=true)
DataObjIDColl m_extendedExtraObjects
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Identifier cnvToIdentifier(const HWIdentifier &sid) const
create an Identifier from a HWIdentifier (inline)
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
virtual float pedestalRMS(const HWIdentifier &id, int gain) const =0
access to RMS of Pedestal index by Identifier, and gain setting
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
bool isOnlineConnected(const HWIdentifier &sid) const
Test whether a HWIdentifier is connected of not (inline)
Proxy for accessing a range of float values like a vector.