CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DQMTTreeIO::TreeSimpleReader< T > Class Template Reference
Inheritance diagram for DQMTTreeIO::TreeSimpleReader< T >:
DQMTTreeIO::TreeReaderBase

Public Member Functions

void read (ULong64_t iIndex, DQMStore *dqmstore, int run, int lumi) override
 
void setTree (TTree *iTree) override
 
 TreeSimpleReader (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

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

Additional Inherited Members

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

Detailed Description

template<class T>
class DQMTTreeIO::TreeSimpleReader< T >

Definition at line 274 of file DQMRootSource.cc.

Constructor & Destructor Documentation

◆ TreeSimpleReader()

Member Function Documentation

◆ read()

template<class T >
void DQMTTreeIO::TreeSimpleReader< T >::read ( ULong64_t  iIndex,
DQMStore dqmstore,
int  run,
int  lumi 
)
inlineoverridevirtual

Implements DQMTTreeIO::TreeReaderBase.

Definition at line 280 of file DQMRootSource.cc.

References dqmPostProcessing_online::existing, dqm::implementation::DQMStore::findOrRecycle(), MonitorElementData::INT, submitPVResolutionJobs::key, MonitorElementData::key_, DQMTTreeIO::TreeObjectReader< T >::m_buffer, DQMTTreeIO::TreeObjectReader< T >::m_fullName, DQMTTreeIO::TreeReaderBase::m_kind, DQMTTreeIO::TreeObjectReader< T >::m_tree, DQMTTreeIO::TreeReaderBase::makeKey(), hlt_dqm_clientPB-live_cfg::me, eostools::move(), MonitorElementData::Scalar::num, dqm::implementation::DQMStore::putME(), MonitorElementData::Scalar::real, MonitorElementData::REAL, writedatasetfile::run, MonitorElementData::Value::scalar_, and MonitorElementData::value_.

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

280  {
281  // This will populate the fields as defined in setTree method
282  m_tree->GetEntry(iIndex);
283 
284  auto key = makeKey(*m_fullName, run, lumi);
285  auto existing = dqmstore->findOrRecycle(key);
286 
287  if (existing) {
288  existing->Fill(m_buffer);
289  } else {
290  // We make our own MEs here, to avoid a round-trip through the booking API.
291  MonitorElementData meData;
292  meData.key_ = key;
294  meData.value_.scalar_.num = m_buffer;
296  meData.value_.scalar_.real = m_buffer;
297  auto me = new MonitorElement(std::move(meData));
298  dqmstore->putME(me);
299  }
300  }
MonitorElementData::Key makeKey(std::string const &fullname, int run, int lumi)
MonitorElement * findOrRecycle(MonitorElementData::Key const &)
Definition: DQMStore.cc:349
key
prepare the HTCondor submission files and eventually submit them
dqm::harvesting::MonitorElement MonitorElement
MonitorElement * putME(MonitorElement *me)
Definition: DQMStore.cc:180
MonitorElementData::Kind m_kind
def move(src, dest)
Definition: eostools.py:511

◆ setTree()

template<class T >
void DQMTTreeIO::TreeSimpleReader< T >::setTree ( TTree *  iTree)
inlineoverridevirtual

Implements DQMTTreeIO::TreeReaderBase.

Definition at line 302 of file DQMRootSource.cc.

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

302  {
303  m_tree = iTree;
304  m_tree->SetBranchAddress(kFullNameBranch, &m_fullName);
305  m_tree->SetBranchAddress(kFlagBranch, &m_tag);
306  m_tree->SetBranchAddress(kValueBranch, &m_buffer);
307  }
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_buffer

template<class T >
T DQMTTreeIO::TreeSimpleReader< T >::m_buffer = 0
private

Definition at line 312 of file DQMRootSource.cc.

◆ m_fullName

template<class T >
std::string* DQMTTreeIO::TreeSimpleReader< T >::m_fullName = nullptr
private

Definition at line 311 of file DQMRootSource.cc.

◆ m_tag

template<class T >
uint32_t DQMTTreeIO::TreeSimpleReader< T >::m_tag = 0
private

Definition at line 313 of file DQMRootSource.cc.

◆ m_tree

template<class T >
TTree* DQMTTreeIO::TreeSimpleReader< T >::m_tree = nullptr
private

Definition at line 310 of file DQMRootSource.cc.