![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
26 m_topo_hquark(nullptr),
27 m_exp_hquark_up(nullptr),
28 m_exp_hquark_down(nullptr),
29 m_exp_hgluon_up(nullptr),
30 m_exp_hgluon_down(nullptr),
31 m_me_hquark_up(nullptr),
32 m_me_hquark_down(nullptr),
33 m_me_hgluon_up(nullptr),
34 m_me_hgluon_down(nullptr),
35 m_pdf_hquark_up(nullptr),
36 m_pdf_hquark_down(nullptr),
37 m_pdf_hgluon_up(nullptr),
38 m_pdf_hgluon_down(nullptr),
39 m_trackeff_hquark(nullptr),
40 m_trackeff_hgluon(nullptr),
41 m_fake_hquark(nullptr),
42 m_fake_hgluon(nullptr),
43 m_trkSelectionTool(
name+
"_trackselectiontool", this),
44 m_trkTruthFilterTool(
name+
"_trackfiltertool",this),
45 m_trkFakeTool(
name+
"_trackfaketool",this),
46 m_jetTrackFilterTool(
name+
"_jettrackfiltertool",this),
47 m_originTool(
name+
"_origintool",this)
96 ATH_MSG_WARNING(
"No config file provided AND no NTrackCut specified." ) ;
101 ATH_MSG_ERROR(
"Cuttype invalid. Must use 'linear_pt', 'log_pt', or 'threshold'");
102 return StatusCode::FAILURE;
108 ATH_MSG_INFO(
"Decorators that will be attached to jet :" );
181 return StatusCode::FAILURE;
210 m_acceptInfo.
addCut(
"QuarkJetTag",
"True if the jet is deemed a quark jet because NTrack<NCut, False if jet deemed gluon jet because NTrack<NCut" );
218 return StatusCode::SUCCESS;
248 double jetWeight = -1;
267 decTagged(
jet) =
false;
268 return StatusCode::SUCCESS;
273 if (
pv )
ATH_MSG_DEBUG(
"Obtaining JetQGTagger decision with user specific primary vertex" );
274 else ATH_MSG_DEBUG(
"Obtaining JetQGTagger decision default" );
280 ATH_MSG_WARNING(
"Unable to retrieve primary vertex container PrimaryVertices");
284 else if ( vxCont->
empty() ) {
290 for (
const auto *vx : *vxCont ) {
308 if ( !
isValid )
return StatusCode::SUCCESS;
323 else if ( readNumTrkPt500PV.
isAvailable() ) jetNTrack = readNumTrkPt500PV(
jet);
325 ATH_MSG_ERROR(
"Neither NumTrkPt500PV nor DFCommonJets_QGTagger_NTracks is available for your jet. Please add it before running in mode 1 of the JetQGTagger.");
326 return StatusCode::FAILURE;
331 decWeight(
jet) = jetWeight;
334 decValidEventContent(
jet) = acceptData.
getCutResult(
"ValidEventContent" );
340 decTag(
jet) = jetNTrack;
341 decWeight(
jet) = jetWeight;
346 double variable_nTrk = -999.0;
349 if(jetNTrack<variable_nTrk) acceptData.
setCutResult(
"QuarkJetTag",
true);
353 if(jetNTrack<variable_nTrk) acceptData.
setCutResult(
"QuarkJetTag",
true);
359 return StatusCode::SUCCESS;
384 return StatusCode::SUCCESS;
392 int pdgid =
jet->getAttribute<
int>(
"PartonTruthLabelID");
394 int tntrk =
jet->getAttribute<
int>(
"DFCommonJets_QGTagger_truthjet_nCharged");
395 float tjetpt =
jet->getAttribute<
float>(
"DFCommonJets_QGTagger_truthjet_pt")*0.001;
396 float tjeteta =
jet->getAttribute<
float>(
"DFCommonJets_QGTagger_truthjet_eta");
397 ATH_MSG_DEBUG(
"truth jet pdgid: " << pdgid <<
" pt: " << tjetpt);
400 return StatusCode::SUCCESS;
406 ATH_MSG_DEBUG(
"Outside of fiducial region: setting weight to 1" );
407 return StatusCode::SUCCESS;
411 ptbin = std::as_const(*m_hgluon).GetXaxis()->FindFixBin(tjetpt);
412 ntrkbin = std::as_const(*m_hgluon).GetYaxis()->FindFixBin(tntrk);
416 ptbin = std::as_const(*m_hquark).GetXaxis()->FindFixBin(tjetpt);
417 ntrkbin = std::as_const(*m_hquark).GetYaxis()->FindFixBin(tntrk);
421 ATH_MSG_INFO(
"Neither quark nor gluon jet: setting weight to 1" );
432 else if ( readNumTrkPt500PV.
isAvailable() ) ntrk = readNumTrkPt500PV(*
jet);
433 else ATH_MSG_ERROR(
"Neither NumTrkPt500PV nor DFCommonJets_QGTagger_NTracks is available for your jet. Please add it before running mode 1 JetQGTagger.");
435 float rjetpt =
jet->pt()*1
e-3;
436 float rjeteta =
jet->eta();
438 ATH_MSG_DEBUG(
"reco jet Pt: " << rjetpt <<
" eta: " << rjeteta);
440 ATH_MSG_DEBUG(
"Outside of fiducial region: setting weight to 1");
441 return StatusCode::SUCCESS;
445 ptbin = std::as_const(*m_hquark).GetXaxis()->FindFixBin(rjetpt);
446 ntrkbin = std::as_const(*m_hquark).GetYaxis()->FindFixBin(ntrk);
450 ptbin = std::as_const(*m_hgluon).GetXaxis()->FindFixBin(rjetpt);
451 ntrkbin = std::as_const(*m_hgluon).GetYaxis()->FindFixBin(ntrk);
458 return StatusCode::SUCCESS;
468 std::vector<const xAOD::IParticle*> jettracks;
471 ATH_MSG_ERROR(
"This jet has no associated objects, so it will not be tagged. Please check the jet collection you are using.");
476 return StatusCode::FAILURE;
479 for (
size_t i = 0;
i < jettracks.size();
i++) {
484 ATH_MSG_ERROR(
"This jet has null tracks, so it will not be tagged. Please check the jet collection you are using.");
489 return StatusCode::FAILURE;
495 bool acceptSyst =
true;
520 return StatusCode::SUCCESS;
542 return StatusCode::SUCCESS;
544 int pdgid =
jet->getAttribute<
int>(
"PartonTruthLabelID");
547 return StatusCode::SUCCESS;
554 GhostTruthAssociationLinkAcc(
"GhostTruthAssociationLink");
556 ATH_MSG_DEBUG(
"Accessing GhostTruthAssociationLink: is available");
559 ATH_MSG_DEBUG(
"Accessing GhostTruthAssociationLink: is valid");
564 return StatusCode::SUCCESS;
569 return StatusCode::SUCCESS;
574 return StatusCode::SUCCESS;
579 double tjetpt = tjet->
pt()*0.001;
580 double tjeteta = tjet->
eta();
582 ATH_MSG_DEBUG(
"Outside of fiducial region: setting weight to 1");
583 return StatusCode::SUCCESS;
598 if( ! (
part->pt()>500.) )
continue;
600 if( !(
part->isCharged()) )
continue;
604 if(
pt>500 ) tntrk++;
610 int ptbin = std::as_const(*m_hgluon).GetXaxis()->FindFixBin(tjetpt);
611 int ntrkbin = std::as_const(*m_hgluon).GetYaxis()->FindFixBin(tntrk);
615 int ptbin = std::as_const(*m_hquark).GetXaxis()->FindFixBin(tjetpt);
616 int ntrkbin = std::as_const(*m_hquark).GetYaxis()->FindFixBin(tntrk);
620 ATH_MSG_DEBUG(
"Neither quark nor gluon jet: setting weight to 1");
623 return StatusCode::SUCCESS;
634 if (systSet.
empty()) {
636 return StatusCode::SUCCESS;
638 else if (systSet.
size()>1) {
639 ATH_MSG_WARNING(
"Tool does not support multiple systematics, returning unsupported" );
640 return StatusCode::FAILURE;
645 else if (systVar == QGntrackSyst::nchargedtopo){
649 else if (systVar == QGntrackSyst::trackefficiency)
651 else if (systVar == QGntrackSyst::trackfakes)
653 else if (systVar == QGntrackSyst::nchargedexp_up){
658 else if (systVar == QGntrackSyst::nchargedme_up){
663 else if (systVar == QGntrackSyst::nchargedpdf_up){
668 else if (systVar == QGntrackSyst::nchargedexp_down){
673 else if (systVar == QGntrackSyst::nchargedme_down){
678 else if (systVar == QGntrackSyst::nchargedpdf_down){
683 else if (systVar == QGntrackSyst::trackeff){
688 else if (systVar == QGntrackSyst::fake){
696 return StatusCode::FAILURE;
700 return StatusCode::SUCCESS;
709 return StatusCode::FAILURE;
716 hist->SetDirectory(
nullptr);
717 return StatusCode::SUCCESS;
virtual StatusCode applySystematicVariation(const SystematicSet &set) override
effects: configure this tool for the given list of systematic variations.
def retrieve(aClass, aKey=None)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
double GetBinContent(int) const
std::string m_trackefffile
StatusCode resetCuts(asg::AcceptData &acceptData) const
Reset cuts.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decTagKey
WriteDecorHandle keys.
size_t size() const
returns: size of the set
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::string m_configFile
Configuration file name.
TEnv m_configReader
TEnv instance to read config files.
virtual StatusCode sysApplySystematicVariation(const SystematicSet &) override
effects: configure this tool for the given list of systematic variations.
bool empty() const
returns: whether the set is empty
StatusCode accept(const xAOD::Muon *mu)
Class to wrap a set of SystematicVariations.
std::string m_tagger_decoration_name
SG::WriteDecorHandleKey< xAOD::JetContainer > m_qgDecWeightKey
StatusCode simplegetNTrackWeight(const xAOD::Jet *jet, double &weight) const
float m_jetPtMin
Kinematic bounds for the jet - the units are controlled by m_ptGeV.
Helper class to provide constant type-safe access to aux data.
#define ATH_MSG_VERBOSE(x)
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.
bool isValid() const
Test to see if the link can be dereferenced.
StatusCode loadHist(TH2D *&hist, const std::string &filename, const std::string &histname)
std::string m_calibArea
Location where config files live on cvmfs.
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readNtrkKey
QGSystApplied m_appliedSystEnum
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Handle class for reading a decoration on an object.
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...
asg::AnaToolHandle< InDet::IInDetTrackTruthFilterTool > m_trkFakeTool
static const std::unordered_map< InDet::TrackSystematic, CP::SystematicVariation, std::hash< int > > TrackSystematicMap
StatusCode getNTrack(const xAOD::Jet *jet, int &ntracks) const
@ TRK_EFF_LOOSE_PHYSMODEL
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
StatusCode checkKinRange(const xAOD::Jet &jet, asg::AcceptData &acceptData) const
Check and record if jet passes kinematic constraints.
Handle class for adding a decoration to an object.
asg::AnaToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelectionTool
asg::AnaToolHandle< InDet::IInDetTrackTruthFilterTool > m_trkTruthFilterTool
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decValidEventContentKey
virtual double eta() const
The pseudorapidity ( ) of the particle.
ElementLink implementation for ROOT usage.
std::string m_weight_decoration_name
virtual StatusCode initialize() override
Initialize the tool.
asg::AcceptInfo m_acceptInfo
Object that stores the results for a jet.
asg::AnaToolHandle< InDet::IInDetTrackTruthOriginTool > m_originTool
virtual StatusCode tag(const xAOD::Jet &jet, const xAOD::Vertex *pv) const override
const IParticle * rawConstituent(size_t i) const
Direct access to constituents. WARNING expert use only.
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readNumTrkPt500PVKey
ReadDecorHandle keys.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
void printCuts() const
Print configured cuts.
virtual StatusCode initialize() override
Initialize the tool.
bool isStable(const T &p)
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
Class describing a Vertex.
bool passKinRange(const xAOD::Jet &jet) const
Check if jet passes kinematic constraints.
bool getCutResult(const std::string &cutName) const
Get the result of a cut, based on the cut name (safer)
#define ATH_MSG_WARNING(x)
const_iterator begin() const
description: const iterator to the beginning of the set
StatusCode getConfigReader()
Get configReader StatusCode.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class describing a TrackParticle.
Helper class to provide constant type-safe access to aux data.
StatusCode getNTrackWeight(const xAOD::Jet *jet, double &weight) const
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.
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
bool empty() const noexcept
Returns true if the collection is empty.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decTaggedKey
WriteDecorHandle keys for tagging bools.
int addCut(const std::string &cutName, const std::string &cutDescription)
Add a cut; returning the cut position.
std::string m_containerName
Configurable members.
asg::AnaToolHandle< InDet::IJetTrackFilterTool > m_jetTrackFilterTool