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 226 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 232 of file DQMRootSource.cc.

232  {
233  // This will populate the fields as defined in setTree method
234  m_tree->GetEntry(iIndex);
235 
236  auto key = makeKey(*m_fullName, run, lumi);
237  auto existing = dqmstore->findOrRecycle(key);
238 
239  if (existing) {
240  existing->Fill(*m_value);
241  } else {
242  // We make our own MEs here, to avoid a round-trip through the booking API.
243  MonitorElementData meData;
244  meData.key_ = key;
245  meData.value_.scalar_.str = *m_value;
246  auto me = new MonitorElement(std::move(meData));
247  dqmstore->putME(me);
248  }
249  }

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 251 of file DQMRootSource.cc.

251  {
252  m_tree = iTree;
253  m_tree->SetBranchAddress(kFullNameBranch, &m_fullName);
254  m_tree->SetBranchAddress(kFlagBranch, &m_tag);
255  m_tree->SetBranchAddress(kValueBranch, &m_value);
256  }

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 260 of file DQMRootSource.cc.

Referenced by read(), and setTree().

◆ m_tag

uint32_t DQMTTreeIO::TreeStringReader::m_tag = 0
private

Definition at line 262 of file DQMRootSource.cc.

Referenced by setTree().

◆ m_tree

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

Definition at line 259 of file DQMRootSource.cc.

Referenced by read(), and setTree().

◆ m_value

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

Definition at line 261 of file DQMRootSource.cc.

Referenced by read(), and setTree().

kValueBranch
static const char *const kValueBranch
Definition: format.h:55
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:155
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
DQMTTreeIO::TreeReaderBase::TreeReaderBase
TreeReaderBase(MonitorElementData::Kind kind, MonitorElementData::Scope rescope)
Definition: DQMRootSource.cc:151
CalibrationSummaryClient_cfi.kind
kind
Definition: CalibrationSummaryClient_cfi.py:37
DQMTTreeIO::TreeStringReader::m_tag
uint32_t m_tag
Definition: DQMRootSource.cc:262
DQMTTreeIO::TreeStringReader::m_tree
TTree * m_tree
Definition: DQMRootSource.cc:259
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:55
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:180
DQMTTreeIO::TreeStringReader::m_fullName
std::string * m_fullName
Definition: DQMRootSource.cc:260
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:261