Project

General

Profile

Support #16152

Updated by Kyle Knoepfel over 3 years ago

Hi again,

I am trying to make some larsoft code portable into gallery. I am stuck on what appears to be a missing piece from gallery that's available in full blown art.

The following code works in larsoft:

<pre><code class="cpp">
art::InputTag

@art::InputTag
_input_tag(label);

art::Handle< std::vector<recob::Hit> > theHits;

evt.getByLabel(_input_tag, theHits);



if (!theHits.isValid())

{

// mf::LogDebug("LArPandora") << " Failed to find hits... " << std::endl;
return;

return;
}

else

{

// mf::LogDebug("LArPandora") << " Found: " << theHits->size() << " Hits " << std::endl;

}



for (unsigned int i = 0; i < theHits->size(); ++i)

{

const art::Ptr<recob::Hit> hit(theHits, i);
hitVector.push_back(hit);

hitVector.push_back(hit);
}
</code></pre>
}@

But, when I port it to gallery (art::Handle -> gallery::Handle) it complains:

<pre>
LArPandoraHelper.cxx:47:59: warning: unused parameter ‘evt’ [-Wunused-parameter]
void LArPandoraHelper::CollectWires(const gallery::Event &evt,
^
In file included from /data/products/larsoft/canvas/v1_05_01/include/canvas/Persistency/Common/Assns.h:82:0,
from /data/products/larsoft/canvas/v1_05_01/include/canvas/Persistency/Common/detail/IPRHelper.h:7,
from /data/products/larsoft/canvas/v1_05_01/include/canvas/Persistency/Common/FindManyP.h:124,
from LArPandoraHelper.cxx:14:
/data/products/larsoft/canvas/v1_05_01/include/canvas/Persistency/Common/Ptr.h: In instantiation of ‘art::Ptr<T>::Ptr(const H&, art::Ptr<T>::key_type) [with H = gallery::Handle<std::vector<recob::Wire> >; T = recob::Wire; art::Ptr<T>::key_type = long unsigned int]’:
LArPandoraHelper.cxx:68:53: required from here
/data/products/larsoft/canvas/v1_05_01/include/canvas/Persistency/Common/Ptr.h:262:11: error: ‘const class gallery::Handle<std::vector<recob::Wire> >’ has no member named ‘id’
key_(idx)
^
/data/products/larsoft/canvas/v1_05_01/include/canvas/Persistency/Common/Ptr.h: In instantiation of ‘art::Ptr<T>::Ptr(const H&, art::Ptr<T>::key_type) [with H = gallery::Handle<std::vector<recob::Hit> >; T = recob::Hit; art::Ptr<T>::key_type = long unsigned int]’:
LArPandoraHelper.cxx:96:50: required from here
/data/products/larsoft/canvas/v1_05_01/include/canvas/Persistency/Common/Ptr.h:262:11: error: ‘const class gallery::Handle<std::vector<recob::Hit> >’ has no member named ‘id’
</pre>


It appears the Handle (and ValidHandle, I tried that first) class in gallery is missing the id member. Is there a work around for this, or is this a bug that needs to be fixed?

Thanks!
Corey

Back