/// Class to get a decent density measurement /// at a particular time. Uses averaging over /// several measurements to help reduce any /// noise effects. /// Blair Jamieson (C) 2009, 2010 #ifndef TTPCGasDensity_hxx__ #define TTPCGasDensity_hxx__ #include "ITPCGas.hxx" #include "IAvgRMSPlot.hxx" #include #include /// Class to get a decent density measurement /// at a particular time. Uses averaging over /// several measurements to help reduce any /// noise effects. /// Blair Jamieson (C) 2009, 2010 class ITPCGasDensity { public: ITPCGasDensity( long autmin, long autmax, int dtaverage = 3600 ); ITPCGasDensity( int ayearmin, int amonthmin, int adaymin, int ahourmin, int aminmin, int asecmin, int ayearmax, int amonthmax, int adaymax, int ahourmax, int aminmax, int asecmax, int dtaverage = 3600); /// Get the averaged temperature at atime for itpc float T( long atime, int itpc ){ if ( atime > fTimeMin && atime < fTimeMax && itpc>=0 && itpc<3 ){ for (unsigned int i=0; i atime ) { if (itpc==0) return fT1Avg[i].fmean; if (itpc==1) return fT2Avg[i].fmean; if (itpc==2) return fT3Avg[i].fmean; } } } std::cout<<"ITPCGasDensity::TTPC> time or tpc outside of range"< fTimeMin && atime < fTimeMax ){ for (unsigned int i=0; i atime ) { return fPAvg[i].fmean; } } } std::cout<<"ITPCGasDensity::P> time outside of range"<0.0&&aT>0.0){ return aP/(aT+273.15); } else { std::cout<<"ITPCGasDensity::Density> time outside of range"< fTimes; std::vector< IAvgRMSPlot > fT1Avg; std::vector< IAvgRMSPlot > fT2Avg; std::vector< IAvgRMSPlot > fT3Avg; std::vector< IAvgRMSPlot > fDens1Avg; std::vector< IAvgRMSPlot > fDens2Avg; std::vector< IAvgRMSPlot > fDens3Avg; std::vector< IAvgRMSPlot > fPAvg; // Initialize values for later lookup void Init(); // Make some plots of the averaged quantities during initialization IAvgRMSPlot fT[3]; ///< Tpc temperature (degC) IAvgRMSPlot fP ; ///< Pressure of inner volume (mbar) IAvgRMSPlot fDensity[3]; ///< Density (mbar/K) }; #endif