ATLAS Offline Software
Loading...
Searching...
No Matches
LArOFCAlg Class Reference

#include <LArOFCAlg.h>

Inheritance diagram for LArOFCAlg:

Classes

struct  perChannelData_t
class  Looper

Public Member Functions

 LArOFCAlg (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute (const EventContext &)
 Execute method.
virtual StatusCode stop ()
StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void process (perChannelData_t &, const LArOnOffIdMapping *cabling) const
bool verify (const HWIdentifier chid, const std::vector< float > &OFCa, const std::vector< float > &OFCb, const std::vector< float > &Shape, const char *ofcversion, const unsigned phase) const
StatusCode initPhysWaveContainer (const LArOnOffIdMapping *cabling)
StatusCode initCaliWaveContainer ()
Eigen::VectorXd getDelta (std::vector< float > &samples, const HWIdentifier chid, unsigned nSamples) const
bool useDelta (const HWIdentifier chid, const int jobOFlag, const LArOnOffIdMapping *cabling) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

static void optFilt (const std::vector< float > &gWave_in, const std::vector< float > &gDerivWave_in, const Eigen::MatrixXd &autoCorrInv, std::vector< float > &OFCa, std::vector< float > &OFCb)
static void optFiltDelta (const std::vector< float > &gWave_in, const std::vector< float > &gDerivWave_in, const Eigen::MatrixXd &autoCorrInv, const Eigen::VectorXd &delta, std::vector< float > &vecOFCa, std::vector< float > &vecOFCb)
static void optFiltPed (const std::vector< float > &gWave_in, const std::vector< float > &gDerivWave_in, const Eigen::MatrixXd &autoCorrInv, std::vector< float > &OFCa, std::vector< float > &OFCb)
static void printOFCVec (const std::vector< float > &vecvec, MsgStream &mLog)

Private Attributes

SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKeySC {this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
SG::ReadCondHandleKey< CaloSuperCellDetDescrManagerm_caloSuperCellMgrKey
std::vector< perChannelData_tm_allChannelData
unsigned int m_nPoints {0}
StringProperty m_dumpOFCfile {this, "DumpOFCfile", ""}
StringArrayProperty m_keylist {this, "KeyList", {}, "List of keys to process"}
BooleanProperty m_verify {this, "Verify", true, "Verufy OFCs after computation"}
BooleanProperty m_normalize {this, "Normalize", false, "Normalize input wave"}
BooleanProperty m_timeShift {this, "TimeShift", false, "Shifting input wave"}
IntegerProperty m_timeShiftByIndex {this, "TimeShiftByIndex", -1, "shifting by n bins input wave"}
LArCaliWaveContainerm_waveCnt_nc =nullptr
UnsignedIntegerProperty m_nSamples {this, "Nsample", 5, "How many sample to compute"}
UnsignedIntegerProperty m_nPhases {this, "Nphase", 50, "How many sphases to compute"}
UnsignedIntegerProperty m_dPhases {this, "Dphase", 1, "Number of samples between two neighboring phases (OFC sets)"}
UnsignedIntegerProperty m_nDelays {this, "Ndelay", 24, "Number of delays in one clock"}
FloatProperty m_addOffset {this, "AddTimeOffset", 0., "Time offset to add"}
ToolHandle< ILArAutoCorrDecoderToolm_AutoCorrDecoder {this,"DecoderTool",{} }
ToolHandle< ILArAutoCorrDecoderToolm_AutoCorrDecoderV2 {this,"DecoderToolV2", {} }
const CaloDetDescrManager_Basem_calo_dd_man {}
const LArOnlineID_Basem_onlineID {}
const LArOFCBinCompletem_larPhysWaveBin {}
DoubleProperty m_errAmpl {this, "ErrAmplitude", 0.01, "Allowed amplitude difference in check"}
DoubleProperty m_errTime {this, "ErrTime", 0.01, "Allowed time difference in check"}
BooleanProperty m_readCaliWave {this, "ReadCaliWave", true, "If false PhysWave is input"}
BooleanProperty m_fillShape {this, "FillShape", false, "Fill also shape object"}
StringProperty m_ofcKey {this, "KeyOFC", "LArOFC", "Output key non-pileup OFCs"}
StringProperty m_ofcKeyV2 {this, "KeyOFCV2", "LArOFCV2", "Output key pileup OFCs"}
StringProperty m_shapeKey {this, "KeyShape", "LArShape", "Output key Shape object"}
BooleanProperty m_storeMaxPhase {this,"StoreMaxPhase", false, "Store phase of input wave max.?"}
StringProperty m_ofcBinKey {this, "LArOFCBinKey", "LArOFCPhase","Key for storing OFCBin object for MAx phase"}
StringProperty m_groupingType {this, "GroupingType", "SubDetector","Which grouping type to use"}
StringProperty m_larPhysWaveBinKey {this,"LArPhysWaveBinKey", "", "Key for object to choose bin"}
IntegerProperty m_useDelta {this, "UseDelta", 0, "0= not use Delta, 1=only EMECIW/HEC/FCAL, 2=all , 3 = only EMECIW/HEC/FCAL1+high eta FCAL2-3"}
IntegerProperty m_useDeltaV2 {this, "UseDeltaV2", 0, "Same af before for Delta"}
BooleanProperty m_computeV2 {this, "ComputeOFCV2", false, "Compute pileup OFCs?"}
BooleanProperty m_computePed {this, "ComputeOFCPed", false, "Compute OFCs with additional constraint to pedestal?"}
IntegerProperty m_nThreads {this, "nThreads", -1, "-1: No TBB, 0: Let TBB decide, >0 number of threads"}
BooleanProperty m_readDSPConfig {this, "ReadDSPConfig", false, "Read DSPConfig object ?"}
StringProperty m_DSPConfigFolder {this,"DSPConfigFolder","/LAR/Configuration/DSPConfiguration", "Folder for DSPConfig object"}
std::unique_ptr< LArDSPConfigm_DSPConfig
BooleanProperty m_forceShift {this, "ForceShift", false, "Forcing shift of input wave ?"}
BooleanProperty m_isSC {this, "isSC", false, "Running on cells or supercells?"}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static const float m_fcal3Delta [5] ={0.0790199937765, 0.0952000226825, 0.0790199937765, 0.0952000226825, 0.0790199937765}
static const float m_fcal2Delta [5] ={-0.01589001104, -0.0740399733186, -0.01589001104, -0.0740399733186, -0.01589001104}
static const float m_fcal1Delta [5] ={0.0679600232979, -0.139479996869, 0.0679600232979, -0.139479996869, 0.0679600232979}

Detailed Description

Definition at line 39 of file LArOFCAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArOFCAlg()

LArOFCAlg::LArOFCAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 40 of file LArOFCAlg.cxx.

41 : AthAlgorithm(name, pSvcLocator)
42{}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode LArOFCAlg::execute ( const EventContext & ctx)
inlinevirtual

Execute method.

Implements AthAlgorithm.

Definition at line 46 of file LArOFCAlg.h.

46{return StatusCode::SUCCESS;}

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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 & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode LArOFCAlg::finalize ( )
inline

Definition at line 48 of file LArOFCAlg.h.

48{return StatusCode::SUCCESS;}

◆ getDelta()

Eigen::VectorXd LArOFCAlg::getDelta ( std::vector< float > & samples,
const HWIdentifier chid,
unsigned nSamples ) const
private

Definition at line 831 of file LArOFCAlg.cxx.

831 {
832
833 if (nSamples>5) nSamples=5;
834
835 Eigen::VectorXd delta(nSamples); //return value
836
837 if (m_onlineID->isFCALchannel(chid) ){
838 // FCAL use fixed delta from data.
839 const int slot = m_onlineID->slot(chid) ;
840 if ( slot <=9){ // FCAL 1
841 for (unsigned i=0;i<nSamples;++i) {
842 delta[i]=m_fcal1Delta[i];
843 }
844 }else
845 if(slot <=13){ // FCAL 2
846 for (unsigned i=0;i<nSamples;++i) {
847 delta[i]=m_fcal2Delta[i];
848 }
849 }else { //FCAL 3
850 for (unsigned i=0;i<nSamples;++i) {
851 delta[i]=m_fcal3Delta[i];
852 }
853 }
854
855 }else
856 { // from Shape
857 float odd = 0.;
858 float even = 0.;
859 for (unsigned int i = 0;i<samples.size();++i) {
860 if (i%2==0){
861 even += samples[i];
862 }
863 else {
864 odd += samples[i];
865 }
866 }
867
868 for (unsigned i=0;i<nSamples;++i) {
869 if (i%2==0)
870 delta[i]=even;
871 else
872 delta[i]=odd;
873 }
874 }
875
876 return delta;
877
878}
static const float m_fcal3Delta[5]
Definition LArOFCAlg.h:827
static const float m_fcal2Delta[5]
Definition LArOFCAlg.h:828
static const float m_fcal1Delta[5]
Definition LArOFCAlg.h:829
const LArOnlineID_Base * m_onlineID
Definition LArOFCAlg.h:143

◆ initCaliWaveContainer()

StatusCode LArOFCAlg::initCaliWaveContainer ( )
private

Definition at line 601 of file LArOFCAlg.cxx.

601 {
602
604 for (unsigned k=0 ; k<m_keylist.size() ; k++ ) { // Loop over all containers that are to be processed (e.g. different gains)
605 ATH_MSG_INFO( "Processing WaveContainer from StoreGate! key = " << m_keylist[k] );
606
607 //Input cali-wave might come from the same job. In this case we see a non-const container in SG probably w/o corrections applied.
608 //Try non-const retrieve:
609 const LArCaliWaveContainer* waveCnt = nullptr;
610 m_waveCnt_nc=detStore()->tryRetrieve<LArCaliWaveContainer>(m_keylist[k]);
611 if (m_waveCnt_nc) {
612 waveCnt=m_waveCnt_nc; //Retain const pointer
613 if (!m_waveCnt_nc->correctionsApplied()) {
614 ATH_MSG_INFO( "LArCaliWaveContainer: Corrections not yet applied, applying them now..." );
615 if (m_waveCnt_nc->applyCorrections().isFailure()) {
616 ATH_MSG_ERROR( "Failed to apply corrections to LArCaliWaveContainer!" );
617 return StatusCode::FAILURE;
618 }
619 else {
620 ATH_MSG_INFO("Applied corrections to non-const Wave container");
621 }
622 }
623 }
624 else {
625 waveCnt=detStore()->tryConstRetrieve<LArCaliWaveContainer>(m_keylist[k]);
626 if (!waveCnt) {
627 ATH_MSG_ERROR( "Failed to retrieve a LArCaliWaveContainer with key " << m_keylist[k] );
628 return StatusCode::FAILURE;
629 }
630 }
631
632
633 m_allChannelData.reserve(std::max(m_allChannelData.size()*3/2,m_allChannelData.size()+128*waveCnt->size()));// Size doesn't give the expected response on a ConditionsContainer
634
635 for (unsigned gain = CaloGain::LARHIGHGAIN ; gain < CaloGain::LARNGAIN ; gain++ ) { // loop on possible gains
636 WAVEIT it=waveCnt->begin(gain);
637 WAVEIT it_e=waveCnt->end(gain);
638 for (;it!=it_e;++it) {
639 const LArCaliWaveVec& wVec=*it;
640 for (const auto& cw : wVec) {
641 const LArWaveCumul* wave= &(cw); //down-cast
642 if (!wave->isEmpty()) {
643 m_allChannelData.emplace_back(wave,it.channelId(),gain);
644 }
645 }
646 } //end loop over channels
647 }//end loop over gains
648 }//end loop over SG keys
649 return StatusCode::SUCCESS;
650}
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
const ServiceHandle< StoreGateSvc > & detStore() const
size_type size() const noexcept
Returns the number of elements in the collection.
ConditionsMap::const_iterator ConstConditionsMapIterator
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
std::vector< perChannelData_t > m_allChannelData
Definition LArOFCAlg.h:94
StringArrayProperty m_keylist
Definition LArOFCAlg.h:124
LArCaliWaveContainer * m_waveCnt_nc
Definition LArOFCAlg.h:131
bool isEmpty() const
is LArWave uninitialized?
Definition LArWave.h:183
@ LARNGAIN
Definition CaloGain.h:19
@ LARHIGHGAIN
Definition CaloGain.h:18

◆ initialize()

StatusCode LArOFCAlg::initialize ( )

Definition at line 46 of file LArOFCAlg.cxx.

46 {
47
49
50 if ( m_nSamples>32 ) {
51 ATH_MSG_ERROR( "You are not allowed to compute OFC for Nsamples = " << m_nSamples ) ;
52 return StatusCode::FAILURE;
53 }
54
55 StatusCode sc = m_AutoCorrDecoder.retrieve();
56 if (sc.isFailure()) {
57 ATH_MSG_FATAL( "Could not retrieve AutoCorrDecoder " << m_AutoCorrDecoder );
58 return StatusCode::FAILURE;
59 } else {
60 ATH_MSG_INFO( "Retrieved Decoder Tool: "<< m_AutoCorrDecoder );
61 }
62
63
64 if (m_computeV2) {
65 sc = m_AutoCorrDecoderV2.retrieve();
66 if (sc.isFailure()) {
67 ATH_MSG_FATAL( "Could not retrieve AutoCorrDecoderV2 " << m_AutoCorrDecoderV2 );
68 return StatusCode::FAILURE;
69 } else {
70 ATH_MSG_INFO( "Retrieved Decoder Tool: "<< m_AutoCorrDecoderV2 );
71 }
72 }
73
74 if ( m_isSC ) {
75 const LArOnline_SuperCellID* ll;
76 sc = detStore()->retrieve(ll, "LArOnline_SuperCellID");
77 if (sc.isFailure()) {
78 msg(MSG::ERROR) << "Could not get LArOnlineID helper !" << endmsg;
79 return StatusCode::FAILURE;
80 }
81 else {
82 m_onlineID = static_cast<const LArOnlineID_Base*>(ll);
83 ATH_MSG_DEBUG("Found the LArOnlineID helper");
84 }
85 } else { // m_isSC
86 const LArOnlineID* ll;
87 sc = detStore()->retrieve(ll, "LArOnlineID");
88 if (sc.isFailure()) {
89 msg(MSG::ERROR) << "Could not get LArOnlineID helper !" << endmsg;
90 return StatusCode::FAILURE;
91 }
92 else {
93 m_onlineID = static_cast<const LArOnlineID_Base*>(ll);
94 ATH_MSG_DEBUG(" Found the LArOnlineID helper. ");
95 }
96 }
97
98 ATH_CHECK( m_cablingKeySC.initialize(m_isSC) );
100 ATH_CHECK( m_cablingKey.initialize(!m_isSC) );
101 ATH_CHECK( m_caloMgrKey.initialize(!m_isSC) );
102
103 ATH_MSG_INFO( "Number of wave points needed : " << m_nPoints ) ;
104 if (m_computeV2) {
105 ATH_MSG_INFO( "Will compute two flavors of OFCs" );
106 ATH_MSG_INFO( "Version 1: useDelta= " << m_useDelta <<", output key: " << m_ofcKey << " AutoCorrDecoder: " << m_AutoCorrDecoder.name() );
107 ATH_MSG_INFO( "Version 2: useDelta= " << m_useDeltaV2 <<", output key: " << m_ofcKeyV2 << " AutoCorrDecoder: " << m_AutoCorrDecoderV2.name() );
108 }
109 return StatusCode::SUCCESS;
110}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_FATAL(x,...)
static Double_t sc
UnsignedIntegerProperty m_nSamples
Definition LArOFCAlg.h:133
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition LArOFCAlg.h:55
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
Definition LArOFCAlg.h:53
UnsignedIntegerProperty m_nDelays
Definition LArOFCAlg.h:136
ToolHandle< ILArAutoCorrDecoderTool > m_AutoCorrDecoder
Definition LArOFCAlg.h:139
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition LArOFCAlg.h:52
StringProperty m_ofcKeyV2
Definition LArOFCAlg.h:152
ToolHandle< ILArAutoCorrDecoderTool > m_AutoCorrDecoderV2
Definition LArOFCAlg.h:140
UnsignedIntegerProperty m_nPhases
Definition LArOFCAlg.h:134
IntegerProperty m_useDelta
Definition LArOFCAlg.h:160
BooleanProperty m_computeV2
Definition LArOFCAlg.h:162
UnsignedIntegerProperty m_dPhases
Definition LArOFCAlg.h:135
IntegerProperty m_useDeltaV2
Definition LArOFCAlg.h:161
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
Definition LArOFCAlg.h:60
StringProperty m_ofcKey
Definition LArOFCAlg.h:151
BooleanProperty m_isSC
Definition LArOFCAlg.h:172
unsigned int m_nPoints
Definition LArOFCAlg.h:121
::StatusCode StatusCode
StatusCode definition for legacy code.
long long ll

◆ initPhysWaveContainer()

StatusCode LArOFCAlg::initPhysWaveContainer ( const LArOnOffIdMapping * cabling)
private

Definition at line 567 of file LArOFCAlg.cxx.

567 {
568
570
571 for (unsigned k=0 ; k<m_keylist.size() ; k++ ) { // Loop over all containers that are to be processed (e.g. different gains)
572 ATH_MSG_INFO( "Processing WaveContainer from StoreGate! key = " << m_keylist[k] );
573
574 const LArPhysWaveContainer* waveCnt;
575 StatusCode sc=detStore()->retrieve(waveCnt,m_keylist[k]);
576 if (sc.isFailure()) {
577 ATH_MSG_ERROR( "Failed to retrieve a LArPhysWaveContainer with key " << m_keylist[k] );
578 return sc;
579 }
580
581 m_allChannelData.reserve(std::max(m_allChannelData.size()*3/2,m_allChannelData.size()+128*waveCnt->size()));// Size doesn't give the expected response on a ConditionsContainer
582
583 for (unsigned gain = CaloGain::LARHIGHGAIN ; gain < CaloGain::LARNGAIN ; gain++ ) { // loop on possible gains
584 WAVEIT it=waveCnt->begin(gain);
585 WAVEIT it_e=waveCnt->end(gain);
586 for (;it!=it_e;++it) {
587 const HWIdentifier chid=it.channelId();
588 if (cabling->isOnlineConnected (chid)){
589 const LArWaveCumul* wave= &(*it); //down-cast
590 if (!wave->isEmpty()) {
591 m_allChannelData.emplace_back(wave, chid,gain);
592 }
593 }
594 } //end loop over channels
595 }//end loop over gains
596 }//end loop over SG keys
597 return StatusCode::SUCCESS;
598}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ optFilt()

void LArOFCAlg::optFilt ( const std::vector< float > & gWave_in,
const std::vector< float > & gDerivWave_in,
const Eigen::MatrixXd & autoCorrInv,
std::vector< float > & OFCa,
std::vector< float > & OFCb )
staticprivate

Definition at line 653 of file LArOFCAlg.cxx.

654 { // Output variables;
655 assert(gWave.size()==gDerivWave.size());
656 //assert autoCorr size ....
657 const int optNpt = gWave.size();
658
659 Eigen::VectorXd gResp(optNpt), gDerivResp(optNpt);
660 for (int i=0;i<optNpt;i++) {
661 gResp[i] = gWave[i];
662 gDerivResp[i] = gDerivWave[i];
663 }
664
665 Eigen::Matrix2d isol;
666 isol <<
667 (gResp.transpose()*acInverse*gResp)[0],
668 (gResp.transpose()*acInverse*gDerivResp)[0],
669 (gDerivResp.transpose()*acInverse*gResp)[0],
670 (gDerivResp.transpose()*acInverse*gDerivResp)[0];
671
672 Eigen::Vector2d Amp;
673 Eigen::Vector2d Atau;
674 Eigen::Vector2d Ktemp;
675 Eigen::Matrix2d isolInv = isol.inverse();
676
677 // we solve for the lagrange multiplers
678 Ktemp[0] = 1.;
679 Ktemp[1] = 0.;
680 Amp = isolInv*Ktemp;
681
682 Ktemp[0] = 0.;
683 Ktemp[1] = -1.;
684 Atau = isolInv*Ktemp;
685
686 // we express the a and b vectors in terms of the lagrange multipliers
687 Eigen::VectorXd OFCa = Amp[0]*acInverse*gResp + Amp[1]*acInverse*gDerivResp;
688 Eigen::VectorXd OFCb = Atau[0]*acInverse*gResp + Atau[1]*acInverse*gDerivResp;
689
690 //Convert back to std::vector
691 vecOFCa.resize(optNpt);
692 vecOFCb.resize(optNpt);
693 for (int i=0;i<optNpt;i++) {
694 vecOFCa[i]=OFCa[i];
695 vecOFCb[i]=OFCb[i];
696 }
697 }

◆ optFiltDelta()

void LArOFCAlg::optFiltDelta ( const std::vector< float > & gWave_in,
const std::vector< float > & gDerivWave_in,
const Eigen::MatrixXd & autoCorrInv,
const Eigen::VectorXd & delta,
std::vector< float > & vecOFCa,
std::vector< float > & vecOFCb )
staticprivate

HepVector delta(5) ;

delta[0]=3.79198742146; delta[1]=-4.84165741965; delta[2]=3.20189843985; delta[3]=-5.90850592618; delta[4]=1.8260451328;

Definition at line 751 of file LArOFCAlg.cxx.

753 {
754
755
756
757 assert(gWave.size()==gDerivWave.size());
758 //assert autoCorr size ....
759 const int optNpt = gWave.size();
760
761 Eigen::VectorXd gResp(optNpt), gDerivResp(optNpt);
762 for (int i=0;i<optNpt;i++) {
763 gResp[i] = gWave[i];
764 gDerivResp[i] = gDerivWave[i];
765 }
766
767 // try 3X3 matrix with offsets
768
769
779 Eigen::Matrix3d isol;
780 isol <<
781 (gResp.transpose()*acInverse*gResp)[0],
782 (gResp.transpose()*acInverse*gDerivResp),
783 (gResp.transpose()*acInverse*delta)[0],
784
785 (gDerivResp.transpose()*acInverse*gResp)[0],
786 (gDerivResp.transpose()*acInverse*gDerivResp)[0],
787 (gDerivResp.transpose()*acInverse*delta)[0],
788
789 (delta.transpose()*acInverse*gResp)[0],
790 (delta.transpose()*acInverse*gDerivResp)[0],
791 (delta.transpose()*acInverse*delta)[0];
792
793
794 Eigen::Vector3d Amp;
795 Eigen::Vector3d Atau;
796 Eigen::Vector3d Ktemp;
797 Eigen::Matrix3d isolInv = isol.inverse();
798
799 // we solve for the lagrange multiplers
800
801 Ktemp[0] = 1.;
802 Ktemp[1] = 0.;
803 Ktemp[2] = 0.;
804
805 Amp = isolInv*Ktemp;
806
807 Ktemp[0] = 0.;
808 Ktemp[1] = -1.;
809 Atau = isolInv*Ktemp;
810
811 // we express the a and b vectors in terms of the lagrange multipliers
812 Eigen::VectorXd OFCa = Amp[0]*acInverse*gResp + Amp[1]*acInverse*gDerivResp + Amp[2]*acInverse * delta;
813 Eigen::VectorXd OFCb = Atau[0]*acInverse*gResp + Atau[1]*acInverse*gDerivResp + Atau[2]*acInverse * delta ;
814
815
816 //Convert back to std::vector
817 vecOFCa.resize(optNpt);
818 vecOFCb.resize(optNpt);
819 for (int i=0;i<optNpt;i++) {
820 vecOFCa[i]=OFCa[i];
821 vecOFCb[i]=OFCb[i];
822 }
823 }

◆ optFiltPed()

void LArOFCAlg::optFiltPed ( const std::vector< float > & gWave_in,
const std::vector< float > & gDerivWave_in,
const Eigen::MatrixXd & autoCorrInv,
std::vector< float > & OFCa,
std::vector< float > & OFCb )
staticprivate

Definition at line 699 of file LArOFCAlg.cxx.

700 { // Output variables;
701 assert(gWave.size()==gDerivWave.size());
702 //assert autoCorr size ....
703 const int optNpt = gWave.size();
704
705 Eigen::VectorXd gResp(optNpt), gDerivResp(optNpt);
706 for (int i=0;i<optNpt;i++) {
707 gResp[i] = gWave[i];
708 gDerivResp[i] = gDerivWave[i];
709 }
710
711 Eigen::Matrix3d isol;
712 Eigen::Vector3d Kunit(1.,1.,1.);
713 auto s3=(gDerivResp.transpose()*acInverse*gResp)[0];
714 auto s4=(gResp.transpose()*acInverse*Kunit)[0];
715 auto s5=(gDerivResp.transpose()*acInverse*Kunit)[0];
716 isol <<
717 (gResp.transpose()*acInverse*gResp)[0], s3, s4,
718 s3, (gDerivResp.transpose()*acInverse*gResp)[0], s5,
719 s4, s5, (Kunit.transpose()*acInverse*Kunit)[0];
720
721 Eigen::Vector3d Amp;
722 Eigen::Vector3d Atau;
723 Eigen::Vector3d Ktemp;
724 Eigen::Matrix3d isolInv = isol.inverse();
725
726 // we solve for the lagrange multiplers
727 Ktemp[0] = 1.;
728 Ktemp[1] = 0.;
729 Ktemp[2] = 0.;
730 Amp = isolInv*Ktemp;
731
732 Ktemp[0] = 0.;
733 Ktemp[1] = -1.;
734 Ktemp[2] = 0.;
735 Atau = isolInv*Ktemp;
736
737 // we express the a and b vectors in terms of the lagrange multipliers
738 Eigen::VectorXd OFCa = Amp[0]*acInverse*gResp + Amp[1]*acInverse*gDerivResp + Amp[2]*acInverse*Kunit;
739 Eigen::VectorXd OFCb = Atau[0]*acInverse*gResp + Atau[1]*acInverse*gDerivResp + Atau[2]*acInverse*Kunit;
740
741 //Convert back to std::vector
742 vecOFCa.resize(optNpt);
743 vecOFCb.resize(optNpt);
744 for (int i=0;i<optNpt;i++) {
745 vecOFCa[i]=OFCa[i];
746 vecOFCb[i]=OFCb[i];
747 }
748 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

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.

◆ printOFCVec()

void LArOFCAlg::printOFCVec ( const std::vector< float > & vec,
MsgStream & mLog )
staticprivate

Definition at line 972 of file LArOFCAlg.cxx.

972 {
973 mLog << MSG::WARNING << "OFCs";
974 for(float v : vec)
975 mLog << " " << v;
976 mLog << endmsg;
977}
std::vector< size_t > vec

◆ process()

void LArOFCAlg::process ( perChannelData_t & chanData,
const LArOnOffIdMapping * cabling ) const
private

Definition at line 373 of file LArOFCAlg.cxx.

373 {
374
375 LArWaveHelper larWaveHelper;
376 const LArWaveCumul* nextWave=chanData.inputWave;
377 if (!nextWave) {
378 ATH_MSG_ERROR( "input wave is 0" );
379 return;
380 }
381
382 if ( nextWave->getFlag() == LArWave::dac0 ) return ; // skip dac0 waves
383
384 const HWIdentifier ch_id=chanData.chid;
385 const unsigned gain=chanData.gain;
386 ATH_MSG_DEBUG( "Computing OFC for channel " << m_onlineID->channel_name(ch_id) << " in gain = " << gain);
387
388
389 // check constistency of settings
390 if ( m_nPoints > nextWave->getSize() ) {
391 ATH_MSG_ERROR( "Channel " << m_onlineID->channel_name(ch_id) <<": Wave size (" << nextWave->getSize()
392 << ") is too small to fit your OFC request (" << m_nPoints << " points)" ) ;
393 chanData.shortWave=true;
394 return;
395 }
396
397 // the current waveform
398 LArWave aWave = *nextWave; // Actually *copying* the Wave to get rid of the const: need to manipulate Wave to normalize...
399
400 if (m_larPhysWaveBin) {
401 const int bin = m_larPhysWaveBin->bin(ch_id,gain);
402 if (bin>-998) { //>ERRORCODE
403 ATH_MSG_VERBOSE("Channel " << m_onlineID->channel_name(ch_id) << ": shift by index " << bin);
404 aWave=larWaveHelper.translate(aWave,-bin,0);
405 }
406 else
407 ATH_MSG_VERBOSE("Channel 0x" << MSG::hex << ch_id.get_identifier32().get_compact() << MSG::dec << ": No valid index for shifting");
408 }//end if larPhysWaveBin
409
410
411 // normalize input wave, if requested
412 if (m_normalize) {
413 const double peak = aWave.getSample( larWaveHelper.getMax(aWave) );
414 if ( peak == 0 ) {
415 ATH_MSG_ERROR( "Wave maximum is zero, skipping channel " << m_onlineID->channel_name(ch_id) ) ;
416 return;
417 }
418
419 ATH_MSG_VERBOSE("Channel 0x" << m_onlineID->channel_name(ch_id) << " has amplitude = " << peak << ": normalizing...");
420 aWave = aWave * (1./peak);
421 }
422
423 ATH_MSG_VERBOSE("Channel " << m_onlineID->channel_name(ch_id) << " has now amplitude = " << aWave.getSample( larWaveHelper.getMax(aWave)));
424 // compute tstart to shift input wave, if requested
425 if ( m_timeShift ) {
426 if( m_timeShiftByIndex == -1 ) {
427 chanData.tstart = larWaveHelper.getStart(aWave) ;
428 } else {
429 chanData.tstart = m_timeShiftByIndex;
430 }
431 }
432
433 ATH_MSG_DEBUG("Channel" << m_onlineID->channel_name(ch_id) << ", Tstart = " << chanData.tstart);
434
435 //Calculate derivative for this wave
436 LArWave aDerivedWave = larWaveHelper.derive_smooth(aWave);
437
438 chanData.timeBinWidthOFC = m_dPhases*aWave.getDt();
439
440 float maxSampleValAt3=-1;
441
442 //prepare output vectors
443 chanData.ofc_a.resize(m_nPhases);
444 chanData.ofc_b.resize(m_nPhases);
445 chanData.shape.resize(m_nPhases);
446 chanData.shapeDer.resize(m_nPhases);
447
448 if (m_computeV2) {
449 chanData.ofcV2_a.resize(m_nPhases);
450 chanData.ofcV2_b.resize(m_nPhases);
451 }
452
453
454 const Eigen::MatrixXd acInverse=m_AutoCorrDecoder->AutoCorr(chanData.chid,(CaloGain::CaloGain)chanData.gain,m_nSamples).inverse();
455 Eigen::MatrixXd acInverseV2;
456 if (m_computeV2)
457 acInverseV2=m_AutoCorrDecoderV2->AutoCorr(chanData.chid,(CaloGain::CaloGain)chanData.gain,m_nSamples).inverse();
458
459 unsigned tShift=0;
461 if(m_DSPConfig->peakSample(m_onlineID->feb_Id(ch_id)) < 2 ) { // 2 is canonical value for peak
462 tShift = 2 - m_DSPConfig->peakSample(m_onlineID->feb_Id(ch_id));
463 }
464 }
465 if(m_forceShift) tShift=1;
466
467 ATH_MSG_DEBUG("Channel " << m_onlineID->channel_name(ch_id) << "shift: " << tShift);
468
469 for (unsigned iPhase=0;iPhase<m_nPhases;iPhase++) { //Loop over all phases
470
471 ATH_MSG_VERBOSE ("Channel " << m_onlineID->channel_name(ch_id)
472 << ", Gain = " << gain << ", Phase = " << iPhase << ":");
473
474
475 //Reference to the samples and deriviative to be filled
476 std::vector<float>& theSamples=chanData.shape[iPhase];
477 std::vector<float>& theSamplesDer=chanData.shapeDer[iPhase];
478
479 //Extract the points where we compute the OFCs from the wave and the derived wave
480 //and fill the samples an derivative vector
481 theSamples.reserve(m_nSamples);
482 theSamplesDer.reserve(m_nSamples);
483 for (unsigned iSample=0;iSample<m_nSamples;++iSample){ //Loop over all samples
484 const unsigned tbin = chanData.tstart + iPhase*m_dPhases + (iSample+tShift)*m_nDelays ;
485 theSamples.push_back( aWave.getSample(tbin) );
486 theSamplesDer.push_back( aDerivedWave.getSample(tbin) );
487 } //End loop over samples
488
489
490 if (m_storeMaxPhase && m_nSamples>2 && theSamples[2]>maxSampleValAt3) {
491 maxSampleValAt3=theSamples[2];
492 chanData.phasewMaxAt3=iPhase;
493 }
494
495 bool thisChanUseDelta=useDelta(ch_id,m_useDelta,cabling);
496 bool thisChanUseDeltaV2=m_computeV2 && useDelta(ch_id,m_useDeltaV2,cabling);
497 Eigen::VectorXd delta;
498
499 if (thisChanUseDelta || thisChanUseDeltaV2) { // will need delta for at least one of the two versions
500 std::vector<float> theSamples32;
501 theSamples32.reserve(32);
502 for (unsigned iSample=0;iSample<32 ;++iSample){ //Loop over all samples
503 const unsigned tbin = chanData.tstart + iPhase*m_dPhases + (iSample+tShift)*m_nDelays ;
504 if (tbin>=aWave.getSize()) continue;
505 theSamples32.push_back( aWave.getSample(tbin) );
506 } //End loop over samples
507 delta=getDelta(theSamples32,ch_id,m_nSamples);
508 }
509
510 //OFC V1 computiation (i.e. not pileup-optimized)
511 //Reference to the OFCa and OFCb to be filled
512 std::vector<float>& vOFC_a= chanData.ofc_a[iPhase];
513 std::vector<float>& vOFC_b= chanData.ofc_b[iPhase];
514
515 if(m_computePed){
516 optFiltPed(theSamples,theSamplesDer,acInverse,vOFC_a,vOFC_b);
517 } else {
518 if (thisChanUseDelta) {
519 optFiltDelta(theSamples,theSamplesDer,acInverse,delta,vOFC_a,vOFC_b);
520 }
521 else { //don't use Delta
522 optFilt(theSamples,theSamplesDer,acInverse,vOFC_a,vOFC_b);
523 }
524 }
525
526 // verify OFC consistency
527 if (m_verify) {
528 chanData.faultyOFC |= verify(chanData.chid,vOFC_a,vOFC_b,theSamples,"OFC",iPhase);
529 }
530
531
532 if (m_computeV2) {
533 //OFC V2 computiation (i.e. pileup-optimized)
534 //Reference to the OFCa and OFCb to be filled
535 std::vector<float>& vOFCV2_a= chanData.ofcV2_a[iPhase];
536 std::vector<float>& vOFCV2_b= chanData.ofcV2_b[iPhase];
537
538 if(m_computePed){
539 optFiltPed(theSamples,theSamplesDer,acInverseV2,vOFCV2_a,vOFCV2_b);
540 } else {
541 if (thisChanUseDeltaV2) {
542 optFiltDelta(theSamples,theSamplesDer,acInverseV2,delta,vOFCV2_a,vOFCV2_b);
543 }
544 else { //don't use Delta
545 optFilt(theSamples,theSamplesDer,acInverseV2,vOFCV2_a,vOFCV2_b);
546 }
547 }
548
549 // verify OFC consistency
550 if (m_verify) {
551 chanData.faultyOFC |= verify(chanData.chid,vOFCV2_a,vOFCV2_b,theSamples,"OFCV2",iPhase);
552 }
553 }//end if computeV2
554 } //End loop over all phases
555
556 // in case we're dealing with a LArPhysWave, add any possible previous time shift
557 if (!m_readCaliWave) {
558 const LArPhysWave* pwave=dynamic_cast<const LArPhysWave*>(nextWave);
559 if (pwave)
560 chanData.tstart += pwave->getTimeOffset()+m_addOffset;
561 }
562 }
#define ATH_MSG_VERBOSE(x,...)
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
BooleanProperty m_verify
Definition LArOFCAlg.h:125
BooleanProperty m_timeShift
Definition LArOFCAlg.h:127
IntegerProperty m_timeShiftByIndex
Definition LArOFCAlg.h:128
std::unique_ptr< LArDSPConfig > m_DSPConfig
Definition LArOFCAlg.h:168
bool useDelta(const HWIdentifier chid, const int jobOFlag, const LArOnOffIdMapping *cabling) const
BooleanProperty m_readCaliWave
Definition LArOFCAlg.h:149
const LArOFCBinComplete * m_larPhysWaveBin
Definition LArOFCAlg.h:144
static void optFilt(const std::vector< float > &gWave_in, const std::vector< float > &gDerivWave_in, const Eigen::MatrixXd &autoCorrInv, std::vector< float > &OFCa, std::vector< float > &OFCb)
static void optFiltPed(const std::vector< float > &gWave_in, const std::vector< float > &gDerivWave_in, const Eigen::MatrixXd &autoCorrInv, std::vector< float > &OFCa, std::vector< float > &OFCb)
BooleanProperty m_readDSPConfig
Definition LArOFCAlg.h:166
Eigen::VectorXd getDelta(std::vector< float > &samples, const HWIdentifier chid, unsigned nSamples) const
BooleanProperty m_forceShift
Definition LArOFCAlg.h:170
FloatProperty m_addOffset
Definition LArOFCAlg.h:137
BooleanProperty m_storeMaxPhase
Definition LArOFCAlg.h:154
bool verify(const HWIdentifier chid, const std::vector< float > &OFCa, const std::vector< float > &OFCb, const std::vector< float > &Shape, const char *ofcversion, const unsigned phase) const
BooleanProperty m_computePed
Definition LArOFCAlg.h:163
BooleanProperty m_normalize
Definition LArOFCAlg.h:126
static void optFiltDelta(const std::vector< float > &gWave_in, const std::vector< float > &gDerivWave_in, const Eigen::MatrixXd &autoCorrInv, const Eigen::VectorXd &delta, std::vector< float > &vecOFCa, std::vector< float > &vecOFCb)
int getTimeOffset() const
Definition LArPhysWave.h:97
LArWave translate(const LArWave &theWave, int nShift, double baseline=0.) const
LArWave derive_smooth(const LArWave &theWave) const
smoothed derivative
unsigned int getMax(const LArWave &theWave) const
return index of maximum sample
unsigned getStart(const LArWave &theWave) const
size_t getSize() const
number of time samples
Definition LArWave.h:62
const double & getSample(const unsigned int i) const
Amplitude per time bin.
Definition LArWave.h:53
const double & getDt() const
delta time
Definition LArWave.h:50
unsigned getFlag() const
flag: ...
Definition LArWave.h:178

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ stop()

StatusCode LArOFCAlg::stop ( )
virtual

TBB global control parameter

Definition at line 113 of file LArOFCAlg.cxx.

114{
115
116 ATH_MSG_DEBUG( "In LArOFCAlg finalize()");
117
118 ATH_MSG_INFO( "Number of samples : " << m_nSamples ) ;
119 ATH_MSG_INFO( "Number of delays acquired : " << m_nDelays ) ;
120 ATH_MSG_INFO( "Number of phases in OFC : " << m_nPhases ) ;
121 ATH_MSG_INFO( "Spacing between two phases : " << m_dPhases ) ;
122
123
124 const LArOnOffIdMapping* cabling{nullptr};
125 if(m_isSC) {
126 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKeySC};
127 ATH_CHECK(cablingHdl.isValid());
128 cabling = *cablingHdl;
129
130 if (m_useDelta == 3 || m_useDeltaV2==3){
131 SG::ReadCondHandle<CaloSuperCellDetDescrManager> caloSuperCellMgrHandle{m_caloSuperCellMgrKey};
132 ATH_CHECK(caloSuperCellMgrHandle.isValid());
133 m_calo_dd_man = *caloSuperCellMgrHandle;
134 }
135 }
136 else {
137 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
138 ATH_CHECK(cablingHdl.isValid());
139 cabling = *cablingHdl;
140
141 if (m_useDelta == 3 || m_useDeltaV2==3){
142 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
143 ATH_CHECK(caloMgrHandle.isValid());
144 m_calo_dd_man = *caloMgrHandle;
145 }
146 }
147
148 if ( m_timeShift ) {
149 if( m_timeShiftByIndex == -1 ) {
150 ATH_MSG_INFO( " Will use helper class for start time." );
151 } else {
152 ATH_MSG_INFO( " Manually shifting pulses by time index " << m_timeShiftByIndex );
153 }
154 }
155
156 if (!m_larPhysWaveBinKey.empty()) {
158 }
159
160 if (m_readCaliWave) {
162 }
163 else {
164 ATH_CHECK(this->initPhysWaveContainer(cabling));
165 }
166
167 if (m_readDSPConfig) {
168 const AthenaAttributeList* attrList=nullptr;
169 ATH_CHECK(detStore()->retrieve(attrList, m_DSPConfigFolder));
170
171 const coral::Blob& blob = (attrList->coralList())["febdata"].data<coral::Blob>();
172 if (blob.size()<3) {
173 ATH_MSG_INFO( "Found empty blob, nothing to do");
174 } else {
175 m_DSPConfig = std::make_unique<LArDSPConfig>(attrList);
176 }
177 }
178
179 if (m_allChannelData.empty()) {
180 ATH_MSG_ERROR( "No input waves found" );
181 return StatusCode::FAILURE;
182 }
183
185 if (m_nThreads>-1) {
186 //There are sone external tools, etc. that potentially cached stuff.
187 //We need to call them at least once to make sure all caches are filled before we go multi-threaded
189
190 m_AutoCorrDecoder->AutoCorr(chanData.chid,(CaloGain::CaloGain)chanData.gain,m_nSamples);
191 if (m_computeV2)
192 m_AutoCorrDecoderV2->AutoCorr(chanData.chid,(CaloGain::CaloGain)chanData.gain,m_nSamples);
193
194 Identifier id=cabling->cnvToIdentifier(chanData.chid);
195 if (m_useDelta==3 || m_useDeltaV2) {
196 m_calo_dd_man->get_element(id);
197 }
198
199 std::ignore = m_onlineID->isFCALchannel(chanData.chid);
200
201
202 if (!m_larPhysWaveBinKey.empty()) {
203 m_larPhysWaveBin->bin(chanData.chid,(CaloGain::CaloGain)chanData.gain);
204 }
206 std::unique_ptr<tbb::global_control> tbbgc;
207
208 if (m_nThreads>0) {
209 tbbgc=std::make_unique<tbb::global_control>( tbb::global_control::max_allowed_parallelism, m_nThreads);
210 }
211
212 //Instanciated the functor and start parallel_for
213 Looper looper(&m_allChannelData,cabling, this);
214 tbb::blocked_range<size_t> range(0, m_allChannelData.size());
215 ATH_MSG_INFO( "Starting parallel execution" );
216 tbb::parallel_for(tbb::blocked_range<size_t>(0, m_allChannelData.size()),looper);
217
218 ATH_MSG_INFO( "Done with parallel execution" );
219
220 }
221 else {
222 ATH_MSG_INFO( "Single threaded execution" );
223 for (perChannelData_t& chanData : m_allChannelData) {
224 this->process(chanData,cabling);
225 }
226 }
227
229
230 // OFC persistent object
231 std::unique_ptr<LArOFCComplete> larOFCComplete=std::make_unique<LArOFCComplete>();
232 StatusCode sc = larOFCComplete->setGroupingType(m_groupingType,msg());
233 if (sc.isFailure()) {
234 ATH_MSG_ERROR( "Failed to set groupingType for LArOFCComplete object" );
235 return sc;
236 }
237 sc=larOFCComplete->initialize();
238 if (sc.isFailure()) {
239 ATH_MSG_ERROR( "Failed initialize LArOFCComplete object" );
240 return sc;
241 }
242
243
244 std::unique_ptr<LArOFCComplete> larOFCCompleteV2=std::make_unique<LArOFCComplete>();
245 sc = larOFCComplete->setGroupingType(m_groupingType,msg());
246 if (sc.isFailure()) {
247 ATH_MSG_ERROR( "Failed to set groupingType for LArOFCComplete object" );
248 return sc;
249 }
250 sc=larOFCCompleteV2->initialize();
251 if (sc.isFailure()) {
252 ATH_MSG_ERROR( "Failed initialize LArOFCComplete object" );
253 return sc;
254 }
255
256
257 std::unique_ptr<LArOFCBinComplete> larOFCBinComplete;
258 if (m_storeMaxPhase) {
259 larOFCBinComplete=std::make_unique<LArOFCBinComplete>();
260 sc=larOFCBinComplete->setGroupingType(m_groupingType,msg());
261 if (sc.isFailure()) {
262 ATH_MSG_ERROR( "Failed to set groupingType for LArOFCBinComplete object" );
263 return sc;
264 }
265 sc = larOFCBinComplete->initialize();
266 if ( sc.isFailure() ) {
267 ATH_MSG_ERROR( "Could not initialize LArOFCComplete data object - exit!" ) ;
268 return sc ;
269 }
270 }
271
272 // LArShape persistent object
273 std::unique_ptr<LArShapeComplete> larShapeComplete;
274 if (m_fillShape) {
275 larShapeComplete = std::make_unique<LArShapeComplete>();
276 sc=larShapeComplete->setGroupingType(m_groupingType,msg());
277 if (sc.isFailure()) {
278 ATH_MSG_ERROR( "Failed to set groupingType for LArShapeComplete object" );
279 return sc;
280 }
281 sc=larShapeComplete->initialize();
282 if (sc.isFailure()) {
283 ATH_MSG_ERROR( "Failed initialize LArShapeComplete object" );
284 return sc;
285 }
286 }
287
288
289 //Counters (for information only):
290 unsigned nChannels=0;
291 unsigned nFailed=0;
292
293 for (const perChannelData_t& chanData : m_allChannelData) {
294 ++nChannels;
295 if (chanData.faultyOFC) ++nFailed;
296 // register channel to LArOFCComplete
297 const HWIdentifier ch_id=chanData.chid;
298 const int gain=chanData.gain;
299 ATH_MSG_DEBUG( "add to LArOFCComplete, channel " << m_onlineID->channel_name(ch_id) << ", gain=" << (int)gain);
300 const std::vector<std::vector<float> > & allPhaseOFCa=chanData.ofc_a;
301 const std::vector<std::vector<float> > & allPhaseOFCb=chanData.ofc_b;
302 const std::vector<std::vector<float> > & allPhaseShape=chanData.shape;
303 const std::vector<std::vector<float> > & allPhaseShapeDer=chanData.shapeDer;
304 larOFCComplete->set(ch_id,gain,allPhaseOFCa,allPhaseOFCb,chanData.tstart,chanData.timeBinWidthOFC);
305 if (larOFCBinComplete) larOFCBinComplete->set(ch_id,gain,chanData.phasewMaxAt3);
306 if ( m_fillShape ) larShapeComplete->set(ch_id,gain,allPhaseShape,allPhaseShapeDer,chanData.tstart,chanData.timeBinWidthOFC);
307
308
309 if (m_computeV2) {
310 const std::vector<std::vector<float> > & allPhaseOFCV2a=chanData.ofcV2_a;
311 const std::vector<std::vector<float> > & allPhaseOFCV2b=chanData.ofcV2_b;
312 larOFCCompleteV2->set(ch_id,gain,allPhaseOFCV2a,allPhaseOFCV2b,chanData.tstart,chanData.timeBinWidthOFC);
313 }
314
315 } // end loop over m_allChannelData
316
317 ATH_MSG_INFO( " Summary : Computed OFCs for " << nChannels << " channels * gains" );
318 if (nFailed)
319 ATH_MSG_ERROR( "Number of channels * gains with failed OFC verification: " << nFailed );
320
321 if ( !m_dumpOFCfile.empty()) {
322 ATH_MSG_INFO( "Dumping OFCs to file " << m_dumpOFCfile ) ;
323 larOFCComplete->dumpOFC(m_dumpOFCfile) ;
324 }
325
326 sc = detStore()->record(std::move(larOFCComplete),m_ofcKey);
327 if (sc.isFailure()) {
328 ATH_MSG_ERROR( "Could not record LArOFCComplete to DetStore with key " << m_ofcKey );
329 return StatusCode::FAILURE;
330 }
331 ATH_MSG_INFO( "LArOFCComplete object recorded with key " << m_ofcKey ) ;
332
333 // record second version of LArOFCComplete object
334 if (m_computeV2) {
335 sc = detStore()->record(std::move(larOFCCompleteV2),m_ofcKeyV2);
336 if (sc.isFailure()) {
337 ATH_MSG_ERROR( "Could not record LArOFCComplete to DetStore with key " << m_ofcKeyV2 );
338 return StatusCode::FAILURE;
339 }
340 ATH_MSG_INFO( "LArOFCComplete object recorded with key " << m_ofcKeyV2 ) ;
341 }
342
343 if (larOFCBinComplete) {
344 sc = detStore()->record(std::move(larOFCBinComplete),m_ofcBinKey);
345 if (sc.isFailure()) {
346 ATH_MSG_ERROR( "Could not record LArOFCBinCompete object" );
347 return StatusCode::FAILURE;
348 }
349 }
350
351 // record LArShapeComplete object
352 if ( m_fillShape ) {
353 ATH_MSG_DEBUG( "Trying to record LArShapeComplete object to detector store, key = " << m_shapeKey);
354 sc = detStore()->record(std::move(larShapeComplete),m_shapeKey);
355 if (sc.isFailure()) {
356 ATH_MSG_ERROR( "Could not record LArShapeComplete to DetStore with key " << m_shapeKey );
357 return StatusCode::FAILURE;
358 }
359 ATH_MSG_INFO( "LArShapeComplete object recorded to DetStore successfully with key " << m_shapeKey ) ;
360 }
361
362
363 //Undo corrections, if they are applied by this algo:
364 if (m_waveCnt_nc) {
365 ATH_CHECK(m_waveCnt_nc->undoCorrections());
366 ATH_MSG_INFO("Reverted corrections of non-cost wave container");
367 }
368
369 return StatusCode::SUCCESS;
370}
StatusCode initCaliWaveContainer()
const CaloDetDescrManager_Base * m_calo_dd_man
Definition LArOFCAlg.h:142
StringProperty m_ofcBinKey
Definition LArOFCAlg.h:155
BooleanProperty m_fillShape
Definition LArOFCAlg.h:150
StatusCode initPhysWaveContainer(const LArOnOffIdMapping *cabling)
StringProperty m_DSPConfigFolder
Definition LArOFCAlg.h:167
StringProperty m_larPhysWaveBinKey
Definition LArOFCAlg.h:158
StringProperty m_shapeKey
Definition LArOFCAlg.h:153
StringProperty m_dumpOFCfile
Definition LArOFCAlg.h:123
StringProperty m_groupingType
Definition LArOFCAlg.h:157
IntegerProperty m_nThreads
Definition LArOFCAlg.h:164
const std::string process
unsigned int constexpr nChannels
Definition RPDUtils.h:23

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_WARNING(x,...)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

◆ useDelta()

bool LArOFCAlg::useDelta ( const HWIdentifier chid,
const int jobOFlag,
const LArOnOffIdMapping * cabling ) const
private

Definition at line 880 of file LArOFCAlg.cxx.

880 {
881
882 if (jobOFlag==2){
883 return true;
884 }
885
886 if(jobOFlag==1) { // only HEC/EMECIW/FCAL
887 if (m_onlineID->isEMECIW(chid) || m_onlineID->isFCALchannel(chid) || m_onlineID->isHECchannel(chid)) {
888 return true;
889 }
890 }
891
892 if(jobOFlag==3) { // only HEC/EMECIW/FCAL1 and high eta FCAL2-3
893 if (m_onlineID->isEMECIW(chid) || m_onlineID->isHECchannel(chid)) {
894 return true;
895 }
896 else if (m_onlineID->isFCALchannel(chid) ){
897
898 if (cabling->isOnlineConnected (chid)){
899 Identifier ofl_id = cabling->cnvToIdentifier(chid);
900 const CaloDetDescrElement* dde = m_calo_dd_man->get_element(ofl_id);
901 if (! dde) {
902 ATH_MSG_ERROR( " dde = 0 , onl_id, ofl_id= "<< chid<<" "<<ofl_id );
903 return false; // Exception better?
904 }
905 if ( m_isSC ) {
907 if (sampling==CaloCell_ID::FCAL0){
908 return true;
909 }
910 else {
911 if (fabs(dde->eta())>4.0){
912 return true;
913 }
914 }
915 } else {
916 CaloCell_ID::CaloSample sampling = dde->getSampling();
917 if (sampling==CaloCell_ID::FCAL0){
918 return true;
919 }
920 else {
921 if (fabs(dde->eta())>4.0){
922 return true;
923 }
924 }
925 }
926
927 }//end if connected
928 }//end if isFCALchannel
929
930 }//else if jobOFlag=3
931
932 return false;
933}
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
CaloCell_ID::CaloSample getSampling() const
cell sampling

◆ verify()

bool LArOFCAlg::verify ( const HWIdentifier chid,
const std::vector< float > & OFCa,
const std::vector< float > & OFCb,
const std::vector< float > & Shape,
const char * ofcversion,
const unsigned phase ) const
private

Definition at line 936 of file LArOFCAlg.cxx.

937 {
938
939 bool result=false;
940 float recAmpl=0, recTime=0;
941 for (unsigned iSample=0;iSample<m_nSamples;++iSample){
942
943#ifdef LAROFCALG_DEBUGOUTPUT
944 ATH_MSG_VERBOSE("a["<<iSample<<"]="<<vOFC_a[iSample] << " b["<<iSample<<"]="<<vOFC_b[iSample]
945 << " Sample=" << aWave.getSample(tbin));
946#endif
947 recAmpl += OFCa[iSample] * Shape[iSample];
948 recTime += OFCb[iSample] * Shape[iSample];
949 } //End loop over samples
950
951 if (recAmpl != 0) {
952 recTime /= recAmpl ;
953 }
954
955 // At this point the reconstructed amplitude must be = 1 by definition, whatever the initial normalisation!
956 ATH_MSG_VERBOSE("recAmp=" << recAmpl << " ; recTime=" << recTime);
957 if ( fabs(1.-recAmpl) > m_errAmpl ) {
958 ATH_MSG_WARNING( "Applying phase " << phase << " of " << ofcversion << " to original wave yields an Amplitude of "<< recAmpl
959 << " instead of 1. -> Wrong OFCs? channel " << m_onlineID->channel_name(chid) );
961 result=true;
962 }
963 if ( fabs(recTime) > m_errTime ) {
964 ATH_MSG_WARNING( "Applying phase " << phase << " of " << ofcversion << " to original wave yields a time offset of " << recTime
965 << " -> Wrong OFCs? channel " << m_onlineID->channel_name(chid) );
967 result=true;
968 }
969 return result;
970}
DoubleProperty m_errAmpl
Definition LArOFCAlg.h:146
DoubleProperty m_errTime
Definition LArOFCAlg.h:147
static void printOFCVec(const std::vector< float > &vec, MsgStream &mLog)

Member Data Documentation

◆ m_addOffset

FloatProperty LArOFCAlg::m_addOffset {this, "AddTimeOffset", 0., "Time offset to add"}
private

Definition at line 137 of file LArOFCAlg.h.

137{this, "AddTimeOffset", 0., "Time offset to add"} ;

◆ m_allChannelData

std::vector<perChannelData_t> LArOFCAlg::m_allChannelData
private

Definition at line 94 of file LArOFCAlg.h.

◆ m_AutoCorrDecoder

ToolHandle<ILArAutoCorrDecoderTool> LArOFCAlg::m_AutoCorrDecoder {this,"DecoderTool",{} }
private

Definition at line 139 of file LArOFCAlg.h.

139{this,"DecoderTool",{} };

◆ m_AutoCorrDecoderV2

ToolHandle<ILArAutoCorrDecoderTool> LArOFCAlg::m_AutoCorrDecoderV2 {this,"DecoderToolV2", {} }
private

Definition at line 140 of file LArOFCAlg.h.

140{this,"DecoderToolV2", {} };

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> LArOFCAlg::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 52 of file LArOFCAlg.h.

52{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_cablingKeySC

SG::ReadCondHandleKey<LArOnOffIdMapping> LArOFCAlg::m_cablingKeySC {this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"}
private

Definition at line 53 of file LArOFCAlg.h.

53{this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"};

◆ m_calo_dd_man

const CaloDetDescrManager_Base* LArOFCAlg::m_calo_dd_man {}
private

Definition at line 142 of file LArOFCAlg.h.

142{};

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> LArOFCAlg::m_caloMgrKey
private
Initial value:
{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }

Definition at line 55 of file LArOFCAlg.h.

55 { this
56 , "CaloDetDescrManager"
57 , "CaloDetDescrManager"
58 , "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_caloSuperCellMgrKey

SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> LArOFCAlg::m_caloSuperCellMgrKey
private
Initial value:
{ this
, "CaloSuperCellDetDescrManager"
, "CaloSuperCellDetDescrManager"
, "SG Key for CaloSuperCellDetDescrManager in the Condition Store" }

Definition at line 60 of file LArOFCAlg.h.

60 { this
61 , "CaloSuperCellDetDescrManager"
62 , "CaloSuperCellDetDescrManager"
63 , "SG Key for CaloSuperCellDetDescrManager in the Condition Store" };

◆ m_computePed

BooleanProperty LArOFCAlg::m_computePed {this, "ComputeOFCPed", false, "Compute OFCs with additional constraint to pedestal?"}
private

Definition at line 163 of file LArOFCAlg.h.

163{this, "ComputeOFCPed", false, "Compute OFCs with additional constraint to pedestal?"};

◆ m_computeV2

BooleanProperty LArOFCAlg::m_computeV2 {this, "ComputeOFCV2", false, "Compute pileup OFCs?"}
private

Definition at line 162 of file LArOFCAlg.h.

162{this, "ComputeOFCV2", false, "Compute pileup OFCs?"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dPhases

UnsignedIntegerProperty LArOFCAlg::m_dPhases {this, "Dphase", 1, "Number of samples between two neighboring phases (OFC sets)"}
private

Definition at line 135 of file LArOFCAlg.h.

135{this, "Dphase", 1, "Number of samples between two neighboring phases (OFC sets)"};

◆ m_DSPConfig

std::unique_ptr<LArDSPConfig> LArOFCAlg::m_DSPConfig
private

Definition at line 168 of file LArOFCAlg.h.

◆ m_DSPConfigFolder

StringProperty LArOFCAlg::m_DSPConfigFolder {this,"DSPConfigFolder","/LAR/Configuration/DSPConfiguration", "Folder for DSPConfig object"}
private

Definition at line 167 of file LArOFCAlg.h.

167{this,"DSPConfigFolder","/LAR/Configuration/DSPConfiguration", "Folder for DSPConfig object"};

◆ m_dumpOFCfile

StringProperty LArOFCAlg::m_dumpOFCfile {this, "DumpOFCfile", ""}
private

Definition at line 123 of file LArOFCAlg.h.

123{this, "DumpOFCfile", ""};

◆ m_errAmpl

DoubleProperty LArOFCAlg::m_errAmpl {this, "ErrAmplitude", 0.01, "Allowed amplitude difference in check"}
private

Definition at line 146 of file LArOFCAlg.h.

146{this, "ErrAmplitude", 0.01, "Allowed amplitude difference in check"};

◆ m_errTime

DoubleProperty LArOFCAlg::m_errTime {this, "ErrTime", 0.01, "Allowed time difference in check"}
private

Definition at line 147 of file LArOFCAlg.h.

147{this, "ErrTime", 0.01, "Allowed time difference in check"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fcal1Delta

const float LArOFCAlg::m_fcal1Delta ={0.0679600232979, -0.139479996869, 0.0679600232979, -0.139479996869, 0.0679600232979}
staticprivate

Definition at line 829 of file LArOFCAlg.h.

867:public AthAlgorithm {
868 //Acutally this algo can do internal multi-threading at finalize
869 //but not the way regular athenaMT works, so the thread-safety checker complains
870public:
871
872 LArOFCAlg (const std::string& name, ISvcLocator* pSvcLocator);
874 StatusCode execute(const EventContext&) {return StatusCode::SUCCESS;}
875 virtual StatusCode stop();
876 StatusCode finalize(){return StatusCode::SUCCESS;}
877
878private:
879
880 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
881 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKeySC{this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"};
882
883 SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
884 , "CaloDetDescrManager"
885 , "CaloDetDescrManager"
886 , "SG Key for CaloDetDescrManager in the Condition Store" };
887
888 SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> m_caloSuperCellMgrKey { this
889 , "CaloSuperCellDetDescrManager"
890 , "CaloSuperCellDetDescrManager"
891 , "SG Key for CaloSuperCellDetDescrManager in the Condition Store" };
892
893 struct perChannelData_t {
894 //Input:
895 const LArWaveCumul* inputWave;
896 HWIdentifier chid;
897 unsigned gain;
898
899 //Output:
900 std::vector<std::vector<float> > ofc_a;
901 std::vector<std::vector<float> > ofc_b;
902
903 std::vector<std::vector<float> > ofcV2_a;
904 std::vector<std::vector<float> > ofcV2_b;
905
906 std::vector<std::vector<float> >shape;
907 std::vector<std::vector<float> >shapeDer;
908
909 float tstart;
910 float timeBinWidthOFC;
911 unsigned phasewMaxAt3;
912 bool faultyOFC;
913 bool shortWave;
914
915
916 perChannelData_t(const LArWaveCumul* wave, const HWIdentifier hi, const unsigned g) :
917 inputWave(wave), chid(hi), gain(g),tstart(0), timeBinWidthOFC(25./24), phasewMaxAt3(0), faultyOFC(false), shortWave(false) {};
918
919 };
920
921
922 std::vector<perChannelData_t> m_allChannelData;
923
924 static void optFilt(const std::vector<float> &gWave_in, const std::vector<float> &gDerivWave_in, const Eigen::MatrixXd& autoCorrInv, //input variables
925 std::vector<float>& OFCa, std::vector<float>& OFCb // Output variables;
926 ) ;
927
928 static void optFiltDelta(const std::vector<float> &gWave_in, const std::vector<float> &gDerivWave_in, const Eigen::MatrixXd& autoCorrInv,
929 const Eigen::VectorXd& delta, //input variables
930 std::vector<float>& vecOFCa, std::vector<float>& vecOFCb // Output variables;
931 ) ;
932
933 static void optFiltPed(const std::vector<float> &gWave_in, const std::vector<float> &gDerivWave_in, const Eigen::MatrixXd& autoCorrInv, //input variables
934 std::vector<float>& OFCa, std::vector<float>& OFCb // Output variables;
935 ) ;
936
937 void process(perChannelData_t&, const LArOnOffIdMapping* cabling) const;
938
939
940 bool verify(const HWIdentifier chid, const std::vector<float>& OFCa, const std::vector<float>& OFCb,
941 const std::vector<float>& Shape, const char* ofcversion, const unsigned phase) const;
942
943 static void printOFCVec(const std::vector<float>& vec, MsgStream& mLog) ;
944
945
946 StatusCode initPhysWaveContainer(const LArOnOffIdMapping* cabling);
948
949 unsigned int m_nPoints{0};
950
951 StringProperty m_dumpOFCfile{this, "DumpOFCfile", ""};
952 StringArrayProperty m_keylist{this, "KeyList", {}, "List of keys to process"};
953 BooleanProperty m_verify{this, "Verify", true, "Verufy OFCs after computation"};
954 BooleanProperty m_normalize{this, "Normalize", false, "Normalize input wave"};
955 BooleanProperty m_timeShift{this, "TimeShift", false, "Shifting input wave"};
956 IntegerProperty m_timeShiftByIndex{this, "TimeShiftByIndex", -1, "shifting by n bins input wave"} ;
957
958
959 LArCaliWaveContainer* m_waveCnt_nc=nullptr;
960
961 UnsignedIntegerProperty m_nSamples{this, "Nsample", 5, "How many sample to compute"};
962 UnsignedIntegerProperty m_nPhases{this, "Nphase", 50, "How many sphases to compute"};
963 UnsignedIntegerProperty m_dPhases{this, "Dphase", 1, "Number of samples between two neighboring phases (OFC sets)"};
964 UnsignedIntegerProperty m_nDelays{this, "Ndelay", 24, "Number of delays in one clock"};
965 FloatProperty m_addOffset{this, "AddTimeOffset", 0., "Time offset to add"} ;
966
967 ToolHandle<ILArAutoCorrDecoderTool> m_AutoCorrDecoder{this,"DecoderTool",{} };
968 ToolHandle<ILArAutoCorrDecoderTool> m_AutoCorrDecoderV2{this,"DecoderToolV2", {} };
969
970 const CaloDetDescrManager_Base* m_calo_dd_man{};
971 const LArOnlineID_Base* m_onlineID{};
972 const LArOFCBinComplete* m_larPhysWaveBin{};
973
974 DoubleProperty m_errAmpl{this, "ErrAmplitude", 0.01, "Allowed amplitude difference in check"};
975 DoubleProperty m_errTime{this, "ErrTime", 0.01, "Allowed time difference in check"};
976
977 BooleanProperty m_readCaliWave{this, "ReadCaliWave", true, "If false PhysWave is input"};
978 BooleanProperty m_fillShape{this, "FillShape", false, "Fill also shape object"};
979 StringProperty m_ofcKey{this, "KeyOFC", "LArOFC", "Output key non-pileup OFCs"};
980 StringProperty m_ofcKeyV2{this, "KeyOFCV2", "LArOFCV2", "Output key pileup OFCs"};
981 StringProperty m_shapeKey{this, "KeyShape", "LArShape", "Output key Shape object"};
982 BooleanProperty m_storeMaxPhase{this,"StoreMaxPhase", false, "Store phase of input wave max.?"};
983 StringProperty m_ofcBinKey{this, "LArOFCBinKey", "LArOFCPhase","Key for storing OFCBin object for MAx phase"};
984
985 StringProperty m_groupingType{this, "GroupingType", "SubDetector","Which grouping type to use"};
986 StringProperty m_larPhysWaveBinKey{this,"LArPhysWaveBinKey", "", "Key for object to choose bin"};
987
988 IntegerProperty m_useDelta{this, "UseDelta", 0, "0= not use Delta, 1=only EMECIW/HEC/FCAL, 2=all , 3 = only EMECIW/HEC/FCAL1+high eta FCAL2-3"};
989 IntegerProperty m_useDeltaV2{this, "UseDeltaV2", 0, "Same af before for Delta"};
990 BooleanProperty m_computeV2{this, "ComputeOFCV2", false, "Compute pileup OFCs?"};
991 BooleanProperty m_computePed{this, "ComputeOFCPed", false, "Compute OFCs with additional constraint to pedestal?"};
992 IntegerProperty m_nThreads{this, "nThreads", -1, "-1: No TBB, 0: Let TBB decide, >0 number of threads"};
993
994 BooleanProperty m_readDSPConfig{this, "ReadDSPConfig", false, "Read DSPConfig object ?"};
995 StringProperty m_DSPConfigFolder{this,"DSPConfigFolder","/LAR/Configuration/DSPConfiguration", "Folder for DSPConfig object"};
996 std::unique_ptr<LArDSPConfig> m_DSPConfig;
997
998 BooleanProperty m_forceShift{this, "ForceShift", false, "Forcing shift of input wave ?"};
999
1000 BooleanProperty m_isSC{this, "isSC", false, "Running on cells or supercells?"};
1001
1002 Eigen::VectorXd getDelta(std::vector<float>& samples, const HWIdentifier chid, unsigned nSamples) const;
1003
1004
1005
1006 bool useDelta(const HWIdentifier chid, const int jobOFlag, const LArOnOffIdMapping* cabling) const;
1007
1008 static const float m_fcal3Delta[5];
1009 static const float m_fcal2Delta[5];
1010 static const float m_fcal1Delta[5];
1011
1012
1013 //Functor for processing with TBB
1015 //The way this class gets used is actually thread-safe
1016 public:
1017 Looper(std::vector<perChannelData_t>* p, const LArOnOffIdMapping* cabling, const LArOFCAlg* a) : m_perChanData(p), m_cabling(cabling), m_ofcAlg(a) {};
1018 void operator() (tbb::blocked_range<size_t>& r) const {
1019 for (size_t i=r.begin();i!=r.end();++i) {
1020 m_ofcAlg->process(m_perChanData->at(i),m_cabling);
1021 }
1022 }
1023 private:
1024 std::vector<perChannelData_t>* m_perChanData;
1025 const LArOnOffIdMapping* m_cabling;
1026 const LArOFCAlg* m_ofcAlg;
1027 };
1028};
1029
1030
1031#endif
1032
static Double_t a
void operator()(T1)
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
StatusCode execute(const EventContext &)
Execute method.
Definition LArOFCAlg.h:46
StatusCode initialize()
Definition LArOFCAlg.cxx:46
StatusCode finalize()
Definition LArOFCAlg.h:48
virtual StatusCode stop()
LArOFCAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition LArOFCAlg.cxx:40
int r
Definition globals.cxx:22
std::vector< std::vector< float > > ofcV2_a
Definition LArOFCAlg.h:75
perChannelData_t(const LArWaveCumul *wave, const HWIdentifier hi, const unsigned g)
Definition LArOFCAlg.h:88
std::vector< std::vector< float > > ofc_b
Definition LArOFCAlg.h:73
std::vector< std::vector< float > > shapeDer
Definition LArOFCAlg.h:79
std::vector< std::vector< float > > ofcV2_b
Definition LArOFCAlg.h:76
std::vector< std::vector< float > > shape
Definition LArOFCAlg.h:78
std::vector< std::vector< float > > ofc_a
Definition LArOFCAlg.h:72
const LArWaveCumul * inputWave
Definition LArOFCAlg.h:67

◆ m_fcal2Delta

const float LArOFCAlg::m_fcal2Delta ={-0.01589001104, -0.0740399733186, -0.01589001104, -0.0740399733186, -0.01589001104}
staticprivate

Definition at line 828 of file LArOFCAlg.h.

866:public AthAlgorithm {
867 //Acutally this algo can do internal multi-threading at finalize
868 //but not the way regular athenaMT works, so the thread-safety checker complains
869public:
870
871 LArOFCAlg (const std::string& name, ISvcLocator* pSvcLocator);
873 StatusCode execute(const EventContext&) {return StatusCode::SUCCESS;}
874 virtual StatusCode stop();
875 StatusCode finalize(){return StatusCode::SUCCESS;}
876
877private:
878
879 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
880 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKeySC{this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"};
881
882 SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
883 , "CaloDetDescrManager"
884 , "CaloDetDescrManager"
885 , "SG Key for CaloDetDescrManager in the Condition Store" };
886
887 SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> m_caloSuperCellMgrKey { this
888 , "CaloSuperCellDetDescrManager"
889 , "CaloSuperCellDetDescrManager"
890 , "SG Key for CaloSuperCellDetDescrManager in the Condition Store" };
891
892 struct perChannelData_t {
893 //Input:
894 const LArWaveCumul* inputWave;
895 HWIdentifier chid;
896 unsigned gain;
897
898 //Output:
899 std::vector<std::vector<float> > ofc_a;
900 std::vector<std::vector<float> > ofc_b;
901
902 std::vector<std::vector<float> > ofcV2_a;
903 std::vector<std::vector<float> > ofcV2_b;
904
905 std::vector<std::vector<float> >shape;
906 std::vector<std::vector<float> >shapeDer;
907
908 float tstart;
909 float timeBinWidthOFC;
910 unsigned phasewMaxAt3;
911 bool faultyOFC;
912 bool shortWave;
913
914
915 perChannelData_t(const LArWaveCumul* wave, const HWIdentifier hi, const unsigned g) :
916 inputWave(wave), chid(hi), gain(g),tstart(0), timeBinWidthOFC(25./24), phasewMaxAt3(0), faultyOFC(false), shortWave(false) {};
917
918 };
919
920
921 std::vector<perChannelData_t> m_allChannelData;
922
923 static void optFilt(const std::vector<float> &gWave_in, const std::vector<float> &gDerivWave_in, const Eigen::MatrixXd& autoCorrInv, //input variables
924 std::vector<float>& OFCa, std::vector<float>& OFCb // Output variables;
925 ) ;
926
927 static void optFiltDelta(const std::vector<float> &gWave_in, const std::vector<float> &gDerivWave_in, const Eigen::MatrixXd& autoCorrInv,
928 const Eigen::VectorXd& delta, //input variables
929 std::vector<float>& vecOFCa, std::vector<float>& vecOFCb // Output variables;
930 ) ;
931
932 static void optFiltPed(const std::vector<float> &gWave_in, const std::vector<float> &gDerivWave_in, const Eigen::MatrixXd& autoCorrInv, //input variables
933 std::vector<float>& OFCa, std::vector<float>& OFCb // Output variables;
934 ) ;
935
936 void process(perChannelData_t&, const LArOnOffIdMapping* cabling) const;
937
938
939 bool verify(const HWIdentifier chid, const std::vector<float>& OFCa, const std::vector<float>& OFCb,
940 const std::vector<float>& Shape, const char* ofcversion, const unsigned phase) const;
941
942 static void printOFCVec(const std::vector<float>& vec, MsgStream& mLog) ;
943
944
945 StatusCode initPhysWaveContainer(const LArOnOffIdMapping* cabling);
947
948 unsigned int m_nPoints{0};
949
950 StringProperty m_dumpOFCfile{this, "DumpOFCfile", ""};
951 StringArrayProperty m_keylist{this, "KeyList", {}, "List of keys to process"};
952 BooleanProperty m_verify{this, "Verify", true, "Verufy OFCs after computation"};
953 BooleanProperty m_normalize{this, "Normalize", false, "Normalize input wave"};
954 BooleanProperty m_timeShift{this, "TimeShift", false, "Shifting input wave"};
955 IntegerProperty m_timeShiftByIndex{this, "TimeShiftByIndex", -1, "shifting by n bins input wave"} ;
956
957
958 LArCaliWaveContainer* m_waveCnt_nc=nullptr;
959
960 UnsignedIntegerProperty m_nSamples{this, "Nsample", 5, "How many sample to compute"};
961 UnsignedIntegerProperty m_nPhases{this, "Nphase", 50, "How many sphases to compute"};
962 UnsignedIntegerProperty m_dPhases{this, "Dphase", 1, "Number of samples between two neighboring phases (OFC sets)"};
963 UnsignedIntegerProperty m_nDelays{this, "Ndelay", 24, "Number of delays in one clock"};
964 FloatProperty m_addOffset{this, "AddTimeOffset", 0., "Time offset to add"} ;
965
966 ToolHandle<ILArAutoCorrDecoderTool> m_AutoCorrDecoder{this,"DecoderTool",{} };
967 ToolHandle<ILArAutoCorrDecoderTool> m_AutoCorrDecoderV2{this,"DecoderToolV2", {} };
968
969 const CaloDetDescrManager_Base* m_calo_dd_man{};
970 const LArOnlineID_Base* m_onlineID{};
971 const LArOFCBinComplete* m_larPhysWaveBin{};
972
973 DoubleProperty m_errAmpl{this, "ErrAmplitude", 0.01, "Allowed amplitude difference in check"};
974 DoubleProperty m_errTime{this, "ErrTime", 0.01, "Allowed time difference in check"};
975
976 BooleanProperty m_readCaliWave{this, "ReadCaliWave", true, "If false PhysWave is input"};
977 BooleanProperty m_fillShape{this, "FillShape", false, "Fill also shape object"};
978 StringProperty m_ofcKey{this, "KeyOFC", "LArOFC", "Output key non-pileup OFCs"};
979 StringProperty m_ofcKeyV2{this, "KeyOFCV2", "LArOFCV2", "Output key pileup OFCs"};
980 StringProperty m_shapeKey{this, "KeyShape", "LArShape", "Output key Shape object"};
981 BooleanProperty m_storeMaxPhase{this,"StoreMaxPhase", false, "Store phase of input wave max.?"};
982 StringProperty m_ofcBinKey{this, "LArOFCBinKey", "LArOFCPhase","Key for storing OFCBin object for MAx phase"};
983
984 StringProperty m_groupingType{this, "GroupingType", "SubDetector","Which grouping type to use"};
985 StringProperty m_larPhysWaveBinKey{this,"LArPhysWaveBinKey", "", "Key for object to choose bin"};
986
987 IntegerProperty m_useDelta{this, "UseDelta", 0, "0= not use Delta, 1=only EMECIW/HEC/FCAL, 2=all , 3 = only EMECIW/HEC/FCAL1+high eta FCAL2-3"};
988 IntegerProperty m_useDeltaV2{this, "UseDeltaV2", 0, "Same af before for Delta"};
989 BooleanProperty m_computeV2{this, "ComputeOFCV2", false, "Compute pileup OFCs?"};
990 BooleanProperty m_computePed{this, "ComputeOFCPed", false, "Compute OFCs with additional constraint to pedestal?"};
991 IntegerProperty m_nThreads{this, "nThreads", -1, "-1: No TBB, 0: Let TBB decide, >0 number of threads"};
992
993 BooleanProperty m_readDSPConfig{this, "ReadDSPConfig", false, "Read DSPConfig object ?"};
994 StringProperty m_DSPConfigFolder{this,"DSPConfigFolder","/LAR/Configuration/DSPConfiguration", "Folder for DSPConfig object"};
995 std::unique_ptr<LArDSPConfig> m_DSPConfig;
996
997 BooleanProperty m_forceShift{this, "ForceShift", false, "Forcing shift of input wave ?"};
998
999 BooleanProperty m_isSC{this, "isSC", false, "Running on cells or supercells?"};
1000
1001 Eigen::VectorXd getDelta(std::vector<float>& samples, const HWIdentifier chid, unsigned nSamples) const;
1002
1003
1004
1005 bool useDelta(const HWIdentifier chid, const int jobOFlag, const LArOnOffIdMapping* cabling) const;
1006
1007 static const float m_fcal3Delta[5];
1008 static const float m_fcal2Delta[5];
1009 static const float m_fcal1Delta[5];
1010
1011
1012 //Functor for processing with TBB
1014 //The way this class gets used is actually thread-safe
1015 public:
1016 Looper(std::vector<perChannelData_t>* p, const LArOnOffIdMapping* cabling, const LArOFCAlg* a) : m_perChanData(p), m_cabling(cabling), m_ofcAlg(a) {};
1017 void operator() (tbb::blocked_range<size_t>& r) const {
1018 for (size_t i=r.begin();i!=r.end();++i) {
1019 m_ofcAlg->process(m_perChanData->at(i),m_cabling);
1020 }
1021 }
1022 private:
1023 std::vector<perChannelData_t>* m_perChanData;
1024 const LArOnOffIdMapping* m_cabling;
1025 const LArOFCAlg* m_ofcAlg;
1026 };
1027};
1028
1029
1030#endif
1031

◆ m_fcal3Delta

const float LArOFCAlg::m_fcal3Delta ={0.0790199937765, 0.0952000226825, 0.0790199937765, 0.0952000226825, 0.0790199937765}
staticprivate

Definition at line 827 of file LArOFCAlg.h.

865:public AthAlgorithm {
866 //Acutally this algo can do internal multi-threading at finalize
867 //but not the way regular athenaMT works, so the thread-safety checker complains
868public:
869
870 LArOFCAlg (const std::string& name, ISvcLocator* pSvcLocator);
872 StatusCode execute(const EventContext&) {return StatusCode::SUCCESS;}
873 virtual StatusCode stop();
874 StatusCode finalize(){return StatusCode::SUCCESS;}
875
876private:
877
878 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
879 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKeySC{this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"};
880
881 SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
882 , "CaloDetDescrManager"
883 , "CaloDetDescrManager"
884 , "SG Key for CaloDetDescrManager in the Condition Store" };
885
886 SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> m_caloSuperCellMgrKey { this
887 , "CaloSuperCellDetDescrManager"
888 , "CaloSuperCellDetDescrManager"
889 , "SG Key for CaloSuperCellDetDescrManager in the Condition Store" };
890
891 struct perChannelData_t {
892 //Input:
893 const LArWaveCumul* inputWave;
894 HWIdentifier chid;
895 unsigned gain;
896
897 //Output:
898 std::vector<std::vector<float> > ofc_a;
899 std::vector<std::vector<float> > ofc_b;
900
901 std::vector<std::vector<float> > ofcV2_a;
902 std::vector<std::vector<float> > ofcV2_b;
903
904 std::vector<std::vector<float> >shape;
905 std::vector<std::vector<float> >shapeDer;
906
907 float tstart;
908 float timeBinWidthOFC;
909 unsigned phasewMaxAt3;
910 bool faultyOFC;
911 bool shortWave;
912
913
914 perChannelData_t(const LArWaveCumul* wave, const HWIdentifier hi, const unsigned g) :
915 inputWave(wave), chid(hi), gain(g),tstart(0), timeBinWidthOFC(25./24), phasewMaxAt3(0), faultyOFC(false), shortWave(false) {};
916
917 };
918
919
920 std::vector<perChannelData_t> m_allChannelData;
921
922 static void optFilt(const std::vector<float> &gWave_in, const std::vector<float> &gDerivWave_in, const Eigen::MatrixXd& autoCorrInv, //input variables
923 std::vector<float>& OFCa, std::vector<float>& OFCb // Output variables;
924 ) ;
925
926 static void optFiltDelta(const std::vector<float> &gWave_in, const std::vector<float> &gDerivWave_in, const Eigen::MatrixXd& autoCorrInv,
927 const Eigen::VectorXd& delta, //input variables
928 std::vector<float>& vecOFCa, std::vector<float>& vecOFCb // Output variables;
929 ) ;
930
931 static void optFiltPed(const std::vector<float> &gWave_in, const std::vector<float> &gDerivWave_in, const Eigen::MatrixXd& autoCorrInv, //input variables
932 std::vector<float>& OFCa, std::vector<float>& OFCb // Output variables;
933 ) ;
934
935 void process(perChannelData_t&, const LArOnOffIdMapping* cabling) const;
936
937
938 bool verify(const HWIdentifier chid, const std::vector<float>& OFCa, const std::vector<float>& OFCb,
939 const std::vector<float>& Shape, const char* ofcversion, const unsigned phase) const;
940
941 static void printOFCVec(const std::vector<float>& vec, MsgStream& mLog) ;
942
943
944 StatusCode initPhysWaveContainer(const LArOnOffIdMapping* cabling);
946
947 unsigned int m_nPoints{0};
948
949 StringProperty m_dumpOFCfile{this, "DumpOFCfile", ""};
950 StringArrayProperty m_keylist{this, "KeyList", {}, "List of keys to process"};
951 BooleanProperty m_verify{this, "Verify", true, "Verufy OFCs after computation"};
952 BooleanProperty m_normalize{this, "Normalize", false, "Normalize input wave"};
953 BooleanProperty m_timeShift{this, "TimeShift", false, "Shifting input wave"};
954 IntegerProperty m_timeShiftByIndex{this, "TimeShiftByIndex", -1, "shifting by n bins input wave"} ;
955
956
957 LArCaliWaveContainer* m_waveCnt_nc=nullptr;
958
959 UnsignedIntegerProperty m_nSamples{this, "Nsample", 5, "How many sample to compute"};
960 UnsignedIntegerProperty m_nPhases{this, "Nphase", 50, "How many sphases to compute"};
961 UnsignedIntegerProperty m_dPhases{this, "Dphase", 1, "Number of samples between two neighboring phases (OFC sets)"};
962 UnsignedIntegerProperty m_nDelays{this, "Ndelay", 24, "Number of delays in one clock"};
963 FloatProperty m_addOffset{this, "AddTimeOffset", 0., "Time offset to add"} ;
964
965 ToolHandle<ILArAutoCorrDecoderTool> m_AutoCorrDecoder{this,"DecoderTool",{} };
966 ToolHandle<ILArAutoCorrDecoderTool> m_AutoCorrDecoderV2{this,"DecoderToolV2", {} };
967
968 const CaloDetDescrManager_Base* m_calo_dd_man{};
969 const LArOnlineID_Base* m_onlineID{};
970 const LArOFCBinComplete* m_larPhysWaveBin{};
971
972 DoubleProperty m_errAmpl{this, "ErrAmplitude", 0.01, "Allowed amplitude difference in check"};
973 DoubleProperty m_errTime{this, "ErrTime", 0.01, "Allowed time difference in check"};
974
975 BooleanProperty m_readCaliWave{this, "ReadCaliWave", true, "If false PhysWave is input"};
976 BooleanProperty m_fillShape{this, "FillShape", false, "Fill also shape object"};
977 StringProperty m_ofcKey{this, "KeyOFC", "LArOFC", "Output key non-pileup OFCs"};
978 StringProperty m_ofcKeyV2{this, "KeyOFCV2", "LArOFCV2", "Output key pileup OFCs"};
979 StringProperty m_shapeKey{this, "KeyShape", "LArShape", "Output key Shape object"};
980 BooleanProperty m_storeMaxPhase{this,"StoreMaxPhase", false, "Store phase of input wave max.?"};
981 StringProperty m_ofcBinKey{this, "LArOFCBinKey", "LArOFCPhase","Key for storing OFCBin object for MAx phase"};
982
983 StringProperty m_groupingType{this, "GroupingType", "SubDetector","Which grouping type to use"};
984 StringProperty m_larPhysWaveBinKey{this,"LArPhysWaveBinKey", "", "Key for object to choose bin"};
985
986 IntegerProperty m_useDelta{this, "UseDelta", 0, "0= not use Delta, 1=only EMECIW/HEC/FCAL, 2=all , 3 = only EMECIW/HEC/FCAL1+high eta FCAL2-3"};
987 IntegerProperty m_useDeltaV2{this, "UseDeltaV2", 0, "Same af before for Delta"};
988 BooleanProperty m_computeV2{this, "ComputeOFCV2", false, "Compute pileup OFCs?"};
989 BooleanProperty m_computePed{this, "ComputeOFCPed", false, "Compute OFCs with additional constraint to pedestal?"};
990 IntegerProperty m_nThreads{this, "nThreads", -1, "-1: No TBB, 0: Let TBB decide, >0 number of threads"};
991
992 BooleanProperty m_readDSPConfig{this, "ReadDSPConfig", false, "Read DSPConfig object ?"};
993 StringProperty m_DSPConfigFolder{this,"DSPConfigFolder","/LAR/Configuration/DSPConfiguration", "Folder for DSPConfig object"};
994 std::unique_ptr<LArDSPConfig> m_DSPConfig;
995
996 BooleanProperty m_forceShift{this, "ForceShift", false, "Forcing shift of input wave ?"};
997
998 BooleanProperty m_isSC{this, "isSC", false, "Running on cells or supercells?"};
999
1000 Eigen::VectorXd getDelta(std::vector<float>& samples, const HWIdentifier chid, unsigned nSamples) const;
1001
1002
1003
1004 bool useDelta(const HWIdentifier chid, const int jobOFlag, const LArOnOffIdMapping* cabling) const;
1005
1006 static const float m_fcal3Delta[5];
1007 static const float m_fcal2Delta[5];
1008 static const float m_fcal1Delta[5];
1009
1010
1011 //Functor for processing with TBB
1013 //The way this class gets used is actually thread-safe
1014 public:
1015 Looper(std::vector<perChannelData_t>* p, const LArOnOffIdMapping* cabling, const LArOFCAlg* a) : m_perChanData(p), m_cabling(cabling), m_ofcAlg(a) {};
1016 void operator() (tbb::blocked_range<size_t>& r) const {
1017 for (size_t i=r.begin();i!=r.end();++i) {
1018 m_ofcAlg->process(m_perChanData->at(i),m_cabling);
1019 }
1020 }
1021 private:
1022 std::vector<perChannelData_t>* m_perChanData;
1023 const LArOnOffIdMapping* m_cabling;
1024 const LArOFCAlg* m_ofcAlg;
1025 };
1026};
1027
1028
1029#endif
1030

◆ m_fillShape

BooleanProperty LArOFCAlg::m_fillShape {this, "FillShape", false, "Fill also shape object"}
private

Definition at line 150 of file LArOFCAlg.h.

150{this, "FillShape", false, "Fill also shape object"};

◆ m_forceShift

BooleanProperty LArOFCAlg::m_forceShift {this, "ForceShift", false, "Forcing shift of input wave ?"}
private

Definition at line 170 of file LArOFCAlg.h.

170{this, "ForceShift", false, "Forcing shift of input wave ?"};

◆ m_groupingType

StringProperty LArOFCAlg::m_groupingType {this, "GroupingType", "SubDetector","Which grouping type to use"}
private

Definition at line 157 of file LArOFCAlg.h.

157{this, "GroupingType", "SubDetector","Which grouping type to use"};

◆ m_isSC

BooleanProperty LArOFCAlg::m_isSC {this, "isSC", false, "Running on cells or supercells?"}
private

Definition at line 172 of file LArOFCAlg.h.

172{this, "isSC", false, "Running on cells or supercells?"};

◆ m_keylist

StringArrayProperty LArOFCAlg::m_keylist {this, "KeyList", {}, "List of keys to process"}
private

Definition at line 124 of file LArOFCAlg.h.

124{this, "KeyList", {}, "List of keys to process"};

◆ m_larPhysWaveBin

const LArOFCBinComplete* LArOFCAlg::m_larPhysWaveBin {}
private

Definition at line 144 of file LArOFCAlg.h.

144{};

◆ m_larPhysWaveBinKey

StringProperty LArOFCAlg::m_larPhysWaveBinKey {this,"LArPhysWaveBinKey", "", "Key for object to choose bin"}
private

Definition at line 158 of file LArOFCAlg.h.

158{this,"LArPhysWaveBinKey", "", "Key for object to choose bin"};

◆ m_nDelays

UnsignedIntegerProperty LArOFCAlg::m_nDelays {this, "Ndelay", 24, "Number of delays in one clock"}
private

Definition at line 136 of file LArOFCAlg.h.

136{this, "Ndelay", 24, "Number of delays in one clock"};

◆ m_normalize

BooleanProperty LArOFCAlg::m_normalize {this, "Normalize", false, "Normalize input wave"}
private

Definition at line 126 of file LArOFCAlg.h.

126{this, "Normalize", false, "Normalize input wave"};

◆ m_nPhases

UnsignedIntegerProperty LArOFCAlg::m_nPhases {this, "Nphase", 50, "How many sphases to compute"}
private

Definition at line 134 of file LArOFCAlg.h.

134{this, "Nphase", 50, "How many sphases to compute"};

◆ m_nPoints

unsigned int LArOFCAlg::m_nPoints {0}
private

Definition at line 121 of file LArOFCAlg.h.

121{0};

◆ m_nSamples

UnsignedIntegerProperty LArOFCAlg::m_nSamples {this, "Nsample", 5, "How many sample to compute"}
private

Definition at line 133 of file LArOFCAlg.h.

133{this, "Nsample", 5, "How many sample to compute"};

◆ m_nThreads

IntegerProperty LArOFCAlg::m_nThreads {this, "nThreads", -1, "-1: No TBB, 0: Let TBB decide, >0 number of threads"}
private

Definition at line 164 of file LArOFCAlg.h.

164{this, "nThreads", -1, "-1: No TBB, 0: Let TBB decide, >0 number of threads"};

◆ m_ofcBinKey

StringProperty LArOFCAlg::m_ofcBinKey {this, "LArOFCBinKey", "LArOFCPhase","Key for storing OFCBin object for MAx phase"}
private

Definition at line 155 of file LArOFCAlg.h.

155{this, "LArOFCBinKey", "LArOFCPhase","Key for storing OFCBin object for MAx phase"};

◆ m_ofcKey

StringProperty LArOFCAlg::m_ofcKey {this, "KeyOFC", "LArOFC", "Output key non-pileup OFCs"}
private

Definition at line 151 of file LArOFCAlg.h.

151{this, "KeyOFC", "LArOFC", "Output key non-pileup OFCs"};

◆ m_ofcKeyV2

StringProperty LArOFCAlg::m_ofcKeyV2 {this, "KeyOFCV2", "LArOFCV2", "Output key pileup OFCs"}
private

Definition at line 152 of file LArOFCAlg.h.

152{this, "KeyOFCV2", "LArOFCV2", "Output key pileup OFCs"};

◆ m_onlineID

const LArOnlineID_Base* LArOFCAlg::m_onlineID {}
private

Definition at line 143 of file LArOFCAlg.h.

143{};

◆ m_readCaliWave

BooleanProperty LArOFCAlg::m_readCaliWave {this, "ReadCaliWave", true, "If false PhysWave is input"}
private

Definition at line 149 of file LArOFCAlg.h.

149{this, "ReadCaliWave", true, "If false PhysWave is input"};

◆ m_readDSPConfig

BooleanProperty LArOFCAlg::m_readDSPConfig {this, "ReadDSPConfig", false, "Read DSPConfig object ?"}
private

Definition at line 166 of file LArOFCAlg.h.

166{this, "ReadDSPConfig", false, "Read DSPConfig object ?"};

◆ m_shapeKey

StringProperty LArOFCAlg::m_shapeKey {this, "KeyShape", "LArShape", "Output key Shape object"}
private

Definition at line 153 of file LArOFCAlg.h.

153{this, "KeyShape", "LArShape", "Output key Shape object"};

◆ m_storeMaxPhase

BooleanProperty LArOFCAlg::m_storeMaxPhase {this,"StoreMaxPhase", false, "Store phase of input wave max.?"}
private

Definition at line 154 of file LArOFCAlg.h.

154{this,"StoreMaxPhase", false, "Store phase of input wave max.?"};

◆ m_timeShift

BooleanProperty LArOFCAlg::m_timeShift {this, "TimeShift", false, "Shifting input wave"}
private

Definition at line 127 of file LArOFCAlg.h.

127{this, "TimeShift", false, "Shifting input wave"};

◆ m_timeShiftByIndex

IntegerProperty LArOFCAlg::m_timeShiftByIndex {this, "TimeShiftByIndex", -1, "shifting by n bins input wave"}
private

Definition at line 128 of file LArOFCAlg.h.

128{this, "TimeShiftByIndex", -1, "shifting by n bins input wave"} ;

◆ m_useDelta

IntegerProperty LArOFCAlg::m_useDelta {this, "UseDelta", 0, "0= not use Delta, 1=only EMECIW/HEC/FCAL, 2=all , 3 = only EMECIW/HEC/FCAL1+high eta FCAL2-3"}
private

Definition at line 160 of file LArOFCAlg.h.

160{this, "UseDelta", 0, "0= not use Delta, 1=only EMECIW/HEC/FCAL, 2=all , 3 = only EMECIW/HEC/FCAL1+high eta FCAL2-3"};

◆ m_useDeltaV2

IntegerProperty LArOFCAlg::m_useDeltaV2 {this, "UseDeltaV2", 0, "Same af before for Delta"}
private

Definition at line 161 of file LArOFCAlg.h.

161{this, "UseDeltaV2", 0, "Same af before for Delta"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_verify

BooleanProperty LArOFCAlg::m_verify {this, "Verify", true, "Verufy OFCs after computation"}
private

Definition at line 125 of file LArOFCAlg.h.

125{this, "Verify", true, "Verufy OFCs after computation"};

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_waveCnt_nc

LArCaliWaveContainer* LArOFCAlg::m_waveCnt_nc =nullptr
private

Definition at line 131 of file LArOFCAlg.h.


The documentation for this class was generated from the following files: