LITuning Class Reference

#include <LITuning.h>

Inheritance diagram for LITuning:
LILookup

List of all members.

Public Types

enum  EGcTuningType { kGcUnknown = 0, kGcLinearInPmtAdc = 1, kGcLinearInPinAdc = 2 }
typedef enum
LITuning::EGcTuningType 
EGcTuningType_t

Public Member Functions

 LITuning ()
 ~LITuning ()
void CalculateDriftPoints ()
void CalculateGainCurve (EGcTuningType tuningType=kGcLinearInPinAdc)
void InputDataGc (std::vector< LIRun > &gainCurve)
void SetAdcAtStartOfSaturation (Double_t i)
void SetdADCdPHAtSat (Double_t i)
void SetFirstGcPointAdc (Double_t i)
void SetIdealAdc (Int_t i)
void SetLastGcPointAdc (Double_t i)
void SetPinHighestMaxHG (Double_t i)
void SetPinHighestMaxLG (Double_t i)
void SetPinLowestMaxHG (Double_t i)
void SetPinLowestMaxLG (Double_t i)
void SetPinLowestMinHG (Double_t i)
void SetPinLowestMinLG (Double_t i)
void SetMaxPossAdc (Double_t i)
void SetMaxPossPh (Double_t i)
void SetMaxPossPin (Double_t i)
void SetMinHGdPINdPH (Double_t i)
void SetMinLGdPINdPH (Double_t i)
void SetMinPossAdc (Double_t i)
void SetMinPossPh (Double_t i)
void SetMinPossPin (Double_t i)
void SetNumCalibPoints (Int_t i)
void SetNumGainPoints (Int_t i)
Float_t FindLowerFraction (std::map< Float_t, Int_t > &inputMap, Float_t fraction, Int_t totalNumHits)
Float_t FindMidFractionAv (std::map< Float_t, Int_t > &inputMap, Float_t lowerFraction, Float_t upperFraction, Int_t totalNumHits)
Float_t FindUpperFraction (std::map< Float_t, Int_t > &inputMap, Float_t fraction, Int_t totalNumHits)
Bool_t GetDataGcGraphs (std::vector< TGraph * > &gGcAdc, std::vector< TGraph * > &gAdcFVsPh, std::vector< TGraph * > &gPinVsPh, std::vector< TGraph * > &gPin2VsPh, std::vector< TGraphAsymmErrors * > &gAdcErrVsPh, std::vector< TGraphAsymmErrors * > &gAdcFErrVsPh)
Bool_t GetTunedDpGraphs (TGraph *&gAdcVsLed, TGraph *&gPhVsLed, TGraph *&gPinVsLed, Int_t numLedsPerPb)
Bool_t GetTunedGcPlots (std::vector< TH2F * > &hGcAdc, std::vector< TH2F * > &hGcPin, std::vector< TH2F * > &hGcPh, Int_t firstLed, Int_t lastLed)
void PrintAll ()
void PrintConfig ()
void PrintLedCheckGrid (LIRun::ELIRunType LIRunType, Int_t firstPb, Int_t lastPb, Int_t firstLed, Int_t lastLed)
Int_t PrintLIConfig (LIRun::ELIRunType LIRunType)

Private Member Functions

void CorrectInterpValues (std::vector< Double_t >::iterator adc, std::vector< Double_t >::iterator ph, std::vector< Double_t >::iterator pin, Int_t led, Int_t pb, Double_t requiredPointAdc, Double_t &interpPh, Double_t &interpPin)
void GcLinearInPinAdc (std::vector< LIRun >::iterator gcData, Int_t goodPin, std::vector< LIRun >::iterator &gcTuned, Double_t firstPh, Double_t lastPh, Double_t firstPin, Double_t lastPin)
void GcLinearInPmtAdc (std::vector< LIRun >::iterator gcData, Int_t goodPin, std::vector< LIRun >::iterator &gcTuned, Double_t firstPh, Double_t lastPh, Double_t firstPin, Double_t lastPin)
void InitialiseDataMembers (Detector::Detector_t det)
Double_t CalcAv_dPINdPH (std::vector< LIRun >::iterator gcData, Int_t pinNumber)
void CalcFirstGcPoint (std::vector< LIRun >::iterator gcData, Int_t goodPin, Double_t &firstPh, Double_t &firstPin)
void CalcLastGcPoint (std::vector< LIRun >::iterator gcData, Int_t goodPin, Double_t &lastPh, Double_t &lastPin)
Double_t CalcLastGcPointAdc (std::vector< LIRun >::iterator gcData)
Bool_t DataIsOk (std::vector< LIRun >::iterator GainCurveData, Int_t minNumPoints=4, Int_t maxAllowedAdc=15000)
Int_t GoodPin (std::vector< LIRun >::iterator currentGc)
Double_t Interpolate (Double_t y, Double_t y2, Double_t m, Double_t x2)
void InterpolateAboveOrBelow (EGcTuningType tuningType, std::vector< Double_t >::iterator adc, std::vector< Double_t >::iterator ph, std::vector< Double_t >::iterator pin, Int_t led, Int_t pb, Double_t &interpAdc, Double_t &interpPh, Double_t &interpPin)
void PrintFirstLastMsg (Double_t firstPh, Double_t lastPh, Double_t firstPin, Double_t lastPin)
void PrintPhPinMsg (std::vector< Double_t >::iterator adc, std::vector< Double_t >::iterator ph, std::vector< Double_t >::iterator pin, Double_t interpPh, Double_t interpPin)
void PrintPhMsg (std::vector< Double_t >::iterator adc, std::vector< Double_t >::iterator ph, Double_t interpPh)
void PrintPinMsg (std::vector< Double_t >::iterator pin, std::vector< Double_t >::iterator ph, Double_t interpAdc, Double_t interpPh)

Private Attributes

Double_t fAdcAtStartOfSaturation
std::vector< LIRunfBestDp
std::vector< LIRunfBestGc
Double_t fdADCdPHAtSat
Detector::Detector_t fDetector
Double_t fFirstGcPointAdc
std::vector< LIRun > * fGainCurve
Int_t fIdealAdc
Double_t fLastGcPointAdc
Int_t fNumCalibPoints
Int_t fNumGainPoints
Double_t fPinHighestMaxHG
Double_t fPinHighestMaxLG
Double_t fPinLowestMaxHG
Double_t fPinLowestMaxLG
Double_t fPinLowestMinHG
Double_t fPinLowestMinLG
Double_t fMaxPossAdc
Double_t fMaxPossPh
Double_t fMaxPossPin
Double_t fMinHGdPINdPH
Double_t fMinLGdPINdPH
Double_t fMinPossAdc
Double_t fMinPossPh
Double_t fMinPossPin
std::string fS

Detailed Description

Definition at line 24 of file LITuning.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
kGcUnknown 
kGcLinearInPmtAdc 
kGcLinearInPinAdc 

Definition at line 29 of file LITuning.h.

00029                              {
00030     kGcUnknown        = 0,
00031     kGcLinearInPmtAdc = 1,
00032     kGcLinearInPinAdc = 2
00033   } EGcTuningType_t;  


Constructor & Destructor Documentation

LITuning::LITuning (  ) 

Definition at line 29 of file LITuning.cxx.

References Msg::kDebug, Detector::kUnknown, and MSG.

00030 {
00031   MSG("LITuning", Msg::kDebug) 
00032     <<"Running LITuning constructor..."<<endl;
00033 
00034   this->InitialiseDataMembers(Detector::kUnknown);
00035 
00036   //some good runs to test the code on:
00037   //15853 - has lots of really low points
00038   //17681 - a drift point run
00039   //17661 - has a very saturated led and a bad pin
00040   //      - also has some missing info at low ph; 0 adc and 0 ph
00041   //17616 - led 1 has two bad pins and doesn't saturate!!!!!
00042 
00043   MSG("LITuning", Msg::kDebug) 
00044     <<"Constructed LITuning object"<<endl;
00045 }

LITuning::~LITuning (  ) 

Definition at line 49 of file LITuning.cxx.

References Msg::kDebug, and MSG.

00050 {
00051   MSG("LITuning", Msg::kDebug) 
00052     <<"Running LITuning destructor..."<<endl;
00053 
00054   MSG("LITuning", Msg::kDebug) 
00055     <<"Finished LITuning destructor"<<endl;
00056 }


Member Function Documentation

Double_t LITuning::CalcAv_dPINdPH ( std::vector< LIRun >::iterator  gcData,
Int_t  pinNumber 
) [private]
void LITuning::CalcFirstGcPoint ( std::vector< LIRun >::iterator  gcData,
Int_t  goodPin,
Double_t &  firstPh,
Double_t &  firstPin 
) [private]

Referenced by CalculateGainCurve().

void LITuning::CalcLastGcPoint ( std::vector< LIRun >::iterator  gcData,
Int_t  goodPin,
Double_t &  lastPh,
Double_t &  lastPin 
) [private]

Referenced by CalculateGainCurve().

Double_t LITuning::CalcLastGcPointAdc ( std::vector< LIRun >::iterator  gcData  )  [private]
void LITuning::CalculateDriftPoints (  ) 

Definition at line 1271 of file LITuning.cxx.

References DataIsOk(), fBestDp, fGainCurve, fIdealAdc, Interpolate(), Msg::kDebug, LIRun::kDriftPoint, Msg::kInfo, Msg::kVerbose, Msg::kWarning, and MSG.

Referenced by LIAnalysis::LedTuning().

01272 {
01273   MSG("LITuning", Msg::kInfo) 
01274     <<"Running CalculateDriftPoints method..."<<endl;
01275 
01276   //get iterators to the gain curves and drift points
01277   vector<LIRun>::iterator gcData;
01278   gcData=fGainCurve->begin();
01279   vector<LIRun>::iterator dpTuned;
01280   //note can't get begin() before vector contains any elements
01281   //so get end()-1 for dpTuned below 
01282 
01283   MSG("LITuning_TuneDp",Msg::kDebug)
01284     <<"Starting the loop over all input data gain curves"<<endl;
01285     
01286   //loop over all the gain curves
01287   while (gcData!=fGainCurve->end()){
01288 
01289     if (!this->DataIsOk(gcData,2)){
01290       gcData++;
01291       continue;
01292     }
01293 
01294     //get iterators to the vectors of gain curve points
01295     vector<Double_t> phVector;
01296     vector<Double_t>::iterator ph;
01297     phVector=gcData->GetPh();
01298     ph=phVector.begin();
01299     vector<Double_t> adcVector;
01300     vector<Double_t>::iterator adc;
01301     adcVector=gcData->GetAdc();
01302     adc=adcVector.begin();
01303 
01304     //get the pulserbox and led associated with real data gain curve
01305     Int_t pulserBox=gcData->GetPb();
01306     Int_t led=gcData->GetLed();
01307 
01308     MSG("LITuning_TuneDp",Msg::kDebug)
01309       <<"("<<pulserBox<<":"<<led<<") First point has ph="<<*ph
01310       <<", adc="<<*adc<<endl;
01311 
01312     //add another DP to vector to hold tuned drift points
01313     fBestDp.push_back(LIRun(pulserBox,led,LIRun::kDriftPoint));
01314     //get iterator to the newest (last) element
01315     dpTuned=fBestDp.end()-1;
01316     MSG("LITuning_TuneDp",Msg::kDebug)
01317       <<"("<<pulserBox<<":"<<led<<") Created DP"<<endl;
01318 
01319     //check that the first adc is not too high
01320     if (*adc>fIdealAdc){  
01321       //if there is not enough data at low pulse heights
01322       //it is better to set too high than too low
01323       //since the led might not have turned on at low PH
01324       dpTuned->AddPoint(*ph,*adc);
01325       
01326       MSG("LITuning_TuneDp",Msg::kInfo)
01327         <<"("<<pulserBox<<":"<<led<<") DP"
01328         <<" Not enough points at low PHs"
01329         <<" for DP. Pulse Height set to lowest point taken"
01330         <<endl<<"PH="<<*ph<<", ideal ADC="<<fIdealAdc
01331         <<", actual adc="<<*adc
01332         <<endl;
01333       //once it's found then continue to the next GC
01334       gcData++;
01335       continue;
01336     }
01337     //iterate to take you to the second point
01338     ph++;
01339     adc++;
01340 
01341     MSG("LITuning_TuneDp",Msg::kDebug)
01342       <<"Starting loop over the given gain curve"<<endl;
01343     
01344     //loop over the points 2 -> end
01345     while(ph!=gcData->GetPh().end()){
01346       
01347       if (*adc>fIdealAdc){
01348         //interpolate to find the best PH
01349         Double_t m=(*ph-*(ph-1))/(*adc-*(adc-1));
01350         Double_t bestPhInterp=this->Interpolate(fIdealAdc,*adc,m,*ph);
01351         //(fIdealAdc-*adc)*
01352         //((*ph-*(ph-1))/(*adc-*(adc-1)))+*ph;
01353        
01354         if (bestPhInterp<0){ 
01355           MSG("LITuning_TuneDp",Msg::kWarning)
01356             <<endl<<"("<<pulserBox<<":"<<led<<") DP"
01357             <<" Interpolated point is negative ("
01358             <<bestPhInterp<<"). Setting to one"
01359             <<", ideal="<<fIdealAdc
01360             <<endl<<"       Lower point: adc="<<*(adc-1)
01361             <<", PH="<<*(ph-1)
01362             <<endl<<"       Upper point: adc="<<*adc
01363             <<", PH="<<*ph<<endl<<endl;
01364           
01365           //set to 0 if negative
01366           //this should never happen!!
01367           bestPhInterp=0;
01368         }
01369         else{
01370           MSG("LITuning_TuneDp",Msg::kInfo)
01371             <<"("<<pulserBox<<":"<<led<<") DP"
01372             <<" Interpolated point found, fIdealAdc="<<fIdealAdc
01373             <<endl<<"       Lower point: adc="<<*(adc-1)
01374             <<", PH="<<*(ph-1)
01375             <<endl<<"       Upper point: adc="<<*adc
01376             <<", PH="<<*ph<<"  Best Ph="<<bestPhInterp
01377             <<endl;
01378         }
01379 
01380         //set the interpolated DP
01381         dpTuned->AddPoint(bestPhInterp,fIdealAdc);
01382         
01383         //once point is found then stop loop    
01384         MSG("LITuning_TuneDp",Msg::kDebug)
01385           <<"("<<pulserBox<<":"<<led
01386           <<") Point found. Breaking out of loop"<<endl;
01387         break;
01388       }
01389       
01390       //iterate the gain curve point
01391       adc++;
01392       ph++;
01393       MSG("LITuning_TuneDp",Msg::kVerbose)
01394         <<"("<<pulserBox<<":"<<led<<") Iterated to next ph"<<endl;
01395     }//end of while
01396 
01397     //check if a DP was found and print a message
01398     if (*adc>10 && ph==gcData->GetPh().end() &&
01399         dpTuned->GetPh().empty()){
01400       MSG("LITuning_TuneDp",Msg::kInfo)
01401         <<"("<<pulserBox<<":"<<led<<") DP"
01402         <<" Not enough points at high PHs"
01403         <<" for DP, ideal ADC="<<fIdealAdc
01404         <<", PH="<<*ph<<", adc="<<*adc
01405         <<endl;
01406     }
01407     
01408     //iterate to next gain curve
01409     MSG("LITuning_TuneDp",Msg::kDebug)
01410       <<"("<<pulserBox<<":"<<led<<") Iterated to next dp"<<endl;
01411     gcData++;
01412   }
01413 
01414   MSG("LITuning_TuneDp",Msg::kDebug)
01415     <<"Finished the loop over all input data gain curves"<<endl;
01416     
01417   MSG("LITuning",Msg::kInfo) 
01418     <<"CalculateDriftPoints method finished"<<endl;
01419 }

void LITuning::CalculateGainCurve ( EGcTuningType  tuningType = kGcLinearInPinAdc  ) 

Definition at line 1931 of file LITuning.cxx.

References CalcFirstGcPoint(), CalcLastGcPoint(), DataIsOk(), exit(), fBestGc, fGainCurve, GcLinearInPinAdc(), GcLinearInPmtAdc(), GoodPin(), MsgService::Instance(), Msg::kDebug, Msg::kFatal, LIRun::kGainCurve, kGcLinearInPinAdc, kGcLinearInPmtAdc, Msg::kInfo, Msg::kWarning, MSG, and PrintFirstLastMsg().

Referenced by LIAnalysis::LedTuning().

01932 {
01933   MSG("LITuning", Msg::kInfo) 
01934     <<"Running CalculateGainCurve method..."<<endl;
01935 
01936   if (tuningType!=kGcLinearInPmtAdc && tuningType!=kGcLinearInPinAdc){
01937     MSG("LITuning_TuneGc",Msg::kFatal)
01938       <<"Tuning type = "<<tuningType<<" not defined."<<endl
01939       <<"Will exit programme here."<<endl;
01940     exit(0);
01941   }
01942   
01943   //get iterators to the gain curve
01944   vector<LIRun>::iterator gcData;
01945   gcData=fGainCurve->begin();
01946   vector<LIRun>::iterator gcTuned;
01947   //note can't get begin() before vector contains any elements
01948   //so get end()-1 for gcTuned below 
01949 
01951   //loop over all the gain curves for the different pulser boxes
01952   //and leds
01954   while (gcData!=fGainCurve->end()){
01955 
01956     //get the pulserbox and led associated with real data gain curve
01957     Int_t pulserBox=gcData->GetPb();
01958     Int_t led=gcData->GetLed();
01959 
01960     if (led!=-1 && pulserBox!=-1){
01961       if (MsgService::Instance()->IsActive("LITuning_TuneGc",
01962                                            Msg::kDebug)){
01963         MSG("LITuning_TuneGc", Msg::kInfo)
01964           <<endl<<"("<<pulserBox<<":"<<led
01965           <<") **** Starting GC tuning for this led... **** "
01966           <<endl<<endl;
01967       }
01968     }
01969 
01970     if (!this->DataIsOk(gcData)){
01971       MSG("LITuning_TuneGc", Msg::kInfo) 
01972         <<"This gain curve data ("<<pulserBox<<":"<<led<<") is not "
01973         <<"consistent for calcuations"<<endl
01974         <<"Either it has less than the minimum number of points or"
01975         <<" the data is nonsense"<<endl;
01976       gcData++;
01977       continue;
01978     }
01979 
01980     //get iterators to the vectors of gain curve points
01981     vector<Double_t> phVector;
01982     vector<Double_t>::iterator ph;
01983     phVector=gcData->GetPh();
01984     ph=phVector.begin();
01985     vector<Double_t> adcVector;
01986     vector<Double_t>::iterator adc;
01987     adcVector=gcData->GetAdc();
01988     adc=adcVector.begin();
01989     vector<Double_t>pinVector;
01990     vector<Double_t>::iterator pin;
01991     Int_t goodPin=this->GoodPin(gcData);
01992     if (goodPin==1 || goodPin==2){
01993       pinVector=gcData->GetPin(goodPin);
01994       pin=pinVector.begin();
01995     }
01996     else {
01997       MSG("LITuning_TuneGc", Msg::kWarning)
01998         <<endl 
01999         <<"This gain curve ("<<pulserBox<<":"<<led<<") does not have "
02000         <<"a good pin diode associated with it (goodPin="<<goodPin<<")"
02001         <<endl;
02002       
02003       //set pin iterator to point to pulse height!!!
02004       //pin=ph;
02005       //don't like this, best to skip
02006 
02007       //find out the first and last points before continuing
02008       
02009       //variables for first and last points
02010       Double_t firstPh=-1;
02011       Double_t firstPin=-1;
02012       Double_t lastPh=-1;
02013       Double_t lastPin=-1;
02014       //get the first and last gain curve points
02015       this->CalcFirstGcPoint(gcData,1,firstPh,firstPin);
02016       this->CalcLastGcPoint(gcData,1,lastPh,lastPin);
02017       
02018       MSG("LITuning_TuneGc", Msg::kWarning)
02019         <<"("<<pulserBox<<":"<<led<<") Skipping this LED"<<endl
02020         <<"Calcuated first and last points anyway:"<<endl
02021         <<"first Ph="<<firstPh<<", last Ph="<<lastPh<<endl
02022         <<"first Pin="<<firstPin<<", last Pin="<<lastPin<<endl<<endl;
02023 
02024       gcData++;
02025       continue;
02026     }
02027     
02028     MSG("LITuning_TuneGc",Msg::kDebug)
02029       <<"("<<pulserBox<<":"<<led<<"), ph="<<*ph<<", adc="<<*adc
02030       <<", good pin="<<goodPin<<endl;
02031 
02032     //variables to hold the ph and pin values to find GC points between
02033     Double_t firstPh=-1;
02034     Double_t firstPin=-1;
02035     Double_t lastPh=-1;
02036     Double_t lastPin=-1;
02037 
02038     //get the first and last gain curve points
02039     this->CalcFirstGcPoint(gcData,goodPin,firstPh,firstPin);
02040     this->CalcLastGcPoint(gcData,goodPin,lastPh,lastPin);
02041     
02042     if (MsgService::Instance()->IsActive("LITuning_TuneGc",
02043                                          Msg::kDebug)){
02044       this->PrintFirstLastMsg(firstPh,lastPh,firstPin,lastPin);
02045     }
02046 
02047     //add another GC to vector to hold tuned drift points
02048     fBestGc.push_back(LIRun(pulserBox,led,LIRun::kGainCurve));
02049     //get iterator to the newest (last) element
02050     gcTuned=fBestGc.end()-1;
02051 
02053     //Run the tuning algorithm on this particular pulser box and
02054     //led to generate the points
02056     if (tuningType==kGcLinearInPmtAdc){
02057       this->GcLinearInPmtAdc(gcData,goodPin,gcTuned,firstPh,lastPh,
02058                              firstPin,lastPin);
02059     }
02060     else if (tuningType==kGcLinearInPinAdc){
02061       this->GcLinearInPinAdc(gcData,goodPin,gcTuned,firstPh,lastPh,
02062                              firstPin,lastPin);
02063     }
02064 
02065     MSG("LITuning_TuneGc",Msg::kDebug)
02066       <<"("<<pulserBox<<":"<<led<<") Created tuned GC Point"<<endl;
02067     
02068     gcData++;
02069   }
02070 
02071   MSG("LITuning",Msg::kInfo) 
02072     <<"CalculateGainCurve method finished"<<endl;
02073 }

void LITuning::CorrectInterpValues ( std::vector< Double_t >::iterator  adc,
std::vector< Double_t >::iterator  ph,
std::vector< Double_t >::iterator  pin,
Int_t  led,
Int_t  pb,
Double_t  requiredPointAdc,
Double_t &  interpPh,
Double_t &  interpPin 
) [private]
Bool_t LITuning::DataIsOk ( std::vector< LIRun >::iterator  GainCurveData,
Int_t  minNumPoints = 4,
Int_t  maxAllowedAdc = 15000 
) [private]
Float_t LITuning::FindLowerFraction ( std::map< Float_t, Int_t > &  inputMap,
Float_t  fraction,
Int_t  totalNumHits 
)

Referenced by LIAnalysis::LedTuning().

Float_t LITuning::FindMidFractionAv ( std::map< Float_t, Int_t > &  inputMap,
Float_t  lowerFraction,
Float_t  upperFraction,
Int_t  totalNumHits 
)

Referenced by LIAnalysis::LedTuning().

Float_t LITuning::FindUpperFraction ( std::map< Float_t, Int_t > &  inputMap,
Float_t  fraction,
Int_t  totalNumHits 
)

Referenced by LIAnalysis::LedTuning().

void LITuning::GcLinearInPinAdc ( std::vector< LIRun >::iterator  gcData,
Int_t  goodPin,
std::vector< LIRun >::iterator &  gcTuned,
Double_t  firstPh,
Double_t  lastPh,
Double_t  firstPin,
Double_t  lastPin 
) [private]

Referenced by CalculateGainCurve().

void LITuning::GcLinearInPmtAdc ( std::vector< LIRun >::iterator  gcData,
Int_t  goodPin,
std::vector< LIRun >::iterator &  gcTuned,
Double_t  firstPh,
Double_t  lastPh,
Double_t  firstPin,
Double_t  lastPin 
) [private]

Referenced by CalculateGainCurve().

Bool_t LITuning::GetDataGcGraphs ( std::vector< TGraph * > &  gGcAdc,
std::vector< TGraph * > &  gAdcFVsPh,
std::vector< TGraph * > &  gPinVsPh,
std::vector< TGraph * > &  gPin2VsPh,
std::vector< TGraphAsymmErrors * > &  gAdcErrVsPh,
std::vector< TGraphAsymmErrors * > &  gAdcFErrVsPh 
)

Referenced by LIAnalysis::LedTuning().

Bool_t LITuning::GetTunedDpGraphs ( TGraph *&  gAdcVsLed,
TGraph *&  gPhVsLed,
TGraph *&  gPinVsLed,
Int_t  numLedsPerPb 
)

Definition at line 2373 of file LITuning.cxx.

References fBestDp, fS, MsgService::Instance(), Msg::kDebug, Msg::kInfo, Msg::kWarning, MSG, and LILookup::TGraphVect().

Referenced by LIAnalysis::LedTuning().

02376 {
02377   MSG("LITuning",Msg::kInfo) 
02378     <<"Running GetTunedDpGraphs method..."<<endl;
02379 
02380   //check if a gain curve has been calculated
02381   if (fBestDp.empty()){
02382     MSG("LITuning",Msg::kWarning)
02383       <<"There is nothing to print, no tuned values have been"
02384       <<" computed for a drift point"<<endl;
02385     return false;
02386   }
02387 
02388   vector<LIRun>::iterator tunedRun;
02389   vector<LIRun>::iterator tunedRunEnd;
02390  
02391   //select the tuned gain curve
02392   tunedRun=fBestDp.begin();
02393   tunedRunEnd=fBestDp.end();
02394   
02395   vector<Double_t> phVector;
02396   vector<Double_t> pinVector;
02397   vector<Double_t> adcVector;
02398   vector<Double_t> ledIndexVector;
02399 
02401   //loop over tuned DPs and fill vectors
02403   while (tunedRun!=tunedRunEnd){
02404 
02405     //get the pulserbox and led 
02406     Int_t pulserBox=tunedRun->GetPb();
02407     Int_t led=tunedRun->GetLed();
02408     //calculate the ledIndex
02409     Int_t ledIndex=pulserBox*numLedsPerPb+led-1;
02410 
02411     phVector.push_back(tunedRun->GetPh(0));
02412     pinVector.push_back(tunedRun->GetPin(2,0));//pin2
02413     adcVector.push_back(tunedRun->GetAdc(0));
02414     ledIndexVector.push_back(ledIndex);
02415 
02416    //print only on debug
02417     if (MsgService::Instance()->IsActive("LITuning",Msg::kDebug)){
02418       tunedRun->PrintAll();
02419     }
02420 
02421     //iterate the li run that you are looking at
02422     tunedRun++;
02423   }
02424 
02425   MSG("LITuning",Msg::kDebug) 
02426     <<"Making graphs..."<<endl;
02427   gAdcVsLed=this->TGraphVect(ledIndexVector,adcVector);
02428   gPhVsLed=this->TGraphVect(ledIndexVector,phVector);
02429   gPinVsLed=this->TGraphVect(ledIndexVector,pinVector);
02430     
02432   //do pmt adc graph
02434   fS="Theoretical Tuned PMT ADC of LEDs";
02435   gAdcVsLed->SetTitle(fS.c_str());
02436   gAdcVsLed->SetFillColor(0);
02437   gAdcVsLed->SetMinimum(-2);
02438 
02440   //do ph graph
02442   fS="Tuned Pulse Height of LEDs";
02443   gPhVsLed->SetTitle(fS.c_str());
02444   gPhVsLed->SetFillColor(0);
02445   gPhVsLed->SetMinimum(-2);
02446 
02448   //do pin adc graph
02450   fS="PIN ADC at Tuned Drift Point Light Levels";
02451   gPinVsLed->SetTitle(fS.c_str());
02452   gPinVsLed->SetFillColor(0);
02453   gPinVsLed->SetMinimum(-2);
02454 
02455   MSG("LITuning",Msg::kDebug) 
02456     <<"Finished GetTunedDpGraphs method"<<endl;
02457   return true;
02458 }

Bool_t LITuning::GetTunedGcPlots ( std::vector< TH2F * > &  hGcAdc,
std::vector< TH2F * > &  hGcPin,
std::vector< TH2F * > &  hGcPh,
Int_t  firstLed,
Int_t  lastLed 
)

Referenced by LIAnalysis::LedTuning().

Int_t LITuning::GoodPin ( std::vector< LIRun >::iterator  currentGc  )  [private]

Referenced by CalculateGainCurve().

void LITuning::InitialiseDataMembers ( Detector::Detector_t  det  )  [private]

Definition at line 60 of file LITuning.cxx.

References bfld::AsString(), exit(), fAdcAtStartOfSaturation, fdADCdPHAtSat, fDetector, fFirstGcPointAdc, fGainCurve, fIdealAdc, fLastGcPointAdc, fMaxPossAdc, fMaxPossPh, fMaxPossPin, fMinHGdPINdPH, fMinLGdPINdPH, fMinPossAdc, fMinPossPh, fMinPossPin, fNumCalibPoints, fNumGainPoints, fPinHighestMaxHG, fPinHighestMaxLG, fPinLowestMaxHG, fPinLowestMaxLG, fPinLowestMinHG, fPinLowestMinLG, fS, Msg::kDebug, Detector::kFar, Msg::kFatal, Detector::kNear, Detector::kUnknown, and MSG.

00061 {
00062   MSG("LITuning", Msg::kDebug) 
00063     <<"Running InitialiseDataMembers method..."<<endl;
00064 
00065   //initialise data members
00066  
00067   if (det==Detector::kFar){
00068     fAdcAtStartOfSaturation=8000;
00069     fdADCdPHAtSat=1;
00070     fDetector=det;
00071     fFirstGcPointAdc=350;
00072     fGainCurve=0;//set pointer to zero
00073     fIdealAdc=3500;
00074     fLastGcPointAdc=13800;
00075     fPinHighestMaxHG=8000;
00076     fPinHighestMaxLG=8000;
00077     fPinLowestMaxHG=400;
00078     fPinLowestMaxLG=200;
00079     fPinLowestMinHG=80;
00080     fPinLowestMinLG=80;
00081     fMaxPossAdc=15000;
00082     fMaxPossPh=1023;
00083     fMaxPossPin=11000;
00084     fMinHGdPINdPH=3;
00085     fMinLGdPINdPH=0.5;
00086     fMinPossAdc=0;
00087     fMinPossPh=0;
00088     fMinPossPin=0;
00089     fNumCalibPoints=15;
00090     fNumGainPoints=20;
00091     fS="";
00092   }
00093   else if (det==Detector::kNear){
00094     //these have not been set properly
00095     //jjh added best guesses on 19/Dec/04
00096     fAdcAtStartOfSaturation=40000;
00097     fdADCdPHAtSat=1;
00098     fDetector=det;
00099     fFirstGcPointAdc=350;
00100     fGainCurve=0;//set pointer to zero
00101     fIdealAdc=5000;
00102     fLastGcPointAdc=30000;
00103     fPinHighestMaxHG=60000;
00104     fPinHighestMaxLG=60000;
00105     fPinLowestMaxHG=100;
00106     fPinLowestMaxLG=100;
00107     fPinLowestMinHG=70;
00108     fPinLowestMinLG=70;
00109     fMaxPossAdc=60000;
00110     fMaxPossPh=1023;
00111     fMaxPossPin=60000;
00112     fMinHGdPINdPH=3;
00113     fMinLGdPINdPH=0.5;
00114     fMinPossAdc=0;
00115     fMinPossPh=0;
00116     fMinPossPin=0;
00117     fNumCalibPoints=15;
00118     fNumGainPoints=20;
00119     fS="";
00120   }
00121   else if (det==Detector::kUnknown){//make default same as FD
00122     fAdcAtStartOfSaturation=8000;
00123     fdADCdPHAtSat=1;
00124     fDetector=Detector::kFar;
00125     fFirstGcPointAdc=350;
00126     fGainCurve=0;//set pointer to zero
00127     fIdealAdc=3500;
00128     fLastGcPointAdc=13800;
00129     fPinHighestMaxHG=8000;
00130     fPinHighestMaxLG=8000;
00131     fPinLowestMaxHG=400;
00132     fPinLowestMaxLG=200;
00133     fPinLowestMinHG=80;
00134     fPinLowestMinLG=80;
00135     fMaxPossAdc=15000;
00136     fMaxPossPh=1023;
00137     fMaxPossPin=11000;
00138     fMinHGdPINdPH=3;
00139     fMinLGdPINdPH=0.5;
00140     fMinPossAdc=0;
00141     fMinPossPh=0;
00142     fMinPossPin=0;
00143     fNumCalibPoints=15;
00144     fNumGainPoints=20;
00145     fS="";
00146   }
00147   else {
00148     MSG("LITuning", Msg::kFatal) 
00149       <<"Detector Type "<<Detector::AsString(fDetector)
00150       <<" not implemented"<<endl
00151       <<"Exiting now..."<<endl<<endl;
00152     exit(0);
00153   }
00154 
00155   MSG("LITuning", Msg::kDebug) 
00156     <<"Finished InitialiseDataMembers method"<<endl;
00157 }

void LITuning::InputDataGc ( std::vector< LIRun > &  gainCurve  ) 

Referenced by LIAnalysis::LedTuning().

Double_t LITuning::Interpolate ( Double_t  y,
Double_t  y2,
Double_t  m,
Double_t  x2 
) [private]

Definition at line 1578 of file LITuning.cxx.

References Msg::kVerbose, and MSG.

Referenced by CalculateDriftPoints().

01580 {
01581   MSG("LITuning",Msg::kVerbose) 
01582     <<"Running Interpolate method..."<<endl;
01583     
01584   //interpolation formula
01585   Double_t x=(y-y2)*m+x2;
01586 
01587   MSG("LITuning",Msg::kVerbose) 
01588     <<"Interpolate method finished"<<endl;
01589   return x;
01590 }

void LITuning::InterpolateAboveOrBelow ( EGcTuningType  tuningType,
std::vector< Double_t >::iterator  adc,
std::vector< Double_t >::iterator  ph,
std::vector< Double_t >::iterator  pin,
Int_t  led,
Int_t  pb,
Double_t &  interpAdc,
Double_t &  interpPh,
Double_t &  interpPin 
) [private]
void LITuning::PrintAll (  ) 

Definition at line 2912 of file LITuning.cxx.

References fGainCurve, Msg::kDebug, Msg::kInfo, MSG, and run().

Referenced by LIAnalysis::LedTuning().

02913 {
02914   MSG("LITuning",Msg::kInfo) 
02915     <<"Running PrintAll method..."<<endl;
02916 
02917   //create iterators
02918   vector<LIRun>::iterator run;
02919   vector<LIRun>::iterator runEnd;
02920 
02921   MSG("LITuning",Msg::kDebug) 
02922     <<"Getting iterators to input gain curve"<<endl;
02923   //get the begining and end of the vector of gain curves
02924   run=fGainCurve->begin();
02925   runEnd=fGainCurve->end();
02926   MSG("LITuning",Msg::kDebug)
02927     <<"Got iterators to input gain curve"<<endl;
02928   
02929   //loop and print out the data stored in the LIRun objects
02930   while (run!=runEnd){
02931     //print out the info stored in the object
02932     run->PrintAll();
02933     //iterate the li run that you are printing out
02934     run++;
02935   }
02936   
02937   MSG("LITuning",Msg::kInfo) 
02938     <<"PrintAll method finished"<<endl;
02939 }

void LITuning::PrintConfig (  ) 

Definition at line 202 of file LITuning.cxx.

References bfld::AsString(), fAdcAtStartOfSaturation, fdADCdPHAtSat, fDetector, fFirstGcPointAdc, fIdealAdc, fLastGcPointAdc, fMaxPossAdc, fMaxPossPh, fMaxPossPin, fMinHGdPINdPH, fMinLGdPINdPH, fMinPossAdc, fMinPossPh, fMinPossPin, fNumCalibPoints, fNumGainPoints, fPinHighestMaxHG, fPinHighestMaxLG, fPinLowestMaxHG, fPinLowestMaxLG, fPinLowestMinHG, fPinLowestMinLG, Msg::kInfo, and MSG.

Referenced by LIAnalysis::LedTuning().

00203 {
00204   MSG("LITuning", Msg::kInfo) 
00205     <<endl
00206     <<"LITuning object has the following configuration:"<<endl
00207     <<"fDetector="<<Detector::AsString(fDetector)<<endl
00208     <<"fNumGainPoints="<<fNumGainPoints<<endl
00209     <<"fIdealAdc="<<fIdealAdc<<endl
00210     <<"fFirstGcPointAdc="<<fFirstGcPointAdc
00211     <<", fLastGcPointAdc="<<fLastGcPointAdc<<endl
00212     <<"fdADCdPHAtSat="<<fdADCdPHAtSat<<endl
00213     <<"fAdcAtStartOfSaturation="<<fAdcAtStartOfSaturation<<endl
00214     <<"fNumCalibPoints="<<fNumCalibPoints<<endl
00215     <<"fPinHighestMaxLG="<<fPinHighestMaxLG
00216     <<", fPinHighestMaxHG="<<fPinHighestMaxHG<<endl
00217     <<"fPinLowestMaxLG="<<fPinLowestMaxLG
00218     <<", fPinLowestMaxHG="<<fPinLowestMaxHG<<endl
00219     <<"fPinLowestMinLG="<<fPinLowestMinLG
00220     <<", fPinLowestMinHG="<<fPinLowestMinHG<<endl
00221     <<"fMinPossAdc="<<fMinPossAdc
00222     <<", fMaxPossAdc="<<fMaxPossAdc<<endl
00223     <<"fMinPossPh="<<fMinPossPh
00224     <<", fMaxPossPh="<<fMaxPossPh<<endl
00225     <<"fMinPossPin="<<fMinPossPin
00226     <<", fMaxPossPin="<<fMaxPossPin<<endl
00227     <<"fMinLGdPINdPH="<<fMinLGdPINdPH
00228     <<", fMinHGdPINdPH="<<fMinHGdPINdPH<<endl
00229     <<endl;
00230 }

void LITuning::PrintFirstLastMsg ( Double_t  firstPh,
Double_t  lastPh,
Double_t  firstPin,
Double_t  lastPin 
) [private]

Definition at line 286 of file LITuning.cxx.

References fNumGainPoints, Msg::kInfo, and MSG.

Referenced by CalculateGainCurve().

00288 {
00289     MSG("LITuning_TuneGc",Msg::kInfo) 
00290       <<"Input calculated first/last GC data points are:"<<endl
00291       <<static_cast<Int_t>(firstPh)<<" < PH < "
00292       <<static_cast<Int_t>(lastPh)<<endl
00293       <<static_cast<Int_t>(firstPin)<<" < PIN < "
00294       <<static_cast<Int_t>(lastPin)<<endl
00295       <<"Number of required GC points = "<<fNumGainPoints<<endl;
00296 }

void LITuning::PrintLedCheckGrid ( LIRun::ELIRunType  LIRunType,
Int_t  firstPb,
Int_t  lastPb,
Int_t  firstLed,
Int_t  lastLed 
)

Definition at line 2231 of file LITuning.cxx.

References fBestDp, fBestGc, Form(), Msg::kDebug, LIRun::kDriftPoint, LIRun::kGainCurve, Msg::kInfo, Msg::kVerbose, Msg::kWarning, and MSG.

Referenced by LIAnalysis::LedTuning().

02234 {
02235   MSG("LITuning",Msg::kDebug) 
02236     <<"Running PrintLedCheckGrid method..."<<endl;
02237  
02238   vector<LIRun>::iterator tunedRun;
02239   vector<LIRun>::iterator tunedRunEnd;
02240 
02241   Int_t totalNumPbs=lastPb-firstPb+1;
02242   Int_t numLedsPerPb=lastLed-firstLed+1;
02243   
02244   //select appropriate vectors depending if the run to 
02245   //be checked is a GC or a DP
02246   if (liRun==LIRun::kGainCurve){
02247     if (fBestGc.empty()){
02248       MSG("LITuning",Msg::kWarning)
02249         <<"There is nothing to print, no tuned values have been"
02250         <<" computed for a gain curve"<<endl;
02251     }
02252     //select the tuned gain curve
02253     tunedRun=fBestGc.begin();
02254     tunedRunEnd=fBestGc.end();
02255   }
02256   else if (liRun==LIRun::kDriftPoint){
02257     if (fBestDp.empty()){
02258       MSG("LITuning",Msg::kWarning)
02259         <<"There is nothing to print, no tuned values have been"
02260         <<" computed for a drift point"<<endl;
02261     }
02262     //select the tuned drift points
02263     tunedRun=fBestDp.begin();
02264     tunedRunEnd=fBestDp.end();
02265   }
02266   
02267   //vector to hold which leds were tuned
02268   vector<Int_t> totalLISystem(totalNumPbs*numLedsPerPb,0);
02269 
02270   //loop over tuned leds
02271   while (tunedRun!=tunedRunEnd){
02272 
02273     //get iterator to the vector of li run points
02274     vector<Double_t> phVector;
02275     phVector=tunedRun->GetPh();
02276 
02277     //check that there is a point present
02278     if (phVector.empty()){
02279       MSG("LITuning",Msg::kWarning)
02280         <<"("<<tunedRun->GetPb()<<":"<<tunedRun->GetLed()
02281         <<") DP is empty"<<endl;
02282       tunedRun++;
02283       continue;
02284     }
02285 
02286     Int_t pb=tunedRun->GetPb();
02287     Int_t led=tunedRun->GetLed();
02288     Int_t ledIndex=pb*numLedsPerPb+led-1;
02289 
02290     if (pb<=lastPb && led<=lastLed &&
02291         pb>=firstPb && led>=firstLed){
02292       totalLISystem[ledIndex]++;
02293     }
02294     else{
02295       MSG("LITuning",Msg::kInfo)
02296         <<"Pulser box and or led are out of expected range:"
02297         <<" PB="<<pb<<", LED="<<led<<endl;
02298     }
02299     tunedRun++;
02300   }
02301   
02302   //variable to hold the output string
02303   string sDataProcessed="";
02304 
02305   //loop over whole li system
02306   for (Int_t pb=firstPb;pb<=lastPb;pb++){
02307     for (Int_t led=firstLed;led<=lastLed;led++){
02308       Int_t ledIndex=pb*numLedsPerPb+led-1;
02309       MSG("LITuning",Msg::kVerbose)
02310         <<"PB="<<pb<<", LED="<<led<<endl;
02311       
02312       string sBox="";
02313       sBox=Form("%d",pb);
02314       if (pb<10) sBox="0"+sBox;
02315       
02316       string sLed="";
02317       sLed=Form("%d",led);
02318       if (led<10) sLed="0"+sLed;
02319       
02320       string sTotalLISystem=Form("%d",totalLISystem[ledIndex]);
02321       static Int_t lastPulserBox=-1;
02322 
02323       if (pb!=lastPulserBox){
02324         MSG("LITuning",Msg::kDebug)
02325           <<"New PB="<<pb<<", LED="<<led<<endl;
02326         
02327         //add prefix to each line in string
02328         if (pb==firstPb){
02329           sDataProcessed+="PB "+sBox+" LEDs: ";
02330         }
02331         else{
02332           sDataProcessed+="\nPB "+sBox+" LEDs: ";
02333         }
02334       }
02335       //keep a record of last pulser box
02336       lastPulserBox=pb;
02337 
02338       //add whether point was tuned      
02339       sDataProcessed+=sTotalLISystem;
02340       
02341       //add comma separations
02342       if (led!=lastLed){
02343         sDataProcessed+=",";
02344       }
02345       
02346       //add spaces every five leds
02347       if (led%5==0){
02348         sDataProcessed+=" ";
02349       }
02350     }
02351   }
02352 
02353   string sLIRunType="non-specified type";
02354   if (liRun==LIRun::kGainCurve){
02355     sLIRunType="Gain Curve";
02356   }
02357   else if (liRun==LIRun::kDriftPoint){
02358     sLIRunType="Drift Point";
02359   }
02360 
02361   //print string
02362   MSG("LITuning",Msg::kInfo)
02363     <<endl<<"Of the "<<totalNumPbs*numLedsPerPb
02364     <<" leds the following were tuned for a "<<sLIRunType<<endl
02365     <<sDataProcessed<<endl;
02366   
02367   MSG("LITuning",Msg::kDebug) 
02368     <<"Finished PrintLedCheckGrid method"<<endl;
02369 }

Int_t LITuning::PrintLIConfig ( LIRun::ELIRunType  LIRunType  ) 

Definition at line 2077 of file LITuning.cxx.

References fBestDp, fBestGc, Form(), fS, MsgService::Instance(), Msg::kDebug, LIRun::kDriftPoint, LIRun::kGainCurve, Msg::kInfo, Msg::kVerbose, Msg::kWarning, and MSG.

Referenced by LIAnalysis::LedTuning().

02078 {
02079   MSG("LITuning",Msg::kDebug) 
02080     <<"Running PrintLIConfig method..."<<endl;
02081 
02082   vector<LIRun>::iterator tunedRun;
02083   vector<LIRun>::iterator tunedRunEnd;
02084 
02085   //select appropriate vectors depending if the run to 
02086   //be printed is a GC or a DP
02087   if (liRun==LIRun::kGainCurve){
02088     if (fBestGc.empty()){
02089       MSG("LITuning",Msg::kWarning)
02090         <<"There is nothing to print, no tuned values have been"
02091         <<" computed for a gain curve"<<endl;
02092       return 0;
02093     }
02094     //select the tuned gain curve
02095     tunedRun=fBestGc.begin();
02096     tunedRunEnd=fBestGc.end();
02097     MSG("LITuning",Msg::kInfo)<<endl<<"<fullCalib>"<<endl;
02098   }
02099   else if (liRun==LIRun::kDriftPoint){
02100     if (fBestDp.empty()){
02101       MSG("LITuning",Msg::kWarning)
02102         <<"There is nothing to print, no tuned values have been"
02103         <<" computed for a drift point"<<endl;
02104       return 0;
02105     }
02106     //select the tuned drift points
02107     tunedRun=fBestDp.begin();
02108     tunedRunEnd=fBestDp.end();
02109     MSG("LITuning",Msg::kInfo)<<endl<<"<driftCalib>"<<endl;
02110   }
02111   
02112   //variable to hold the last pulser box
02113   Int_t lastPulserBox=-1;
02114 
02115   //loop and print out the list of LI run pulse heights 
02116   //in the desired format
02117   while (tunedRun!=tunedRunEnd){
02118 
02119     //get iterators to the vectors of li run points
02120     vector<Double_t> phVector;
02121     vector<Double_t>::iterator ph;
02122     phVector=tunedRun->GetPh();
02123     ph=phVector.begin();
02124 
02125     //check that there is a point present
02126     if (phVector.empty()){
02127       MSG("LITuning",Msg::kWarning)
02128         <<"("<<tunedRun->GetPb()<<":"<<tunedRun->GetLed()
02129         <<") DP is empty"<<endl;
02130       tunedRun++;
02131       continue;
02132     }
02133     else{
02134       //leave a line between pulser boxes
02135       if (tunedRun->GetPb()!=lastPulserBox){
02136         MSG("LITuning",Msg::kInfo)<<endl;
02137       }
02138     }
02139 
02140     //keep a record of last pulser box
02141     lastPulserBox=tunedRun->GetPb();
02142 
02143     //print only on debug
02144     if (MsgService::Instance()->IsActive("LITuning",Msg::kDebug)){
02145       tunedRun->PrintAll();
02146     }
02147 
02148     string sBox="";
02149     sBox=Form("%d",tunedRun->GetPb());
02150     if (tunedRun->GetPb()<10) sBox="0"+sBox;
02151     
02152     string sLed="";
02153     sLed=Form("%d",tunedRun->GetLed());
02154     if (tunedRun->GetLed()<10) sLed="0"+sLed;
02155     
02156     //form the base string
02157     fS="box"+sBox+"led"+sLed+"#I=";
02158 
02159     //loop over all the points in the vector (1 or more)
02160     while(ph!=phVector.end()){
02161 
02162       MSG("LITuning",Msg::kVerbose)
02163         <<"Looping over tuned points"<<endl;
02164 
02165       //round up pulse height
02166       Double_t rem=0;
02167       Double_t iph=0;
02168       rem=modf(*ph,&iph);
02169       if (rem>=0.5) iph++;//round up
02170 
02171       string sPh="";
02172       if (iph<1e6){
02173         sPh=Form("%d",static_cast<Int_t>(iph));
02174       }
02175       else{
02176         sPh="Really high PH!";
02177       }
02178 
02179       MSG("LITuning",Msg::kVerbose)
02180         <<"iph="<<iph
02181         <<", sPh="<<sPh<<endl;
02182 
02183       fS+=sPh;
02184       if (ph<phVector.end()-1) fS+=",";
02185       //iterate the next point
02186       ph++;
02187     }
02188     fS+=";";
02189     //print out the string in the required format
02190     MSG("LITuning",Msg::kInfo)<<fS<<endl; 
02191 
02192     //iterate the li run that you are printing out
02193     tunedRun++;
02194   }
02195 
02196   //print out end tag
02197   if (liRun==LIRun::kGainCurve){
02198     MSG("LITuning",Msg::kInfo)<<endl<<"</fullCalib>"<<endl;
02199   }
02200   else if (liRun==LIRun::kDriftPoint){
02201     MSG("LITuning",Msg::kInfo)<<endl<<"</driftCalib>"<<endl;
02202   }
02203   
02204   //This is the format under which the parameters are specified
02205   //in the config file
02206 
02207   //Label under which we specify LI sequence for drift calib:
02208   //<driftCalib>
02209   //box00led01#I=400;
02210   //box00led02#I=440;
02211   //box00led03#I=510;
02212   //[etc., etc.]
02213   //box15led20#I=390;
02214   //</driftCalib>
02215   
02216   //Label under which we specify LI sequence for gain-curve calib:
02217   //<fullCalib>
02218   //box00led01#I=100,200,300,400,500,600,700,800,900,1000;
02219   //box00led02#I=110,220,330,440,550,660,770,880,990,1023;
02220   //[etc., etc.]
02221   //box15led20#I=98,196,294,392,490,588,686,784,882,980;
02222   //</fullCalib>
02223   
02224   MSG("LITuning",Msg::kDebug) 
02225     <<"PrintLIConfig method finished"<<endl;
02226   return 1;
02227 }

void LITuning::PrintPhMsg ( std::vector< Double_t >::iterator  adc,
std::vector< Double_t >::iterator  ph,
Double_t  interpPh 
) [private]
void LITuning::PrintPhPinMsg ( std::vector< Double_t >::iterator  adc,
std::vector< Double_t >::iterator  ph,
std::vector< Double_t >::iterator  pin,
Double_t  interpPh,
Double_t  interpPin 
) [private]
void LITuning::PrintPinMsg ( std::vector< Double_t >::iterator  pin,
std::vector< Double_t >::iterator  ph,
Double_t  interpAdc,
Double_t  interpPh 
) [private]
void LITuning::SetAdcAtStartOfSaturation ( Double_t  i  )  [inline]

Definition at line 45 of file LITuning.h.

References fAdcAtStartOfSaturation.

void LITuning::SetdADCdPHAtSat ( Double_t  i  )  [inline]

Definition at line 46 of file LITuning.h.

References fdADCdPHAtSat.

Referenced by LIAnalysis::LedTuning().

00046 {fdADCdPHAtSat=i;}

void LITuning::SetFirstGcPointAdc ( Double_t  i  )  [inline]

Definition at line 47 of file LITuning.h.

References fFirstGcPointAdc.

Referenced by LIAnalysis::LedTuning().

00047 {fFirstGcPointAdc=i;}

void LITuning::SetIdealAdc ( Int_t  i  )  [inline]

Definition at line 48 of file LITuning.h.

References fIdealAdc.

Referenced by LIAnalysis::LedTuning().

00048 {fIdealAdc=i;}

void LITuning::SetLastGcPointAdc ( Double_t  i  )  [inline]

Definition at line 49 of file LITuning.h.

References fLastGcPointAdc.

Referenced by LIAnalysis::LedTuning().

00049 {fLastGcPointAdc=i;}

void LITuning::SetMaxPossAdc ( Double_t  i  )  [inline]

Definition at line 56 of file LITuning.h.

References fMaxPossAdc.

00056 {fMaxPossAdc=i;}

void LITuning::SetMaxPossPh ( Double_t  i  )  [inline]

Definition at line 57 of file LITuning.h.

References fMaxPossPh.

00057 {fMaxPossPh=i;}

void LITuning::SetMaxPossPin ( Double_t  i  )  [inline]

Definition at line 58 of file LITuning.h.

References fMaxPossPin.

00058 {fMaxPossPin=i;}

void LITuning::SetMinHGdPINdPH ( Double_t  i  )  [inline]

Definition at line 59 of file LITuning.h.

References fMinHGdPINdPH.

00059 {fMinHGdPINdPH=i;}

void LITuning::SetMinLGdPINdPH ( Double_t  i  )  [inline]

Definition at line 60 of file LITuning.h.

References fMinLGdPINdPH.

00060 {fMinLGdPINdPH=i;}

void LITuning::SetMinPossAdc ( Double_t  i  )  [inline]

Definition at line 61 of file LITuning.h.

References fMinPossAdc.

00061 {fMinPossAdc=i;}

void LITuning::SetMinPossPh ( Double_t  i  )  [inline]

Definition at line 62 of file LITuning.h.

References fMinPossPh.

00062 {fMinPossPh=i;}

void LITuning::SetMinPossPin ( Double_t  i  )  [inline]

Definition at line 63 of file LITuning.h.

References fMinPossPin.

00063 {fMinPossPin=i;}

void LITuning::SetNumCalibPoints ( Int_t  i  ) 

Definition at line 171 of file LITuning.cxx.

References exit(), fNumCalibPoints, Msg::kFatal, and MSG.

Referenced by LIAnalysis::LedTuning().

00172 {
00173   if (i<=1){
00174     MSG("LITuning", Msg::kFatal) 
00175       <<endl
00176       <<" *** Warning: Number of calib points <= 1 *** "<<endl
00177       <<"Data input is most likely a drift point run!"<<endl
00178       <<"Exiting now..."<<endl<<endl;
00179     exit(0);
00180   }
00181 
00182   fNumCalibPoints=i;
00183 }

void LITuning::SetNumGainPoints ( Int_t  i  ) 

Definition at line 187 of file LITuning.cxx.

References exit(), fNumGainPoints, Msg::kFatal, and MSG.

Referenced by LIAnalysis::LedTuning().

00188 {
00189   if (i<=1){
00190     MSG("LITuning", Msg::kFatal) 
00191       <<endl
00192       <<" *** Warning: Number of gain curve points <= 1 *** "<<endl
00193       <<"Exiting now..."<<endl<<endl;
00194     exit(0);
00195   }
00196 
00197   fNumGainPoints=i;
00198 }

void LITuning::SetPinHighestMaxHG ( Double_t  i  )  [inline]

Definition at line 50 of file LITuning.h.

References fPinHighestMaxHG.

00050 {fPinHighestMaxHG=i;}

void LITuning::SetPinHighestMaxLG ( Double_t  i  )  [inline]

Definition at line 51 of file LITuning.h.

References fPinHighestMaxLG.

00051 {fPinHighestMaxLG=i;}

void LITuning::SetPinLowestMaxHG ( Double_t  i  )  [inline]

Definition at line 52 of file LITuning.h.

References fPinLowestMaxHG.

00052 {fPinLowestMaxHG=i;}

void LITuning::SetPinLowestMaxLG ( Double_t  i  )  [inline]

Definition at line 53 of file LITuning.h.

References fPinLowestMaxLG.

00053 {fPinLowestMaxLG=i;}

void LITuning::SetPinLowestMinHG ( Double_t  i  )  [inline]

Definition at line 54 of file LITuning.h.

References fPinLowestMinHG.

00054 {fPinLowestMinHG=i;}

void LITuning::SetPinLowestMinLG ( Double_t  i  )  [inline]

Definition at line 55 of file LITuning.h.

References fPinLowestMinLG.

00055 {fPinLowestMinLG=i;}


Member Data Documentation

Definition at line 158 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetAdcAtStartOfSaturation().

std::vector<LIRun> LITuning::fBestDp [private]
std::vector<LIRun> LITuning::fBestGc [private]

Definition at line 160 of file LITuning.h.

Referenced by CalculateGainCurve(), PrintLedCheckGrid(), and PrintLIConfig().

Double_t LITuning::fdADCdPHAtSat [private]

Definition at line 161 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetdADCdPHAtSat().

Definition at line 162 of file LITuning.h.

Referenced by InitialiseDataMembers(), and PrintConfig().

Double_t LITuning::fFirstGcPointAdc [private]

Definition at line 163 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetFirstGcPointAdc().

std::vector<LIRun>* LITuning::fGainCurve [private]
Int_t LITuning::fIdealAdc [private]

Definition at line 165 of file LITuning.h.

Referenced by CalculateDriftPoints(), InitialiseDataMembers(), PrintConfig(), and SetIdealAdc().

Double_t LITuning::fLastGcPointAdc [private]

Definition at line 166 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetLastGcPointAdc().

Double_t LITuning::fMaxPossAdc [private]

Definition at line 175 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetMaxPossAdc().

Double_t LITuning::fMaxPossPh [private]

Definition at line 176 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetMaxPossPh().

Double_t LITuning::fMaxPossPin [private]

Definition at line 177 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetMaxPossPin().

Double_t LITuning::fMinHGdPINdPH [private]

Definition at line 178 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetMinHGdPINdPH().

Double_t LITuning::fMinLGdPINdPH [private]

Definition at line 179 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetMinLGdPINdPH().

Double_t LITuning::fMinPossAdc [private]

Definition at line 180 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetMinPossAdc().

Double_t LITuning::fMinPossPh [private]

Definition at line 181 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetMinPossPh().

Double_t LITuning::fMinPossPin [private]

Definition at line 182 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetMinPossPin().

Int_t LITuning::fNumCalibPoints [private]

Definition at line 167 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetNumCalibPoints().

Int_t LITuning::fNumGainPoints [private]
Double_t LITuning::fPinHighestMaxHG [private]

Definition at line 169 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetPinHighestMaxHG().

Double_t LITuning::fPinHighestMaxLG [private]

Definition at line 170 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetPinHighestMaxLG().

Double_t LITuning::fPinLowestMaxHG [private]

Definition at line 171 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetPinLowestMaxHG().

Double_t LITuning::fPinLowestMaxLG [private]

Definition at line 172 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetPinLowestMaxLG().

Double_t LITuning::fPinLowestMinHG [private]

Definition at line 173 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetPinLowestMinHG().

Double_t LITuning::fPinLowestMinLG [private]

Definition at line 174 of file LITuning.h.

Referenced by InitialiseDataMembers(), PrintConfig(), and SetPinLowestMinLG().

std::string LITuning::fS [private]

Definition at line 183 of file LITuning.h.

Referenced by GetTunedDpGraphs(), InitialiseDataMembers(), and PrintLIConfig().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1