PdbMutCalibStrip.hh
//-----------------------------------------------------------------------------
//
// The pdbcal package
// Copyright (C) PHENIX collaboration, 2002
//
// Declaration of class PdbMutCalibStrip
//
// Purpose: Store MuTr calibration information; one object, one strip
//
// Description:
//
// Author: silvermy (silvermy@lanl.gov)
//-----------------------------------------------------------------------------
#ifndef __PDBMUTCALIBSTRIP_HH__
#define __PDBMUTCALIBSTRIP_HH__
#include <iostream>
#include "PdbCalChan.hh"
static const int NMUTCALIBPAR = 4; // number of extra calibration parameters
// besides pedestal and gain
static const int MAXMUTRDAC = 0xff;
static const int MAXMUTRADC = 1800;
class PdbMutCalibStrip : public PdbCalChan {
public:
PdbMutCalibStrip();
PdbMutCalibStrip(int iarm, int istation, int ioctant,
int ihalfoctant, int igap, int iplane,
int istrip);
void zero(); // zero all variables (non-address indices)
virtual ~PdbMutCalibStrip();
PdbMutCalibStrip& operator=(const PdbMutCalibStrip& rhs);
virtual void print() const;
virtual void write(ostream& os) const;
virtual void read(istream& is);
int getArm() const { return ArmNum; }
int getStation() const { return StationNum; }
int getOctant() const { return OctantNum; }
int getHalfOctant() const { return HalfOctantNum; }
int getGap() const { return GapNum; }
int getPlane() const { return PlaneNum; }
int getStrip() const { return StripNum; }
int get_ncalibpar () { return NMUTCALIBPAR; }
float get_pedestal() const { return pedestal; }
float get_gain() const { return gain; }
float get_rms() const { return rms; }
float get_calibpar (int index) const { return calibpar[index]; }
void setArm (int temp) { ArmNum = temp; }
void setStation (int temp) { StationNum = temp; }
void setOctant (int temp) { OctantNum = temp; }
void setHalfOctant (int temp) { HalfOctantNum = temp; }
void setGap (int temp) { GapNum = temp; }
void setPlane (int temp) { PlaneNum = temp; }
void setStrip (int temp) { StripNum = temp; }
void set_pedestal (float temp) { pedestal = temp; }
void set_gain (float temp) { gain = temp; }
void set_rms (float temp) { rms = temp; }
void set_calibpar (int index, float temp) { calibpar[index] = temp; }
// set all routines
void set_indices (int iarm, int istation, int ioctant,
int ihalfoctant, int igap, int iplane,
int istrip);
void set_values (float fped, float fgain, float frms);
void set_calibparAll (float temp[NMUTCALIBPAR]);
// get all
void get_indices (int & iarm, int & istation, int & ioctant,
int & ihalfoctant, int & igap, int & iplane,
int & istrip) const;
void get_values (float & fped, float & fgain, float & frms) const;
void get_calibparAll (float temp[NMUTCALIBPAR]) const;
// id routines
int getUniqueId() const;
bool getName(char *name) const;
// identifying the calibration parameters with their presently assigned names
float getCenter() const { return calibpar[0]; }
float getSqrLow() const { return calibpar[1]; }
float getSqrHigh() const { return calibpar[2]; }
float getLinSat() const { return calibpar[3]; }
void setCenter(float temp) { calibpar[0] = temp; }
void setSqrLow(float temp) { calibpar[1] = temp; }
void setSqrHigh(float temp) { calibpar[2] = temp; }
void setLinSat(float temp) { calibpar[3] = temp; }
// fit info
int getStatus() const { return Status; }
int getStep() const { return Step; }
int getSaturation() const { return Saturation; }
void setStatus(int temp) { Status = temp; }
void setStep(int temp) { Step = temp; }
void setSaturation(int temp) { Saturation = temp; }
// perhaps most important: conversion between DAC and ADC values
// using the fit parameters
int getAdc(int dac) const;
int getDac(int adc) const;
protected:
int ArmNum;
int StationNum;
int OctantNum;
int HalfOctantNum;
int GapNum;
int PlaneNum;
int StripNum;
float pedestal;
float gain;
float rms;
float calibpar[NMUTCALIBPAR];
int Status; // how did the fitting go?
int Step; // step size used in fitting
int Saturation; // where pre-amplifier changes response
// LinSat parameter kicks in
};
#endif /* __PDBMUTCALIBSTRIP_HH__ */