ISNPtGainSummaryData.h

00001 #ifndef ISNPTGAINSUMMARYDATA_H
00002 #define ISNPTGAINSUMMARYDATA_H
00003 
00004 #include <ISSummaryData.h>
00005 
00006 #include <string>
00007 
00008 
00009 // <<BeginUserCode>>
00010 
00011 // <<EndUserCode>>
00019 class ISNPtGainSummaryData : public ISSummaryData {
00020 public:
00021 
00025     double *                      gainByChip;
00029     size_t                        gainByChip_size;
00030 
00034     double *                      gainRMSByChip;
00038     size_t                        gainRMSByChip_size;
00039 
00043     double *                      offsetByChip;
00047     size_t                        offsetByChip_size;
00048 
00052     double *                      offsetRMSByChip;
00056     size_t                        offsetRMSByChip_size;
00057 
00061     double *                      noiseByChip;
00065     size_t                        noiseByChip_size;
00066 
00070     double *                      noiseRMSByChip;
00074     size_t                        noiseRMSByChip_size;
00075 
00079     unsigned long                 version;
00080 
00081 
00082     static const ISType & type() {
00083     static const ISType type_ = ISNPtGainSummaryData( ).ISInfo::type();
00084     return type_;
00085     }
00086 
00087     ISNPtGainSummaryData( )
00088       : ISSummaryData( "ISNPtGainSummaryData" )
00089     {
00090     initialize();
00091     }
00092 
00093     ~ISNPtGainSummaryData(){
00094     if ( gainByChip_size != 0 ) delete[] gainByChip;
00095     if ( gainRMSByChip_size != 0 ) delete[] gainRMSByChip;
00096     if ( offsetByChip_size != 0 ) delete[] offsetByChip;
00097     if ( offsetRMSByChip_size != 0 ) delete[] offsetRMSByChip;
00098     if ( noiseByChip_size != 0 ) delete[] noiseByChip;
00099     if ( noiseRMSByChip_size != 0 ) delete[] noiseRMSByChip;
00100 
00101 // <<BeginUserCode>>
00102 
00103 // <<EndUserCode>>
00104     }
00105 
00106 protected:
00107     ISNPtGainSummaryData( const std::string & type )
00108       : ISSummaryData( type )
00109     {
00110     initialize();
00111     }
00112 
00113     void publishGuts( ISostream & out ){
00114     ISSummaryData::publishGuts( out );
00115     out.put( gainByChip, gainByChip_size );
00116     out.put( gainRMSByChip, gainRMSByChip_size );
00117     out.put( offsetByChip, offsetByChip_size );
00118     out.put( offsetRMSByChip, offsetRMSByChip_size );
00119     out.put( noiseByChip, noiseByChip_size );
00120     out.put( noiseRMSByChip, noiseRMSByChip_size );
00121     out << version;
00122     }
00123 
00124     void refreshGuts( ISistream & in ){
00125     ISSummaryData::refreshGuts( in );
00126     if ( gainByChip_size != 0 ) delete[] gainByChip;
00127     in.get( &gainByChip, gainByChip_size );
00128     if ( gainRMSByChip_size != 0 ) delete[] gainRMSByChip;
00129     in.get( &gainRMSByChip, gainRMSByChip_size );
00130     if ( offsetByChip_size != 0 ) delete[] offsetByChip;
00131     in.get( &offsetByChip, offsetByChip_size );
00132     if ( offsetRMSByChip_size != 0 ) delete[] offsetRMSByChip;
00133     in.get( &offsetRMSByChip, offsetRMSByChip_size );
00134     if ( noiseByChip_size != 0 ) delete[] noiseByChip;
00135     in.get( &noiseByChip, noiseByChip_size );
00136     if ( noiseRMSByChip_size != 0 ) delete[] noiseRMSByChip;
00137     in.get( &noiseRMSByChip, noiseRMSByChip_size );
00138     in >> version;
00139     }
00140 
00141 private:
00142     void initialize()
00143     {
00144     gainByChip_size = 0;
00145     gainRMSByChip_size = 0;
00146     offsetByChip_size = 0;
00147     offsetRMSByChip_size = 0;
00148     noiseByChip_size = 0;
00149     noiseRMSByChip_size = 0;
00150     version = 1;
00151 
00152 // <<BeginUserCode>>
00153 
00154 // <<EndUserCode>>
00155     }
00156 
00157 
00158 // <<BeginUserCode>>
00159 
00160 // <<EndUserCode>>
00161 };
00162 
00163 // <<BeginUserCode>>
00164 
00165 // <<EndUserCode>>
00166 #endif // ISNPTGAINSUMMARYDATA_H

Generated on Mon Feb 6 14:01:22 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6