Loading [MathJax]/extensions/tex2jax.js
 |
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>
53 ATH_MSG_ERROR(
"JetForwardPFlowJvtTool needs to have its input jet container configured!");
54 return StatusCode::FAILURE;
90 return StatusCode::SUCCESS;
94 std::vector<TVector2> pileupMomenta;
100 if(pileupMomenta.empty()) {
101 ATH_MSG_DEBUG(
"pileupMomenta is empty, this can happen for events with no PU vertices."
102 <<
" fJVT won't be computed for this event and will be set to 0 instead." );
104 fjvtHandle(*jetF) = 1;
105 fjvtRawHandle(*jetF) = 0;
107 return StatusCode::SUCCESS;
111 fjvtHandle(*jetF) = 1;
112 fjvtRawHandle(*jetF) = 0;
115 double fjvt =
getFJVT(jetF,pileupMomenta);
117 fjvtRawHandle(*jetF) = fjvt;
120 return StatusCode::SUCCESS;
126 for (
const TVector2&
pu : pileupMomenta) {
127 double projection =
pu*fjet/fjet.Mod();
128 if (projection<fjvt) fjvt = projection;
130 return -1*fjvt/fjet.Mod();
134 int pvind,
int vertices)
const {
135 std::vector<TVector2> pileupMomenta;
137 const std::size_t pv_index = (pvind==-1) ?
getPV() : std::size_t(pvind);
143 if(vx->index()==(
size_t)pv_index)
continue;
146 jname += vx->index();
150 ATH_MSG_WARNING(
" Some issue appeared while building the pflow pileup jets for vertex "
151 << vx->index() <<
" (vxType = " << vx->vertexType()<<
" )!" );
152 return pileupMomenta;
172 pileupMomenta.push_back(vertex_met);
173 if(vertices!=-1 &&
int(vx->index())==vertices)
break;
175 return pileupMomenta;
180 char jet_nnjvtpass=
false;
182 jet_nnjvtpass = passJvtHandle(*pjet);
183 if (pjet->p4().DeltaR(
jet->p4())<0.3 && jet_nnjvtpass &&
isCentralJet(pjet) )
return true;
192 std::vector<fastjet::PseudoJet> input_pfo;
193 std::set<int> charged_pfo;
198 ATH_MSG_ERROR(
"Could not retrieve the TrackVertexAssociation: "
209 if (!orHandle(*fe))
continue;
211 if (fe->isCharged()) {
216 if (vx.
index()!=pv_index
221 charged_pfo.insert(fe->index());
223 else if (std::abs(fe->eta())<
m_neutMaxRap && !fe->isCharged() && fe->e()>0)
235 if (!orHandle(*pfo))
continue;
237 if (pfo->isCharged()) {
238 if (vx.
index()==pv_index && std::abs((vx.
z()-pfo->track(0)->z0())*
sin(pfo->track(0)->theta()))>
m_dzCut)
240 if (vx.
index()!=pv_index
245 charged_pfo.insert(pfo->index());
247 else if (std::abs(pfo->eta())<
m_neutMaxRap && !pfo->isCharged() && pfo->eEM()>0)
254 std::shared_ptr<xAOD::JetContainer> vertjets = std::make_shared<xAOD::JetContainer>();
255 std::shared_ptr<xAOD::JetAuxContainer> vertjetsAux = std::make_shared<xAOD::JetAuxContainer>();
257 vertjets->setStore(vertjetsAux.get());
262 std::vector<int> seeds;
264 if (!evtInfoHandle.isValid())
272 fastjet::AreaDefinition area_def(fastjet::active_area_explicit_ghosts,
273 fastjet::GhostedAreaSpec(fastjet::SelectorAbsRapMax(
m_maxRap)));
274 area_def = area_def.with_fixed_seed(seeds);
275 fastjet::ClusterSequenceArea clust_pfo(input_pfo,jet_def,area_def);
276 std::vector<fastjet::PseudoJet> inclusive_jets = sorted_by_pt(clust_pfo.inclusive_jets(5000.));
278 for (
size_t i = 0;
i < inclusive_jets.size();
i++) {
281 inclusive_jets[
i].
eta(),
282 inclusive_jets[
i].
phi(),
283 inclusive_jets[
i].
m());
285 inclusive_jets[
i].area_4vector().
eta(),
286 inclusive_jets[
i].area_4vector().
phi(),
287 inclusive_jets[
i].area_4vector().
m());
289 jet->setJetP4(tempjetp4);
290 jet->setJetP4(
"JetConstitScaleMomentum",tempjetp4);
291 jet->setJetP4(
"JetPileupScaleMomentum",tempjetp4);
292 jet->setAttribute(
"ActiveArea4vec",newArea);
293 jet->setAttribute(
"DetectorEta",
jet->eta());
294 std::vector<fastjet::PseudoJet> constituents = inclusive_jets[
i].constituents();
295 float chargedpart = 0;
296 for (
size_t j = 0; j < constituents.size(); j++) {
297 if (charged_pfo.count(constituents[j].user_index())>=1) {
298 chargedpart += constituents[j].perp();
305 if((
m_pfoJES->modify(*vertjets)).isFailure()){
316 TLorentzVector pfo_p4;
319 if( (
m_wpfotool->fillWeight(*pfo,pweight)).isSuccess() ){
321 pfo_p4= TLorentzVector(pfo->
p4().Px()*pweight,pfo->
p4().Py()*pweight,pfo->
p4().Pz()*pweight,pfo->
e()*pweight);
326 fastjet::PseudoJet psj(pfo_p4);
329 psj.set_user_index(pfo->
index());
331 psj.set_user_index(-1);
338 TLorentzVector fe_p4;
341 if( (
m_wpfotool->fillWeight(*fe,pweight)).isSuccess() ){
343 fe_p4= TLorentzVector(fe->
p4().Px()*pweight,fe->
p4().Py()*pweight,fe->
p4().Pz()*pweight,fe->
e()*pweight);
348 fastjet::PseudoJet psj(fe_p4);
351 psj.set_user_index(fe->
index());
353 psj.set_user_index(-1);
382 ATH_MSG_DEBUG(
"Successfully retrieved primary vertex container");
387 if(vxContHandle->empty() ){
389 }
else if(vxContHandle->size() != 1 ){
390 ATH_MSG_WARNING(
"Couldn't identify the hard-scatter primary vertex (no vertex with \"vx->vertexType()==xAOD::VxType::PriVtx\" in the container)! ");
404 for(
const xAOD::Jet *tjet : *truthJets) {
405 if (tjet->p4().DeltaR(
jet->p4())<0.3 && tjet->pt()>10
e3) ishs =
true;
406 if (tjet->p4().DeltaR(
jet->p4())<0.6) ispu =
false;
408 isHSHandle(*
jet)=ishs;
409 isPUHandle(*
jet)=ispu;
411 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.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
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.
void seedsFromEventInfo(const xAOD::EventInfo *ei, std::vector< int > &seeds)
Fill seeds vector from run & event number. This functio is separated from the class so it's easier to...
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.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
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)