ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecoTools
TrackToCalo
src
CaloCellSelectorRoughdR.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// CaloCellSelectorRoughdR.cxx, (c) ATLAS Detector software
8
9
#include "
TrackToCalo/CaloCellSelectorRoughdR.h
"
10
11
#include "
CaloEvent/CaloCell.h
"
12
#include "
TrackToCalo/CaloCellSelectorUtils.h
"
13
#include "
TrkCaloExtension/CaloExtension.h
"
14
15
namespace
Trk
{
16
17
CaloCellSelectorRoughdR::CaloCellSelectorRoughdR
(
double
coneSize) :
m_coneSize
(coneSize),
m_midEta
(0),
m_midPhi
(0),
m_maxDiff
(0) {}
18
19
CaloCellSelectorRoughdR::~CaloCellSelectorRoughdR
() =
default
;
20
21
bool
CaloCellSelectorRoughdR::preSelectAction
(
const
Trk::CaloExtension
& caloExtension) {
22
if
(caloExtension.
caloLayerIntersections
().empty())
return
false
;
23
25
CaloExtensionHelpers::entryExitPerLayerVector
(caloExtension,
m_crossPoints
);
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
}
46
m_maxDiff
+=
m_coneSize
;
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
}
87
88
bool
CaloCellSelectorRoughdR::select
(
const
CaloCell
& cell)
const
{
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
}
93
94
}
// namespace Trk
CaloCellSelectorRoughdR.h
CaloCellSelectorUtils.h
CaloCell.h
CaloExtension.h
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::eta
float eta() const
cell eta
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloDetDescrElement::phi
float phi() const
cell phi
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
Trk::CaloCellSelectorRoughdR::preSelectAction
bool preSelectAction(const Trk::CaloExtension &caloExtension)
Initialize selector wtih CaloExtension, returns false if the selection cannot be performed for the gi...
Definition
CaloCellSelectorRoughdR.cxx:21
Trk::CaloCellSelectorRoughdR::m_crossPoints
CaloExtensionHelpers::EntryExitPerLayerVector m_crossPoints
Definition
CaloCellSelectorRoughdR.h:38
Trk::CaloCellSelectorRoughdR::~CaloCellSelectorRoughdR
~CaloCellSelectorRoughdR()
Trk::CaloCellSelectorRoughdR::m_midEta
double m_midEta
Definition
CaloCellSelectorRoughdR.h:33
Trk::CaloCellSelectorRoughdR::CaloCellSelectorRoughdR
CaloCellSelectorRoughdR(double coneSize)
Definition
CaloCellSelectorRoughdR.cxx:17
Trk::CaloCellSelectorRoughdR::m_midPhi
double m_midPhi
Definition
CaloCellSelectorRoughdR.h:34
Trk::CaloCellSelectorRoughdR::m_maxDiff
double m_maxDiff
Definition
CaloCellSelectorRoughdR.h:35
Trk::CaloCellSelectorRoughdR::select
bool select(const CaloCell &cell) const
Method to determine if a cell is to be selected or not.
Definition
CaloCellSelectorRoughdR.cxx:88
Trk::CaloCellSelectorRoughdR::m_coneSize
double m_coneSize
Definition
CaloCellSelectorRoughdR.h:32
Trk::CaloExtension
Tracking class to hold the extrapolation through calorimeter Layers Both the caloEntryLayerIntersecti...
Definition
TrkEvent/TrkCaloExtension/TrkCaloExtension/CaloExtension.h:19
Trk::CaloExtension::caloLayerIntersections
const std::vector< CurvilinearParameters > & caloLayerIntersections() const
access to the intersections with the calorimeter layers.
Definition
TrkEvent/TrkCaloExtension/TrkCaloExtension/CaloExtension.h:59
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:48
CaloExtensionHelpers::entryExitPerLayerVector
void entryExitPerLayerVector(const Trk::CaloExtension &extension, EntryExitPerLayerVector &result, const LayersToSelect *selection=nullptr)
Definition
CaloExtensionHelpers.h:178
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Utils::deltaR2
double deltaR2(double eta1, double eta2, double phi1, double phi2)
Definition
CaloCellSelectorUtils.cxx:17
Utils::deltaR
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition
CaloCellSelectorUtils.cxx:23
Generated on
for ATLAS Offline Software by
1.17.0