Jpp  16.0.0-rc.2
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 723 of file JRunHistograms.hh.

Constructor & Destructor Documentation

JRA_Histograms::JRA_Histograms ( )
inline

Definition at line 733 of file JRunHistograms.hh.

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

Definition at line 735 of file JRunHistograms.hh.

735  {
736 
737  du_ids = getStringIDs(detector);
742  }
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 749 of file JRunHistograms.hh.

749  {
750 
752 
753  }
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 761 of file JRunHistograms.hh.

761  {
762 
764  const string prefix = "KM3NETDAQ::JDAQ" ;
765  string ts_name = T::Class_Name();
766  string::size_type pos = ts_name.find(prefix);
767 
768  if (pos != string::npos) ts_name.replace(ts_name.find(prefix) , prefix.length() , "");
769 
770  h_timeslice.initialize(du_ids , modules_per_string , index , ts_name);
771  }
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 776 of file JRunHistograms.hh.

776  {
777 
779  }
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 789 of file JRunHistograms.hh.

789  {
790 
791  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str());
792 
793  f.cd (dirname.c_str());
794 
795  for (int i=0 ; i < (int)table.size(); i++){
796 
797  for (int j=0 ; j< (int)table[i].size(); j++){
798 
799  if (table[i][j]) table [i][j] -> Write();
800  }
801  }
802  }
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
int j
Definition: JPolint.hh:682
template<class T >
void JRA_Histograms::Write_histogram_table_to_file ( TFile &  f,
string  dirname,
vector< T * >  table 
)
inline

Definition at line 812 of file JRunHistograms.hh.

812  {
813 
814  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str());
815 
816  f.cd (dirname.c_str());
817 
818  for (int i=0 ; i < (int)table.size(); i++){
819 
820  if (table[i]) table[i] -> Write();
821  }
822  }
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
template<class T , class V >
void JRA_Histograms::Write_manager_to_file ( TFile &  f,
string  dirname,
JManager< T, V > *  table 
)
inline

Definition at line 832 of file JRunHistograms.hh.

832  {
833 
834  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str());
835 
836  f.cd (dirname.c_str());
837 
838  for (typename JManager < T , V >::const_iterator i = table -> begin() ; i != table -> end() ; ++i){
839 
840  i -> second -> Write();
841  }
842  }
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
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 850 of file JRunHistograms.hh.

850  {
851 
852  for (typename JManager < T , V >::const_iterator i = manager -> begin() ; i != manager -> end() ; ++i){
853 
854  if (i -> second -> GetTitle()){
855 
856  std::string buffer = i -> second -> GetTitle();
857  string::size_type ipos = buffer.find(wc);
858 
859  if (ipos!=std::string::npos){
860 
861  ostringstream os;
862 
863  os << i -> first ;
864 
865  buffer.replace(ipos, 1, os.str());
866 
867  i -> second -> SetTitle(buffer.c_str());
868  }
869  }
870  }
871  }
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 879 of file JRunHistograms.hh.

879  {
880 
881  for (typename JManager < T , V >::const_iterator i = manager -> begin() ; i != manager -> end() ; ++i){
882 
883  std::string fullpath = MAKE_STRING(i->second->GetName());
884 
885  int pos = fullpath.rfind ('/');
886  std::string name = fullpath.substr (pos + 1);
887  std::string path = fullpath.substr (0 , pos);
888 
889  if (f.GetDirectory(path.c_str()) == 0) f.mkdir (path.c_str());
890 
891  f.cd(path.c_str());
892 
893  i -> second -> SetName(name.c_str());
894  i -> second -> Write();
895  }
896  }
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
#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
$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
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 904 of file JRunHistograms.hh.

904  {
905 
906  for (typename vector < JManager < T , V >* >::const_iterator i = table.begin() ; i != table.end() ; ++i){
907 
908  if ((*i)){
909 
910  for (typename JManager < T , V >::const_iterator j = (*i) -> begin() ; j != (*i) -> end() ; ++j){
911 
912  std::string fullpath = MAKE_STRING(j-> second -> GetName());
913 
914  int pos = fullpath.rfind ('/');
915  std::string name = fullpath.substr (pos + 1);
916  std::string path = fullpath.substr (0 , pos);
917 
918  if (f.GetDirectory(path.c_str()) == 0) f.mkdir (path.c_str());
919 
920  f.cd(path.c_str());
921 
922  j -> second -> SetName(name.c_str());
923  j -> second -> Write();
924  }
925  }
926  }
927  }
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
#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
$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
int j
Definition: JPolint.hh:682
void JRA_Histograms::Write_to_file ( TFile &  f)
inline

Definition at line 933 of file JRunHistograms.hh.

933  {
934 
935  f.mkdir("Detector");
936  f .cd("Detector");
937 
944 
946 
947  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){
948 
949  if ((*i)){
950 
951  for (typename JManager < string , TH2D >::const_iterator j = (*i) -> begin() ; j != (*i) -> end() ; ++j){
952 
953  for(int k=1 ; k < j -> second -> GetNbinsX() ; ++k){
954 
955  for(int t=1 ; t < j -> second -> GetNbinsY() ; ++t){
956 
957  double width = j -> second -> GetYaxis() -> GetBinWidth(t);
958 
959  j -> second -> SetBinContent(k,t,j -> second -> GetBinContent(k,t) / width);
960  j -> second -> SetBinError(k,t,j -> second -> GetBinError(k,t) / width);
961  }
962  }
963  }
964  }
965  }
966 
970 
973 
975 
978 
979  f.mkdir ( MAKE_STRING ("JDAQEvent").c_str());
980  f.cd ("JDAQEvent");
981 
997  }
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
vector< TH2D * > h_dom_mean_rates
TH2D * h_Triggered_hits_per_module
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
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
TH1D * h_Triggered_hits_3dmuon
void normalizeBW1D(TH1D *h)
int j
Definition: JPolint.hh:682
TH2D * h_Triggered_hits_3dmuon_per_module
JManager< string, TH2D > * m_Snapshot_hits_per_pmt
TH1D * h_Triggered_over_Snapshot_hits

Member Data Documentation

SummaryHistograms JRA_Histograms::h_summary

Definition at line 727 of file JRunHistograms.hh.

TimesliceHistograms JRA_Histograms::h_timeslice

Definition at line 728 of file JRunHistograms.hh.

TriggerHistograms JRA_Histograms::h_trigger

Definition at line 729 of file JRunHistograms.hh.

std::set<int> JRA_Histograms::du_ids

Definition at line 730 of file JRunHistograms.hh.

int JRA_Histograms::modules_per_string

Definition at line 731 of file JRunHistograms.hh.


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