ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::CaloCellSelectorRoughdR Class Reference

#include <CaloCellSelectorRoughdR.h>

Inheritance diagram for Trk::CaloCellSelectorRoughdR:
Collaboration diagram for Trk::CaloCellSelectorRoughdR:

Public Member Functions

 CaloCellSelectorRoughdR (double coneSize)
 ~CaloCellSelectorRoughdR ()
bool preSelectAction (const Trk::CaloExtension &caloExtension)
 Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the given input.
bool select (const CaloCell &cell) const
 Method to determine if a cell is to be selected or not.
virtual bool preSelectActionCells (const Rec::ParticleCellAssociation &cellAssociation)
 Initialize selector wtih ParticleCellAssociation, returns false if the selection cannot be performed for the given input.

Private Attributes

double m_coneSize
double m_midEta
double m_midPhi
double m_maxDiff
CaloExtensionHelpers::EntryExitPerLayerVector m_crossPoints

Detailed Description

Definition at line 22 of file CaloCellSelectorRoughdR.h.

Constructor & Destructor Documentation

◆ CaloCellSelectorRoughdR()

Trk::CaloCellSelectorRoughdR::CaloCellSelectorRoughdR ( double coneSize)

◆ ~CaloCellSelectorRoughdR()

Trk::CaloCellSelectorRoughdR::~CaloCellSelectorRoughdR ( )
default

Member Function Documentation

◆ preSelectAction()

bool Trk::CaloCellSelectorRoughdR::preSelectAction ( const Trk::CaloExtension & caloExtension)
virtual

Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the given input.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Reimplemented from Trk::ICaloCellSelector.

Definition at line 21 of file CaloCellSelectorRoughdR.cxx.

21 {
22 if (caloExtension.caloLayerIntersections().empty()) return false;
23
26 // get mean direction of the calo crossings
27 Amg::Vector3D meanPos(0., 0., 0.);
28 for (auto entry : m_crossPoints) {
29 int code = std::get<0>(entry);
30 if (code < 0 || code >= 24) { continue; } // not a intersection with a calo layer
31 meanPos += std::get<1>(entry).unit();
32 }
33
34 m_midEta = meanPos.eta();
35 m_midPhi = meanPos.phi();
36
37 // get individual crossings max deviation from the mean direction as tolerance
38 m_maxDiff = 0.;
39 for (auto entry : m_crossPoints) {
40 int code = std::get<0>(entry);
41 if (code < 0 || code >= 24) { continue; } // not a intersection with a calo layer
42 Amg::Vector3D pos = std::get<1>(entry);
43 double rDiff = Utils::deltaR(pos.eta(), m_midEta, pos.phi(), m_midPhi);
44 if (rDiff > m_maxDiff) m_maxDiff = rDiff;
45 }
47 m_maxDiff *= m_maxDiff; // do comparison in dR*dR
49
50 // const std::vector<const CurvilinearParameters*>& intersections = caloExtension.caloLayerIntersections();
51 // int nPts = intersections.size();
52
53 // Amg::Vector3D meanPos(0., 0., 0.);
54 // m_maxDiff = 0.;
55
57 // for (int i=0;i<nPts;++i){
58 // //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
59 // int code = parsIdHelper.caloSample(intersections[i]->cIdentifier());
60 // if (!parsIdHelper.isEntryToVolume(intersections[i]->cIdentifier())) code = -code;
61 // //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
62 // if ( !(code >= 0 && code < 24) ) { continue; } // not a intersection with a calo layer
63 // meanPos += intersections[i]->position().unit();
64 //}
65
66 // m_midEta = meanPos.eta();
67 // m_midPhi = meanPos.phi();
68
70 // for (int i=0;i<nPts;++i){
71 // //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
72 // int code = parsIdHelper.caloSample(intersections[i]->cIdentifier());
73 // if (!parsIdHelper.isEntryToVolume(intersections[i]->cIdentifier())) code = -code;
74 // //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75 // if ( !(code >= 0 && code < 24) ) { continue; } // not a intersection with a calo layer
76 // Amg::Vector3D pos = intersections[i]->position();
77 // double rDiff = Utils::deltaR(pos.eta(), m_midEta, pos.phi(), m_midPhi);
78 // if (rDiff>m_maxDiff) m_maxDiff = rDiff;
79 //}
80
82 // m_maxDiff += m_coneSize;
83 // m_maxDiff *= m_maxDiff; //do comparison in dR*dR
84
85 return true;
86 }
CaloExtensionHelpers::EntryExitPerLayerVector m_crossPoints
const std::vector< CurvilinearParameters > & caloLayerIntersections() const
access to the intersections with the calorimeter layers.
Eigen::Matrix< double, 3, 1 > Vector3D
void entryExitPerLayerVector(const Trk::CaloExtension &extension, EntryExitPerLayerVector &result, const LayersToSelect *selection=nullptr)
double deltaR(double eta1, double eta2, double phi1, double phi2)

◆ preSelectActionCells()

bool ICaloCellSelector::preSelectActionCells ( const Rec::ParticleCellAssociation & cellAssociation)
inlinevirtualinherited

Initialize selector wtih ParticleCellAssociation, returns false if the selection cannot be performed for the given input.

Definition at line 44 of file Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloCellSelector.h.

44 {
45 return preSelectAction(cellAssociation.caloExtension());
46 }
const Trk::CaloExtension & caloExtension() const
return calo extension
virtual bool preSelectAction(const Trk::CaloExtension &caloExtension)
Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the gi...

◆ select()

bool Trk::CaloCellSelectorRoughdR::select ( const CaloCell & cell) const
virtual

Method to determine if a cell is to be selected or not.

Parameters
CaloCell
Returns
bool

Implements Trk::ICaloCellSelector.

Definition at line 88 of file CaloCellSelectorRoughdR.cxx.

88 {
89 const CaloDetDescrElement* dde = cell.caloDDE();
90 if (!dde) return false;
91 return Utils::deltaR2(m_midEta, dde->eta(), m_midPhi, dde->phi()) < m_maxDiff;
92 }
double deltaR2(double eta1, double eta2, double phi1, double phi2)

Member Data Documentation

◆ m_coneSize

double Trk::CaloCellSelectorRoughdR::m_coneSize
private

Definition at line 32 of file CaloCellSelectorRoughdR.h.

◆ m_crossPoints

CaloExtensionHelpers::EntryExitPerLayerVector Trk::CaloCellSelectorRoughdR::m_crossPoints
private

Definition at line 38 of file CaloCellSelectorRoughdR.h.

◆ m_maxDiff

double Trk::CaloCellSelectorRoughdR::m_maxDiff
private

Definition at line 35 of file CaloCellSelectorRoughdR.h.

◆ m_midEta

double Trk::CaloCellSelectorRoughdR::m_midEta
private

Definition at line 33 of file CaloCellSelectorRoughdR.h.

◆ m_midPhi

double Trk::CaloCellSelectorRoughdR::m_midPhi
private

Definition at line 34 of file CaloCellSelectorRoughdR.h.


The documentation for this class was generated from the following files: