ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::jFEXCondAlgo Class Reference

#include <jFEXCondAlgo.h>

Inheritance diagram for LVL1::jFEXCondAlgo:
Collaboration diagram for LVL1::jFEXCondAlgo:

Public Member Functions

 jFEXCondAlgo (const std::string &name, ISvcLocator *svc)
 Constructors.
virtual StatusCode initialize () override
 Function initialising the algorithm.
virtual StatusCode execute (const EventContext &) const override
 Function executing the algorithm.
virtual bool isReEntrant () const override
 Avoid scheduling algorithm multiple times.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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

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

Private Attributes

SG::WriteCondHandleKey< jFEXDBCondDatam_jFEXDBParamsKey {this, "jFEXDBParamsKey", "jFEXDBParams", "Output for jFEX DB parameters"}
SG::ReadCondHandleKey< CondAttrListCollectionm_JfexModuleSettingsKey {this,"JfexModuleSettings", "", "Key to store JfexModuleSettings DB path"}
SG::ReadCondHandleKey< CondAttrListCollectionm_JfexNoiseCutsKey {this,"JfexNoiseCuts" , "", "Key to store JfexNoiseCuts DB path" }
SG::ReadCondHandleKey< CondAttrListCollectionm_JfexSystemSettingsKey {this,"JfexSystemSettings", "", "Key to store JfexSystemSettings DB path"}
UnsignedIntegerProperty m_dbBeginTimestamp {this,"BeginTimestamp", 1698527690,"Earliest timestamp that db parameters will be loaded. Default is start of 2023-10-27"}
Gaudi::Property< bool > m_isMC {this, "IsMC", false, "For MC, always access the DB"}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 24 of file jFEXCondAlgo.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

◆ jFEXCondAlgo()

LVL1::jFEXCondAlgo::jFEXCondAlgo ( const std::string & name,
ISvcLocator * svc )

Constructors.

Definition at line 27 of file jFEXCondAlgo.cxx.

27: AthCondAlgorithm(name, svc){}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode LVL1::jFEXCondAlgo::execute ( const EventContext & ctx) const
overridevirtual

Function executing the algorithm.

Definition at line 42 of file jFEXCondAlgo.cxx.

42 {
43
44
45 // Construct the output Cond Object and fill it in
46 std::unique_ptr<jFEXDBCondData> writeDBTool(std::make_unique<jFEXDBCondData>() );
47
48 //Write handle
49 SG::WriteCondHandle<jFEXDBCondData> writeCHandle(m_jFEXDBParamsKey, ctx);
50 if (writeCHandle.isValid()) {
51 ATH_MSG_DEBUG("Existing jfex condition data is still valid");
52 return StatusCode::SUCCESS;
53 }
54
55 // Date from which jFEX database parameters should be used (MC should always use DB)
56 // PU fix: 2023-10-27
57 bool validTimeStamp = (ctx.eventID().time_stamp() < m_dbBeginTimestamp) ? false : true;
58 if (m_isMC)
59 validTimeStamp = true;
60
61 // Set DB to false if any of keys not provided
62 bool anyKeyEmpty = ( m_JfexModuleSettingsKey.empty() || m_JfexNoiseCutsKey.empty() || m_JfexSystemSettingsKey.empty() );
63
64 bool useDBparams = (!anyKeyEmpty && validTimeStamp);
65
66 /***************************************/
67 /* */
68 /* Jet calibration Parameters */
69 /* */
70 /***************************************/
71 std::vector<std::vector<int>> jJCalibParams(6, std::vector<int>(25, 0)); //6 modules, up to 25 calib factors
72
73 if(!m_JfexModuleSettingsKey.empty() && useDBparams){
74 SG::ReadCondHandle <CondAttrListCollection> load_jFexModuleSet{m_JfexModuleSettingsKey, ctx };
75
76 // we should check if it is valid and the size is 6 (corresponding to the 6 jfex modules)
77 if (load_jFexModuleSet.isValid() and load_jFexModuleSet->size() == 6) {
78
79 //setting the validity
80 writeCHandle.addDependency(load_jFexModuleSet);
81
82 unsigned int mod = 0;
83 for (auto itr = load_jFexModuleSet->begin(); itr != load_jFexModuleSet->end(); ++itr) {
84
85 const coral::Blob& blob = (itr->second["json"]).data<coral::Blob>();
86 const std::string s((char*)blob.startingAddress(),blob.size());
87 nlohmann::json attrList = nlohmann::json::parse(s);
88
89 if(attrList["JetCalib"] == nullptr) {
90 ATH_MSG_ERROR("Not loaded jFEX JetCalib from "<<m_JfexModuleSettingsKey);
91 return StatusCode::FAILURE;
92 }
93
94 const std::vector<int> v_tmp(attrList["JetCalib"]);
95 if ( not(v_tmp.size() == 9 || v_tmp.size() == 8 || v_tmp.size() == 25 ) ){ //9 ET bins (before 2024), 8 (ctrl) / 25 (fwd) eta bins (from 2024 on)
96 ATH_MSG_ERROR("Not loaded jFEX JetCalib from "<<m_JfexModuleSettingsKey<<" (unexpected size: "<<v_tmp.size()<<")");
97 return StatusCode::FAILURE;
98 }
99
100 jJCalibParams[mod] = std::move(v_tmp);
101 mod++;
102 }
103
104 }
105 else{
106 ATH_MSG_ERROR("Values from "<<m_JfexModuleSettingsKey<< " not loaded. Wrong key?");
107 return StatusCode::FAILURE;
108 }
109 }
110 else{
111
112 // LOADING default values!
113 for(unsigned int fex=0; fex<6; fex++){
114 for(unsigned int range=0; range<25; range++){
115 jJCalibParams[fex][range] = jDBdefaults::jJCalibParams[fex][range];
116 }
117 }
118 }
119
120 writeDBTool->set_jJCalibParam(jJCalibParams);
121
122
123 /***************************************/
124 /* */
125 /* System Settings Parameters */
126 /* */
127 /***************************************/
128
129 // Loading defaults
130 bool PileUpCorrectionJet = jDBdefaults::PileUpCorrectionJet;
131 bool PileUpCorrectionMET = jDBdefaults::PileUpCorrectionMET;
132 int PileUpThresholdLowEm = jDBdefaults::PileUpThresholdLowEm;
133 int PileUpThresholdHighEm = jDBdefaults::PileUpThresholdHighEm;
134 int PileUpThresholdLowHadLar = jDBdefaults::PileUpThresholdLowHadLar;
135 int PileUpThresholdHighHadLar = jDBdefaults::PileUpThresholdHighHadLar;
136 int PileUpThresholdLowHadHecOverlap = jDBdefaults::PileUpThresholdLowHadHecOverlap;
137 int PileUpThresholdHighHadHecOverlap = jDBdefaults::PileUpThresholdHighHadHecOverlap;
138 int PileUpThresholdLowHadTrex = jDBdefaults::PileUpThresholdLowHadTrex;
139 int PileUpThresholdHighHadTrex = jDBdefaults::PileUpThresholdHighHadTrex;
140 int PileUpThresholdLowFcal = jDBdefaults::PileUpThresholdLowFcal;
141 int PileUpThresholdHighFcal = jDBdefaults::PileUpThresholdHighFcal;
142
143
144 if(!m_JfexSystemSettingsKey.empty() && useDBparams) {
145 SG::ReadCondHandle <CondAttrListCollection> load_SystemSet{m_JfexSystemSettingsKey, ctx};
146
147 const std::vector<std::string> myStrings{ "PileUpCorrectionJet", "PileUpCorrectionMET", "PileUpThresholdLowEm", "PileUpThresholdHighEm", "PileUpThresholdLowHadLar", "PileUpThresholdHighHadLar", "PileUpThresholdLowHadHecOverlap", "PileUpThresholdHighHadHecOverlap", "PileUpThresholdLowHadTrex", "PileUpThresholdHighHadTrex", "PileUpThresholdLowFcal", "PileUpThresholdHighFcal" };
148
149 if (load_SystemSet.isValid()) {
150
151 //setting the validity
152 writeCHandle.addDependency(load_SystemSet);
153
154 for (auto itr = load_SystemSet->begin(); itr != load_SystemSet->end(); ++itr) {
155
156 const coral::Blob& blob = (itr->second["json"]).data<coral::Blob>();
157 const std::string s((char*)blob.startingAddress(),blob.size());
158 nlohmann::json attrList = nlohmann::json::parse(s);
159
160 //checking if all the string are present in the json file
161 bool allitemsPresent = true;
162 for(const auto & name:myStrings ) {
163 allitemsPresent = allitemsPresent && attrList.contains(name);
164 }
165 if(allitemsPresent) {
166 PileUpCorrectionJet = (bool) attrList[myStrings.at( 0)];
167 PileUpCorrectionMET = (bool) attrList[myStrings.at( 1)];
168 PileUpThresholdLowEm = (int) attrList[myStrings.at( 2)];
169 PileUpThresholdHighEm = (int) attrList[myStrings.at( 3)];
170 PileUpThresholdLowHadLar = (int) attrList[myStrings.at( 4)];
171 PileUpThresholdHighHadLar = (int) attrList[myStrings.at( 5)];
172 PileUpThresholdLowHadHecOverlap = (int) attrList[myStrings.at( 6)];
173 PileUpThresholdHighHadHecOverlap = (int) attrList[myStrings.at( 7)];
174 PileUpThresholdLowHadTrex = (int) attrList[myStrings.at( 8)];
175 PileUpThresholdHighHadTrex = (int) attrList[myStrings.at( 9)];
176 PileUpThresholdLowFcal = (int) attrList[myStrings.at(10)];
177 PileUpThresholdHighFcal = (int) attrList[myStrings.at(11)];
178 }
179 else {
180 ATH_MSG_DEBUG("Loading Pileup values for jFEX ID A:"<<itr->first <<". Some towers are not used anymore. Skipping");
181 }
182 }
183 }
184 else {
185 ATH_MSG_ERROR("Values from "<<m_JfexSystemSettingsKey<< " not loaded. Wrong key?");
186 return StatusCode::FAILURE;
187 }
188 }
189
190 writeDBTool->set_doPileUpJet(PileUpCorrectionJet);
191 writeDBTool->set_doPileUpMet(PileUpCorrectionMET);
192 writeDBTool->set_PUThrLowEm(PileUpThresholdLowEm);
193 writeDBTool->set_PUThrHighEm(PileUpThresholdHighEm);
194 writeDBTool->set_PUThrLowHadLar(PileUpThresholdLowHadLar);
195 writeDBTool->set_PUThrHighHadLar(PileUpThresholdHighHadLar);
196 writeDBTool->set_PUThrLowHadHecOverlap(PileUpThresholdLowHadHecOverlap);
197 writeDBTool->set_PUThrHighHadHecOverlap(PileUpThresholdHighHadHecOverlap);
198 writeDBTool->set_PUThrLowHadTrex(PileUpThresholdLowHadTrex);
199 writeDBTool->set_PUThrHighHadTrex(PileUpThresholdHighHadTrex);
200 writeDBTool->set_PUThrLowFcal(PileUpThresholdLowFcal);
201 writeDBTool->set_PUThrHighFcal(PileUpThresholdHighFcal);
202
203 /***************************************/
204 /* */
205 /* Noise Cut Parameters */
206 /* */
207 /***************************************/
208
209 // Noise values for EM and HAD
210 // the map contains: key: OnlineID and the array contains {CutJetEM, CutJetHad, CutMetEM, CutMetHad} in that order!
211 std::unordered_map< uint16_t, std::array<uint16_t,4> > NoiseCuts;
212
213 // PileUp values for EM and HAD
214 // the map contains: key: OnlineID and the array contains {CutJetEM, CutJetHad, CutMetEM, CutMetHad} in that order!
215 std::unordered_map< uint16_t, std::array<uint16_t,4> > PileUpWeight;
216
217
218 if(!m_JfexNoiseCutsKey.empty() && useDBparams) {
219
220 SG::ReadCondHandle <CondAttrListCollection> load_jFexNoiseCut{m_JfexNoiseCutsKey, ctx };
221
222 std::vector<std::string> myStringsNoise;
223
224 if (PileUpCorrectionJet == 0 and PileUpCorrectionMET == 0)
225 myStringsNoise = { "CutJetEM", "CutJetHad", "CutMetEM", "CutMetHad" };
226 else if (PileUpCorrectionJet == 1 and PileUpCorrectionMET == 0)
227 myStringsNoise = { "CutJetPUEM", "CutJetPUHad", "CutMetEM", "CutMetHad" };
228 else if (PileUpCorrectionJet == 0 and PileUpCorrectionMET == 1)
229 myStringsNoise = { "CutJetEM", "CutJetHad", "CutMetPUEM", "CutMetPUHad" };
230 else // (PileUpCorrectionJet == 1 and PileUpCorrectionMET == 1)
231 myStringsNoise = { "CutJetPUEM", "CutJetPUHad", "CutMetPUEM", "CutMetPUHad" };
232
233 const std::vector<std::string> myStringsPileup{ "PileUpWeightEM", "PileUpWeightHad", "InverseWeightEM", "InverseWeightHad" };
234
235 // we should check if it is valid and the size is 6 (corresponding to the 6 jfex modules)
236 if (load_jFexNoiseCut.isValid()) {
237
238 //setting the validity
239 writeCHandle.addDependency(load_jFexNoiseCut);
240
241 writeDBTool->set_sendDefaults(false);
242
243 for (auto itr = load_jFexNoiseCut->begin(); itr != load_jFexNoiseCut->end(); ++itr) {
244
245 const coral::Blob& blob = (itr->second["json"]).data<coral::Blob>();
246 const std::string s((char*)blob.startingAddress(),blob.size());
247 nlohmann::json attrList = nlohmann::json::parse(s);
248
249
250 //Trying to update Noise cut values
251 bool allitemsPresent = true;
252 for(const auto & name:myStringsNoise ) {
253 allitemsPresent = allitemsPresent && attrList.contains(name);
254 }
255
256 if( allitemsPresent ) {
257 NoiseCuts[ (uint16_t) itr->first ]= { {(uint16_t) attrList[myStringsNoise.at(0)],(uint16_t) attrList[myStringsNoise.at(1)],(uint16_t) attrList[myStringsNoise.at(2)],(uint16_t) attrList[myStringsNoise.at(3)]} };
258 }
259 else {
260 ATH_MSG_DEBUG("Loading Pileup values for jFEX ID B:"<<itr->first <<". Some towers are not used anymore. Skipping");
261 NoiseCuts[ (uint16_t) itr->first ] = {0, 0, 0, 0};
262 }
263
264 //Trying to update the PileUp values
265 allitemsPresent = true;
266 for(const auto & name:myStringsPileup ) {
267 allitemsPresent = allitemsPresent && attrList.contains(name);
268 }
269
270 if( allitemsPresent ) {
271 PileUpWeight[ (uint16_t) itr->first ]= { {(uint16_t) attrList[myStringsPileup.at(0)],(uint16_t) attrList[myStringsPileup.at(1)],(uint16_t) attrList[myStringsPileup.at(2)],(uint16_t) attrList[myStringsPileup.at(3)]} };
272 }
273 else {
274 ATH_MSG_DEBUG("Loading Pileup values for jFEX ID C:"<<itr->first <<". Some towers are not used anymore. Skipping");
275 PileUpWeight[ (uint16_t) itr->first ] = {0, 0, 0, 0};
276 }
277 }
278
279 }
280 else {
281 ATH_MSG_ERROR("Values from "<<m_JfexNoiseCutsKey<< " not loaded. Wrong key?");
282 return StatusCode::FAILURE;
283 }
284 }
285 else{
286 NoiseCuts[0x0000] = jDBdefaults::PileUpWeight_default; // Unused - filled with 0s
287 NoiseCuts[0x00f0] = jDBdefaults::NoiseCuts_LATOME_TILE;
288 NoiseCuts[0x0f00] = jDBdefaults::NoiseCuts_LATOME_HEC;
289 NoiseCuts[0xf000] = jDBdefaults::NoiseCuts_FCAL;
290
291 PileUpWeight[0x0000] = jDBdefaults::PileUpWeight_default;
292 PileUpWeight[0x00f0] = jDBdefaults::PileUpWeight_default;
293 PileUpWeight[0x0f00] = jDBdefaults::PileUpWeight_default;
294 PileUpWeight[0xf000] = jDBdefaults::PileUpWeight_default;
295 }
296
297
298 writeDBTool->set_NoiseCuts(NoiseCuts);
299 writeDBTool->set_PileUpValues(PileUpWeight);
300
301 if(msgLvl(MSG::DEBUG)){
302
303 std::stringstream myprint;
304 if (useDBparams)
305 myprint << "Parameters obtained from m_JfexModuleSettingsKey: "<< m_JfexModuleSettingsKey << std::endl;
306 else
307 myprint << "JfexModuleSettings obtained from jDBdefaults"<< std::endl;
308 myprint << "jJCalibParam:" << std::endl;
309
310 for(int mod=0; mod<6; mod++) {
311 myprint << "jFEX"<<mod<<" - ";
312 for(int range=0; range<25; range++) {
313 myprint << writeDBTool->get_jJCalibParam(mod,range)<< " ";
314 }
315 myprint << std::endl;
316 }
317 myprint << std::endl;
318
319 ATH_MSG_DEBUG(myprint.str());
320
321
322 std::stringstream myprint1;
323
324 if (useDBparams)
325 myprint1 << "Parameters obtained from m_JfexSystemSettingsKey: "<< m_JfexSystemSettingsKey << std::endl;
326 else
327 myprint1 << "JfexSystemSettings obtained from jDBdefaults"<< std::endl;
328
329 myprint1 << "System setting parameters: " <<std::endl;
330 myprint1 << "PileUpCorrectionJet: " << writeDBTool->get_doPileUpJet() <<std::endl;
331 myprint1 << "PileUpCorrectionMET: " << writeDBTool->get_doPileUpMet() <<std::endl;
332 myprint1 << "PileUpThresholdLowEm: " << writeDBTool->get_PUThrLowEm() <<std::endl;
333 myprint1 << "PileUpThresholdHighEm: " << writeDBTool->get_PUThrHighEm() <<std::endl;
334 myprint1 << "PileUpThresholdLowHadLar: " << writeDBTool->get_PUThrLowHadLar() <<std::endl;
335 myprint1 << "PileUpThresholdHighHadLar: " << writeDBTool->get_PUThrHighHadLar() <<std::endl;
336 myprint1 << "PileUpThresholdLowHadHecOverlap: " << writeDBTool->get_PUThrLowHadHecOverlap() <<std::endl;
337 myprint1 << "PileUpThresholdHighHadHecOverlap: "<< writeDBTool->get_PUThrHighHadHecOverlap()<<std::endl;
338 myprint1 << "PileUpThresholdLowHadTrex: " << writeDBTool->get_PUThrLowHadTrex() <<std::endl;
339 myprint1 << "PileUpThresholdHighHadTrex: " << writeDBTool->get_PUThrHighHadTrex() <<std::endl;
340 myprint1 << "PileUpThresholdLowFcal: " << writeDBTool->get_PUThrLowFcal() <<std::endl;
341 myprint1 << "PileUpThresholdHighFcal: " << writeDBTool->get_PUThrHighFcal() <<std::endl;
342
343 ATH_MSG_DEBUG(myprint1.str());
344
345 std::stringstream myprint2;
346
347 if (useDBparams)
348 myprint2 << "Parameters obtained from m_JfexNoiseCutsKey: "<< m_JfexNoiseCutsKey << std::endl;
349 else
350 myprint2 << "JfexNoiseCuts obtained from jDBdefaults"<< std::endl;
351
352 for( const auto& [key, value] : NoiseCuts) {
353 const auto [CutJetEM, CutJetHad, CutMetEM, CutMetHad] = value;
354 const auto [PileUpWeightEM, PileUpWeightHad, InverseWeightEM, InverseWeightHad] = PileUpWeight[key];
355
356 myprint2 <<"OnlineID: 0x"<< std::hex<<key<<std::dec<< " - CutJetEM: "<< CutJetEM<< ", CutJetHad:"<< CutJetHad<< ", CutMetEM:"<< CutMetEM<< ", CutMetHad:"<< CutMetHad<< ", PileUpWeightEM: "<< PileUpWeightEM<< ", PileUpWeightHad:"<< PileUpWeightHad<< ", InverseWeightEM:"<< InverseWeightEM<< ", InverseWeightHad:"<< InverseWeightHad<< std::endl;
357 }
358
359 ATH_MSG_DEBUG(myprint2.str());
360
361 }
362
363
364
365 // If DB parameters not loaded, valid for infinity and beyond!
366 if (!useDBparams) {
367 writeCHandle.addDependency(IOVInfiniteRange::infiniteRunLB()); // Use infinite IOV
368 }
369
370 //Wrinting into SG!
371 if (writeCHandle.record(std::move(writeDBTool)).isFailure()) {
372 ATH_MSG_ERROR("Could not record " << writeCHandle.key() << " with EventRange " << writeCHandle.getRange() << " into Conditions Store");
373 return StatusCode::FAILURE;
374 }
375 ATH_MSG_INFO("Recorded " << writeCHandle.key() << " with EventRange " << writeCHandle.getRange() << " into Conditions Store");
376
377 return StatusCode::SUCCESS;
378
379}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
bool msgLvl(const MSG::Level lvl) const
static EventIDRange infiniteRunLB()
Produces an EventIDRange that is infinite in RunLumi and invalid in Time.
SG::ReadCondHandleKey< CondAttrListCollection > m_JfexNoiseCutsKey
SG::ReadCondHandleKey< CondAttrListCollection > m_JfexSystemSettingsKey
SG::WriteCondHandleKey< jFEXDBCondData > m_jFEXDBParamsKey
Gaudi::Property< bool > m_isMC
UnsignedIntegerProperty m_dbBeginTimestamp
SG::ReadCondHandleKey< CondAttrListCollection > m_JfexModuleSettingsKey
static constexpr int PileUpThresholdHighHadLar
static constexpr int PileUpThresholdHighEm
static constexpr std::array< uint16_t, 4 > NoiseCuts_LATOME_HEC
static constexpr bool PileUpCorrectionJet
static constexpr int PileUpThresholdLowFcal
static constexpr int PileUpThresholdLowHadTrex
static constexpr int PileUpThresholdLowHadHecOverlap
static constexpr std::array< uint16_t, 4 > NoiseCuts_FCAL
static constexpr std::array< uint16_t, 4 > PileUpWeight_default
static constexpr std::array< uint16_t, 4 > NoiseCuts_LATOME_TILE
static constexpr int PileUpThresholdHighHadTrex
static constexpr int PileUpThresholdHighFcal
static constexpr int PileUpThresholdLowEm
static constexpr int jJCalibParams[6][25]
static constexpr bool PileUpCorrectionMET
static constexpr int PileUpThresholdLowHadLar
static constexpr int PileUpThresholdHighHadHecOverlap
setBGCode setTAP setLVL2ErrorBits bool
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 & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ initialize()

StatusCode LVL1::jFEXCondAlgo::initialize ( )
overridevirtual

Function initialising the algorithm.

Definition at line 29 of file jFEXCondAlgo.cxx.

29 {
30
31 ATH_MSG_INFO("Loading jFEX parameters from DB");
32
36 ATH_CHECK( m_jFEXDBParamsKey.initialize() );
37
38 return StatusCode::SUCCESS;
39}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ inputHandles()

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

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ isReEntrant()

virtual bool AthCondAlgorithm::isReEntrant ( ) const
inlineoverridevirtualinherited

Avoid scheduling algorithm multiple times.

With multiple concurrent events, conditions objects often expire simultaneously for all slots. To avoid that the scheduler runs the CondAlg in each slot, we declare it as "non-reentrant". This ensures that the conditions objects are only created once.

In case a particular CondAlg should behave differently, it can override this method again and return true.

See also
ATEAM-836

Definition at line 39 of file AthCondAlgorithm.h.

39{ 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()

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

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

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

Execute an algorithm.

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

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

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

Override sysInitialize.

Override sysInitialize from the base class.

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

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

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

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_WARNING(x)
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_dbBeginTimestamp

UnsignedIntegerProperty LVL1::jFEXCondAlgo::m_dbBeginTimestamp {this,"BeginTimestamp", 1698527690,"Earliest timestamp that db parameters will be loaded. Default is start of 2023-10-27"}
private

Definition at line 45 of file jFEXCondAlgo.h.

45{this,"BeginTimestamp", 1698527690,"Earliest timestamp that db parameters will be loaded. Default is start of 2023-10-27"};

◆ 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_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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_isMC

Gaudi::Property<bool> LVL1::jFEXCondAlgo::m_isMC {this, "IsMC", false, "For MC, always access the DB"}
private

Definition at line 47 of file jFEXCondAlgo.h.

47{this, "IsMC", false, "For MC, always access the DB"};

◆ m_jFEXDBParamsKey

SG::WriteCondHandleKey<jFEXDBCondData> LVL1::jFEXCondAlgo::m_jFEXDBParamsKey {this, "jFEXDBParamsKey", "jFEXDBParams", "Output for jFEX DB parameters"}
private

Definition at line 38 of file jFEXCondAlgo.h.

38{this, "jFEXDBParamsKey", "jFEXDBParams", "Output for jFEX DB parameters"};

◆ m_JfexModuleSettingsKey

SG::ReadCondHandleKey<CondAttrListCollection> LVL1::jFEXCondAlgo::m_JfexModuleSettingsKey {this,"JfexModuleSettings", "", "Key to store JfexModuleSettings DB path"}
private

Definition at line 41 of file jFEXCondAlgo.h.

41{this,"JfexModuleSettings", "", "Key to store JfexModuleSettings DB path"};

◆ m_JfexNoiseCutsKey

SG::ReadCondHandleKey<CondAttrListCollection> LVL1::jFEXCondAlgo::m_JfexNoiseCutsKey {this,"JfexNoiseCuts" , "", "Key to store JfexNoiseCuts DB path" }
private

Definition at line 42 of file jFEXCondAlgo.h.

42{this,"JfexNoiseCuts" , "", "Key to store JfexNoiseCuts DB path" };

◆ m_JfexSystemSettingsKey

SG::ReadCondHandleKey<CondAttrListCollection> LVL1::jFEXCondAlgo::m_JfexSystemSettingsKey {this,"JfexSystemSettings", "", "Key to store JfexSystemSettings DB path"}
private

Definition at line 43 of file jFEXCondAlgo.h.

43{this,"JfexSystemSettings", "", "Key to store JfexSystemSettings DB path"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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