73 TFile* currentFile =
dynamic_cast<TFile*
>(gROOT->GetListOfFiles()->Last());
74 if (
nullptr == currentFile) {
75 throw cms::Exception(
"FileNotFound") <<
"unable to find the TFile '" << gROOT->GetListOfFiles()->Last() <<
"'\n"
76 <<
"retrieved by calling 'gROOT->GetListOfFiles()->Last()'\n"
77 <<
"Please check the list of files.";
84 if (
nullptr == eventTree) {
88 <<
"'\n Please check that the file is a standard CMS ROOT format.\n"
89 <<
"If the above is not the file you expect then please open your data file after all other files.";
91 Long_t eventEntry = eventTree->GetReadEntry();
96 <<
"please call GetEntry for the 'Events' TTree for each event in order to make edm::Ref's work."
97 <<
"\n Also be sure to call 'SetAddress' for all Branches after calling the GetEntry.";
102 return getIt(branchID, eventEntry);
107 IdToBuffers::iterator itBuffer =
idToBuffers_.find(branchID);
113 if (
nullptr == buffer) {
117 buffer = &(itBuffer->second);
119 if (
nullptr == buffer) {
120 throw cms::Exception(
"NullBuffer") <<
"Found a null buffer which is supposed to hold the data item."
121 <<
"\n Please contact developers since this message should not happen.";
123 if (
nullptr == buffer->
branch_) {
124 throw cms::Exception(
"NullBranch") <<
"The TBranch which should hold the data item is null."
125 <<
"\n Please contact the developers since this message should not happen.";
132 void* address = buffer->
class_->New();
134 static TClass
const* edproductTClass = TClass::GetClass(
typeid(
edm::WrapperBase));
138 if (
nullptr == prod) {
140 <<
"' to a edm::WrapperBase."
141 <<
"Please contact developers since something is very wrong.";
144 buffer->
product_ = std::shared_ptr<edm::WrapperBase const>(prod);
148 buffer->
branch_->SetAddress(address);
150 buffer->
branch_->GetEntry(eventEntry);
155 <<
"Calling GetEntry with index " << eventEntry <<
"for branch " << buffer->
branch_->GetName() <<
" failed.";
174 std::vector<edm::WrapperBase const*>& foundContainers,
175 std::vector<unsigned int>&
keys)
const {
193 return std::monostate{};
196 return std::monostate{};
206 if (
auto factory = std::get_if<edm::detail::GetThinnedKeyFromExceptionFactory>(&
ret)) {
207 return [
func = *factory]() {
209 ex.addContext(
"Calling BareRootProductGetter::getThinnedKeyFrom()");
216 ex.
addContext(
"Calling BareRootProductGetter::getThinnedKeyFrom()");
226 if (
nullptr == branch) {
233 if (!
bool(classType)) {
234 throw cms::Exception(
"MissingDictionary") <<
"could not find dictionary for type '" << fullName <<
"'"
235 <<
"\n Please make sure all the necessary libraries are available.";
239 TClass* rootClassType = TClass::GetClass(classType.typeInfo());
240 if (
nullptr == rootClassType) {
241 throw cms::Exception(
"MissingRootDictionary") <<
"could not find a ROOT dictionary for type '" << fullName <<
"'"
242 <<
"\n Please make sure all the necessary libraries are available.";
245 void* address = rootClassType->New();
247 static TClass
const* edproductTClass = TClass::GetClass(
typeid(
edm::WrapperBase));
250 if (
nullptr == prod) {
251 throw cms::Exception(
"FailedConversion") <<
"failed to convert a '" << fullName <<
"' to a edm::WrapperBase."
252 <<
"Please contact developers since something is very wrong.";
257 Buffer b(prod, branch, address, rootClassType);
263 branch->SetAddress(address);
269 Long_t eventEntry)
const {
271 if (wrapperBase ==
nullptr) {
273 <<
"BareRootProductGetter::getThinnedAssociation, product ThinnedAssociation not found.\n";
277 <<
"BareRootProductGetter::getThinnedAssociation, product has wrong type, not a ThinnedAssociation.\n";
283 return thinnedAssociation;
std::string const & branchName() const
tuple ret
prodAgent to be discontinued
~BareRootProductGetter() override
std::variant< unsigned int, detail::GetThinnedKeyFromExceptionFactory, std::monostate > OptionalThinnedKey
std::type_info const & dynamicTypeInfo() const
edm::propagate_const< TClass * > class_
void getThinnedProducts(edm::ProductID const &, std::vector< edm::WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const override
std::optional< std::tuple< WrapperBase const *, unsigned int > > getThinnedProduct(ProductID const &pid, unsigned int key, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F1 pidToBid, F2 getThinnedAssociation, F3 getByProductID)
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)
TFile const * getFile() const
bool updateFile(TFile *file)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t Func __host__ __device__ V int Func func
const edm::BranchDescription & branchIDToBranch(const edm::BranchID &bid) const
static TypeWithDict byName(std::string const &name)
std::optional< std::tuple< edm::WrapperBase const *, unsigned int > > getThinnedProduct(edm::ProductID const &, unsigned int key) const override
edm::WrapperBase const * getIt(edm::ProductID const &) const override
std::string const & className() const
edm::ThinnedAssociation const * getThinnedAssociation(edm::BranchID const &branchID, Long_t eventEntry) const
tuple key
prepare the HTCondor submission files and eventually submit them
edm::OptionalThinnedKey getThinnedKeyFrom(edm::ProductID const &parent, unsigned int key, edm::ProductID const &thinned) const override
TTree const * getEventTree() const
const edm::ThinnedAssociationsHelper & thinnedAssociationsHelper() const
T const * product() const
std::string wrappedClassName(std::string const &iFullName)
void addContext(std::string const &context)
edm::propagate_const< TBranch * > branch_
Buffer * createNewBuffer(edm::BranchID const &) const
std::string const & eventTreeName()
fwlite::BranchMapReader branchMap_
std::shared_ptr< edm::WrapperBase const > product_
edm::BranchID productToBranchID(const edm::ProductID &pid)
void getThinnedProducts(ProductID const &pid, ThinnedAssociationsHelper const &thinnedAssociationsHelper, F1 pidToBid, F2 getThinnedAssociation, F3 getByProductID, std::vector< WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys)
static HepMC::HEPEVT_Wrapper wrapper