Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

FunctionStatsDist.cxx

Go to the documentation of this file.
00001 #include "FastShowerUtils/FunctionStatsDist.h"
00002 #include "FastShowerUtils/Quartet.h"
00003 #include "FastShowerUtils/ParticleParameters.h"
00004 #include <iostream>
00005 #include <fstream>
00006 #include <algorithm>
00007 #include <string>
00008 
00009 namespace FastShower{
00010   //
00011   FunctionStatsDist::FunctionStatsDist():
00012     FunctionStats(), m_name(""),m_values(std::vector<Quartet<double> >()){
00013   }
00014   //
00015   FunctionStatsDist::FunctionStatsDist(std::string s):
00016     FunctionStats(), m_name(s), m_values(std::vector<Quartet<double> >()){
00017   }
00018   //
00019   FunctionStatsDist::FunctionStatsDist(const FunctionStatsDist& rhs):
00020   FunctionStats(rhs){
00021 
00022     m_name   = rhs.m_name;
00023     m_values = rhs.m_values;
00024 
00025   }
00026   //
00027   FunctionStatsDist& 
00028   FunctionStatsDist::operator=(const FunctionStatsDist& rhs){
00029 
00030     if (&rhs == this) return *this;
00031 
00032     FunctionStats::operator=(rhs);
00033     m_values = rhs.m_values;
00034 
00035     return *this;
00036   }
00037   //
00038   void FunctionStatsDist::bump(double x){
00039     FunctionStats::bump(x);
00040   }
00041   void FunctionStatsDist::bump(double x, const ParticleParameters* pp){
00042     FunctionStats::bump(x);
00043     m_values.push_back(Quartet<double>(x,
00044                                        pp->energy(),
00045                                        pp->delEta(),
00046                                        pp->delPhi()
00047                                        )
00048                        );
00049   }
00050   void FunctionStatsDist::report(std::ostream& ostr) const{
00051     FunctionStats::report(ostr);
00052 
00053     fstream ofile;
00054     std::string filename=m_name+".dat";
00055     ofile.open(filename.c_str(), ios::out);
00056 
00057     //    cout<<"copying "<<m_values.size()<<" values to "<<filename<<endl;
00058     std::copy(m_values.begin(), 
00059               m_values.end(), 
00060               ostream_iterator<Quartet<double> >(ofile)
00061               );
00062 
00063     ofile.close();    
00064 
00065 
00066     
00067   }
00068   //
00069 }//namespace
00070 
00071 
00072 
00073 
00074 
00075 

Generated on Tue Mar 18 11:49:56 2003 for FastShowerUtils by doxygen1.3-rc1