|
ATLAS Offline Software
|
#include <JetClusterer.h>
|
| JetClusterer (const std::string &name) |
|
StatusCode | initialize () override |
| Dummy implementation of the initialisation function. More...
|
|
std::pair< std::unique_ptr< xAOD::JetContainer >, std::unique_ptr< SG::IAuxStore > > | getJets () const override |
| Return the final jets with their aux store. More...
|
|
virtual void | print () const |
| Print the state of the tool. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
StatusCode | getAndRecordJets (SG::WriteHandle< xAOD::JetContainer > &jetHandle) const |
| Method to allow the client to pass in a WriteHandle for the container and aux container to be recorded, while the client remains free to modify the output but does not need to know the type of the aux container. More...
|
|
virtual StatusCode | initWithOutput (const SG::WriteHandleKey< xAOD::JetContainer > &) |
| Method to allow the client to pass in a WriteHandle during initialisation, in case this is needed for anything... More...
|
|
|
SG::ReadHandleKey< xAOD::EventInfo > | m_eventinfokey {"EventInfo"} |
| Handle to EventInfo. This is used to get the evt&run number to set the Ghost area random seeds. More...
|
|
SG::ReadHandleKey< PseudoJetContainer > | m_inputPseudoJets {this, "InputPseudoJets", "inputpseudojet", "input constituents"} |
| Handle Input PseudoJetContainer. More...
|
|
SG::WriteHandleKey< PseudoJetVector > | m_finalPseudoJets {this, "FinalPseudoJets_DONOTSET", "", "output pseudojets -- autoconfigured name"} |
| used to build the key under which the final PJ will be stored in evtStore() More...
|
|
SG::WriteHandleKey< jet::ClusterSequence > | m_clusterSequence {this, "ClusterSequence_DONOTSET", "", "output pseudojets -- autoconfigured name"} |
|
Gaudi::Property< std::string > | m_jetRank {this, "jetRankName", "jetRank", "name for accessor for jet rank"} |
|
Gaudi::Property< std::string > | m_jetalg {this, "JetAlgorithm", "AntiKt", "alg type : AntiKt, Kt, CA..."} |
|
Gaudi::Property< float > | m_jetrad {this, "JetRadius", 0.4 , "jet size parameter"} |
|
Gaudi::Property< float > | m_ptmin {this, "PtMin", 0.0, "pT min in MeV"} |
|
Gaudi::Property< float > | m_ghostarea {this, "GhostArea", 0.0, "Area for ghosts. 0==>no ghosts."} |
|
Gaudi::Property< int > | m_ranopt {this, "RandomOption", 1, "Rand option: 0=fj default, 1=run/event"} |
|
Gaudi::Property< int > | m_inputType {this, "JetInputType", 0, "input type as in xAOD::JetInput (see xAODJet/JetContainerInfo.h)"} |
|
fastjet::JetAlgorithm | m_fjalg |
|
bool | m_useArea |
|
Gaudi::Property< float > | m_minrad {this, "VariableRMinRadius", -1.0, "Variable-R min radius" } |
|
Gaudi::Property< float > | m_massscale {this, "VariableRMassScale", -1.0, "Variable-R mass scale" } |
|
bool | m_isVariableR |
|
SG::AuxElement::Accessor< int > | m_jetRankAccessor |
|
Definition at line 43 of file JetClusterer.h.
◆ StoreGateSvc_t
◆ JetClusterer()
JetClusterer::JetClusterer |
( |
const std::string & |
name | ) |
|
|
inline |
◆ buildAreaDefinition()
fastjet::AreaDefinition JetClusterer::buildAreaDefinition |
( |
bool & |
seedsok | ) |
const |
|
protected |
Build the area definition when running with area calculation. The seedsok flag is set to false when error occurs when retrieving event/run number to initiate the seeds.
Definition at line 271 of file JetClusterer.cxx.
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);
◆ buildClusterSequence()
std::unique_ptr< fastjet::ClusterSequence > JetClusterer::buildClusterSequence |
( |
const PseudoJetVector * |
pseudoJetvector | ) |
const |
|
protected |
Used to create the cluster sequence.
Definition at line 91 of file JetClusterer.cxx.
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);
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ getAndRecordJets()
Method to allow the client to pass in a WriteHandle for the container and aux container to be recorded, while the client remains free to modify the output but does not need to know the type of the aux container.
Every class derived from IJetProvider needs to implement the record, providing the explicit type – we should give StoreGate maximal information rather than recording AuxContainerBase
The recommended solution is for the concrete tool to inherit from the templated JetProvider class provided below.
Implements IJetProvider.
Definition at line 81 of file IJetProvider.h.
82 std::unique_ptr<xAOD::JetContainer>
jets(
nullptr);
83 std::unique_ptr<SG::IAuxStore> auxCont(
nullptr);
85 if(
jets.get()==
nullptr || auxCont.get()==
nullptr) {
return StatusCode::FAILURE;}
88 std::unique_ptr<CONCRETEAUX> auxCont_derived(
static_cast<CONCRETEAUX*
>(auxCont.release()));
91 return jetHandle.
record(std::move(
jets), std::move(auxCont_derived));
◆ getJets()
Return the final jets with their aux store.
Can return a pair of null pointers if an error occurs.
Implements IJetProvider.
Reimplemented in JetClustererByVertex.
Definition at line 192 of file JetClusterer.cxx.
195 auto nullreturn = std::make_pair(std::unique_ptr<xAOD::JetContainer>(
nullptr), std::unique_ptr<SG::IAuxStore>(
nullptr));
200 if (!pjContHandle.isValid())
208 auto jets = std::make_unique<xAOD::JetContainer>();
209 auto auxCont = std::make_unique<xAOD::JetAuxContainer>();
210 jets->setStore(auxCont.get());
212 const PseudoJetVector *pseudoJetVector = pjContHandle->casVectorPseudoJet();
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));
◆ getKey()
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the SG::sgkey_t
key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getName
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The hashed key of the object in the store. If not found, an invalid (zero) key.
Definition at line 119 of file AsgTool.cxx.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getName()
const std::string & asg::AsgTool::getName |
( |
const void * |
ptr | ) |
const |
|
inherited |
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the std::string
name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getKey
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The string name of the object in the store. If not found, an empty string.
Definition at line 106 of file AsgTool.cxx.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ initialize()
StatusCode JetClusterer::initialize |
( |
| ) |
|
|
overridevirtual |
Dummy implementation of the initialisation function.
It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...
Reimplemented from asg::AsgTool.
Reimplemented in JetClustererByVertex.
Definition at line 44 of file JetClusterer.cxx.
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;
◆ initWithOutput()
Method to allow the client to pass in a WriteHandle during initialisation, in case this is needed for anything...
The main (only?) use case is for copying jets, and propagating any decorations already on the original to the copy in StoreGate
Quietly return success in the general case – the JetRecAlg will always call this, so as to remain agnostic as to the concrete type.
Reimplemented in JetCopier.
Definition at line 65 of file IJetProvider.h.
65 {
return StatusCode::SUCCESS;};
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ isVariableR()
bool JetClusterer::isVariableR |
( |
| ) |
const |
|
inlineprotected |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msg_level_name()
const std::string & asg::AsgTool::msg_level_name |
( |
| ) |
const |
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
MSG::name( msg().level() )
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
- Returns
- The string name of the current minimum message level that's printed
Definition at line 101 of file AsgTool.cxx.
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ print()
void asg::AsgTool::print |
( |
| ) |
const |
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ processPseudoJet()
translate to xAOD::Jet
Definition at line 151 of file JetClusterer.cxx.
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);
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_clusterSequence
◆ m_detStore
◆ m_eventinfokey
Handle to EventInfo. This is used to get the evt&run number to set the Ghost area random seeds.
Definition at line 84 of file JetClusterer.h.
◆ m_evtStore
◆ m_finalPseudoJets
◆ m_fjalg
fastjet::JetAlgorithm JetClusterer::m_fjalg |
|
protected |
◆ m_ghostarea
Gaudi::Property<float> JetClusterer::m_ghostarea {this, "GhostArea", 0.0, "Area for ghosts. 0==>no ghosts."} |
|
protected |
◆ m_inputPseudoJets
◆ m_inputType
Gaudi::Property<int> JetClusterer::m_inputType {this, "JetInputType", 0, "input type as in xAOD::JetInput (see xAODJet/JetContainerInfo.h)"} |
|
protected |
◆ m_isVariableR
bool JetClusterer::m_isVariableR |
|
protected |
◆ m_jetalg
Gaudi::Property<std::string> JetClusterer::m_jetalg {this, "JetAlgorithm", "AntiKt", "alg type : AntiKt, Kt, CA..."} |
|
protected |
◆ m_jetrad
Gaudi::Property<float> JetClusterer::m_jetrad {this, "JetRadius", 0.4 , "jet size parameter"} |
|
protected |
◆ m_jetRank
Gaudi::Property<std::string> JetClusterer::m_jetRank {this, "jetRankName", "jetRank", "name for accessor for jet rank"} |
|
protected |
◆ m_jetRankAccessor
◆ m_massscale
Gaudi::Property<float> JetClusterer::m_massscale {this, "VariableRMassScale", -1.0, "Variable-R mass scale" } |
|
protected |
◆ m_minrad
Gaudi::Property<float> JetClusterer::m_minrad {this, "VariableRMinRadius", -1.0, "Variable-R min radius" } |
|
protected |
◆ m_ptmin
Gaudi::Property<float> JetClusterer::m_ptmin {this, "PtMin", 0.0, "pT min in MeV"} |
|
protected |
◆ m_ranopt
Gaudi::Property<int> JetClusterer::m_ranopt {this, "RandomOption", 1, "Rand option: 0=fj default, 1=run/event"} |
|
protected |
◆ m_useArea
bool JetClusterer::m_useArea |
|
protected |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
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
Helper class to provide type-safe access to aux data.
Gaudi::Property< float > m_ghostarea
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Gaudi::Property< int > m_inputType
Gaudi::Property< int > m_ranopt
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
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.
virtual void setOwner(IDataHandleHolder *o)=0
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
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
SG::ReadHandleKey< PseudoJetContainer > m_inputPseudoJets
Handle Input PseudoJetContainer.
fastjet::JetAlgorithm fastJetDef(ID id)
Gaudi::Property< float > m_minrad
fastjet::ClusterSequence ClusterSequence
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.
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
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 void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
SG::AuxElement::Accessor< int > m_jetRankAccessor
virtual std::pair< std::unique_ptr< xAOD::JetContainer >, std::unique_ptr< SG::IAuxStore > > getJets() const =0
Method to build the collection and return it to the caller.
std::vector< fastjet::PseudoJet > PseudoJetVector
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()
ID algId(const std::string &n)
Converts a string into a JetAlgorithmType::ID.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Property< float > m_ptmin
Gaudi::Property< std::string > m_jetRank
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void processPseudoJet(const fastjet::PseudoJet &pj, const PseudoJetContainer &pjCont, xAOD::JetContainer *jets, const xAOD::Vertex *vertex) const
translate to xAOD::Jet