• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

spadicplugin/go4/TSpadicControl.cxx (r4864/r1179)

Go to the documentation of this file.
00001 
00002 
00003 #include "TSpadicControl.h"
00004 #include "Riostream.h"
00005 
00006 #include "TMath.h"
00007 
00008 //***********************************************************
00009 TSpadicControl::TSpadicControl(const char* name) :
00010    TGo4Parameter(name),
00011    fEnableFit(false),fEnableDebug(false)
00012 {
00013  
00014 for(int ch=0; ch<N_CHA;++ch)
00015    {
00016         fCalibFactor[ch][0]=0;
00017         if(CALIB_ORDER>1) fCalibFactor[ch][1]=0.42; // 25 MeV=pulseheight 60 counts
00018         if(CALIB_ORDER>2) fCalibFactor[ch][2]=0; // currently disabled
00019         // add higher orders here..
00020    }
00021 }
00022 
00023 TSpadicControl::~TSpadicControl()
00024 {
00025 }
00026 
00027 
00028 Bool_t TSpadicControl::UpdateFrom(TGo4Parameter *source)
00029 {
00030    TSpadicControl * from = dynamic_cast<TSpadicControl*> (source);
00031    if (from==0) {
00032       cout << "Wrong parameter class: " << source->ClassName() << endl;
00033       return kFALSE;
00034    }
00035 
00036    fEnableFit = from->fEnableFit;
00037    fEnableDebug = from->fEnableDebug;
00038   for(int ch=0; ch<N_CHA;++ch)
00039    {
00040          for(int order=0; order<CALIB_ORDER;++order)
00041         {
00042                 fCalibFactor[ch][order]=from->fCalibFactor[ch][order];
00043         }
00044    }
00045    return kTRUE;
00046 }
00047 
00048 
00049 Double_t TSpadicControl::Calibrate(Int_t ch, Double_t raw)
00050 {
00051         Double_t result=0;
00052         for(int ord=0; ord<CALIB_ORDER;++ord)
00053         {
00054                 result+=fCalibFactor[ch][ord]*TMath::Power(raw,ord);
00055         }
00056 return result;
00057 }       

Generated on Tue Dec 10 2013 04:52:23 for ROCsoft by  doxygen 1.7.1