FairRoot/PandaRoot
Public Member Functions | Public Attributes | List of all members
DataObject Struct Reference

#include <PndTimeStructureAnaTask.h>

Public Member Functions

 DataObject ()
 
 DataObject (TString branchName)
 
std::vector< Double_tCalcIntegral (TH1 *h1)
 
std::vector< Double_tGetBinCenters (TH1 *h1)
 
void FillGraphs ()
 
void FillGraph (TH1D *theGraph, TH1 *h1)
 
void FillGraphPercent (TH1D *theGraph, TH1 *h1)
 

Public Attributes

TString fBranchName
 
TClonesArray * fBranch
 
TH1D * fTimeHisto
 
TH1D * fEventHisto
 
TH1D * fEventDiffHisto
 
TH1D * fEventGap
 
TH1D * fEventGapPerc
 
TH1D * fOverlap
 
TH1D * fOverlapPerc
 
Int_t fOldEventNr
 
Double_t fOldTimeStamp
 
Bool_t fEventMixture
 
std::map< Int_t, std::pair
< Double_t, Double_t > > 
fEventStartStopMap
 

Detailed Description

Definition at line 28 of file PndTimeStructureAnaTask.h.

Constructor & Destructor Documentation

DataObject::DataObject ( )
inline
DataObject::DataObject ( TString  branchName)
inline

Definition at line 32 of file PndTimeStructureAnaTask.h.

References fBranchName, fEventDiffHisto, fEventHisto, fTimeHisto, and TString.

32  : fBranchName(branchName), fBranch(0), fOldEventNr(-1), fOldTimeStamp(0), fEventMixture(kFALSE)
33  {
34  TString histoName("hBetweenEvents");
35  histoName += fBranchName;
36  TString eventHistoName("hInsideEvent");
37  eventHistoName += fBranchName;
38  TString eventDiffHistoName("hEventLength");
39  eventDiffHistoName += fBranchName;
40  fTimeHisto = new TH1D(histoName, histoName, 10000, 0, 10000);
41  fEventHisto = new TH1D(eventHistoName, eventHistoName, 100, 0, 100);
42  fEventDiffHisto = new TH1D(eventDiffHistoName, eventDiffHistoName, 1000, 0, 1000);
43  }
TClonesArray * fBranch

Member Function Documentation

std::vector<Double_t> DataObject::CalcIntegral ( TH1 *  h1)
inline

Definition at line 44 of file PndTimeStructureAnaTask.h.

References Double_t, and i.

Referenced by FillGraph(), and FillGraphPercent().

44  {
45  std::vector<Double_t> result;
46  Double_t sum = 0;
47  for (int i = 0; i < h1->GetNbinsX(); i++){
48  sum += h1->GetBinContent(i);
49  result.push_back(sum);
50  }
51  return result;
52  }
Int_t i
Definition: run_full.C:25
Double_t
void DataObject::FillGraph ( TH1D *  theGraph,
TH1 *  h1 
)
inline

Definition at line 80 of file PndTimeStructureAnaTask.h.

References CalcIntegral(), GetBinCenters(), and i.

Referenced by FillGraphs().

80  {
81  std::vector<Double_t> values = CalcIntegral(h1);
82  std::vector<Double_t> binCenters = GetBinCenters(h1);
83  for (size_t i = 0; i < values.size(); i++)
84  theGraph->Fill(binCenters[i], values[i]);
85  }
Int_t i
Definition: run_full.C:25
std::vector< Double_t > GetBinCenters(TH1 *h1)
std::vector< Double_t > CalcIntegral(TH1 *h1)
void DataObject::FillGraphPercent ( TH1D *  theGraph,
TH1 *  h1 
)
inline

Definition at line 87 of file PndTimeStructureAnaTask.h.

References CalcIntegral(), GetBinCenters(), and i.

Referenced by FillGraphs().

87  {
88  std::vector<Double_t> values = CalcIntegral(h1);
89  std::vector<Double_t> binCenters = GetBinCenters(h1);
90  for (size_t i = 0; i < values.size(); i++)
91  theGraph->Fill(binCenters[i], values[i]/values.back() * 100.0);
92  }
Int_t i
Definition: run_full.C:25
std::vector< Double_t > GetBinCenters(TH1 *h1)
std::vector< Double_t > CalcIntegral(TH1 *h1)
void DataObject::FillGraphs ( )
inline

Definition at line 61 of file PndTimeStructureAnaTask.h.

References fBranchName, fEventGap, fEventGapPerc, fEventHisto, FillGraph(), FillGraphPercent(), fOverlap, fOverlapPerc, fTimeHisto, and TString.

61  {
62 
63  TString eventGapName = fBranchName + "EventGap";
64  fEventGap = new TH1D(eventGapName.Data(), eventGapName.Data(), fTimeHisto->GetNbinsX(), fTimeHisto->GetXaxis()->GetXmin(), fTimeHisto->GetXaxis()->GetXmax());
66 
67  TString eventGapPercName = fBranchName + "EventGapPerc";
68  fEventGapPerc = new TH1D(eventGapPercName.Data(),eventGapPercName.Data(), fTimeHisto->GetNbinsX(), fTimeHisto->GetXaxis()->GetXmin(), fTimeHisto->GetXaxis()->GetXmax());
70 
71  TString overlapName = fBranchName + "Overlap";
72  fOverlap = new TH1D(overlapName.Data(), overlapName.Data(),fEventHisto->GetNbinsX(), fEventHisto->GetXaxis()->GetXmin(), fEventHisto->GetXaxis()->GetXmax());
74 
75  TString overlapPercName = fBranchName + "OverlapPerc";
76  fOverlapPerc = new TH1D(overlapPercName.Data(), overlapPercName.Data(), fEventHisto->GetNbinsX(), fEventHisto->GetXaxis()->GetXmin(), fEventHisto->GetXaxis()->GetXmax());
78  }
void FillGraph(TH1D *theGraph, TH1 *h1)
void FillGraphPercent(TH1D *theGraph, TH1 *h1)
std::vector<Double_t> DataObject::GetBinCenters ( TH1 *  h1)
inline

Definition at line 54 of file PndTimeStructureAnaTask.h.

References i.

Referenced by FillGraph(), and FillGraphPercent().

54  {
55  std::vector<Double_t> result;
56  for (int i = 0; i < h1->GetNbinsX(); i++){
57  result.push_back(h1->GetBinCenter(i));
58  }
59  return result;
60  }
Int_t i
Definition: run_full.C:25

Member Data Documentation

TClonesArray* DataObject::fBranch

Definition at line 95 of file PndTimeStructureAnaTask.h.

TString DataObject::fBranchName

Definition at line 94 of file PndTimeStructureAnaTask.h.

Referenced by DataObject(), and FillGraphs().

TH1D* DataObject::fEventDiffHisto

Definition at line 98 of file PndTimeStructureAnaTask.h.

Referenced by DataObject().

TH1D* DataObject::fEventGap

Definition at line 99 of file PndTimeStructureAnaTask.h.

Referenced by FillGraphs().

TH1D* DataObject::fEventGapPerc

Definition at line 100 of file PndTimeStructureAnaTask.h.

Referenced by FillGraphs().

TH1D* DataObject::fEventHisto

Definition at line 97 of file PndTimeStructureAnaTask.h.

Referenced by DataObject(), and FillGraphs().

Bool_t DataObject::fEventMixture

Definition at line 105 of file PndTimeStructureAnaTask.h.

std::map<Int_t, std::pair<Double_t, Double_t> > DataObject::fEventStartStopMap

Definition at line 106 of file PndTimeStructureAnaTask.h.

Int_t DataObject::fOldEventNr

Definition at line 103 of file PndTimeStructureAnaTask.h.

Double_t DataObject::fOldTimeStamp

Definition at line 104 of file PndTimeStructureAnaTask.h.

TH1D* DataObject::fOverlap

Definition at line 101 of file PndTimeStructureAnaTask.h.

Referenced by FillGraphs().

TH1D* DataObject::fOverlapPerc

Definition at line 102 of file PndTimeStructureAnaTask.h.

Referenced by FillGraphs().

TH1D* DataObject::fTimeHisto

Definition at line 96 of file PndTimeStructureAnaTask.h.

Referenced by DataObject(), and FillGraphs().


The documentation for this struct was generated from the following file: