CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DQMTTreeIO::TreeStringReader Class Reference
Inheritance diagram for DQMTTreeIO::TreeStringReader:
DQMTTreeIO::TreeReaderBase

Public Member Functions

void read (ULong64_t iIndex, DQMStore *dqmstore, int run, int lumi) override
 
void setTree (TTree *iTree) override
 
 TreeStringReader (MonitorElementData::Kind kind, MonitorElementData::Scope rescope)
 
- Public Member Functions inherited from DQMTTreeIO::TreeReaderBase
MonitorElementData::Key makeKey (std::string const &fullname, int run, int lumi)
 
 TreeReaderBase (MonitorElementData::Kind kind, MonitorElementData::Scope rescope)
 
virtual ~TreeReaderBase ()
 

Private Attributes

std::string * m_fullName = nullptr
 
uint32_t m_tag = 0
 
TTree * m_tree = nullptr
 
std::string * m_value = nullptr
 

Additional Inherited Members

- Protected Attributes inherited from DQMTTreeIO::TreeReaderBase
MonitorElementData::Kind m_kind
 
MonitorElementData::Scope m_rescope
 

Detailed Description

Definition at line 228 of file DQMRootSource.cc.

Constructor & Destructor Documentation

◆ TreeStringReader()

DQMTTreeIO::TreeStringReader::TreeStringReader ( MonitorElementData::Kind  kind,
MonitorElementData::Scope  rescope 
)
inline

Definition at line 230 of file DQMRootSource.cc.

References cms::cuda::assert(), DQMTTreeIO::TreeReaderBase::m_kind, and MonitorElementData::STRING.

230  : TreeReaderBase(kind, rescope) {
232  }
assert(be >=bs)
TreeReaderBase(MonitorElementData::Kind kind, MonitorElementData::Scope rescope)
MonitorElementData::Kind m_kind

Member Function Documentation

◆ read()

void DQMTTreeIO::TreeStringReader::read ( ULong64_t  iIndex,
DQMStore dqmstore,
int  run,
int  lumi 
)
inlineoverridevirtual

Implements DQMTTreeIO::TreeReaderBase.

Definition at line 234 of file DQMRootSource.cc.

References dqmPostProcessing_online::existing, dqm::implementation::DQMStore::findOrRecycle(), crabWrapper::key, MonitorElementData::key_, m_fullName, m_tree, m_value, DQMTTreeIO::TreeReaderBase::makeKey(), hlt_dqm_clientPB-live_cfg::me, eostools::move(), dqm::implementation::DQMStore::putME(), writedatasetfile::run, MonitorElementData::Value::scalar_, MonitorElementData::Scalar::str, and MonitorElementData::value_.

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

234  {
235  // This will populate the fields as defined in setTree method
236  m_tree->GetEntry(iIndex);
237 
238  auto key = makeKey(*m_fullName, run, lumi);
239  auto existing = dqmstore->findOrRecycle(key);
240 
241  if (existing) {
242  existing->Fill(*m_value);
243  } else {
244  // We make our own MEs here, to avoid a round-trip through the booking API.
245  MonitorElementData meData;
246  meData.key_ = key;
247  meData.value_.scalar_.str = *m_value;
248  auto me = new MonitorElement(std::move(meData));
249  dqmstore->putME(me);
250  }
251  }
MonitorElementData::Key makeKey(std::string const &fullname, int run, int lumi)
MonitorElement * findOrRecycle(MonitorElementData::Key const &)
Definition: DQMStore.cc:317
dqm::harvesting::MonitorElement MonitorElement
MonitorElement * putME(MonitorElement *me)
Definition: DQMStore.cc:148
def move(src, dest)
Definition: eostools.py:511

◆ setTree()

void DQMTTreeIO::TreeStringReader::setTree ( TTree *  iTree)
inlineoverridevirtual

Implements DQMTTreeIO::TreeReaderBase.

Definition at line 253 of file DQMRootSource.cc.

References kFlagBranch, kFullNameBranch, kValueBranch, m_fullName, m_tag, m_tree, and m_value.

253  {
254  m_tree = iTree;
255  m_tree->SetBranchAddress(kFullNameBranch, &m_fullName);
256  m_tree->SetBranchAddress(kFlagBranch, &m_tag);
257  m_tree->SetBranchAddress(kValueBranch, &m_value);
258  }
static const char *const kFullNameBranch
Definition: format.h:57
static const char *const kFlagBranch
Definition: format.h:58
static const char *const kValueBranch
Definition: format.h:59

Member Data Documentation

◆ m_fullName

std::string* DQMTTreeIO::TreeStringReader::m_fullName = nullptr
private

Definition at line 262 of file DQMRootSource.cc.

Referenced by read(), and setTree().

◆ m_tag

uint32_t DQMTTreeIO::TreeStringReader::m_tag = 0
private

Definition at line 264 of file DQMRootSource.cc.

Referenced by setTree().

◆ m_tree

TTree* DQMTTreeIO::TreeStringReader::m_tree = nullptr
private

Definition at line 261 of file DQMRootSource.cc.

Referenced by read(), and setTree().

◆ m_value

std::string* DQMTTreeIO::TreeStringReader::m_value = nullptr
private

Definition at line 263 of file DQMRootSource.cc.

Referenced by read(), and setTree().