6 #include "HlitAnalysisSelectorIO.h"
13 : TSelector(), fChain(0), fEvent(0), fHistPx(0), fHistPy(0), fHistPz(0),
14 fHistPxPy(0), fOutputFile(
"hlit-ana.root") {
41 if (
fChain->GetCurrentFile())
42 Printf(
"File : %s",
fChain->GetCurrentFile()->GetName());
57 TString option = GetOption();
59 fHistPx =
new TH1D(
"hPx",
"p_{x}", 100, -5.0, 5.0);
61 fHistPy =
new TH1D(
"hPy",
"p_{y}", 100, -5.0, 5.0);
63 fHistPz =
new TH1D(
"hPz",
"p_{z}", 100, -5.0, 5.0);
67 new TH2D(
"hPxPy",
"p_{x} vs p_{y}", 100, -5.0, 5.0, 100, -5.0, 5.0);
101 fHistPx =
dynamic_cast<TH1D *
>(fOutput->FindObject(
"hPx"));
102 fHistPy =
dynamic_cast<TH1D *
>(fOutput->FindObject(
"hPy"));
103 fHistPz =
dynamic_cast<TH1D *
>(fOutput->FindObject(
"hPz"));
104 fHistPxPy =
dynamic_cast<TH2D *
>(fOutput->FindObject(
"hPxPy"));
107 TCanvas *c =
new TCanvas(
"cP",
"Momentum distributions");
119 TFile *output = TFile::Open(
fOutputFile.Data(),
"RECREATE");
128 return fChain ?
fChain->GetTree()->GetEntry(entry, getall) : 0;
TH2D * fHistPxPy
px vs py distribution
Double_t GetPz() const
Momentum z component.
Double_t GetPy() const
Momentum y component.
TString fOutputFile
Output file name.
TTree * fChain
Pointer to the analyzed TTree or TChain.
virtual void Init(TTree *tree)
HlitTrack * GetTrack(Long64_t id)
virtual void Begin(TTree *)
virtual Bool_t Process(Long64_t entry)
HlitEvent * fEvent
Current Event.
TH1D * fHistPz
pz distribution
virtual void SlaveTerminate()
Double_t GetPx() const
Momentum x component.
TH1D * fHistPx
px distribution
TH1D * fHistPy
py distribution
HlitAnalysisSelectorIO(TTree *tree=0)
virtual ~HlitAnalysisSelectorIO()
Long64_t GetNTrack() const
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
virtual void SlaveBegin(TTree *tree)