Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
FemtoCorrFunc.cxx
1/*
2 * CorrFuncCollection.cxx
3 *
4 * Created on: 4 lip 2019
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "FemtoCorrFunc.h"
11
12#include "Cout.h"
13#include "HtmlCore.h"
14#include "HtmlTable.h"
15#include "Std.h"
16
17#include <TBrowser.h>
18#include <TCanvas.h>
19#include <TNamed.h>
20#include <TROOT.h>
21#include <TSystem.h>
22
23
24namespace Hal {
25 FemtoCorrFunc::FemtoCorrFunc(const DividedHisto1D* h, Int_t size) {
26 fEventCol.SetName("EventColID");
27 fPairCol.SetName("TrackColID");
28 if (h != NULL && size > 0) {
29 fArray = new ObjectMatrix_1();
30 fArray->Init(size, h);
31 }
32 }
33
34 FemtoCorrFunc::FemtoCorrFunc(const DividedHisto1D& h, Int_t size) {
35 fEventCol.SetName("EventColID");
36 fPairCol.SetName("TrackColID");
37 if (size > 0) {
38 fArray = new ObjectMatrix_1();
39 fArray->Init(size, &h);
40 }
41 }
42
43 void FemtoCorrFunc::Add(const Object* pack) {
44 FemtoCorrFunc* other = (FemtoCorrFunc*) pack;
45 if (other->fArray->GetSize() != fArray->GetSize()) {
46 Cout::PrintInfo("Cannot merge CorrFunc, sizes are different", EInfo::kError);
47 return;
48 } else {
49 for (int i = 0; i < fArray->GetSize(); i++) {
50 DividedHisto1D* this_func = (DividedHisto1D*) fArray->At(i);
51 DividedHisto1D* other_func = (DividedHisto1D*) other->fArray->At(i);
52 this_func->Add(other_func);
53 }
54 }
55 }
56
57 void FemtoCorrFunc::Browse(TBrowser* b) {
58 b->Add(&fEventCol);
59 b->Add(&fPairCol);
60 for (int i = 0; i < fArray->GetSize(); i++) {
61 b->Add(fArray->At(i));
62 }
63 }
64
65 FemtoCorrFunc::FemtoCorrFunc(const FemtoCorrFunc& other) {
66 if (other.fArray) { fArray = (ObjectMatrix_1*) other.fArray->Clone(); }
67 fEventCol = other.fEventCol;
68 fPairCol = other.fPairCol;
69 }
70
71 FemtoCorrFunc& FemtoCorrFunc::operator=(const FemtoCorrFunc& other) {
72 if (this == &other) return *this;
73 if (fArray) delete fArray;
74 if (other.fArray) { fArray = (ObjectMatrix_1*) other.fArray->Clone(); }
75 fEventCol = other.fEventCol;
76 fPairCol = other.fPairCol;
77 return *this;
78 }
79
80 FemtoCorrFunc::~FemtoCorrFunc() {
81 if (fArray) delete fArray;
82 }
83
84} // namespace Hal
static void PrintInfo(TString text, Hal::EInfo status)
Definition Cout.cxx:370
virtual void Add(const Object *h)
virtual void Add(const Object *pack)
Int_t GetSize() const
virtual void Init(Int_t size, const TObject *temp)
TObject * At(Int_t i) const
virtual void Add(const Object *pack)
Definition Object.cxx:24