|
ATLAS Offline Software
|
#include <LArMasterWaveBuilder.h>
|
| LArMasterWaveBuilder (const std::string &name, ISvcLocator *pSvcLocator) |
|
| ~LArMasterWaveBuilder () |
|
StatusCode | initialize () |
|
StatusCode | execute () |
|
StatusCode | stop () |
|
StatusCode | finalize () |
|
StatusCode | perMWCal (const std::vector< LArCaliWave * >, LArWave &mwfWave, LArWave &intrWave) |
|
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 |
|
Definition at line 25 of file LArMasterWaveBuilder.h.
◆ StoreGateSvc_t
◆ LArMasterWaveBuilder()
LArMasterWaveBuilder::LArMasterWaveBuilder |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~LArMasterWaveBuilder()
LArMasterWaveBuilder::~LArMasterWaveBuilder |
( |
| ) |
|
|
default |
◆ 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()
◆ diffWave() [1/2]
◆ diffWave() [2/2]
Definition at line 521 of file LArMasterWaveBuilder.cxx.
522 double norm1, norm2 ;
530 if ( norm1 <=0 || norm2 <= 0 )
return -1 ;
532 for (
unsigned u=0 ;
u < w1.
getSize() ;
u++ ) {
535 if ( diff1 > resid ) {
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode LArMasterWaveBuilder::execute |
( |
| ) |
|
|
inline |
◆ 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();
◆ finalize()
StatusCode LArMasterWaveBuilder::finalize |
( |
| ) |
|
|
inline |
◆ initialize()
StatusCode LArMasterWaveBuilder::initialize |
( |
| ) |
|
Definition at line 70 of file LArMasterWaveBuilder.cxx.
73 ATH_MSG_WARNING (
"DACMinPS jobOption has wrong size. Will use default." );
80 ATH_MSG_WARNING (
"DACMinStrips jobOption has wrong size. Will use default." );
87 ATH_MSG_WARNING (
"DACMinMiddle jobOption has wrong size. Will use default." );
94 ATH_MSG_WARNING (
"DACMinBack jobOption has wrong size. Will use default." );
103 ATH_MSG_WARNING (
"DACMaxPS jobOption has wrong size. Will use default." );
110 ATH_MSG_WARNING (
"DACMaxStrips jobOption has wrong size. Will use default." );
117 ATH_MSG_WARNING (
"DACMaxMiddle jobOption has wrong size. Will use default." );
124 ATH_MSG_WARNING (
"DACMaxBack jobOption has wrong size. Will use default." );
136 return StatusCode::SUCCESS ;
◆ 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.
◆ perMWCal()
◆ renounce()
◆ renounceArray()
◆ stop()
StatusCode LArMasterWaveBuilder::stop |
( |
| ) |
|
Definition at line 139 of file LArMasterWaveBuilder.cxx.
150 return StatusCode::FAILURE;
156 return StatusCode::FAILURE;
164 msg() << MSG::INFO <<
"Check on ADC saturation: " ;
172 msg() << MSG::INFO <<
"Check on mimimum DAC value: " ;
181 ATH_MSG_INFO (
"Master Waveforms will NOT be normalized" );
184 ATH_MSG_INFO (
"Master Waveforms will be shifted to the origin" );
186 ATH_MSG_INFO (
"Master Waveforms will NOT be shifted to the origin" );
189 ATH_MSG_INFO (
"Build MWs even with only one usable DAC" );
191 ATH_MSG_INFO (
"Don't build MWs if only one usable DAC" );
194 ATH_MSG_INFO (
"For linearity check, normalize to peak " );
196 ATH_MSG_INFO (
"For linearity check, normalize to DAC " );
204 if ( caliWaveContainer ==
nullptr ) {
206 return StatusCode::FAILURE;
212 auto mwContainer = std::make_unique<LArCaliWaveContainer>();
218 std::vector< std::map<HWIdentifier, std::vector<int> > > badDACs ;
221 unsigned nMasterWaves = 0 ;
225 ATH_MSG_DEBUG (
"Evaluating master wavefroms for gain " << gain_it );
228 unsigned gainFactor = (
unsigned)(
pow(10,2-gain_it)) ;
231 std::vector<int> minDAC , maxDAC ;
241 ATH_MSG_INFO (
"Minimum DAC allowed for layers 0,1,2,3 and gain " << gain_it );
243 ATH_MSG_INFO (
"Maximum DAC allowed for layers 0,1,2,3 and gain " << gain_it );
252 if ( cell_it == cell_it_e ) {
259 for ( ; cell_it!=cell_it_e ; ++cell_it ) {
263 if ( wave_it == wave_it_e ) {
271 double dt = vCaliWaves[0].getDt() ;
272 unsigned nDACs = vCaliWaves.size() ;
275 <<
" in gain " << gain_it );
277 for (
unsigned i=0 ;
i<nDACs ;
i++ )
278 msg() << vCaliWaves[
i].getDAC() <<
" " ;
287 region = emId->
region(
id) ;
296 DACMin = minDAC[
layer] ;
297 DACMax = maxDAC[
layer] ;
300 std::vector<double> vDACs ;
301 std::vector<const LArWave*> vWaves ;
302 std::vector<bool> usable ;
303 std::vector<int> thisDAC ;
304 std::vector<double> thisPeak ;
305 usable.resize(nDACs) ;
306 thisDAC.resize(nDACs) ;
307 thisPeak.resize(nDACs) ;
310 for (
unsigned i=0 ;
i<nDACs ;
i++ ) {
311 thisDAC[
i] = vCaliWaves[
i].getDAC() ;
316 <<
"DAC below threshold... skip!" );
324 <<
" absolute ADC saturation... skip!" );
330 <<
" relative ADC saturation... skip!" );
336 if ( fabs( thisPeak[
i]/thisDAC[
i] ) < gainFactor*0.0001 ) {
346 double minOverallDiff = 9.e+99 ;
347 for (
unsigned i=0 ;
i<nDACs ;
i++ ) {
348 if ( ! usable[
i] ) continue ;
349 if ( thisDAC[
i]<DACMin || thisDAC[
i]>DACMax ) continue ;
350 double thisOverallDiff = 0 ;
351 for (
unsigned k=0 ;
k<nDACs ;
k++ ) {
352 if ( ! usable[
k] ) continue ;
353 if (
k ==
i ) continue ;
355 if ( theDiff>0 ) thisOverallDiff += theDiff ;
357 if ( thisOverallDiff < minOverallDiff ) {
359 minOverallDiff = thisOverallDiff ;
363 if ( refIndex >=0 ) {
364 int refDAC = thisDAC[refIndex] ;
365 ATH_MSG_DEBUG (
"Check non-linearity against DAC " << refDAC );
366 for (
unsigned i=0 ;
i<nDACs ;
i++ ) {
367 if ( ! usable[
i] ) continue ;
373 <<
" non-linearity detected, rel.resid= " << relDiff
374 <<
" at t= " << tbin*vCaliWaves[
i].getDt() <<
" tbin= " << tbin
377 }
else if ( relDiff < 0 ) {
379 <<
" could not check linearity... skip!" );
383 <<
" linear within " << relDiff );
387 ATH_MSG_DEBUG (
"Could not find reference DAC, just reject all waves not in DAC ["
388 << DACMin <<
"," << DACMax <<
"]" );
389 for (
unsigned i=0 ;
i<nDACs ;
i++ ) {
390 if ( thisDAC[
i]<DACMin || thisDAC[
i]>DACMax ) usable[
i] = false ;
394 for (
unsigned i=0 ;
i<nDACs ;
i++ ) {
396 vDACs.push_back( (
double)( thisDAC[
i] ) ) ;
397 const LArWave* wave = &vCaliWaves[
i];
398 vWaves.push_back(wave);
400 if ( (
unsigned int)thisDAC[
i] > 1000/gainFactor )
401 ( badDACs[(
unsigned)gain_it][chID] ).push_back(thisDAC[
i]) ;
404 unsigned nGoodDACs = vDACs.size() ;
405 ATH_MSG_DEBUG ( nGoodDACs <<
" DAC's selected for MW evaluation, channel 0x"
409 std::vector<LArWave> fitWave ;
410 if ( nGoodDACs >= 2 ) {
412 if ( fitWave.empty() ) {
413 ATH_MSG_ERROR (
"Master waveform linear fit failed! Channel 0x"
414 << MSG::hex << chID.
get_compact() << MSG::dec <<
", gain = " << gain_it );
417 }
else if (
m_buildMWoneDAC && nGoodDACs==1 && vDACs[0]>=DACMin && vDACs[0]<=DACMax ) {
419 <<
" just divide caliwave by DAC! Channel 0x"
420 << MSG::hex << chID.
get_compact() << MSG::dec <<
", gain = " << gain_it );
422 fitWave[1] = (*vWaves[0])*(1./vDACs[0]) ;
426 ATH_MSG_ERROR (
"No DACs available, cannot build MW! Channel 0x"
427 << MSG::hex << chID.
get_compact() << MSG::dec <<
", gain = " << gain_it );
431 ATH_MSG_DEBUG (
"master waveform evaluation succeeded for channel 0x"
432 << MSG::hex << chID.
get_compact() << MSG::dec <<
", gain = " << gain_it );
433 ATH_MSG_DEBUG (
" ... with " << nGoodDACs <<
" DAC values: " << vDACs );
444 fitWave[1] = fitWave[1] * (1/peak) ;
455 dacWaves.push_back( masterWave );
456 dacWaves.push_back( dac0Wave );
459 ATH_MSG_DEBUG (
"MW and DAC0 evaluated and written in container, channel 0x"
464 ATH_MSG_INFO ( nMasterWaves <<
" master wfs generated for gain " << gain_it );
476 std::map<HWIdentifier, std::vector<int> > & badDACsGain = badDACs[gain_it] ;
478 for (
const auto&
p : badDACsGain) {
480 const std::vector<int> & DACs =
p.second ;
485 int region = emId->
region(
id);
489 const std::vector<HWIdentifier>& calibLineV=clCont->calibSlotLine(chId);
490 std::vector<HWIdentifier>::const_iterator calibLineIt=calibLineV.begin();
492 if ( !calibLineV.empty() )
493 calibLine = onlineHelper->
channel(*calibLineIt);
495 int slot = onlineHelper->
slot(chId) ;
497 const char gainName[3][3] = {
"HG" ,
"MG" ,
"LG" } ;
500 sprintf( formOut,
"%2s 0x%8x [%1d;%1d;%3d;%2d] [%2d;%3d;%3d;%3d]",
503 ATH_MSG_INFO (
"*** " << std::string(formOut) <<
" : " << DACs );
506 ATH_MSG_ERROR (
"LArID_Exception: channel 0x" << MSG::hex << chId << MSG::dec <<
" not registered " );
513 return StatusCode::SUCCESS;
◆ 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_ADCsatur
int LArMasterWaveBuilder::m_ADCsatur |
|
private |
◆ m_buildMWoneDAC
bool LArMasterWaveBuilder::m_buildMWoneDAC |
|
private |
◆ m_cablingKey
◆ m_CLKey
◆ m_dacMaxLayer0
std::vector<unsigned> LArMasterWaveBuilder::m_dacMaxLayer0 |
|
private |
◆ m_dacMaxLayer1
std::vector<unsigned> LArMasterWaveBuilder::m_dacMaxLayer1 |
|
private |
◆ m_dacMaxLayer2
std::vector<unsigned> LArMasterWaveBuilder::m_dacMaxLayer2 |
|
private |
◆ m_dacMaxLayer3
std::vector<unsigned> LArMasterWaveBuilder::m_dacMaxLayer3 |
|
private |
◆ m_DACmin
int LArMasterWaveBuilder::m_DACmin |
|
private |
◆ m_dacMinLayer0
std::vector<unsigned> LArMasterWaveBuilder::m_dacMinLayer0 |
|
private |
◆ m_dacMinLayer1
std::vector<unsigned> LArMasterWaveBuilder::m_dacMinLayer1 |
|
private |
◆ m_dacMinLayer2
std::vector<unsigned> LArMasterWaveBuilder::m_dacMinLayer2 |
|
private |
◆ m_dacMinLayer3
std::vector<unsigned> LArMasterWaveBuilder::m_dacMinLayer3 |
|
private |
◆ m_detStore
◆ m_diffWaveNormPeak
bool LArMasterWaveBuilder::m_diffWaveNormPeak |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_groupingType
std::string LArMasterWaveBuilder::m_groupingType |
|
private |
◆ m_keyinput
std::string LArMasterWaveBuilder::m_keyinput |
|
private |
◆ m_keyoutput
std::string LArMasterWaveBuilder::m_keyoutput |
|
private |
◆ m_linearityTolerance
double LArMasterWaveBuilder::m_linearityTolerance |
|
private |
◆ m_listAllAnalysedChannels
bool LArMasterWaveBuilder::m_listAllAnalysedChannels |
|
private |
◆ m_normalize
bool LArMasterWaveBuilder::m_normalize |
|
private |
◆ m_timeShift
bool LArMasterWaveBuilder::m_timeShift |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_waveHelper
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
int phi(const Identifier id) const
return phi according to :
HWIdentifier channelId() const
std::string ChanDacGain(HWIdentifier ch, int DAC, int gain)
Scalar phi() const
phi method
size_t getSize() const
number of time samples
const LArEM_ID * em_idHelper() const
access to EM idHelper
unsigned getStart(const LArWave &theWave) const
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Declaration of const iterator.
double m_linearityTolerance
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
LArWave translate(const LArWave &theWave, int nShift, double baseline=0.) const
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_listAllAnalysedChannels
value_type get_compact() const
Get the compact id.
int region(const Identifier id) const
return region according to :
int getDAC() const
DAC value.
int sampling(const Identifier id) const
return sampling according to :
std::vector< unsigned > m_dacMinLayer2
const std::string & key() const
Return the StoreGate ID for the referenced object.
unsigned int getMax(const LArWave &theWave) const
return index of maximum sample
std::vector< unsigned > m_dacMinLayer1
value_type get_compact() const
Get the compact id.
@ u
Enums for curvilinear frames.
int eta(const Identifier id) const
return eta according to :
Liquid Argon Cumulative Wave Container.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
std::vector< unsigned > m_dacMaxLayer2
const double & getSample(const unsigned int i) const
Amplitude per time bin.
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
::StatusCode StatusCode
StatusCode definition for legacy code.
double diffWave(const LArCaliWave &w1, const LArCaliWave &w2, int &tbin, bool normPeak) const
std::vector< unsigned > m_dacMaxLayer1
Helper class for offline cell identifiers.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
LArCaliWaveContainer::LArCaliWaves::const_iterator CaliWaveIt
std::vector< unsigned > m_dacMinLayer3
std::vector< LArWave > linearMasterWave(const std::vector< const LArWave * > &vWaves, const std::vector< double > &vAmpli) const
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
SG::ReadCondHandleKey< LArCalibLineMapping > m_CLKey
StatusCode initialize(bool used=true)
DataObjIDColl m_extendedExtraObjects
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
#define ATH_MSG_WARNING(x)
std::vector< unsigned > m_dacMinLayer0
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
Helper class for LArEM offline identifiers.
LArWaveHelper * m_waveHelper
std::vector< unsigned > m_dacMaxLayer3
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::string m_groupingType
std::vector< unsigned > m_dacMaxLayer0
Exception class for LAr Identifiers.