|
ATLAS Offline Software
|
#include <ParticleCaloCellAssociationTool.h>
|
| ParticleCaloCellAssociationTool (const std::string &, const std::string &, const IInterface *) |
|
virtual | ~ParticleCaloCellAssociationTool () override |
|
virtual StatusCode | initialize () override final |
|
virtual StatusCode | finalize () override final |
|
virtual std::unique_ptr< ParticleCellAssociation > | particleCellAssociation (const xAOD::IParticle &particle, float dr, const CaloCellContainer *container=nullptr, const CaloExtensionCollection *extensionCache=nullptr) const override final |
| Method to get the ParticleCellAssociation for a given Particle. More...
|
|
virtual ParticleCellAssociation * | particleCellAssociation (const xAOD::IParticle &particle, float dr, IParticleCaloCellAssociationTool::Cache &cache, const CaloCellContainer *container=nullptr, const CaloExtensionCollection *extensionCache=nullptr) const override final |
| Method to get the ParticleCellAssociation for a given Particle. 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 | sysInitialize () override |
| Perform system initialization for an algorithm. 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 |
|
◆ Cache
Method to get the ParticleCellAssociation for a given Particle.
- Parameters
-
particle | input particle |
dr | cone size used for the association @ param cache cache for keeping previous results |
container | cell container to be used if provided |
extensionCache | A calo extension cache to be used if provided |
- Returns
- ParticleCellAssociation* (plain ptr cache has ownership)
An alg looping over a single collection of IParticles
re-using them multiple times can use a local cache of the form std::unordered_map<size_t,std::unique_ptr<ParticleCellAssociation >>. where the key is the value of IParticle::index()
This method adds the ParticleCellAssociation to the cache look-up table which retains ownership.
Definition at line 56 of file IParticleCaloCellAssociationTool.h.
◆ StoreGateSvc_t
◆ ParticleCaloCellAssociationTool()
Rec::ParticleCaloCellAssociationTool::ParticleCaloCellAssociationTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~ParticleCaloCellAssociationTool()
Rec::ParticleCaloCellAssociationTool::~ParticleCaloCellAssociationTool |
( |
| ) |
|
|
overridevirtualdefault |
◆ associateCells()
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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
◆ finalize()
StatusCode Rec::ParticleCaloCellAssociationTool::finalize |
( |
| ) |
|
|
finaloverridevirtual |
◆ getCellIntersections()
Definition at line 143 of file ParticleCaloCellAssociationTool.cxx.
152 cellIntersections.reserve(extension.caloLayerIntersections().size() * 1.3);
185 double drFix =
cell->caloDDE()->dr();
186 double dzFix =
cell->caloDDE()->dz();
189 int isample =
cell->caloDDE()->getSampling();
197 double drTG = fabs((
pos->second.first - pos2->second.second).perp());
198 double dzTG = fabs((
pos->second.first - pos2->second.second).z());
202 <<
cell->caloDDE()->getSampling() <<
" dr "
203 <<
cell->caloDDE()->dr() <<
" drTG " << drTG);
206 <<
cell->caloDDE()->getSampling() <<
" dz "
207 <<
cell->caloDDE()->dz() <<
" dzTG " << dzTG);
214 if (
cell->caloDDE()->deta() > 0) {
217 2 *
cell->caloDDE()->deta() *
sin(theta / 2.) *
cos(theta / 2);
218 if (theta + dtheta <
M_PI) {
223 -
log(
tan((theta + dtheta) / 2.)) +
log(
tan((theta) / 2.));
225 <<
cell->caloDDE()->getSampling() <<
" deta "
226 <<
cell->caloDDE()->deta() <<
" detaCheck "
227 << detaCheck <<
" drFix " << drFix);
230 << theta <<
" dtheta " << dtheta <<
" sum/pi "
231 << (theta + dtheta) * M_1_PI <<
" deta "
232 <<
cell->caloDDE()->deta());
238 double drMin = 100000.;
242 const CaloCell* cellFound =
nullptr;
243 for (
const auto* celln :
cells) {
246 if (
cell->caloDDE()->getSubCalo() == celln->caloDDE()->getSubCalo()) {
248 if (abs(dsample) == dscut) {
249 double drNew = fabs(
cell->caloDDE()->r() - celln->caloDDE()->r());
261 <<
cell->caloDDE()->getSampling() <<
" x "
262 <<
cell->caloDDE()->x() <<
" y " <<
cell->caloDDE()->y()
263 <<
" z " <<
cell->caloDDE()->z() <<
" dr "
264 <<
cell->caloDDE()->dr() <<
" drFix " << drFix
265 <<
" drTG " << drTG);
269 << cellFound->
caloDDE()->
x() <<
" y "
270 << cellFound->
caloDDE()->
y() <<
" z "
271 << cellFound->
caloDDE()->
z() <<
" dr "
272 << cellFound->
caloDDE()->
dr() <<
" dscut " << dscut
273 <<
" drFix " << drFix);
281 if (
cell->caloDDE()->deta() > 0) {
284 2 *
cell->caloDDE()->deta() *
sin(theta / 2.) *
cos(theta / 2);
285 if (theta + dtheta <
M_PI) {
286 double dz = fabs(
cell->caloDDE()->r() /
tan(theta + dtheta) -
287 cell->caloDDE()->r() /
tan(theta));
291 << theta <<
" dtheta " << dtheta <<
" sum/pi "
292 << (theta + dtheta) * M_1_PI <<
" deta "
293 <<
cell->caloDDE()->deta());
296 -
log(
tan((theta + dtheta) / 2.)) +
log(
tan((theta) / 2.));
298 <<
cell->caloDDE()->getSampling() <<
" deta "
299 <<
cell->caloDDE()->deta() <<
" detaCheck "
300 << detaCheck <<
" dtheta " << dtheta <<
" dzFix "
303 double dzMin = 100000.;
307 const CaloCell* cellFound =
nullptr;
308 for (
const auto* celln :
cells) {
311 if (
cell->caloDDE()->getSubCalo() == celln->caloDDE()->getSubCalo()) {
313 if (abs(isample - isample2) == dscut) {
314 double dzNew = fabs(
cell->caloDDE()->z() - celln->caloDDE()->z());
326 <<
cell->caloDDE()->getSampling() <<
" x "
327 <<
cell->caloDDE()->x() <<
" y " <<
cell->caloDDE()->y()
328 <<
" z " <<
cell->caloDDE()->z() <<
" dz "
329 <<
cell->caloDDE()->dz() <<
" dzFix " << dzFix
330 <<
" dzTG " << dzTG);
334 << cellFound->
caloDDE()->
x() <<
" y "
335 << cellFound->
caloDDE()->
y() <<
" z "
336 << cellFound->
caloDDE()->
z() <<
" dz "
337 << cellFound->
caloDDE()->
dz() <<
" dscut " << dscut
338 <<
" dzFix " << dzFix);
346 if (
cell->energy() > 50.)
348 <<
cell->caloDDE()->getSampling() <<
" cell energy "
349 <<
cell->energy() <<
" dzFix " << dzFix <<
" dzTG " << dzTG
350 <<
" drFix " << drFix <<
" drTG " << drTG <<
" barrel "
361 *
cell,
pos->second.first, pos2->second.second, drFix, dzFix);
362 double totpath = (
pos->second.first - pos2->second.second).
mag();
363 path = totpath != 0 ? pathInMM / totpath : 0.;
364 if (
path > 0 ||
cell->energy() > 50.) {
366 <<
cell->caloDDE()->getSampling() <<
" cell energy "
367 <<
cell->energy() <<
" drFix " << drFix <<
" dzFix "
368 << dzFix <<
" path " <<
path <<
" length TG " << totpath);
370 <<
cell->caloDDE()->dz() <<
" deta "
371 <<
cell->caloDDE()->deta());
381 if (path2 <= 0. &&
path <= 0.)
391 eLoss = eLossPair->second;
395 eLoss = 0.5 * (eLossPair->second) + 0.5 * (eLossPair2->second);
400 eLoss = 0.5 * (eLossPair->second) + 0.5 * (eLossPair2->second);
406 <<
path <<
" PATH2D = " << path2 <<
" eLoss " << eLoss
407 <<
" cell energy " << (
cell)->
energy() <<
" radius "
408 <<
cell->caloDDE()->r() <<
" phi " <<
cell->caloDDE()->phi()
409 <<
" dr " <<
cell->caloDDE()->dr() <<
" dphi "
410 <<
cell->caloDDE()->dphi() <<
" x " <<
cell->caloDDE()->x()
411 <<
" y " <<
cell->caloDDE()->y() <<
" z "
412 <<
cell->caloDDE()->z() <<
" dx " <<
cell->caloDDE()->dx()
413 <<
" dy " <<
cell->caloDDE()->dy() <<
" dz "
414 <<
cell->caloDDE()->dz() <<
" volume "
415 <<
cell->caloDDE()->volume());
417 cellIntersections.emplace_back(
418 cell,
new ParticleCellIntersection(*
cell, eLoss, use3D ?
path : path2));
420 ATH_MSG_DEBUG(
" added cell intersections " << cellIntersections.size());
◆ initialize()
StatusCode Rec::ParticleCaloCellAssociationTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
◆ inputHandles()
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.
◆ interfaceID()
const InterfaceID & Rec::IParticleCaloCellAssociationTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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.
◆ particleCellAssociation() [1/2]
Method to get the ParticleCellAssociation for a given Particle.
- Parameters
-
particle | input particle |
dr | cone size used for the association |
container | cell container to be used if provided |
- Returns
- std::unique_ptr<ParticleCellAssociation>
Implements Rec::IParticleCaloCellAssociationTool.
Definition at line 57 of file ParticleCaloCellAssociationTool.cxx.
65 std::unique_ptr<const Trk::CaloExtension> caloExtensionUPtr;
72 Gaudi::Hive::currentContext(),
particle);
73 caloExtension = caloExtensionUPtr.get();
81 "Received a caloExtension object without track extrapolation");
92 container = &(*cccHdl);
94 std::vector<const CaloCell*>
cells;
104 if (!caloExtensionUPtr)
108 caloExtensionUPtr = std::make_unique<Trk::CaloExtension>(
115 std::vector<Trk::CurvilinearParameters>(
117 return std::make_unique<ParticleCellAssociation>(caloExtensionUPtr.release(),
120 std::move(cellIntersections),
◆ particleCellAssociation() [2/2]
Method to get the ParticleCellAssociation for a given Particle.
- Parameters
-
particle | input particle |
dr | cone size used for the association @ param cache cache for keeping previous results |
container | cell container to be used if provided |
- Returns
- ParticleCellAssociation* (plain ptr cache has ownership)
An alg looping over a single collection of IParticles re-using them multiple times can use a local cache of the form std::unordered_map<size_t,std::unique_ptr<ParticleCellAssociation >>. where the key is the value of IParticle::index()
This method adds the ParticleCellAssociation to the cache look-up table which retains ownership.
Implements Rec::IParticleCaloCellAssociationTool.
Definition at line 125 of file ParticleCaloCellAssociationTool.cxx.
133 std::unique_ptr<ParticleCellAssociation>&
association =
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_caloExtensionTool
◆ m_caloMgrKey
◆ m_cellContainerName
◆ m_coneSize
Gaudi::Property<double> Rec::ParticleCaloCellAssociationTool::m_coneSize { this, "ConeSize", 0.2 } |
|
private |
◆ m_defaultSelector
◆ m_detStore
◆ m_evtStore
◆ m_pathLenUtil
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
path
python interpreter configuration --------------------------------------—
std::map< CaloSampling::CaloSample, double > ScalarLayerMap
Tracking class to hold the extrapolation from a particle from the ID to the muon system (or the other...
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
void entryExitLayerMap(const Trk::CaloExtension &extension, EntryExitLayerMap &result, const LayersToSelect *selection=nullptr)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const TrackParameters * caloEntryLayerIntersection() const
access to intersection with the calorimeter entry layer return NULL if the intersection failed
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
const TrackParameters * muonEntryLayerIntersection() const
access to intersection with the muon entry layer return NULL if the intersection failed
double pathInsideCell(const CaloCell &cell, const Amg::Vector3D &entry, const Amg::Vector3D &exit)
Return the % of the path crossed inside the cell, given the parameters for the extrapolation at entra...
virtual void setOwner(IDataHandleHolder *o)=0
Trk::CaloCellSelectorLayerdR m_defaultSelector
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Gaudi::Property< double > m_coneSize
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
void associateCells(const CaloCellContainer &container, const Trk::CaloExtension &caloExtension, float dr, std::vector< const CaloCell * > &cells) const
virtual std::unique_ptr< ParticleCellAssociation > particleCellAssociation(const xAOD::IParticle &particle, float dr, const CaloCellContainer *container=nullptr, const CaloExtensionCollection *extensionCache=nullptr) const override final
Method to get the ParticleCellAssociation for a given Particle.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
std::map< CaloSampling::CaloSample, std::pair< Amg::Vector3D, Amg::Vector3D > > EntryExitLayerMap
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void pathLenLayerMap(const Trk::CaloExtension &extension, ScalarLayerMap &result)
static double get3DPathLength(const CaloCell &cell, const Amg::Vector3D &entry, const Amg::Vector3D &exit, double drFix, double dzFix)
StatusCode initialize(bool used=true)
void eLossLayerMap(const Trk::CaloExtension &extension, ScalarLayerMap &result)
void getCellIntersections(const Trk::CaloExtension &caloExtension, const std::vector< const CaloCell * > &cells, ParticleCellAssociation::CellIntersections &cellIntersections) const
This class provides the client interface for accessing the detector description information common to...
Data object for each calorimeter readout cell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
SG::ReadHandleKey< CaloCellContainer > m_cellContainerName
void setConeSize(double coneSize)
std::vector< std::pair< const CaloCell *, ParticleCellIntersection * > > CellIntersections
typedef for vector of cell intersections
const std::vector< CurvilinearParameters > & caloLayerIntersections() const
access to the intersections with the calorimeter layers.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Scalar mag() const
mag method
virtual ParametersBase< DIM, T > * clone() const override=0
clone method for polymorphic deep copy