CalibrationSmearer Class Reference

#include <CalibrationSmearer.h>

List of all members.

Public Member Functions

 CalibrationSmearer (Int_t size=1001, TRandom *generator=0)
 ~CalibrationSmearer ()
Float_t GetGausSmear (Int_t key) const
const Float_t * GetGausSmears (Int_t key, Int_t n) const

Private Member Functions

 ClassDef (CalibrationSmearer, 0)

Private Attributes

Int_t fN
Float_t * fValues

Detailed Description

Definition at line 33 of file CalibrationSmearer.h.


Constructor & Destructor Documentation

CalibrationSmearer::CalibrationSmearer ( Int_t  size = 1001,
TRandom *  generator = 0 
)

Definition at line 5 of file CalibrationSmearer.cxx.

00005                                                                        :
00006   fN(size),
00007   fValues(0)
00008 {
00009   TRandom* rand = generator;
00010   if(!rand) rand = gRandom;
00011   
00012   fValues = new Float_t[size];
00013   for(int i=0;i<size;i++) {
00014     fValues[i] = rand->Gaus(1.0);
00015   }
00016   
00017 }

CalibrationSmearer::~CalibrationSmearer (  ) 

Definition at line 19 of file CalibrationSmearer.cxx.

References fValues.

00020 {
00021   if(fValues) delete [] fValues;
00022 }  


Member Function Documentation

CalibrationSmearer::ClassDef ( CalibrationSmearer  ,
 
) [private]
Float_t CalibrationSmearer::GetGausSmear ( Int_t  key  )  const

Definition at line 27 of file CalibrationSmearer.cxx.

References fN, and fValues.

00028 {
00029   return fValues[key%fN];
00030 }

const Float_t * CalibrationSmearer::GetGausSmears ( Int_t  key,
Int_t  n 
) const

Definition at line 33 of file CalibrationSmearer.cxx.

References fN, and fValues.

00034 {
00035   return fValues + (key%(fN-n));
00036 }


Member Data Documentation

Int_t CalibrationSmearer::fN [private]

Definition at line 47 of file CalibrationSmearer.h.

Referenced by GetGausSmear(), and GetGausSmears().

Float_t* CalibrationSmearer::fValues [private]

Definition at line 48 of file CalibrationSmearer.h.

Referenced by GetGausSmear(), GetGausSmears(), and ~CalibrationSmearer().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1