STEER/TFndRunConfiguration.cxx

00001 // @(#)fROOT/STEER:$Name:  $:$Id: TFndRunConfiguration.cxx,v 1.8 2007/09/24 07:32:41 Diego_Faso Exp $
00002 // Revision Author: Diego Faso <mailto:faso@to.infn.it>, 2005/06/24
00003 // Original Author: P. Cerello <mailto:cerello@to.infn.it>, 2000
00004 
00006 //                                                  //
00007 //               TFndRunConfiguration               //
00008 //                                                  //
00009 // Class for run configuration options definition   //
00010 //                                                  //
00012 
00013 #include "TThread.h"
00014 #include "TFndRunConfiguration.h"
00015 
00016 ClassImp(TFndRunConfiguration)
00017 
00018 //___________________________________________
00019 TFndRunConfiguration::TFndRunConfiguration():
00020   fDebugLevel(0),fDebugRawLevel(0),fGeb2hdtUsingGUI(),fGeb2hdtUpdateEvGap(),
00021   fMustFillMonitor(),fMustSaveHdt(),
00022   fTofPedestalSubtraction(),fTofZeroTimeSubtraction(),fTofChargeEqualisation(),
00023   fLmdPedestalSubtraction(),fLmdZeroTimeSubtraction(),fLmdChargeEqualisation(),
00024   fAdcRange(),fAdcBins(),fTdcRange(),fTdcBins()
00025 {
00026   
00027   SetDefaults();
00028  
00029 }
00030 
00031 //___________________________________________
00032 TFndRunConfiguration::~TFndRunConfiguration()
00033 {
00034 
00035 }
00036 
00037 //___________________________________________
00038 void TFndRunConfiguration::SetDefaults(){
00039   // default values (to be used by the producer 'geb2hdt')
00040   //  enum EFndMonDetectors { D_TOF = 0, D_LMD, D_STB, D_SIL, D_GTS }; // description of all monitored detectors
00041   
00042   fGeb2hdtUsingGUI = kTRUE;
00043   fGeb2hdtUpdateEvGap = 500;
00044   for(Int_t i= (Int_t)D_GTS; i<= (Int_t)D_STB; i++) fMustFillMonitor[i] = kTRUE;
00045   fMustSaveHdt = kTRUE;
00046   // ---
00047 
00048   //
00049   fAdcBins[D_TOF]     = 50;
00050   fAdcRange[D_TOF][0] = 0;
00051   fAdcRange[D_TOF][1] = 4100;
00052   
00053   fTdcBins[D_TOF]     = 50;
00054   fTdcRange[D_TOF][0] = 0;
00055   fTdcRange[D_TOF][1] = 4100;
00056   // ---
00057   fAdcBins[D_LMD]     = 50;
00058   fAdcRange[D_LMD][0] = 0;
00059   fAdcRange[D_LMD][1] = 4100;
00060   
00061   fTdcBins[D_LMD]     = 50;
00062   fTdcRange[D_LMD][0] = 0;
00063   fTdcRange[D_LMD][1] = 4100;
00064   // ---
00065   fAdcBins[D_STB]     = 1; // may not use
00066   fAdcRange[D_STB][0] = 0; // may not use
00067   fAdcRange[D_STB][1] = 1; // may not use
00068   
00069   fTdcBins[D_STB]     = 50;
00070   fTdcRange[D_STB][0] = 0;
00071   fTdcRange[D_STB][1] = 4100;
00072   // ---
00073   fAdcBins[D_SIL]     = 50;
00074   fAdcRange[D_SIL][0] = 0;
00075   fAdcRange[D_SIL][1] = 4100;
00076   
00077   fTdcBins[D_SIL]     = 50;
00078   fTdcRange[D_SIL][0] = 0;
00079   fTdcRange[D_SIL][1] = 4100;
00080   // ---
00081   fAdcBins[D_GTS]     = 1; // may not use
00082   fAdcRange[D_GTS][0] = 0; // may not use
00083   fAdcRange[D_GTS][1] = 1; // may not use
00084   
00085   fTdcBins[D_GTS]     = 1; // may not use
00086   fTdcRange[D_GTS][0] = 0; // may not use
00087   fTdcRange[D_GTS][1] = 1; // may not use
00088   // ---
00089 
00090 }
00091 //___________________________________________
00092 void TFndRunConfiguration::SetAdcRange(Int_t detector,Int_t bins,Float_t x_low,Float_t x_hi){
00093   if(detector<0 || detector> K_N_FND_MON_DETECTORS){
00094     Error("SetAdcRange","detector id \"%d\" not accepted",detector);
00095     return;
00096   }
00097   fAdcBins[detector]     = bins;
00098   fAdcRange[detector][0] = x_low;
00099   fAdcRange[detector][1] = x_hi;
00100 }
00101 
00102 //___________________________________________
00103 void TFndRunConfiguration::SetTdcRange(Int_t detector,Int_t bins,Float_t x_low,Float_t x_hi){
00104   if(detector<0 || detector> K_N_FND_MON_DETECTORS){
00105     Error("SetTdcRange","detector id \"%d\" not accepted",detector);
00106     return;
00107   }
00108   fTdcBins[detector]     = bins;
00109   fTdcRange[detector][0] = x_low;
00110   fTdcRange[detector][1] = x_hi;
00111 }
00112 
00113 //___________________________________________
00114 void TFndRunConfiguration::GetAdcRange(Int_t detector,Int_t &bins,Float_t &x_low,Float_t &x_hi){
00115   if(detector<0 || detector> K_N_FND_MON_DETECTORS){
00116     Error("GetAdcRange","detector id \"%d\" not accepted",detector);
00117     bins = 1; x_low = 0; x_hi = 1;
00118     return;
00119   }
00120   bins  = fAdcBins[detector];
00121   x_low = fAdcRange[detector][0];
00122   x_hi  = fAdcRange[detector][1];
00123 }
00124 
00125 //___________________________________________
00126 void TFndRunConfiguration::GetTdcRange(Int_t detector,Int_t &bins,Float_t &x_low,Float_t &x_hi){
00127   if(detector<0 || detector> K_N_FND_MON_DETECTORS){
00128     Error("GetTdcRange","detector id \"%d\" not accepted",detector);
00129     bins = 1; x_low = 0; x_hi = 1;
00130     return;
00131   }
00132   bins  = fTdcBins[detector];
00133   x_low = fTdcRange[detector][0];
00134   x_hi  = fTdcRange[detector][1];
00135 }
00136 
00137 //___________________________________________
00138 void TFndRunConfiguration::Print(Option_t *)const{
00139 
00140   TString msg = "*****************************";
00141   TString clin = "  FINUDA Run Configuration   "; msg+=clin;
00142 
00143 
00144   clin.Form("*****************************" ); msg+=clin;
00145   clin.Form("   Debug level    :   %d",fDebugLevel); msg+=clin;
00146   clin.Form("   Debug Raw level: 0x%x",fDebugRawLevel); msg+=clin;
00147   clin.Form("*****************************" ); msg+=clin;
00148   clin.Form("      TOF Configuration      " ); msg+=clin;
00149   clin.Form("*****************************" ); msg+=clin;
00150   clin.Form(" - TofPedestalSubtraction: %d",fTofPedestalSubtraction); msg+=clin;
00151   clin.Form(" - TofZeroTimeSubtraction: %d",fTofZeroTimeSubtraction); msg+=clin;
00152   clin.Form(" - TofChargeEqualisation: %d",fTofChargeEqualisation); msg+=clin;
00153   clin.Form("*****************************" ); msg+=clin;
00154   clin.Form("      LMD Configuration      " ); msg+=clin;
00155   clin.Form("*****************************" ); msg+=clin;
00156   clin.Form(" - LmdPedestalSubtraction: %d",fLmdPedestalSubtraction); msg+=clin;
00157   clin.Form(" - LmdZeroTimeSubtraction: %d",fLmdZeroTimeSubtraction); msg+=clin;
00158   clin.Form(" - LmdChargeEqualisation: %d",fLmdChargeEqualisation); msg+=clin;
00159   clin.Form("*****************************" ); msg+=clin;
00160 
00161   Printf(msg.Data());
00162 }

Generated on Tue Oct 16 15:40:48 2007 by  doxygen 1.5.2