CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
DQMTTreeIO::TreeObjectReader< T > Class Template Reference
Inheritance diagram for DQMTTreeIO::TreeObjectReader< T >:
DQMTTreeIO::TreeReaderBase

Public Member Functions

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

Tm_buffer = nullptr
 
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::TreeObjectReader< T >

Definition at line 187 of file DQMRootSource.cc.

Constructor & Destructor Documentation

Member Function Documentation

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

Implements DQMTTreeIO::TreeReaderBase.

Definition at line 195 of file DQMRootSource.cc.

References dqmPostProcessing_online::existing, dqm::implementation::DQMStore::findOrRecycle(), submitPVResolutionJobs::key, MonitorElementData::key_, DQMTTreeIO::TreeObjectReader< T >::m_buffer, DQMTTreeIO::TreeObjectReader< T >::m_fullName, DQMTTreeIO::TreeObjectReader< T >::m_tree, DQMTTreeIO::TreeReaderBase::makeKey(), hlt_dqm_clientPB-live_cfg::me, DQMTTreeIO::DQMMergeHelper::mergeTogether(), eostools::move(), MonitorElementData::Value::object_, dqm::implementation::DQMStore::putME(), and MonitorElementData::value_.

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

195  {
196  // This will populate the fields as defined in setTree method
197  m_tree->GetEntry(iIndex);
198 
199  auto key = makeKey(*m_fullName, run, lumi);
200  auto existing = dqmstore->findOrRecycle(key);
201  if (existing) {
202  // TODO: make sure there is sufficient locking here.
204  } else {
205  // We make our own MEs here, to avoid a round-trip through the booking API.
206  MonitorElementData meData;
207  meData.key_ = key;
208  meData.value_.object_ = std::unique_ptr<T>((T*)(m_buffer->Clone()));
209  auto me = new MonitorElement(std::move(meData));
210  dqmstore->putME(me);
211  }
212  }
static void mergeTogether(TH1 *original, TH1 *toAdd)
edm::propagate_const< std::unique_ptr< TH1 > > object_
MonitorElementData::Key makeKey(std::string const &fullname, int run, int lumi)
MonitorElement * findOrRecycle(MonitorElementData::Key const &)
Definition: DQMStore.cc:317
def move
Definition: eostools.py:511
tuple key
prepare the HTCondor submission files and eventually submit them
list lumi
Definition: dqmdumpme.py:53
dqm::harvesting::MonitorElement MonitorElement
MonitorElement * putME(MonitorElement *me)
Definition: DQMStore.cc:148
long double T
template<class T >
void DQMTTreeIO::TreeObjectReader< T >::setTree ( TTree *  iTree)
inlineoverridevirtual

Implements DQMTTreeIO::TreeReaderBase.

Definition at line 214 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.

214  {
215  m_tree = iTree;
216  m_tree->SetBranchAddress(kFullNameBranch, &m_fullName);
217  m_tree->SetBranchAddress(kFlagBranch, &m_tag);
218  m_tree->SetBranchAddress(kValueBranch, &m_buffer);
219  }
static const char *const kFullNameBranch
Definition: format.h:53
static const char *const kFlagBranch
Definition: format.h:54
static const char *const kValueBranch
Definition: format.h:55

Member Data Documentation

template<class T >
T* DQMTTreeIO::TreeObjectReader< T >::m_buffer = nullptr
private
template<class T >
std::string* DQMTTreeIO::TreeObjectReader< T >::m_fullName = nullptr
private
template<class T >
uint32_t DQMTTreeIO::TreeObjectReader< T >::m_tag = 0
private

Definition at line 225 of file DQMRootSource.cc.

Referenced by DQMTTreeIO::TreeObjectReader< T >::setTree().

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