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

#include "ShowerElementHolder.hh"

Inheritance diagram for reco::shower::ShowerElementAccessor< T >:
reco::shower::ShowerElementBase reco::shower::EventDataProduct< T > reco::shower::ShowerDataProduct< T > reco::shower::ShowerProperty< T, T2 >

Public Member Functions

 ShowerElementAccessor (T &Element)
 
void SetShowerElement (T &Element)
 
int GetShowerElement (T &Element) const
 
T & GetShowerElementRef ()
 
GetShowerElement () const
 
std::string GetType () const override
 
virtual bool CheckTag () const
 
virtual void SetCheckTag (bool &check)
 
bool CheckShowerElement () const
 
void Clear ()
 

Protected Attributes

element
 
bool elementPtr
 

Detailed Description

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

Definition at line 31 of file ShowerElementHolder.hh.

Constructor & Destructor Documentation

template<class T>
reco::shower::ShowerElementAccessor< T >::ShowerElementAccessor ( T &  Element)
inline

Definition at line 81 of file ShowerElementHolder.hh.

References reco::shower::ShowerElementBase::elementPtr.

81  : element(Element)
82  {
83  this->elementPtr = 1;
84  // this->element = Element;
85  }

Member Function Documentation

bool reco::shower::ShowerElementBase::CheckShowerElement ( ) const
inlineinherited

Definition at line 60 of file ShowerElementHolder.hh.

References reco::shower::ShowerElementBase::elementPtr.

61  {
62  if (elementPtr)
63  return true;
64  else
65  return false;
66  }
virtual bool reco::shower::ShowerElementBase::CheckTag ( ) const
inlinevirtualinherited

Reimplemented in reco::shower::ShowerDataProduct< T >.

Definition at line 46 of file ShowerElementHolder.hh.

47  {
48  throw cet::exception("ShowerElementHolder")
49  << "Trying to check an element that is not a product" << std::endl;
50  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<class T>
int reco::shower::ShowerElementAccessor< T >::GetShowerElement ( T &  Element) const
inline
template<class T>
T reco::shower::ShowerElementAccessor< T >::GetShowerElement ( ) const
inline

Definition at line 116 of file ShowerElementHolder.hh.

References reco::shower::ShowerElementBase::elementPtr.

117  {
118  if (!this->elementPtr) {
119  throw cet::exception("ShowerElementHolder")
120  << "The element that is being accessed is not set" << std::endl;
121  }
122  return element;
123  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<class T>
T& reco::shower::ShowerElementAccessor< T >::GetShowerElementRef ( )
inline

Definition at line 107 of file ShowerElementHolder.hh.

References reco::shower::ShowerElementBase::elementPtr.

Referenced by reco::shower::ShowerElementHolder::GetEventElement().

108  {
109  if (!this->elementPtr) {
110  throw cet::exception("ShowerElementHolder")
111  << "The element that is being accessed is not set" << std::endl;
112  }
113  return element;
114  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<class T>
std::string reco::shower::ShowerElementAccessor< T >::GetType ( ) const
inlineoverridevirtual

Implements reco::shower::ShowerElementBase.

Definition at line 126 of file ShowerElementHolder.hh.

126 { return cet::demangle_symbol(typeid(element).name()); }
virtual void reco::shower::ShowerElementBase::SetCheckTag ( bool &  check)
inlinevirtualinherited

Reimplemented in reco::shower::ShowerDataProduct< T >.

Definition at line 51 of file ShowerElementHolder.hh.

References reco::shower::ShowerElementBase::GetType().

52  {
53  throw cet::exception("ShowerElementHolder")
54  << "Trying to set an element that is not a product" << std::endl;
55  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

template<class T>
T reco::shower::ShowerElementAccessor< T >::element
protected

Definition at line 129 of file ShowerElementHolder.hh.


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