SysHists2D Class Reference

#include <SysHists2D.h>

List of all members.

Public Member Functions

 SysHists2D (std::string)
 ~SysHists2D ()
void SetRecoBins (int n, double *edges)
void SetPIDBins (int n, double *edges)
void SetTrueBins (int n, double *edges)
void AddPID (std::string pid)
void InitializeHists ()
int GetRecoBins ()
int GetPIDBins ()
int GetTrueBins ()

Public Attributes

TDirectory * fDirectory
TH2D * ND_TrueVsReco
TH2D * FD_TrueVsReco
std::map< std::string, TH2D * > ND_RecoVsPID
std::map< std::string, TH2D * > FD_RecoVsPID
TH2D * ND_TrueVsReco_ErrorHist
TH2D * FD_TrueVsReco_ErrorHist
std::map< std::string, TH2D * > ND_RecoVsPID_ErrorHist
std::map< std::string, TH2D * > FD_RecoVsPID_ErrorHist

Private Attributes

int nReco
int nTrue
int nPID
vector< double > RecoEdges
vector< double > PIDEdges
vector< double > TrueEdges
vector< std::string > PIDlist

Detailed Description

Definition at line 13 of file SysHists2D.h.


Constructor & Destructor Documentation

SysHists2D::SysHists2D ( std::string  name  ) 

Definition at line 3 of file SysHists2D.cxx.

References fDirectory, nPID, nReco, nTrue, PIDEdges, RecoEdges, and TrueEdges.

00004 {
00005   fDirectory = new TDirectory(name.c_str(),name.c_str());
00006   
00007   int i;
00008   
00009   nReco = 100;
00010   for(i=0;i<nReco+1;i++)
00011   {
00012     RecoEdges.push_back(i*1.);
00013   }
00014   nTrue = 1200;
00015   for(i=0;i<nTrue+1;i++)
00016   {
00017     TrueEdges.push_back(i*0.1);
00018   }
00019   nPID = 20;
00020   for(i=0;i<nPID+1;i++)
00021   {
00022     PIDEdges.push_back(i*0.05);
00023   }
00024 }

SysHists2D::~SysHists2D (  ) 

Definition at line 26 of file SysHists2D.cxx.

00027 {
00028 }


Member Function Documentation

void SysHists2D::AddPID ( std::string  pid  ) 

Definition at line 71 of file SysHists2D.cxx.

References PIDlist.

Referenced by SysFileGen2D::InitializeHistograms().

00072 {
00073   PIDlist.push_back(pid);
00074   
00075   return;
00076 }

int SysHists2D::GetPIDBins (  )  [inline]

Definition at line 43 of file SysHists2D.h.

References nPID.

Referenced by SysFileGen2D::FinalizeHistograms().

00043 { return nPID; };

int SysHists2D::GetRecoBins (  )  [inline]

Definition at line 42 of file SysHists2D.h.

References nReco.

Referenced by SysFileGen2D::FinalizeHistograms().

00042 { return nReco; };

int SysHists2D::GetTrueBins (  )  [inline]

Definition at line 44 of file SysHists2D.h.

00044 { return nTrue; };

void SysHists2D::InitializeHists (  ) 

Definition at line 77 of file SysHists2D.cxx.

References FD_RecoVsPID, FD_RecoVsPID_ErrorHist, FD_TrueVsReco, FD_TrueVsReco_ErrorHist, Form(), ND_RecoVsPID, ND_RecoVsPID_ErrorHist, ND_TrueVsReco, ND_TrueVsReco_ErrorHist, nPID, nReco, nTrue, PIDEdges, PIDlist, RecoEdges, and TrueEdges.

Referenced by SysFileGen2D::InitializeHistograms().

00078 {
00079   double *redges = new double[nReco+1];
00080   double *tedges = new double[nTrue+1];
00081   double *pedges = new double[nPID+1];
00082   int i;
00083   for(i=0;i<nReco+1;i++)
00084   {
00085     redges[i] = RecoEdges.at(i);
00086   }
00087   for(i=0;i<nTrue+1;i++)
00088   {
00089     tedges[i] = TrueEdges.at(i);
00090   }
00091   for(i=0;i<nPID+1;i++)
00092   {
00093     pedges[i] = PIDEdges.at(i);
00094   }
00095   
00096   ND_TrueVsReco = new TH2D("ND_TrueVsReco","",nReco,redges,nTrue,tedges);
00097   FD_TrueVsReco = new TH2D("FD_TrueVsReco","",nReco,redges,nTrue,tedges);
00098   ND_TrueVsReco_ErrorHist = new TH2D("ND_TrueVsReco_ErrorHist","",nReco,redges,nTrue,tedges);
00099   FD_TrueVsReco_ErrorHist = new TH2D("FD_TrueVsReco_ErrorHist","",nReco,redges,nTrue,tedges);
00100   
00101   ND_RecoVsPID.clear();
00102   FD_RecoVsPID.clear();
00103   ND_RecoVsPID_ErrorHist.clear();
00104   FD_RecoVsPID_ErrorHist.clear();
00105   
00106   TH2D *h;
00107   int np = PIDlist.size();
00108   for(i=0;i<np;i++)
00109   {
00110     h = new TH2D(Form("ND_RecoVs%s",PIDlist[i].c_str()),"",nPID,pedges,nReco,redges);
00111     ND_RecoVsPID[PIDlist[i]] = h;
00112     
00113     h = new TH2D(Form("FD_RecoVs%s",PIDlist[i].c_str()),"",nPID,pedges,nReco,redges);
00114     FD_RecoVsPID[PIDlist[i]] = h;
00115     
00116     h = new TH2D(Form("ND_RecoVs%s_ErrorHist",PIDlist[i].c_str()),"",nPID,pedges,nReco,redges);
00117     ND_RecoVsPID_ErrorHist[PIDlist[i]] = h;
00118     
00119     h = new TH2D(Form("FD_RecoVs%s_ErrorHist",PIDlist[i].c_str()),"",nPID,pedges,nReco,redges);
00120     FD_RecoVsPID_ErrorHist[PIDlist[i]] = h;
00121   }
00122   
00123   ND_TrueVsReco->Sumw2();
00124   FD_TrueVsReco->Sumw2();
00125   ND_TrueVsReco_ErrorHist->Sumw2();
00126   FD_TrueVsReco_ErrorHist->Sumw2();
00127   for(i=0;i<np;i++)
00128   {
00129     ND_RecoVsPID[PIDlist[i]]->Sumw2();
00130     FD_RecoVsPID[PIDlist[i]]->Sumw2();
00131     ND_RecoVsPID_ErrorHist[PIDlist[i]]->Sumw2();
00132     FD_RecoVsPID_ErrorHist[PIDlist[i]]->Sumw2();
00133   }
00134   
00135   delete [] redges;
00136   delete [] tedges;
00137   delete [] pedges;
00138   
00139   return;
00140 }

void SysHists2D::SetPIDBins ( int  n,
double *  edges 
)

Definition at line 57 of file SysHists2D.cxx.

References nPID, and PIDEdges.

00058 {
00059   int i;
00060   
00061   nPID = n;
00062   
00063   PIDEdges.clear();
00064   for(i=0;i<nPID+1;i++)
00065   {
00066     PIDEdges.push_back(edges[i]);
00067   }
00068   
00069   return;
00070 }

void SysHists2D::SetRecoBins ( int  n,
double *  edges 
)

Definition at line 29 of file SysHists2D.cxx.

References nReco, and RecoEdges.

00030 {
00031   int i;
00032   
00033   nReco = n;
00034   
00035   RecoEdges.clear();
00036   for(i=0;i<nReco+1;i++)
00037   {
00038     RecoEdges.push_back(edges[i]);
00039   }
00040   
00041   return;
00042 }

void SysHists2D::SetTrueBins ( int  n,
double *  edges 
)

Definition at line 43 of file SysHists2D.cxx.

References nTrue, and TrueEdges.

00044 {
00045   int i;
00046   
00047   nTrue = n;
00048   
00049   TrueEdges.clear();
00050   for(i=0;i<nTrue+1;i++)
00051   {
00052     TrueEdges.push_back(edges[i]);
00053   }
00054   
00055   return;
00056 }


Member Data Documentation

std::map<std::string, TH2D*> SysHists2D::FD_RecoVsPID
std::map<std::string, TH2D*> SysHists2D::FD_RecoVsPID_ErrorHist

Definition at line 24 of file SysHists2D.h.

Referenced by InitializeHists(), and SysFileGen2D::ResetHistograms().

Definition at line 30 of file SysHists2D.h.

Referenced by InitializeHists(), and SysFileGen2D::ResetHistograms().

std::map<std::string, TH2D*> SysHists2D::ND_RecoVsPID
std::map<std::string, TH2D*> SysHists2D::ND_RecoVsPID_ErrorHist

Definition at line 23 of file SysHists2D.h.

Referenced by InitializeHists(), and SysFileGen2D::ResetHistograms().

Definition at line 29 of file SysHists2D.h.

Referenced by InitializeHists(), and SysFileGen2D::ResetHistograms().

int SysHists2D::nPID [private]

Definition at line 50 of file SysHists2D.h.

Referenced by GetPIDBins(), InitializeHists(), SetPIDBins(), and SysHists2D().

int SysHists2D::nReco [private]

Definition at line 44 of file SysHists2D.h.

Referenced by GetRecoBins(), InitializeHists(), SetRecoBins(), and SysHists2D().

int SysHists2D::nTrue [private]

Definition at line 49 of file SysHists2D.h.

Referenced by InitializeHists(), SetTrueBins(), and SysHists2D().

vector<double> SysHists2D::PIDEdges [private]

Definition at line 53 of file SysHists2D.h.

Referenced by InitializeHists(), SetPIDBins(), and SysHists2D().

vector<std::string> SysHists2D::PIDlist [private]

Definition at line 56 of file SysHists2D.h.

Referenced by AddPID(), and InitializeHists().

vector<double> SysHists2D::RecoEdges [private]

Definition at line 52 of file SysHists2D.h.

Referenced by InitializeHists(), SetRecoBins(), and SysHists2D().

vector<double> SysHists2D::TrueEdges [private]

Definition at line 54 of file SysHists2D.h.

Referenced by InitializeHists(), SetTrueBins(), and SysHists2D().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1