53 if (
nullptr == eventTree) {
57 <<
"'\n Please check that the file is a standard CMS ROOT format.\n" 58 <<
"If the above is not the file you expect then please open your data file after all other files.";
60 Long_t eventEntry = eventTree->GetReadEntry();
65 <<
"please call GetEntry for the 'Events' TTree for each event in order to make edm::Ref's work." 66 <<
"\n Also be sure to call 'SetAddress' for all Branches after calling the GetEntry.";
71 return getIt(branchID, eventEntry);
76 IdToBuffers::iterator itBuffer =
idToBuffers_.find(branchID);
86 buffer = &(itBuffer->second);
89 throw cms::Exception(
"NullBuffer") <<
"Found a null buffer which is supposed to hold the data item." 90 <<
"\n Please contact developers since this message should not happen.";
92 if (
nullptr ==
buffer->branch_) {
93 throw cms::Exception(
"NullBranch") <<
"The TBranch which should hold the data item is null." 94 <<
"\n Please contact the developers since this message should not happen.";
96 if (
buffer->eventEntry_ != eventEntry) {
101 void* address =
buffer->class_->New();
103 static TClass
const* edproductTClass = TClass::GetClass(
typeid(
edm::WrapperBase));
107 if (
nullptr ==
prod) {
109 <<
"' to a edm::WrapperBase." 110 <<
"Please contact developers since something is very wrong.";
112 buffer->address_ = address;
113 buffer->product_ = std::shared_ptr<edm::WrapperBase const>(
prod);
116 address = &(
buffer->address_);
117 buffer->branch_->SetAddress(address);
119 buffer->branch_->GetEntry(eventEntry);
120 buffer->eventEntry_ = eventEntry;
124 <<
"Calling GetEntry with index " << eventEntry <<
"for branch " <<
buffer->branch_->GetName() <<
" failed.";
127 return buffer->product_.get();
143 std::vector<edm::WrapperBase const*>& foundContainers,
144 std::vector<unsigned int>&
keys)
const {
162 return std::monostate{};
165 return std::monostate{};
175 if (
auto factory = std::get_if<edm::detail::GetThinnedKeyFromExceptionFactory>(&
ret)) {
176 return [
func = *factory]() {
178 ex.addContext(
"Calling BareRootProductGetterBase::getThinnedKeyFrom()");
185 ex.
addContext(
"Calling BareRootProductGetterBase::getThinnedKeyFrom()");
202 if (!
bool(classType)) {
204 <<
"\n Please make sure all the necessary libraries are available.";
208 TClass* rootClassType = TClass::GetClass(classType.typeInfo());
209 if (
nullptr == rootClassType) {
210 throw cms::Exception(
"MissingRootDictionary") <<
"could not find a ROOT dictionary for type '" <<
fullName <<
"'" 211 <<
"\n Please make sure all the necessary libraries are available.";
214 void* address = rootClassType->New();
216 static TClass
const* edproductTClass = TClass::GetClass(
typeid(
edm::WrapperBase));
219 if (
nullptr ==
prod) {
220 throw cms::Exception(
"FailedConversion") <<
"failed to convert a '" <<
fullName <<
"' to a edm::WrapperBase." 221 <<
"Please contact developers since something is very wrong.";
232 branch->SetAddress(address);
238 Long_t eventEntry)
const {
240 if (wrapperBase ==
nullptr) {
242 <<
"BareRootProductGetterBase::getThinnedAssociation, product ThinnedAssociation not found.\n";
246 <<
"BareRootProductGetterBase::getThinnedAssociation, product has wrong type, not a ThinnedAssociation.\n";
252 return thinnedAssociation;
~BareRootProductGetterBase() override
BareRootProductGetterBase()
std::variant< unsigned int, detail::GetThinnedKeyFromExceptionFactory, std::monostate > OptionalThinnedKey
std::optional< std::tuple< edm::WrapperBase const *, unsigned int > > getThinnedProduct(edm::ProductID const &, unsigned int key) const override
ret
prodAgent to be discontinued
std::optional< std::tuple< WrapperBase const *, unsigned int > > getThinnedProduct(ProductID const &pid, unsigned int key, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F1 pidToBid, F2 getThinnedAssociation, F3 getByProductID)
fwlite::BranchMapReader branchMap_
bool updateEvent(Long_t eventEntry)
std::variant< unsigned int, GetThinnedKeyFromExceptionFactory, std::monostate > getThinnedKeyFrom_implementation(ProductID const &parentID, BranchID const &parent, unsigned int key, ProductID const &thinnedID, BranchID thinned, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F &&getThinnedAssociation)
void getThinnedProducts(edm::ProductID const &, std::vector< edm::WrapperBase const *> &foundContainers, std::vector< unsigned int > &keys) const override
bool updateFile(TFile *file)
TTree const * getEventTree() const
const edm::ThinnedAssociationsHelper & thinnedAssociationsHelper() const
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID, Long_t eventEntry) const
virtual TFile * currentFile() const =0
edm::OptionalThinnedKey getThinnedKeyFrom(edm::ProductID const &parent, unsigned int key, edm::ProductID const &thinned) const override
static TypeWithDict byName(std::string const &name)
void getThinnedProducts(ProductID const &pid, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F1 pidToBid, F2 getThinnedAssociation, F3 getByProductID, std::vector< WrapperBase const *> &foundContainers, std::vector< unsigned int > &keys)
std::type_info const & dynamicTypeInfo() const
std::string const & className() const
std::string const & branchName() const
const edm::BranchDescription & branchIDToBranch(const edm::BranchID &bid) const
key
prepare the HTCondor submission files and eventually submit them
TFile const * getFile() const
std::string wrappedClassName(std::string const &iFullName)
void addContext(std::string const &context)
std::string const & eventTreeName()
edm::WrapperBase const * getIt(edm::ProductID const &) const override
edm::BranchID productToBranchID(const edm::ProductID &pid)
static HepMC::HEPEVT_Wrapper wrapper
Buffer * createNewBuffer(edm::BranchID const &) const