PulserPinScale Class Reference

#include <PulserPinScale.h>

Inheritance diagram for PulserPinScale:
DbiTableRow

List of all members.

Public Member Functions

 PulserPinScale ()
virtual ~PulserPinScale ()
 PulserPinScale (PulserGainPin &high, PulserGainPin &low, int aggNo)
 PulserPinScale (float high, float low, int aggNo)
UInt_t GetIndex (UInt_t) const
Int_t GetAggregateNo () const
Float_t GetHighGainScale () const
Float_t GetLowGainScale () const
Float_t ScalePins (Float_t high, Float_t low) const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const

Private Attributes

Int_t fAggregateNo
Float_t fHighGainScale
Float_t fLowGainScale

Detailed Description

Definition at line 30 of file PulserPinScale.h.


Constructor & Destructor Documentation

PulserPinScale::PulserPinScale (  ) 

Definition at line 46 of file PulserPinScale.cxx.

00046 {}

PulserPinScale::~PulserPinScale (  )  [virtual]

Definition at line 47 of file PulserPinScale.cxx.

00047 {}

PulserPinScale::PulserPinScale ( PulserGainPin high,
PulserGainPin low,
int  aggNo 
)

Definition at line 49 of file PulserPinScale.cxx.

References fAggregateNo, fHighGainScale, fLowGainScale, Munits::g, PulserGainPin::GetError(), PulserGainPin::GetMean(), PulserGainPin::GetNumPoints(), Msg::kDebug, and MSG.

00051 {
00052   fAggregateNo = aggNo;
00053   // Do fit here
00054   assert(high.GetNumPoints()==low.GetNumPoints());
00055   const Float_t *x_high=high.GetMean();
00056   const Float_t *ex_high=high.GetError();
00057   const Float_t *y_low = low.GetMean();  
00058   const Float_t *ey_low = low.GetError();  
00059 
00060   TGraphErrors g(high.GetNumPoints(),x_high,y_low,ex_high,ey_low);
00061   float xmin=300;
00062   float xmax = 8000;
00063 
00064   for (int i=0;i<high.GetNumPoints();i++) {
00065     if (y_low[i] < 300 && x_high[i]>300) xmin =x_high[i]+1;
00066     if (y_low[i] > 8000 && x_high[i] < 8000) {
00067       xmax = x_high[i]-1;
00068       break;
00069     }
00070   }
00071 
00072   TF1 f("line","[0]*x",xmin,xmax);
00073   g.Fit("line","QR");
00074   MSG("Pulser",Msg::kDebug)<<"Aggregate "<<aggNo<<" fit slope "<<f.GetParameter(0)<<endl;
00075 
00076   fHighGainScale = 1;
00077   fLowGainScale = 1.0/f.GetParameter(0);
00078 
00079 }

PulserPinScale::PulserPinScale ( float  high,
float  low,
int  aggNo 
)

Definition at line 82 of file PulserPinScale.cxx.

References fAggregateNo, fHighGainScale, and fLowGainScale.

00083 {
00084   fHighGainScale = high;
00085   fLowGainScale = low;
00086   fAggregateNo = aggNo;
00087 }


Member Function Documentation

virtual DbiTableRow* PulserPinScale::CreateTableRow (  )  const [inline, virtual]

Implements DbiTableRow.

Definition at line 45 of file PulserPinScale.h.

00045 { return new PulserPinScale;}

void PulserPinScale::Fill ( DbiResultSet rs,
const DbiValidityRec vrec 
) [virtual]

Implements DbiTableRow.

Definition at line 89 of file PulserPinScale.cxx.

References fAggregateNo, fHighGainScale, and fLowGainScale.

00091 {
00092   rs >> fAggregateNo >> fHighGainScale >> fLowGainScale;
00093 
00094 } 

Int_t PulserPinScale::GetAggregateNo (  )  const [inline, virtual]

Reimplemented from DbiTableRow.

Definition at line 40 of file PulserPinScale.h.

References fAggregateNo.

Referenced by PulserDriftCalScheme::GetDriftFar(), and PulserDriftCalScheme::GetDriftPoint().

00040 { return fAggregateNo; }

Float_t PulserPinScale::GetHighGainScale (  )  const [inline]

Definition at line 41 of file PulserPinScale.h.

References fHighGainScale.

00041 {return fHighGainScale;}

UInt_t PulserPinScale::GetIndex ( UInt_t   )  const [inline, virtual]

Reimplemented from DbiTableRow.

Definition at line 39 of file PulserPinScale.h.

References fAggregateNo.

00039 {return fAggregateNo;}

Float_t PulserPinScale::GetLowGainScale (  )  const [inline]

Definition at line 42 of file PulserPinScale.h.

References fLowGainScale.

00042 {return fLowGainScale;}

Float_t PulserPinScale::ScalePins ( Float_t  high,
Float_t  low 
) const

Definition at line 105 of file PulserPinScale.cxx.

References fHighGainScale, and fLowGainScale.

Referenced by PulserDriftCalScheme::GetDriftFar(), and PulserDriftCalScheme::GetDriftPoint().

00106 {
00107   if (fHighGainScale<=0||high<0) {
00108     return fLowGainScale*low;
00109   }
00110   if (fLowGainScale<=0||low<0) {
00111     return fHighGainScale*high;
00112   }
00113   if (high>8000) {
00114     return fLowGainScale*low;
00115   }
00116   if (low<500 || low > 8000) {
00117     return fHighGainScale*high;
00118   }
00119   if (high< 500) {
00120     return fLowGainScale*low;
00121   }
00122   return 0.5*(fLowGainScale*low + fHighGainScale*high);
00123 
00124 }

void PulserPinScale::Store ( DbiOutRowStream ors,
const DbiValidityRec vrec 
) const [virtual]

Reimplemented from DbiTableRow.

Definition at line 96 of file PulserPinScale.cxx.

References fAggregateNo, fHighGainScale, and fLowGainScale.

00098 {
00099     ors << fAggregateNo 
00100         << fHighGainScale 
00101         << fLowGainScale;
00102 }


Member Data Documentation

Definition at line 54 of file PulserPinScale.h.

Referenced by Fill(), GetAggregateNo(), GetIndex(), PulserPinScale(), and Store().

Float_t PulserPinScale::fHighGainScale [private]

Definition at line 55 of file PulserPinScale.h.

Referenced by Fill(), GetHighGainScale(), PulserPinScale(), ScalePins(), and Store().

Float_t PulserPinScale::fLowGainScale [private]

Definition at line 56 of file PulserPinScale.h.

Referenced by Fill(), GetLowGainScale(), PulserPinScale(), ScalePins(), and Store().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1