10#include "FemtoBasicAna.h"
13#include "CutCollection.h"
14#include "CutContainer.h"
15#include "DataFormatManager.h"
16#include "DividedHisto.h"
19#include "EventBinningCut.h"
20#include "EventVirtualCut.h"
21#include "FemtoConst.h"
23#include "MemoryMapManager.h"
24#include "ObjectMatrix.h"
29#include <TClonesArray.h>
40 fUseImgMomenta(kFALSE),
45 fFreezoutGenerator(nullptr),
57 fUseImgMomenta(ana.fUseImgMomenta),
58 fIgnoreSign(ana.fIgnoreSign),
59 fFsiWeight(ana.fFsiWeight),
62 fFreezoutGenerator(nullptr) {
63 if (ana.
fCFs) { fCFs = (ObjectMatrix_2*) ana.fCFs->Clone(); }
64 if (ana.
fCFTemp) { fCFTemp = (FemtoCorrFunc*) ana.fCFTemp->Clone(); }
65 if (ana.
fFreezoutGenerator) { fFreezoutGenerator = ana.fFreezoutGenerator->MakeCopy(); }
66 if (ana.
fFemtoPair) { fFemtoPair = (FemtoPair*) ana.fFemtoPair->Clone(); }
67 if (ana.
fCalc) { fCalc = (FemtoWeightGenerator*) ana.fCalc->Clone(); }
72 Femto::EKinematics mode = Femto::EKinematics::kLCMS;
74 if (mode == Femto::EKinematics::kPRF) {
76 }
else if (mode == Femto::EKinematics::kLCMS) {
78 }
else if (mode == Femto::EKinematics::kSH_LCMS) {
80 }
else if (mode == Femto::EKinematics::kSH_PRF) {
82 }
else if (mode == Femto::EKinematics::kPRFL) {
84 }
else if (mode == Femto::EKinematics::kPHIETA) {
103 for (
int k = 0; k < cfx_col->
GetSize(); k++) {
112 if (
fPdg1 == 0 || fPdg2 == 0) {
113 Cout::PrintInfo(
"Assumed wrong PID = 0, pion PID will be assumed", EInfo::kLowWarning);
119 Cout::PrintInfo(
"Two track collectionsNo in signal and background are different - this might result in crash",
123 if (!ev->InheritsFrom(
"Hal::ComplexEvent") &&
fUseImgMomenta == kTRUE) {
124 Cout::PrintInfo(
"Can't use fake momenta with current format !", EInfo::kLowWarning);
129 return Task::EInitFlag::kFATAL;
132 Femto::EKinematics kinem = Femto::EKinematics::kLCMS;
135 kinem = Femto::LabelToKinematics(label);
139 Cout::PrintInfo(
"Something wrong is with FemtoPair it cannot be created", EInfo::kError);
140 return Task::EInitFlag::kFATAL;
147 if (dummy->InheritsFrom(
"Hal::FemtoSHCF")) {
148 Cout::PrintInfo(
"Cannot ignore sign with SH correlation function!", EInfo::kError);
154 if (prev != Task::EInitFlag::kSUCCESS) {
155 Cout::PrintInfo(
"Fatal FemtoBasicAna::TwoTrackAna::Init", EInfo::kError);
156 return Task::EInitFlag::kFATAL;
159 if (
fCalc ==
nullptr) {
160 Cout::PrintInfo(
"Weight algorithm not configured, autoconfiguration", EInfo::kLowWarning);
164 Cout::PrintInfo(
"Weight algorithm not initialized correctly", EInfo::kLowWarning);
168 Cout::PrintInfo(Form(
"Failed to init array in %s", ClassName()), EInfo::kError);
169 return Task::EInitFlag::kFATAL;
185 TString opt = option;
186 if (opt.EqualTo(
"ignore_sign")) {
188 }
else if (opt.EqualTo(
"use_im_momenta")) {
190 }
else if (opt.EqualTo(
"background:no")) {
191 Cout::PrintInfo(
"This analysis must have background !", EInfo::kLowWarning);
283 if (two_track_signal != two_track_background) {
285 Cout::PrintInfo(
"Different number of two-track collections in signal and background, fixing", EInfo::kDebugInfo);
288 if (two_track_signal > two_track_background) {
289 for (
int i = two_track_background; i < two_track_signal; i++) {
292 }
else if (two_track_background > two_track_signal) {
293 for (
int i = two_track_signal; i < two_track_background; i++) {
312 FemtoBasicAna::~FemtoBasicAna() {
325 for (
int j = 0; j < cont->
GetNextNo(); j++) {
359 if (h->
GetNum() ==
nullptr) {
360 Hal::Cout::PrintInfo(
"Histogram not found in temp func, number of bin not specified?", Hal::EInfo::kError);
363 TString name = h->GetName();
364 name.ReplaceAll(
"[0]",
"");
372 if (!corrfunc->
Check()) {
373 Cout::PrintInfo(Form(
"Problem with %s::Check", corrfunc->ClassName()), EInfo::kError);
382 if (
this != &other) {
static void PrintInfo(TString text, Hal::EInfo status)
Int_t GetNextAddr(Int_t index) const
Int_t GetTwoTrackCollectionsBackgroundNo() const
void RemoveCollection(ECutUpdate update, Int_t collection)
Int_t GetTwoTrackCollectionsNo() const
CutCollection * GetEventCollection(Int_t collection) const
Bool_t PassTrack(Track *track, const Int_t collection)
TString GetLabel(Int_t i) const
Int_t GetLabelsNo() const
CutContainer * fCutContainer
Int_t fEventCollectionsNo
void AddToAnaMetadata(Package *main_pack, TObject *obj) const
MemoryMapManager * fMemoryMap
Int_t fCurrentEventCollectionID
virtual void AddTags(TString tag)
Track * GetTrack(Int_t i) const
virtual void ProcessPair_Rotated()
FemtoFreezoutGenerator * fFreezoutGenerator
virtual void PreprocessFemtoPair()
virtual void PreprocessFemtoPair_Charged()
virtual Bool_t InitArray()
virtual Package * Report() const
FemtoBasicAna & operator=(const FemtoBasicAna &other)
virtual void ProcessPair_ChargedId()
virtual void PreprocessFemtoPair_Hemisphere()
virtual void ProcessPair()
virtual void SetOption(Option_t *option)
virtual void CheckCutContainerCollections()
virtual void PreprocessFemtoPair_Mixed()
virtual void ProcessEvent()
virtual void ProcessFemtoPair_Mixed()
virtual Task::EInitFlag Init()
virtual void ProcessPair_Perfect()
virtual void ProcessFemtoPair_Perfect()
FemtoWeightGenerator * fCalc
virtual void ProcessFemtoPair_Charged()
virtual void ProcessPair_Mixed()
virtual void ProcessFemtoPair_Rotated()
virtual void PreprocessFemtoPair_Perfect()
virtual void FinishTask()
virtual void ProcessFemtoPair_Hemisphere()
virtual void SetCorrFctn(FemtoCorrFunc *h)
virtual void ProcessFemtoPair()
virtual void ProcessPair_Hemisphere()
virtual void PreprocessFemtoPair_Rotated()
void SetEventCollID(Int_t no)
void SetPairCollID(Int_t no)
DividedHisto1D * GetCF(Int_t i) const
void GenerateFreezoutCooordinates(FemtoPair *Pair)
virtual Package * Report() const
virtual void Compute_Mixed()
virtual void Compute_Hemisphere()=0
virtual void Compute_Charged()
virtual void Compute_Rotated()=0
void Build(TwoTrack *tracks)
void SetWeight(Double_t weight)
virtual Bool_t Init(Int_t task_id, FemtoPair *pair)
virtual Double_t GenerateWeight(FemtoPair *pair)
virtual FemtoWeightGenerator * Clone(const char *="") const
Int_t GetTracksNo(Int_t event_collection, Int_t track_collection) const
void AddTrackToMapTrack(Int_t event_collection, Int_t track_collection, Int_t index)
Int_t GetTemporaryTotalTracksNo() const
void BufferEvent(Int_t collection)
void PrepareMaps(Int_t collection)
virtual void ProcessTrack()
TObject * At(Int_t i) const
ObjectMatrix_1 * Get(Int_t i) const
TObject * At(Int_t i, Int_t j) const
virtual void Init(Int_t sizeX, Int_t sizeY, const TObject *temp)
void AddObject(TObject *object)
Int_t fCurrentTrackCollectionID
TwoTrack * fCurrentSignalPair
virtual void CheckCutContainerCollections()
void EnableNonIdentical()
TwoTrack * fCurrentBackgroundPair
Int_t fTwoTrackCollectionsNo
TwoTrackAna & operator=(const TwoTrackAna &other)
virtual Package * Report() const
Int_t fTwoTrackCollectionsNoBackground
virtual void SetOption(Option_t *option)
Int_t fCurrentPairCollectionID
virtual void FinishEventIdentical()
@ kNoBackgroundNID
kNoBackgroundNID
@ kNoBackgroundID
kNoBackgroundID
virtual void FinishTask()
virtual void FinishEventNonIdentical()
Bool_t IdenticalParticles() const
virtual Task::EInitFlag Init()