Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
art::detail::SamplingInputFile Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/art/v2_13_00/source/art/Framework/Modules/detail/SamplingInputFile.h"

Public Types

using EntriesForID_t = std::map< EventID, input::EntryNumbers >
 
using InstanceForID_t = std::map< SubRunID, std::unique_ptr< EDProduct >>
 
using ProductsForKey_t = std::map< BranchKey, InstanceForID_t >
 

Public Member Functions

 SamplingInputFile (std::string const &dataset, std::string const &filename, double weight, double probability, EventID const &firstEvent, GroupSelectorRules const &groupSelectorRules, bool dropDescendants, unsigned int treeCacheSize, int64_t treeMaxVirtualSize, int64_t saveMemoryObjectThreshold, BranchDescription const &sampledEventInfoDesc, bool compactRangeSets, std::map< BranchKey, BranchDescription > &oldKeyToSampledProductDescription, ModuleDescription const &moduleDescription, bool readIncomingParameterSets, MasterProductRegistry &mpr)
 
EventID nextEvent () const
 
bool readyForNextEvent ()
 
EntriesForID_t treeEntries (BranchType)
 
ProductsForKey_t productsFor (EntriesForID_t const &entries, BranchType)
 
template<typename T >
SampledInfo< TsampledInfoFor (EntriesForID_t const &entries)
 
std::unique_ptr< EventPrincipalreadEvent (EventID const &eventID, ProcessConfigurations const &sampled_pcs, ProcessConfiguration const &current_pc)
 

Private Member Functions

void dropOnInput_ (GroupSelectorRules const &rules, BranchChildren const &children, bool dropDescendants, ProductList &productList)
 
bool updateEventEntry_ (FileIndex::const_iterator &iter, input::EntryNumber &entry) const
 
TTree * treeForBranchType_ (BranchType bt) const
 
EventAuxiliary auxiliaryForEntry_ (input::EntryNumber entry)
 
History historyForEntry_ (input::EntryNumber entry)
 

Private Attributes

std::string const dataset_
 
std::unique_ptr< TFile > file_
 
double const weight_
 
double const probability_
 
EventID const firstEvent_
 
cet::sqlite::Connection sqliteDB_ {}
 
int64_t saveMemoryObjectThreshold_
 
FileIndex fileIndex_ {}
 
FileFormatVersion fileFormatVersion_ {}
 
FileIndex::const_iterator fiIter_ {fileIndex_.cbegin()}
 
FileIndex::const_iterator fiEnd_ {fileIndex_.cend()}
 
input::EntryNumber currentEventEntry_ {-1}
 
TTree * runTree_ {nullptr}
 
TTree * subRunTree_ {nullptr}
 
TTree * eventTree_ {nullptr}
 
TTree * eventMetaTree_ {nullptr}
 
TBranch * auxBranch_ {nullptr}
 
TBranch * productProvenanceBranch_ {nullptr}
 
TTree * eventHistoryTree_ {nullptr}
 
input::BranchMap branches_ {}
 
BranchDescription const & sampledEventInfoDesc_
 
bool compactRangeSets_
 
ProductRegistry productListHolder_ {}
 
ProductTable presentEventProducts_ {}
 
std::unique_ptr< BranchIDLists > branchIDLists_
 

Detailed Description

Definition at line 39 of file SamplingInputFile.h.

Member Typedef Documentation

Definition at line 41 of file SamplingInputFile.h.

Definition at line 42 of file SamplingInputFile.h.

Definition at line 43 of file SamplingInputFile.h.

Constructor & Destructor Documentation

art::detail::SamplingInputFile::SamplingInputFile ( std::string const &  dataset,
std::string const &  filename,
double  weight,
double  probability,
EventID const &  firstEvent,
GroupSelectorRules const &  groupSelectorRules,
bool  dropDescendants,
unsigned int  treeCacheSize,
int64_t  treeMaxVirtualSize,
int64_t  saveMemoryObjectThreshold,
BranchDescription const &  sampledEventInfoDesc,
bool  compactRangeSets,
std::map< BranchKey, BranchDescription > &  oldKeyToSampledProductDescription,
ModuleDescription const &  moduleDescription,
bool  readIncomingParameterSets,
MasterProductRegistry mpr 
)
explicit

Member Function Documentation

EventAuxiliary art::detail::SamplingInputFile::auxiliaryForEntry_ ( input::EntryNumber  entry)
private
void art::detail::SamplingInputFile::dropOnInput_ ( GroupSelectorRules const &  rules,
BranchChildren const &  children,
bool  dropDescendants,
ProductList productList 
)
private
History art::detail::SamplingInputFile::historyForEntry_ ( input::EntryNumber  entry)
private
EventID art::detail::SamplingInputFile::nextEvent ( ) const
ProductsForKey_t art::detail::SamplingInputFile::productsFor ( EntriesForID_t const &  entries,
BranchType   
)
std::unique_ptr<EventPrincipal> art::detail::SamplingInputFile::readEvent ( EventID const &  eventID,
ProcessConfigurations const &  sampled_pcs,
ProcessConfiguration const &  current_pc 
)
bool art::detail::SamplingInputFile::readyForNextEvent ( )
template<typename T >
SampledInfo< T > art::detail::SamplingInputFile::sampledInfoFor ( EntriesForID_t const &  entries)

Definition at line 135 of file SamplingInputFile.h.

References PandAna.Demos.tute_pid_validation::ids, gammaraytel::pr, probability_, and weight_.

136  {
137  // We use a set because it is okay for multiple entries of the
138  // same (sub)run to be present in the FileIndex--these correspond
139  // to (sub)run fragments. However, we do not want these to appear
140  // as separate entries in the SampledInfo object.
141  std::set<T> ids;
142  for (auto const& pr : entries) {
143  auto const& invalid_event_id = pr.first;
144  ids.insert(id_for<T>(invalid_event_id));
145  }
146 
147  return SampledInfo<T>{
148  weight_, probability_, std::vector<T>(cbegin(ids), cend(ids))};
149  }
EntriesForID_t art::detail::SamplingInputFile::treeEntries ( BranchType  )
TTree* art::detail::SamplingInputFile::treeForBranchType_ ( BranchType  bt) const
private
bool art::detail::SamplingInputFile::updateEventEntry_ ( FileIndex::const_iterator iter,
input::EntryNumber entry 
) const
private

Member Data Documentation

TBranch* art::detail::SamplingInputFile::auxBranch_ {nullptr}
private

Definition at line 104 of file SamplingInputFile.h.

input::BranchMap art::detail::SamplingInputFile::branches_ {}
private

Definition at line 107 of file SamplingInputFile.h.

std::unique_ptr<BranchIDLists> art::detail::SamplingInputFile::branchIDLists_
private
Initial value:
{
nullptr}

Definition at line 112 of file SamplingInputFile.h.

bool art::detail::SamplingInputFile::compactRangeSets_
private

Definition at line 109 of file SamplingInputFile.h.

input::EntryNumber art::detail::SamplingInputFile::currentEventEntry_ {-1}
private

Definition at line 99 of file SamplingInputFile.h.

std::string const art::detail::SamplingInputFile::dataset_
private

Definition at line 88 of file SamplingInputFile.h.

TTree* art::detail::SamplingInputFile::eventHistoryTree_ {nullptr}
private

Definition at line 106 of file SamplingInputFile.h.

TTree* art::detail::SamplingInputFile::eventMetaTree_ {nullptr}
private

Definition at line 103 of file SamplingInputFile.h.

TTree* art::detail::SamplingInputFile::eventTree_ {nullptr}
private

Definition at line 102 of file SamplingInputFile.h.

FileIndex::const_iterator art::detail::SamplingInputFile::fiEnd_ {fileIndex_.cend()}
private

Definition at line 98 of file SamplingInputFile.h.

FileIndex::const_iterator art::detail::SamplingInputFile::fiIter_ {fileIndex_.cbegin()}
private

Definition at line 97 of file SamplingInputFile.h.

std::unique_ptr<TFile> art::detail::SamplingInputFile::file_
private

Definition at line 89 of file SamplingInputFile.h.

FileFormatVersion art::detail::SamplingInputFile::fileFormatVersion_ {}
private

Definition at line 96 of file SamplingInputFile.h.

FileIndex art::detail::SamplingInputFile::fileIndex_ {}
private

Definition at line 95 of file SamplingInputFile.h.

EventID const art::detail::SamplingInputFile::firstEvent_
private

Definition at line 92 of file SamplingInputFile.h.

ProductTable art::detail::SamplingInputFile::presentEventProducts_ {}
private

Definition at line 111 of file SamplingInputFile.h.

double const art::detail::SamplingInputFile::probability_
private

Definition at line 91 of file SamplingInputFile.h.

Referenced by sampledInfoFor().

ProductRegistry art::detail::SamplingInputFile::productListHolder_ {}
private

Definition at line 110 of file SamplingInputFile.h.

TBranch* art::detail::SamplingInputFile::productProvenanceBranch_ {nullptr}
private

Definition at line 105 of file SamplingInputFile.h.

TTree* art::detail::SamplingInputFile::runTree_ {nullptr}
private

Definition at line 100 of file SamplingInputFile.h.

BranchDescription const& art::detail::SamplingInputFile::sampledEventInfoDesc_
private

Definition at line 108 of file SamplingInputFile.h.

int64_t art::detail::SamplingInputFile::saveMemoryObjectThreshold_
private

Definition at line 94 of file SamplingInputFile.h.

cet::sqlite::Connection art::detail::SamplingInputFile::sqliteDB_ {}
private

Definition at line 93 of file SamplingInputFile.h.

TTree* art::detail::SamplingInputFile::subRunTree_ {nullptr}
private

Definition at line 101 of file SamplingInputFile.h.

double const art::detail::SamplingInputFile::weight_
private

Definition at line 90 of file SamplingInputFile.h.

Referenced by sampledInfoFor().


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