![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
33 ATH_MSG_ERROR(
"JetQGTaggerVariableTool needs to have its input jet container configured!");
34 return StatusCode::FAILURE;
56 return StatusCode::SUCCESS;
73 if (!vertexContainer.isValid()){
75 return StatusCode::FAILURE;
78 const auto *vertices = vertexContainer.cptr();
82 if (vertices->empty() ) {
86 nTrkHandle(*
jet) = -1;
87 trkWidthHandle(*
jet) = -1.;
88 trkC1Handle(*
jet) = -1.;
89 nChargedHandle(*
jet) = -1;
90 truthPtHandle(*
jet) = -1.;
91 truthEtaHandle(*
jet) = -1.;
94 return StatusCode::SUCCESS;
102 if (!handle_tva.isValid()){
104 return StatusCode::FAILURE;
107 const auto *tva = handle_tva.cptr();
112 int nTracksCount = 0;
113 float TracksWidth = 0., SumTracks_pTs = 0., TracksC1 = 0.,
beta = 0.2;
116 std::vector<const xAOD::IParticle*> jettracks;
120 std::vector<bool> IsGoodTrack;
121 TLorentzVector tracki_TLV, trackj_TLV;
122 TLorentzVector jet_TLV =
jet -> p4();
123 for (
size_t i = 0;
i < jettracks.size();
i++) {
126 IsGoodTrack.push_back(
false);
139 (HSvertex == tva->associatedVertex(trk) || (HSvertex != tva->associatedVertex(trk) && std::abs((trk->
z0()+trk->
vz()-HSvertex->
z())*
sin(trk->
theta()))<3.))
142 IsGoodTrack.push_back(
accept);
147 tracki_TLV = trk -> p4();
148 double DR_tracki_jet = tracki_TLV.DeltaR(jet_TLV);
149 TracksWidth += trk ->
pt() * DR_tracki_jet;
150 SumTracks_pTs += trk ->
pt();
154 if(SumTracks_pTs>0.) TracksWidth = TracksWidth / SumTracks_pTs;
155 else TracksWidth = -1.;
158 for(
size_t i = 0;
i < jettracks.size();
i++) {
160 if( !( IsGoodTrack.at(
i) ) )
continue;
162 for(
size_t j =
i+1; j < jettracks.size(); j++) {
164 if( !( IsGoodTrack.at(j) ) )
continue;
166 tracki_TLV = trki -> p4();
167 trackj_TLV = trkj -> p4();
168 double DR_tracki_trackj = tracki_TLV.DeltaR(trackj_TLV);
169 TracksC1 += trki ->
pt() * trkj ->
pt() *
pow( DR_tracki_trackj,
beta) ;
174 if(SumTracks_pTs>0.) TracksC1 = TracksC1 / (
pow(SumTracks_pTs, 2.) );
180 if (!eventInfoContainer.isValid()){
182 return StatusCode::FAILURE;
185 const auto *eventInfo = eventInfoContainer.cptr();
189 float truthjet_pt = -999.0;
190 float truthjet_eta = -999.0;
196 ATH_MSG_DEBUG(
"Accessing GhostTruthAssociationLink: is available");
199 ATH_MSG_DEBUG(
"Accessing GhostTruthAssociationLink: is valid");
211 ATH_MSG_DEBUG(
"Cannot access truth Link: setting weight to 1");
217 truthjet_pt = tjet->
pt();
218 truthjet_eta = tjet->
eta();
228 if( ! (
part->pt()>500.) )
continue;
231 if( !(
part->isCharged()) )
continue;
237 nTrkHandle(*
jet) = nTracksCount;
238 trkWidthHandle(*
jet) = TracksWidth;
239 trkC1Handle(*
jet) = TracksC1;
240 nChargedHandle(*
jet) = tntrk;
241 truthPtHandle(*
jet) = truthjet_pt;
242 truthEtaHandle(*
jet) = truthjet_eta;
246 return StatusCode::SUCCESS;
253 for (
size_t iVertex = 0; iVertex < vertices->
size(); ++iVertex ) {
256 ATH_MSG_VERBOSE(
"JetQGTaggerVariableTool " <<
name() <<
" Found HS vertex at index: "<< iVertex);
257 return vertices->
at(iVertex);
260 ATH_MSG_VERBOSE(
"There is no vertex of type PriVx. Taking default vertex.");
261 return vertices->
at(0);
virtual double pt() const override final
The transverse momentum ( ) of the particle.
StatusCode accept(const xAOD::Muon *mu)
float vz() const
The z origin for the parameters.
float z0() const
Returns the parameter.
Helper class to provide constant type-safe access to aux data.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
Class providing the definition of the 4-vector interface.
@ IS_SIMULATION
true: simulation, false: data
bool isValid() const
Test to see if the link can be dereferenced.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
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.
virtual double eta() const
The pseudorapidity ( ) of the particle.
ElementLink implementation for ROOT usage.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
const IParticle * rawConstituent(size_t i) const
Direct access to constituents. WARNING expert use only.
bool isStable(const T &p)
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class describing a TrackParticle.
const T * at(size_type n) const
Access an element, as an rvalue.
Helper class to provide constant type-safe access to aux data.
size_t numConstituents() const
Number of constituents in this jets (this is valid even when reading a file where the constituents ha...
virtual double pt() const
The transverse momentum ( ) of the particle.
float theta() const
Returns the parameter, which has range 0 to .
size_type size() const noexcept
Returns the number of elements in the collection.