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

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.

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  }

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().

◆ setTree()

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

Implements DQMTTreeIO::TreeReaderBase.

Definition at line 253 of file DQMRootSource.cc.

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  }

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

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().

kValueBranch
static const char *const kValueBranch
Definition: format.h:55
dqm::implementation::DQMStore::findOrRecycle
MonitorElement * findOrRecycle(MonitorElementData::Key const &)
Definition: DQMStore.cc:317
MonitorElementData::Kind::STRING
dqmPostProcessing_online.existing
existing
Definition: dqmPostProcessing_online.py:126
cms::cuda::assert
assert(be >=bs)
kFullNameBranch
static const char *const kFullNameBranch
Definition: format.h:53
MonitorElementData::key_
Key key_
Definition: MonitorElementCollection.h:245
DQMTTreeIO::TreeReaderBase::makeKey
MonitorElementData::Key makeKey(std::string const &fullname, int run, int lumi)
Definition: DQMRootSource.cc:157
MonitorElementData::Value::scalar_
Scalar scalar_
Definition: MonitorElementCollection.h:157
MonitorElementData::value_
Value value_
Definition: MonitorElementCollection.h:246
kFlagBranch
static const char *const kFlagBranch
Definition: format.h:54
dqm::implementation::DQMStore::putME
MonitorElement * putME(MonitorElement *me)
Definition: DQMStore.cc:148
DQMTTreeIO::TreeReaderBase::TreeReaderBase
TreeReaderBase(MonitorElementData::Kind kind, MonitorElementData::Scope rescope)
Definition: DQMRootSource.cc:153
CalibrationSummaryClient_cfi.kind
kind
Definition: CalibrationSummaryClient_cfi.py:37
DQMTTreeIO::TreeStringReader::m_tag
uint32_t m_tag
Definition: DQMRootSource.cc:264
DQMTTreeIO::TreeStringReader::m_tree
TTree * m_tree
Definition: DQMRootSource.cc:261
eostools.move
def move(src, dest)
Definition: eostools.py:511
writedatasetfile.run
run
Definition: writedatasetfile.py:27
DQMTTreeIO::MonitorElement
dqm::harvesting::MonitorElement MonitorElement
Definition: DQMRootSource.cc:57
MonitorElementData::Scalar::str
std::string str
Definition: MonitorElementCollection.h:48
MonitorElementData
Definition: MonitorElementCollection.h:43
DQMTTreeIO::TreeReaderBase::m_kind
MonitorElementData::Kind m_kind
Definition: DQMRootSource.cc:182
DQMTTreeIO::TreeStringReader::m_fullName
std::string * m_fullName
Definition: DQMRootSource.cc:262
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
crabWrapper.key
key
Definition: crabWrapper.py:19
lumi
Definition: LumiSectionData.h:20
DQMTTreeIO::TreeStringReader::m_value
std::string * m_value
Definition: DQMRootSource.cc:263