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

ReweightLooper Class Reference

#include <ReweightLooper.h>

List of all members.

Public Member Functions

 ReweightLooper (std::string, Int_t, Double_t, Double_t)
 ~ReweightLooper ()
void AddDaughter (std::string, Int_t, Double_t, Double_t)
ReweightLooperGetDaughter ()
std::string GetName ()
Double_t GetValue (Int_t)
void ResetCounter ()
Int_t GetNIntervals ()
Bool_t Grind (std::map< std::string, Double_t * >)

Protected Attributes

std::string fVarName
Int_t fNIntervals
Double_t fMin
Double_t fMax
ReweightLooperfDaughter
Int_t fInternalCounter


Constructor & Destructor Documentation

ReweightLooper::ReweightLooper std::string  ,
Int_t  ,
Double_t  ,
Double_t 
 

Definition at line 4 of file ReweightLooper.cxx.

References fDaughter, fInternalCounter, fMax, fMin, fNIntervals, and fVarName.

Referenced by AddDaughter().

00005                                                           {
00006   fVarName = VarName;
00007   fNIntervals = NIntervals;
00008   fMin = Min;
00009   fMax = Max;
00010   fDaughter = NULL;
00011   fInternalCounter = 0;
00012 }

ReweightLooper::~ReweightLooper  ) 
 

Definition at line 14 of file ReweightLooper.cxx.

00014                                 {
00015   std::cout << "Deleting daughter looper" << std::endl;
00016   delete fDaughter;
00017 }


Member Function Documentation

void ReweightLooper::AddDaughter std::string  ,
Int_t  ,
Double_t  ,
Double_t 
 

Definition at line 19 of file ReweightLooper.cxx.

References fDaughter, and ReweightLooper().

00020                                                             {
00021   if(fDaughter) fDaughter->AddDaughter(VarName,NIntervals,Min,Max);
00022   else fDaughter = new ReweightLooper(VarName,NIntervals,Min,Max);
00023 }

ReweightLooper* ReweightLooper::GetDaughter  )  [inline]
 

Definition at line 24 of file ReweightLooper.h.

Referenced by PANAnalysis::MakeReweightTree().

00024 {return fDaughter;}

std::string ReweightLooper::GetName  )  [inline]
 

Definition at line 25 of file ReweightLooper.h.

Referenced by PANAnalysis::MakeReweightTree().

00025 { return fVarName; }

Int_t ReweightLooper::GetNIntervals  )  [inline]
 

Definition at line 28 of file ReweightLooper.h.

00028 { return fNIntervals; }

Double_t ReweightLooper::GetValue Int_t   ) 
 

Definition at line 25 of file ReweightLooper.cxx.

References fMax, fMin, and fNIntervals.

Referenced by Grind().

00025                                          {
00026   if(n<0||n>fNIntervals) return 999;
00027   return fMin + Double_t(n)*(fMax-fMin)/Double_t(fNIntervals);
00028 }

Bool_t ReweightLooper::Grind std::map< std::string, Double_t * >   ) 
 

Definition at line 30 of file ReweightLooper.cxx.

References fDaughter, fInternalCounter, GetValue(), and ResetCounter().

Referenced by PANAnalysis::MakeReweightTree().

00030                                                                   {
00031   if(fInternalCounter<=fNIntervals){
00032     (*variables[fVarName]) = this->GetValue(fInternalCounter);    
00033     if(fDaughter) {
00034       if(!fDaughter->Grind(variables)) {
00035         fInternalCounter += 1;
00036         fDaughter->ResetCounter();
00037         return this->Grind(variables);
00038       }
00039     }
00040     else {
00041       fInternalCounter += 1;
00042     }
00043   }
00044   else return false;
00045   return true;
00046 }

void ReweightLooper::ResetCounter  )  [inline]
 

Definition at line 27 of file ReweightLooper.h.

Referenced by Grind(), and PANAnalysis::MakeReweightTree().

00027 { fInternalCounter = 0; }


Member Data Documentation

ReweightLooper* ReweightLooper::fDaughter [protected]
 

Definition at line 16 of file ReweightLooper.h.

Referenced by AddDaughter(), Grind(), and ReweightLooper().

Int_t ReweightLooper::fInternalCounter [protected]
 

Definition at line 17 of file ReweightLooper.h.

Referenced by Grind(), and ReweightLooper().

Double_t ReweightLooper::fMax [protected]
 

Definition at line 15 of file ReweightLooper.h.

Referenced by GetValue(), and ReweightLooper().

Double_t ReweightLooper::fMin [protected]
 

Definition at line 14 of file ReweightLooper.h.

Referenced by GetValue(), and ReweightLooper().

Int_t ReweightLooper::fNIntervals [protected]
 

Definition at line 13 of file ReweightLooper.h.

Referenced by GetValue(), and ReweightLooper().

std::string ReweightLooper::fVarName [protected]
 

Definition at line 12 of file ReweightLooper.h.

Referenced by ReweightLooper().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:15 2010 for loon by  doxygen 1.3.9.1