Public Member Functions | Private Attributes | List of all members
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
 
- Public Member Functions inherited from reco::shower::ShowerPtrMakerBase
virtual ~ShowerPtrMakerBase () noexcept=default
 

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 23 of file ShowerProducedPtrsHolder.hh.

Constructor & Destructor Documentation

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

Definition at line 225 of file ShowerProducedPtrsHolder.hh.

225  {
226  ptrmaker = nullptr;
227  ptr = 0;
228  InstanceName = Instancename;
229  }
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 232 of file ShowerProducedPtrsHolder.hh.

232  {
233  if(ptr){
234  return true;
235  }
236  return false;
237  }
template<class T>
art::Ptr<T> reco::shower::ShowerPtrMaker< T >::GetArtPtr ( int  iter) const
inline

Definition at line 251 of file ShowerProducedPtrsHolder.hh.

251  {
252  if(ptr){
253  if(ptrmaker == nullptr){
254  throw cet::exception("ShowerPtrMaker") << "Ptr maker ptr is null" << std::endl;
255  }
256  return (*ptrmaker)(iter);
257  }
258  throw cet::exception("ShowerPtrMaker") << "Trying to get a ptrmaker that does not exists" << std::endl;
259  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
template<class T>
art::PtrMaker<T>& reco::shower::ShowerPtrMaker< T >::GetPtrMaker ( )
inline

Definition at line 240 of file ShowerProducedPtrsHolder.hh.

240  {
241  if(ptr){
242  if(ptrmaker == nullptr){
243  throw cet::exception("ShowerPtrMaker") << "Ptr maker ptr is null" << std::endl;
244  }
245  return *ptrmaker;
246  }
247  throw cet::exception("ShowerPtrMaker") << "Trying to get a ptrmaker that does not exists" << std::endl;
248  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
template<class T>
void reco::shower::ShowerPtrMaker< T >::Reset ( void  )
inlineoverridevirtual

Implements reco::shower::ShowerPtrMakerBase.

Definition at line 267 of file ShowerProducedPtrsHolder.hh.

267  {
268  if(!ptr){
269  throw cet::exception("ShowerPtrMaker") << "Trying to reset ptr but it has not been set in the first place. Please contatc Dom Barker" << std::endl;
270  }
271  ptrmaker.reset(nullptr);
272  ptr = 0;
273  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
template<class T>
void reco::shower::ShowerPtrMaker< T >::SetPtrMaker ( art::Event evt)
inlineoverridevirtual

Implements reco::shower::ShowerPtrMakerBase.

Definition at line 262 of file ShowerProducedPtrsHolder.hh.

262  {
263  ptrmaker.reset(new art::PtrMaker<T>(evt,InstanceName));
264  ptr = 1;
265  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker

Member Data Documentation

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

Definition at line 281 of file ShowerProducedPtrsHolder.hh.

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

Definition at line 284 of file ShowerProducedPtrsHolder.hh.

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

Definition at line 278 of file ShowerProducedPtrsHolder.hh.


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