|
ATLAS Offline Software
|
Go to the documentation of this file.
31 return StatusCode::SUCCESS;
34 ATH_MSG_DEBUG(
"Process a new tau candidate, addreess " << &tau
35 <<
", e: " << tau.
pt()
36 <<
", eta: " << tau.
eta()
37 <<
", pt: " << tau.
pt());
51 for (
xAOD::PFO* pfo : neutralPFOContainer) {
53 <<
", e: " << pfo->pt()
54 <<
", eta: " << pfo->eta()
55 <<
", pt: " << pfo->pt());
58 return StatusCode::SUCCESS;
64 std::vector<ElementLink<xAOD::IParticleContainer>> emptyLinks;
67 pfo->setAssociatedParticleLinks(
type, emptyLinks);
75 if (not tauTrackLink.isValid()) {
83 chargedPFOContainer.
push_back(chargedPFO);
87 chargedPFO->
setP4(tauTrack->
p4());
106 float position = -10.0;
109 std::vector<const xAOD::IParticle*> tauTrackParticles;
112 if (tauTrackParticles.empty()) {
123 if( not tauTrack->detail(
detail, position)) {
124 ATH_MSG_WARNING(
"Failed to retrieve extrapolated chargedPFO position, will set -10.0 to " <<
detail);
134 std::map< xAOD::PFO*,std::vector< ElementLink< xAOD::IParticleContainer > > > linkMap;
139 if (not hadPFOLink.isValid()) {
143 ATH_MSG_DEBUG(
"hadPFO " << hadPFOLink.index() <<
", eta: " << (*hadPFOLink)->eta() <<
", phi: " << (*hadPFOLink)->phi() );
158 chargedPFOMatch = chargedPFO;
162 if( not chargedPFOMatch ){
174 if( not linkMap.count(chargedPFOMatch) ) {
175 linkMap[chargedPFOMatch] = std::vector< ElementLink< xAOD::IParticleContainer > >();
178 linkMap[chargedPFOMatch].push_back(newHadLink);
182 for (
auto [
k,
v] : linkMap) {
191 std::map< xAOD::PFO*,std::vector< ElementLink< xAOD::IParticleContainer > > > linkMap;
193 if (not chargedPFOLink.isValid()) {
197 const xAOD::PFO* chargedPFO = (*chargedPFOLink);
213 neutralPFOMatch = neutralPFO;
217 if (not neutralPFOMatch){
224 if (not newChargedLink.
isValid()){
229 if( not linkMap.count(neutralPFOMatch) ) {
230 linkMap[neutralPFOMatch] = std::vector< ElementLink< xAOD::IParticleContainer > >();
233 linkMap[neutralPFOMatch].push_back(newChargedLink);
237 for (
auto [
k,
v] : linkMap) {
252 std::vector<const xAOD::IParticle*> chargedPFOs;
254 if (chargedPFOs.empty()) {
258 ATH_MSG_DEBUG(
"Associated charged PFOs: " << chargedPFOs.size() );
261 float neutralEnergy = neutralPFO->
e();
264 if( not chargedPFO ){
265 ATH_MSG_WARNING(
"Failed to downcast IParticle ptr: " << chargedParticle <<
", to ChargedPFO! " );
268 float chargedEMEnergy = chargedPFO->e();
270 std::vector<const xAOD::IParticle*> hadPFOs;
272 for (
const auto *hadPFO : hadPFOs) {
273 chargedEMEnergy -= hadPFO->e();
276 if( chargedEMEnergy < 0.0 ) chargedEMEnergy = 0.0;
277 neutralEnergy -= chargedEMEnergy;
278 ATH_MSG_DEBUG(
"Subtracting charged energy: " << chargedEMEnergy );
280 float neutralPt = neutralEnergy / std::cosh(neutralPFO->
eta());
281 if (neutralPt <= 100.) neutralPt = 100.0;
283 ATH_MSG_DEBUG(
"Neutral PFO pt, original: " << neutralPFO->
pt() <<
" subtracted: " << neutralPt);
284 neutralPFO->
setP4(neutralPt , neutralPFO->
eta(), neutralPFO->
phi(), neutralPFO->
m());
const PFOLinks_t & hadronicPFOLinks() const
void associateHadronicToChargedPFOs(const xAOD::TauJet &pTau, xAOD::PFOContainer &pChargedPFOContainer) const
associate hadronic PFOs to charged PFOs
virtual double pt() const
The transverse momentum ( ) of the particle.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
virtual double eta() const
The pseudorapidity ( ) of the particle.
size_t nProtoNeutralPFOs() const
Get the number of cellbased_neutral PFO particles associated with this tau.
float charge() const
Returns the charge.
void clearProtoChargedPFOLinks()
Remove all cellbased_charged PFOs from the tau.
virtual double eta() const
The pseudorapidity ( ) of the particle.
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
void clearAssociatedParticleLinks(xAOD::PFOContainer &pfoContainer, xAOD::PFODetails::PFOParticleType type) const
Clear accosicated partcle links for the pfo container.
PFOParticleType
This enum is used to label the associated particles to the PFO object.
const PFO * protoChargedPFO(size_t i) const
Get the pointer to a given cellbased_charged PFO associated with this tau.
bool associatedParticles(PFODetails::PFOParticleType ParticleType, std::vector< const IParticle * > &theParticles) const
get a vector of PFO constituent particle types via enum
Class providing the definition of the 4-vector interface.
bool isValid() const
Test to see if the link can be dereferenced.
virtual StatusCode executePi0ClusterScaler(xAOD::TauJet &pTau, xAOD::PFOContainer &pNeutralPFOContainer, xAOD::PFOContainer &pChargedPFOContainer) const override
virtual double e() const
The total energy of the particle.
virtual double pt() const
The transverse momentum ( ) of the particle.
void createChargedPFOs(xAOD::TauJet &pTau, xAOD::PFOContainer &pChargedPFOContainer) const
create charged PFOs
void subtractChargedEnergyFromNeutralPFOs(const xAOD::TauJet &tau, xAOD::PFOContainer &pNeutralPFOContainer) const
associate charged PFOs to neutral PFOs
PFO_v1 PFO
Definition of the current "pfo version".
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
bool setTrackLink(const ElementLink< xAOD::TrackParticleContainer > &theTrack)
Set a track constituent - does NOT append to existing container
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a tau jet.
virtual double phi() const
The azimuthal angle ( ) of the particle.
size_t index() const
Return the index of this element within its container.
TauPi0ClusterScaler(const std::string &name)
ElementLink implementation for ROOT usage.
Class describing a particle flow object.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Evaluate cluster kinematics with a different vertex / signal state.
virtual double m() const
The invariant mass of the particle.
float getExtrapolatedPosition(const xAOD::PFO &chargedPFO, xAOD::TauJetParameters::TrackDetail detail) const
Get extrapolated position to the CAL.
const TauTrackLinks_t tauTrackLinks(TauJetParameters::TauTrackFlag=TauJetParameters::TauTrackFlag::classifiedCharged) const
void associateChargedToNeutralPFOs(const xAOD::TauJet &pTau, xAOD::PFOContainer &pNeutralPFOContainer) const
associate charged PFOs to neutral PFOs
bool setAssociatedParticleLink(PFODetails::PFOParticleType ParticleType, const ElementLink< IParticleContainer > &theParticle)
Set an IParticle constituent via enum - does NOT append to existing container.
void setP4(const FourMom_t &vec)
set the 4-vec
void setCharge(float charge)
set charge of PFO
#define ATH_MSG_WARNING(x)
const TrackParticleLinks_t & trackLinks() const
const PFOLinks_t & protoChargedPFOLinks() const
cellbased pfos
const PFO * protoNeutralPFO(size_t i) const
Get the pointer to a given cellbased_neutral PFO associated with this tau.
const CaloCluster * cluster(unsigned int index) const
Retrieve a const pointer to a CaloCluster.
const TrackParticle * track() const
size_t nProtoChargedPFOs() const
Get the number of cellbased_charged PFO particles associated with this tau.
const T * at(size_type n) const
Access an element, as an rvalue.
void addProtoChargedPFOLink(const ElementLink< PFOContainer > &pfo)
add a cellbased_charged PFO to the tau