GhostFakeData Class Reference

#include <GhostFakeData.h>

List of all members.

Public Member Functions

 GhostFakeData (GhostInputs *inputs)
 ~GhostFakeData ()
void SetOscillationParameters (Double_t sin2, Double_t dm2, Double_t mu2=0)
void SetScalingFactors (Double_t det, Double_t rock, Double_t nc, Double_t numubar)
void Set2DSystematicFactors (Double_t *systfactors)
void Set1DSystematicFactors (Double_t *systfactors)
void SetGaussianSystematicFactors (Bool_t gaussian=1)
void AddSample (GhostSample *sample)
void GenerateSpectra (vector< vector< vector< ArrayTH1D * > > > &ret_object)
void Pause ()

Private Attributes

GhostInputsgInputs
Double_t fSin2Chosen
Double_t fDm2Chosen
Double_t fMu2Chosen
Bool_t fGaussianShifts
Int_t fSampleCounter
Double_t fImposedDetScale
Double_t fImposedRockScale
Double_t fImposedNCScale
Double_t fImposedNuMuBarScale
Double_t fCCScale
Double_t fNCScale
TFile * fOutputFile
TString fOutputFileName
TRandom3 * rScale
Double_t * f2DSystematicFactors
Double_t * f1DSystematicFactors
vector< GhostSample * > vFakeDataSamples

Detailed Description

Definition at line 34 of file GhostFakeData.h.


Constructor & Destructor Documentation

GhostFakeData::GhostFakeData ( GhostInputs inputs  ) 

Definition at line 40 of file GhostFakeData.cxx.

References Msg::kInfo, and MSG.

00040                                                 :
00041   fSin2Chosen(-999.9),
00042   fDm2Chosen(-999.9),
00043   fMu2Chosen(-999.9),
00044   fGaussianShifts(0),
00045   fImposedDetScale(0.0),
00046   fImposedRockScale(0.0),
00047   fImposedNCScale(0.0),
00048   fImposedNuMuBarScale(0.0)
00049 {  
00050   MSG("GhostFakeData",Msg::kInfo) << " *-* GhostFakeData::GhostFakeData() *-* " << endl;
00051   vFakeDataSamples.clear();
00052   fSampleCounter = 0;
00053 
00054   gInputs = inputs;
00055 
00056   fOutputFileName = gInputs->fBestFitRootFilename;
00057 }

GhostFakeData::~GhostFakeData (  ) 

Definition at line 59 of file GhostFakeData.cxx.

References fOutputFile, Msg::kInfo, and MSG.

00060 {
00061   MSG("GhostFakeData",Msg::kInfo) << " *-* GhostFakeData::~GhostFakeData() *-* " << endl;
00062   delete fOutputFile;
00063 }


Member Function Documentation

void GhostFakeData::AddSample ( GhostSample sample  )  [inline]

Definition at line 48 of file GhostFakeData.h.

References fSampleCounter, and vFakeDataSamples.

00048 { vFakeDataSamples.push_back(sample); fSampleCounter++; }

void GhostFakeData::GenerateSpectra ( vector< vector< vector< ArrayTH1D * > > > &  ret_object  ) 

Definition at line 67 of file GhostFakeData.cxx.

References f1DSystematicFactors, f2DSystematicFactors, fDm2Chosen, fGaussianShifts, fImposedDetScale, fImposedNCScale, fImposedNuMuBarScale, fImposedRockScale, fMu2Chosen, GhostInputs::fNum1DSysts, GhostInputs::fNum2DSysts, fOutputFile, fOutputFileName, fSin2Chosen, gInputs, Msg::kInfo, MSG, rScale, and vFakeDataSamples.

Referenced by GhostFramework::RunFit().

00067                                                                                    {
00068 
00069   MSG("GhostFakeData",Msg::kInfo) << " *-* GhostFakeData::GenerateSpectra() *-* " << endl;
00070 
00071   fOutputFile = new TFile(fOutputFileName.Data(),"recreate");
00072 
00073   //Loop over samples
00074   for(UInt_t i=0;i<vFakeDataSamples.size();i++){
00075 
00076     MSG("GhostFakeData",Msg::kInfo) << " *-* GhostFakeData::GenerateSpectra() " << (TString)(vFakeDataSamples.at(i)->fSampleName).Data() << " Sample *-*" << endl;
00077  
00078     
00079     //Generate random scales for MDC run
00080     if(fGaussianShifts){
00081       rScale = new TRandom3(0); 
00082       
00083       //2D systematics
00084       for(Int_t j=0;j<gInputs->fNum2DSysts;j++){
00085         f2DSystematicFactors[j] = rScale->Gaus(0,1);
00086       }
00087       
00088       //1D systematics
00089       for(Int_t j=0;j<gInputs->fNum1DSysts;j++){
00090         f1DSystematicFactors[j] = rScale->Gaus(0,1);
00091       }
00092       delete rScale;
00093     }
00094     
00095     MSG("GhostFakeData",Msg::kInfo) << " *-* GhostFakeData::GenerateSpectra() CC Detector NuMu Scaling on Fake Data (/sigma) = " << fImposedDetScale  << " *-*" << endl;
00096     MSG("GhostFakeData",Msg::kInfo) << " *-* GhostFakeData::GenerateSpectra() CC Rock NuMu Scaling on Fake Data (/sigma) = " << fImposedRockScale  << " *-*" << endl;
00097     MSG("GhostFakeData",Msg::kInfo) << " *-* GhostFakeData::GenerateSpectra() NC Scaling on Fake Data (/sigma) = " << fImposedNCScale  << " *-*" << endl;
00098     MSG("GhostFakeData",Msg::kInfo) << " *-* GhostFakeData::GenerateSpectra() NuMuBar Scaling on Fake Data (/sigma) = " << fImposedNuMuBarScale  << " *-*" << endl;
00099 
00100     for(Int_t j=0;j<vFakeDataSamples.at(i)->fNum2DSysts;j++){
00101       MSG("GhostFakeData",Msg::kInfo) << " *-* GhostFakeData::GenerateSpectra() 2D Systematic #" << j << " Scaling on Fake Data (/sigma) = " << f2DSystematicFactors[j] << " *-*" << endl;
00102     }
00103     for(Int_t j=0;j<vFakeDataSamples.at(i)->fNum1DSysts;j++){
00104       MSG("GhostFakeData",Msg::kInfo) << " *-* GhostFakeData::GenerateSpectra() 1D Systematic #" << j << " Scaling on Fake Data (/sigma) = " << f1DSystematicFactors[j] << " *-*" << endl;
00105     }
00106     
00107     //For this sample, "make final prediction"
00108     TString label("FakeData");
00109 
00110     vFakeDataSamples.at(i)->GetSpectrum(fSin2Chosen,fDm2Chosen,fImposedDetScale,fImposedRockScale,fImposedNCScale,fImposedNuMuBarScale,
00111                                         f2DSystematicFactors,f1DSystematicFactors,ret_object.at(i),fOutputFile,label,fMu2Chosen);
00112 
00113   }//EO loop over samples
00114 
00115   fOutputFile->Close();
00116 }

void GhostFakeData::Pause (  ) 

Definition at line 120 of file GhostFakeData.cxx.

References gSystem().

00121 {
00122   cout << "Press return to continue" << endl;
00123 
00124   int key = 0;
00125   while(1){
00126     gSystem->ProcessEvents();
00127     fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK);
00128     key = getchar();
00129     if(key=='\n') break;
00130     usleep(1000);
00131   }
00132 }

void GhostFakeData::Set1DSystematicFactors ( Double_t *  systfactors  )  [inline]

Definition at line 45 of file GhostFakeData.h.

References f1DSystematicFactors.

00045 { f1DSystematicFactors = systfactors; }

void GhostFakeData::Set2DSystematicFactors ( Double_t *  systfactors  )  [inline]

Definition at line 44 of file GhostFakeData.h.

References f2DSystematicFactors.

00044 { f2DSystematicFactors = systfactors; }

void GhostFakeData::SetGaussianSystematicFactors ( Bool_t  gaussian = 1  )  [inline]

Definition at line 46 of file GhostFakeData.h.

References fGaussianShifts.

00046 { fGaussianShifts = gaussian; }    

void GhostFakeData::SetOscillationParameters ( Double_t  sin2,
Double_t  dm2,
Double_t  mu2 = 0 
) [inline]

Definition at line 42 of file GhostFakeData.h.

References fDm2Chosen, fMu2Chosen, and fSin2Chosen.

00042 { fSin2Chosen = sin2; fDm2Chosen = dm2; fMu2Chosen = mu2; }

void GhostFakeData::SetScalingFactors ( Double_t  det,
Double_t  rock,
Double_t  nc,
Double_t  numubar 
) [inline]

Member Data Documentation

Definition at line 79 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and Set1DSystematicFactors().

Definition at line 78 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and Set2DSystematicFactors().

Double_t GhostFakeData::fCCScale [private]

Definition at line 70 of file GhostFakeData.h.

Double_t GhostFakeData::fDm2Chosen [private]

Definition at line 58 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and SetOscillationParameters().

Definition at line 60 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and SetGaussianSystematicFactors().

Double_t GhostFakeData::fImposedDetScale [private]

Definition at line 64 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and SetScalingFactors().

Double_t GhostFakeData::fImposedNCScale [private]

Definition at line 66 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and SetScalingFactors().

Definition at line 67 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and SetScalingFactors().

Definition at line 65 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and SetScalingFactors().

Double_t GhostFakeData::fMu2Chosen [private]

Definition at line 59 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and SetOscillationParameters().

Double_t GhostFakeData::fNCScale [private]

Definition at line 71 of file GhostFakeData.h.

TFile* GhostFakeData::fOutputFile [private]

Definition at line 73 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and ~GhostFakeData().

TString GhostFakeData::fOutputFileName [private]

Definition at line 74 of file GhostFakeData.h.

Referenced by GenerateSpectra().

Definition at line 61 of file GhostFakeData.h.

Referenced by AddSample().

Double_t GhostFakeData::fSin2Chosen [private]

Definition at line 57 of file GhostFakeData.h.

Referenced by GenerateSpectra(), and SetOscillationParameters().

Definition at line 54 of file GhostFakeData.h.

Referenced by GenerateSpectra().

TRandom3* GhostFakeData::rScale [private]

Definition at line 76 of file GhostFakeData.h.

Referenced by GenerateSpectra().

Definition at line 80 of file GhostFakeData.h.

Referenced by AddSample(), and GenerateSpectra().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1