Fork me on GitHub

Changeset dc883b4 in git for external


Ignore:
Timestamp:
Mar 4, 2021, 2:36:16 PM (4 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
master
Children:
4658ca4
Parents:
f9517a5
Message:

add info to TreeWriter

Location:
external/ExRootAnalysis
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • external/ExRootAnalysis/ExRootTreeReader.cc

    rf9517a5 rdc883b4  
    1212#include "TBranchElement.h"
    1313#include "TCanvas.h"
     14#include "TParameter.h"
    1415#include "TClonesArray.h"
    1516#include "TH2.h"
     
    119120//------------------------------------------------------------------------------
    120121
     122Double_t ExRootTreeReader::GetInfo(const char *name)
     123{
     124  TTree *tree = NULL;
     125  TParameter<Double_t> *param = NULL;
     126  Double_t result = -999.9;
     127  if(fChain) tree = fChain->GetTree();
     128  if(tree) param = static_cast<TParameter<Double_t> *>(tree->GetUserInfo()->FindObject(name));
     129  if(param) result = param->GetVal();
     130  return result;
     131}
     132
     133//------------------------------------------------------------------------------
     134
    121135Bool_t ExRootTreeReader::Notify()
    122136{
  • external/ExRootAnalysis/ExRootTreeReader.h

    rf9517a5 rdc883b4  
    2929
    3030  TClonesArray *UseBranch(const char *branchName);
     31  Double_t GetInfo(const char *name);
    3132
    3233private:
  • external/ExRootAnalysis/ExRootTreeWriter.cc

    rf9517a5 rdc883b4  
    1111#include "ExRootAnalysis/ExRootTreeBranch.h"
    1212
     13#include "TParameter.h"
    1314#include "TClonesArray.h"
    1415#include "TFile.h"
     
    4849  fBranches.insert(branch);
    4950  return branch;
     51}
     52
     53//------------------------------------------------------------------------------
     54
     55void ExRootTreeWriter::AddInfo(const char *name, Double_t value)
     56{
     57  if(!fTree) fTree = NewTree();
     58  fTree->GetUserInfo()->Add(new TParameter<Double_t>(name, value));
    5059}
    5160
  • external/ExRootAnalysis/ExRootTreeWriter.h

    rf9517a5 rdc883b4  
    2929
    3030  ExRootTreeBranch *NewBranch(const char *name, TClass *cl);
     31  void AddInfo(const char *name, Double_t value);
    3132
    3233  void Clear();
Note: See TracChangeset for help on using the changeset viewer.