1111
1212// / \file EMCALClusters.h
1313// / \brief Table definitions for EMCAL analysis clusters
14- // / \author Raymond Ehlers <raymond.ehlers@cern.ch>, ORNL
14+ // / \author Raymond Ehlers <raymond.ehlers@cern.ch>, ORNL, Florian Jonas <florian.jonas@cern.ch>, Marvin Hemmer <marvin.hemmer@cern.ch>
1515
1616#ifndef PWGJE_DATAMODEL_EMCALCLUSTERS_H_
1717#define PWGJE_DATAMODEL_EMCALCLUSTERS_H_
2323
2424#include < stdexcept>
2525#include < string>
26+ #include < unordered_map>
2627#include < vector>
2728
2829namespace o2 ::aod
@@ -32,76 +33,112 @@ namespace emcalcluster
3233
3334// define global cluster definitions
3435// New definitions should be added here!
35- const EMCALClusterDefinition kV3NoSplit (ClusterAlgorithm_t::kV3 , 0 , 1 , " kV3NoSplit" , 0.5 , 0.1 , -10000 , 10000 , 20000 , false , 0 ., false );
36- const EMCALClusterDefinition kV3NoSplitLowSeed (ClusterAlgorithm_t::kV3 , 1 , 1 , " kV3NoSplitLowSeed" , 0.3 , 0.1 , -10000 , 10000 , 20000 , false , 0 ., false );
37- const EMCALClusterDefinition kV3NoSplitLowerSeed (ClusterAlgorithm_t::kV3 , 2 , 1 , " kV3NoSplitLowerSeed" , 0.2 , 0.1 , -10000 , 10000 , 20000 , false , 0 ., false );
38- const EMCALClusterDefinition kV3Default (ClusterAlgorithm_t::kV3 , 10 , 1 , " kV3Default" , 0.5 , 0.1 , -10000 , 10000 , 20000 , true , 0.03 , false );
39- const EMCALClusterDefinition kV3MostSplit (ClusterAlgorithm_t::kV3 , 11 , 1 , " kV3MostSplit" , 0.5 , 0.1 , -10000 , 10000 , 20000 , true , 0 ., false );
40- const EMCALClusterDefinition kV3LowSeed (ClusterAlgorithm_t::kV3 , 12 , 1 , " kV3LowSeed" , 0.3 , 0.1 , -10000 , 10000 , 20000 , true , 0.03 , false );
41- const EMCALClusterDefinition kV3MostSplitLowSeed (ClusterAlgorithm_t::kV3 , 13 , 1 , " kV3MostSplitLowSeed" , 0.3 , 0.1 , -10000 , 10000 , 20000 , true , 0 ., false );
42- const EMCALClusterDefinition kV3StrictTime (ClusterAlgorithm_t::kV3 , 20 , 1 , " kV3StrictTime" , 0.5 , 0.1 , -500 , 500 , 20000 , true , 0.03 , false );
43- const EMCALClusterDefinition kV3StricterTime (ClusterAlgorithm_t::kV3 , 21 , 1 , " kV3StricterTime" , 0.5 , 0.1 , -100 , 100 , 20000 , true , 0.03 , false );
44- const EMCALClusterDefinition kV3MostStrictTime (ClusterAlgorithm_t::kV3 , 22 , 1 , " kV3MostStrictTime" , 0.5 , 0.1 , -50 , 50 , 20000 , true , 0.03 , false );
45- const EMCALClusterDefinition kV3Default5x5 (ClusterAlgorithm_t::kV3 , 30 , 1 , " kV3Default5x5" , 0.5 , 0.1 , -10000 , 10000 , 20000 , true , 0.03 , true );
46- const EMCALClusterDefinition kV3SmallTimeDiff (ClusterAlgorithm_t::kV3 , 40 , 1 , " kV3SmallTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 500 , true , 0.03 , false );
47- const EMCALClusterDefinition kV3SmallerTimeDiff (ClusterAlgorithm_t::kV3 , 41 , 1 , " kV3SmallerTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 100 , true , 0.03 , false );
48- const EMCALClusterDefinition kV3SmallestTimeDiff (ClusterAlgorithm_t::kV3 , 42 , 1 , " kV3SmallestTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 50 , true , 0.03 , false );
49- const EMCALClusterDefinition kV3MostSplitSmallTimeDiff (ClusterAlgorithm_t::kV3 , 43 , 1 , " kV3MostSplitSmallTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 500 , true , 0 ., false );
50- const EMCALClusterDefinition kV3MostSplitSmallerTimeDiff (ClusterAlgorithm_t::kV3 , 44 , 1 , " kV3MostSplitSmallerTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 100 , true , 0 ., false );
51- const EMCALClusterDefinition kV3MostSplitSmallestTimeDiff (ClusterAlgorithm_t::kV3 , 45 , 1 , " kV3MostSplitSmallestTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 50 , true , 0 ., false );
52- const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowestSeed (ClusterAlgorithm_t::kV3 , 50 , 1 , " kV3MostSplitSmallestTimeDiffLowestSeed" , 0.1 , 0.1 , -10000 , 10000 , 50 , true , 0 ., false );
53- const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowSeed (ClusterAlgorithm_t::kV3 , 51 , 1 , " kV3MostSplitSmallestTimeDiffLowSeed" , 0.3 , 0.1 , -10000 , 10000 , 50 , true , 0 ., false );
54- const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowerSeed (ClusterAlgorithm_t::kV3 , 52 , 1 , " kV3MostSplitSmallestTimeDiffLowerSeed" , 0.2 , 0.1 , -10000 , 10000 , 50 , true , 0 ., false );
36+ inline const EMCALClusterDefinition kV3NoSplit (ClusterAlgorithm::kV3 , 0 , 1 , " kV3NoSplit" , 0.5 , 0.1 , -10000 , 10000 , 20000 , false , 0 ., false );
37+ inline const EMCALClusterDefinition kV3NoSplitLowSeed (ClusterAlgorithm::kV3 , 1 , 1 , " kV3NoSplitLowSeed" , 0.3 , 0.1 , -10000 , 10000 , 20000 , false , 0 ., false );
38+ inline const EMCALClusterDefinition kV3NoSplitLowerSeed (ClusterAlgorithm::kV3 , 2 , 1 , " kV3NoSplitLowerSeed" , 0.2 , 0.1 , -10000 , 10000 , 20000 , false , 0 ., false );
39+ inline const EMCALClusterDefinition kV3Default (ClusterAlgorithm::kV3 , 10 , 1 , " kV3Default" , 0.5 , 0.1 , -10000 , 10000 , 20000 , true , 0.03 , false );
40+ inline const EMCALClusterDefinition kV3MostSplit (ClusterAlgorithm::kV3 , 11 , 1 , " kV3MostSplit" , 0.5 , 0.1 , -10000 , 10000 , 20000 , true , 0 ., false );
41+ inline const EMCALClusterDefinition kV3LowSeed (ClusterAlgorithm::kV3 , 12 , 1 , " kV3LowSeed" , 0.3 , 0.1 , -10000 , 10000 , 20000 , true , 0.03 , false );
42+ inline const EMCALClusterDefinition kV3MostSplitLowSeed (ClusterAlgorithm::kV3 , 13 , 1 , " kV3MostSplitLowSeed" , 0.3 , 0.1 , -10000 , 10000 , 20000 , true , 0 ., false );
43+ inline const EMCALClusterDefinition kV3StrictTime (ClusterAlgorithm::kV3 , 20 , 1 , " kV3StrictTime" , 0.5 , 0.1 , -500 , 500 , 20000 , true , 0.03 , false );
44+ inline const EMCALClusterDefinition kV3StricterTime (ClusterAlgorithm::kV3 , 21 , 1 , " kV3StricterTime" , 0.5 , 0.1 , -100 , 100 , 20000 , true , 0.03 , false );
45+ inline const EMCALClusterDefinition kV3MostStrictTime (ClusterAlgorithm::kV3 , 22 , 1 , " kV3MostStrictTime" , 0.5 , 0.1 , -50 , 50 , 20000 , true , 0.03 , false );
46+ inline const EMCALClusterDefinition kV3Default5x5 (ClusterAlgorithm::kV3 , 30 , 1 , " kV3Default5x5" , 0.5 , 0.1 , -10000 , 10000 , 20000 , true , 0.03 , true );
47+ inline const EMCALClusterDefinition kV3SmallTimeDiff (ClusterAlgorithm::kV3 , 40 , 1 , " kV3SmallTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 500 , true , 0.03 , false );
48+ inline const EMCALClusterDefinition kV3SmallerTimeDiff (ClusterAlgorithm::kV3 , 41 , 1 , " kV3SmallerTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 100 , true , 0.03 , false );
49+ inline const EMCALClusterDefinition kV3SmallestTimeDiff (ClusterAlgorithm::kV3 , 42 , 1 , " kV3SmallestTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 50 , true , 0.03 , false );
50+ inline const EMCALClusterDefinition kV3MostSplitSmallTimeDiff (ClusterAlgorithm::kV3 , 43 , 1 , " kV3MostSplitSmallTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 500 , true , 0 ., false );
51+ inline const EMCALClusterDefinition kV3MostSplitSmallerTimeDiff (ClusterAlgorithm::kV3 , 44 , 1 , " kV3MostSplitSmallerTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 100 , true , 0 ., false );
52+ inline const EMCALClusterDefinition kV3MostSplitSmallestTimeDiff (ClusterAlgorithm::kV3 , 45 , 1 , " kV3MostSplitSmallestTimeDiff" , 0.5 , 0.1 , -10000 , 10000 , 50 , true , 0 ., false );
53+ inline const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowestSeed (ClusterAlgorithm::kV3 , 50 , 1 , " kV3MostSplitSmallestTimeDiffLowestSeed" , 0.1 , 0.1 , -10000 , 10000 , 50 , true , 0 ., false );
54+ inline const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowSeed (ClusterAlgorithm::kV3 , 51 , 1 , " kV3MostSplitSmallestTimeDiffLowSeed" , 0.3 , 0.1 , -10000 , 10000 , 50 , true , 0 ., false );
55+ inline const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowerSeed (ClusterAlgorithm::kV3 , 52 , 1 , " kV3MostSplitSmallestTimeDiffLowerSeed" , 0.2 , 0.1 , -10000 , 10000 , 50 , true , 0 ., false );
56+
57+ // / \brief function returns EMCALClusterDefinition for the given storage ID
58+ // / \param storageID storage ID of the cluster definition
59+ // / \return EMCALClusterDefinition for the given storage ID
60+ inline const EMCALClusterDefinition& getClusterDefinitionFromID (int storageID)
61+ {
62+ switch (storageID) {
63+ case 0 :
64+ return kV3NoSplit ;
65+ case 1 :
66+ return kV3NoSplitLowSeed ;
67+ case 2 :
68+ return kV3NoSplitLowerSeed ;
69+ case 10 :
70+ return kV3Default ;
71+ case 11 :
72+ return kV3MostSplit ;
73+ case 12 :
74+ return kV3LowSeed ;
75+ case 13 :
76+ return kV3MostSplitLowSeed ;
77+ case 20 :
78+ return kV3StrictTime ;
79+ case 21 :
80+ return kV3StricterTime ;
81+ case 22 :
82+ return kV3MostStrictTime ;
83+ case 30 :
84+ return kV3Default5x5 ;
85+ case 40 :
86+ return kV3SmallTimeDiff ;
87+ case 41 :
88+ return kV3SmallerTimeDiff ;
89+ case 42 :
90+ return kV3SmallestTimeDiff ;
91+ case 43 :
92+ return kV3MostSplitSmallTimeDiff ;
93+ case 44 :
94+ return kV3MostSplitSmallerTimeDiff ;
95+ case 45 :
96+ return kV3MostSplitSmallestTimeDiff ;
97+ case 50 :
98+ return kV3MostSplitSmallestTimeDiffLowestSeed ;
99+ case 51 :
100+ return kV3MostSplitSmallestTimeDiffLowSeed ;
101+ case 52 :
102+ return kV3MostSplitSmallestTimeDiffLowerSeed ;
103+ default :
104+ throw std::invalid_argument (" Cluster definition storageID not recognized: " + std::to_string (storageID));
105+ }
106+ }
55107
56108// / \brief function returns EMCALClusterDefinition for the given name
57- // / \param name name of the cluster definition
109+ // / \param clusterDefinitionName name of the cluster definition
58110// / \return EMCALClusterDefinition for the given name
59- inline const EMCALClusterDefinition getClusterDefinitionFromString (const std::string& clusterDefinitionName)
111+ inline const EMCALClusterDefinition& getClusterDefinitionFromString (const std::string& clusterDefinitionName)
60112{
61- if (clusterDefinitionName == " kV3NoSplit" ) {
62- return kV3NoSplit ;
63- } else if (clusterDefinitionName == " kV3NoSplitLowSeed" ) {
64- return kV3NoSplitLowSeed ;
65- } else if (clusterDefinitionName == " kV3NoSplitLowerSeed" ) {
66- return kV3NoSplitLowerSeed ;
67- } else if (clusterDefinitionName == " kV3Default" ) {
68- return kV3Default ;
69- } else if (clusterDefinitionName == " kV3MostSplit" ) {
70- return kV3MostSplit ;
71- } else if (clusterDefinitionName == " kV3LowSeed" ) {
72- return kV3LowSeed ;
73- } else if (clusterDefinitionName == " kV3MostSplitLowSeed" ) {
74- return kV3MostSplitLowSeed ;
75- } else if (clusterDefinitionName == " kV3StrictTime" ) {
76- return kV3StrictTime ;
77- } else if (clusterDefinitionName == " kV3StricterTime" ) {
78- return kV3StricterTime ;
79- } else if (clusterDefinitionName == " kV3MostStrictTime" ) {
80- return kV3MostStrictTime ;
81- } else if (clusterDefinitionName == " kV3Default5x5" ) {
82- return kV3Default5x5 ;
83- } else if (clusterDefinitionName == " kV3SmallTimeDiff" ) {
84- return kV3SmallTimeDiff ;
85- } else if (clusterDefinitionName == " kV3SmallerTimeDiff" ) {
86- return kV3SmallerTimeDiff ;
87- } else if (clusterDefinitionName == " kV3SmallestTimeDiff" ) {
88- return kV3SmallestTimeDiff ;
89- } else if (clusterDefinitionName == " kV3MostSplitSmallTimeDiff" ) {
90- return kV3MostSplitSmallTimeDiff ;
91- } else if (clusterDefinitionName == " kV3MostSplitSmallerTimeDiff" ) {
92- return kV3MostSplitSmallerTimeDiff ;
93- } else if (clusterDefinitionName == " kV3MostSplitSmallestTimeDiff" ) {
94- return kV3MostSplitSmallestTimeDiff ;
95- } else if (clusterDefinitionName == " kV3MostSplitSmallestTimeDiffLowestSeed" ) {
96- return kV3MostSplitSmallestTimeDiffLowestSeed ;
97- } else if (clusterDefinitionName == " kV3MostSplitSmallestTimeDiffLowSeed" ) {
98- return kV3MostSplitSmallestTimeDiffLowSeed ;
99- } else if (clusterDefinitionName == " kV3MostSplitSmallestTimeDiffLowerSeed" ) {
100- return kV3MostSplitSmallestTimeDiffLowerSeed ;
101- } else {
102- throw std::invalid_argument (" Cluster definition name not recognized" );
113+ static const std::unordered_map<std::string, int > nameToID = {
114+ {" kV3NoSplit" , 0 },
115+ {" kV3NoSplitLowSeed" , 1 },
116+ {" kV3NoSplitLowerSeed" , 2 },
117+ {" kV3Default" , 10 },
118+ {" kV3MostSplit" , 11 },
119+ {" kV3LowSeed" , 12 },
120+ {" kV3MostSplitLowSeed" , 13 },
121+ {" kV3StrictTime" , 20 },
122+ {" kV3StricterTime" , 21 },
123+ {" kV3MostStrictTime" , 22 },
124+ {" kV3Default5x5" , 30 },
125+ {" kV3SmallTimeDiff" , 40 },
126+ {" kV3SmallerTimeDiff" , 41 },
127+ {" kV3SmallestTimeDiff" , 42 },
128+ {" kV3MostSplitSmallTimeDiff" , 43 },
129+ {" kV3MostSplitSmallerTimeDiff" , 44 },
130+ {" kV3MostSplitSmallestTimeDiff" , 45 },
131+ {" kV3MostSplitSmallestTimeDiffLowestSeed" , 50 },
132+ {" kV3MostSplitSmallestTimeDiffLowSeed" , 51 },
133+ {" kV3MostSplitSmallestTimeDiffLowerSeed" , 52 },
134+ };
135+
136+ auto it = nameToID.find (clusterDefinitionName);
137+ if (it == nameToID.end ()) {
138+ throw std::invalid_argument (" Cluster definition name not recognized: " + clusterDefinitionName);
103139 }
104- };
140+ return getClusterDefinitionFromID (it->second );
141+ }
105142
106143DECLARE_SOA_INDEX_COLUMN (Collision, collision); // ! collisionID used as index for matched clusters
107144DECLARE_SOA_INDEX_COLUMN (BC , bc); // ! bunch crossing ID used as index for ambiguous clusters
0 commit comments