Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CentralityInfov2.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CentralityInfov2.cc
1 #include "CentralityInfov2.h"
2 
3 #include <limits>
4 
5 void CentralityInfov2::identify(std::ostream& os) const
6 {
7  os << " CentralityInfo: " << std::endl;
8  os << " Centrile: " << (has_centile(CentralityInfo::PROP::mbd_NS) ? get_centile(CentralityInfo::PROP::mbd_NS) : -999.99) << std::endl;
9  os << " CentBin : " << (has_centrality_bin(CentralityInfo::PROP::mbd_NS) ? get_centrality_bin(CentralityInfo::PROP::mbd_NS) : -999.99) << std::endl;
10 
11  return;
12 }
13 
14 bool CentralityInfov2::has_centrality_bin(const PROP prop_id) const
15 {
16  return _centrality_bin_map.find(prop_id) != _centrality_bin_map.end();
17 }
18 
20 {
21  _centrality_bin_map[prop_id] = value;
22 }
23 
25 {
26  if (!has_centrality_bin(prop_id))
27  {
28  return std::numeric_limits<int>::quiet_NaN();
29  }
30  else
31  {
32  return _centrality_bin_map.at(prop_id);
33  }
34 }