ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
LVL1::eTowerMakerFromEfexTowers Class Reference

#include <eTowerMakerFromEfexTowers.h>

Inheritance diagram for LVL1::eTowerMakerFromEfexTowers:
Collaboration diagram for LVL1::eTowerMakerFromEfexTowers:

Public Member Functions

 eTowerMakerFromEfexTowers (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~eTowerMakerFromEfexTowers ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (const EventContext &ctx) const override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
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. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKey< xAOD::eFexTowerContainerm_eFexTowerContainerSGKey {this, "InputTowers", "L1_eFexDataTowers", "efexTowers (use L1_eFexEmulatedTowers for built from SC, or L1_eFexDataTowers for efex readout"}
 
SG::ReadHandleKey< xAOD::eFexTowerContainerm_eFexTowerContainer2SGKey {this, "SecondaryInputTowers", "L1_eFexEmulatedTowers", "If specified, will fallback to this collection of towers if the first collection is incomplete"}
 
UnsignedIntegerProperty m_minTowersRequired {this,"MinTowersRequired",1,"Will use the primary collection provided there's at least this many towers there"}
 
SG::WriteHandleKey< LVL1::eTowerContainerm_eTowerContainerSGKey {this, "MyETowers", "eTowerContainer", "MyETowers"}
 
ToolHandle< IeTowerBuilderm_eTowerBuilderTool {this, "eTowerBuilderTool", "LVL1::eTowerBuilder", "Tool that builds eTowers for simulation"}
 
SG::ReadCondHandleKey< CondAttrListCollectionm_noiseCutsKey
 
UnsignedIntegerProperty m_noiseCutBeginTimestamp {this,"NoiseCutsBeginTimestamp",1672531200,"Earliest timestamp that noise cuts will be applied from db. Default is start of 2023"}
 
std::atomic< bool > m_printedNoiseCuts = false
 
std::mutex m_debugMutex
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 19 of file eTowerMakerFromEfexTowers.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

◆ eTowerMakerFromEfexTowers()

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

Definition at line 30 of file eTowerMakerFromEfexTowers.cxx.

31  : AthReentrantAlgorithm(name, pSvcLocator)
32  {
33 
34  }

◆ ~eTowerMakerFromEfexTowers()

LVL1::eTowerMakerFromEfexTowers::~eTowerMakerFromEfexTowers ( )
default

Member Function Documentation

◆ cardinality()

unsigned int AthReentrantAlgorithm::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.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

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

Definition at line 54 of file eTowerMakerFromEfexTowers.cxx.

55 {
56  // load noise cuts .. should really only need to do this at start of runs, not every event!
57  std::map<std::pair<int, int>, int> noiseCutsMap; // key is [eta,layer]
58  bool useHardcodedCuts = false;
59  if(!m_noiseCutsKey.empty()) {
60  // check timestamp of event is not *before* date when started using database
61  if (ctx.eventID().time_stamp() < m_noiseCutBeginTimestamp) {
62  useHardcodedCuts = true;
63  } else {
65  if (noiseCuts.isValid()) {
67  m_printedNoiseCuts = true;
68  ATH_MSG_DEBUG("DB Noise cuts are:");
69  noiseCuts->dump();
70  }
71  if(noiseCuts->size()==0) {
72  ATH_MSG_ERROR("No noise cuts loaded from conditions db for event with timestamp" << ctx.eventID().time_stamp());
73  return StatusCode::FAILURE;
74  }
75  for (auto itr = noiseCuts->begin(); itr != noiseCuts->end(); ++itr) {
76  if (itr->first >= 50) continue;
77  noiseCutsMap[std::pair(itr->first, 0)] = itr->second["EmPS"].data<int>();
78  noiseCutsMap[std::pair(itr->first, 1)] = itr->second["EmFR"].data<int>();
79  noiseCutsMap[std::pair(itr->first, 2)] = itr->second["EmMD"].data<int>();
80  noiseCutsMap[std::pair(itr->first, 3)] = itr->second["EmBK"].data<int>();
81  noiseCutsMap[std::pair(itr->first, 4)] = (itr->first >= 10 && itr->first < 40)
82  ? itr->second["Tile"].data<int>()
83  : itr->second["HEC"].data<int>();
84  }
85  }
86  }
87  }
88 
89  // STEP 0 - Make a fresh local eTowerContainer
90  std::unique_ptr<eTowerContainer> local_eTowerContainerRaw = std::make_unique<eTowerContainer>();
91 
92  // STEP 1 - Make some eTowers and fill the local container
93  m_eTowerBuilderTool->init(local_eTowerContainerRaw);
94  local_eTowerContainerRaw->clearContainerMap();
95  local_eTowerContainerRaw->fillContainerMap();
96 
98  if((!eFexTowers.isValid() || eFexTowers->size() < m_minTowersRequired) && !m_eFexTowerContainer2SGKey.empty()) {
100  // removing this to avoid breaking frozen tier0 policy
101  // bug keeping commented out until sure we've replaced with a good alternative
102  //const xAOD::EventInfo* ei = nullptr;
103  //CHECK( evtStore()->retrieve(ei) );
104  //ei->auxdecor<bool>("eTowerMakerFromEfexTowers_usedSecondary") = true;
105  }
106 
107  // STEP 2 - Do the efexTower-tower mapping - put this information into the eTowerContainer
108  for(auto eFexTower : *eFexTowers) {
109  // need to ensure this eFexTower is a "core" tower in a module ... so that there aren't disconnected inputs
110  // and also need to only do one tower per location, of course
111  auto tower = local_eTowerContainerRaw->findTower(eFexTower->eFEXtowerID());
112  auto counts = eFexTower->et_count();
113  for(size_t i=0;i<counts.size();i++) {
114  if(i<10 && eFexTower->em_status()) continue; // bad status bits have their energy zerod by the firmware
115  if(i==10 && eFexTower->had_status()) continue;
116  if (eFexTower->disconnectedCount(i)) continue;
117  if (counts.at(i)==0 || (counts.at(i)>1020 && counts.at(i)!=1023)) continue; // absent (1025 from BS decoder), invalid (1022), empty (0) or masked (0) channel
118  // special case logic for reordering |eta|=2.5 and overlap
119  // and l1 1.8-2.0 ... need to put the merged sc counts into slots that wont be split
120  int layer; int cell=i;
121  if(i<1 || (i==4 && std::abs(eFexTower->eta()+0.025)>2.4)) {layer = 0;cell=0;}
122  else if(i<5) layer = 1;
123  else if(i<9) layer = 2;
124  else if(i<10) layer = 3;
125  else layer = 4;
126 
127  // apply noise cut ... for runs up to 14th April 2023 was killing with <, then from run 449180 onwards kills with <=
128  // since long-term behaviour is latter, will use that
129  //if(useHardcodedCuts && !eFEXCompression::noiseCut(counts.at(i),layer,true)) continue;
130  if(!useHardcodedCuts && counts.at(i) <= noiseCutsMap[std::pair( int( (eFexTower->eta() + 2.525)/0.1 ), layer)]) continue;
131 
132  // checking we haven't already filled this tower (happens when using efexDataTowers ... multiple towers per loc for different modules)
133  // this is ugly as ...
134  if(!tower->getET_float(layer,cell-(layer==1)*1-(layer==2)*5-(layer==3)*9-(layer==4)*10)) {
135  // if tile then count is in steps of 500 MeV, not in latome multilinear encoding
136  bool isTile = (std::abs(eFexTower->eta()+0.025)<1.5 && layer==4);
137  tower->setET(cell,isTile ? (counts.at(i)*500.) : eFEXCompression::expand(counts.at(i)),layer + isTile, useHardcodedCuts);
138  }
139  }
140  }
141 
142  if(msgLvl(MSG::DEBUG)) {
143  std::scoped_lock lock(m_debugMutex);
144  // dump towers to histograms
145  // counts are the "codes" of multi-scale latome, or tile count
146 
147  TFile *debugFile = dynamic_cast<TFile *>(gROOT->GetListOfFiles()->FindObject("debug_eFexTowerMakerFromEfexTowers.root"));
148  if (!debugFile) debugFile = TFile::Open("debug_eFexTowerMakerFromEfexTowers.root", "RECREATE");
149  if (debugFile->GetListOfKeys()->GetEntries() < 20) {
150  TDirectory *dir = gDirectory;
151  debugFile->cd();
152  TH2D ps("ps", "ps [code];#eta;#phi", 50, -2.5, 2.5, 64, -M_PI, M_PI);
153  TH2D l1("l1", "l1 [code];#eta;#phi", 200, -2.5, 2.5, 64, -M_PI, M_PI);
154  TH2D l2("l2", "l2 [code];#eta;#phi", 200, -2.5, 2.5, 64, -M_PI, M_PI);
155  TH2D l3("l3", "l3 [code];#eta;#phi", 50, -2.5, 2.5, 64, -M_PI, M_PI);
156  TH2D had("had", "had [code~25MeV or 500MeV for tile];#eta;#phi", 50, -2.5, 2.5, 64, -M_PI, M_PI);
157  std::vector < TH1 * > hists{&ps, &l1, &l2, &l3, &had};
158  for(auto eFexTower : *eFexTowers) {
159  auto counts = eFexTower->et_count();
160  if (counts.empty()) continue;
161  int etaIndex = int( (eFexTower->eta()+0.025)*10 ) + (((eFexTower->eta()+0.025)<0) ? -1 : 1); // runs from -25 to 25 (excluding 0)
162  int phiIndex = int( (eFexTower->phi()+0.025)*32./M_PI ) + ((eFexTower->phi()+0.025)<0 ? -1 : 1); // runs from -32 to 32 (excluding 0)
163  double tEta = ((etaIndex < 0 ? 0.5 : -0.5) + etaIndex - 0.5) * 0.1; // left edge
164  double tPhi = ((phiIndex < 0 ? 0.5 : -0.5) + phiIndex) * M_PI / 32; // centre
165  for(size_t i=0;i<counts.size();i++) {
166  if(i<10 && eFexTower->em_status()) continue; // bad status bits have their energy zerod by the firmware
167  if(i==10 && eFexTower->had_status()) continue;
168  if (eFexTower->disconnectedCount(i)) continue;
169  int layer; int cell=i;
170  if(i<1 || (i==4 && std::abs(eFexTower->eta()+0.025)>2.4)) {layer = 0;cell=0;}
171  else if(i<5) {layer = 1;cell = i-1;}
172  else if(i<9) {layer = 2;cell = i-5;}
173  else if(i<10) {layer = 3;cell=0;}
174  else {layer = 4;cell=0;}
175  if(!useHardcodedCuts && counts.at(i) <= noiseCutsMap[std::pair( int( (eFexTower->eta() + 2.525)/0.1 ), layer)]) continue;
176  hists.at(layer)->SetBinContent(hists.at(layer)->FindFixBin(tEta + 0.025 * cell + 0.0125, tPhi),counts.at(i));
177 
178  }
179  }
180 
181  TCanvas c;
182  c.SetName(TString::Format("evt%lu", ctx.eventID().event_number()));
183  c.SetTitle(TString::Format("Run %u LB %u Event %lu", ctx.eventID().run_number(), ctx.eventID().lumi_block(),
184  ctx.eventID().event_number()));
185  c.Divide(2, 3);
186  TH2D tobs("tobs", "Sum [MeV];#eta;#phi", 50, -2.5, 2.5, 64, -M_PI, M_PI);
187  for (size_t i = 0; i < hists.size(); i++) {
188  c.GetPad(i + 1)->cd();gPad->SetGrid(1,1);
189  hists[i]->SetStats(false);
190  hists[i]->SetMarkerSize(2); // controls text size
191  hists[i]->GetXaxis()->SetRangeUser(-0.3, 0.3);
192  hists[i]->GetYaxis()->SetRangeUser(-0.3, 0.3);
193  hists[i]->Draw((hists[i]->GetNbinsX() > 50) ? "coltext89" : "coltext");
194  for (int ii = 1; ii <= hists[i]->GetNbinsX(); ii++) {
195  bool isTile = (i==4 && std::abs(hists[i]->GetXaxis()->GetBinCenter(ii))<1.5);
196  for (int jj = 1; jj <= hists[i]->GetNbinsY(); jj++)
197  tobs.Fill(hists[i]->GetXaxis()->GetBinCenter(ii), hists[i]->GetYaxis()->GetBinCenter(jj),
198  isTile ? (hists[i]->GetBinContent(ii, jj)*500.) : eFEXCompression::expand(hists[i]->GetBinContent(ii, jj)));
199  }
200  }
201  c.GetPad(hists.size() + 1)->cd();
202  tobs.SetStats(false);
203  tobs.Draw("col");
204  TBox b(-0.3, -0.3, 0.3, 0.3);
205  b.SetLineColor(kRed);
206  b.SetFillStyle(0);
207  b.SetLineWidth(1);
208  b.SetBit(TBox::kCannotMove);
209  tobs.GetListOfFunctions()->Add(b.Clone());
210  gPad->AddExec("onClick", TString::Format(
211  "{ auto pad = gPad->GetCanvas()->GetPad(%lu); if( pad->GetEvent()==kButton1Down ) { double x = pad->PadtoX(pad->AbsPixeltoX(pad->GetEventX())); double y = pad->PadtoY(pad->AbsPixeltoY(pad->GetEventY())); for(int i=1;i<%lu;i++) {auto h = dynamic_cast<TH1*>(gPad->GetCanvas()->GetPad(i)->GetListOfPrimitives()->At(1)); if(h) {h->GetXaxis()->SetRangeUser(x-0.3,x+0.3);h->GetYaxis()->SetRangeUser(y-0.3,y+0.3); } } if(auto b = dynamic_cast<TBox*>(pad->FindObject(\"tobs\")->FindObject(\"TBox\"))) {b->SetX1(x-0.3);b->SetX2(x+0.3);b->SetY1(y-0.3);b->SetY2(y+0.3);} gPad->GetCanvas()->Paint(); gPad->GetCanvas()->Update(); } }",
212  hists.size() + 1, hists.size() + 1));
213  c.Write();
214  gDirectory = dir;
215  }
216  }
217 
218 
219 
220  // STEP 3 - Write the completed eTowerContainer into StoreGate (move the local copy in memory)
222  ATH_CHECK(eTowerContainerSG.record(std::move(/*my_eTowerContainerRaw*/local_eTowerContainerRaw)));
223 
224  // STEP 4 - Close and clean the event
225  m_eTowerBuilderTool->reset();
226 
227  return StatusCode::SUCCESS;
228 }

◆ 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 & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ initialize()

StatusCode LVL1::eTowerMakerFromEfexTowers::initialize ( )
overridevirtual

Definition at line 37 of file eTowerMakerFromEfexTowers.cxx.

38 {
39  ATH_CHECK( m_eTowerBuilderTool.retrieve() );
40  ATH_CHECK( m_eFexTowerContainerSGKey.initialize() );
44 
45  if (!m_noiseCutsKey.empty()) {
46  // disable built-in noise cuts because will be loading them from conditions db instead
48  }
49 
50  return StatusCode::SUCCESS;
51 }

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

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::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 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::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 InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_debugMutex

std::mutex LVL1::eTowerMakerFromEfexTowers::m_debugMutex
mutableprivate

Definition at line 46 of file eTowerMakerFromEfexTowers.h.

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

SG::ReadHandleKey<xAOD::eFexTowerContainer> LVL1::eTowerMakerFromEfexTowers::m_eFexTowerContainer2SGKey {this, "SecondaryInputTowers", "L1_eFexEmulatedTowers", "If specified, will fallback to this collection of towers if the first collection is incomplete"}
private

Definition at line 34 of file eTowerMakerFromEfexTowers.h.

◆ m_eFexTowerContainerSGKey

SG::ReadHandleKey<xAOD::eFexTowerContainer> LVL1::eTowerMakerFromEfexTowers::m_eFexTowerContainerSGKey {this, "InputTowers", "L1_eFexDataTowers", "efexTowers (use L1_eFexEmulatedTowers for built from SC, or L1_eFexDataTowers for efex readout"}
private

Definition at line 31 of file eTowerMakerFromEfexTowers.h.

◆ m_eTowerBuilderTool

ToolHandle<IeTowerBuilder> LVL1::eTowerMakerFromEfexTowers::m_eTowerBuilderTool {this, "eTowerBuilderTool", "LVL1::eTowerBuilder", "Tool that builds eTowers for simulation"}
private

Definition at line 38 of file eTowerMakerFromEfexTowers.h.

◆ m_eTowerContainerSGKey

SG::WriteHandleKey<LVL1::eTowerContainer> LVL1::eTowerMakerFromEfexTowers::m_eTowerContainerSGKey {this, "MyETowers", "eTowerContainer", "MyETowers"}
private

Definition at line 37 of file eTowerMakerFromEfexTowers.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 AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_minTowersRequired

UnsignedIntegerProperty LVL1::eTowerMakerFromEfexTowers::m_minTowersRequired {this,"MinTowersRequired",1,"Will use the primary collection provided there's at least this many towers there"}
private

Definition at line 35 of file eTowerMakerFromEfexTowers.h.

◆ m_noiseCutBeginTimestamp

UnsignedIntegerProperty LVL1::eTowerMakerFromEfexTowers::m_noiseCutBeginTimestamp {this,"NoiseCutsBeginTimestamp",1672531200,"Earliest timestamp that noise cuts will be applied from db. Default is start of 2023"}
private

Definition at line 42 of file eTowerMakerFromEfexTowers.h.

◆ m_noiseCutsKey

SG::ReadCondHandleKey<CondAttrListCollection> LVL1::eTowerMakerFromEfexTowers::m_noiseCutsKey
private
Initial value:
{this,"NoiseCutsKey","",
"Key to noise cuts (AttrListCollection)"}

Definition at line 40 of file eTowerMakerFromEfexTowers.h.

◆ m_printedNoiseCuts

std::atomic<bool> LVL1::eTowerMakerFromEfexTowers::m_printedNoiseCuts = false
mutableprivate

Definition at line 44 of file eTowerMakerFromEfexTowers.h.

◆ 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:
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
xAOD::eFexTower_v1::eFEXtowerID
uint32_t eFEXtowerID() const
setter for the above
Definition: eFexTower_v1.cxx:23
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LVL1::eTowerMakerFromEfexTowers::m_eFexTowerContainerSGKey
SG::ReadHandleKey< xAOD::eFexTowerContainer > m_eFexTowerContainerSGKey
Definition: eTowerMakerFromEfexTowers.h:31
LVL1::eTowerMakerFromEfexTowers::m_eFexTowerContainer2SGKey
SG::ReadHandleKey< xAOD::eFexTowerContainer > m_eFexTowerContainer2SGKey
Definition: eTowerMakerFromEfexTowers.h:34
StateLessPT_NewConfig.Format
Format
Definition: StateLessPT_NewConfig.py:146
LVL1::eTowerMakerFromEfexTowers::m_eTowerBuilderTool
ToolHandle< IeTowerBuilder > m_eTowerBuilderTool
Definition: eTowerMakerFromEfexTowers.h:38
xAOD::eFexTower
eFexTower_v1 eFexTower
Define the latest version of the TriggerTower class.
Definition: eFexTower.h:15
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
LVL1::eTowerMakerFromEfexTowers::m_noiseCutsKey
SG::ReadCondHandleKey< CondAttrListCollection > m_noiseCutsKey
Definition: eTowerMakerFromEfexTowers.h:40
M_PI
#define M_PI
Definition: ActiveFraction.h:11
LVL1::eTowerMakerFromEfexTowers::m_minTowersRequired
UnsignedIntegerProperty m_minTowersRequired
Definition: eTowerMakerFromEfexTowers.h:35
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
LVL1::eFEXCompression::expand
static int expand(unsigned int code)
Uncompress data.
Definition: eFEXCompression.cxx:55
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::eFexTower_v1::phi
float phi() const
setter for the above
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
LVL1::eFEXCompression::s_disableNoiseCuts
static std::atomic< bool > s_disableNoiseCuts
Definition: eFEXCompression.h:59
xAOD::eFexTower_v1::eta
float eta() const
The pseudorapidity ( )
LVL1::eTowerMakerFromEfexTowers::m_noiseCutBeginTimestamp
UnsignedIntegerProperty m_noiseCutBeginTimestamp
Definition: eTowerMakerFromEfexTowers.h:42
skel.l2
l2
Definition: skel.GENtoEVGEN.py:399
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
lumiFormat.i
int i
Definition: lumiFormat.py:85
LVL1::eTowerMakerFromEfexTowers::m_debugMutex
std::mutex m_debugMutex
Definition: eTowerMakerFromEfexTowers.h:46
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
xAOD::eFexTower_v1::disconnectedCount
bool disconnectedCount(size_t idx) const
setter for the above
Definition: eFexTower_v1.cxx:77
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MakeTH3DFromTH2Ds.hists
hists
Definition: MakeTH3DFromTH2Ds.py:72
xAOD::eFexTower_v1::et_count
const std::vector< uint16_t > & et_count() const
get Energy Counts
LVL1::eTowerMakerFromEfexTowers::m_eTowerContainerSGKey
SG::WriteHandleKey< LVL1::eTowerContainer > m_eTowerContainerSGKey
Definition: eTowerMakerFromEfexTowers.h:37
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
LVL1::eTowerMakerFromEfexTowers::m_printedNoiseCuts
std::atomic< bool > m_printedNoiseCuts
Definition: eTowerMakerFromEfexTowers.h:44
beamspotman.dir
string dir
Definition: beamspotman.py:623
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::eFexTower_v1::had_status
uint32_t had_status() const
setter for the above
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
eflowRec::phiIndex
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition: EtaPhiLUT.cxx:23
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
PyPoolBrowser.expand
expand
Definition: PyPoolBrowser.py:128
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
skel.l1
l1
Definition: skel.GENtoEVGEN.py:398
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
python.compressB64.c
def c
Definition: compressB64.py:93
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >