Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
CorrFitPairGeneratorYPtKtStubborn.cxx
1/*
2 * CorrFitPairGeneratorYPtStubbornSubborn.cxx
3 *
4 * Created on: 29 lut 2024
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "CorrFitPairGeneratorYPtKtStubborn.h"
10
11#include "FemtoCorrFuncKt.h"
12#include "FemtoMiniPair.h"
13
14#include <RtypesCore.h>
15#include <TAxis.h>
16#include <TClonesArray.h>
17#include <TDatabasePDG.h>
18#include <TFile.h>
19#include <TMath.h>
20#include <TMathBase.h>
21#include <TObjArray.h>
22#include <TParticlePDG.h>
23#include <TRandom.h>
24#include <TTree.h>
25
26namespace Hal {
27 CorrFitPairGeneratorYPtKtStubborn::CorrFitPairGeneratorYPtKtStubborn() {}
28
29 CorrFitPairGeneratorYPtKtStubborn::~CorrFitPairGeneratorYPtKtStubborn() {}
30
31 void CorrFitPairGeneratorYPtKtStubborn::GenerateEvent() {
32 switch (fGroupingFlag) {
33 case EGrouping::kOneDim: {
34 int size1d = fLimitsN.GetSize() - 1;
35 int bin = -1;
36 int counted = 0;
37 int startBin = fLimitsN[1];
38 do {
39 bin = GeneratePairOneDim();
40 if (bin < 1) continue;
41 if (fLimitsN[bin] == startBin) {
42 auto array = fSignalPairs[bin];
43 fLimitsN.IncrementAfter(bin);
44 auto pair = (FemtoMicroPair*) array->ConstructedAt(array->GetEntriesFast());
45 *pair = fPair;
46 counted++;
47 }
48 } while (counted != size1d);
49 } break;
50 case EGrouping::kThreeDim: {
51 int size1d = fLimits3D.GetSize() - 1;
52 int size2d = fLimits3D[1].GetSize() - 1;
53 int size3d = fLimits3D[1][1].GetSize() - 1;
54 int totalSize = size1d * size2d * size3d - 1;
55 int counted = 0;
56 int startBin = fLimits3D[1][1][1];
57 int nPairs = 0;
58 do {
59 auto bin = GeneratePairThreeDim();
60 nPairs++;
61 if (bin.x < 1) continue;
62 if (bin.y < 1) continue;
63 if (bin.z < 1) continue;
64 if (fLimits3D[bin.x][bin.y][bin.z] == startBin) {
65 auto array = fSignalPairs[bin.z - 1];
66 auto pair = (FemtoMicroPair*) array->ConstructedAt(array->GetEntriesFast());
67 fLimits3D.IncrementAfter(bin.x, bin.y, bin.z);
68 *pair = fPair;
69 counted++;
70 }
71 } while (counted != totalSize);
72 for (int i = 0; i < totalSize; i++) {
73 for (auto sig : fSignalPairs) {
74 auto pair = (FemtoMicroPair*) sig->ConstructedAt(0);
75 *fHbtPair = *pair;
76 fHbtPair->Compute();
77 }
78 }
79 } break;
80 }
81 }
82
83} // namespace Hal
T IncrementAfter(Int_t i)
Definition Array.h:116
Int_t GetSize() const
Definition Array.h:50
Int_t GetSize() const
Definition Array.h:221
T IncrementAfter(Int_t A, Int_t B, Int_t C)
Definition Array.h:256
virtual void Compute()=0