|
ATLAS Offline Software
|
Go to the documentation of this file.
27 , m_defaultSelector(0.4)
29 declareInterface<IParticleCaloCellAssociationTool>(
this);
47 return StatusCode::SUCCESS;
53 return StatusCode::SUCCESS;
56 std::unique_ptr<ParticleCellAssociation>
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),
133 std::unique_ptr<ParticleCellAssociation>&
association =
145 const std::vector<const CaloCell*>&
cells,
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) {
215 double theta = atan2(
cell->caloDDE()->r(),
cell->z());
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) {
282 double theta = atan2(
cell->caloDDE()->r(),
cell->z());
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(
420 ATH_MSG_DEBUG(
" added cell intersections " << cellIntersections.size());
428 std::vector<const CaloCell*>&
cells)
const
432 ATH_MSG_DEBUG(
"associateCells() - NO TrackParameters found in "
433 "caloExtension.caloEntryLayerIntersection()");
437 double eta =
pars->position().eta();
438 double phi =
pars->position().phi();
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
list_iterator begin() const
path
python interpreter configuration --------------------------------------—
std::map< CaloSampling::CaloSample, double > ScalarLayerMap
void select(double eta, double phi, double deta, double dphi)
Tracking class to hold the extrapolation from a particle from the ID to the muon system (or the other...
void entryExitLayerMap(const Trk::CaloExtension &extension, EntryExitLayerMap &result, const LayersToSelect *selection=nullptr)
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.
Class providing the definition of the 4-vector interface.
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...
Trk::CaloCellSelectorLayerdR m_defaultSelector
std::unordered_map< size_t, std::unique_ptr< ParticleCellAssociation > > Cache
Method to get the ParticleCellAssociation for a given Particle.
list_iterator end() const
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Name: MuonSpContainer.h Package : offline/Reconstruction/MuonIdentification/muonEvent.
Gaudi::Property< double > m_coneSize
::StatusCode StatusCode
StatusCode definition for legacy code.
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
ParticleCaloCellAssociationTool(const std::string &, const std::string &, const IInterface *)
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.
class storing information on the intersection of a track with a cell
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 StatusCode finalize() override final
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
virtual ~ParticleCaloCellAssociationTool() override
Container class for CaloCell.
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)
virtual StatusCode initialize() override final
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.
class storing calorimeter cell association with IParticle objects
Scalar mag() const
mag method
virtual ParametersBase< DIM, T > * clone() const override=0
clone method for polymorphic deep copy