 |
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),
132 acc_uid(
n.useBarcode ?
"barcode" :
"uid")
141 const std::string& linkname):
147 const std::vector<const xAOD::TruthParticle*>& ipv)
const
155 IPLV::value_type link;
158 link.toIndexedElement(*ipc,
ip->index());
159 links.push_back(link);
170 if (container.size() == 0)
return nullptr;
171 auto itr = std::max_element(container.begin(), container.end(),
172 [](
auto*
p1,
auto*
p2) {
173 return p1->pt() < p2->pt();
185 labelling_particle = getMaxPtPart(
particles.b);
186 child_particle = getCharmChild(labelling_particle);
189 labelling_particle = getMaxPtPart(
particles.c);
192 labelling_particle = getMaxPtPart(
particles.tau);
230 int double_label = 0;
250 bool hasElectrondecay =
false;
251 bool hasMuondecay =
false;
252 bool hasHadronicdecay =
false;
254 for (
size_t i = 0;
i< itau->nChildren();
i++){
255 if (itau->child(
i)->absPdgId() == 12 || itau->child(
i)->absPdgId() == 14 || itau->child(
i)->absPdgId() == 16)
continue;
256 if (
MC::isMuon(itau->child(
i))) hasMuondecay =
true;
258 else hasHadronicdecay =
true;
264 if (hasHadronicdecay){
266 if (hasMuondecay) double_label = 151513;
268 else if (hasElectrondecay) double_label = 151511;
270 else double_label = 1515;
274 if (hasHadronicdecay) double_label = 15;
290 if (!
part)
return NAN;
294 if (!
part)
return NAN;
295 if (
const auto* vx =
part->decayVtx() )
return (
p3(vx) - origin).perp();
299 if (!
part)
return NAN;
300 return part->p4().DeltaR(
jet.p4());
304 return part->pdgId();
309 if (!
part)
return NAN;
310 if (
const auto* vx =
part->decayVtx() ) {
312 return p3(
jet).deltaPhi(displacement);
319 if (!
part)
return NAN;
320 if (
const auto* vx =
part->decayVtx() ) {
322 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
constexpr int INVALID_PARTICLE_ID
float partDR(const xAOD::TruthParticle *part, const xAOD::Jet &jet)
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
SG::AuxElement::Decorator< int > uniqueID
Amg::Vector3D p3(const xAOD::TruthVertex *p)
SG::AuxElement::Decorator< int > doubleint
SG::AuxElement::Decorator< IPLV > m_dec
SG::ConstAccessor< int > acc_uid
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