/scratch0/jsnuveri/BDSIM/BDSIMgit/bdsim/include/BDSBin.hh

00001 #ifndef BDSBIN_H
00002 #define BDSBIN_H
00003 
00004 #include "globals.hh"       // geant4 globals / types
00005 #include <vector>
00006 #include <utility>
00007 #include <ostream>
00008 
00014 class BDSBin
00015 {
00016 public:
00017   BDSBin(G4double inXmin, G4double inXmax);
00018   G4double GetValue(){return total;}
00019   G4double GetError(){return sqrt(sumWeightsSquared);}
00020   G4double GetLowerEdge(){return xmin;}
00021   G4double GetUpperEdge(){return xmax;}
00022   std::pair<G4double, G4double> GetXMeanAndTotal();
00023   BDSBin operator+= (const G4double& weight);
00024   G4bool operator== (const G4double& rhs   ) {return (total == rhs);}
00025   G4bool operator!= (const G4double& rhs   ) {return !operator == (rhs);}
00026   void   Empty(){total = 0; sumWeightsSquared = 0;}
00027   G4bool InRange(G4double x);
00028 
00029   G4double xmin;
00030   G4double xmax;
00031   G4double xmean;
00032   G4double total;
00033   G4double sumWeightsSquared;
00034 
00036   friend std::ostream& operator<< (std::ostream &out, BDSBin const &bin);
00037 };
00038 
00039 
00040 #endif

Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7