![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
19 #include "fastjet/ClusterSequence.hh"
20 #include "fastjet/ClusterSequenceArea.hh"
21 #include <fastjet/AreaDefinition.hh>
52 ATH_MSG_ERROR(
"JetForwardPFlowJvtTool needs to have its input jet container configured!");
53 return StatusCode::FAILURE;
88 return StatusCode::SUCCESS;
92 std::vector<TVector2> pileupMomenta;
98 if(pileupMomenta.empty()) {
99 ATH_MSG_DEBUG(
"pileupMomenta is empty, this can happen for events with no PU vertices."
100 <<
" fJVT won't be computed for this event and will be set to 0 instead." );
102 fjvtHandle(*jetF) = 1;
103 fjvtRawHandle(*jetF) = 0;
105 return StatusCode::SUCCESS;
109 fjvtHandle(*jetF) = 1;
110 fjvtRawHandle(*jetF) = 0;
113 double fjvt =
getFJVT(jetF,pileupMomenta);
115 fjvtRawHandle(*jetF) = fjvt;
118 return StatusCode::SUCCESS;
124 for (
const TVector2&
pu : pileupMomenta) {
125 double projection =
pu*fjet/fjet.Mod();
126 if (projection<fjvt) fjvt = projection;
128 return -1*fjvt/fjet.Mod();
132 int pvind,
int vertices)
const {
133 std::vector<TVector2> pileupMomenta;
135 const std::size_t pv_index = (pvind==-1) ?
getPV() : std::size_t(pvind);
141 if(vx->index()==(
size_t)pv_index)
continue;
144 jname += vx->index();
148 ATH_MSG_WARNING(
" Some issue appeared while building the pflow pileup jets for vertex "
149 << vx->index() <<
" (vxType = " << vx->vertexType()<<
" )!" );
150 return pileupMomenta;
170 pileupMomenta.push_back(vertex_met);
171 if(vertices!=-1 &&
int(vx->index())==vertices)
break;
173 return pileupMomenta;
178 char jet_nnjvtpass=
false;
180 jet_nnjvtpass = passJvtHandle(*pjet);
181 if (pjet->p4().DeltaR(
jet->p4())<0.3 && jet_nnjvtpass &&
isCentralJet(pjet) )
return true;
190 std::vector<fastjet::PseudoJet> input_pfo;
191 std::set<int> charged_pfo;
196 ATH_MSG_ERROR(
"Could not retrieve the TrackVertexAssociation: "
207 if (!orHandle(*fe))
continue;
209 if (fe->isCharged()) {
214 if (vx.
index()!=pv_index
219 charged_pfo.insert(fe->index());
221 else if (std::abs(fe->eta())<
m_neutMaxRap && !fe->isCharged() && fe->e()>0)
233 if (!orHandle(*pfo))
continue;
235 if (pfo->isCharged()) {
236 if (vx.
index()==pv_index && std::abs((vx.
z()-pfo->track(0)->z0())*
sin(pfo->track(0)->theta()))>
m_dzCut)
238 if (vx.
index()!=pv_index
243 charged_pfo.insert(pfo->index());
245 else if (std::abs(pfo->eta())<
m_neutMaxRap && !pfo->isCharged() && pfo->eEM()>0)
252 std::shared_ptr<xAOD::JetContainer> vertjets = std::make_shared<xAOD::JetContainer>();
253 std::shared_ptr<xAOD::JetAuxContainer> vertjetsAux = std::make_shared<xAOD::JetAuxContainer>();
255 vertjets->setStore(vertjetsAux.get());
260 fastjet::AreaDefinition area_def(fastjet::active_area_explicit_ghosts,
261 fastjet::GhostedAreaSpec(fastjet::SelectorAbsRapMax(
m_maxRap)));
262 fastjet::ClusterSequenceArea clust_pfo(input_pfo,jet_def,area_def);
263 std::vector<fastjet::PseudoJet> inclusive_jets = sorted_by_pt(clust_pfo.inclusive_jets(5000.));
265 for (
size_t i = 0;
i < inclusive_jets.size();
i++) {
268 inclusive_jets[
i].
eta(),
269 inclusive_jets[
i].
phi(),
270 inclusive_jets[
i].
m());
272 inclusive_jets[
i].area_4vector().
eta(),
273 inclusive_jets[
i].area_4vector().
phi(),
274 inclusive_jets[
i].area_4vector().
m());
276 jet->setJetP4(tempjetp4);
277 jet->setJetP4(
"JetConstitScaleMomentum",tempjetp4);
278 jet->setJetP4(
"JetPileupScaleMomentum",tempjetp4);
279 jet->setAttribute(
"ActiveArea4vec",newArea);
280 jet->setAttribute(
"DetectorEta",
jet->eta());
281 std::vector<fastjet::PseudoJet> constituents = inclusive_jets[
i].constituents();
282 float chargedpart = 0;
283 for (
size_t j = 0; j < constituents.size(); j++) {
284 if (charged_pfo.count(constituents[j].user_index())>=1) {
285 chargedpart += constituents[j].perp();
292 if((
m_pfoJES->modify(*vertjets)).isFailure()){
303 TLorentzVector pfo_p4;
306 if( (
m_wpfotool->fillWeight(*pfo,pweight)).isSuccess() ){
308 pfo_p4= TLorentzVector(pfo->
p4().Px()*pweight,pfo->
p4().Py()*pweight,pfo->
p4().Pz()*pweight,pfo->
e()*pweight);
313 fastjet::PseudoJet psj(pfo_p4);
316 psj.set_user_index(pfo->
index());
318 psj.set_user_index(-1);
325 TLorentzVector fe_p4;
328 if( (
m_wpfotool->fillWeight(*fe,pweight)).isSuccess() ){
330 fe_p4= TLorentzVector(fe->
p4().Px()*pweight,fe->
p4().Py()*pweight,fe->
p4().Pz()*pweight,fe->
e()*pweight);
335 fastjet::PseudoJet psj(fe_p4);
338 psj.set_user_index(fe->
index());
340 psj.set_user_index(-1);
369 ATH_MSG_DEBUG(
"Successfully retrieved primary vertex container");
374 if(vxContHandle->empty() ){
376 }
else if(vxContHandle->size() != 1 ){
377 ATH_MSG_WARNING(
"Couldn't identify the hard-scatter primary vertex (no vertex with \"vx->vertexType()==xAOD::VxType::PriVtx\" in the container)! ");
391 for(
const xAOD::Jet *tjet : *truthJets) {
392 if (tjet->p4().DeltaR(
jet->p4())<0.3 && tjet->pt()>10
e3) ishs =
true;
393 if (tjet->p4().DeltaR(
jet->p4())<0.6) ispu =
false;
395 isHSHandle(*
jet)=ishs;
396 isPUHandle(*
jet)=ispu;
398 return StatusCode::SUCCESS;
std::shared_ptr< xAOD::JetAuxContainer > jetAuxCont
Scalar phi() const
phi method
Scalar perp() const
perp method - perpenticular length
Scalar eta() const
pseudorapidity method
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual double e() const
The total energy of the particle.
std::shared_ptr< xAOD::JetContainer > jetCont
Handle class for reading a decoration on an object.
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
float z() const
Returns the z position.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
size_t index() const
Return the index of this element within its container.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const xAOD::Vertex * associatedVertex(const xAOD::TrackParticle *trk) const
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Class describing a particle flow object.
virtual double e() const override
The total energy of the particle.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
Class describing a TrackParticle.
TLorentzVector GetVertexCorrectedEMFourVec(const xAOD::Vertex &vertexToCorrectTo) const
Correct EM scale 4-vector to point at a vertex.
TLorentzVector getVertexCorrectedFourVec(const xAOD::FlowElement &fe, const xAOD::Vertex &vertexToCorrectTo)
Jet_v1 Jet
Definition of the current "jet version".
A detector object made of other lower level object(s)