00001 #ifndef CLUSTER_CC 00002 #define CLUSTER_CC 00003 00004 #include "cluster.hh" 00005 00006 namespace larlight{ 00007 00008 //############################################################################ 00009 cluster::cluster(DATA::DATA_TYPE type) : data_base(type) 00010 //############################################################################ 00011 { 00012 if( _type != DATA::Cluster && 00013 _type != DATA::FuzzyCluster && 00014 _type != DATA::DBCluster && 00015 _type != DATA::CrawlerCluster && 00016 _type != DATA::HoughCluster && 00017 _type != DATA::ShowerAngleCluster ) 00018 00019 { 00020 Message::send(MSG::ERROR,__FUNCTION__, 00021 Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str())); 00022 00023 _type = DATA::Cluster; 00024 } 00025 00026 clear_data(); 00027 } 00028 00029 00030 //#################################################################################### 00031 event_cluster::event_cluster(DATA::DATA_TYPE type) : std::vector<larlight::cluster>(), 00032 event_base(type) 00033 //#################################################################################### 00034 { 00035 if( _type != DATA::Cluster && 00036 _type != DATA::FuzzyCluster && 00037 _type != DATA::DBCluster && 00038 _type != DATA::CrawlerCluster && 00039 _type != DATA::HoughCluster && 00040 _type != DATA::ShowerAngleCluster ) 00041 00042 { 00043 Message::send(MSG::ERROR,__FUNCTION__, 00044 Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str())); 00045 00046 _type = DATA::Cluster; 00047 } 00048 00049 clear_data(); 00050 00051 } 00052 00053 DATA::DATA_TYPE cluster::get_hit_type() const 00054 { 00055 00056 // Assume there's only 1 unique association 00057 00058 if(size_association(DATA::Hit)) return DATA::Hit; 00059 if(size_association(DATA::GausHit)) return DATA::GausHit; 00060 if(size_association(DATA::RFFHit)) return DATA::RFFHit; 00061 if(size_association(DATA::FFTHit)) return DATA::FFTHit; 00062 if(size_association(DATA::CrawlerHit)) return DATA::CrawlerHit; 00063 if(size_association(DATA::APAHit)) return DATA::APAHit; 00064 else 00065 Message::send(MSG::ERROR,__FUNCTION__,"Did not find any associated hit!"); 00066 return DATA::DATA_TYPE_MAX; 00067 00068 } 00069 00070 DATA::DATA_TYPE event_cluster::get_hit_type() const 00071 { 00072 00073 if(this->size()) return this->at(0).get_hit_type(); 00074 return DATA::DATA_TYPE_MAX; 00075 00076 } 00077 00078 } 00079 00080 #endif 00081