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

Modified class for shower library generation algorithm. More...

#include <FastCaloSimParamAlg.h>

Inheritance diagram for FastCaloSimParamAlg:
Collaboration diagram for FastCaloSimParamAlg:

Public Member Functions

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

StatusCode clusterize (ISF_FCS_Parametrization::FCS_StepInfoCollection *stepinfo) const
 
StatusCode truncate (ISF_FCS_Parametrization::FCS_StepInfoCollection *stepinfo) const
 
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< ISF_FCS_Parametrization::FCS_StepInfoCollectionm_inputCollectionKey
 
SG::WriteHandleKey< ISF_FCS_Parametrization::FCS_StepInfoCollectionm_outputCollectionKey
 
BooleanProperty m_clusterize
 
DoubleProperty m_truncate
 
DoubleProperty m_maxDistance
 
DoubleProperty m_maxRadius
 property, see LArG4GenShowerLib::LArG4GenShowerLib More...
 
DoubleProperty m_maxRadiusLAr
 property, see LArG4GenShowerLib::LArG4GenShowerLib More...
 
DoubleProperty m_maxRadiusHEC
 property, see LArG4GenShowerLib::LArG4GenShowerLib More...
 
DoubleProperty m_maxRadiusFCAL
 property, see LArG4GenShowerLib::LArG4GenShowerLib More...
 
DoubleProperty m_maxRadiusTile
 property, see LArG4GenShowerLib::LArG4GenShowerLib More...
 
DoubleProperty m_maxTime
 
DoubleProperty m_maxTimeLAr
 
DoubleProperty m_maxTimeHEC
 
DoubleProperty m_maxTimeFCAL
 
DoubleProperty m_maxTimeTile
 
DoubleProperty m_minEnergy
 property, see LArG4GenShowerLib::LArG4GenShowerLib More...
 
DoubleProperty m_containmentEnergy
 property, see LArG4GenShowerLib::LArG4GenShowerLib More...
 
DoubleProperty m_energyFraction
 property, see LArG4GenShowerLib::LArG4GenShowerLib More...
 
StringArrayProperty m_lib_struct_files
 
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
 
DataObjIDColl m_extendedExtraObjects
 
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

Modified class for shower library generation algorithm.

Definition at line 39 of file FastCaloSimParamAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ FastCaloSimParamAlg()

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

Definition at line 39 of file FastCaloSimParamAlg.cxx.

40  : AthAlgorithm(name, pSvcLocator)
41  , m_inputCollectionKey("EventSteps")
42  , m_outputCollectionKey("MergedEventSteps")
43 {
44  declareProperty("InputCollectionName", m_inputCollectionKey, "");
45  declareProperty("OutputCollectionName", m_outputCollectionKey, "");
46  declareProperty("Clusterize", m_clusterize = true, "merge nearby hits");
47  declareProperty("Truncate", m_truncate = 2,"truncate hits with t>1000ns (if >=2)");
48  declareProperty("MaxDistance", m_maxDistance = 50000.,
49  "max distance squared after which the hits will be truncated");
50  declareProperty("MinEnergy", m_minEnergy = .99,
51  "energy border, that truncation won't cross");
52  declareProperty("MaxRadius", m_maxRadius = 25.,
53  "maximal radius squared until two hits will be combined");
54  declareProperty("MaxRadiusLAr", m_maxRadiusLAr = 25.,
55  "maximal radius in LAr squared until two hits will be combined");
56  declareProperty("MaxRadiusHEC", m_maxRadiusHEC = 100.,
57  "maximal radius in HEC squared until two hits will be combined");
58  declareProperty("MaxRadiusFCAL", m_maxRadiusFCAL = 100.,
59  "maximal radius in FCAL squared until two hits will be combined");
60  declareProperty("MaxRadiusTile", m_maxRadiusTile = 100.,
61  "maximal radius in Tile squared until two hits will be combined");
62 
63  declareProperty("MaxTime", m_maxTime = 25., "max time difference to merge two hits (ns) ");
64  declareProperty("MaxTimeLAr", m_maxTimeLAr = 25., "max time difference to merge two hits (ns) ");
65  declareProperty("MaxTimeHEC", m_maxTimeHEC = 25., "max time difference to merge two hits (ns) ");
66  declareProperty("MaxTimeFCAL", m_maxTimeFCAL = 25., "max time difference to merge two hits (ns) ");
67  declareProperty("MaxTimeTile", m_maxTimeTile = 25., "max time difference to merge two hits (ns) ");
68 
69 
70  declareProperty("ContainmentEnergy", m_containmentEnergy = 0.95,
71  "energy fraction that will be inside containment borders");
72  declareProperty("LibStructFiles", m_lib_struct_files,
73  "List of files to read library structures from");
74  declareProperty("EnergyFraction", m_energyFraction = .02,
75  "the allowed amount of energy that can be deposited outside calorimeter region ");
76 }

Member Function Documentation

◆ clusterize()

StatusCode FastCaloSimParamAlg::clusterize ( ISF_FCS_Parametrization::FCS_StepInfoCollection stepinfo) const
private

Definition at line 113 of file FastCaloSimParamAlg.cxx.

114 {
115  ATH_MSG_DEBUG("Initial clusterize size: "<<stepinfo->size()<<" - will merge steps in the same cell which are less than dR and dT to each other");
116  double total_energy1(0.);
117  for (const auto step: *stepinfo) {
118  total_energy1+=step->energy();
119  }
120  ATH_MSG_DEBUG("Check: total energy before clusterize "<<total_energy1);
121 
122  SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,Gaudi::Hive::currentContext()};
123  ATH_CHECK(caloMgrHandle.isValid());
124  const CaloDetDescrManager* calo_dd_man = *caloMgrHandle;
125 
126  // Try this if it will be faster: split to cells first
127  std::map<Identifier, ISF_FCS_Parametrization::FCS_StepInfoCollection*> FCS_SIC_cells;
128  for (const auto step: *stepinfo) {
129  if (FCS_SIC_cells.find(step->identify()) != FCS_SIC_cells.end()) {// Already have a step for this cell
130  auto&& stepCopy = std::make_unique<ISF_FCS_Parametrization::FCS_StepInfo>(*step);
131  FCS_SIC_cells[step->identify()]->push_back( stepCopy.release() );
132  }
133  else { // First step for this cell
134  auto && new_fcs_sic = std::make_unique<ISF_FCS_Parametrization::FCS_StepInfoCollection>();
135  auto&& stepCopy = std::make_unique<ISF_FCS_Parametrization::FCS_StepInfo>(*step);
136  new_fcs_sic->push_back( stepCopy.release() );
137  FCS_SIC_cells.insert(std::pair<Identifier, ISF_FCS_Parametrization::FCS_StepInfoCollection*>(step->identify(),new_fcs_sic.release()));
138  }
139  }
140 
141  ATH_MSG_DEBUG("Merging separately in each cell: Ncells: "<<FCS_SIC_cells.size());
142  // Then do merging for each cell
143  for (std::map<Identifier, ISF_FCS_Parametrization::FCS_StepInfoCollection*>::iterator it = FCS_SIC_cells.begin(); it!= FCS_SIC_cells.end(); ++it) {
144  std::stable_sort(FCS_SIC_cells[it->first]->begin(), FCS_SIC_cells[it->first]->end(), SortByE());
145  if (! calo_dd_man->get_element(it->first)) {
146  // Bad identifier
147  ATH_MSG_WARNING("Something wrong with identifier: "<<it->first);
148  continue;
149  }
150  else if ((it->second)->size()==1) {
151  continue; // Go to next iterator
152  }
153 
154  const CaloCell_ID::CaloSample layer = calo_dd_man->get_element(it->first)->getSampling();
155  double dsame(0.);
156  double tsame(0.);
158  dsame = m_maxRadiusLAr;
159  tsame = m_maxTimeLAr;
160  }
161  else if (layer >= CaloCell_ID::HEC0 && layer <= CaloCell_ID::HEC3) {
162  dsame = m_maxRadiusHEC;
163  tsame = m_maxTimeHEC;
164  }
166  dsame = m_maxRadiusTile;
167  tsame = m_maxTimeTile;
168  }
170  dsame = m_maxRadiusFCAL;
171  tsame = m_maxTimeFCAL;
172  }
173  else {
174  dsame = m_maxRadius;
175  tsame = m_maxTime;
176  }
178  while ( it1 != (it->second)->end() ) {
180  while (it2 != (it->second)->end()) {
181  if (((*it1)->diff2(**it2) < dsame) && std::fabs((*it1)->time() - (*it2)->time()) < tsame ) {
182  **it1 += **it2;
183  it2 = (it->second)->erase(it2); // also calls delete on the pointer (because the DataVector owns its elements)
184  continue;
185  }
186  ++it2;
187  }
188  ++it1;
189  }
190  }
191  // Merge them back into a single list
192  ATH_MSG_VERBOSE("Copying back");
193  stepinfo->clear(); // also calls delete on all the removed elements (because the DataVector owns its elements)
194  for (std::map<Identifier, ISF_FCS_Parametrization::FCS_StepInfoCollection*>::iterator it = FCS_SIC_cells.begin(); it!= FCS_SIC_cells.end(); ++it) {
195  for (const auto step: *(it->second)) {
196  auto&& stepCopy = std::make_unique<ISF_FCS_Parametrization::FCS_StepInfo>(*step);
197  stepinfo->push_back( stepCopy.release() );
198  }
199  // Tidy up temporary FCS_StepInfoCollections as we go
200  it->second->clear(); // also calls delete on all the removed elements (because the DataVector owns its elements)
201  delete (it->second);
202  }
203  double total_energy2(0.);
204  for (const auto step: *stepinfo) {
205  total_energy2+=step->energy();
206  }
207  ATH_MSG_DEBUG("Check: total energy "<<total_energy2);
208  ATH_MSG_DEBUG("After clusterize: "<<stepinfo->size());
209  unsigned int nInvalid(0);
210  // Remove invalid FCS_StepInfo objects
212  while(stepIter != stepinfo->end()) {
213  if ((*stepIter)->valid()) {
214  ++stepIter;
215  continue;
216  }
217  ++nInvalid;
218  stepIter = stepinfo->erase(stepIter); // also calls delete on the pointer (because the DataVector owns its elements)
219  }
220  ATH_MSG_DEBUG("Removed "<<nInvalid<<" StepInfo objects. New collection size: "<<stepinfo->size());
221  return StatusCode::SUCCESS;
222 }

◆ declareGaudiProperty() [1/4]

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

Definition at line 89 of file FastCaloSimParamAlg.cxx.

90 {
93  ATH_CHECK(outputHandle.record(std::make_unique<ISF_FCS_Parametrization::FCS_StepInfoCollection>()));
94 
95  // TODO would be more efficient to directly write the truncated
96  // input collection to the output collection rather than copying it
97  // first.
98  for (const auto *const step: *inputHandle ) {
99  auto&& stepCopy = std::make_unique<ISF_FCS_Parametrization::FCS_StepInfo>(*step);
100  outputHandle->push_back( stepCopy.release() );
101  }
102  ATH_CHECK(this->truncate(&*outputHandle));
103 
104  if (m_clusterize) {
105  ATH_CHECK(this->clusterize(&*outputHandle));
106  }
107  else {
108  ATH_MSG_DEBUG("Not merging nearby hits: "<<m_clusterize);
109  }
110  return StatusCode::SUCCESS;
111 }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

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

◆ initialize()

StatusCode FastCaloSimParamAlg::initialize ( )
finaloverridevirtual

Definition at line 79 of file FastCaloSimParamAlg.cxx.

80 {
81  ATH_MSG_DEBUG("Initializing");
85  ATH_MSG_DEBUG("FastCaloSimParamAlg " << this->name() << " initialized");
86  return StatusCode::SUCCESS;
87 }

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< 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< 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< 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< 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< 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  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

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

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

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

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

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 }

◆ sysStart()

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

Handle START transition.

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

◆ truncate()

StatusCode FastCaloSimParamAlg::truncate ( ISF_FCS_Parametrization::FCS_StepInfoCollection stepinfo) const
private

Definition at line 224 of file FastCaloSimParamAlg.cxx.

225 {
226  ATH_MSG_DEBUG("Initial truncate size: "<<stepinfo->size()<<" settings: "<<m_truncate);
227  if (m_truncate>0) {
229  while (stepIter != stepinfo->end()) {
230  if ((m_truncate>=2)&&((*stepIter)->time()>1000)) {
231  stepIter = stepinfo->erase(stepIter); // also calls delete on the pointer (because the DataVector owns its elements)
232  continue;
233  }
234  ++stepIter;
235  }
236  ATH_MSG_DEBUG("After truncate size: "<<stepinfo->size());
237  }
238  return StatusCode::SUCCESS;
239 }

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_caloMgrKey

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

Definition at line 85 of file FastCaloSimParamAlg.h.

◆ m_clusterize

BooleanProperty FastCaloSimParamAlg::m_clusterize
private

Definition at line 63 of file FastCaloSimParamAlg.h.

◆ m_containmentEnergy

DoubleProperty FastCaloSimParamAlg::m_containmentEnergy
private

property, see LArG4GenShowerLib::LArG4GenShowerLib

Definition at line 80 of file FastCaloSimParamAlg.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_energyFraction

DoubleProperty FastCaloSimParamAlg::m_energyFraction
private

property, see LArG4GenShowerLib::LArG4GenShowerLib

Definition at line 81 of file FastCaloSimParamAlg.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_inputCollectionKey

SG::ReadHandleKey<ISF_FCS_Parametrization::FCS_StepInfoCollection> FastCaloSimParamAlg::m_inputCollectionKey
private

Definition at line 61 of file FastCaloSimParamAlg.h.

◆ m_lib_struct_files

StringArrayProperty FastCaloSimParamAlg::m_lib_struct_files
private

Definition at line 83 of file FastCaloSimParamAlg.h.

◆ m_maxDistance

DoubleProperty FastCaloSimParamAlg::m_maxDistance
private

Definition at line 65 of file FastCaloSimParamAlg.h.

◆ m_maxRadius

DoubleProperty FastCaloSimParamAlg::m_maxRadius
private

property, see LArG4GenShowerLib::LArG4GenShowerLib

Definition at line 66 of file FastCaloSimParamAlg.h.

◆ m_maxRadiusFCAL

DoubleProperty FastCaloSimParamAlg::m_maxRadiusFCAL
private

property, see LArG4GenShowerLib::LArG4GenShowerLib

Definition at line 69 of file FastCaloSimParamAlg.h.

◆ m_maxRadiusHEC

DoubleProperty FastCaloSimParamAlg::m_maxRadiusHEC
private

property, see LArG4GenShowerLib::LArG4GenShowerLib

Definition at line 68 of file FastCaloSimParamAlg.h.

◆ m_maxRadiusLAr

DoubleProperty FastCaloSimParamAlg::m_maxRadiusLAr
private

property, see LArG4GenShowerLib::LArG4GenShowerLib

Definition at line 67 of file FastCaloSimParamAlg.h.

◆ m_maxRadiusTile

DoubleProperty FastCaloSimParamAlg::m_maxRadiusTile
private

property, see LArG4GenShowerLib::LArG4GenShowerLib

Definition at line 70 of file FastCaloSimParamAlg.h.

◆ m_maxTime

DoubleProperty FastCaloSimParamAlg::m_maxTime
private

Definition at line 72 of file FastCaloSimParamAlg.h.

◆ m_maxTimeFCAL

DoubleProperty FastCaloSimParamAlg::m_maxTimeFCAL
private

Definition at line 75 of file FastCaloSimParamAlg.h.

◆ m_maxTimeHEC

DoubleProperty FastCaloSimParamAlg::m_maxTimeHEC
private

Definition at line 74 of file FastCaloSimParamAlg.h.

◆ m_maxTimeLAr

DoubleProperty FastCaloSimParamAlg::m_maxTimeLAr
private

Definition at line 73 of file FastCaloSimParamAlg.h.

◆ m_maxTimeTile

DoubleProperty FastCaloSimParamAlg::m_maxTimeTile
private

Definition at line 76 of file FastCaloSimParamAlg.h.

◆ m_minEnergy

DoubleProperty FastCaloSimParamAlg::m_minEnergy
private

property, see LArG4GenShowerLib::LArG4GenShowerLib

Definition at line 79 of file FastCaloSimParamAlg.h.

◆ m_outputCollectionKey

SG::WriteHandleKey<ISF_FCS_Parametrization::FCS_StepInfoCollection> FastCaloSimParamAlg::m_outputCollectionKey
private

Definition at line 62 of file FastCaloSimParamAlg.h.

◆ m_truncate

DoubleProperty FastCaloSimParamAlg::m_truncate
private

Definition at line 64 of file FastCaloSimParamAlg.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
SortByE
Definition: FastCaloSimParamAlg.cxx:34
FastCaloSimParamAlg::m_lib_struct_files
StringArrayProperty m_lib_struct_files
Definition: FastCaloSimParamAlg.h:83
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
FastCaloSimParamAlg::m_inputCollectionKey
SG::ReadHandleKey< ISF_FCS_Parametrization::FCS_StepInfoCollection > m_inputCollectionKey
Definition: FastCaloSimParamAlg.h:61
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
FastCaloSimParamAlg::m_minEnergy
DoubleProperty m_minEnergy
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FastCaloSimParamAlg.h:79
skel.it
it
Definition: skel.GENtoEVGEN.py:396
FastCaloSimParamAlg::m_energyFraction
DoubleProperty m_energyFraction
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FastCaloSimParamAlg.h:81
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
FastCaloSimParamAlg::m_maxRadiusLAr
DoubleProperty m_maxRadiusLAr
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FastCaloSimParamAlg.h:67
FastCaloSimParamAlg::m_maxRadiusFCAL
DoubleProperty m_maxRadiusFCAL
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FastCaloSimParamAlg.h:69
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
FastCaloSimParamAlg::m_outputCollectionKey
SG::WriteHandleKey< ISF_FCS_Parametrization::FCS_StepInfoCollection > m_outputCollectionKey
Definition: FastCaloSimParamAlg.h:62
std::stable_sort
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
Definition: DVL_algorithms.h:711
FastCaloSimParamAlg::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: FastCaloSimParamAlg.h:85
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
FastCaloSimParamAlg::m_maxTime
DoubleProperty m_maxTime
Definition: FastCaloSimParamAlg.h:72
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
FastCaloSimParamAlg::m_containmentEnergy
DoubleProperty m_containmentEnergy
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FastCaloSimParamAlg.h:80
FastCaloSimParamAlg::m_maxRadiusHEC
DoubleProperty m_maxRadiusHEC
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FastCaloSimParamAlg.h:68
FastCaloSimParamAlg::m_maxTimeHEC
DoubleProperty m_maxTimeHEC
Definition: FastCaloSimParamAlg.h:74
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
FastCaloSimParamAlg::clusterize
StatusCode clusterize(ISF_FCS_Parametrization::FCS_StepInfoCollection *stepinfo) const
Definition: FastCaloSimParamAlg.cxx:113
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
FastCaloSimParamAlg::m_maxTimeLAr
DoubleProperty m_maxTimeLAr
Definition: FastCaloSimParamAlg.h:73
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
DetDescrDictionaryDict::it1
std::vector< HWIdentifier >::iterator it1
Definition: DetDescrDictionaryDict.h:17
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FastCaloSimParamAlg::m_maxTimeTile
DoubleProperty m_maxTimeTile
Definition: FastCaloSimParamAlg.h:76
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FastCaloSimParamAlg::truncate
StatusCode truncate(ISF_FCS_Parametrization::FCS_StepInfoCollection *stepinfo) const
Definition: FastCaloSimParamAlg.cxx:224
AthCommonDataStore< AthCommonMsg< 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
FastCaloSimParamAlg::m_maxDistance
DoubleProperty m_maxDistance
Definition: FastCaloSimParamAlg.h:65
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:221
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
FastCaloSimParamAlg::m_truncate
DoubleProperty m_truncate
Definition: FastCaloSimParamAlg.h:64
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
LArCellBinning.step
step
Definition: LArCellBinning.py:158
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
FastCaloSimParamAlg::m_maxTimeFCAL
DoubleProperty m_maxTimeFCAL
Definition: FastCaloSimParamAlg.h:75
DataVector::erase
iterator erase(iterator position)
Remove element at a given position.
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
FastCaloSimParamAlg::m_clusterize
BooleanProperty m_clusterize
Definition: FastCaloSimParamAlg.h:63
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
FastCaloSimParamAlg::m_maxRadiusTile
DoubleProperty m_maxRadiusTile
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FastCaloSimParamAlg.h:70
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
FastCaloSimParamAlg::m_maxRadius
DoubleProperty m_maxRadius
property, see LArG4GenShowerLib::LArG4GenShowerLib
Definition: FastCaloSimParamAlg.h:66
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >