15#include "FairRootManager.h"
16#include "TClonesArray.h"
35 fName =
"FindPrimaryVertex";
50 fName =
"FindPrimaryVertex";
80 cout <<
"-E- CbmFindPrimaryVertex::Init : "
81 <<
"No vertex finder selected! " << endl;
86 FairRootManager* ioman = FairRootManager::Instance();
88 cout <<
"-E- CbmFindPrimaryVertex::Init: "
89 <<
"RootManager not instantised!" << endl;
96 cout <<
"-W- CbmFindPrimaryVertex::Init: No STSTrack array!" << endl;
101 fEvents =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"Event"));
103 LOG(info) << GetName() <<
": Found Event branch; run event-by-event";
105 fEvents =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"CbmEvent"));
107 LOG(info) << GetName() <<
": Found CbmEvent branch; run event-by-event";
109 LOG(info) << GetName() <<
": No event branch found! Run in time-based mode.";
110 LOG(warning) << GetName() <<
"*** The primary vertex finder is not designed to find mutiple vertices.";
111 LOG(warning) << GetName() <<
"*** Running it on an entire time slice will not produce sensible results.";
122 ioman->Register(
"PrimaryVertex.",
"Global",
fPrimVert, IsOutputBranchPersistent(
"PrimaryVertex"));
143 Int_t nTracks =
fTracks->GetEntriesFast();
144 Int_t nTracksUsed = 0;
156 nEvents =
fEvents->GetEntriesFast();
157 for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
161 LOG(debug) << GetName() <<
": Event " << iEvent <<
" " <<
event->GetVertex()->ToString();
162 nTracksUsed += result;
165 if (iEvent == 0) *
fPrimVert = *(
event->GetVertex());
172 logOut << setw(20) << left << GetName() <<
" [";
173 logOut << fixed << setw(8) << setprecision(1) << right << timer.RealTime() * 1000. <<
" ms] ";
174 logOut <<
"TS " <<
fNofTs;
175 if (
fEvents) logOut <<
", events " << nEvents;
176 logOut <<
", tracks used " << nTracksUsed <<
" / " << nTracks;
177 LOG(info) << logOut.str();
193 std::cout << std::endl;
194 LOG(info) <<
"=====================================";
195 LOG(info) << GetName() <<
": Run summary";
196 LOG(info) <<
"Time slices : " <<
fNofTs;
197 LOG(info) <<
"Tracks/ TS : " << fixed << setprecision(2) <<
fNofTracks / Double_t(
fNofTs);
198 LOG(info) <<
"Used Tracks / TS : " << fixed << setprecision(2) <<
fNofTracksUsed / Double_t(
fNofTs);
199 LOG(info) <<
"Time / TS : " << fixed << setprecision(2) << 1000. *
fTimeTot / Double_t(
fNofTs) <<
" ms";
202 LOG(info) <<
"Events / TS : " << fixed << setprecision(2) << Double_t(
fNofEvents) / Double_t(
fNofTs);
203 LOG(info) <<
"Tracks / event : " << fixed << setprecision(2) << Double_t(
fNofTracks) / Double_t(
fNofEvents);
204 LOG(info) <<
"Used tracks / event : " << fixed << setprecision(2)
207 LOG(info) <<
"=====================================";
ClassImp(CbmConverterManager)
Class characterising one event by a collection of links (indices) to data objects,...
virtual void Exec(Option_t *opt)
Double_t fNofTracks
Number of input tracks.
virtual ~CbmFindPrimaryVertex()
CbmPrimaryVertexFinder * fFinder
virtual InitStatus Init()
Int_t fNofEvents
Number of processed events.
Double_t fNofTracksUsed
Number of tracks used for vertex finding.
Int_t fNofTs
Number of processed timeslices.
Double_t fTimeTot
Total execution time [s].
virtual Int_t FindEventVertex(CbmEvent *event, TClonesArray *tracks)=0
virtual Int_t FindPrimaryVertex(TClonesArray *tracks, CbmVertex *vertex)=0