ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Trk::CaloCellSelectorMinPerp Class Reference

#include <CaloCellSelectorMinPerp.h>

Inheritance diagram for Trk::CaloCellSelectorMinPerp:
Collaboration diagram for Trk::CaloCellSelectorMinPerp:

Public Member Functions

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

Private Attributes

const Trk::CaloExtensionm_caloExtension
 
double m_coneSize
 
Amg::Vector3D m_meanPos
 
double m_perp2cut
 

Detailed Description

Definition at line 22 of file CaloCellSelectorMinPerp.h.

Constructor & Destructor Documentation

◆ CaloCellSelectorMinPerp()

Trk::CaloCellSelectorMinPerp::CaloCellSelectorMinPerp ( double  coneSize)

Definition at line 17 of file CaloCellSelectorMinPerp.cxx.

◆ ~CaloCellSelectorMinPerp()

Trk::CaloCellSelectorMinPerp::~CaloCellSelectorMinPerp ( )
default

Member Function Documentation

◆ preSelectAction()

bool Trk::CaloCellSelectorMinPerp::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 19 of file CaloCellSelectorMinPerp.cxx.

19  {
20  m_caloExtension = &caloExtension;
21 
22  // find a circular cone (defined by cut in perpendicular distance form track i.e. perp2)
23  // with approx area as the dR cone
24  // the dR cone is roughly thought as an elipse
25  if (m_caloExtension->caloLayerIntersections().empty()) return false;
26 
28 
29  double a = fabs(pos.eta());
30  double b = exp(-a); // = tan(theta/2)
31  double c = 2. * b / (1. - b * b); // = tan(theta)
32  double r = c / sqrt(1. + c * c); // distance from beam axis
33  double t1 = 2. * atan(exp(-(a - m_coneSize)));
34  double t2 = 2. * atan(exp(-(a + m_coneSize)));
35  double dRad1 = fabs(t1 - t2) / 2.;
36  // double dRad1 = 2.*b/(1.+b*b) * m_coneSize; //semi-major axis of the dR cone elipse
37  double dRad2 = r * m_coneSize; // semi minor axis of the dR cone elipse
38  m_perp2cut = dRad1 * dRad2; // force area of circle = area of elipse, i.e. pi*r*r = pi*dRad1*dRad2
39  return true;
40  }

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

◆ select()

bool Trk::CaloCellSelectorMinPerp::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 42 of file CaloCellSelectorMinPerp.cxx.

42  {
43  if (!m_caloExtension || m_caloExtension->caloLayerIntersections().empty()) return false;
44 
45  const CaloDetDescrElement* dde = cell.caloDDE();
46  if (!dde) return false;
47 
48  Amg::Vector3D cellPos(dde->x(), dde->y(), dde->z());
49 
50  int nearestIdx;
51  Amg::Vector3D nearestPos, nearestMom;
52  Utils::findNearestPoint(cellPos, m_caloExtension, nearestIdx, nearestPos, nearestMom);
53 
54  // get the perp2 from track
55  Amg::Vector3D dPos = cellPos - nearestPos;
56  float perp2 = dPos.perp2(nearestMom);
57 
58  // get the total track length from IP to point of cloest approach to the cell
59  // scale the perp2 cut with this length
60  float totTrkLen = sqrt(dPos.mag2() - perp2);
61  if (dPos.dot(nearestMom) < 0) { totTrkLen = -totTrkLen; }
62 
64  Amg::Vector3D oldPos(0., 0., 0.);
65  const std::vector<Trk::CurvilinearParameters>& intersections = m_caloExtension->caloLayerIntersections();
66  for (int i = 0; i <= nearestIdx; ++i) {
67  pos = intersections[i].position();
68  totTrkLen += (pos - oldPos).mag();
69  std::swap(oldPos, pos);
70  }
71 
72  // prevent cell at exact opposite of the track from being selected..
73  if (totTrkLen < 0) return false;
74 
75  if (perp2 < (m_perp2cut * totTrkLen * totTrkLen)) { return true; } // IF
76 
77  return false;
78  }

Member Data Documentation

◆ m_caloExtension

const Trk::CaloExtension* Trk::CaloCellSelectorMinPerp::m_caloExtension
private

Definition at line 32 of file CaloCellSelectorMinPerp.h.

◆ m_coneSize

double Trk::CaloCellSelectorMinPerp::m_coneSize
private

Definition at line 33 of file CaloCellSelectorMinPerp.h.

◆ m_meanPos

Amg::Vector3D Trk::CaloCellSelectorMinPerp::m_meanPos
private

Definition at line 34 of file CaloCellSelectorMinPerp.h.

◆ m_perp2cut

double Trk::CaloCellSelectorMinPerp::m_perp2cut
private

Definition at line 35 of file CaloCellSelectorMinPerp.h.


The documentation for this class was generated from the following files:
Trk::CaloCellSelectorMinPerp::m_perp2cut
double m_perp2cut
Definition: CaloCellSelectorMinPerp.h:35
beamspotman.r
def r
Definition: beamspotman.py:676
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloDetDescrElement::y
float y() const
cell y
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:365
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
perp2
Scalar perp2() const
perp2 method - perpendicular length squared
Definition: AmgMatrixBasePlugin.h:36
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
Trk::CaloCellSelectorMinPerp::m_coneSize
double m_coneSize
Definition: CaloCellSelectorMinPerp.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
Rec::ParticleCaloAssociation::caloExtension
const Trk::CaloExtension & caloExtension() const
return calo extension
Definition: ParticleCaloAssociation.h:73
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
Trk::CaloCellSelectorMinPerp::m_caloExtension
const Trk::CaloExtension * m_caloExtension
Definition: CaloCellSelectorMinPerp.h:32
Trk::ICaloCellSelector::preSelectAction
virtual bool preSelectAction(const Trk::CaloExtension &caloExtension)
Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the gi...
Definition: Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/ICaloCellSelector.h:40
WriteCellNoiseToCool.cellPos
cellPos
Definition: WriteCellNoiseToCool.py:400
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CaloDetDescrElement::x
float x() const
cell x
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:363
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
a
TList * a
Definition: liststreamerinfos.cxx:10
CaloDetDescrElement::z
float z() const
cell z
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:367
Trk::CaloExtension::caloLayerIntersections
const std::vector< CurvilinearParameters > & caloLayerIntersections() const
access to the intersections with the calorimeter layers.
Definition: CaloExtension.h:76
Utils::findNearestPoint
void findNearestPoint(const Amg::Vector3D &inputPos, const Trk::CaloExtension *caloExtension, int &nearestIdx, Amg::Vector3D &nearestPos, Amg::Vector3D &nearestMom)
Definition: CaloCellSelectorUtils.cxx:25
xAOD::Iso::coneSize
float coneSize(IsolationConeSize type)
convert Isolation Size into cone size
Definition: IsolationHelpers.h:27
python.compressB64.c
def c
Definition: compressB64.py:93
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26