Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawCluster.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawCluster.cc
1 // $Id: $
2 
12 #include "RawCluster.h"
13 
14 #include <cstdlib>
15 #include <iostream>
16 
17 using namespace std;
18 
19 std::pair<const std::string, RawCluster::PROPERTY_TYPE>
21 {
22  switch (prop_id)
23  {
24  case prop_ecore:
25  return make_pair("EM cluster energy estimated with its core towers", RawCluster::type_float);
26  break;
27  case prop_prob:
28  return make_pair("cluster template probability for EM shower", RawCluster::type_float);
29  break;
30  case prop_chi2:
31  return make_pair("reduced chi2 for EM shower", RawCluster::type_float);
32  break;
33 
34  case prop_et_iso_calotower_sub_R01:
35  return make_pair("subtracted calortower isolation ET R=.1", RawCluster::type_float);
36  break;
37 
38  case prop_et_iso_calotower_sub_R02:
39  return make_pair("subtracted calortower isolation ET R=.2", RawCluster::type_float);
40  break;
41  case prop_et_iso_calotower_sub_R03:
42  return make_pair("subtracted calortower isolation ET R=.3", RawCluster::type_float);
43  break;
44  case prop_et_iso_calotower_sub_R04:
45  return make_pair("subtracted calortower isolation ET R=.4", RawCluster::type_float);
46  break;
47  case prop_et_iso_calotower_R01:
48  return make_pair("calortower isolation ET R=.1", RawCluster::type_float);
49  break;
50  case prop_et_iso_calotower_R02:
51  return make_pair("calortower isolation ET R=.2", RawCluster::type_float);
52 
53  break;
54  case prop_et_iso_calotower_R03:
55  return make_pair("calortower isolation ET R=.3", RawCluster::type_float);
56  break;
57  case prop_et_iso_calotower_R04:
58  return make_pair("calortower isolation ET R=.4", RawCluster::type_float);
59  break;
60  // case prop_truth_track_ID:
61  // return make_pair("truth cluster's PHG4Particle ID", RawCluster::type_int);
62  // break;
63  // case prop_truth_flavor:
64  // return make_pair("truth cluster's PHG4Particle flavor", RawCluster::type_int);
65  // break;
66 
67  default:
68  cout << "RawCluster::get_property_info - Fatal Error - unknown index " << prop_id << endl;
69  exit(1);
70  }
71 }
72 
73 bool RawCluster::check_property(const PROPERTY prop_id, const PROPERTY_TYPE prop_type)
74 {
75  pair<const string, PROPERTY_TYPE> property_info = get_property_info(prop_id);
76  if (property_info.second != prop_type)
77  {
78  return false;
79  }
80  return true;
81 }
82 
83 string
85 {
86  switch (prop_type)
87  {
88  case type_int:
89  return "int";
90  case type_uint:
91  return "unsigned int";
92  case type_float:
93  return "float";
94  default:
95  return "unkown";
96  }
97 }