Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:27

0001 // $Id: $
0002 
0003 /*!
0004  * \file RawCluster.cc
0005  * \brief
0006  * \author Jin Huang <jhuang@bnl.gov>
0007  * \author Francesco Vassalli <Francesco.Vassalli@colorado.edu>
0008  * \version $Revision: 2  $
0009  * \date $Date: 07/13/18$
0010  */
0011 
0012 #include "RawCluster.h"
0013 
0014 #include <cstdlib>
0015 #include <iostream>
0016 
0017 std::pair<const std::string, RawCluster::PROPERTY_TYPE>
0018 RawCluster::get_property_info(const PROPERTY prop_id)
0019 {
0020   switch (prop_id)
0021   {
0022   case prop_ecore:
0023     return std::make_pair("EM cluster energy estimated with its core towers", RawCluster::type_float);
0024     break;
0025   case prop_prob:
0026     return std::make_pair("cluster template probability for EM shower", RawCluster::type_float);
0027     break;
0028   case prop_chi2:
0029     return std::make_pair("reduced chi2 for EM shower", RawCluster::type_float);
0030     break;
0031   case prop_merged_cluster_prob:
0032     return std::make_pair("cluster template merged pi0 cluster probability for EM shower", RawCluster::type_float);
0033     break;
0034 
0035   case prop_et_iso_calotower_sub_R01:
0036     return std::make_pair("subtracted calortower isolation ET R=.1", RawCluster::type_float);
0037     break;
0038 
0039   case prop_et_iso_calotower_sub_R02:
0040     return std::make_pair("subtracted calortower isolation ET R=.2", RawCluster::type_float);
0041     break;
0042   case prop_et_iso_calotower_sub_R03:
0043     return std::make_pair("subtracted calortower isolation ET R=.3", RawCluster::type_float);
0044     break;
0045   case prop_et_iso_calotower_sub_R04:
0046     return std::make_pair("subtracted calortower isolation ET R=.4", RawCluster::type_float);
0047     break;
0048   case prop_et_iso_calotower_R01:
0049     return std::make_pair("calortower isolation ET R=.1", RawCluster::type_float);
0050     break;
0051   case prop_et_iso_calotower_R02:
0052     return std::make_pair("calortower isolation ET R=.2", RawCluster::type_float);
0053 
0054     break;
0055   case prop_et_iso_calotower_R03:
0056     return std::make_pair("calortower isolation ET R=.3", RawCluster::type_float);
0057     break;
0058   case prop_et_iso_calotower_R04:
0059     return std::make_pair("calortower isolation ET R=.4", RawCluster::type_float);
0060     break;
0061     //  case prop_truth_track_ID:
0062     //    return std::make_pair("truth cluster's PHG4Particle ID", RawCluster::type_int);
0063     //    break;
0064     //  case prop_truth_flavor:
0065     //    return std::make_pair("truth cluster's PHG4Particle flavor", RawCluster::type_int);
0066     //    break;
0067 
0068   default:
0069     std::cout << "RawCluster::get_property_info - Fatal Error - unknown index " << prop_id << std::endl;
0070     exit(1);
0071   }
0072 }
0073 
0074 bool RawCluster::check_property(const PROPERTY prop_id, const PROPERTY_TYPE prop_type)
0075 {
0076   std::pair<const std::string, PROPERTY_TYPE> property_info = get_property_info(prop_id);
0077   if (property_info.second != prop_type)
0078   {
0079     return false;
0080   }
0081   return true;
0082 }
0083 
0084 std::string
0085 RawCluster::get_property_type(const PROPERTY_TYPE prop_type)
0086 {
0087   switch (prop_type)
0088   {
0089   case type_int:
0090     return "int";
0091   case type_uint:
0092     return "unsigned int";
0093   case type_float:
0094     return "float";
0095   default:
0096     return "unkown";
0097   }
0098 }