MutCalibStrip.hh
//
// MutCalibStrip.h - declare calibration data class that will store the
// calibration data and be able to retrieve it from the database.
//
#ifndef __MUTCALIBSTRIP_HH__
#define __MUTCALIBSTRIP_HH__
#include "PHTimeStamp.h"
#include "PHString.h"
#include <set>
#include <iostream.h>
#include "PdbMutCalibStrip.hh"
class OrderFunc
{
public:
bool operator() (const PdbMutCalibStrip p1, const PdbMutCalibStrip p2) const
{
// return 1 if ptr1 should be before ptr2, else 0
return ( p1.getUniqueId() < p2.getUniqueId() );
}
};
typedef set< PdbMutCalibStrip, OrderFunc > set_type;
typedef set_type::iterator set_iterator;
class MutCalibStrip {
public:
MutCalibStrip();
virtual ~MutCalibStrip();
// methods for input and output
// Objy interface
int dbGetAll(PHTimeStamp tsearch);
int dbPutAll(PHTimeStamp start,
PHTimeStamp stop,
PHString descriptor);
// ASCII text input/output
int txtGetAll(char* infile);
int txtPutAll(char* outfile);
// info on what we in store
int getNumberOfStrips() const
{ return (int) s.size(); }
// access to the individual calib objects
// changing these afterwards will not change contents in our set
virtual PdbMutCalibStrip* getPdbMutCalibStrip(const int arm,
const int station,
const int octant,
const int halfoctant,
const int gap,
const int plane,
const int strip);
// put in other strip values, overwriting if strip is already existing in set
virtual void putPdbMutCalibStrip(const PdbMutCalibStrip *newp);
private:
set_type s; // this our set of PdbMutCalibStrips
set_iterator iter; // and the associated iterator
PdbMutCalibStrip p; // and a strip object
};
#endif /* __MUTCALIBSTRIP_HH__ */