forked from AliceO2Group/O2Physics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMCSignal.cxx
More file actions
103 lines (90 loc) · 5.5 KB
/
Copy pathMCSignal.cxx
File metadata and controls
103 lines (90 loc) · 5.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "PWGDQ/Core/MCSignal.h"
#include "MCProng.h"
#include <TNamed.h>
#include <Rtypes.h>
#include <cstdint>
#include <iostream>
#include <vector>
using std::cout;
using std::endl;
ClassImp(MCSignal);
//________________________________________________________________________________________________
MCSignal::MCSignal() : TNamed("", ""),
fProngs({}),
fNProngs(0),
fCommonAncestorIdxs({}),
fExcludeCommonAncestor(false),
fDecayChannelIsExclusive(false),
fDecayChannelIsNotExclusive(false),
fNAncestorDirectProngs(0),
fTempAncestorLabel(-1)
{
}
//________________________________________________________________________________________________
MCSignal::MCSignal(int nProngs, const char* name /*= ""*/, const char* title /*= ""*/) : TNamed(name, title),
fProngs({}),
fNProngs(nProngs),
fCommonAncestorIdxs({}),
fExcludeCommonAncestor(false),
fDecayChannelIsExclusive(false),
fDecayChannelIsNotExclusive(false),
fNAncestorDirectProngs(0),
fTempAncestorLabel(-1)
{
fProngs.reserve(nProngs);
}
//________________________________________________________________________________________________
MCSignal::MCSignal(const char* name, const char* title, std::vector<MCProng> prongs, std::vector<int8_t> commonAncestors, bool excludeCommonAncestor) : TNamed(name, title),
fProngs(prongs),
fNProngs(prongs.size()),
fCommonAncestorIdxs(commonAncestors),
fExcludeCommonAncestor(excludeCommonAncestor),
fDecayChannelIsExclusive(false),
fDecayChannelIsNotExclusive(false),
fNAncestorDirectProngs(0),
fTempAncestorLabel(-1)
{
}
//________________________________________________________________________________________________
void MCSignal::SetProngs(std::vector<MCProng> prongs, std::vector<int8_t> commonAncestors)
{
fProngs = prongs;
fNProngs = fProngs.size();
fCommonAncestorIdxs = commonAncestors;
}
//________________________________________________________________________________________________
void MCSignal::AddProng(MCProng prong, int8_t commonAncestor)
{
if (fProngs.size() < fNProngs) {
fProngs.push_back(prong);
fCommonAncestorIdxs.push_back(commonAncestor);
} else { // TODO: there should be an error message here
return;
}
}
//________________________________________________________________________________________________
void MCSignal::PrintConfig()
{
cout << "Name/Title: " << fName << " / " << fTitle << endl;
cout << "Exclude common ancestor combinations: " << fExcludeCommonAncestor << endl;
cout << "Decay channel is exclusive: " << fDecayChannelIsExclusive << endl;
cout << "Decay channel is not exclusive: " << fDecayChannelIsNotExclusive << endl;
cout << "Decay channel direct prongs for the common ancestor: " << fNAncestorDirectProngs << endl;
cout << "Printing " << fNProngs << "/" << fProngs.size() << " prongs:" << endl;
int i = 0;
for (auto& pr : fProngs) {
cout << "Prong #" << i << " commonAncestor: " << fCommonAncestorIdxs[i] << " ================ " << endl;
i++;
pr.Print();
}
}