10#include "TwoTrackAna.h"
13#include "CutCollection.h"
14#include "CutContainer.h"
15#include "MemoryMapManager.h"
17#include "TrackVirtualCut.h"
19#include "TwoTrackVirtualCut.h"
26 MultiTrackAna((use_background ? ECutUpdate::kTwoTrackBackground : ECutUpdate::kTwoTrackBackground)),
32 fCurrentTrack2CollectionNo(0),
33 fCurrentTrack1CollectionNo(0),
36 fBackgroundMode(kNoBackground),
37 fCurrentPairCollectionID(0),
38 fTwoTrackCollectionsNo(0),
39 fTwoTrackCollectionsNoBackground(0),
40 fCurrentSignalPair(NULL),
41 fCurrentBackgroundPair(NULL) {
61 case kChargedID2:
id =
"Opposite charges 0/0+";
break;
62 case kChargedID3:
id =
"Opposite charges 0/+-";
break;
65 id =
"Opposite charges +-/++ --";
67 id =
"Opposite charges +-/++";
70 default:
id =
"Unknown";
break;
123 Cout::PrintInfo(
"IDENTICAL two track analysis enabled", EInfo::kDebugInfo);
125 Cout::PrintInfo(
"NON-IDENTICAL two track analysis enabled", EInfo::kDebugInfo);
133 TString opt = option;
134 if (opt.EqualTo(
"nonid")) {
137 }
else if (opt.EqualTo(
"id")) {
152 }
else if (opt.EqualTo(
"disable:signs_sum")) {
153 fSignedBoth = kFALSE;
160 if (mixsize > 0)
fMixSize = mixsize;
180 Cout::PrintInfo(
"Not enough track collections i nonid analysis", EInfo::kCriticalError);
186 }
else if (trackTrig > 3) {
187 Cout::PrintInfo(
"Too much track collections (>3) fixing ...", EInfo::kLowWarning);
188 for (
int i = 3; i < trackTrig; i++)
203 Cout::PrintInfo(
"Too much track collections (>1), fixing ..", EInfo::kLowWarning);
204 for (
int i = 1; i < trackTrig; i++)
217 Cout::PrintInfo(
"To much track collections (more than 1) fixing", EInfo::kLowWarning);
218 for (
int i = 2; i < trackTrig; i++)
239 for (
int i = 0; i < eventTrig; i++) {
240 for (
int j = 0; j < trackTrig; j++) {
246 for (
int j = 0; j < twotrackT; j++) {
250 for (
int j = 0; j < twoTrackB; j++) {
257 for (
int j = 0; j < twotrackT; j++) {
261 for (
int j = 0; j < twoTrackB; j++) {
267 for (
int j = 0; j < twotrackT; j++) {
273 for (
int j = 0; j < twoTrackB; j++) {
279 for (
int j = 0; j < twotrackT; j++) {
285 for (
int j = 0; j < twoTrackB; j++) {
290 for (
int i = 0; i < trackTrig; i++) {
291 for (
int j = 0; j < twotrackT; j++) {
296 ECutUpdate::kTwoTrackBackground,
326 MakePairs_Hemisphere();
338 MakePairs_Charged2();
347 MakePairs_Charged3();
349 default:
Cout::PrintInfo(
"Unknown Background mode", EInfo::kWarning);
break;
359 if (tr1 == 0 || tr2 == 0) {
367 MakePairs2_Perfect();
375 MakePairs2_Rotated();
379 MakePairs2_Hemisphere();
387 MakePairs2_Charged2();
394 MakePairs2_Charged3();
397 default:
Cout::PrintInfo(
"Unknown Background mode", EInfo::kWarning);
break;
401 void TwoTrackAna::BuildPair(
TwoTrack* pair) { pair->
FastBuild(fCurrentTrack1, fCurrentTrack2); }
403 void TwoTrackAna::BuildPairSwapped(TwoTrack* pair) {
404#ifdef DISABLE_TWO_TRACK_SWAPPING
405 pair->FastBuild(fCurrentTrack1, fCurrentTrack2);
409 pair->FastBuild(fCurrentTrack1, fCurrentTrack2);
412 pair->FastBuild(fCurrentTrack2, fCurrentTrack1);
438 void TwoTrackAna::MakePairs_Charged2() {
445 for (
int i = 0; i < nTrackA; i++) {
447 for (
int j = 0; j < nTrackB; j++) {
450 for (
int k = 0; k < tt_cut_no; k++) {
458 void TwoTrackAna::MakePairs2_Charged2() {
465 for (
int i = 0; i < nTrack; i++) {
467 for (
int j = i + 1; j < nTrack; j++) {
471 for (
int k = 0; k < tt_cut_no; k++) {
482 for (
int i = 0; i < nTrack; i++) {
484 for (
int j = i + 1; j < nTrack; j++) {
488 for (
int k = 0; k < tt_cut_no; k++) {
499 void TwoTrackAna::MakePairs_Charged3() {
504 for (
int i = 0; i < nTrackA; i++) {
506 for (
int j = 0; j < nTrackB; j++) {
509 for (
int k = 0; k < tt_cut_no; k++) {
517 void TwoTrackAna::MakePairs2_Charged3() {
521 for (
int i = 0; i < nTrack; i++) {
523 for (
int j = i + 1; j < nTrack; j++) {
527 for (
int k = 0; k < tt_cut_no; k++) {
535 TwoTrackAna::~TwoTrackAna() {
544 void TwoTrackAna::MakePairs() {
547 Int_t tt_cut_no = track_cuts->
GetNextNo();
551 for (
int i = 0; i < nTrack; i++) {
553 for (
int j = i + 1; j < nTrack; j++) {
556 for (
int k = 0; k < tt_cut_no; k++) {
565 void TwoTrackAna::MakePairs2() {
569 Int_t tt_cut_no = track_cuts->
GetNextNo();
570 for (
int i = 0; i < nTrackA; i++) {
572 for (
int j = 0; j < nTrackB; j++) {
575 for (
int k = 0; k < tt_cut_no; k++) {
585 void TwoTrackAna::MakePairs_Mixed() {
592 for (
int l = 0; l <
fMixSize; l++) {
595 for (
int i = 0; i < nTrackA; i++) {
597 for (
int j = 0; j < nTrackB; j++) {
600 for (
int m = 0; m < tt_cut_no; m++) {
609 void TwoTrackAna::MakePairs2_Mixed() {
613 for (
int l = 0; l <
fMixSize; l++) {
616 for (
int i = 0; i < nTrackA; i++) {
618 for (
int j = 0; j < nTrackB; j++) {
621 for (
int m = 0; m < tt_cut_no; m++) {
629 for (
int l = 0; l <
fMixSize; l++) {
632 for (
int i = 0; i < nTrackA; i++) {
634 for (
int j = 0; j < nTrackB; j++) {
637 for (
int m = 0; m < tt_cut_no; m++) {
646 void TwoTrackAna::MakePairs_Perfect() {
651 for (
int i = 0; i < nTrack; i++) {
653 for (
int j = i + 1; j < nTrack; j++) {
656 for (
int k = 0; k < tt_cut_no; k++) {
664 void TwoTrackAna::MakePairs2_Perfect() {
669 for (
int i = 0; i < nTrackA; i++) {
671 for (
int j = 0; j < nTrackB; j++) {
674 for (
int k = 0; k < tt_cut_no; k++) {
682 void TwoTrackAna::MakePairs_Rotated() {
687 for (
int i = 0; i < nTrack; i++) {
689 for (
int j = i + 1; j < nTrack; j++) {
692 for (
int k = 0; k < tt_cut_no; k++) {
700 void TwoTrackAna::MakePairs2_Rotated() {
705 for (
int i = 0; i < nTrackA; i++) {
707 for (
int j = 0; j < nTrackB; j++) {
710 for (
int k = 0; k < tt_cut_no; k++) {
718 void TwoTrackAna::MakePairs_Hemisphere() {
722 for (
int i = 0; i < nTrack; i++) {
724 for (
int j = i + 1; j < nTrack; j++) {
727 for (
int k = 0; k < tt_cut_no; k++) {
735 void TwoTrackAna::MakePairs2_Hemisphere() {
740 for (
int i = 0; i < nTrackA; i++) {
742 for (
int j = 0; j < nTrackB; j++) {
745 for (
int k = 0; k < tt_cut_no; k++) {
755 fNonIdIsSet(ana.fNonIdIsSet),
756 fSignedBoth(ana.fSignedBoth),
757 fIdentical(ana.fIdentical),
758 fSwapPair(ana.fSwapPair),
759 fSkipEmpty(ana.fSkipEmpty),
760 fCurrentTrack2CollectionNo(0),
761 fCurrentTrack1CollectionNo(0),
762 fCurrentTrack1(nullptr),
763 fCurrentTrack2(nullptr),
764 fBackgroundMode(ana.fBackgroundMode),
765 fCurrentPairCollectionID(0),
766 fTwoTrackCollectionsNo(0),
767 fTwoTrackCollectionsNoBackground(0),
768 fCurrentSignalPair(nullptr),
769 fCurrentBackgroundPair(nullptr) {}
787 default:
return TwoTrack::kOther;
break;
789 return TwoTrack::kOther;
793 if (
this != &other) {
794 MultiTrackAna::operator =(other);
795 fNonIdIsSet = other.fNonIdIsSet;
796 fSignedBoth = other.fSignedBoth;
797 fIdentical = other.fIdentical;
798 fSwapPair = other.fSwapPair;
799 fSkipEmpty = other.fSkipEmpty;
800 fCurrentTrack1CollectionNo = other.fCurrentTrack1CollectionNo;
801 fCurrentTrack2CollectionNo = other.fCurrentTrack2CollectionNo;
802 if (other.
fCurrentTrack) { fCurrentTrack1 = other.fCurrentTrack1; }
803 if (other.fCurrentTrack2) { fCurrentTrack2 = other.fCurrentTrack2; }
static void PrintInfo(TString text, Hal::EInfo status)
Int_t GetNextAddrBackround(Int_t index) const
Int_t GetNextNoBackround() const
Bool_t PassSignalPair(TwoTrack *pair, const Int_t collection)
Int_t GetTwoTrackCollectionsBackgroundNo() const
void LinkCollections(ECutUpdate opt_low, Int_t in_low, ECutUpdate opt_high, Int_t in_high)
void RemoveCollection(ECutUpdate update, Int_t collection)
Int_t GetTwoTrackCollectionsNo() const
Int_t GetEventCollectionsNo() const
CutCollection * GetTrackCollection(Int_t collection) const
Bool_t PassBackgroundPair(TwoTrack *pair, const Int_t collection)
Int_t GetTrackCollectionsNo() const
CutContainer * fCutContainer
void AddToAnaMetadata(Package *main_pack, TObject *obj) const
MemoryMapManager * fMemoryMap
virtual void AddCut(const Cut &cut, Option_t *opt="")
Int_t fCurrentEventCollectionID
virtual void AddTags(TString tag)
Int_t GetTracksNo(Int_t event_collection, Int_t track_collection) const
void RejectLastEvent(Int_t event_collection)
Bool_t IsReadyToMixing(Int_t collection) const
Track * GetTrack(Int_t event_collection, Int_t track_collection, Int_t index) const
virtual Task::EInitFlag Init()
virtual void InitNewCutContainer()
virtual void SetOption(Option_t *option)
virtual void ProcessEvent()
Int_t fCurrentTrackCollectionID
virtual Package * Report() const
virtual void FinishTask()
Int_t fTrackCollectionsNo
virtual void CheckCutContainerCollections()
TwoTrack * fCurrentSignalPair
virtual void ProcessPair2_Charged2()
virtual void CheckCutContainerCollections()
virtual void ProcessPair2_Charged3()
virtual void InitNewCutContainer()
TwoTrack * fCurrentBackgroundPair
Int_t fTwoTrackCollectionsNo
TwoTrackAna & operator=(const TwoTrackAna &other)
virtual Package * Report() const
virtual void ProcessEvent()
virtual void ProcessPair_Charged2()
static TString BackgroundOptionPerfect()
static TString BackgroundOptionCharge()
virtual void ProcessPair2_Perfect()
Int_t fTwoTrackCollectionsNoBackground
static TString BackgroundOptionNoBackground()
virtual void SetOption(Option_t *option)
virtual void ProcessPair_Perfect()
virtual void ProcessPair2()
virtual void ProcessPair2_Hemisphere()
Int_t fCurrentPairCollectionID
virtual void SetPairHiddenInfo()
virtual void FinishEventIdentical()
@ kHemispherePairsID
kHemispherePairsID
@ kRotatedPairsID
kRotatedPairsID
@ kRotatedPairs
kRotatedPairs
@ kNoBackgroundNID
kNoBackgroundNID
@ kHemispherePairsNID
kHemispherePairsNID
@ kNoBackgroundID
kNoBackgroundID
@ kHemispherePairs
kHemispherePairs
@ kRotatedPairsNID
kRotatedPairsNID
@ kChargedNID2
kChargedNID2
@ kMixedPairsNID
kMixedPairsNID
@ kPerfectPairsID
kPerfectPairsID
@ kNoBackground
kNoBackground
@ kPerfectPairsNID
kPerfectPairsNID
@ kPerfectPairs
kPerfectPairs
@ kMixedPairsID
kMixedPairsID
@ kChargedNID3
kChargedNID3
virtual void ProcessPair_Mixed()
TwoTrackAna(Bool_t use_background=kFALSE)
virtual void ProcessPair2_Mixed()
virtual void ProcessPair2_Rotated()
virtual void ProcessPair_Hemisphere()
virtual void LinkCollections()
static TString BackgroundOptionHemisphere()
static TwoTrack::PairType GetPairType(EAnaMode mode)
virtual void FinishTask()
static TString BackgroundOptionRotated()
virtual void ProcessPair_Charged3()
virtual void DeleteHiddenPairInfo()
virtual void FinishEventNonIdentical()
static TString BackgroundOptionMixed()
virtual void ProcessPair_Rotated()
Bool_t IdenticalParticles() const
virtual void ProcessPair()
void SetMixSize(Int_t mixsize)
virtual Task::EInitFlag Init()
HiddenInfo * GetHiddenInfo() const
void SetHiddenInfo(HiddenInfo *info)
void FastBuild(Track *track1, Track *track2)
void SetSame(Bool_t same)
void SetPairType(PairType type)