/// Class to build average gas properties inside TPC /// over a particular time period (or run). /// Blair Jamieson (C) 2009, 2010 #ifndef TTPCGasAvg_hxx__ #define TTPCGasAvg_hxx__ #include #include "IAvgRMSPlot.hxx" using namespace std; #include "ITPCGas.hxx" /// Class to build average gas properties inside TPC /// over a particular time period (or run). Also /// has facilities to make an animated gif of the /// TPC gas properties over a period of time. /// Blair Jamieson (C) 2009, 2010 class ITPCGasAvg { public: /// Initialize TPC gas properties averaging object using unix times ITPCGasAvg( int maxsamples = -1, long autmin = 1224118800, long autmax = 1224118800 ); /// Initialize TPC gas properties averaging object using year, /// month(0-11), day (1-31), ... ITPCGasAvg( int maxsamples, int ayearmin, int amonthmin, int adaymin, int ahourmin, int aminmin, int asecmin, int ayearmax, int amonthmax, int adaymax, int ahourmax, int aminmax, int asecmax ); // Methods to get time range of readings long GetTimeMin() { return fTimeMin;} ///< get minimum unix time long GetTimeMax() { return fTimeMax;} ///< get maximum unix time int GetRunMin() { return fRunMin; } ///< get minimum run number int GetRunMax() { return fRunMax; } ///< get maximum run number IAvgRMSPlot* ArFlow () { return &fArFlow; } ///< Argon flow (l/min) IAvgRMSPlot* CF4Flow() { return &fCF4Flow;} ///< CF4 flow (l/min) IAvgRMSPlot* IbuFlow() { return &fIbuFlow;} ///< isobutane flow (l/min) // Add a few computed quantities IAvgRMSPlot* ArFrac () { return &fArFrac; } ///< Fraction of argon in mix IAvgRMSPlot* CF4Frac() { return &fCF4Frac; } ///< Fraction of argon in mix IAvgRMSPlot* IbuFrac() { return &fIbuFrac; } ///< Fraction of argon in mix // TPC pressures IAvgRMSPlot* Patm () { return &fPatm; } ///< Atmospheric pressure (mbar) IAvgRMSPlot* PD1 () { return &fPD1; } ///< outer volume to atm dp (mbarg) IAvgRMSPlot* PD2 () { return &fPD2; } ///< inner to outer volume dp (mbarg) IAvgRMSPlot* P () { return &fP; } ///< inner volume absolute pressure (mbar) IAvgRMSPlot* PD4 () { return &fPD4; } ///< isobutane monitor pressure to atmospheric dp (mbarg) // GAs analyzer data IAvgRMSPlot* H2O () { return &fH2O; } ///< H2O in ~ppm IAvgRMSPlot* O2 () { return &fO2; } ///< O2 in ppm IAvgRMSPlot* IbuMon () { return &fIbuMon; } ///< Isobutane % from safety monitor IAvgRMSPlot* IbuAn () { return &fIbuAn; } ///< Isobutane % from MGA3000 (crap) IAvgRMSPlot* CO2An () { return &fCO2An; } ///< CO2 ppm from MGA3000 (crap) IAvgRMSPlot* CF4An () { return &fCF4An; } ///< CF4 % from MGA3000 (fine but offset) IAvgRMSPlot* Temp () { return &fTO2; } ///< temperture (degC) from O2 monitor // TPC temperature data IAvgRMSPlot* TTPC1 () { return &fTTPC1; } ///< temperature (degC) avg of TPC1 T probes on gas manifold IAvgRMSPlot* TTPC2 () { return &fTTPC2; } ///< temperature (degC) avg of TPC2 T probes on gas manifold IAvgRMSPlot* TTPC3 () { return &fTTPC3; } ///< temperature (degC) avg of TPC3 T probes on gas manifold IAvgRMSPlot* DensityTPC1 () { return &fDensity1; } ///< density (mbar/K) avg of TPC1 IAvgRMSPlot* DensityTPC2 () { return &fDensity2; } ///< density (mbar/K) avg of TPC2 IAvgRMSPlot* DensityTPC3 () { return &fDensity3; } ///< density (mbar/K) avg of TPC3 // Mixer temperatures IAvgRMSPlot* D0TC1 () { return &fD0TC1;} ///< temperture (degC) from normal isobutane flowmeter IAvgRMSPlot* D0TC2 () { return &fD0TC2;} ///< temperture (degC) from purge isobutane flowmeter IAvgRMSPlot* D0TC3 () { return &fD0TC3;} ///< temperture (degC) from purge isobutane supply line IAvgRMSPlot* D0TC4 () { return &fD0TC4;} ///< temperture (degC) from Argon supply line IAvgRMSPlot* D0TC5 () { return &fD0TC5;} ///< temperture (degC) from normal isobutane supply line // purifier temperatures IAvgRMSPlot* P0TC1 () { return & fP0TC1;} ///< temperture (degC) from purifier 1 top IAvgRMSPlot* P0TC2 () { return & fP0TC2;} ///< temperture (degC) from purifier 1 middle IAvgRMSPlot* P0TC3 () { return & fP0TC3;} ///< temperture (degC) from purifier 1 bottom IAvgRMSPlot* P0TC4 () { return & fP0TC4;} ///< temperture (degC) from purifier 2 top IAvgRMSPlot* P0TC5 () { return & fP0TC5;} ///< temperture (degC) from purifier 2 middle IAvgRMSPlot* P0TC6 () { return & fP0TC6;} ///< temperture (degC) from purifier 2 bottom // isobutane cylinder room temperatures IAvgRMSPlot* DXTC1 () { return & fDXTC1;} ///< temperture (degC) from isobutane bottle 1 IAvgRMSPlot* DXTC2 () { return & fDXTC2;} ///< temperture (degC) from isobutane bottle 2 IAvgRMSPlot* DXTC3 () { return & fDXTC3;} ///< temperture (degC) from isobutane line // monitor chamber drift information IAvgRMSPlot* VdIn () { return & fVdIn; } ///< Drift speed of input gas ( cm / microseconds ) IAvgRMSPlot* VdInUnc () { return & fVdInUnc; } ///< Uncertainty in drift speed of input gas ( cm / microseconds ) IAvgRMSPlot* VdOut () { return & fVdOut; } ///< Drift speed of return gas ( cm / microseconds ) IAvgRMSPlot* VdOutUnc() { return & fVdOutUnc; } ///< Uncertainty in drift speed of return gas ( cm / microseconds ) IAvgRMSPlot* GainIn (){ return & fGainIn; } ///< Gain of input gas IAvgRMSPlot* GainInUnc (){ return & fGainInUnc; } ///< Uncertainty in gain of input gas IAvgRMSPlot* GainOut (){ return & fGainOut; } ///< Drift speed of return gas IAvgRMSPlot* GainOutUnc(){ return & fGainOutUnc; } ///< Uncertainty in gain of return gas /// Print average and rms gas properties results to std::cout void Print(); /// Make plots of properties vs time to files (png and root) /// Make sure to call print befor plot. void Plot(); private: int fMaxSamples; ///< Maximum number of samples to use in averaging long fTimeMin; ///< Minumum in time range long fTimeMax; ///< Maximum in time range int fRunMin; ///< Minimum in run range int fRunMax; ///< Maximum in run range // input flows IAvgRMSPlot fArFlow; ///< Argon flow (l/min) IAvgRMSPlot fCF4Flow; ///< CF4 flow (l/min) IAvgRMSPlot fIbuFlow; ///< isobutane flow (l/min) IAvgRMSPlot fArFrac; ///< Argon fraction (%) IAvgRMSPlot fCF4Frac; ///< CF4 fraction (%) IAvgRMSPlot fIbuFrac; ///< isobutane fraction (%) // pressures IAvgRMSPlot fPatm; ///< Atmospheric pressure (mbar) IAvgRMSPlot fPD1; ///< outer volume to atm dp (mbarg) IAvgRMSPlot fPD2; ///< inner to outer volume dp (mbarg) IAvgRMSPlot fP; ///< inner volume absolute pressure (mbar) IAvgRMSPlot fPD4; ///< ibumon to atmospheric volume dp (mbarg) // gas analyzer information IAvgRMSPlot fH2O; ///< H2O in ~ppm IAvgRMSPlot fO2; ///< Inner volume O2 in ppm IAvgRMSPlot fIbuMon; ///< Isobutane % from safety monitor IAvgRMSPlot fIbuAn; ///< Isobutane % from MGA3000 (crap) IAvgRMSPlot fCO2An; ///< CO2 ppm from MGA3000 (fine but offset) IAvgRMSPlot fCF4An; ///< CF4 % from MGA3000 (fine but offset) // gas system temperatures IAvgRMSPlot fTO2; ///< temperture (degC) from O2 monitor IAvgRMSPlot fTTPC1; ///< temperature (degC) avg of TPC1 T probes on gas manifold IAvgRMSPlot fTTPC2; ///< temperature (degC) avg of TPC1 T probes on gas manifold IAvgRMSPlot fTTPC3; ///< temperature (degC) avg of TPC1 T probes on gas manifold IAvgRMSPlot fDensity1; ///< density (mbar/K) avg of TPC1 IAvgRMSPlot fDensity2; ///< density (mbar/K) avg of TPC2 IAvgRMSPlot fDensity3; ///< density (mbar/K) avg of TPC3 // mixing room temperatures IAvgRMSPlot fD0TC1; ///< temperture (degC) from normal isobutane flowmeter IAvgRMSPlot fD0TC2; ///< temperture (degC) from purge isobutane flowmeter IAvgRMSPlot fD0TC3; ///< temperture (degC) from purge isobutane supply line IAvgRMSPlot fD0TC4; ///< temperture (degC) from Argon supply line IAvgRMSPlot fD0TC5; ///< temperture (degC) from normal isobutane supply line // purifier temperatures IAvgRMSPlot fP0TC1; ///< temperture (degC) from purifier 1 top IAvgRMSPlot fP0TC2; ///< temperture (degC) from purifier 1 middle IAvgRMSPlot fP0TC3; ///< temperture (degC) from purifier 1 bottom IAvgRMSPlot fP0TC4; ///< temperture (degC) from purifier 2 top IAvgRMSPlot fP0TC5; ///< temperture (degC) from purifier 2 middle IAvgRMSPlot fP0TC6; ///< temperture (degC) from purifier 2 bottom // isobutane cylinder room temperatures IAvgRMSPlot fDXTC1; ///< temperture (degC) from isobutane bottle 1 IAvgRMSPlot fDXTC2; ///< temperture (degC) from isobutane bottle 2 IAvgRMSPlot fDXTC3; ///< temperture (degC) from isobutane line // monitor chamber drift information IAvgRMSPlot fVdIn; ///< Drift speed of input gas ( cm / microseconds ) IAvgRMSPlot fVdInUnc; ///< Uncertainty in drift speed of input gas ( cm / microseconds ) IAvgRMSPlot fVdOut; ///< Drift speed of return gas ( cm / microseconds ) IAvgRMSPlot fVdOutUnc; ///< Uncertainty in drift speed of return gas ( cm / microseconds ) IAvgRMSPlot fGainIn; ///< Gain of input gas IAvgRMSPlot fGainInUnc; ///< Uncertainty in gain of input gas IAvgRMSPlot fGainOut; ///< Drift speed of return gas IAvgRMSPlot fGainOutUnc; ///< Uncertainty in gain of return gas /// Initialize gas properties / pressure averaging object void Init(); /// Update the Average and RMS calculations for each of the gas system conditions void AddUpdate( ITPCGas &agas, bool lastflag=false ); }; #endif