 |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include "GaudiKernel/SystemOfUnits.h"
17 #include <unordered_map>
34 return StatusCode::SUCCESS;
41 return StatusCode::SUCCESS;
46 float sumETCellsLAr = 0.;
47 float eta0cut = 0.075;
48 float eta1cut = 0.0475;
49 float eta2cut = 0.075;
53 float phi2cut = 0.075;
54 float phi3cut = 0.075;
62 constexpr
size_t numberOfEM_Layers{4};
63 constexpr
double invalidCoordinate{-11111.};
64 constexpr
double invalidCoordinateThreshold{-11110.};
65 std::array<double, numberOfEM_Layers> extrapolatedEta{};
66 std::array<double, numberOfEM_Layers> extrapolatedPhi{};
67 extrapolatedEta.fill(invalidCoordinate);
68 extrapolatedPhi.fill(invalidCoordinate);
72 std::unique_ptr<Trk::CaloExtension> uniqueExtension ;
74 trackIndex = orgTrack->
index();
79 Gaudi::Hive::currentContext(), *orgTrack);
80 caloExtension = uniqueExtension.get();
85 caloExtension = (*particleCache)[trackIndex];
86 ATH_MSG_VERBOSE(
"Getting element " << trackIndex <<
" from the particleCache");
87 if( not caloExtension ){
88 ATH_MSG_VERBOSE(
"Cache does not contain a calo extension -> Calculating with the a CaloExtensionTool" );
90 Gaudi::Hive::currentContext(), *orgTrack);
91 caloExtension = uniqueExtension.get();
94 if( not caloExtension){
95 ATH_MSG_DEBUG(
"extrapolation of leading track to calo surfaces failed : caloExtension is nullptr" );
96 return StatusCode::RECOVERABLE;
98 const std::vector<Trk::CurvilinearParameters>& clParametersVector = caloExtension->caloLayerIntersections();
99 if(clParametersVector.empty() ){
100 ATH_MSG_DEBUG(
"extrapolation of leading track to calo surfaces failed : caloLayerIntersection is empty" );
101 return StatusCode::RECOVERABLE;
113 if(
index < 0 )
continue;
114 extrapolatedEta[
index] =
cur.position().eta();
115 extrapolatedPhi[
index] =
cur.position().phi();
117 for (
size_t i = 0;
i < numberOfEM_Layers; ++
i) {
118 if ( extrapolatedEta[
i] < invalidCoordinateThreshold || extrapolatedPhi[
i] < invalidCoordinateThreshold ){
119 ATH_MSG_DEBUG(
"extrapolation of leading track to calo surfaces failed for sampling : " <<
i );
120 return StatusCode::SUCCESS;
125 std::bitset<200000> cellSeen{};
126 const std::unordered_map<int, int> samplingLookup{
127 {4,0}, {5,1}, {6,2}, {7,3}, {8,12},
128 {15, 12}, {16,13}, {17,14}, {18,12}, {19, 13}, {20,14}
130 const auto notFound{samplingLookup.end()};
132 std::vector<xAOD::CaloVertexedTopoCluster> vertexedClusterList = pTau.
vertexedClusters();
137 if (cell_links ==
nullptr) {
138 ATH_MSG_DEBUG(
"NO Cell links found for cluster with pT " << cluster.
pt());
143 for (; pCellIter != pCellIterE; ++pCellIter) {
144 double cellEta{}, cellPhi{}, cellET{};
150 cellPhi = vxCell.
phi();
151 cellEta = vxCell.
eta();
152 cellET = vxCell.
et();
154 cellPhi = pCell->
phi();
155 cellEta = pCell->
eta();
156 cellET = pCell->
et();
159 if (
const auto & pElement {samplingLookup.find(sampling)};pElement != notFound){
160 sampling = pElement->second;
163 if (sampling < 4)
i = sampling;
164 if (sampling == 12 || sampling == 13 || sampling == 14)
i = 3;
166 detEtaTrk = std::abs( cellEta - extrapolatedEta[
i] );
167 if ((sampling == 0 && detEtaTrk < eta0cut && detPhiTrk < phi0cut) ||
168 (sampling == 1 && detEtaTrk < eta1cut && detPhiTrk < phi1cut) ||
169 (sampling == 2 && detEtaTrk < eta2cut && detPhiTrk < phi2cut) ||
170 (sampling == 3 && detEtaTrk < eta3cut && detPhiTrk < phi3cut)) {
171 sumETCellsLAr += cellET;
177 return StatusCode::SUCCESS;
virtual double phi() const override final
get phi (through CaloDetDescrElement)
virtual double eta() const final
The pseudorapidity of the particle.
Gaudi::Property< bool > m_useOldCalo
Tracking class to hold the extrapolation through calorimeter Layers Both the caloEntryLayerIntersecti...
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
const_iterator begin() const
const begin method
CaloSampling::CaloSample caloSample(TrackParametersIdentifier id) const
CaloSample encoded in id, returns CaloSampling::Unknown if id is not valid
const Amg::Vector3D & position() const
Returns the 3-pos.
virtual double phi() const final
The aximuthal angle of the particle.
#define ATH_MSG_VERBOSE(x)
__HOSTDEV__ double Phi_mpi_pi(double)
bool isEntryToVolume(TrackParametersIdentifier id) const
returns true if the id belongs to the volume entrance
helper class to encode and decode a TrackParametersIdentifier
Description of a calorimeter cluster.
Gaudi::Property< bool > m_doVertexCorrection
IdentifierHash calo_hash() const
cell calo hash
SG::ReadHandleKey< CaloExtensionCollection > m_ParticleCacheKey
virtual StatusCode execute(xAOD::TauJet &pTau) const override
Execute - called for each tau candidate.
::StatusCode StatusCode
StatusCode definition for legacy code.
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Class describing a tau jet.
const TauTrack * track(size_t i, TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged, int *container_index=0) const
Get the pointer to a given tauTrack associated with this tau /*container index needed by trackNonCons...
virtual double et() const override final
get et
TauElectronVetoVariables(const std::string &name)
size_t index() const
Return the index of this element within its container.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
virtual double pt() const
The transverse momentum ( ) of the particle.
std::vector< xAOD::CaloVertexedTopoCluster > vertexedClusters() const
const_iterator end() const
const end method
Data object for each calorimeter readout cell.
Evaluate cell kinematics with a different vertex.
virtual StatusCode initialize() override
Tool initializer.
CaloCell_ID::CaloSample getSampling() const
cell sampling
const Vertex * vertex() const
@ sumEMCellEtOverLeadTrkPt
void setDetail(TauJetParameters::Detail detail, int value)
virtual double et() const
transverse energy defined to be e*sin(theta)
const TrackParticle * track() const
Class describing a TrackParticle.
Evaluate cluster kinematics with a different vertex / signal state.
const_iterator to loop over cells belonging to a cluster
Evaluate cell kinematics with a different vertex.
virtual double eta() const override final
get eta (through CaloDetDescrElement)
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool