37 m_name(iName), m_tree(iTree), m_entry(-1),
44 TBranch* auxBranch =
m_tree->FindBranch(
"ESRecordAuxiliary");
45 auxBranch->SetAddress(&pAux);
48 auxBranch->GetEntry(
index);
95 if(iEvent.
run() != 0) {
102 assert(iEvent.
run()!=0);
112 std::pair<StartIOVtoEntryMap::iterator, StartIOVtoEntryMap::iterator> range =
114 if(range.first!=range.second){
133 m_end = range.second->first;
142 TClass* cls =
nullptr;
144 if(
nullptr ==
b.second.first
or nullptr ==
b.second.second)
continue;
145 if(0==
b.second.first->GetExpectedType(cls,dt)) {
146 cls->Destructor(
b.second.second);
147 b.second.second =
nullptr;
150 for(
auto&
b : m_branches){
151 if(
nullptr ==
b.second.first)
continue;
152 assert(
b.second.second ==
nullptr);
179 const void*& iData)
const 183 std::pair<TBranch*,void*>&
branch =
m_branches[std::make_pair(iType,iLabel)];
184 if(
nullptr == branch.first){
185 branch.second =
nullptr;
188 (*returnValue)<<
"The type " 189 <<iType.
typeInfo().name()<<
" was requested from Record "<<
name()
190 <<
" but the type has no known dictionary";
195 branch.first =
m_tree->FindBranch(branchName.c_str());
197 if(
nullptr == branch.first){
199 (*returnValue)<<
"The data of type " 201 <<
" with label '"<<iLabel<<
"' for Record "<<
name()<<
" is not in this file.";
207 if(0!=branch.first->GetExpectedType(cls,dt)) {
209 (*returnValue)<<
"The type " 210 <<iType.
typeInfo().name()<<
" was requested from Record "<<
name()
211 <<
" but the TBranch does not know what Type it holds.";
215 branch.first->SetAutoDelete(kFALSE);
219 (*returnValue) <<
" The Record " 220 <<
name()<<
" was asked to get data for a 'time' for which it has no data";
223 if(
nullptr != branch.second) {
228 assert(
nullptr == branch.second);
229 branch.first->SetAddress(&branch.second);
230 iData = branch.second;
231 branch.first->GetEntry(
m_entry);
235 std::vector<std::pair<std::string,std::string> >
238 std::vector<std::pair<std::string,std::string> > returnValue;
240 TObjArray* branches =
m_tree->GetListOfBranches();
241 TIter
next( branches );
242 while (TObject*
obj =
next()) {
243 TBranch*
branch =
static_cast<TBranch*
> (
obj);
244 const char*
name = branch->GetName();
245 if (0!=strcmp(name,
"ESRecordAuxiliary") ) {
247 size_t len = strlen(name);
248 const char* cIndex = name+len;
250 while (name != --cIndex) {
252 if( *(cIndex-1)==
'_') {
260 returnValue.push_back(std::make_pair(type,label));
static Timestamp invalidTimestamp()
Record(const char *iName, TTree *)
const edm::EventID & eventID() const
const IOVSyncValue & startSyncValue() const
const std::type_info & typeInfo() const
std::string unformat_mangled_to_type(const std::string &)
given a mangled name return the C++ class name
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
const std::string & name() const
std::string format_type_to_mangled(const std::string &)
given a C++ class name returned a mangled name
void syncTo(const edm::EventID &, const edm::Timestamp &)
std::vector< std::pair< std::string, std::string > > typeAndLabelOfAvailableData() const
std::map< std::pair< edm::TypeID, std::string >, std::pair< TBranch *, void * > > m_branches
std::string const & className() const
bool get(HANDLE &, const char *iLabel="") const
bool hasDictionary(std::type_info const &)
std::map< IOVSyncValue, unsigned int > m_startIOVtoEntry
static const IOVSyncValue & invalidIOVSyncValue()
const edm::Timestamp & timestamp() const
const IOVSyncValue & endSyncValue() const