|
ATLAS Offline Software
|
Go to the documentation of this file.
52 ATH_MSG_ERROR(
"JetForwardJvtTool needs to have its input jet container configured!");
53 return StatusCode::FAILURE;
74 #ifndef XAOD_STANDALONE
87 return StatusCode::SUCCESS;
94 std::vector<TVector2> pileupMomenta;
95 const std::size_t pvind =
getPV();
99 for(
const auto *
const jetF : jetCont) {
100 outHandle(*jetF) = 1;
103 double fjvt =
getFJVT(jetF, pileupMomenta, pvind)/jetF->pt();
105 fjvtDecHandle(*jetF) = fjvt;
107 return StatusCode::SUCCESS;
113 return fjvtDecHandle(*
jet);
118 for (
size_t pui = 0; pui < pileupMomenta.size(); pui++) {
119 if (pui==pvind)
continue;
120 double projection = pileupMomenta[pui]*fjet/fjet.Mod();
121 if (projection>fjvt) fjvt = projection;
131 if( !trkMetHandle.
isValid() ) {
135 if( !vertexContainerHandle.
isValid() ) {
140 std::vector<TVector2> pileupMomenta;
141 for(
const auto *
const vx : *vertexContainerHandle) {
143 TString vname =
"PVTrack_vx";
144 vname += vx->index();
146 TVector2(0.5*(*trkMetHandle)[vname.Data()]->mpx(),
147 0.5*(*trkMetHandle)[vname.Data()]->mpy()));
150 for (
const auto *
const jet : *
jets) {
153 if (jetvert>=0) pileupMomenta[jetvert] += TVector2(0.5*
jet->pt()*
cos(
jet->phi()),0.5*
jet->pt()*
sin(
jet->phi()));
155 return pileupMomenta;
163 Width = widthHandle(*
jet);
169 CWidth+=fabs(
cl->pt()*
atan(sqrt(secondR)/centermag)*cosh(
cl->eta()));
173 return (CWidth + Width);
187 if(!orHandle(*
jet))
return false;
191 jvt = jvtMomentHandle(*
jet);
198 std::vector<float> sumpts;
200 sumpts = sumPtsHandle(*
jet);
203 for (
size_t i = 0;
i < sumpts.size();
i++) {
204 if (sumpts[
i]>firstVal) {
206 firstVal = sumpts[
i];
213 std::vector<float> sumpts;
215 sumpts = sumPtsHandle(*
jet);
216 if (sumpts.size()<2)
return 0;
218 std::nth_element(sumpts.begin(),sumpts.begin()+sumpts.size()/2,sumpts.end(),std::greater<int>());
219 double median = sumpts[sumpts.size()/2];
220 std::nth_element(sumpts.begin(),sumpts.begin(),sumpts.end(),std::greater<int>());
221 double max = sumpts[0];
227 std::size_t pvind = 0;
229 if (!vertexContainer.isValid()){
233 const auto *vxCont = vertexContainer.cptr();
235 if(vxCont->empty()) {
238 ATH_MSG_DEBUG(
"Successfully retrieved primary vertex container");
239 for(
const auto *
const vx : *vxCont) {
241 {pvind = vx->index();
break;}
250 for(
const auto *
const jet : *
jets) {
253 for(
const auto *
const tjet : *truthJets) {
254 if (tjet->p4().DeltaR(
jet->p4())<0.3 && tjet->pt()>10
e3) ishs =
true;
255 if (tjet->p4().DeltaR(
jet->p4())<0.6) ispu =
false;
257 isHSHandle(*
jet)=ishs;
258 isPUHandle(*
jet)=ispu;
260 return StatusCode::SUCCESS;
iterator end() const
iterator after the last constituent
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
float median(std::vector< float > &Vec)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
iterator begin() const
iterator on the first constituent
Description of a calorimeter cluster.
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 bool isValid() override final
Can the handle be successfully dereferenced?
bool SECOND_R(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, double &out)
bool CENTER_MAG(const xAOD::TauJet &, const xAOD::CaloVertexedTopoCluster &cluster, double &out)
#define ATH_MSG_WARNING(x)
A vector of jet constituents at the scale used during jet finding.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
bool empty() const noexcept
Returns true if the collection is empty.