10#include "V0BasicFinder.h"
12#include <RtypesCore.h>
13#include <TClonesArray.h>
14#include <TDatabasePDG.h>
16#include <TParticlePDG.h>
20#include "CutContainer.h"
21#include "CutMonitor.h"
22#include "DataManager.h"
23#include "MemoryMapManager.h"
28#include "TwoTrackCut.h"
29#include "V0Candidate.h"
35 V0BasicFinder::V0BasicFinder() :
36 TrackAna(ECutUpdate::kTwoTrack),
43 fFirstV0Finder(kTRUE),
48 Task::EInitFlag V0BasicFinder::Init() {
51 fFirstV0Finder = kFALSE;
52 fV0Tracks = (TClonesArray*) mngr->GetObject(
"V0Tracks");
54 fV0Tracks =
new TClonesArray(
"Hal::V0Track");
55 mngr->
Register(
"V0Tracks",
"V0", fV0Tracks, fWrite);
58 Task::EInitFlag stat = TrackAna::Init();
59 if (fV0Candiate ==
nullptr) {
60 Cout::PrintInfo(
"No VO candidate class!", EInfo::kError);
61 return Task::EInitFlag::kFATAL;
63 TDatabasePDG* db = TDatabasePDG::Instance();
64 TParticlePDG* particle = db->GetParticle(fV0Pdg);
65 if (particle ==
nullptr)
return Task::EInitFlag::kFATAL;
66 fV0Mass = particle->Mass();
67 particle = db->GetParticle(fPosPdg);
68 if (particle ==
nullptr)
return Task::EInitFlag::kFATAL;
69 fPosMass = particle->Mass();
70 particle = db->GetParticle(fNegPdg);
71 if (particle ==
nullptr)
return Task::EInitFlag::kFATAL;
72 fNegMass = particle->Mass();
77 Package* pack = TrackAna::Report();
84 void V0BasicFinder::ProcessEvent() {
85 TrackAna::ProcessEvent();
86 for (
int i = 0; i < fMemoryMap->GetTracksNo(fCurrentEventCollectionID, 0); i++) {
87 fV0Candiate->AddFirstTrack(fMemoryMap->GetTemporaryTrack(fCurrentEventCollectionID, 0, i));
88 for (
int j = 0; j < fMemoryMap->GetTracksNo(fCurrentEventCollectionID, 1); j++) {
89 fV0Candiate->AddSecondTrack(fMemoryMap->GetTemporaryTrack(fCurrentEventCollectionID, 1, j));
90 fV0Candiate->MakeV0(fPosMass, fNegMass, fV0Pdg, fPosPdg, fNegPdg);
92 if (fCutContainer->PassSignalPair(fV0Candiate, 0)) {
93 V0Track* v0 = (
V0Track*) fV0Tracks->ConstructedAt(fV0Tracks->GetEntriesFast());
94 *v0 = fV0Candiate->GetV0Track();
100 void V0BasicFinder::Exec(Option_t* option) {
101 if (fFirstV0Finder) fV0Tracks->Clear();
102 TrackAna::Exec(option);
105 V0BasicFinder::~V0BasicFinder() {}
107 void V0BasicFinder::AddNegDauCut(
const TrackCut& dau_neg, Option_t* opt) {
108 TString option = opt;
110 if (Hal::Std::FindParam(option,
"fast")) { optz =
"fast"; }
111 if (Hal::Std::FindParam(option,
"re")) { optz = optz +
"+re"; }
112 if (Hal::Std::FindParam(option,
"im")) { optz = optz +
"+im"; }
113 TrackAna::AddCut(dau_neg, optz +
"{1}");
116 void V0BasicFinder::AddPosDauCut(
const TrackCut& pos_cut, Option_t* opt) {
117 TString option = opt;
119 if (Hal::Std::FindParam(option,
"fast")) { optz =
"fast"; }
120 if (Hal::Std::FindParam(option,
"re")) { optz = optz +
"+re"; }
121 if (Hal::Std::FindParam(option,
"im")) { optz = optz +
"+im"; }
122 TrackAna::AddCut(pos_cut, optz +
"{0}");
125 void V0BasicFinder::AddCandicateCut(
const TwoTrackCut& obj, Option_t* opt) { TrackAna::AddCut(obj, opt); }
127 void V0BasicFinder::AddCandicateCutMon(
const CutMonitor& mon, Option_t* opt) { TrackAna::AddCutMonitor(mon, opt); }
129 void V0BasicFinder::SetPDG(Int_t dau1, Int_t dau2, Int_t v0) {
137 void V0BasicFinder::AddNegDauCutMon(
const CutMonitor& mon, Option_t* ) { TrackAna::AddCutMonitor(mon,
"{1}"); }
139 void V0BasicFinder::AddPosDauCutMon(
const CutMonitor& mon, Option_t* ) { TrackAna::AddCutMonitor(mon,
"{0}"); }
141 void V0BasicFinder::LinkCollections() {
142 Int_t eventTrig = fCutContainer->GetEventCollectionsNo();
143 for (
int iEv = 0; iEv < eventTrig; iEv++) {
144 fCutContainer->LinkCollections(ECutUpdate::kEvent, iEv, ECutUpdate::kTrack, 0);
145 fCutContainer->LinkCollections(ECutUpdate::kEvent, iEv, ECutUpdate::kTrack, 1);
146 fCutContainer->LinkCollections(ECutUpdate::kTrack, 0, ECutUpdate::kTwoTrack, 0);
147 fCutContainer->LinkCollections(ECutUpdate::kTrack, 1, ECutUpdate::kTwoTrack, 0);
void Register(const char *name, const char *folderName, TNamed *obj, Bool_t toFile)
Bool_t CheckBranch(const char *BrName)
void AddObject(TObject *object)