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

#include <LArCalibDigitMaker.h>

Inheritance diagram for LArCalibDigitMaker:
Collaboration diagram for LArCalibDigitMaker:

Public Member Functions

 LArCalibDigitMaker (const std::string &name, ISvcLocator *pSvcLocator)
 ~LArCalibDigitMaker ()
StatusCode initialize ()
StatusCode execute (const EventContext &ctx)
 Execute method with EventContext.
StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual StatusCode execute ()
 Execute method without EventContext (deprecated).
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
const EventContext & getContext () const
 Deprecated methods (use the ones with EventContext).
bool filterPassed () const
void setFilterPassed (bool state) 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

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadCondHandleKey< LArCalibLineMappingm_calibMapKey {this,"CalibMapKey","LArCalibLineMap","SG Key of calib line mapping object"}
SG::ReadCondHandleKey< LArCalibLineMappingm_calibMapSCKey {this,"CalibMapSCKey","LArCalibIdMapSC","SG Key of calib line mapping object"}
std::vector< std::string > m_keylist
std::vector< std::vector< double > > m_vPattern
std::vector< std::vector< double > > m_vDAC
std::vector< unsigned > m_vDelay
std::vector< int > m_nPatterns
std::vector< std::vector< double > > m_vBoardIDs
unsigned m_nTrigger {}
double m_delayScale {}
bool m_dontRun {}
bool m_isSC {}
int m_eventNb = 0
bool m_skipDuplicates {}
std::vector< HWIdentifierm_pulsedChids
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

Detailed Description

Definition at line 12 of file LArCalibDigitMaker.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

◆ LArCalibDigitMaker()

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

Definition at line 24 of file LArCalibDigitMaker.cxx.

25 : AthAlgorithm(name, pSvcLocator),
26 m_nTrigger(0)
27{
28 declareProperty("KeyList",m_keylist);
31 declareProperty("Pattern",m_vPattern);
32 declareProperty("nPattern",m_nPatterns);
33 declareProperty("NTrigger",m_nTrigger);
34 declareProperty("BoardIDs",m_vBoardIDs);
35 declareProperty("DelayScale",m_delayScale=(25./240.)*ns);
36 declareProperty("DontRun",m_dontRun=false); //Put only Board configuration in DetectorStore
37 declareProperty("isSC",m_isSC=false);
38 declareProperty("skipDuplicates",m_skipDuplicates=false);
39}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< unsigned > m_vDelay
std::vector< std::vector< double > > m_vDAC
std::vector< std::vector< double > > m_vPattern
std::vector< int > m_nPatterns
std::vector< std::string > m_keylist
std::vector< std::vector< double > > m_vBoardIDs

◆ ~LArCalibDigitMaker()

LArCalibDigitMaker::~LArCalibDigitMaker ( )

Definition at line 41 of file LArCalibDigitMaker.cxx.

42{//empty
43}

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 }

◆ 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() [1/2]

virtual StatusCode AthAlgorithm::execute ( )
inlinevirtualinherited

Execute method without EventContext (deprecated).

Override this method if the EventContext is not needed.

Reimplemented in AthenaMonManager, AthPrescaler, BuildVertexPointingAlg, CP::AsgClassificationDecorationAlg, CP::AsgEnergyDecoratorAlg, CP::AsgEventScaleFactorAlg, CP::AsgLeptonTrackDecorationAlg, CP::AsgObjectScaleFactorAlg, CP::AsgPriorityDecorationAlg, CP::AsgSelectionAlg, CP::AsgShallowCopyAlg, CP::AsgUnionPreselectionAlg, CP::AsgUnionSelectionAlg, CP::AsgViewFromSelectionAlg, CP::AsgxAODNTupleMakerAlg, CP::BJetCalibrationAlg, CP::BootstrapGeneratorAlg, CP::BTaggingEfficiencyAlg, CP::BTaggingInformationDecoratorAlg, CP::BTaggingTriggerEfficiencyAlg, CP::BTaggingTriggerMatchingAlg, CP::ChargeSelectorAlg, CP::CopyNominalSelectionAlg, CP::DileptonInvariantMassSelectorAlg, CP::DileptonInvariantMassWindowSelectorAlg, CP::DileptonOSSFInvariantMassWindowSelectorAlg, CP::DiTauEfficiencyCorrectionsAlg, CP::DiTauMassCalculatorAlg, CP::DiTauSmearingAlg, CP::DiTauTruthMatchingAlg, CP::EgammaCalibrationAndSmearingAlg, CP::EgammaFSRForMuonsCollectorAlg, CP::EgammaIsolationCorrectionAlg, CP::EgammaIsolationSelectionAlg, CP::ElectronEfficiencyCorrectionAlg, CP::ElectronSiHitDecAlg, CP::EventCutFlowHistAlg, CP::EventFlagSelectionAlg, CP::EventSelectionByObjectFlagAlg, CP::EventStatusSelectionAlg, CP::FakeBkgCalculatorAlg, CP::InDetTrackBiasingAlg, CP::InDetTrackExtraVarDecoratorAlg, CP::InDetTrackSelectionAlg, CP::InDetTrackSmearingAlg, CP::JetCalibAlg, CP::JetCalibrationAlg, CP::JetDecoratorAlg, CP::JetFFSmearingAlg, CP::JetGhostMuonAssociationAlg, CP::JetModifierAlg, CP::JetNGhostSelectorAlg, CP::JetReclusteringAlg, CP::JetSelectionAlg, CP::JetTriggerDecoratorAlg, CP::JetUncertaintiesAlg, CP::JvtEfficiencyAlg, CP::JvtUpdateAlg, CP::KinematicHistAlg, CP::LeptonSFCalculatorAlg, CP::MCTCDecorationAlg, CP::MetadataHistAlg, CP::MetBuilderAlg, CP::MetMakerAlg, CP::MetSignificanceAlg, CP::MissingETPlusTransverseMassSelectorAlg, CP::MissingETSelectorAlg, CP::MuonCalibrationAndSmearingAlg, CP::MuonEfficiencyScaleFactorAlg, CP::MuonIsolationAlg, CP::MuonSelectionAlgV2, CP::MuonTriggerEfficiencyScaleFactorAlg, CP::NJetDecoratorAlg, CP::NLargeRJetMassWindowSelectorAlg, CP::NObjectMassSelectorAlg, CP::NObjectPtSelectorAlg, CP::ObjectCutFlowHistAlg, CP::OverlapRemovalAlg, CP::PhotonEfficiencyCorrectionAlg, CP::PhotonExtraVariablesAlg, CP::PhotonShowerShapeFudgeAlg, CP::PileupReweightingAlg, CP::PileupReweightingProvider, CP::PMGTruthWeightAlg, CP::RNtupleTreeMakerAlg, CP::RunNumberSelectorAlg, CP::RunPartonHistoryAlg, CP::SaveFilterAlg, CP::SecVertexTruthMatchAlg, CP::SSVWeightsAlg, CP::SumNLeptonPtSelectorAlg, CP::SysListDumperAlg, CP::SysTruthWeightAlg, CP::TauCombineMuonRMTausAlg, CP::TauEfficiencyCorrectionsAlg, CP::TauSmearingAlg, CP::TauTruthMatchingAlg, CP::TransverseMassSelectorAlg, CP::TreeFillerAlg, CP::TreeMakerAlg, CP::TrigEventSelectionAlg, CP::TrigGlobalEfficiencyAlg, CP::TrigMatchingAlg, CP::TrigPrescalesAlg, CP::VGammaORAlg, CP::xAODWriterAlg, CP::XbbEfficiencyAlg, CP::XbbInformationDecoratorAlg, DecoratePhotonPointingAlg, DecorateVertexScoreAlg, DumpGeo, EL::AnaAlgorithm, EL::UnitTestAlg2, EL::UnitTestAlg3, EL::UnitTestAlg4, EL::UnitTestAlg5, EL::UnitTestAlg7, EventReco::KLFitterFinalizeOutputAlg, EventReco::RunKLFitterAlg, GRLSelectorAlg, IdDictCnvTest, InDetUpdateCaches, JetGlobalEventSetup, LArAutoCorrAlgToDB, LArAutoCorrFromStdNtuple, LArBadChannelHunter, LArBlockCorrections, LArCalibCopyAlg< CONDITIONSCONTAINER >, LArCalibCopyAlg< LArDAC2uAMC >, LArCalibCopyAlg< LArPhysWaveContainer >, LArCalibCopyAlg< LArTdriftComplete >, LArCalibPatchingAlg< CONDITIONSCONTAINER >, LArCalibPatchingAlg< LArAutoCorrComplete >, LArCalibPatchingAlg< LArCaliWaveContainer >, LArCalibPatchingAlg< LArMphysOverMcalComplete >, LArCalibPatchingAlg< LArRampComplete >, LArCalibValidationAlg< CONDITIONSCONTAINER, REFCONTAINER >, LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >, LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >, LArCalibValidationAlg< LArPedestalComplete, ILArPedestal >, LArCalibValidationAlg< LArRampComplete, ILArRamp >, LArCaliWaveSelector, LArCompleteToFlat, LArDeltaRespPredictor, LArDSPThresholdFillInline, LArDuplicateConstants, LArFillDSPConfig, LArFlatFromFile, LArGeoWeightsFill, LArMasterWaveBuilder, LArMphysOverMcalFromTuple, LArOFCAlg, LArOFCBin_PhysCaliTdiffFromStdNtuple, LArOFCtoOFC, LArOFPhaseFill, LArParamsFromStdNtuple, LArPhysWaveFromAscii, LArPhysWaveFromStdNtuple, LArPhysWaveFromTuple, LArPhysWavePredictor, LArPhysWaveShifter, LArRampAdHocPatchingAlg, LArReadParamsFromFile< DATA >, LArReadParamsFromFile< LArCableAttenuationComplete >, LArReadParamsFromFile< LArCableLengthComplete >, LArReadParamsFromFile< LArCaliPulseParamsComplete >, LArReadParamsFromFile< LArDetCellParamsComplete >, LArReadParamsFromFile< LArEMEC_CphiComplete >, LArReadParamsFromFile< LArEMEC_HValphaComplete >, LArReadParamsFromFile< LArEMEC_HVbetaComplete >, LArReadParamsFromFile< LArMphysOverMcalComplete >, LArReadParamsFromFile< LArPhysCaliTdiffComplete >, LArReadParamsFromFile< LArRinjComplete >, LArReadParamsFromFile< LArTdriftComplete >, LArReadParamsFromFile< LArTshaperComplete >, LArRTMParamExtractor, LArShapeFromStdNtuple, LArTimePhysPrediction, LisNtuple, LVL1::eFEXDriver, LVL1::L1CaloTriggerTowerDecoratorAlg, LVL1::L1TopoSimulation, LVL1::TrigT1MBTS, OverlapRemovalGenUseAlg, PyAthena::Alg, SGInputLoader, SUSYToolsAlg, TBBPCRec, TBMWPCRec, TBScintillatorRec, TBTailCatcherRec, TBTrackInfoFromTag, Trig::TrigMatchTestAlg, TrkEDMTestAlg, ZdcLEDNtuple, and ZdcNtuple.

Definition at line 76 of file AthAlgorithm.h.

76 {
77 throw GaudiException( "execute() or execute(const EventContext&) needs to be implemented", name(),
78 StatusCode::FAILURE );
79 }

◆ execute() [2/2]

StatusCode LArCalibDigitMaker::execute ( const EventContext & )
virtual

Execute method with EventContext.

Override this method if acccess to the EventContext is needed.

Reimplemented from AthAlgorithm.

Definition at line 116 of file LArCalibDigitMaker.cxx.

116 {
117
118 if (m_dontRun) return StatusCode::SUCCESS;
119
120
121
122 const LArCalibLineMapping *clcabling=nullptr;
123 if(m_isSC) {
124 ATH_MSG_DEBUG ( "======== LArCalibDigitMaker: using SC calib line map" );
125 SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_calibMapSCKey, ctx};
126 clcabling=*clHdl;
127 } else {
128 SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_calibMapKey, ctx};
129 clcabling=*clHdl;
130 }
131
132
133 if(!clcabling) {
134 ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_calibMapKey.key() );
135 return StatusCode::FAILURE;
136 }
137
138 const unsigned eventNb=(ctx.eventID().event_number())&0xffffff ; // Are we sure?
139
140 ATH_MSG_DEBUG ( "======== executing event "<< eventNb << " ========" );
141
142 const LArCalibParams* calibParams = nullptr;
143 ATH_CHECK( detStore()->retrieve(calibParams,"LArCalibParams") );
144
145 for (const std::string& key : m_keylist) { //Loop over all containers that are to be processed (e.g. different gains)
146 ATH_MSG_DEBUG ( "Retrieving LArDigitContainer. Key= " << key );
147 const LArDigitContainer* larDigitCont;
148 StatusCode sc = evtStore()->retrieve(larDigitCont,key);
149 if (sc.isFailure()) {
150 ATH_MSG_DEBUG ( "Cannot read LArDigitContainer from StoreGate! key=" << key );
151 continue; //Try next container
152 }
153 if (larDigitCont->empty()) {
154 ATH_MSG_DEBUG ( "LArDigitContainer with key '" << key << "' is empty. Ignored." );
155 continue; //Try next container
156 }
157 if (!m_pulsedChids.empty()) m_pulsedChids.clear();
158 //Iterate over LArDigitContainer and build LArCalibDigitContainer
159 auto calibDigitContainer=std::make_unique<LArCalibDigitContainer>();
160 calibDigitContainer->setDelayScale(m_delayScale);
161 for (const LArDigit* digit : *larDigitCont) {
162 HWIdentifier chid=digit->hardwareID();
163
164 if(std::find(m_pulsedChids.begin(), m_pulsedChids.end(), chid) != m_pulsedChids.end()) {
165 if(m_skipDuplicates) continue; // skip this channel if it was already pulsed
166 m_pulsedChids.push_back(chid);
167 }
168
169 //Get data members of LArDigit
170 const std::vector<short>& samples=digit->samples();
172 const std::vector<HWIdentifier>& calibChannelIDs=clcabling->calibSlotLine(chid);
173 if (calibChannelIDs.empty()) {
174 continue; //Disconnected channel
175 }
176 //For the time being, I assume we are in H8 and have only one calib channel per FEB channel
177 std::vector<HWIdentifier>::const_iterator csl_it=calibChannelIDs.begin();
178 //Now the CalibBoard settings:
179 //Get data to build LArCalibDigit:
180 unsigned ddac=calibParams->DAC(eventNb,*csl_it);
181 if(ddac==kmaxDAC) {
182 ATH_MSG_WARNING("SKIP "<<chid<<" "<<gain<<" "<<ddac<<" event no "<<eventNb);
183 continue;
184 }
185 uint16_t dac=ddac;
186 uint16_t delay=calibParams->Delay(eventNb,*csl_it);
187
188 bool ispulsed=false;
189 for(; csl_it != calibChannelIDs.end(); ++csl_it) {
190 if(calibParams->isPulsed(eventNb,*csl_it)){
191 ispulsed=true;
192 break;
193 }
194 }
195 //build LArCalibDigit:
196 if ( ispulsed ){
197 ATH_MSG_VERBOSE("HERE!! "<<chid<<" "<<gain<<" "<<dac<<" "<<delay<<" "<<ispulsed<<" event no "<<eventNb<<" "<<calibChannelIDs.size()<<" calib lines, first is "<<*csl_it);
198
199 }
200 LArCalibDigit* calibDigit=new LArCalibDigit(chid,gain, samples, dac, delay, ispulsed);
201 calibDigitContainer->push_back(calibDigit);
202 } //End iteration to build calibDigits
203 ATH_MSG_DEBUG("Trying to store with key "<<key);
204 ATH_CHECK( evtStore()->record(std::move(calibDigitContainer),key) );
205 ATH_MSG_DEBUG ("LArCalibDigitContainer recorded to StoreGate. key=" << key );
206 } //End loop key list
207 return StatusCode::SUCCESS;
208}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
double delay(std::size_t d)
#define kmaxDAC
This class contains the LAr Calibration Board settings and a set of functions to decoded them.
static Double_t sc
const ServiceHandle< StoreGateSvc > & detStore() const
bool empty() const noexcept
Returns true if the collection is empty.
SG::ReadCondHandleKey< LArCalibLineMapping > m_calibMapKey
std::vector< HWIdentifier > m_pulsedChids
SG::ReadCondHandleKey< LArCalibLineMapping > m_calibMapSCKey
const std::vector< HWIdentifier > & calibSlotLine(const HWIdentifier id) const
unsigned Delay(const unsigned event, const HWIdentifier calibLineID) const
bool isPulsed(const unsigned event, const HWIdentifier calibLineID) const
unsigned DAC(const unsigned event, const HWIdentifier calibLineID) const
::StatusCode StatusCode
StatusCode definition for legacy code.
setWord1 uint16_t

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

◆ filterPassed()

bool AthAlgorithm::filterPassed ( ) const
inherited

Definition at line 94 of file AthAlgorithm.cxx.

94 {
95 return execState( Gaudi::Hive::currentContext() ).filterPassed();
96}

◆ finalize()

StatusCode LArCalibDigitMaker::finalize ( )
inline

Definition at line 22 of file LArCalibDigitMaker.h.

22{return StatusCode::SUCCESS;}

◆ getContext()

const EventContext & AthAlgorithm::getContext ( ) const
inherited

Deprecated methods (use the ones with EventContext).

Definition at line 90 of file AthAlgorithm.cxx.

90 {
91 return Gaudi::Hive::currentContext();
92}

◆ initialize()

StatusCode LArCalibDigitMaker::initialize ( )

Definition at line 45 of file LArCalibDigitMaker.cxx.

46{
47
48 //m_oldeventNb=-999;
49 m_eventNb=-1;
50
51 ATH_MSG_DEBUG ( "======== LArCalibDigitMaker Initialize ========" );
52 // bool containsKeySC = false;
53 for (unsigned int i = 0; i < m_keylist.size(); ++i) {
54 if (m_keylist.at(i).compare("SC") == 0) {
55 m_isSC = true;
56 ATH_MSG_DEBUG ( "======== LArCalibDigitMaker isSC is True ========" );
57 }
58 }
59 ATH_CHECK( m_calibMapSCKey.initialize(m_isSC) );
60 ATH_CHECK( m_calibMapKey.initialize(!m_isSC) );
61
62 //if we have calib board params as jobOpts, set them
63
64 std::vector<std::vector<unsigned>> theseBoardIDs;
65 std::vector<std::vector<unsigned>> thesePatterns;
66 std::vector<std::vector<unsigned>> theseDACs;
67 theseBoardIDs.reserve(m_vBoardIDs.size());
68 thesePatterns.reserve(m_vPattern.size());
69 theseDACs.reserve(m_vDAC.size());
70 for (const auto& elem : m_vBoardIDs) {
71 theseBoardIDs.emplace_back(elem.begin(), elem.end());
72 }
73 for (const auto& elem : m_vPattern) {
74 thesePatterns.emplace_back(elem.begin(), elem.end());
75 }
76 for (const auto& elem : m_vDAC) {
77 theseDACs.emplace_back(elem.begin(), elem.end());
78 }
79 std::vector<unsigned> cutPattern;
80
81 auto calibParams = std::make_unique<LArCalibParams>();
82 ATH_CHECK( calibParams->initialize() );
83 for( long unsigned int i=0; i < theseBoardIDs.size(); i++ ){
84 if (!theseBoardIDs[i].empty() && !m_vDAC[i].empty() && !m_vDelay.empty() && !thesePatterns[i].empty() && m_nTrigger) {
85 cutPattern = thesePatterns[i];
86
87 if (thesePatterns[i].size() != ((unsigned int)m_nPatterns[i])){
88 ATH_MSG_WARNING("Going to change pattern length from "<<thesePatterns[i].size()<<" to "<<m_nPatterns[i]);
89 cutPattern.resize(m_nPatterns[i]);
90 }
91 if (thesePatterns[i].size()%4) {
92 ATH_MSG_ERROR ( "Problem with jobOptions! One Pattern must conists of 4 32bit values! Pattern "<< i );
93 return StatusCode::FAILURE;
94 }
95 for (unsigned id : theseBoardIDs[i]) {
96 const HWIdentifier calibBoardHWID(id);
97 calibParams->set(calibBoardHWID,m_nTrigger,cutPattern,theseDACs[i],m_vDelay);
98 }
99 }
100 }
101
102 ATH_CHECK( detStore()->record(std::move(calibParams),"LArCalibParams") );
103 // End set calib board parameters
104
105 if (m_keylist.empty()) {
106 m_keylist.emplace_back("HIGH");
107 m_keylist.emplace_back("MEDIUM");
108 m_keylist.emplace_back("LOW");
109 }
110
111 ATH_MSG_DEBUG ( "======== LArCalibDigitMaker initialize successfully ========" );
112 return StatusCode::SUCCESS;
113}
size_t size() const
Number of registered mappings.
static const Attributes_t empty

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

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 118 of file AthAlgorithm.h.

118{ 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 }

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

◆ 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()

void AthAlgorithm::setFilterPassed ( bool state) const
inherited

Definition at line 98 of file AthAlgorithm.cxx.

98 {
99 execState( Gaudi::Hive::currentContext() ).setFilterPassed(state);
100}

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

Member Data Documentation

◆ m_calibMapKey

SG::ReadCondHandleKey<LArCalibLineMapping> LArCalibDigitMaker::m_calibMapKey {this,"CalibMapKey","LArCalibLineMap","SG Key of calib line mapping object"}
private

Definition at line 24 of file LArCalibDigitMaker.h.

24{this,"CalibMapKey","LArCalibLineMap","SG Key of calib line mapping object"};

◆ m_calibMapSCKey

SG::ReadCondHandleKey<LArCalibLineMapping> LArCalibDigitMaker::m_calibMapSCKey {this,"CalibMapSCKey","LArCalibIdMapSC","SG Key of calib line mapping object"}
private

Definition at line 25 of file LArCalibDigitMaker.h.

25{this,"CalibMapSCKey","LArCalibIdMapSC","SG Key of calib line mapping object"};

◆ m_delayScale

double LArCalibDigitMaker::m_delayScale {}
private

Definition at line 33 of file LArCalibDigitMaker.h.

33{};

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

bool LArCalibDigitMaker::m_dontRun {}
private

Definition at line 34 of file LArCalibDigitMaker.h.

34{};

◆ m_eventNb

int LArCalibDigitMaker::m_eventNb = 0
private

Definition at line 36 of file LArCalibDigitMaker.h.

◆ 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 AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 121 of file AthAlgorithm.h.

◆ m_isSC

bool LArCalibDigitMaker::m_isSC {}
private

Definition at line 35 of file LArCalibDigitMaker.h.

35{};

◆ m_keylist

std::vector<std::string> LArCalibDigitMaker::m_keylist
private

Definition at line 26 of file LArCalibDigitMaker.h.

◆ m_nPatterns

std::vector<int> LArCalibDigitMaker::m_nPatterns
private

Definition at line 30 of file LArCalibDigitMaker.h.

◆ m_nTrigger

unsigned LArCalibDigitMaker::m_nTrigger {}
private

Definition at line 32 of file LArCalibDigitMaker.h.

32{};

◆ m_pulsedChids

std::vector<HWIdentifier> LArCalibDigitMaker::m_pulsedChids
private

Definition at line 38 of file LArCalibDigitMaker.h.

◆ m_skipDuplicates

bool LArCalibDigitMaker::m_skipDuplicates {}
private

Definition at line 37 of file LArCalibDigitMaker.h.

37{};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vBoardIDs

std::vector<std::vector<double> > LArCalibDigitMaker::m_vBoardIDs
private

Definition at line 31 of file LArCalibDigitMaker.h.

◆ m_vDAC

std::vector<std::vector<double> > LArCalibDigitMaker::m_vDAC
private

Definition at line 28 of file LArCalibDigitMaker.h.

◆ m_vDelay

std::vector<unsigned> LArCalibDigitMaker::m_vDelay
private

Definition at line 29 of file LArCalibDigitMaker.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vPattern

std::vector<std::vector<double> > LArCalibDigitMaker::m_vPattern
private

Definition at line 27 of file LArCalibDigitMaker.h.


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