|
ATLAS Offline Software
|
#include <JetRecTool.h>
|
| JetRecTool (const std::string &myname) |
|
StatusCode | initialize () override |
| Initialization. Check all tools here. More...
|
|
virtual const xAOD::JetContainer * | build () const override |
| Retrieve inputs with tools and construct new jet collection. More...
|
|
int | execute () const override |
| Call build and put jets in event store. More...
|
|
void | print () const override |
| Display the configuration. More...
|
|
int | inputContainerNames (std::vector< std::string > &connames) override |
| Method to return the list of input containers. More...
|
|
int | outputContainerNames (std::vector< std::string > &connames) override |
| Method to return the list of output containers. More...
|
|
void | setInputJetContainer (const xAOD::JetContainer *cont) |
| For trigger usage in grooming mode only : give the input ungroomed jet container. 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 |
|
|
SG::WriteHandleKey< xAOD::JetContainer > | m_outcoll {this, "OutputContainer", ""} |
|
SG::ReadHandleKey< xAOD::JetContainer > | m_incoll {this, "InputContainer", ""} |
|
SG::ReadHandleKeyArray< PseudoJetContainer > | m_psjsin {this, "InputPseudoJets", {}} |
|
ToolHandle< IJetExecuteTool > | m_intool |
|
ToolHandle< IJetPseudojetRetriever > | m_hpjr |
|
ToolHandle< IJetFinder > | m_finder |
|
ToolHandle< IJetGroomer > | m_groomer |
|
ToolHandleArray< IJetModifier > | m_modifiers {this, "JetModifiers", {}} |
|
ToolHandleArray< IJetConsumer > | m_consumers {this, "JetConsumers", {}} |
|
bool | m_trigger {} |
|
int | m_initCount {} |
|
bool | m_find {} |
|
bool | m_groom {} |
|
bool | m_copy {} |
|
xAOD::JetInput::Type | m_inputtype |
|
IJetFinder::NameList | m_ghostlabs |
|
std::vector< std::string > | m_incolls |
|
std::vector< std::string > | m_outcolls |
|
const IJetPseudojetRetriever * | m_ppjr {} |
|
const xAOD::JetContainer * | m_trigInputJetsForGrooming {} |
|
ToolHandle< GenericMonitoringTool > | m_monTool {this,"MonTool","","Monitoring tool"} |
|
const double | m_mevtogev = 0.001 |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
- Author
- David Adams.
- Date
- January 2014
This is the top-level tool for jet reconstruction. It creates a new jet collection from finding, grooming or copy. There is a one-to-one correpondence between jet collections and JetRecTool instances.
Properties are as follows: OutputContainer: Name of the output jet collection InputCollection: Name of the input jet collection. Required for grooming or copy. If InputTool is defined, the collection name is taked from the output collection name of that tool. The configured value of this property should be identical to that or blank. InputPseudoJets: Array of ReadHandleKeys for the pseudojet collections to be retrieved and passed to JetFinder. These collections are merged and used as input for jet finding. InputTool: Handle for the JetRecTool called to create the input collection if it is not already found in the event store. JetPseudojetRetriever: Tool used to retrieve the pseudojet cluster sequence associated with a jet. If undefined, one is created. JetFinder: Handle for the tool used to find jets. JetGroomer: Handle for the tool used to groom jets. JetModifiers: Array of handles of tools used to modify the jet collection, e.g. to add moments sort or filter. JetConsumers: Tools consuming jets to run after building jets
This tool may be used to build jets in any one of three ways:
- To find jets, the JetFinder and PseudoJetGetters must be defined. InputCollection, InputTool and JetGroomer should not be defined.
- To groom jets, the JetGroomer and InputCollection or InputTool must be defined. The JetFinder should not be defined.
- To copy jets, the InputCollection or InputTool must be defined. The tool may also be used to call a sequence of pseudojet builders without building any jets. In this case, none of OutputCollection, InputCollection, InputTool, JetFinder or jetGroomer should be defined and the array of jet modifiers should be empty.
Definition at line 68 of file JetRecTool.h.
◆ StoreGateSvc_t
◆ JetRecTool()
JetRecTool::JetRecTool |
( |
const std::string & |
myname | ) |
|
◆ build()
const JetContainer * JetRecTool::build |
( |
| ) |
const |
|
overridevirtual |
Retrieve inputs with tools and construct new jet collection.
Implements IJetBuildTool.
Definition at line 217 of file JetRecTool.cxx.
230 #ifndef GENERATIONBASE
232 ATH_MSG_DEBUG(
"Check Aux store: " << pjets.get() <<
" ... " << &pjets->
auxbase() <<
" ... " << pjetsaux.get() );
233 if ( pjetsaux.get() ==
nullptr ) {
238 if(jetsHandle.record(std::move(pjets), std::move(pjetsaux)).isFailure()){
246 std::unique_ptr<xAOD::JetAuxContainer> pjetsaux(
dynamic_cast<xAOD::JetAuxContainer*
>( pjets->getStore() ));
247 ATH_MSG_DEBUG(
"Check Aux store: " << pjets.get() <<
" ... " << &pjets->
auxbase() <<
" ... " << pjetsaux.get() );
248 if ( pjetsaux.get() ==
nullptr ) {
253 if(jetsHandle.record(std::move(pjets), std::move(pjetsaux)).isFailure()){
263 if ( !jetsHandle.isValid() ) {
267 for ( ModifierArray::const_iterator imod=
m_modifiers.begin();
271 if((*imod)->modify(*jetsHandle).isFailure())
280 if ( !jetsHandle.isValid() ) {
284 for ( ConsumerArray::const_iterator icon=
m_consumers.begin();
288 (*icon)->process(*jetsHandle) ;
294 #if !defined (GENERATIONBASE) && !defined (XAOD_ANALYSIS)
303 njets = jetsHandle->size();
306 return jetsHandle.isValid() ? &(*jetsHandle) :
nullptr;
◆ collectPseudoJets()
Definition at line 401 of file JetRecTool.cxx.
404 auto allPseudoJets = std::make_unique<PseudoJetContainer>();
408 for (
const auto& pjcontkey :
m_psjsin) {
410 ATH_MSG_DEBUG(
"Adding PseudoJetContainers for: " << h_newpsjs.key());
411 if(! h_newpsjs.isValid()) {
413 << h_newpsjs.key() <<
" failed");
416 allPseudoJets->append(h_newpsjs.get());
419 return allPseudoJets;
◆ copyJets()
Definition at line 523 of file JetRecTool.cxx.
531 if(jetsIn ==
nullptr){
539 for (
const Jet* poldjet : *jetsIn) {
541 jets->push_back(pnewjet);
◆ 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]
◆ execute()
int JetRecTool::execute |
( |
| ) |
const |
|
overridevirtual |
◆ 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
◆ fillOutputContainer()
◆ findJets()
◆ 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
◆ getOldJets()
Definition at line 433 of file JetRecTool.cxx.
437 if ( !
m_incoll.key().empty() && handle_in.isValid()) {
438 pjetsin = handle_in.cptr();
440 if ( pjetsin ==
nullptr && !
m_intool.empty() ) {
447 if ( pjetsin ==
nullptr ) {
451 <<
" jet multiplicity is "<< pjetsin->size());
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ groomJets()
Definition at line 496 of file JetRecTool.cxx.
504 if(jetsIn ==
nullptr){
514 for (
const auto *
const ijet : *jetsIn){
m_groomer->groom(*ijet,
◆ initialize()
StatusCode JetRecTool::initialize |
( |
| ) |
|
|
overridevirtual |
Initialization. Check all tools here.
Reimplemented from asg::AsgTool.
Definition at line 66 of file JetRecTool.cxx.
72 string mode =
"pseudojets";
81 return StatusCode::FAILURE;
106 if (
m_hpjr.retrieve().isSuccess() ) {
112 #ifdef XAOD_STANDALONE
124 return StatusCode::FAILURE;
127 if ( pasgtool !=
nullptr ) {
128 const string* pval = pasgtool->
getProperty<std::string>(
"OutputContainer");
129 if ( pval !=
nullptr ) {
134 ATH_MSG_ERROR(
"Input tool does not have output collection name.");
135 return StatusCode::FAILURE;
148 return StatusCode::FAILURE;
158 return StatusCode::FAILURE;
166 return StatusCode::FAILURE;
173 <<
" pseudojet inputs.");
174 for (
size_t ilab(0); ilab<
m_psjsin.size(); ++ilab ) {
175 const std::string& pjcontname =
m_psjsin[ilab].key();
176 if(pjcontname.size()<9) {
177 ATH_MSG_ERROR(
"Invalid pseudojet container name " << pjcontname);
178 ATH_MSG_ERROR(
"This must be of the form \"PseudoJet\"+label");
179 return StatusCode::FAILURE;
181 std::string
label = pjcontname.substr(9);
195 <<
" jet modifiers.");
200 <<
" jet consumers.");
208 #if !defined (GENERATIONBASE) && !defined (XAOD_ANALYSIS)
◆ inputContainerNames()
int JetRecTool::inputContainerNames |
( |
std::vector< std::string > & |
connames | ) |
|
|
overridevirtual |
Method to return the list of input containers.
The names of required input containers are appended to connames. Returns nonzero for error. Default returns 0 and adds no names.
Reimplemented from IJetExecuteTool.
Definition at line 373 of file JetRecTool.cxx.
375 ATH_MSG_WARNING(
"Input container list requested before initialization.");
◆ 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.
◆ makeOutputContainer()
Definition at line 458 of file JetRecTool.cxx.
461 auto pjets = std::make_unique<xAOD::JetContainer>();
466 #ifndef GENERATIONBASE
◆ 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()
◆ outputContainerNames()
int JetRecTool::outputContainerNames |
( |
std::vector< std::string > & |
connames | ) |
|
|
overridevirtual |
Method to return the list of output containers.
The names of produced output containers are appended to connames. Returns nonzero for error. Default returns 0 and adds no names.
Reimplemented from IJetExecuteTool.
Definition at line 384 of file JetRecTool.cxx.
386 ATH_MSG_WARNING(
"Output container list requested before initialization.");
◆ 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 JetRecTool::print |
( |
| ) |
const |
|
overridevirtual |
Display the configuration.
Reimplemented from asg::AsgTool.
Definition at line 326 of file JetRecTool.cxx.
339 for (
const auto& pjcontkey :
m_psjsin ) {
360 for ( ModifierArray::const_iterator imod=
m_modifiers.begin();
364 ToolHandle<IJetModifier> hmod = *imod;
◆ renounce()
◆ renounceArray()
◆ setInputJetContainer()
For trigger usage in grooming mode only : give the input ungroomed jet container.
Definition at line 395 of file JetRecTool.cxx.
◆ 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_consumers
ToolHandleArray<IJetConsumer> JetRecTool::m_consumers {this, "JetConsumers", {}} |
|
private |
◆ m_copy
bool JetRecTool::m_copy {} |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_find
bool JetRecTool::m_find {} |
|
private |
◆ m_finder
◆ m_ghostlabs
◆ m_groom
bool JetRecTool::m_groom {} |
|
private |
◆ m_groomer
◆ m_hpjr
◆ m_incoll
◆ m_incolls
std::vector<std::string> JetRecTool::m_incolls |
|
private |
◆ m_initCount
int JetRecTool::m_initCount {} |
|
private |
◆ m_inputtype
◆ m_intool
◆ m_mevtogev
const double JetRecTool::m_mevtogev = 0.001 |
|
private |
◆ m_modifiers
ToolHandleArray<IJetModifier> JetRecTool::m_modifiers {this, "JetModifiers", {}} |
|
private |
◆ m_monTool
◆ m_outcoll
◆ m_outcolls
std::vector<std::string> JetRecTool::m_outcolls |
|
private |
◆ m_ppjr
◆ m_psjsin
◆ m_trigger
bool JetRecTool::m_trigger {} |
|
private |
◆ m_trigInputJetsForGrooming
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Extra patterns decribing particle interation process.
Group
Properties of a chain group.
Scalar phi() const
phi method
Basic data class defines behavior for all Jet objects The Jet class is the principal data class for...
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
#define ATH_MSG_VERBOSE(x)
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
const SG::AuxVectorBase & auxbase() const
Convert to AuxVectorBase.
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Temporary container used until we have I/O for AuxStoreInternal.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Temporary container used until we have I/O for AuxStoreInternal.
::StatusCode StatusCode
StatusCode definition for legacy code.
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)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Declare a monitored scalar variable.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Jet_v1 Jet
Definition of the current "jet version".