Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
reference Class Reference
Collaboration diagram for reference:

Public Member Functions

 reference (const std::string &n, const std::string &f)
 
 reference (const reference &r)
 
const std::string & name () const
 
const std::string & file () const
 
int run () const
 

Private Attributes

std::string m_name
 
std::string m_file
 
int m_run
 

Detailed Description

Definition at line 437 of file hcg.cxx.

Constructor & Destructor Documentation

◆ reference() [1/2]

reference::reference ( const std::string &  n,
const std::string &  f 
)
inline

oh dear, find the run number from the specified file

go through sub directories

Definition at line 441 of file hcg.cxx.

441  :
442  m_name(n), m_file(f) {
443 
445 
446  std::cerr << "opening file " << f << std::endl;
447 
448  TFile* r = TFile::Open(f.c_str());
449  if ( r==0 ) {
450  std::cerr << "cannot open root file " << f << std::endl;
451  std::exit(-1);
452  }
453 
454  r->cd();
455 
456  TList* tl = gDirectory->GetListOfKeys();
457 
459 
460  for ( int i=0 ; i<tl->GetSize() ; i++ ) {
461 
462  TKey* tobj = (TKey*)tl->At(i);
463 
464  if ( std::string(tobj->GetClassName()).find("TDirectory")!=std::string::npos ) {
465  // (*outp) << ns << "Directory " << tobj->GetName() << std::endl;
466 
467  TDirectory* tnd = (TDirectory*)tobj->ReadObj();
468 
469  std::string dir = tnd->GetName();
470 
471  if ( contains( dir, "run_" ) ) {
472  dir.erase( 0, std::string( "run_").size() );
473  m_run = std::atoi( dir.c_str() );
474 
475  break;
476  }
477 
478  }
479  }
480 
481  r->Close();
482  }

◆ reference() [2/2]

reference::reference ( const reference r)
inline

Definition at line 485 of file hcg.cxx.

485 : m_name(r.m_name), m_file(r.m_file), m_run(r.m_run) { }

Member Function Documentation

◆ file()

const std::string& reference::file ( ) const
inline

Definition at line 489 of file hcg.cxx.

489 { return m_file; }

◆ name()

const std::string& reference::name ( ) const
inline

Definition at line 488 of file hcg.cxx.

488 { return m_name; }

◆ run()

int reference::run ( ) const
inline

Definition at line 491 of file hcg.cxx.

491 { return m_run; }

Member Data Documentation

◆ m_file

std::string reference::m_file
private

Definition at line 496 of file hcg.cxx.

◆ m_name

std::string reference::m_name
private

Definition at line 495 of file hcg.cxx.

◆ m_run

int reference::m_run
private

Definition at line 498 of file hcg.cxx.


The documentation for this class was generated from the following file:
beamspotman.r
def r
Definition: beamspotman.py:676
reference::m_file
std::string m_file
Definition: hcg.cxx:496
reference::m_name
std::string m_name
Definition: hcg.cxx:495
reference::m_run
int m_run
Definition: hcg.cxx:498
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
contains
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition: hcg.cxx:111
hist_file_dump.f
f
Definition: hist_file_dump.py:141
calibdata.exit
exit
Definition: calibdata.py:236
beamspotman.dir
string dir
Definition: beamspotman.py:623
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73