Public Member Functions | Private Attributes | List of all members
gallery::BranchData Class Reference

#include <BranchData.h>

Inheritance diagram for gallery::BranchData:
art::EDProductGetter gallery::AssnsBranchData

Public Member Functions

virtual ~BranchData ()
 
 BranchData ()=default
 
 BranchData (art::TypeID const &type, TClass *iTClass, TBranch *branch, EventNavigator const *eventNavigator, art::PrincipalBase const *finder, std::string &&iBranchName)
 
 BranchData (BranchData const &)=delete
 
 BranchData (BranchData &&)=delete
 
BranchDataoperator= (BranchData const &)=delete
 
BranchDataoperator= (BranchData &&)=delete
 
virtual void updateFile (TBranch *iBranch)
 
TClass * tClass () const noexcept
 
void * address () const noexcept
 
TBranch * branch () const noexcept
 
std::string const & branchName () const noexcept
 
long long lastProduct () const noexcept
 
virtual art::EDProduct const * getIt_ () const
 
virtual art::EDProduct const * uniqueProduct_ () const
 
virtual art::EDProduct const * uniqueProduct_ (art::TypeID const &) const
 
- Public Member Functions inherited from art::EDProductGetter
virtual ~EDProductGetter ()
 
 EDProductGetter ()
 
 EDProductGetter (EDProductGetter const &)=delete
 
 EDProductGetter (EDProductGetter &&)=delete
 
EDProductGetteroperator= (EDProductGetter const &)=delete
 
EDProductGetteroperator= (EDProductGetter &&)=delete
 
EDProduct const * getIt () const
 

Private Attributes

TClass * tClass_ {nullptr}
 
void * address_ {nullptr}
 
art::EDProduct const * edProduct_ {nullptr}
 
TBranch * branch_ {nullptr}
 
EventNavigator const * eventNavigator_ {nullptr}
 
cet::exempt_ptr< art::PrincipalBase const > finder_ {nullptr}
 
long long lastProduct_ {-1}
 
std::string branchName_ {}
 

Detailed Description

Definition at line 26 of file BranchData.h.

Constructor & Destructor Documentation

gallery::BranchData::~BranchData ( )
virtual

Definition at line 31 of file BranchData.cc.

32  {
33  if (tClass_) {
34  tClass_->Destructor(address_);
35  }
36  }
gallery::BranchData::BranchData ( )
default
gallery::BranchData::BranchData ( art::TypeID const &  type,
TClass *  iTClass,
TBranch *  branch,
EventNavigator const *  eventNavigator,
art::PrincipalBase const *  finder,
std::string &&  iBranchName 
)
explicit

Definition at line 38 of file BranchData.cc.

44  : tClass_{iTClass}
45  , address_{(tClass_ != nullptr) ? tClass_->New() : nullptr}
46  , edProduct_{calculateEDProductAddress(tClass_, address_)}
47  , branch_{iBranch}
48  , eventNavigator_{eventNavigator}
49  , finder_{finder}
50  , lastProduct_{-1}
51  , branchName_{move(iBranchName)}
52  {
53  if (tClass_ == nullptr) {
55  << "In BranchData constructor, no dictionary exists for type "
56  << type.className();
57  }
58  if (address_ == nullptr) {
60  << "In BranchData constructor, failed to construct type "
61  << type.className();
62  }
63  if (branch_) {
64  branch_->SetAddress(&address_);
65  }
66  }
std::string branchName_
Definition: BranchData.h:89
art::EDProduct const * edProduct_
Definition: BranchData.h:84
EventNavigator const * eventNavigator_
Definition: BranchData.h:86
cet::exempt_ptr< art::PrincipalBase const > finder_
Definition: BranchData.h:87
def move(depos, offset)
Definition: depos.py:107
long long lastProduct_
Definition: BranchData.h:88
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
TBranch * branch_
Definition: BranchData.h:85
gallery::BranchData::BranchData ( BranchData const &  )
delete
gallery::BranchData::BranchData ( BranchData &&  )
delete

Member Function Documentation

void* gallery::BranchData::address ( ) const
inlinenoexcept

Definition at line 54 of file BranchData.h.

55  {
56  return address_;
57  }
TBranch* gallery::BranchData::branch ( ) const
inlinenoexcept

Definition at line 60 of file BranchData.h.

61  {
62  return branch_;
63  }
TBranch * branch_
Definition: BranchData.h:85
std::string const& gallery::BranchData::branchName ( ) const
inlinenoexcept

Definition at line 66 of file BranchData.h.

67  {
68  return branchName_;
69  }
std::string branchName_
Definition: BranchData.h:89
art::EDProduct const * gallery::BranchData::getIt_ ( ) const
virtual

Reimplemented from art::EDProductGetter.

Reimplemented in gallery::AssnsBranchData.

Definition at line 79 of file BranchData.cc.

80  {
81  if (branch_ == nullptr) {
82  return nullptr;
83  }
84  long long entry = eventNavigator_->eventEntry();
85  if (entry != lastProduct_) {
86  // haven't gotten the data for this event
87  art::configureRefCoreStreamer(finder_.get());
88  branch_->GetEntry(entry);
89  art::configureRefCoreStreamer();
91  }
92  if (edProduct_->isPresent()) {
93  return edProduct_;
94  }
95  return nullptr;
96  }
art::EDProduct const * edProduct_
Definition: BranchData.h:84
QList< Entry > entry
EventNavigator const * eventNavigator_
Definition: BranchData.h:86
constexpr pointer get() const noexcept
Definition: exempt_ptr.h:148
cet::exempt_ptr< art::PrincipalBase const > finder_
Definition: BranchData.h:87
long long lastProduct_
Definition: BranchData.h:88
bool isPresent() const
Definition: EDProduct.h:31
long long eventEntry() const
TBranch * branch_
Definition: BranchData.h:85
long long gallery::BranchData::lastProduct ( ) const
inlinenoexcept

Definition at line 72 of file BranchData.h.

73  {
74  return lastProduct_;
75  }
long long lastProduct_
Definition: BranchData.h:88
BranchData& gallery::BranchData::operator= ( BranchData const &  )
delete
BranchData& gallery::BranchData::operator= ( BranchData &&  )
delete
TClass* gallery::BranchData::tClass ( ) const
inlinenoexcept

Definition at line 48 of file BranchData.h.

49  {
50  return tClass_;
51  }
art::EDProduct const * gallery::BranchData::uniqueProduct_ ( ) const
virtual

Reimplemented in gallery::AssnsBranchData.

Definition at line 99 of file BranchData.cc.

100  {
101  return getIt_();
102  }
virtual art::EDProduct const * getIt_() const
Definition: BranchData.cc:79
art::EDProduct const * gallery::BranchData::uniqueProduct_ ( art::TypeID const &  ) const
virtual

Reimplemented in gallery::AssnsBranchData.

Definition at line 105 of file BranchData.cc.

106  {
107  return getIt_();
108  }
virtual art::EDProduct const * getIt_() const
Definition: BranchData.cc:79
void gallery::BranchData::updateFile ( TBranch *  iBranch)
virtual

Reimplemented in gallery::AssnsBranchData.

Definition at line 69 of file BranchData.cc.

70  {
71  branch_ = iBranch;
72  if (branch_) {
73  branch_->SetAddress(&address_);
74  }
75  lastProduct_ = -1;
76  }
long long lastProduct_
Definition: BranchData.h:88
TBranch * branch_
Definition: BranchData.h:85

Member Data Documentation

void* gallery::BranchData::address_ {nullptr}
private

Definition at line 83 of file BranchData.h.

TBranch* gallery::BranchData::branch_ {nullptr}
private

Definition at line 85 of file BranchData.h.

std::string gallery::BranchData::branchName_ {}
private

Definition at line 89 of file BranchData.h.

art::EDProduct const* gallery::BranchData::edProduct_ {nullptr}
private

Definition at line 84 of file BranchData.h.

EventNavigator const* gallery::BranchData::eventNavigator_ {nullptr}
private

Definition at line 86 of file BranchData.h.

cet::exempt_ptr<art::PrincipalBase const> gallery::BranchData::finder_ {nullptr}
private

Definition at line 87 of file BranchData.h.

long long gallery::BranchData::lastProduct_ {-1}
mutableprivate

Definition at line 88 of file BranchData.h.

TClass* gallery::BranchData::tClass_ {nullptr}
private

Definition at line 82 of file BranchData.h.


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