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 (const JDetector &detector)
 
void initialize_summary_histograms ()
 
template<class T >
void initialize_timeslice_histograms ()
 
void initialize_trigger_histograms ()
 
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

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

Detailed Description

Definition at line 740 of file JRunHistograms.hh.

Constructor & Destructor Documentation

JRA_Histograms::JRA_Histograms ( )
inline

Definition at line 750 of file JRunHistograms.hh.

750 {}
JRA_Histograms::JRA_Histograms ( const JDetector detector)
inline

Definition at line 752 of file JRunHistograms.hh.

752  {
753 
754  du_ids = getStringIDs(detector);
759  }
std::set< int > du_ids
std::set< int > getStringIDs(const JDetector &detector)
Get list of strings IDs.
TimesliceHistograms h_timeslice
TriggerHistograms h_trigger
static const JStringCounter getNumberOfStrings
Function object to count unique strings.
SummaryHistograms h_summary
int getNumberOfModules(const JDetector &detector)
Get number of modules.

Member Function Documentation

void JRA_Histograms::initialize_summary_histograms ( )
inline

Definition at line 766 of file JRunHistograms.hh.

766  {
767 
769 
770  }
std::set< int > du_ids
void initialize(std::set< int > &du_ids, int modules_per_string)
SummaryHistograms h_summary
template<class T >
void JRA_Histograms::initialize_timeslice_histograms ( )
inline

Definition at line 778 of file JRunHistograms.hh.

778  {
779 
781  const string prefix = "KM3NETDAQ::JDAQ" ;
782  string ts_name = T::Class_Name();
783  string::size_type pos = ts_name.find(prefix);
784 
785  if (pos != string::npos) ts_name.replace(ts_name.find(prefix) , prefix.length() , "");
786 
787  h_timeslice.initialize(du_ids , modules_per_string , index , ts_name);
788  }
std::set< int > du_ids
TimesliceHistograms h_timeslice
void initialize(std::set< int > du_ids, int modules_per_string, int ts_type, std::string ts_name)
Indexing of data type in type list.
Definition: JTypeList.hh:310
void JRA_Histograms::initialize_trigger_histograms ( )
inline

Definition at line 793 of file JRunHistograms.hh.

793  {
794 
796  }
std::set< int > du_ids
void initialize(std::set< int > &du_ids, 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 806 of file JRunHistograms.hh.

806  {
807 
808  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str());
809 
810  f.cd (dirname.c_str());
811 
812  for (int i=0 ; i < (int)table.size(); i++){
813 
814  for (int j=0 ; j< (int)table[i].size(); j++){
815 
816  if (table[i][j]) table [i][j] -> Write();
817  }
818  }
819  }
then JPizza f
Definition: JPizza.sh:46
int j
Definition: JPolint.hh:634
template<class T >
void JRA_Histograms::Write_histogram_table_to_file ( TFile &  f,
string  dirname,
vector< T * >  table 
)
inline

Definition at line 829 of file JRunHistograms.hh.

829  {
830 
831  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str());
832 
833  f.cd (dirname.c_str());
834 
835  for (int i=0 ; i < (int)table.size(); i++){
836 
837  if (table[i]) table[i] -> Write();
838  }
839  }
then JPizza f
Definition: JPizza.sh:46
template<class T , class V >
void JRA_Histograms::Write_manager_to_file ( TFile &  f,
string  dirname,
JManager< T, V > *  table 
)
inline

Definition at line 849 of file JRunHistograms.hh.

849  {
850 
851  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str());
852 
853  f.cd (dirname.c_str());
854 
855  for (typename JManager < T , V >::const_iterator i = table -> begin() ; i != table -> end() ; ++i){
856 
857  i -> second -> Write();
858  }
859  }
then JPizza f
Definition: JPizza.sh:46
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:42
template<class T , class V >
void JRA_Histograms::Replace_wildcard_in_name ( JManager< T, V > *  manager,
char  wc = '%' 
)
inline

Definition at line 867 of file JRunHistograms.hh.

867  {
868 
869  for (typename JManager < T , V >::const_iterator i = manager -> begin() ; i != manager -> end() ; ++i){
870 
871  if (i -> second -> GetTitle()){
872 
873  std::string buffer = i -> second -> GetTitle();
874  string::size_type ipos = buffer.find(wc);
875 
876  if (ipos!=std::string::npos){
877 
878  ostringstream os;
879 
880  os << i -> first ;
881 
882  buffer.replace(ipos, 1, os.str());
883 
884  i -> second -> SetTitle(buffer.c_str());
885  }
886  }
887  }
888  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:42
template<class T , class V >
void JRA_Histograms::Write_manager_in_key_dir ( TFile &  f,
JManager< T, V > *  manager 
)
inline

Definition at line 896 of file JRunHistograms.hh.

896  {
897 
898  for (typename JManager < T , V >::const_iterator i = manager -> begin() ; i != manager -> end() ; ++i){
899 
900  std::string fullpath = MAKE_STRING(i->second->GetName());
901 
902  int pos = fullpath.rfind ('/');
903  std::string name = fullpath.substr (pos + 1);
904  std::string path = fullpath.substr (0 , pos);
905 
906  if (f.GetDirectory(path.c_str()) == 0) f.mkdir (path.c_str());
907 
908  f.cd(path.c_str());
909 
910  i -> second -> SetName(name.c_str());
911  i -> second -> Write();
912  }
913  }
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:699
then JPizza f
Definition: JPizza.sh:46
do cat driver txt<< EOFevent ev_configure{RC_EVT%< ev_configure.txt > RC_DWRT path
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:42
then echo n User name
Definition: JCookie.sh:45
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 921 of file JRunHistograms.hh.

921  {
922 
923  for (typename vector < JManager < T , V >* >::const_iterator i = table.begin() ; i != table.end() ; ++i){
924 
925  if ((*i)){
926 
927  for (typename JManager < T , V >::const_iterator j = (*i) -> begin() ; j != (*i) -> end() ; ++j){
928 
929  std::string fullpath = MAKE_STRING(j-> second -> GetName());
930 
931  int pos = fullpath.rfind ('/');
932  std::string name = fullpath.substr (pos + 1);
933  std::string path = fullpath.substr (0 , pos);
934 
935  if (f.GetDirectory(path.c_str()) == 0) f.mkdir (path.c_str());
936 
937  f.cd(path.c_str());
938 
939  j -> second -> SetName(name.c_str());
940  j -> second -> Write();
941  }
942  }
943  }
944  }
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:699
then JPizza f
Definition: JPizza.sh:46
do cat driver txt<< EOFevent ev_configure{RC_EVT%< ev_configure.txt > RC_DWRT path
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:42
then echo n User name
Definition: JCookie.sh:45
int j
Definition: JPolint.hh:634
void JRA_Histograms::Write_to_file ( TFile &  f)
inline

Definition at line 950 of file JRunHistograms.hh.

950  {
951 
952  f.mkdir("Detector");
953  f .cd("Detector");
954 
961 
963 
964  for (typename vector < JManager < string , TH2D >* >::const_iterator i = h_timeslice.m_pmt_tot_distributions.begin() ; i != h_timeslice.m_pmt_tot_distributions.end() ; ++i){
965 
966  if ((*i)){
967 
968  for (typename JManager < string , TH2D >::const_iterator j = (*i) -> begin() ; j != (*i) -> end() ; ++j){
969 
970  for(int k=1 ; k < j -> second -> GetNbinsX() ; ++k){
971 
972  for(int t=1 ; t < j -> second -> GetNbinsY() ; ++t){
973 
974  double width = j -> second -> GetYaxis() -> GetBinWidth(t);
975 
976  j -> second -> SetBinContent(k,t,j -> second -> GetBinContent(k,t) / width);
977  j -> second -> SetBinError(k,t,j -> second -> GetBinError(k,t) / width);
978  }
979  }
980  }
981  }
982  }
983 
987 
990 
992 
995 
996  f.mkdir ( MAKE_STRING ("JDAQEvent").c_str());
997  f.cd ("JDAQEvent");
998 
1002 
1003  f.mkdir (MAKE_STRING ("JDAQEvent/hits_per_event").c_str());
1004  f.cd ("JDAQEvent/hits_per_event");
1005 
1009 
1010  f.mkdir ( MAKE_STRING ("JDAQEvent/hits_pmt_distributions").c_str());
1011  f.cd ("JDAQEvent/hits_pmt_distributions");
1012 
1015 
1016  f.mkdir ( MAKE_STRING ("JDAQEvent/hits_tot_distributions").c_str());
1017  f.cd ("JDAQEvent/hits_tot_distributions");
1018 
1021 
1022  f.cd ("JDAQEvent");
1023 
1026 
1028  }
*fatal Wrong number of arguments esac JCookie sh JRuns D $DETECTOR d sort n k
Definition: JRunrange.sh:16
TH1D * h_pmt_distribution_snapshot_hits
TH2D * h_Snapshot_hits_per_module
TH1D * h_pmt_distribution_triggered_hits
vector< JManager< string, TH2D > * > m_pmt_tot_distributions
JManager< string, TH1D > * m_mean_summary_rate_distribution
vector< TH2D * > h_dom_mean_rates
TH2D * h_Triggered_hits_per_module
JManager< string, TH2D > * m_mean_summary_rate
TH1D * h_dom_rate_distribution
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:699
then JPizza f
Definition: JPizza.sh:46
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:42
TimesliceHistograms h_timeslice
TH1D * h_tot_distribution_snapshot_hits
TriggerHistograms h_trigger
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, TH1D > * > m_mean_ToT_distribution
SummaryHistograms h_summary
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
TH1D * h_tot_distribution_triggered_hits
void normalizeBW1D(TH1D *h)
int j
Definition: JPolint.hh:634
JManager< string, TH2D > * m_Snapshot_hits_per_pmt

Member Data Documentation

SummaryHistograms JRA_Histograms::h_summary

Definition at line 744 of file JRunHistograms.hh.

TimesliceHistograms JRA_Histograms::h_timeslice

Definition at line 745 of file JRunHistograms.hh.

TriggerHistograms JRA_Histograms::h_trigger

Definition at line 746 of file JRunHistograms.hh.

std::set<int> JRA_Histograms::du_ids

Definition at line 747 of file JRunHistograms.hh.

int JRA_Histograms::modules_per_string

Definition at line 748 of file JRunHistograms.hh.


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