All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 30 of file ShowerProducedPtrsHolder.hh.

Constructor & Destructor Documentation

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

Definition at line 239 of file ShowerProducedPtrsHolder.hh.

239  {
240  ptrmaker = nullptr;
241  ptr = 0;
242  InstanceName = Instancename;
243  }
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 246 of file ShowerProducedPtrsHolder.hh.

246  {
247  if(ptr){
248  return true;
249  }
250  return false;
251  }
template<class T>
art::Ptr<T> reco::shower::ShowerPtrMaker< T >::GetArtPtr ( int  iter) const
inline

Definition at line 265 of file ShowerProducedPtrsHolder.hh.

265  {
266  if(ptr){
267  if(ptrmaker == nullptr){
268  throw cet::exception("ShowerPtrMaker") << "Ptr maker ptr is null" << std::endl;
269  }
270  return (*ptrmaker)(iter);
271  }
272  throw cet::exception("ShowerPtrMaker") << "Trying to get a ptrmaker that does not exists" << std::endl;
273  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker
template<class T>
art::PtrMaker<T>& reco::shower::ShowerPtrMaker< T >::GetPtrMaker ( )
inline

Definition at line 254 of file ShowerProducedPtrsHolder.hh.

254  {
255  if(ptr){
256  if(ptrmaker == nullptr){
257  throw cet::exception("ShowerPtrMaker") << "Ptr maker ptr is null" << std::endl;
258  }
259  return *ptrmaker;
260  }
261  throw cet::exception("ShowerPtrMaker") << "Trying to get a ptrmaker that does not exists" << std::endl;
262  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker
template<class T>
void reco::shower::ShowerPtrMaker< T >::Reset ( )
inlineoverridevirtual

Implements reco::shower::ShowerPtrMakerBase.

Definition at line 281 of file ShowerProducedPtrsHolder.hh.

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

Implements reco::shower::ShowerPtrMakerBase.

Definition at line 276 of file ShowerProducedPtrsHolder.hh.

276  {
277  ptrmaker.reset(new art::PtrMaker<T>(evt,InstanceName));
278  ptr = 1;
279  }
std::unique_ptr< art::PtrMaker< T > > ptrmaker
TCEvent evt
Definition: DataStructs.cxx:8

Member Data Documentation

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

Definition at line 295 of file ShowerProducedPtrsHolder.hh.

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

Definition at line 298 of file ShowerProducedPtrsHolder.hh.

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

Definition at line 292 of file ShowerProducedPtrsHolder.hh.


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