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

#include <TileFCSmStepToTileHitVec.h>

Inheritance diagram for TileFCSmStepToTileHitVec:
Collaboration diagram for TileFCSmStepToTileHitVec:

Public Member Functions

 TileFCSmStepToTileHitVec (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~TileFCSmStepToTileHitVec ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
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

int getUshapeFromGM () 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

ServiceHandle< IGeoModelSvcm_geoModSvc
 
std::string m_FCS_StepInfo
 
std::string m_hitVec
 
std::string m_infoName
 
const TileIDm_tileID
 
const TileInfom_tileInfo
 
const TileDetDescrManagerm_tileMgr
 
ServiceHandle< ITileCalculatorm_calc
 
float m_deltaT
 
std::vector< TileHit * > m_allHits
 
int m_uShape
 
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

Definition at line 45 of file TileFCSmStepToTileHitVec.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

◆ TileFCSmStepToTileHitVec()

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

Definition at line 49 of file TileFCSmStepToTileHitVec.cxx.

50  : AthAlgorithm(name, pSvcLocator)
51  , m_geoModSvc("GeoModelSvc",name)
52  , m_FCS_StepInfo ("MergedEventSteps")
53  , m_hitVec ("TileHitVec_FCS")
54  , m_infoName ("TileInfo")
55  , m_tileID(nullptr)
56  , m_tileInfo(nullptr)
57  , m_tileMgr(nullptr)
58  , m_calc("TileGeoG4SDCalc", name)
60  , m_allHits(0)
61  , m_uShape(-1)
62 {
63  declareProperty( "GeoModelSvc", m_geoModSvc );
64  declareProperty( "TileCalculator", m_calc);
65  declareProperty("StepInfoCollection", m_FCS_StepInfo, "Name of input container (default=TileHitCnt)");
66  declareProperty("TileHitVector", m_hitVec, "Name of output hit vector (default=TileHitVec)");
67  declareProperty("TileInfoName", m_infoName, "Name of TileInfo store (default=TileInfo");
68  declareProperty("DeltaT", m_deltaT, "Minimal Time granularity in TileHit (default=0.5ns)");
69 
70 }

◆ ~TileFCSmStepToTileHitVec()

TileFCSmStepToTileHitVec::~TileFCSmStepToTileHitVec ( )
virtual

Definition at line 76 of file TileFCSmStepToTileHitVec.cxx.

77 {}

Member Function Documentation

◆ 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 TileFCSmStepToTileHitVec::execute ( )

Definition at line 116 of file TileFCSmStepToTileHitVec.cxx.

117 {
118  ATH_MSG_DEBUG( "Execution beginning" );
119 
120  m_allHits.clear();
121  m_allHits.resize(m_tileID->pmt_hash_max(),0);
122  int nHit = 0;
123  float Etot = 0.0;
124  int newHits = 0;
125  int sum_size = 0;
126  const double tile_radius[13] = { 2300.,
127  2400., 2500., 2600.,
128  2730., 2860., 2990.,
129  3140., 3290., 3440.,
130  3640., 3820.,
131  3820.01 };
132 
133  const double M_PI_32 = M_PI/32.;
134  const double M_PI_64 = M_PI/64.;
135  const double TAN_PI_64 = tan(M_PI/64.);
136 
137  // size is amaller than master plate and there is a gap between modules
138  const double size_correction = 2.75 + 1.5/2.;
139 
140  const ISF_FCS_Parametrization::FCS_StepInfoCollection* inCollect = nullptr;
141  std::unique_ptr<TileHitVector> FCS_hits = std::make_unique<TileHitVector>();
142 
143  // Get FCS_StepInfo from FCS_StepInfoCollection
144  ATH_CHECK(evtStore()->retrieve(inCollect,m_FCS_StepInfo)); //FIXME use a ReadHandle
145 
146  IdContext pmt_context = m_tileID->pmt_context();
147 
148  // Iterating over Steps, creating new TileHits
149  for(const ISF_FCS_Parametrization::FCS_StepInfo* stepInfo : *inCollect) {
150  Identifier hit_id = stepInfo->identify();
151  if (m_tileID->is_tile(hit_id)) {
152  double ene = stepInfo->energy();
153  double time = stepInfo->time();
154 
155  IdentifierHash hit_idhash;
156  m_tileID->get_hash(hit_id, hit_idhash, &pmt_context);
157 
158  if (m_uShape < 0) { // do not change anything for negative uShape values
159 
160  if ( ! m_allHits[hit_idhash] ) {
161  m_allHits[hit_idhash] = new TileHit(hit_id,ene,time);
162  ++newHits;
163  // ATH_MSG_INFO(
165  "Iterating over Steps: new hit with id " << m_tileID->to_string(hit_id,-1)
166  << " nHit=" << nHit << " energy=" << ene << " time=" << time);
167  } else {
168  m_allHits[hit_idhash]->add(ene,time,m_deltaT);
169  // ATH_MSG_INFO(
171  "Iterating over Steps: extra hit with id " << m_tileID->to_string(hit_id,-1)
172  << " nHit=" << nHit << " energy=" << ene << " time=" << time);
173  }
174 
175  } else {
176 
177  int section = m_tileID->section(hit_id);
178  int side = m_tileID->side(hit_id);
179  int module = m_tileID->module(hit_id);
180  int sample = m_tileID->sample(hit_id);
181 
182  bool Ecell = (sample == 3);
183  bool spC10 = (section == 3 && sample == 1 &&
184  ((module >= 38 && module <= 41) || (module >= 54 && module <= 57)));
185 
186  if ( Ecell || spC10 ) {
187  if ( ! m_allHits[hit_idhash] ) {
188  m_allHits[hit_idhash] = new TileHit(hit_id,ene,time);
189  // ATH_MSG_INFO(
191  "Iterating over Steps: new E/C10 hit with id " << m_tileID->to_string(hit_id,-1)
192  << " nHit=" << nHit << " energy=" << ene );
193  ++newHits;
194  } else {
195  m_allHits[hit_idhash]->add(ene,time,m_deltaT);
196  // ATH_MSG_INFO(
198  "Iterating over Steps: extra E/C10 hit with id " << m_tileID->to_string(hit_id,-1)
199  << " nHit=" << nHit << " energy=" << ene );
200  }
201 
202  } else { //cell have two pmt
203 
204  double x = stepInfo->x(); // coordinates of the hit
205  double y = stepInfo->y(); // coordinates of the hit
206  int pmt = m_tileID->pmt(hit_id); // original pmt index
207  double edep[2];
208  Identifier cell_id = m_tileID->cell_id(hit_id);
209 
210  double phi_module=(module + 0.5) * M_PI_32;
211  double phi_hit = atan2(y,x);
212  if (phi_hit<0) phi_hit += 2*M_PI;
213  double dphi = phi_hit - phi_module; // should be in the range [-pi/64, pi/64]
214  if (dphi < -M_PI_64 || dphi > M_PI_64) {
215  ATH_MSG_ERROR( "Displaced hit with id " << m_tileID->to_string(hit_id,-1)
216  << " x " << x << " y " << y
217  << " phi_module " << phi_module << " phi_hit " << phi_hit
218  << " dphi " << dphi );
219  // correcting dphi
220  dphi -= trunc(dphi/M_PI_64) * M_PI_64;
221  }
222 
223  double radius = sqrt(x*x+y*y);
224  double radius_corrected = radius * cos(dphi);
225  double yLocal = radius * sin(dphi); // if negative, we are closer to pmt with index 0
226  double zLocal = radius * cos(dphi);
227  double halfYLocal = radius_corrected * TAN_PI_64 - size_correction;
228  if (fabs(yLocal) > halfYLocal) {
229  ATH_MSG_ERROR( "Displaced hit with id " << m_tileID->to_string(hit_id,-1)
230  << " x " << x << " y " << y
231  << " radius_corr " << radius_corrected
232  << " yLocal " << yLocal << " halfYlocal_corr " << halfYLocal
233  << " delta " << fabs(yLocal) - halfYLocal );
234  // correcting yLocal
235  yLocal = copysign(halfYLocal,yLocal);
236  }
237 
238  // tile row or tile index - number from 0 to 10
239  int tile_ind = std::lower_bound (tile_radius, tile_radius+12,radius_corrected)-tile_radius-1;
240  if (tile_ind < 0 || tile_ind > 10 ) {
241  ATH_MSG_ERROR( "Displaced hit with id " << m_tileID->to_string(hit_id,-1)
242  << " x " << x << " y " << y
243  << " radius " << radius << " corrected " << radius_corrected
244  << " tile_index " << tile_ind );
245  // correcting tile index
246  if (tile_ind<0) tile_ind = 0;
247  if (tile_ind>10) tile_ind = 10;
248  }
249  TileHitData hitData;
250  hitData.tileSize = tile_ind;
251  hitData.nDetector = section;
252  hitData.nSide = side;
253  m_calc->pmtEdepFromFCS_StepInfo(hitData, ene, yLocal, halfYLocal, zLocal, m_uShape);
254  edep[0] = hitData.edep_down;
255  edep[1] = hitData.edep_up;
256 
257  for (int pm=0; pm<2; ++pm) {
258  // changing hit_id, - use proper pm index (0 or 1) for down/up pmt
259  hit_id = m_tileID->pmt_id(cell_id,pm);
260  m_tileID->get_hash(hit_id, hit_idhash, &pmt_context);
261 
262  double tim=time;
263  if (pm != pmt) { // need to correct time
264  const double ref_ind_tile = 1.59;
265  const double inv_speed = ref_ind_tile / CLHEP::c_light;
266  if (pmt) tim -= 2 * yLocal * inv_speed;
267  else tim += 2 * yLocal * inv_speed;
268  }
269 
270  if ( ! m_allHits[hit_idhash] ) {
271  m_allHits[hit_idhash] = new TileHit(hit_id,edep[pm],tim,m_deltaT);
272  ++newHits;
273  // ATH_MSG_INFO(
275  "Iterating over Steps: new hit with id " << m_tileID->to_string(hit_id,-1)
276  << " nHit=" << nHit << " pmt " << pmt << " energy=" << edep[pm] << " time="
277  << time << " + " << tim-time << " = " << tim);
278  } else {
279  m_allHits[hit_idhash]->add(edep[pm],tim,m_deltaT);
280  // ATH_MSG_INFO(
282  "Iterating over Steps: extra hit with id " << m_tileID->to_string(hit_id,-1)
283  << " nHit=" << nHit << " pmt " << pmt << " energy=" << edep[pm] << " time="
284  << time << " + " << tim-time << " = " << tim);
285  }
286  }
287 
288  }//cell have two pmt
289 
290  }//m_uShape >= 0
291 
292  ++nHit;
293  Etot += ene;
294  }//is_tile(hit_id)
295 
296  }//Iterating over Steps
297 
298  ATH_MSG_DEBUG( "End of Iterating over Steps: nHit=" << nHit << " newHits=" << newHits << " Etot=" << Etot );
299  // ATH_MSG_INFO( "End of Iterating over Steps: nHit=" << nHit << " newHits=" << newHits << " Etot=" << Etot );
300  nHit = 0;
301  Etot = 0.0;
302 
303  // Addition of each TileHit to the TileHitVector
304  std::vector<TileHit*>::const_iterator curr = m_allHits.begin();
305  std::vector<TileHit*>::const_iterator iend = m_allHits.end();
306  for ( ; curr != iend; ++curr) {
307  if (*curr) {
308  TileHit *pHit = (*curr);
309 
310  // ATH_MSG_INFO(
312  "Iterating over Hits: nHit=" << nHit << " size="
313  << pHit->size() << " energy=" << pHit->energy() );
314  FCS_hits->push_back(*pHit);
315  ++nHit;
316  for (int ii=0; ii<pHit->size(); ++ii ) Etot += pHit->energy(ii);
317  sum_size += pHit->size();
318  }
319  }
320 
321  // Register the set of TileHits to the event store
322  CHECK( evtStore()->record(std::move(FCS_hits), m_hitVec, false ) );
323 
324  ATH_MSG_DEBUG( "Execution completed, nHit=" << nHit << " sum_size=" << sum_size << " Etot=" << Etot );
325  // ATH_MSG_INFO( "Execution completed, nHit=" << nHit << " sum_size=" << sum_size << " Etot=" << Etot );
326 
327  return StatusCode::SUCCESS;
328 }

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

◆ finalize()

StatusCode TileFCSmStepToTileHitVec::finalize ( )

Definition at line 333 of file TileFCSmStepToTileHitVec.cxx.

334 {
335  ATH_MSG_INFO( "Finalized successfully" );
336 
337  return StatusCode::SUCCESS;
338 }

◆ getUshapeFromGM()

int TileFCSmStepToTileHitVec::getUshapeFromGM ( ) const
private

Definition at line 106 of file TileFCSmStepToTileHitVec.cxx.

106  {
107  const TileDetectorTool* tileDetectorTool =
108  dynamic_cast<const TileDetectorTool *>(m_geoModSvc->getTool("TileDetectorTool"));
109  return (tileDetectorTool) ? tileDetectorTool->uShape() : 0;
110 }

◆ initialize()

StatusCode TileFCSmStepToTileHitVec::initialize ( )

Definition at line 83 of file TileFCSmStepToTileHitVec.cxx.

84 {
85  ATH_CHECK( m_calc.retrieve() );
86  // retrieve Tile detector manager, TileID helper and TileIfno from det store
90  ATH_CHECK(m_geoModSvc.retrieve());
91  ATH_MSG_VERBOSE("GeoModelSvc initialized.");
92 
93  m_uShape = this->getUshapeFromGM();
94  if (m_uShape < -2) {
95  ATH_MSG_WARNING("Changing U-shape from " << m_uShape << " to -2");
96  m_uShape = -2;
97  }
98  if (m_uShape > 1 && m_uShape < 10) {
99  ATH_MSG_WARNING("Changing U-shape from " << m_uShape << " to 1");
100  m_uShape = 1;
101  }
102 
103  return StatusCode::SUCCESS;
104 }

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

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

std::vector<TileHit*> TileFCSmStepToTileHitVec::m_allHits
private

Definition at line 72 of file TileFCSmStepToTileHitVec.h.

◆ m_calc

ServiceHandle<ITileCalculator> TileFCSmStepToTileHitVec::m_calc
private

Definition at line 69 of file TileFCSmStepToTileHitVec.h.

◆ m_deltaT

float TileFCSmStepToTileHitVec::m_deltaT
private

Definition at line 71 of file TileFCSmStepToTileHitVec.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_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_FCS_StepInfo

std::string TileFCSmStepToTileHitVec::m_FCS_StepInfo
private

Definition at line 62 of file TileFCSmStepToTileHitVec.h.

◆ m_geoModSvc

ServiceHandle<IGeoModelSvc> TileFCSmStepToTileHitVec::m_geoModSvc
private

Definition at line 61 of file TileFCSmStepToTileHitVec.h.

◆ m_hitVec

std::string TileFCSmStepToTileHitVec::m_hitVec
private

Definition at line 63 of file TileFCSmStepToTileHitVec.h.

◆ m_infoName

std::string TileFCSmStepToTileHitVec::m_infoName
private

Definition at line 64 of file TileFCSmStepToTileHitVec.h.

◆ m_tileID

const TileID* TileFCSmStepToTileHitVec::m_tileID
private

Definition at line 66 of file TileFCSmStepToTileHitVec.h.

◆ m_tileInfo

const TileInfo* TileFCSmStepToTileHitVec::m_tileInfo
private

Definition at line 67 of file TileFCSmStepToTileHitVec.h.

◆ m_tileMgr

const TileDetDescrManager* TileFCSmStepToTileHitVec::m_tileMgr
private

Definition at line 68 of file TileFCSmStepToTileHitVec.h.

◆ m_uShape

int TileFCSmStepToTileHitVec::m_uShape
private

Definition at line 74 of file TileFCSmStepToTileHitVec.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:
TileHitData::edep_down
G4double edep_down
Definition: ITileCalculator.h:62
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileHitData::nSide
int nSide
Definition: ITileCalculator.h:52
TileFCSmStepToTileHitVec::m_tileID
const TileID * m_tileID
Definition: TileFCSmStepToTileHitVec.h:66
TileFCSmStepToTileHitVec::m_infoName
std::string m_infoName
Definition: TileFCSmStepToTileHitVec.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TileFCSmStepToTileHitVec::m_tileMgr
const TileDetDescrManager * m_tileMgr
Definition: TileFCSmStepToTileHitVec.h:68
python.SystemOfUnits.nanosecond
int nanosecond
Definition: SystemOfUnits.py:119
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Tile_Base_ID::pmt
int pmt(const Identifier &id) const
Definition: Tile_Base_ID.cxx:180
ReadBchFromCool.pmt
pmt
Definition: ReadBchFromCool.py:62
TileDetectorTool::uShape
int uShape() const
Definition: TileDetectorTool.h:31
Tile_Base_ID::side
int side(const Identifier &id) const
Definition: Tile_Base_ID.cxx:153
TileFCSmStepToTileHitVec::m_calc
ServiceHandle< ITileCalculator > m_calc
Definition: TileFCSmStepToTileHitVec.h:69
Tile_Base_ID::sample
int sample(const Identifier &id) const
Definition: Tile_Base_ID.cxx:171
M_PI
#define M_PI
Definition: ActiveFraction.h:11
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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
x
#define x
TileFCSmStepToTileHitVec::m_hitVec
std::string m_hitVec
Definition: TileFCSmStepToTileHitVec.h:63
TileHitData
Variables to identify Hit objects.
Definition: ITileCalculator.h:45
TileHit::size
int size(void) const
Return length of energy/time vectors
Definition: TileSimEvent/TileSimEvent/TileHit.h:94
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
TRT::Hit::side
@ side
Definition: HitInfo.h:83
python.PyAthena.module
module
Definition: PyAthena.py:131
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
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
TileFCSmStepToTileHitVec::m_uShape
int m_uShape
Definition: TileFCSmStepToTileHitVec.h:74
Tile_Base_ID::module
int module(const Identifier &id) const
Definition: Tile_Base_ID.cxx:159
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
TileFCSmStepToTileHitVec::m_deltaT
float m_deltaT
Definition: TileFCSmStepToTileHitVec.h:71
TileHitData::nDetector
int nDetector
Definition: ITileCalculator.h:49
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
TileHitData::edep_up
G4double edep_up
Definition: ITileCalculator.h:61
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AtlasDetectorID::is_tile
bool is_tile(Identifier id) const
Definition: AtlasDetectorID.h:695
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TileFCSmStepToTileHitVec::m_geoModSvc
ServiceHandle< IGeoModelSvc > m_geoModSvc
Definition: TileFCSmStepToTileHitVec.h:61
Tile_Base_ID::get_hash
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const
create hash id from compact id (return == 0 for OK)
Definition: Tile_Base_ID.cxx:1151
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
TileHitData::tileSize
int tileSize
Definition: ITileCalculator.h:54
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
TileHit
Definition: TileSimEvent/TileSimEvent/TileHit.h:30
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
TileFCSmStepToTileHitVec::m_allHits
std::vector< TileHit * > m_allHits
Definition: TileFCSmStepToTileHitVec.h:72
ISF_FCS_Parametrization::FCS_StepInfo
Definition: FCS_StepInfo.h:45
Tile_Base_ID::pmt_hash_max
size_type pmt_hash_max(void) const
Definition: Tile_Base_ID.cxx:1318
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
TileFCSmStepToTileHitVec::m_tileInfo
const TileInfo * m_tileInfo
Definition: TileFCSmStepToTileHitVec.h:67
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
Tile_Base_ID::to_string
std::string to_string(const Identifier &id, int level=0) const
Definition: Tile_Base_ID.cxx:52
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TileHit::energy
float energy(int ind=0) const
Return energy of ind-th sub-hit
Definition: TileSimEvent/TileSimEvent/TileHit.h:90
Tile_Base_ID::pmt_id
Identifier pmt_id(const Identifier &any_id) const
Definition: Tile_Base_ID.cxx:640
TileFCSmStepToTileHitVec::m_FCS_StepInfo
std::string m_FCS_StepInfo
Definition: TileFCSmStepToTileHitVec.h:62
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
Tile_Base_ID::pmt_context
IdContext pmt_context(void) const
id for PMTs
Definition: Tile_Base_ID.cxx:1065
ISF_FCS_Parametrization::FCS_StepInfoCollection
Class for collection of StepInfo class (G4 hits) copied and modified version to ISF.
Definition: FCS_StepInfoCollection.h:30
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
TileDetectorTool
Definition: TileDetectorTool.h:17
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
TileFCSmStepToTileHitVec::getUshapeFromGM
int getUshapeFromGM() const
Definition: TileFCSmStepToTileHitVec.cxx:106
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
Tile_Base_ID::section
int section(const Identifier &id) const
Definition: Tile_Base_ID.cxx:147
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
section
void section(const std::string &sec)
Definition: TestTriggerMenuAccess.cxx:22
Tile_Base_ID::cell_id
Identifier cell_id(const Identifier &any_id) const
Definition: Tile_Base_ID.cxx:581
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AtlasHitsVector::push_back
void push_back(const T &t)
Definition: AtlasHitsVector.h:145
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14