Jpp  15.0.1-rc.2-highQE
the software that should make you happy
 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 742 of file JRunHistograms.hh.

Constructor & Destructor Documentation

JRA_Histograms::JRA_Histograms ( )
inline

Definition at line 752 of file JRunHistograms.hh.

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

Definition at line 754 of file JRunHistograms.hh.

754  {
755 
756  du_ids = getStringIDs(detector);
761  }
std::set< int > du_ids
std::set< int > getStringIDs(const JDetector &detector)
Get list of strings identifiers.
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 768 of file JRunHistograms.hh.

768  {
769 
771 
772  }
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 780 of file JRunHistograms.hh.

780  {
781 
783  const string prefix = "KM3NETDAQ::JDAQ" ;
784  string ts_name = T::Class_Name();
785  string::size_type pos = ts_name.find(prefix);
786 
787  if (pos != string::npos) ts_name.replace(ts_name.find(prefix) , prefix.length() , "");
788 
789  h_timeslice.initialize(du_ids , modules_per_string , index , ts_name);
790  }
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 795 of file JRunHistograms.hh.

795  {
796 
798  }
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 808 of file JRunHistograms.hh.

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

Definition at line 831 of file JRunHistograms.hh.

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

Definition at line 851 of file JRunHistograms.hh.

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

Definition at line 869 of file JRunHistograms.hh.

869  {
870 
871  for (typename JManager < T , V >::const_iterator i = manager -> begin() ; i != manager -> end() ; ++i){
872 
873  if (i -> second -> GetTitle()){
874 
875  std::string buffer = i -> second -> GetTitle();
876  string::size_type ipos = buffer.find(wc);
877 
878  if (ipos!=std::string::npos){
879 
880  ostringstream os;
881 
882  os << i -> first ;
883 
884  buffer.replace(ipos, 1, os.str());
885 
886  i -> second -> SetTitle(buffer.c_str());
887  }
888  }
889  }
890  }
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. histograms) using unique keys...
Definition: JManager.hh:43
template<class T , class V >
void JRA_Histograms::Write_manager_in_key_dir ( TFile &  f,
JManager< T, V > *  manager 
)
inline

Definition at line 898 of file JRunHistograms.hh.

898  {
899 
900  for (typename JManager < T , V >::const_iterator i = manager -> begin() ; i != manager -> end() ; ++i){
901 
902  std::string fullpath = MAKE_STRING(i->second->GetName());
903 
904  int pos = fullpath.rfind ('/');
905  std::string name = fullpath.substr (pos + 1);
906  std::string path = fullpath.substr (0 , pos);
907 
908  if (f.GetDirectory(path.c_str()) == 0) f.mkdir (path.c_str());
909 
910  f.cd(path.c_str());
911 
912  i -> second -> SetName(name.c_str());
913  i -> second -> Write();
914  }
915  }
then JMuonPostfit f
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:142
$WORKDIR driver txt done cat $WORKDIR driver txt<< EOFprocess ${DATAFILTER}$FILTER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&JDataFilter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAFILTER}-P $PORT</dev/null > &/dev/null)&';process ${DATAWRITER}$WRITER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&JDataWriter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAWRITER}</dev/null > &/dev/null)&';print enterevent ev_init{RC_CMD}event ev_reset{RC_CMD}event ev_init{RC_CMD}event ev_configure{RC_DFLTR%<$WORKDIR/ev_configure_datafilter.txt > RC_DOM<$WORKDIR/ev_configure_domsimulator.txt > RC_DWRT path
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Definition: JManager.hh:43
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 923 of file JRunHistograms.hh.

923  {
924 
925  for (typename vector < JManager < T , V >* >::const_iterator i = table.begin() ; i != table.end() ; ++i){
926 
927  if ((*i)){
928 
929  for (typename JManager < T , V >::const_iterator j = (*i) -> begin() ; j != (*i) -> end() ; ++j){
930 
931  std::string fullpath = MAKE_STRING(j-> second -> GetName());
932 
933  int pos = fullpath.rfind ('/');
934  std::string name = fullpath.substr (pos + 1);
935  std::string path = fullpath.substr (0 , pos);
936 
937  if (f.GetDirectory(path.c_str()) == 0) f.mkdir (path.c_str());
938 
939  f.cd(path.c_str());
940 
941  j -> second -> SetName(name.c_str());
942  j -> second -> Write();
943  }
944  }
945  }
946  }
then JMuonPostfit f
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:142
$WORKDIR driver txt done cat $WORKDIR driver txt<< EOFprocess ${DATAFILTER}$FILTER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&JDataFilter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAFILTER}-P $PORT</dev/null > &/dev/null)&';process ${DATAWRITER}$WRITER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&JDataWriter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAWRITER}</dev/null > &/dev/null)&';print enterevent ev_init{RC_CMD}event ev_reset{RC_CMD}event ev_init{RC_CMD}event ev_configure{RC_DFLTR%<$WORKDIR/ev_configure_datafilter.txt > RC_DOM<$WORKDIR/ev_configure_domsimulator.txt > RC_DWRT path
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Definition: JManager.hh:43
int j
Definition: JPolint.hh:666
void JRA_Histograms::Write_to_file ( TFile &  f)
inline

Definition at line 952 of file JRunHistograms.hh.

952  {
953 
954  f.mkdir("Detector");
955  f .cd("Detector");
956 
963 
965 
966  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){
967 
968  if ((*i)){
969 
970  for (typename JManager < string , TH2D >::const_iterator j = (*i) -> begin() ; j != (*i) -> end() ; ++j){
971 
972  for(int k=1 ; k < j -> second -> GetNbinsX() ; ++k){
973 
974  for(int t=1 ; t < j -> second -> GetNbinsY() ; ++t){
975 
976  double width = j -> second -> GetYaxis() -> GetBinWidth(t);
977 
978  j -> second -> SetBinContent(k,t,j -> second -> GetBinContent(k,t) / width);
979  j -> second -> SetBinError(k,t,j -> second -> GetBinError(k,t) / width);
980  }
981  }
982  }
983  }
984  }
985 
989 
992 
994 
997 
998  f.mkdir ( MAKE_STRING ("JDAQEvent").c_str());
999  f.cd ("JDAQEvent");
1000 
1004 
1005  f.mkdir (MAKE_STRING ("JDAQEvent/hits_per_event").c_str());
1006  f.cd ("JDAQEvent/hits_per_event");
1007 
1011 
1012  f.mkdir ( MAKE_STRING ("JDAQEvent/hits_pmt_distributions").c_str());
1013  f.cd ("JDAQEvent/hits_pmt_distributions");
1014 
1017 
1018  f.mkdir ( MAKE_STRING ("JDAQEvent/hits_tot_distributions").c_str());
1019  f.cd ("JDAQEvent/hits_tot_distributions");
1020 
1023 
1024  f.cd ("JDAQEvent");
1025 
1028 
1030  }
TH1D * h_pmt_distribution_snapshot_hits
TH2D * h_Snapshot_hits_per_module
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
TH1D * h_pmt_distribution_triggered_hits
vector< JManager< string, TH2D > * > m_pmt_tot_distributions
JManager< string, TH1D > * m_mean_summary_rate_distribution
then JMuonPostfit f
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:142
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
Definition: JManager.hh:43
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:666
JManager< string, TH2D > * m_Snapshot_hits_per_pmt

Member Data Documentation

SummaryHistograms JRA_Histograms::h_summary

Definition at line 746 of file JRunHistograms.hh.

TimesliceHistograms JRA_Histograms::h_timeslice

Definition at line 747 of file JRunHistograms.hh.

TriggerHistograms JRA_Histograms::h_trigger

Definition at line 748 of file JRunHistograms.hh.

std::set<int> JRA_Histograms::du_ids

Definition at line 749 of file JRunHistograms.hh.

int JRA_Histograms::modules_per_string

Definition at line 750 of file JRunHistograms.hh.


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