2424/**Special history state: Cluster recombined with beam" */
2525#define JETRECONSTRUCTION_BEAMJET -1
2626
27+ /**
28+ * @enum jetreconstruction_StatusCode
29+ * @brief Status codes for Jet Reconstruction operations.
30+ *
31+ * Common status codes for Jet Reconstruction operations. Most of the standard
32+ * Julia
33+ * https://docs.julialang.org/en/v1/manual/control-flow/#Exception-Handling
34+ * exceptions are mapped to corresponding codes.
35+ */
36+ typedef enum {
37+ JETRECONSTRUCTION_STATUSCODE_OK = 0 , /**< The operation succeeded. */
38+ JETRECONSTRUCTION_STATUSCODE_GENERICEXCEPTION =
39+ 1 , /**< An unspecified error, not covered by other status codes occurred.
40+ */
41+ JETRECONSTRUCTION_STATUSCODE_ARGUMENTERROR = 2 ,
42+ JETRECONSTRUCTION_STATUSCODE_BOUNDSERROR = 3 ,
43+ JETRECONSTRUCTION_STATUSCODE_COMPOSITEEXCEPTION = 4 ,
44+ JETRECONSTRUCTION_STATUSCODE_DIMENSIONMISMATCH = 5 ,
45+ JETRECONSTRUCTION_STATUSCODE_DIVIDEERROR = 6 ,
46+ JETRECONSTRUCTION_STATUSCODE_DOMAINERROR = 7 ,
47+ JETRECONSTRUCTION_STATUSCODE_EOFERROR = 8 ,
48+ JETRECONSTRUCTION_STATUSCODE_ERROREXCEPTION = 9 ,
49+ JETRECONSTRUCTION_STATUSCODE_INEXACTERROR = 10 ,
50+ JETRECONSTRUCTION_STATUSCODE_INITERROR = 11 ,
51+ JETRECONSTRUCTION_STATUSCODE_INTERRUPTEXCEPTION = 12 ,
52+ JETRECONSTRUCTION_STATUSCODE_INVALIDSTATEEXCEPTION = 13 ,
53+ JETRECONSTRUCTION_STATUSCODE_KEYERROR = 14 ,
54+ JETRECONSTRUCTION_STATUSCODE_LOADERROR = 15 ,
55+ JETRECONSTRUCTION_STATUSCODE_OUTOFMEMORYERROR = 16 ,
56+ JETRECONSTRUCTION_STATUSCODE_READONLYMEMORYERROR = 17 ,
57+ /*JETRECONSTRUCTION_STATUSCODE_REMOTEEXCEPTION = 18, distributed only */
58+ JETRECONSTRUCTION_STATUSCODE_METHODERROR = 19 ,
59+ JETRECONSTRUCTION_STATUSCODE_OVERFLOWERROR = 20 ,
60+ /*JETRECONSTRUCTION_STATUSCODE_PARSEERROR = 21, meta only*/
61+ JETRECONSTRUCTION_STATUSCODE_SYSTEMERROR = 22 ,
62+ JETRECONSTRUCTION_STATUSCODE_TYPEERROR = 23 ,
63+ JETRECONSTRUCTION_STATUSCODE_UNDEFREFERROR = 24 ,
64+ JETRECONSTRUCTION_STATUSCODE_UNDEFVARERROR = 25 ,
65+ JETRECONSTRUCTION_STATUSCODE_STRINGINDEXERROR = 26
66+ } jetreconstruction_StatusCode ;
67+
2768/**
2869 * @enum jetreconstruction_JetAlgorithm
2970 * @brief Enumeration representing different jet algorithms used in
@@ -81,23 +122,25 @@ typedef struct {
81122 * @param[in] py The y-component of the momentum.
82123 * @param[in] pz The z-component of the momentum.
83124 * @param[in] E The energy component of the momentum.
84- * @return An integer status code indicating the success or failure.
125+ * @return An integer status code indicating the success or failure. See common
126+ * status codes jetreconstruction_StatusCode.
85127 */
86- int jetreconstruction_PseudoJet_init (jetreconstruction_PseudoJet * ptr ,
87- double px , double py , double pz , double E );
128+ jetreconstruction_StatusCode
129+ jetreconstruction_PseudoJet_init (jetreconstruction_PseudoJet * ptr , double px ,
130+ double py , double pz , double E );
88131
89132/**
90133 * @struct jetreconstruction_HistoryElement
91134 * @brief A struct holding a record of jet mergers and finalisations.
92135 */
93136typedef struct {
94137 long parent1 ; /**< Index in history where first parent of this jet was
95- created (@ref JETRECONSTRUCTION_NONEXISTENTPARENT if this jet is
96- an original particle) */
138+ created (@ref JETRECONSTRUCTION_NONEXISTENTPARENT if this jet
139+ is an original particle) */
97140 long parent2 ; /**< Index in history where second parent of this jet was
98- created (@ref JETRECONSTRUCTION_NONEXISTENTPARENT if this jet is
99- an original particle); @ref JETRECONSTRUCTION_BEAMJET if this
100- history entry just labels the fact that the jet has
141+ created (@ref JETRECONSTRUCTION_NONEXISTENTPARENT if this jet
142+ is an original particle); @ref JETRECONSTRUCTION_BEAMJET if
143+ this history entry just labels the fact that the jet has
101144 recombined with the beam */
102145 long child ; /**< Index in history where the current jet is recombined with
103146 another jet to form its child. It is Invalid
@@ -106,7 +149,8 @@ typedef struct {
106149 PseudoJet object corresponding to this jet (i.e. the
107150 jet created at this entry of the history). NB: if this
108151 element of the history corresponds to a beam
109- recombination, then @p jetp_index = @ref JETRECONSTRUCTION_INVALID.
152+ recombination, then @p jetp_index = @ref
153+ JETRECONSTRUCTION_INVALID.
110154 */
111155 double dij ; /**< The distance corresponding to the recombination at this
112156 stage of the clustering. */
@@ -182,9 +226,10 @@ static inline void jetreconstruction_ClusterSequence_free_members(
182226 * @param[in] strategy The jet reconstruction strategy to use.
183227 * @param[out] result A pointer to which a cluster sequence containing the
184228 * reconstructed jets and the merging history will be stored.
185- * @return An integer status code indicating the success or failure.
229+ * @return An integer status code indicating the success or failure. See common
230+ * status codes jetreconstruction_StatusCode.
186231 */
187- int jetreconstruction_jet_reconstruct (
232+ jetreconstruction_StatusCode jetreconstruction_jet_reconstruct (
188233 const jetreconstruction_PseudoJet * particles , size_t particles_length ,
189234 jetreconstruction_JetAlgorithm algorithm , double R ,
190235 jetreconstruction_RecoStrategy strategy ,
@@ -195,8 +240,9 @@ int jetreconstruction_jet_reconstruct(
195240 * @brief A structure to hold the inclusive or exclusive jets.
196241 */
197242typedef struct {
198- jetreconstruction_PseudoJet * data ; /**< Pointer to an array of jetreconstruction_PseudoJet. */
199- size_t length ; /**< The length of the @ref data array. */
243+ jetreconstruction_PseudoJet
244+ * data ; /**< Pointer to an array of jetreconstruction_PseudoJet. */
245+ size_t length ; /**< The length of the @ref data array. */
200246} jetreconstruction_JetsResult ;
201247
202248/** @private */
@@ -235,9 +281,10 @@ jetreconstruction_JetsResult_free_members(jetreconstruction_JetsResult *ptr) {
235281 * @param[in] dcut The distance parameter used to define the exclusive jets.
236282 * @param[out] result A pointer to the jetreconstruction_JetsResult object where
237283 * the resulting jets will be stored.
238- * @return An integer status code indicating the success or failure.
284+ * @return An integer status code indicating the success or failure. See common
285+ * status codes jetreconstruction_StatusCode.
239286 */
240- int jetreconstruction_exclusive_jets_dcut (
287+ jetreconstruction_StatusCode jetreconstruction_exclusive_jets_dcut (
241288 const jetreconstruction_ClusterSequence * clustersequence , double dcut ,
242289 jetreconstruction_JetsResult * result );
243290
@@ -257,9 +304,10 @@ int jetreconstruction_exclusive_jets_dcut(
257304 * @param[in] njets The number of exclusive jets to be calculated.
258305 * @param[out] result A pointer to the jetreconstruction_JetsResult object where
259306 * the resulting jets will be stored.
260- * @return An integer status code indicating the success or failure.
307+ * @return An integer status code indicating the success or failure. See common
308+ * status codes jetreconstruction_StatusCode.
261309 */
262- int jetreconstruction_exclusive_jets_njets (
310+ jetreconstruction_StatusCode jetreconstruction_exclusive_jets_njets (
263311 const jetreconstruction_ClusterSequence * clustersequence , size_t njets ,
264312 jetreconstruction_JetsResult * result );
265313
@@ -283,8 +331,9 @@ int jetreconstruction_exclusive_jets_njets(
283331 * inclusive jets.
284332 * @param[out] result A pointer to the jetreconstruction_JetsResult object where
285333 * the resulting jets will be stored.
286- * @return An integer status code indicating the success or failure.
334+ * @return An integer status code indicating the success or failure. See common
335+ * status codes jetreconstruction_StatusCode.
287336 */
288- int jetreconstruction_inclusive_jets (
337+ jetreconstruction_StatusCode jetreconstruction_inclusive_jets (
289338 const jetreconstruction_ClusterSequence * clustersequence , double ptmin ,
290339 jetreconstruction_JetsResult * result );
0 commit comments