Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

LIPlane.cxx

Go to the documentation of this file.
00001 
00002 
00003 // Program name: LIPlane.cxx                
00004 //
00005 // Package: LISummary          
00006 //
00007 // Coded by Jeff Hartnell Feb/2003                             
00008 //
00009 // Purpose: 
00010 //
00011 // Contact: jeffrey.hartnell@physics.ox.ac.uk                         
00013 
00014 #include "MessageService/MsgService.h"
00015 
00016 #include "LISummary/LIPlane.h"
00017 
00018 ClassImp(LIPlane)
00019   
00020 CVSID("$Id: LIPlane.cxx,v 1.3 2003/11/17 00:46:51 hartnell Exp $");
00021 
00022 //......................................................................
00023 
00024 LIPlane::LIPlane(Int_t firstStrip,Int_t lastStrip)
00025 {
00026   MSG("LIPlane", Msg::kDebug) 
00027     <<"Running LIPlane default constructor..."<<endl;
00028   
00029   this->InitialiseVariables(firstStrip,lastStrip);  
00030   
00031   MSG("LIPlane", Msg::kDebug) 
00032     <<"Finished LIPlane default constructor"<<endl;
00033 }
00034 
00035 //......................................................................
00036 
00037 LIPlane::~LIPlane()
00038 {
00039   MSG("LIPlane", Msg::kDebug) 
00040     <<"Running LIPlane destructor..."<<endl;
00041   
00042   
00043   MSG("LIPlane", Msg::kDebug) 
00044     <<"Finished LIPlane destructor"<<endl;
00045 }
00046 
00047 //......................................................................
00048 
00049 bool operator==(LIPlane a, LIPlane b)
00050 {
00051   return a.GetAdc()==b.GetAdc();
00052 }
00053 
00054 //......................................................................
00055 
00056 bool operator<(LIPlane a, LIPlane b)
00057 {
00058   return a.GetAdc().size()<b.GetAdc().size();
00059 }
00060 //......................................................................
00061 
00062 void LIPlane::InitialiseVariables(Int_t firstStrip,Int_t lastStrip)
00063 {
00064   MSG("LIPlane",Msg::kVerbose) 
00065     <<"Running InitialiseVariables method..."<<endl;
00066 
00067   fLed=-1;
00068   fMaxPin=-1;
00069   fMaxPin2=-1;
00070   fMinAdc=1e6;
00071   fMaxAdc=-1;
00072   fPulserBox=-1;
00073   fS="";
00074   fFirstStrip=firstStrip;
00075   fLastStrip=lastStrip;
00076 
00077   fHighestPh=-1;//ph at highest required adc
00078   fHighestPin=-1;//pin adc at highest required adc
00079   fLowestPh=-1;//ph at lowest required adc
00080   fLowestPin=-1;//pin adc at lowest required adc
00081 
00082   //initialise all the vectors
00083   for (Int_t st=0;st<=fLastStrip;st++){
00084     fAdc.push_back(-1);
00085     fAdc2.push_back(-1);
00086     fGain.push_back(-1);
00087     fGain2.push_back(-1);
00088     fGainErr.push_back(-1);
00089     fGainErr2.push_back(-1);
00090     fNumEnt.push_back(-1);
00091     fNumEnt2.push_back(-1);
00092     fCounter.push_back(0);
00093     fCounter2.push_back(0);
00094   }
00095 
00096   MSG("LIPlane",Msg::kVerbose) 
00097     <<"InitialiseVariables method finished"<<endl;
00098 }
00099 
00100 //......................................................................
00101 
00102 void LIPlane::SetPoint(Int_t stripEnd,Int_t strip,Double_t adc,
00103                        Double_t gain,Double_t gainErr,Double_t numEnt)
00104 {
00105   MSG("LIPlane",Msg::kVerbose)
00106     <<"Running SetPoint method..."<<endl;
00107 
00108   if (strip<=fLastStrip && strip>=fFirstStrip){
00109 
00110     MSG("LIPlane",Msg::kVerbose)
00111       <<"("<<strip<<","<<stripEnd<<")"
00112       <<" Setting point: adc="<<adc<<", gain="<<gain<<endl;
00113 
00114     if (stripEnd==1){
00115       fAdc[strip]=adc;
00116       fGain[strip]=gain;
00117       fGainErr[strip]=gainErr;
00118       fNumEnt[strip]=numEnt;
00119 
00120       //sanity check
00121       if (fCounter[strip]!=0){
00122         MSG("LIPlane",Msg::kWarning) 
00123           <<"This strip and stripEnd have already been set!"<<endl
00124           <<"Strip="<<strip<<", stripEnd="<<stripEnd<<endl;
00125       }
00126       fCounter[strip]++;
00127     }
00128     else if (stripEnd==2){
00129       fAdc2[strip]=adc;
00130       fGain2[strip]=gain;
00131       fGainErr2[strip]=gainErr;
00132       fNumEnt2[strip]=numEnt;
00133 
00134       //sanity check
00135       if (fCounter2[strip]!=0){
00136         MSG("LIPlane",Msg::kWarning) 
00137           <<"This strip and stripEnd have already been set!"<<endl
00138           <<"Strip="<<strip<<", stripEnd="<<stripEnd<<endl;
00139       }
00140       fCounter2[strip]++;
00141     }
00142     else {
00143       MSG("LIPlane",Msg::kWarning) 
00144         <<"StripEnd is wrong"<<endl;
00145     }
00146   }
00147   else {
00148     MSG("LIPlane",Msg::kWarning) 
00149       <<"Strip is wrong"<<endl;
00150   }
00151 
00152   MSG("LIPlane",Msg::kVerbose) 
00153     <<"SetPoint method finished"<<endl;
00154 }
00155 
00156 //......................................................................
00157 
00158 Double_t LIPlane::GetNumEnt(Int_t stripEnd,Int_t strip)
00159 {
00160   if (strip<=fLastStrip && strip>=fFirstStrip){    
00161     if (stripEnd==1){
00162       return fNumEnt[strip];
00163     }
00164     if (stripEnd==2){
00165       return fNumEnt2[strip];
00166     }
00167   }
00168   return -1;
00169 } 
00170 
00171 //......................................................................
00172 
00173 Double_t LIPlane::GetGain(Int_t stripEnd,Int_t strip)
00174 {
00175 
00176   if (strip<=fLastStrip && strip>=fFirstStrip){    
00177     if (stripEnd==1){
00178       return fGain[strip];
00179     }
00180     if (stripEnd==2){
00181       return fGain2[strip];
00182     }
00183   }
00184   return -1;
00185 } 
00186 
00187 //......................................................................
00188 
00189 Double_t LIPlane::GetGainErr(Int_t stripEnd,Int_t strip)
00190 {
00191 
00192   if (strip<=fLastStrip && strip>=fFirstStrip){    
00193     if (stripEnd==1){
00194       return fGainErr[strip];
00195     }
00196     if (stripEnd==2){
00197       return fGainErr2[strip];
00198     }
00199   }
00200   return -1;
00201 } 
00202 
00203 //......................................................................
00204 
00205 Double_t LIPlane::GetAdc(Int_t stripEnd,Int_t strip)
00206 {
00207   if (strip<=fLastStrip && strip>=fFirstStrip){    
00208     if (stripEnd==1){
00209       return fAdc[strip];
00210     }
00211     if (stripEnd==2){
00212       return fAdc2[strip];
00213     }
00214   }
00215   return -1;
00216 } 
00217 
00218 //......................................................................
00219 
00220 vector<Double_t> LIPlane::GetAdc()
00221 {
00222   MSG("LIPlane",Msg::kVerbose) 
00223     <<"Running GetAdc method..."<<endl;
00224 
00225   MSG("LIPlane",Msg::kVerbose) 
00226     <<"GetAdc method finished"<<endl;
00227   return fAdc;
00228 }
00229 
00230 //......................................................................
00231 

Generated on Mon Feb 15 11:06:52 2010 for loon by  doxygen 1.3.9.1