Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
JRA_Histograms Class Reference

#include <JRunHistograms.hh>

Public Member Functions

 JRA_Histograms ()
 
 JRA_Histograms (JDetector &det)
 
void initialize_summary_histograms (JFrameIndexRange &range)
 
template<class T >
void initialize_timeslice_histograms (JFrameIndexRange &range)
 
void initialize_trigger_histograms (JFrameIndexRange &range)
 
template<class T >
void Write_histogram_table_to_file (TFile &f, string dirname, vector< vector< T * > > table)
 
template<class T >
void Write_histogram_table_to_file (TFile &f, string dirname, vector< T * > table)
 
template<class T , class V >
void Write_manager_to_file (TFile &f, string dirname, JManager< T, V > *table)
 
template<class T , class V >
void Replace_wildcard_in_name (JManager< T, V > *manager, char wc= '%')
 
template<class T , class V >
void Write_manager_in_key_dir (TFile &f, JManager< T, V > *manager)
 
template<class T , class V >
void Write_manager_table_in_key_dir (TFile &f, vector< JManager< T, V > * > table)
 
void Write_to_file (TFile &f)
 

Public Attributes

JDetector detector
 
SummaryHistograms h_summary
 
TimesliceHistograms h_timeslice
 
TriggerHistograms h_trigger
 
std::set< int > du_ids
 
int modules_per_string
 

Detailed Description

Definition at line 1368 of file JRunHistograms.hh.

Constructor & Destructor Documentation

JRA_Histograms::JRA_Histograms ( )
inline

Definition at line 1384 of file JRunHistograms.hh.

1384 {}
JRA_Histograms::JRA_Histograms ( JDetector det)
inline

Definition at line 1386 of file JRunHistograms.hh.

1386  {
1387 
1388  detector = det ;
1389 
1391 
1393 
1395 
1397 
1399 
1400  }
std::set< int > du_ids
int getNumberOfStrings(const JDetector &detector)
Get number of strings.
std::set< int > getStringIDs(const JDetector &detector)
Get list of strings IDs.
TimesliceHistograms h_timeslice
Detector file.
Definition: JHead.hh:126
TriggerHistograms h_trigger
SummaryHistograms h_summary
int getNumberOfModules(const JDetector &detector)
Get number of modules.

Member Function Documentation

void JRA_Histograms::initialize_summary_histograms ( JFrameIndexRange range)
inline

Definition at line 1407 of file JRunHistograms.hh.

1407  {
1408 
1410 
1411  }
std::set< int > du_ids
void initialize(std::set< int > &du_ids, int modules_per_string, JFrameIndexRange &frame_index_range)
SummaryHistograms h_summary
template<class T >
void JRA_Histograms::initialize_timeslice_histograms ( JFrameIndexRange range)
inline

Definition at line 1419 of file JRunHistograms.hh.

1419  {
1420 
1421  const int index = JIndexOf<JDAQTimesliceTypes_t , T>::value ;
1422 
1423  const string prefix = "KM3NETDAQ::JDAQ" ;
1424 
1425  string ts_name = T::Class_Name() ;
1426 
1427  string::size_type pos = ts_name.find(prefix);
1428 
1429  if (pos != string::npos) ts_name.replace(ts_name.find(prefix) , prefix.length() , "") ;
1430 
1431  h_timeslice.initialize(du_ids , modules_per_string , range , index , ts_name) ;
1432 
1433  }
std::set< int > du_ids
TimesliceHistograms h_timeslice
Indexing of data type in type list.
Definition: JTypeList.hh:310
void initialize(std::set< int > du_ids, int modules_per_string, JFrameIndexRange &frame_index_range, int ts_type, std::string ts_name)
void JRA_Histograms::initialize_trigger_histograms ( JFrameIndexRange range)
inline

Definition at line 1438 of file JRunHistograms.hh.

1438  {
1439 
1441 
1442  }
std::set< int > du_ids
void initialize(std::set< int > &du_ids, JFrameIndexRange &frame_index_range, int modules_per_string)
TriggerHistograms h_trigger
template<class T >
void JRA_Histograms::Write_histogram_table_to_file ( TFile &  f,
string  dirname,
vector< vector< T * > >  table 
)
inline

Definition at line 1452 of file JRunHistograms.hh.

1452  {
1453 
1454  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str()) ;
1455 
1456  f.cd (dirname.c_str()) ;
1457 
1458  for (int i=0 ; i < (int)table.size() ; i++){
1459 
1460  for (int j=0 ; j< (int)table[i].size() ; j++){
1461 
1462  if (table[i][j]) table [i][j] -> Write() ;
1463 
1464  }
1465 
1466  }
1467 
1468  }
template<class T >
void JRA_Histograms::Write_histogram_table_to_file ( TFile &  f,
string  dirname,
vector< T * >  table 
)
inline

Definition at line 1478 of file JRunHistograms.hh.

1478  {
1479 
1480  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str()) ;
1481 
1482  f.cd (dirname.c_str()) ;
1483 
1484  for (int i=0 ; i < (int)table.size() ; i++){
1485 
1486  if (table[i]) table[i] -> Write() ;
1487 
1488  }
1489 
1490  }
template<class T , class V >
void JRA_Histograms::Write_manager_to_file ( TFile &  f,
string  dirname,
JManager< T, V > *  table 
)
inline

Definition at line 1500 of file JRunHistograms.hh.

1500  {
1501 
1502  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str()) ;
1503 
1504  f.cd (dirname.c_str()) ;
1505 
1506  for (typename JManager < T , V >::const_iterator i = table -> begin() ; i != table -> end() ; ++i){
1507 
1508  i -> second -> Write() ;
1509 
1510  }
1511 
1512  }
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:38
template<class T , class V >
void JRA_Histograms::Replace_wildcard_in_name ( JManager< T, V > *  manager,
char  wc = '%' 
)
inline

Definition at line 1520 of file JRunHistograms.hh.

1520  {
1521 
1522  for (typename JManager < T , V >::const_iterator i = manager -> begin() ; i != manager -> end() ; ++i){
1523 
1524  if (i -> second -> GetTitle()){
1525 
1526  std::string buffer = i -> second -> GetTitle() ;
1527 
1528  string::size_type ipos = buffer.find(wc) ;
1529 
1530  if (ipos!=std::string::npos){
1531 
1532  ostringstream os;
1533 
1534  os << i -> first ;
1535 
1536  buffer.replace(ipos, 1, os.str());
1537 
1538  i -> second -> SetTitle(buffer.c_str()) ;
1539 
1540  }
1541 
1542  }
1543 
1544  }
1545 
1546  }
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:38
template<class T , class V >
void JRA_Histograms::Write_manager_in_key_dir ( TFile &  f,
JManager< T, V > *  manager 
)
inline

Definition at line 1554 of file JRunHistograms.hh.

1554  {
1555 
1556  for (typename JManager < T , V >::const_iterator i = manager -> begin() ; i != manager -> end() ; ++i){
1557 
1558  std::string fullpath = MAKE_STRING(i-> second -> GetName()) ;
1559 
1560  int pos = fullpath.rfind ('/');
1561 
1562  std::string name = fullpath.substr (pos + 1) ;
1563 
1564  std::string path = fullpath.substr (0 , pos) ;
1565 
1566  if (f.GetDirectory(path.c_str()) == 0) f.mkdir (path.c_str()) ;
1567 
1568  f.cd(path.c_str()) ;
1569 
1570  i -> second -> SetName(name.c_str()) ;
1571 
1572  i -> second -> Write() ;
1573 
1574  }
1575 
1576  }
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:602
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:38
template<class T , class V >
void JRA_Histograms::Write_manager_table_in_key_dir ( TFile &  f,
vector< JManager< T, V > * >  table 
)
inline

Definition at line 1584 of file JRunHistograms.hh.

1584  {
1585 
1586  for (typename vector < JManager < T , V >* >::const_iterator i = table.begin() ; i != table.end() ; ++i){
1587 
1588  if ((*i)){
1589 
1590  for (typename JManager < T , V >::const_iterator j = (*i) -> begin() ; j != (*i) -> end() ; ++j){
1591 
1592  std::string fullpath = MAKE_STRING(j-> second -> GetName()) ;
1593 
1594  int pos = fullpath.rfind ('/');
1595 
1596  std::string name = fullpath.substr (pos + 1) ;
1597 
1598  std::string path = fullpath.substr (0 , pos) ;
1599 
1600  if (f.GetDirectory(path.c_str()) == 0) f.mkdir (path.c_str()) ;
1601 
1602  f.cd(path.c_str()) ;
1603 
1604  j -> second -> SetName(name.c_str()) ;
1605 
1606  j -> second -> Write() ;
1607 
1608  }
1609 
1610  }
1611 
1612  }
1613 
1614  }
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:602
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:38
void JRA_Histograms::Write_to_file ( TFile &  f)
inline

Definition at line 1620 of file JRunHistograms.hh.

1620  {
1621 
1622  f.mkdir("Detector") ;
1623 
1624  f.cd("Detector") ;
1625 
1626  if (h_summary.h_fifo) h_summary.h_fifo -> Write() ;
1627 
1628  if (h_summary.h_daq_status) h_summary.h_daq_status -> Write() ;
1629 
1630  if (h_summary.h_hrv) h_summary.h_hrv -> Write() ;
1631 
1633 
1635 
1637 
1639 
1641 
1642  Write_histogram_table_to_file(f , MAKE_STRING("Detector/ToT_255_vs_time") , h_timeslice.h_ToT_255_vs_time) ;
1643 
1644  Write_histogram_table_to_file(f , MAKE_STRING("Detector/ToT_255_Floor_vs_time") , h_timeslice.h_ToT_255_Floor_vs_time) ;
1645 
1646  Write_histogram_table_to_file(f , MAKE_STRING("Detector/ToT_255_Floor_vs_time") , h_timeslice.h_ToT_255_Floor_vs_time_2) ;
1647 
1648  Write_histogram_table_to_file(f , MAKE_STRING("Detector/slice_start_time") , h_timeslice.h_slice_start_time) ;
1649 
1651 
1652  Write_histogram_table_to_file(f , MAKE_STRING("Detector/Active_modules_detector") , h_timeslice.h_active_modules) ;
1653 
1654  Write_histogram_table_to_file(f , MAKE_STRING("Detector/Active_modules_du") , h_timeslice.h_du_active_modules) ;
1655 
1656  Write_histogram_table_to_file(f , MAKE_STRING("Detector/DOM_mean_rates") , h_timeslice.h_dom_mean_rates) ;
1657 
1659 
1661 
1663 
1665 
1667 
1669 
1671 
1673 
1675 
1677 
1679 
1681 
1683 
1685 
1687 
1689 
1690  f.mkdir ( MAKE_STRING ("JDAQEvent").c_str() ) ;
1691 
1692  f.cd ("JDAQEvent") ;
1693 
1695 
1697 
1698  f.mkdir ( MAKE_STRING ("JDAQEvent/hits_per_event").c_str() ) ;
1699 
1700  f.cd ("JDAQEvent/hits_per_event") ;
1701 
1703 
1705 
1706  f.mkdir ( MAKE_STRING ("JDAQEvent/hits_pmt_distributions").c_str() ) ;
1707 
1708  f.cd ("JDAQEvent/hits_pmt_distributions") ;
1709 
1711 
1713 
1714  f.mkdir ( MAKE_STRING ("JDAQEvent/hits_tot_distributions").c_str() ) ;
1715 
1716  f.cd ("JDAQEvent/hits_tot_distributions") ;
1717 
1719 
1721 
1722  f.mkdir ( MAKE_STRING ("JDAQEvent/trigger_rates").c_str() ) ;
1723 
1724  f.cd ("JDAQEvent/trigger_rates") ;
1725 
1726  if (h_trigger.m_trigger_rates){
1727 
1729 
1730  i -> second -> Scale (1./(i->second->GetBinWidth(1) * getFrameTime() * 1e-9) ) ;
1731 
1732  i -> second -> Write() ;
1733 
1734  }
1735 
1736  }
1737 
1738  f.cd ("JDAQEvent") ;
1739 
1740  //if (h_trigger.h_Trigger_map) { h_trigger.h_Trigger_map -> Write() ; }
1741 
1743 
1745 
1747 
1749 
1750  }
TH1D * h_pmt_distribution_snapshot_hits
TH1D * h_n_triggered_hits_distribution
vector< JManager< string, TH2D > * > m_ToT_255
TH2D * h_Snapshot_hits_per_module
JManager< string, TProfile2D > * m_hrv
TH1D * h_pmt_distribution_triggered_hits
vector< JManager< string, TH2D > * > m_pmt_tot_distributions
vector< TH2D * > h_dom_mean_rates
JManager< string, TProfile2D > * m_summary_rate_vs_time
TH2D * h_Triggered_hits_per_module
JManager< string, TH1D > * m_trigger_rates
JManager< string, TProfile > * m_module_rates_vs_time
vector< TH2D * > h_ToT_255_Floor_vs_time_2
JManager< string, TH2D > * m_mean_summary_rate
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:602
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:38
TimesliceHistograms h_timeslice
TH1D * h_tot_distribution_snapshot_hits
vector< JManager< string, TProfile2D > * > m_pmt_rates_vs_time
TriggerHistograms h_trigger
vector< TProfile2D * > h_du_active_modules
double getFrameTime()
Get frame time duration.
Definition: JDAQClock.hh:162
void Write_manager_table_in_key_dir(TFile &f, vector< JManager< T, V > * > table)
TH1D * h_pmt_rate_distribution
void Write_histogram_table_to_file(TFile &f, string dirname, vector< vector< T * > > table)
vector< JManager< string, TProfile2D > * > m_pmt_tot_vs_time
void normalize(T *h, double n=1.0)
SummaryHistograms h_summary
vector< TH2D * > h_ToT_255_Floor_vs_time
vector< TProfile * > h_active_modules
JManager< string, TH2D > * m_summary_rate_distribution
void Write_manager_in_key_dir(TFile &f, JManager< T, V > *manager)
vector< JManager< string, TH2D > * > m_mean_ToT
vector< JManager< string, TH2D > * > m_pmt_rate_distributions
vector< JManager< string, TH2D > * > m_pmt_dt_consecutive_hits
TH1D * h_tot_distribution_triggered_hits
vector< TH1D * > h_slice_start_time
vector< JManager< string, TProfile > * > m_module_rates_vs_time
vector< TH1D * > h_ToT_255_vs_time
JManager< string, TH2D > * m_Trigger_map
vector< TProfile * > h_rate
JManager< string, TProfile2D > * m_fifo_full
JManager< string, TH2D > * m_Snapshot_hits_per_pmt

Member Data Documentation

JDetector JRA_Histograms::detector

Definition at line 1372 of file JRunHistograms.hh.

SummaryHistograms JRA_Histograms::h_summary

Definition at line 1374 of file JRunHistograms.hh.

TimesliceHistograms JRA_Histograms::h_timeslice

Definition at line 1376 of file JRunHistograms.hh.

TriggerHistograms JRA_Histograms::h_trigger

Definition at line 1378 of file JRunHistograms.hh.

std::set<int> JRA_Histograms::du_ids

Definition at line 1380 of file JRunHistograms.hh.

int JRA_Histograms::modules_per_string

Definition at line 1382 of file JRunHistograms.hh.


The documentation for this class was generated from the following file: