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

#include <LArOFCAlg.h>

Inheritance diagram for LArOFCAlg:

Classes

class  Looper
struct  perChannelData_t

Public Member Functions

 LArOFCAlg (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
virtual StatusCode stop ()
StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
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

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 > &vec, 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
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< 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()
Default constructor:

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< 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< 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< 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< 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 ( )
inline

Definition at line 46 of file LArOFCAlg.h.

46{return StatusCode::SUCCESS;}

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ 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 853 of file LArOFCAlg.cxx.

853 {
854
855 if (nSamples>5) nSamples=5;
856
857 Eigen::VectorXd delta(nSamples); //return value
858
859 if (m_onlineID->isFCALchannel(chid) ){
860 // FCAL use fixed delta from data.
861 const int slot = m_onlineID->slot(chid) ;
862 if ( slot <=9){ // FCAL 1
863 for (unsigned i=0;i<nSamples;++i) {
864 delta[i]=m_fcal1Delta[i];
865 }
866 }else
867 if(slot <=13){ // FCAL 2
868 for (unsigned i=0;i<nSamples;++i) {
869 delta[i]=m_fcal2Delta[i];
870 }
871 }else { //FCAL 3
872 for (unsigned i=0;i<nSamples;++i) {
873 delta[i]=m_fcal3Delta[i];
874 }
875 }
876
877 }else
878 { // from Shape
879 float odd = 0.;
880 float even = 0.;
881 for (unsigned int i = 0;i<samples.size();++i) {
882 if (i%2==0){
883 even += samples[i];
884 }
885 else {
886 odd += samples[i];
887 }
888 }
889
890 for (unsigned i=0;i<nSamples;++i) {
891 if (i%2==0)
892 delta[i]=even;
893 else
894 delta[i]=odd;
895 }
896 }
897
898 return delta;
899
900}
static const float m_fcal3Delta[5]
Definition LArOFCAlg.h:849
static const float m_fcal2Delta[5]
Definition LArOFCAlg.h:850
static const float m_fcal1Delta[5]
Definition LArOFCAlg.h:851
const LArOnlineID_Base * m_onlineID
Definition LArOFCAlg.h:143

◆ initCaliWaveContainer()

StatusCode LArOFCAlg::initCaliWaveContainer ( )
private

Definition at line 623 of file LArOFCAlg.cxx.

623 {
624
626 for (unsigned k=0 ; k<m_keylist.size() ; k++ ) { // Loop over all containers that are to be processed (e.g. different gains)
627 ATH_MSG_INFO( "Processing WaveContainer from StoreGate! key = " << m_keylist[k] );
628
629 //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.
630 //Try non-const retrieve:
631 const LArCaliWaveContainer* waveCnt = nullptr;
632 m_waveCnt_nc=detStore()->tryRetrieve<LArCaliWaveContainer>(m_keylist[k]);
633 if (m_waveCnt_nc) {
634 waveCnt=m_waveCnt_nc; //Retain const pointer
635 if (!m_waveCnt_nc->correctionsApplied()) {
636 ATH_MSG_INFO( "LArCaliWaveContainer: Corrections not yet applied, applying them now..." );
637 if (m_waveCnt_nc->applyCorrections().isFailure()) {
638 ATH_MSG_ERROR( "Failed to apply corrections to LArCaliWaveContainer!" );
639 return StatusCode::FAILURE;
640 }
641 else {
642 ATH_MSG_INFO("Applied corrections to non-const Wave container");
643 }
644 }
645 }
646 else {
647 waveCnt=detStore()->tryConstRetrieve<LArCaliWaveContainer>(m_keylist[k]);
648 if (!waveCnt) {
649 ATH_MSG_ERROR( "Failed to retrieve a LArCaliWaveContainer with key " << m_keylist[k] );
650 return StatusCode::FAILURE;
651 }
652 }
653
654
655 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
656
657 for (unsigned gain = CaloGain::LARHIGHGAIN ; gain < CaloGain::LARNGAIN ; gain++ ) { // loop on possible gains
658 WAVEIT it=waveCnt->begin(gain);
659 WAVEIT it_e=waveCnt->end(gain);
660 for (;it!=it_e;++it) {
661 const LArCaliWaveVec& wVec=*it;
662 for (const auto& cw : wVec) {
663 const LArWaveCumul* wave= &(cw); //down-cast
664 if (!wave->isEmpty()) {
665 m_allChannelData.emplace_back(wave,it.channelId(),gain);
666 }
667 }
668 } //end loop over channels
669 }//end loop over gains
670 }//end loop over SG keys
671 return StatusCode::SUCCESS;
672}
#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_FATAL(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
MsgStream & msg() const
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 589 of file LArOFCAlg.cxx.

589 {
590
592
593 for (unsigned k=0 ; k<m_keylist.size() ; k++ ) { // Loop over all containers that are to be processed (e.g. different gains)
594 ATH_MSG_INFO( "Processing WaveContainer from StoreGate! key = " << m_keylist[k] );
595
596 const LArPhysWaveContainer* waveCnt;
597 StatusCode sc=detStore()->retrieve(waveCnt,m_keylist[k]);
598 if (sc.isFailure()) {
599 ATH_MSG_ERROR( "Failed to retrieve a LArPhysWaveContainer with key " << m_keylist[k] );
600 return sc;
601 }
602
603 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
604
605 for (unsigned gain = CaloGain::LARHIGHGAIN ; gain < CaloGain::LARNGAIN ; gain++ ) { // loop on possible gains
606 WAVEIT it=waveCnt->begin(gain);
607 WAVEIT it_e=waveCnt->end(gain);
608 for (;it!=it_e;++it) {
609 const HWIdentifier chid=it.channelId();
610 if (cabling->isOnlineConnected (chid)){
611 const LArWaveCumul* wave= &(*it); //down-cast
612 if (!wave->isEmpty()) {
613 m_allChannelData.emplace_back(wave, chid,gain);
614 }
615 }
616 } //end loop over channels
617 }//end loop over gains
618 }//end loop over SG keys
619 return StatusCode::SUCCESS;
620}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< 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.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< 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 675 of file LArOFCAlg.cxx.

676 { // Output variables;
677 assert(gWave.size()==gDerivWave.size());
678 //assert autoCorr size ....
679 const int optNpt = gWave.size();
680
681 Eigen::VectorXd gResp(optNpt), gDerivResp(optNpt);
682 for (int i=0;i<optNpt;i++) {
683 gResp[i] = gWave[i];
684 gDerivResp[i] = gDerivWave[i];
685 }
686
687 Eigen::Matrix2d isol;
688 isol <<
689 (gResp.transpose()*acInverse*gResp)[0],
690 (gResp.transpose()*acInverse*gDerivResp)[0],
691 (gDerivResp.transpose()*acInverse*gResp)[0],
692 (gDerivResp.transpose()*acInverse*gDerivResp)[0];
693
694 Eigen::Vector2d Amp;
695 Eigen::Vector2d Atau;
696 Eigen::Vector2d Ktemp;
697 Eigen::Matrix2d isolInv = isol.inverse();
698
699 // we solve for the lagrange multiplers
700 Ktemp[0] = 1.;
701 Ktemp[1] = 0.;
702 Amp = isolInv*Ktemp;
703
704 Ktemp[0] = 0.;
705 Ktemp[1] = -1.;
706 Atau = isolInv*Ktemp;
707
708 // we express the a and b vectors in terms of the lagrange multipliers
709 Eigen::VectorXd OFCa = Amp[0]*acInverse*gResp + Amp[1]*acInverse*gDerivResp;
710 Eigen::VectorXd OFCb = Atau[0]*acInverse*gResp + Atau[1]*acInverse*gDerivResp;
711
712 //Convert back to std::vector
713 vecOFCa.resize(optNpt);
714 vecOFCb.resize(optNpt);
715 for (int i=0;i<optNpt;i++) {
716 vecOFCa[i]=OFCa[i];
717 vecOFCb[i]=OFCb[i];
718 }
719 }

◆ 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 773 of file LArOFCAlg.cxx.

775 {
776
777
778
779 assert(gWave.size()==gDerivWave.size());
780 //assert autoCorr size ....
781 const int optNpt = gWave.size();
782
783 Eigen::VectorXd gResp(optNpt), gDerivResp(optNpt);
784 for (int i=0;i<optNpt;i++) {
785 gResp[i] = gWave[i];
786 gDerivResp[i] = gDerivWave[i];
787 }
788
789 // try 3X3 matrix with offsets
790
791
801 Eigen::Matrix3d isol;
802 isol <<
803 (gResp.transpose()*acInverse*gResp)[0],
804 (gResp.transpose()*acInverse*gDerivResp),
805 (gResp.transpose()*acInverse*delta)[0],
806
807 (gDerivResp.transpose()*acInverse*gResp)[0],
808 (gDerivResp.transpose()*acInverse*gDerivResp)[0],
809 (gDerivResp.transpose()*acInverse*delta)[0],
810
811 (delta.transpose()*acInverse*gResp)[0],
812 (delta.transpose()*acInverse*gDerivResp)[0],
813 (delta.transpose()*acInverse*delta)[0];
814
815
816 Eigen::Vector3d Amp;
817 Eigen::Vector3d Atau;
818 Eigen::Vector3d Ktemp;
819 Eigen::Matrix3d isolInv = isol.inverse();
820
821 // we solve for the lagrange multiplers
822
823 Ktemp[0] = 1.;
824 Ktemp[1] = 0.;
825 Ktemp[2] = 0.;
826
827 Amp = isolInv*Ktemp;
828
829 Ktemp[0] = 0.;
830 Ktemp[1] = -1.;
831 Atau = isolInv*Ktemp;
832
833 // we express the a and b vectors in terms of the lagrange multipliers
834 Eigen::VectorXd OFCa = Amp[0]*acInverse*gResp + Amp[1]*acInverse*gDerivResp + Amp[2]*acInverse * delta;
835 Eigen::VectorXd OFCb = Atau[0]*acInverse*gResp + Atau[1]*acInverse*gDerivResp + Atau[2]*acInverse * delta ;
836
837
838 //Convert back to std::vector
839 vecOFCa.resize(optNpt);
840 vecOFCb.resize(optNpt);
841 for (int i=0;i<optNpt;i++) {
842 vecOFCa[i]=OFCa[i];
843 vecOFCb[i]=OFCb[i];
844 }
845 }

◆ 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 721 of file LArOFCAlg.cxx.

722 { // Output variables;
723 assert(gWave.size()==gDerivWave.size());
724 //assert autoCorr size ....
725 const int optNpt = gWave.size();
726
727 Eigen::VectorXd gResp(optNpt), gDerivResp(optNpt);
728 for (int i=0;i<optNpt;i++) {
729 gResp[i] = gWave[i];
730 gDerivResp[i] = gDerivWave[i];
731 }
732
733 Eigen::Matrix3d isol;
734 Eigen::Vector3d Kunit(1.,1.,1.);
735 auto s3=(gDerivResp.transpose()*acInverse*gResp)[0];
736 auto s4=(gResp.transpose()*acInverse*Kunit)[0];
737 auto s5=(gDerivResp.transpose()*acInverse*Kunit)[0];
738 isol <<
739 (gResp.transpose()*acInverse*gResp)[0], s3, s4,
740 s3, (gDerivResp.transpose()*acInverse*gResp)[0], s5,
741 s4, s5, (Kunit.transpose()*acInverse*Kunit)[0];
742
743 Eigen::Vector3d Amp;
744 Eigen::Vector3d Atau;
745 Eigen::Vector3d Ktemp;
746 Eigen::Matrix3d isolInv = isol.inverse();
747
748 // we solve for the lagrange multiplers
749 Ktemp[0] = 1.;
750 Ktemp[1] = 0.;
751 Ktemp[2] = 0.;
752 Amp = isolInv*Ktemp;
753
754 Ktemp[0] = 0.;
755 Ktemp[1] = -1.;
756 Ktemp[2] = 0.;
757 Atau = isolInv*Ktemp;
758
759 // we express the a and b vectors in terms of the lagrange multipliers
760 Eigen::VectorXd OFCa = Amp[0]*acInverse*gResp + Amp[1]*acInverse*gDerivResp + Amp[2]*acInverse*Kunit;
761 Eigen::VectorXd OFCb = Atau[0]*acInverse*gResp + Atau[1]*acInverse*gDerivResp + Atau[2]*acInverse*Kunit;
762
763 //Convert back to std::vector
764 vecOFCa.resize(optNpt);
765 vecOFCb.resize(optNpt);
766 for (int i=0;i<optNpt;i++) {
767 vecOFCa[i]=OFCa[i];
768 vecOFCb[i]=OFCb[i];
769 }
770 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< 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 994 of file LArOFCAlg.cxx.

994 {
995 mLog << MSG::WARNING << "OFCs";
996 for(float v : vec)
997 mLog << " " << v;
998 mLog << endmsg;
999}
std::vector< size_t > vec

◆ process()

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

Definition at line 395 of file LArOFCAlg.cxx.

395 {
396
397 LArWaveHelper larWaveHelper;
398 const LArWaveCumul* nextWave=chanData.inputWave;
399 if (!nextWave) {
400 ATH_MSG_ERROR( "input wave is 0" );
401 return;
402 }
403
404 if ( nextWave->getFlag() == LArWave::dac0 ) return ; // skip dac0 waves
405
406 const HWIdentifier ch_id=chanData.chid;
407 const unsigned gain=chanData.gain;
408 ATH_MSG_DEBUG( "Computing OFC for channel " << m_onlineID->channel_name(ch_id) << " in gain = " << gain);
409
410
411 // check constistency of settings
412 if ( m_nPoints > nextWave->getSize() ) {
413 ATH_MSG_ERROR( "Channel " << m_onlineID->channel_name(ch_id) <<": Wave size (" << nextWave->getSize()
414 << ") is too small to fit your OFC request (" << m_nPoints << " points)" ) ;
415 chanData.shortWave=true;
416 return;
417 }
418
419 // the current waveform
420 LArWave aWave = *nextWave; // Actually *copying* the Wave to get rid of the const: need to manipulate Wave to normalize...
421
422 if (m_larPhysWaveBin) {
423 const int bin = m_larPhysWaveBin->bin(ch_id,gain);
424 if (bin>-998) { //>ERRORCODE
425 ATH_MSG_VERBOSE("Channel " << m_onlineID->channel_name(ch_id) << ": shift by index " << bin);
426 aWave=larWaveHelper.translate(aWave,-bin,0);
427 }
428 else
429 ATH_MSG_VERBOSE("Channel 0x" << MSG::hex << ch_id.get_identifier32().get_compact() << MSG::dec << ": No valid index for shifting");
430 }//end if larPhysWaveBin
431
432
433 // normalize input wave, if requested
434 if (m_normalize) {
435 const double peak = aWave.getSample( larWaveHelper.getMax(aWave) );
436 if ( peak == 0 ) {
437 ATH_MSG_ERROR( "Wave maximum is zero, skipping channel " << m_onlineID->channel_name(ch_id) ) ;
438 return;
439 }
440
441 ATH_MSG_VERBOSE("Channel 0x" << m_onlineID->channel_name(ch_id) << " has amplitude = " << peak << ": normalizing...");
442 aWave = aWave * (1./peak);
443 }
444
445 ATH_MSG_VERBOSE("Channel " << m_onlineID->channel_name(ch_id) << " has now amplitude = " << aWave.getSample( larWaveHelper.getMax(aWave)));
446 // compute tstart to shift input wave, if requested
447 if ( m_timeShift ) {
448 if( m_timeShiftByIndex == -1 ) {
449 chanData.tstart = larWaveHelper.getStart(aWave) ;
450 } else {
451 chanData.tstart = m_timeShiftByIndex;
452 }
453 }
454
455 ATH_MSG_DEBUG("Channel" << m_onlineID->channel_name(ch_id) << ", Tstart = " << chanData.tstart);
456
457 //Calculate derivative for this wave
458 LArWave aDerivedWave = larWaveHelper.derive_smooth(aWave);
459
460 chanData.timeBinWidthOFC = m_dPhases*aWave.getDt();
461
462 float maxSampleValAt3=-1;
463
464 //prepare output vectors
465 chanData.ofc_a.resize(m_nPhases);
466 chanData.ofc_b.resize(m_nPhases);
467 chanData.shape.resize(m_nPhases);
468 chanData.shapeDer.resize(m_nPhases);
469
470 if (m_computeV2) {
471 chanData.ofcV2_a.resize(m_nPhases);
472 chanData.ofcV2_b.resize(m_nPhases);
473 }
474
475
476 const Eigen::MatrixXd acInverse=m_AutoCorrDecoder->AutoCorr(chanData.chid,(CaloGain::CaloGain)chanData.gain,m_nSamples).inverse();
477 Eigen::MatrixXd acInverseV2;
478 if (m_computeV2)
479 acInverseV2=m_AutoCorrDecoderV2->AutoCorr(chanData.chid,(CaloGain::CaloGain)chanData.gain,m_nSamples).inverse();
480
481 unsigned tShift=0;
483 if(m_DSPConfig->peakSample(m_onlineID->feb_Id(ch_id)) < 2 ) { // 2 is canonical value for peak
484 tShift = 2 - m_DSPConfig->peakSample(m_onlineID->feb_Id(ch_id));
485 }
486 }
487 if(m_forceShift) tShift=1;
488
489 ATH_MSG_DEBUG("Channel " << m_onlineID->channel_name(ch_id) << "shift: " << tShift);
490
491 for (unsigned iPhase=0;iPhase<m_nPhases;iPhase++) { //Loop over all phases
492
493 ATH_MSG_VERBOSE ("Channel " << m_onlineID->channel_name(ch_id)
494 << ", Gain = " << gain << ", Phase = " << iPhase << ":");
495
496
497 //Reference to the samples and deriviative to be filled
498 std::vector<float>& theSamples=chanData.shape[iPhase];
499 std::vector<float>& theSamplesDer=chanData.shapeDer[iPhase];
500
501 //Extract the points where we compute the OFCs from the wave and the derived wave
502 //and fill the samples an derivative vector
503 theSamples.reserve(m_nSamples);
504 theSamplesDer.reserve(m_nSamples);
505 for (unsigned iSample=0;iSample<m_nSamples;++iSample){ //Loop over all samples
506 const unsigned tbin = chanData.tstart + iPhase*m_dPhases + (iSample+tShift)*m_nDelays ;
507 theSamples.push_back( aWave.getSample(tbin) );
508 theSamplesDer.push_back( aDerivedWave.getSample(tbin) );
509 } //End loop over samples
510
511
512 if (m_storeMaxPhase && m_nSamples>2 && theSamples[2]>maxSampleValAt3) {
513 maxSampleValAt3=theSamples[2];
514 chanData.phasewMaxAt3=iPhase;
515 }
516
517 bool thisChanUseDelta=useDelta(ch_id,m_useDelta,cabling);
518 bool thisChanUseDeltaV2=m_computeV2 && useDelta(ch_id,m_useDeltaV2,cabling);
519 Eigen::VectorXd delta;
520
521 if (thisChanUseDelta || thisChanUseDeltaV2) { // will need delta for at least one of the two versions
522 std::vector<float> theSamples32;
523 theSamples32.reserve(32);
524 for (unsigned iSample=0;iSample<32 ;++iSample){ //Loop over all samples
525 const unsigned tbin = chanData.tstart + iPhase*m_dPhases + (iSample+tShift)*m_nDelays ;
526 if (tbin>=aWave.getSize()) continue;
527 theSamples32.push_back( aWave.getSample(tbin) );
528 } //End loop over samples
529 delta=getDelta(theSamples32,ch_id,m_nSamples);
530 }
531
532 //OFC V1 computiation (i.e. not pileup-optimized)
533 //Reference to the OFCa and OFCb to be filled
534 std::vector<float>& vOFC_a= chanData.ofc_a[iPhase];
535 std::vector<float>& vOFC_b= chanData.ofc_b[iPhase];
536
537 if(m_computePed){
538 optFiltPed(theSamples,theSamplesDer,acInverse,vOFC_a,vOFC_b);
539 } else {
540 if (thisChanUseDelta) {
541 optFiltDelta(theSamples,theSamplesDer,acInverse,delta,vOFC_a,vOFC_b);
542 }
543 else { //don't use Delta
544 optFilt(theSamples,theSamplesDer,acInverse,vOFC_a,vOFC_b);
545 }
546 }
547
548 // verify OFC consistency
549 if (m_verify) {
550 chanData.faultyOFC |= verify(chanData.chid,vOFC_a,vOFC_b,theSamples,"OFC",iPhase);
551 }
552
553
554 if (m_computeV2) {
555 //OFC V2 computiation (i.e. pileup-optimized)
556 //Reference to the OFCa and OFCb to be filled
557 std::vector<float>& vOFCV2_a= chanData.ofcV2_a[iPhase];
558 std::vector<float>& vOFCV2_b= chanData.ofcV2_b[iPhase];
559
560 if(m_computePed){
561 optFiltPed(theSamples,theSamplesDer,acInverseV2,vOFCV2_a,vOFCV2_b);
562 } else {
563 if (thisChanUseDeltaV2) {
564 optFiltDelta(theSamples,theSamplesDer,acInverseV2,delta,vOFCV2_a,vOFCV2_b);
565 }
566 else { //don't use Delta
567 optFilt(theSamples,theSamplesDer,acInverseV2,vOFCV2_a,vOFCV2_b);
568 }
569 }
570
571 // verify OFC consistency
572 if (m_verify) {
573 chanData.faultyOFC |= verify(chanData.chid,vOFCV2_a,vOFCV2_b,theSamples,"OFCV2",iPhase);
574 }
575 }//end if computeV2
576 } //End loop over all phases
577
578 // in case we're dealing with a LArPhysWave, add any possible previous time shift
579 if (!m_readCaliWave) {
580 const LArPhysWave* pwave=dynamic_cast<const LArPhysWave*>(nextWave);
581 if (pwave)
582 chanData.tstart += pwave->getTimeOffset()+m_addOffset;
583 }
584 }
#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< 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< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ 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;
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
334 if (sc.isFailure()) {
335 ATH_MSG_ERROR( "Could not symlink ILArOFC with LArOFCComplete." );
336 return StatusCode::FAILURE;
337 }
338 ATH_MSG_INFO( "Symlink with ILArOFC done" ) ;
339
340
341 // record and symlink second version of LArOFCComplete object
342 if (m_computeV2) {
343 sc = detStore()->record(std::move(larOFCCompleteV2),m_ofcKeyV2);
344 if (sc.isFailure()) {
345 ATH_MSG_ERROR( "Could not record LArOFCComplete to DetStore with key " << m_ofcKeyV2 );
346 return StatusCode::FAILURE;
347 }
348 ATH_MSG_INFO( "LArOFCComplete object recorded with key " << m_ofcKeyV2 ) ;
349
351 if (sc.isFailure()) {
352 ATH_MSG_ERROR( "Could not symlink ILArOFC with LArOFCComplete." );
353 return StatusCode::FAILURE;
354 }
355 ATH_MSG_INFO( "Symlink with ILArOFC done" ) ;
356 }
357
358 if (larOFCBinComplete) {
359 sc = detStore()->record(std::move(larOFCBinComplete),m_ofcBinKey);
360 if (sc.isFailure()) {
361 ATH_MSG_ERROR( "Could not record LArOFCBinCompete object" );
362 return StatusCode::FAILURE;
363 }
364 }
365
366 // record and symlink LArShapeComplete object
367 if ( m_fillShape ) {
368 ATH_MSG_DEBUG( "Trying to record LArShapeComplete object to detector store, key = " << m_shapeKey);
369 sc = detStore()->record(std::move(larShapeComplete),m_shapeKey);
370 if (sc.isFailure()) {
371 ATH_MSG_ERROR( "Could not record LArShapeComplete to DetStore with key " << m_shapeKey );
372 return StatusCode::FAILURE;
373 }
374 ATH_MSG_INFO( "LArShapeComplete object recorded to DetStore successfully with key " << m_shapeKey ) ;
375 ATH_MSG_DEBUG( "Trying to symlink ILArShape with LArShapeComplete");
377 if (sc.isFailure()) {
378 ATH_MSG_ERROR( "Could not symlink ILArShape with LArShapeComplete." );
379 return StatusCode::FAILURE;
380 }
381 ATH_MSG_INFO( "ILArShape symlink with LArShapeComplete successfully" ) ;
382 }
383
384
385 //Undo corrections, if they are applied by this algo:
386 if (m_waveCnt_nc) {
387 ATH_CHECK(m_waveCnt_nc->undoCorrections());
388 ATH_MSG_INFO("Reverted corrections of non-cost wave container");
389 }
390
391 return StatusCode::SUCCESS;
392}
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
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

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

Definition at line 66 of file AthAlgorithm.cxx.

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

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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< 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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ useDelta()

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

Definition at line 902 of file LArOFCAlg.cxx.

902 {
903
904 if (jobOFlag==2){
905 return true;
906 }
907
908 if(jobOFlag==1) { // only HEC/EMECIW/FCAL
909 if (m_onlineID->isEMECIW(chid) || m_onlineID->isFCALchannel(chid) || m_onlineID->isHECchannel(chid)) {
910 return true;
911 }
912 }
913
914 if(jobOFlag==3) { // only HEC/EMECIW/FCAL1 and high eta FCAL2-3
915 if (m_onlineID->isEMECIW(chid) || m_onlineID->isHECchannel(chid)) {
916 return true;
917 }
918 else if (m_onlineID->isFCALchannel(chid) ){
919
920 if (cabling->isOnlineConnected (chid)){
921 Identifier ofl_id = cabling->cnvToIdentifier(chid);
922 const CaloDetDescrElement* dde = m_calo_dd_man->get_element(ofl_id);
923 if (! dde) {
924 ATH_MSG_ERROR( " dde = 0 , onl_id, ofl_id= "<< chid<<" "<<ofl_id );
925 return false; // Exception better?
926 }
927 if ( m_isSC ) {
929 if (sampling==CaloCell_ID::FCAL0){
930 return true;
931 }
932 else {
933 if (fabs(dde->eta())>4.0){
934 return true;
935 }
936 }
937 } else {
938 CaloCell_ID::CaloSample sampling = dde->getSampling();
939 if (sampling==CaloCell_ID::FCAL0){
940 return true;
941 }
942 else {
943 if (fabs(dde->eta())>4.0){
944 return true;
945 }
946 }
947 }
948
949 }//end if connected
950 }//end if isFCALchannel
951
952 }//else if jobOFlag=3
953
954 return false;
955}
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 958 of file LArOFCAlg.cxx.

959 {
960
961 bool result=false;
962 float recAmpl=0, recTime=0;
963 for (unsigned iSample=0;iSample<m_nSamples;++iSample){
964
965#ifdef LAROFCALG_DEBUGOUTPUT
966 ATH_MSG_VERBOSE("a["<<iSample<<"]="<<vOFC_a[iSample] << " b["<<iSample<<"]="<<vOFC_b[iSample]
967 << " Sample=" << aWave.getSample(tbin));
968#endif
969 recAmpl += OFCa[iSample] * Shape[iSample];
970 recTime += OFCb[iSample] * Shape[iSample];
971 } //End loop over samples
972
973 if (recAmpl != 0) {
974 recTime /= recAmpl ;
975 }
976
977 // At this point the reconstructed amplitude must be = 1 by definition, whatever the initial normalisation!
978 ATH_MSG_VERBOSE("recAmp=" << recAmpl << " ; recTime=" << recTime);
979 if ( fabs(1.-recAmpl) > m_errAmpl ) {
980 ATH_MSG_WARNING( "Applying phase " << phase << " of " << ofcversion << " to original wave yields an Amplitude of "<< recAmpl
981 << " instead of 1. -> Wrong OFCs? channel " << m_onlineID->channel_name(chid) );
983 result=true;
984 }
985 if ( fabs(recTime) > m_errTime ) {
986 ATH_MSG_WARNING( "Applying phase " << phase << " of " << ofcversion << " to original wave yields a time offset of " << recTime
987 << " -> Wrong OFCs? channel " << m_onlineID->channel_name(chid) );
989 result=true;
990 }
991 return result;
992}
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< 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< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fcal1Delta

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

Definition at line 851 of file LArOFCAlg.h.

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

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

◆ m_fcal3Delta

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

Definition at line 849 of file LArOFCAlg.h.

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

◆ 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< 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< 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: