|
ATLAS Offline Software
|
Go to the documentation of this file.
15 for (
unsigned int n = 0;
n <
p->nChildren();
n++) {
19 if (!child)
return nullptr;
21 return getCharmChild(child);
38 for (
size_t iC = 0; iC <
p->nChildren(); iC++) {
40 if (!
cc) {
continue; }
51 if (!
p)
return {NAN, NAN, NAN};
52 return {
p->x(),
p->y(),
p->z()};
55 return {j.
px(), j.
py(), j.
pz()};
58 if (
events.empty())
return {NAN, NAN, NAN};
59 return p3(
events.at(0)->signalProcessVertex());
64 (
const std::vector<const xAOD::TruthParticle*>&
parents
65 , std::vector<const xAOD::TruthParticle*>&
children
71 const std::vector<const xAOD::TruthParticle*> copyParents =
parents;
93 auto chk = [](
const std::string&
s,
const std::string&
varname) {
94 if (
s.empty())
throw std::runtime_error(
95 "name for '" +
varname +
"' is not specified in particle jet tools"
98 #define CHECK(var) chk(var, #var)
117 singleint(
n.singleint),
118 doubleint(
n.doubleint),
126 childLxy(
n.childLxy),
128 childPdgId(
n.childPdgId),
129 childPositionDPhi(
n.childPositionDPhi),
130 childPositionDEta(
n.childPositionDEta)
139 const std::string& linkname):
145 const std::vector<const xAOD::TruthParticle*>& ipv)
const
153 IPLV::value_type link;
156 link.toIndexedElement(*ipc,
ip->index());
157 links.push_back(link);
168 if (container.size() == 0)
return nullptr;
169 auto itr = std::max_element(container.begin(), container.end(),
170 [](
auto*
p1,
auto*
p2) {
171 return p1->pt() < p2->pt();
183 labelling_particle = getMaxPtPart(
particles.b);
184 child_particle = getCharmChild(labelling_particle);
187 labelling_particle = getMaxPtPart(
particles.c);
190 labelling_particle = getMaxPtPart(
particles.tau);
227 int double_label = 0;
247 bool hasElectrondecay =
false;
248 bool hasMuondecay =
false;
249 bool hasHadronicdecay =
false;
251 for (
size_t i = 0;
i< itau->nChildren();
i++){
252 if (itau->child(
i)->absPdgId() == 12 || itau->child(
i)->absPdgId() == 14 || itau->child(
i)->absPdgId() == 16)
continue;
253 if (
MC::isMuon(itau->child(
i))) hasMuondecay =
true;
255 else hasHadronicdecay =
true;
261 if (hasHadronicdecay){
263 if (hasMuondecay) double_label = 151513;
265 else if (hasElectrondecay) double_label = 151511;
267 else double_label = 1515;
271 if (hasHadronicdecay) double_label = 15;
287 if (!
part)
return NAN;
291 if (!
part)
return NAN;
292 if (
const auto* vx =
part->decayVtx() )
return (
p3(vx) - origin).perp();
296 if (!
part)
return NAN;
297 return part->p4().DeltaR(
jet.p4());
301 return part->pdgId();
306 if (!
part)
return NAN;
307 if (
const auto* vx =
part->decayVtx() ) {
309 return p3(
jet).deltaPhi(displacement);
316 if (!
part)
return NAN;
317 if (
const auto* vx =
part->decayVtx() ) {
319 return displacement.eta() -
jet.eta();
bool isChild(const xAOD::TruthParticle *p, const xAOD::TruthParticle *c)
SG::AuxElement::Decorator< float > childLxy
bool hasCharm(const T &p)
LabelDecorators(const LabelNames &)
parents
print ("==> buf:",buf)
std::string childPositionDEta
float partDR(const xAOD::TruthParticle *part, const xAOD::Jet &jet)
SG::AuxElement::Decorator< int > barcode
constexpr int INVALID_PARTICLE_BARCODE
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
float positionDEta(const xAOD::TruthParticle *part, const xAOD::Jet &jet, const Amg::Vector3D &origin)
SG::AuxElement::Decorator< float > Lxy
Amg::Vector3D p3(const xAOD::TruthVertex *p)
SG::AuxElement::Decorator< int > doubleint
SG::AuxElement::Decorator< IPLV > m_dec
float pz() const
The z-component of the jet's momentum.
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Class describing a truth particle in the MC record.
float py() const
The y-component of the jet's momentum.
void childrenRemoved(const std::vector< const xAOD::TruthParticle * > &parents, std::vector< const xAOD::TruthParticle * > &children)
SG::AuxElement::Decorator< float > pt
float partPt(const xAOD::TruthParticle *part)
Class describing a truth vertex in the MC record.
SG::AuxElement::Decorator< int > pdgId
SG::AuxElement::Decorator< int > childPdgId
std::string childPositionDPhi
IParticleLinker(const SG::ReadHandleKey< xAOD::TruthParticleContainer > &, const std::string &linkName)
float px() const
The x-component of the jet's momentum.
SG::AuxElement::Decorator< float > childPt
Eigen::Matrix< double, 3, 1 > Vector3D
SG::AuxElement::Decorator< float > positionDEta
Amg::Vector3D signalProcessP3(const xAOD::TruthEventContainer &)
float positionDPhi(const xAOD::TruthParticle *part, const xAOD::Jet &jet, const Amg::Vector3D &origin)
void setJetLabels(const xAOD::Jet &jet, const Particles &particles, const LabelNames &names)
float partLxy(const xAOD::TruthParticle *part, const Amg::Vector3D &origin)
int partPdgId(const xAOD::TruthParticle *part)
SG::AuxElement::Decorator< float > childPositionDEta
SG::AuxElement::Decorator< float > positionDPhi
void decorate(const xAOD::Jet &, const std::vector< const xAOD::TruthParticle * > &) const
int pdgId() const
PDG ID code.
SG::AuxElement::Decorator< float > childPositionDPhi
SG::AuxElement::Decorator< int > singleint
SG::AuxElement::Decorator< float > dr
std::vector< ElementLink< xAOD::IParticleContainer > > IPLV