|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "fastjet/PseudoJet.hh"
9 #include "fastjet/ClusterSequence.hh"
10 #include "fastjet/ClusterSequenceArea.hh"
11 #include "fastjet/config.h"
12 #include "fastjet/contrib/VariableRPlugin.hh"
39 seeds.push_back(ievt);
40 seeds.push_back(irun);
54 return StatusCode::FAILURE;
59 return StatusCode::FAILURE;
74 ATH_MSG_WARNING(
"A non-empty value was found for the FinalPseudoJets WriteHandleKey -- this will be ignored!");
86 return StatusCode::SUCCESS;
95 using fastjet::contrib::VariableRPlugin;
96 std::unique_ptr<VariableRPlugin> VRJetPlugin(
nullptr);
104 VariableRPlugin::ClusterType VRClusterType = VariableRPlugin::AKTLIKE;
108 VRClusterType = VariableRPlugin::KTLIKE;
111 VRClusterType = VariableRPlugin::AKTLIKE;
114 VRClusterType = VariableRPlugin::CALIKE;
117 ATH_MSG_ERROR(
"Unsupported clustering algorithm for Variable-R jet finding.");
121 jetdef = fastjet::JetDefinition(VRJetPlugin.get());
124 std::unique_ptr<fastjet::ClusterSequence> clSequence(
nullptr);
135 clSequence = std::make_unique<fastjet::ClusterSequenceArea>(*pseudoJetVector, jetdef, adef);
145 clSequence = std::make_unique<fastjet::ClusterSequence>(*pseudoJetVector, jetdef);
164 pjAccessor(
jet) = &pj;
168 jet.setAlgorithmType(ialg);
178 ATH_MSG_VERBOSE(
" xAOD::Jet with pt " << std::setprecision(4) <<
jet.pt() * 1
e-3 <<
" has " <<
jet.getConstituents().size() <<
" constituents");
179 ATH_MSG_VERBOSE(
" Leading constituent is of type " <<
jet.getConstituents()[0].rawConstituent()->type());
184 jet.setAssociatedObject(
"OriginVertex", originVertex);
195 auto nullreturn = std::make_pair(std::unique_ptr<xAOD::JetContainer>(
nullptr), std::unique_ptr<SG::IAuxStore>(
nullptr));
208 auto jets = std::make_unique<xAOD::JetContainer>();
209 auto auxCont = std::make_unique<xAOD::JetAuxContainer>();
210 jets->setStore(auxCont.get());
213 ATH_MSG_DEBUG(
"Pseudojet input container has size " << pseudoJetVector->size());
224 auto pjVector = std::make_unique<PseudoJetVector>(fastjet::sorted_by_pt(clSequence->inclusive_jets(
m_ptmin)));
228 for (
const auto &pj : *pjVector)
230 msg() <<
" Pseudojet with pt " << std::setprecision(4) << pj.Et() * 1
e-3 <<
" has " << pj.constituents().size() <<
" constituents" <<
endmsg;
236 if (!pjVector->empty())
239 for (
const fastjet::PseudoJet &pj : *pjVector)
250 if (!pjVectorHandle.
record(std::move(pjVector)))
258 if (!clusterSeqHandle.
record(std::move(clSequence)))
265 ATH_MSG_DEBUG(
"Reconstructed jet count: " <<
jets->size() <<
" clusterseq=" << clSequence.get());
268 return std::make_pair(std::move(
jets), std::move(auxCont));
274 fastjet::GhostedAreaSpec gspec(5.0, 1,
m_ghostarea);
276 std::vector<int> seeds;
282 if (!evtInfoHandle.isValid())
294 ATH_MSG_DEBUG(
" Actual ghost area: " << gspec.actual_ghost_area());
300 if (seeds.size() == 2)
302 ATH_MSG_DEBUG(
" Random seeds: " << seeds[0] <<
", " << seeds[1]);
308 for (
auto seed : seeds)
314 return fastjet::AreaDefinition(fastjet::active_area,
316 .with_fixed_seed(seeds);
SG::ReadHandleKey< xAOD::EventInfo > m_eventinfokey
Handle to EventInfo. This is used to get the evt&run number to set the Ghost area random seeds.
Gaudi::Property< std::string > m_jetalg
uint64_t eventNumber() const
The current event's event number.
Helper class to provide type-safe access to aux data.
Gaudi::Property< float > m_ghostarea
Gaudi::Property< int > m_inputType
Gaudi::Property< int > m_ranopt
Gaudi::Property< float > m_jetrad
bool msgLvl(const MSG::Level lvl) const
SG::WriteHandleKey< jet::ClusterSequence > m_clusterSequence
Gaudi::Property< float > m_massscale
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
@ IS_SIMULATION
true: simulation, false: data
uint32_t runNumber() const
The current event's run number.
uint32_t mcChannelNumber() const
The MC generator's channel number.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
fastjet::AreaDefinition buildAreaDefinition(bool &seedsok) const
Build the area definition when running with area calculation. The seedsok flag is set to false when e...
fastjet::JetAlgorithm m_fjalg
StatusCode initialize() override
Dummy implementation of the initialisation function.
SG::ReadHandleKey< PseudoJetContainer > m_inputPseudoJets
Handle Input PseudoJetContainer.
fastjet::JetAlgorithm fastJetDef(ID id)
Gaudi::Property< float > m_minrad
fastjet::ClusterSequence ClusterSequence
::StatusCode StatusCode
StatusCode definition for legacy code.
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...
std::unique_ptr< fastjet::ClusterSequence > buildClusterSequence(const PseudoJetVector *pseudoJetvector) const
Used to create the cluster sequence.
xAOD::Jet & translate(const fastjet::PseudoJet &pj, const PseudoJetContainer &pjCont, xAOD::JetContainer &jetCont, const xAOD::Vertex *originVertex=nullptr) const
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...
@ undefined_jet_algorithm
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::AuxElement::Accessor< int > m_jetRankAccessor
Class describing the basic event information.
std::vector< fastjet::PseudoJet > PseudoJetVector
Class describing a Vertex.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
#define ATH_MSG_WARNING(x)
SG::WriteHandleKey< PseudoJetVector > m_finalPseudoJets
used to build the key under which the final PJ will be stored in evtStore()
std::pair< std::unique_ptr< xAOD::JetContainer >, std::unique_ptr< SG::IAuxStore > > getJets() const override
Return the final jets with their aux store.
ID algId(const std::string &n)
Converts a string into a JetAlgorithmType::ID.
Gaudi::Property< float > m_ptmin
const std::vector< PseudoJet > * casVectorPseudoJet() const
Gaudi::Property< std::string > m_jetRank
uint64_t mcEventNumber() const
The MC generator's event number.
bool eventType(EventType type) const
Check for one particular bitmask value.
void processPseudoJet(const fastjet::PseudoJet &pj, const PseudoJetContainer &pjCont, xAOD::JetContainer *jets, const xAOD::Vertex *vertex) const
translate to xAOD::Jet