00001 // $Id: TXXXCalibPar.h 478 2009-10-29 12:26:09Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TXXXCalibPar_H 00015 #define TXXXCalibPar_H 00016 00017 #include "TGo4Parameter.h" 00018 00019 #define __LINESNUMBER__ 20 00020 #define __TEXTMAX__ 256 00021 #define __POLORDER__ 4 00022 #define __DATANAME__ "data1" 00023 #define __GRAPHNAME__ "graph1" 00024 00025 class TGraph; 00026 class TH1; 00027 class TGo4Fitter; 00028 00029 class TXXXCalibPar : public TGo4Parameter { 00030 public: 00031 TXXXCalibPar(); 00032 TXXXCalibPar(const char* name, TH1* spectrum, TGraph* curve); 00033 virtual ~TXXXCalibPar(); 00034 00035 Int_t PrintParameter(Text_t * n, Int_t); 00036 Bool_t UpdateFrom(TGo4Parameter *); 00037 00038 /* Read calibration lines from database (ascii file) */ 00039 void ReadDatabase(); 00040 00041 void SetCalibSpectrum(TH1* h1) { fxCalibSpectrum = h1; } 00042 00043 /* calculate energy from channel number using the current polynom */ 00044 Double_t Energy(Int_t channel); 00045 00047 Double_t fdA[__POLORDER__]; // Calibration polynom coeff 00049 Bool_t fbRecalibrate; // Set to kTRUE to make calibration fit in update from 00051 Bool_t fbReadDatabase; // Set to kTRUE to re-read energies from external ascii file 00053 TString fxDatabase; // Filename for ascii file with linesname - energy 00055 Int_t fiLinesChannel[__LINESNUMBER__]; // Centroid channel numbers for fitted lines 00057 Float_t ffLinesEnergy[__LINESNUMBER__]; // Database energies of calibration lines 00059 TString fxLinesNames[__LINESNUMBER__]; // Database names of calibration lines. 00060 00062 TGo4Fitter* fxLinesFinder; // Fitter to search lines 00063 00065 TGo4Fitter* fxCalibrator; // Fitter for calibration of channel/energies with polynom 00066 00068 TGraph* fxCalibCurve; 00069 00070 TString fxGraphName; // Name of the graph to contain the calibration points 00071 00073 TH1* fxCalibSpectrum; 00074 00076 TString fxSpectrumName; //Name of the calibration spectrum histogram 00077 00078 ClassDef(TXXXCalibPar,1) 00079 }; 00080 00081 #endif