CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 234 of file DQMRootSource.cc.

Constructor & Destructor Documentation

◆ TreeStringReader()

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

Definition at line 236 of file DQMRootSource.cc.

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

236  : TreeReaderBase(kind, rescope) {
238  }
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 240 of file DQMRootSource.cc.

References dqmPostProcessing_online::existing, dqm::implementation::DQMStore::findOrRecycle(), crabWrapper::key, MonitorElementData::key_, DQMTTreeIO::TreeObjectReader< T >::m_fullName, DQMTTreeIO::TreeObjectReader< T >::m_tree, 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().

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

◆ setTree()

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

Implements DQMTTreeIO::TreeReaderBase.

Definition at line 259 of file DQMRootSource.cc.

References kFlagBranch, kFullNameBranch, kValueBranch, DQMTTreeIO::TreeObjectReader< T >::m_fullName, DQMTTreeIO::TreeObjectReader< T >::m_tag, and DQMTTreeIO::TreeObjectReader< T >::m_tree.

259  {
260  m_tree = iTree;
261  m_tree->SetBranchAddress(kFullNameBranch, &m_fullName);
262  m_tree->SetBranchAddress(kFlagBranch, &m_tag);
263  m_tree->SetBranchAddress(kValueBranch, &m_value);
264  }
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 268 of file DQMRootSource.cc.

◆ m_tag

uint32_t DQMTTreeIO::TreeStringReader::m_tag = 0
private

Definition at line 270 of file DQMRootSource.cc.

◆ m_tree

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

Definition at line 267 of file DQMRootSource.cc.

◆ m_value

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

Definition at line 269 of file DQMRootSource.cc.