26#if !defined (GENERATIONBASE) && !defined (XAOD_ANALYSIS)
36using std::setprecision;
48 m_hpjr(
"JetPseudojetRetriever/jpjr",this),
67 ATH_MSG_INFO(
"Initializing JetRecTool " << name() <<
".");
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;
170 StatusCode rstat = StatusCode::SUCCESS;
171 string prefix =
"--- ";
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);
185 ATH_MSG_INFO(prefix <<
"Extracting input type from primary label.");
195 <<
" jet modifiers.");
200 <<
" jet consumers.");
208#if !defined (GENERATIONBASE) && !defined (XAOD_ANALYSIS)
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()){
267 for ( ModifierArray::const_iterator imod=
m_modifiers.begin();
271 if((*imod)->modify(*jetsHandle).isFailure())
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;
317 if (
build() ==
nullptr ) {
339 for (
const auto& pjcontkey :
m_psjsin ) {
360 for ( ModifierArray::const_iterator imod=
m_modifiers.begin();
363 if (
msgLvl(MSG::DEBUG) ) {
364 ToolHandle<IJetModifier> hmod = *imod;
375 ATH_MSG_WARNING(
"Input container list requested before initialization.");
386 ATH_MSG_WARNING(
"Output container list requested before initialization.");
404 auto allPseudoJets = std::make_unique<PseudoJetContainer>();
408 for (
const auto& pjcontkey :
m_psjsin) {
413 << h_newpsjs.
key() <<
" failed");
416 allPseudoJets->append(h_newpsjs.
get());
419 return allPseudoJets;
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());
461 auto pjets = std::make_unique<xAOD::JetContainer>();
466#ifndef GENERATIONBASE
504 if(jetsIn ==
nullptr){
514 for (
const auto *
const ijet : *jetsIn){
m_groomer->groom(*ijet,
531 if(jetsIn ==
nullptr){
539 for (
const Jet* poldjet : *jetsIn) {
541 jets->push_back(pnewjet);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Header file to be included by clients of the Monitored infrastructure.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool msgLvl(const MSG::Level lvl) const
size_type size() const noexcept
Returns the number of elements in the collection.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::string label(const std::string &format, int i)
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Jet_v1 Jet
Definition of the current "jet version".
JetAuxContainer_v1 JetAuxContainer
Definition of the current jet auxiliary container.
JetTrigAuxContainer_v2 JetTrigAuxContainer
Definition of the current jet trigger auxiliary container.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Extra patterns decribing particle interation process.