6#include "AnalysisTree/Matching.hpp"
11#include <AnalysisTree/Configuration.hpp>
17 fEvent =
new AnalysisTree::EventHeader();
18 fVtxTracks =
new AnalysisTree::TrackDetector();
19 fTofHits =
new AnalysisTree::HitDetector();
20 fVtx2Tof =
new AnalysisTree::Matching();
21 fVtx2Mc =
new AnalysisTree::Matching();
22 if (tree->GetBranch(
"VtxTracks.") ==
nullptr) {
23 Hal::Cout::PrintInfo(
"Lack of VtxTracks in AT", Hal::EInfo::kError);
26 if (tree->GetBranch(
"RecEventHeader.") ==
nullptr) {
27 Hal::Cout::PrintInfo(
"Lack of RecEventHeader in AT", Hal::EInfo::kError);
30 if (tree->GetBranch(
"TofHits.") ==
nullptr) {
31 Hal::Cout::PrintInfo(
"Lack of TofHits in AT", Hal::EInfo::kError);
34 if (tree->GetBranch(
"VtxTracks2TofHits.") ==
nullptr) {
35 Hal::Cout::PrintInfo(
"Lack of VtxTracks2TofHits tracks in AT", Hal::EInfo::kError);
38 tree->SetBranchAddress(
"VtxTracks.", &
fVtxTracks);
39 tree->SetBranchAddress(
"RecEventHeader.", &
fEvent);
40 tree->SetBranchAddress(
"TofHits.", &
fTofHits);
41 tree->SetBranchAddress(
"VtxTracks2TofHits.", &
fVtx2Tof);
42 tree->SetBranchStatus(
"VtxTracks.", 1);
43 tree->SetBranchStatus(
"RecEventHeader.", 1);
44 tree->SetBranchStatus(
"TofHits.", 1);
45 tree->SetBranchStatus(
"VtxTracks2TofHits.", 1);
46 if (tree->GetBranch(
"VtxTracks2SimParticles.")) {
47 tree->SetBranchAddress(
"VtxTracks2SimParticles.", &
fVtx2Mc);
48 tree->SetBranchStatus(
"VtxTracks2SimParticles.", 1);
56 fEvent =
new AnalysisTree::EventHeader();
58 if (tree->GetBranch(
"SimEventHeader.") ==
nullptr)
return kFALSE;
59 if (tree->GetBranch(
"SimParticles.") ==
nullptr)
return kFALSE;
60 tree->SetBranchAddress(
"SimEventHeader.", &
fEvent);
61 tree->SetBranchAddress(
"SimParticles.", &
fParticles);
62 tree->SetBranchStatus(
"SimEventHeader.", 1);
63 tree->SetBranchStatus(
"SimParticles.", 1);
69 TFile* oldFile = gFile;
70 TDirectory* oldDir = gDirectory;
72 TFile* f =
new TFile(file);
73 AnalysisTree::Configuration* conf = (AnalysisTree::Configuration*) f->Get(
"Configuration");
102 TFile* oldFile = gFile;
103 TDirectory* oldDir = gDirectory;
105 TFile* f =
new TFile(inFile);
107 AnalysisTree::Configuration* conf = (AnalysisTree::Configuration*) f->Get(
"Configuration");
109 GetFieldIds().
px = conf->GetBranchConfig(
"SimParticles").GetFieldId(
"px");
110 GetFieldIds().
py = conf->GetBranchConfig(
"SimParticles").GetFieldId(
"py");
111 GetFieldIds().
pz = conf->GetBranchConfig(
"SimParticles").GetFieldId(
"pz");
112 GetFieldIds().
mass = conf->GetBranchConfig(
"SimParticles").GetFieldId(
"mass");
113 GetFieldIds().
pdg = conf->GetBranchConfig(
"SimParticles").GetFieldId(
"pid");
117 GetFieldIds().
freezX = conf->GetBranchConfig(
"SimParticles").GetFieldId(
"xfreez");
118 GetFieldIds().
freezY = conf->GetBranchConfig(
"SimParticles").GetFieldId(
"yfreez");
119 GetFieldIds().
freezZ = conf->GetBranchConfig(
"SimParticles").GetFieldId(
"zfreez");
120 GetFieldIds().
freezT = conf->GetBranchConfig(
"SimParticles").GetFieldId(
"tfreez");
AnalysisTree::EventHeader * fEvent
AnaTreeMcIds & GetFieldIds()
AnalysisTree::Particles * fParticles
Bool_t ConnectToTree(TChain *tree)
void LoadFields(TString inFile)
AnaTreeRecoIds & GetFieldIds()
AnalysisTree::TrackDetector * fVtxTracks
Bool_t ConnectToTree(TChain *tree)
AnalysisTree::Matching * fVtx2Tof
AnalysisTree::Matching * fVtx2Mc
AnalysisTree::HitDetector * fTofHits
AnalysisTree::EventHeader * fEvent
void LoadFields(TString file)