File indexing completed on 2025-08-06 08:13:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #define SCORRELATORUTILITIES_FLOWINFO_CC
0012
0013
0014 #include "FlowInfo.h"
0015
0016
0017 using namespace std;
0018
0019
0020
0021 namespace SColdQcdCorrelatorAnalysis {
0022
0023
0024
0025
0026
0027
0028 void Types::FlowInfo::Minimize() {
0029
0030 id = -1 * numeric_limits<int>::max();
0031 type = -1 * numeric_limits<int>::max();
0032 mass = -1. * numeric_limits<double>::max();
0033 eta = -1. * numeric_limits<double>::max();
0034 phi = -1. * numeric_limits<double>::max();
0035 ene = -1. * numeric_limits<double>::max();
0036 px = -1. * numeric_limits<double>::max();
0037 py = -1. * numeric_limits<double>::max();
0038 pz = -1. * numeric_limits<double>::max();
0039 pt = -1. * numeric_limits<double>::max();
0040 return;
0041
0042 }
0043
0044
0045
0046
0047
0048
0049 void Types::FlowInfo::Maximize() {
0050
0051 id = numeric_limits<int>::max();
0052 type = numeric_limits<int>::max();
0053 mass = numeric_limits<double>::max();
0054 eta = numeric_limits<double>::max();
0055 phi = numeric_limits<double>::max();
0056 ene = numeric_limits<double>::max();
0057 px = numeric_limits<double>::max();
0058 py = numeric_limits<double>::max();
0059 pz = numeric_limits<double>::max();
0060 pt = numeric_limits<double>::max();
0061 return;
0062
0063 }
0064
0065
0066
0067
0068
0069
0070
0071
0072 void Types::FlowInfo::Reset() {
0073
0074 Maximize();
0075 return;
0076
0077 }
0078
0079
0080
0081
0082
0083
0084 void Types::FlowInfo::SetInfo(const ParticleFlowElement* flow) {
0085
0086 id = flow -> get_id();
0087 type = flow -> get_type();
0088 mass = flow -> get_mass();
0089 eta = flow -> get_eta();
0090 phi = flow -> get_phi();
0091 ene = flow -> get_e();
0092 px = flow -> get_px();
0093 py = flow -> get_py();
0094 pz = flow -> get_pz();
0095 pt = flow -> get_pt();
0096 return;
0097
0098 }
0099
0100
0101
0102
0103
0104
0105 bool Types::FlowInfo::IsInAcceptance(const FlowInfo& minimum, const FlowInfo& maximum) const {
0106
0107 return ((*this >= minimum) && (*this <= maximum));
0108
0109 }
0110
0111
0112
0113
0114
0115
0116 bool Types::FlowInfo::IsInAcceptance(const pair<FlowInfo, FlowInfo>& range) const {
0117
0118 return ((*this >= range.first) && (*this <= range.second));
0119
0120 }
0121
0122
0123
0124
0125
0126
0127
0128
0129 vector<string> Types::FlowInfo::GetListOfMembers() {
0130
0131 vector<string> members = {
0132 "id",
0133 "type",
0134 "mass",
0135 "eta",
0136 "phi",
0137 "ene",
0138 "px",
0139 "py",
0140 "pz",
0141 "pt"
0142 };
0143 return members;
0144
0145 }
0146
0147
0148
0149
0150
0151
0152
0153
0154 bool Types::operator <(const FlowInfo& lhs, const FlowInfo& rhs) {
0155
0156
0157 const bool isLessThan = (
0158 (lhs.mass < rhs.mass) &&
0159 (lhs.ene < rhs.ene) &&
0160 (lhs.eta < rhs.eta) &&
0161 (lhs.phi < rhs.phi) &&
0162 (lhs.px < rhs.px) &&
0163 (lhs.py < rhs.py) &&
0164 (lhs.pz < rhs.pz) &&
0165 (lhs.pt < rhs.pt)
0166 );
0167 return isLessThan;
0168
0169 }
0170
0171
0172
0173
0174
0175
0176 bool Types::operator >(const FlowInfo& lhs, const FlowInfo& rhs) {
0177
0178
0179 const bool isGreaterThan = (
0180 (lhs.mass > rhs.mass) &&
0181 (lhs.ene > rhs.ene) &&
0182 (lhs.eta > rhs.eta) &&
0183 (lhs.phi > rhs.phi) &&
0184 (lhs.px > rhs.px) &&
0185 (lhs.py > rhs.py) &&
0186 (lhs.pz > rhs.pz) &&
0187 (lhs.pt > rhs.pt)
0188 );
0189 return isGreaterThan;
0190
0191 }
0192
0193
0194
0195
0196
0197
0198 bool Types::operator <=(const FlowInfo& lhs, const FlowInfo& rhs) {
0199
0200
0201 const bool isLessThanOrEqualTo = (
0202 (lhs.mass < rhs.mass) &&
0203 (lhs.ene < rhs.ene) &&
0204 (lhs.eta < rhs.eta) &&
0205 (lhs.phi < rhs.phi) &&
0206 (lhs.px < rhs.px) &&
0207 (lhs.py < rhs.py) &&
0208 (lhs.pz < rhs.pz) &&
0209 (lhs.pt < rhs.pt)
0210 );
0211 return isLessThanOrEqualTo;
0212
0213 }
0214
0215
0216
0217
0218
0219
0220 bool Types::operator >=(const FlowInfo& lhs, const FlowInfo& rhs) {
0221
0222
0223 const bool isGreaterThanOrEqualTo = (
0224 (lhs.mass > rhs.mass) &&
0225 (lhs.ene > rhs.ene) &&
0226 (lhs.eta > rhs.eta) &&
0227 (lhs.phi > rhs.phi) &&
0228 (lhs.px > rhs.px) &&
0229 (lhs.py > rhs.py) &&
0230 (lhs.pz > rhs.pz) &&
0231 (lhs.pt > rhs.pt)
0232 );
0233 return isGreaterThanOrEqualTo;
0234
0235 }
0236
0237
0238
0239
0240
0241
0242
0243
0244 Types::FlowInfo::FlowInfo() {
0245
0246
0247
0248 }
0249
0250
0251
0252
0253
0254
0255 Types::FlowInfo::~FlowInfo() {
0256
0257
0258
0259 }
0260
0261
0262
0263
0264
0265
0266 Types::FlowInfo::FlowInfo(const Const::Init init) {
0267
0268 switch (init) {
0269 case Const::Init::Minimize:
0270 Minimize();
0271 break;
0272 case Const::Init::Maximize:
0273 Maximize();
0274 break;
0275 default:
0276 Maximize();
0277 break;
0278 }
0279
0280 }
0281
0282
0283
0284
0285
0286
0287 Types::FlowInfo::FlowInfo(const ParticleFlowElement* flow) {
0288
0289 SetInfo(flow);
0290
0291 }
0292
0293 }
0294
0295