LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
reco::shower::ShowerPtrMaker< T > Class Template Reference

#include "ShowerProducedPtrsHolder.hh"

Inheritance diagram for reco::shower::ShowerPtrMaker< T >:
reco::shower::ShowerPtrMakerBase

Public Member Functions

 ShowerPtrMaker (const std::string &Instancename)
 
bool CheckPtrMaker () const override
 
art::PtrMaker< T > & GetPtrMaker ()
 
art::Ptr< T > GetArtPtr (int iter) const
 
void SetPtrMaker (art::Event &evt) override
 
void Reset () override
 

Private Attributes

std::unique_ptr< art::PtrMaker< T > > ptrmaker
 
std::string InstanceName
 
int ptr
 

Detailed Description

template<class T>
class reco::shower::ShowerPtrMaker< T >

Definition at line 33 of file ShowerProducedPtrsHolder.hh.

Constructor & Destructor Documentation

template<class T>
reco::shower::ShowerPtrMaker< T >::ShowerPtrMaker ( const std::string &  Instancename)
inline

Definition at line 231 of file ShowerProducedPtrsHolder.hh.

232  {
233  ptrmaker = nullptr;
234  ptr = 0;
235  InstanceName = Instancename;
236  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker

Member Function Documentation

template<class T>
bool reco::shower::ShowerPtrMaker< T >::CheckPtrMaker ( ) const
inlineoverridevirtual

Implements reco::shower::ShowerPtrMakerBase.

Definition at line 239 of file ShowerProducedPtrsHolder.hh.

240  {
241  if (ptr) { return true; }
242  return false;
243  }
template<class T>
art::Ptr<T> reco::shower::ShowerPtrMaker< T >::GetArtPtr ( int  iter) const
inline

Definition at line 259 of file ShowerProducedPtrsHolder.hh.

Referenced by reco::shower::ShowerProducedPtrsHolder::GetArtPtr().

260  {
261  if (ptr) {
262  if (ptrmaker == nullptr) {
263  throw cet::exception("ShowerPtrMaker") << "Ptr maker ptr is null" << std::endl;
264  }
265  return (*ptrmaker)(iter);
266  }
267  throw cet::exception("ShowerPtrMaker")
268  << "Trying to get a ptrmaker that does not exists" << std::endl;
269  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<class T>
art::PtrMaker<T>& reco::shower::ShowerPtrMaker< T >::GetPtrMaker ( )
inline

Definition at line 246 of file ShowerProducedPtrsHolder.hh.

Referenced by reco::shower::ShowerProducedPtrsHolder::GetPtrMaker().

247  {
248  if (ptr) {
249  if (ptrmaker == nullptr) {
250  throw cet::exception("ShowerPtrMaker") << "Ptr maker ptr is null" << std::endl;
251  }
252  return *ptrmaker;
253  }
254  throw cet::exception("ShowerPtrMaker")
255  << "Trying to get a ptrmaker that does not exists" << std::endl;
256  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<class T>
void reco::shower::ShowerPtrMaker< T >::Reset ( )
inlineoverridevirtual

Implements reco::shower::ShowerPtrMakerBase.

Definition at line 278 of file ShowerProducedPtrsHolder.hh.

279  {
280  if (!ptr) {
281  throw cet::exception("ShowerPtrMaker") << "Trying to reset ptr but it has not been set in "
282  "the first place. Please contatc Dom Barker"
283  << std::endl;
284  }
285  ptrmaker.reset(nullptr);
286  ptr = 0;
287  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<class T>
void reco::shower::ShowerPtrMaker< T >::SetPtrMaker ( art::Event evt)
inlineoverridevirtual

Implements reco::shower::ShowerPtrMakerBase.

Definition at line 272 of file ShowerProducedPtrsHolder.hh.

273  {
274  ptrmaker.reset(new art::PtrMaker<T>(evt, InstanceName));
275  ptr = 1;
276  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker

Member Data Documentation

template<class T>
std::string reco::shower::ShowerPtrMaker< T >::InstanceName
private

Definition at line 294 of file ShowerProducedPtrsHolder.hh.

template<class T>
int reco::shower::ShowerPtrMaker< T >::ptr
private

Definition at line 297 of file ShowerProducedPtrsHolder.hh.

template<class T>
std::unique_ptr<art::PtrMaker<T> > reco::shower::ShowerPtrMaker< T >::ptrmaker
private

Definition at line 291 of file ShowerProducedPtrsHolder.hh.


The documentation for this class was generated from the following file: