7 #include "StJetFinder/StProtoJet.h"
8 #include "StSpinPool/StJets/StJets.h"
9 #include "StSpinPool/StJetEvent/StJetEvent.h"
12 #include "StjeParticleCollector.h"
13 #include "StjeJetFinderRunner.h"
14 #include "StjeJetCuts.h"
15 #include "StjeTreeWriter.h"
16 #include "StjeDefaultJetTreeWriter.h"
17 #include "StppJetAnalyzer.h"
18 #include "StJetMaker.h"
22 StJetMaker::StJetMaker(
const char* name,
StMuDstMaker* uDstMaker,
const char* outputName)
25 , _treeWriter(_defaultTreeWriter)
29 StJetMaker::~StJetMaker()
31 delete _defaultTreeWriter;
44 StJetBranch* jetBranch =
new StJetBranch(anapars,jetpars,fourPMaker,name);
45 mJetBranches.push_back(jetBranch);
46 _treeWriter->addJetFinder(fourPMaker,&jetBranch->particles,&jetBranch->protojets,name,
new StJets);
51 _treeWriter = treeWriter;
54 Int_t StJetMaker::Init()
56 for (
size_t iBranch = 0; iBranch < mJetBranches.size(); ++iBranch)
57 mJetBranches[iBranch]->jetFinder->Init();
66 for (
size_t iBranch = 0; iBranch < mJetBranches.size(); ++iBranch) {
67 StJetBranch* jetBranch = mJetBranches[iBranch];
68 _treeWriter->fillJetTreeHeader(iBranch);
69 for (
size_t iVertex = 0; iVertex < jetBranch->particleCollector->numberOfVertices(); ++iVertex) {
70 jetBranch->particleCollector->Do(iVertex);
71 jetBranch->jetFinder->Run();
72 jetBranch->jetCuts->Apply();
73 _treeWriter->fillJetTree(iBranch,iVertex);
77 _treeWriter->jetTree()->Fill();
84 _treeWriter->Finish();
89 TTree* StJetMaker::tree()
const
91 return _treeWriter->jetTree();
94 StJets* StJetMaker::getStJets(
const char* branchName)
const
96 TTree* jetTree = _treeWriter->jetTree();
98 TBranch* branch = jetTree->GetBranch(branchName);
99 if (branch)
return *(
StJets**)branch->GetAddress();
104 StJetEvent* StJetMaker::getStJetEvent(
const char* branchName)
const
106 TTree* jetTree = _treeWriter->jetTree();
108 TBranch* branch = jetTree->GetBranch(branchName);
109 if (branch)
return *(
StJetEvent**)branch->GetAddress();