1 #**** This file is a part of the HAMMER library
2 #**** Copyright (C) 2016 - 2020 The HAMMER Collaboration
3 #**** HAMMER is licensed under version 3 of the GPL; see COPYING for details
4 #**** Please note the MCnet academic guidelines; see GUIDELINES for details
7 # \brief Cython class to import classes from hammer library
10 from libcpp.map cimport map
11 from libcpp.set cimport set as cset
12 from libcpp.string cimport
string
13 from libcpp.pair cimport pair
14 from libcpp.vector cimport vector
15 from libcpp.unordered_map cimport unordered_map
16 from libcpp cimport
bool
19 cdef
extern from
"<array>" namespace "std" nogil:
20 cdef cppclass array4 "std::array<double, 4>":
22 double& operator[](size_t)
24 cdef cppclass array3 "std::array<double, 3>":
26 double& operator[](size_t)
28 cdef extern from "Hammer/Tools/Utils.hh" namespace "Hammer":
30 cdef cppclass
UMap[T, U]:
32 ctypedef U mapped_type
33 ctypedef pair[const T, U] value_type
35 pair[T, U]& operator*()
38 bint operator==(iterator)
39 bint operator!=(iterator)
40 cppclass reverse_iterator:
41 pair[T, U]& operator*()
44 bint operator==(reverse_iterator)
45 bint operator!=(reverse_iterator)
46 cppclass const_iterator(iterator):
48 cppclass const_reverse_iterator(reverse_iterator):
54 #UMap& operator=(UMap&)
55 bint operator==(UMap&, UMap&)
56 bint operator!=(UMap&, UMap&)
57 bint operator<(UMap&, UMap&)
58 bint operator>(UMap&, UMap&)
59 bint operator<=(UMap&, UMap&)
60 bint operator>=(UMap&, UMap&)
62 const U& const_at "at"(const T&)
64 const_iterator const_begin "
begin"()
69 const_iterator const_end "
end"()
70 pair[iterator, iterator] equal_range(T&)
71 pair[const_iterator, const_iterator] const_equal_range "equal_range"(const T&)
72 iterator erase(iterator)
73 iterator erase(iterator, iterator)
76 const_iterator const_find "find"(T&)
77 pair[iterator, bint] insert(pair[T, U]) # XXX pair[T,U]&
78 iterator insert(iterator, pair[T, U]) # XXX pair[T,U]&
79 iterator insert(iterator, iterator)
80 #key_compare key_comp()
81 iterator lower_bound(T&)
82 const_iterator const_lower_bound "lower_bound"(T&)
84 reverse_iterator rbegin()
85 const_reverse_iterator const_rbegin "rbegin"()
86 reverse_iterator rend()
87 const_reverse_iterator const_rend "rend"()
90 iterator upper_bound(T&)
91 const_iterator const_upper_bound "upper_bound"(T&)
92 #value_compare value_comp()
93 void max_load_factor(float)
94 float max_load_factor()
98 size_t max_bucket_count()
99 size_t bucket_size(size_t)
100 size_t bucket(const T&)
102 cdef extern from "Hammer/Math/FourMomentum.hh" namespace "Hammer":
104 ## wrapper of `Hammer::FourMomentum` class
105 cdef cppclass FourMomentum:
108 FourMomentum(double, double, double, double)
110 FourMomentum fromPtEtaPhiM(
double,
double,
double,
double)
112 FourMomentum fromEtaPhiME(
double,
double,
double,
double) except +
114 FourMomentum fromPM(
double,
double,
double,
double)
123 double mass() except +
133 double gamma() except +
134 double beta() except +
135 array3 boostVector() except +
138 cdef
extern from
"Hammer/Particle.hh" namespace "Hammer":
140 ## wrapper of `Hammer::Particle` class
141 cdef cppclass Particle:
143 Particle(FourMomentum, int)
144 Particle& setMomentum(FourMomentum)
145 Particle& setPdgId(int)
147 FourMomentum& momentum()
150 cdef extern from "Hammer/Process.hh" namespace "Hammer":
152 ## wrapper of `Hammer::Process` class
153 cdef cppclass Process:
155 size_t addParticle(Particle)
156 void addVertex(size_t, vector[size_t])
157 void removeVertex(size_t, bool)
158 vector[size_t]& getDaughtersIds(size_t) except +
159 size_t getParentId(size_t)
160 vector[size_t]& getSiblingsIds(size_t)
161 Particle& getParticle(size_t) except +
162 vector[Particle] getDaughters(size_t, bool) except +
163 vector[Particle] getSiblings(size_t, bool)
164 Particle& getParent(size_t)
165 bool isParent(size_t)
166 size_t getFirstVertex()
168 cset[size_t] fullId()
169 size_t getVertexId(string)
170 size_t numParticles(bool)
172 cdef extern from "Hammer/Tools/Logging.hh" namespace "Hammer":
174 ## wrapper of `Hammer::Log` class
177 void setLevel(
string,
int)
179 void setLevels(map[
string,
int])
181 void setShowTimestamp(
bool)
183 void setShowLevel(
bool)
185 void setShowLoggerName(
bool)
187 void setUseColors(
bool)
189 void setWarningMaxCount(
string,
int)
191 void resetWarningCounters()
194 cdef
extern from
"Hammer/Tools/Utils.hh" namespace "Hammer":
197 cdef extern from "Hammer/Tools/IOTypes.hh" namespace "Hammer":
199 ## wrapper of `Hammer::IOBuffer` struct
200 cdef cppclass IOBuffer:
205 ## wrapper of `Hammer::BinContents` struct
206 cdef cppclass BinContents:
219 ## wrapper of `Hammer::IOBuffers` class
220 cdef cppclass IOBuffers:
222 IOBuffers(IOBuffers&&) except +
225 iterator operator++()
226 bint operator==(iterator)
227 bint operator!=(iterator)
237 ## wrapper of `Hammer::HistoInfo` struct
238 cdef cppclass HistoInfo:
241 cset[cset[size_t]] eventGroupId
244 cdef extern from "Hammer/IndexTypes.hh" namespace "Hammer":
246 ## wrapper of `Hammer::WTerm` enum class
252 cdef extern from "Hammer/Hammer.hh" namespace "Hammer":
254 ## wrapper of `Hammer::Hammer` class
255 cdef cppclass Hammer:
258 void initEvent(double)
259 size_t addProcess(Process)
260 void removeProcess(size_t)
261 void setEventHistogramBin(string, vector[uint16_t])
262 void fillEventHistogram(string, vector[double])
263 void setEventBaseWeight(double)
265 bool loadEventWeights(IOBuffer, bool)
266 IOBuffer saveEventWeights()
267 bool loadRunHeader(IOBuffer, bool)
268 IOBuffer saveRunHeader()
269 string loadHistogramDefinition(IOBuffer, bool)
270 HistoInfo loadHistogram(IOBuffer, bool)
271 IOBuffers saveHistogram(HistoInfo)
272 IOBuffers saveHistogram(string)
273 IOBuffers saveHistogram(string, string)
274 IOBuffers saveHistogram(string, cset[cset[size_t]])
275 IOBuffers saveHistogram(string, string, cset[cset[size_t]])
276 bool loadRates(IOBuffer, bool)
278 void readCards(string, string)
279 void saveOptionCard(string, bool)
280 void saveHeaderCard(string)
281 void saveReferences(string)
282 void setOptions(string)
283 void setHeader(string)
284 void addTotalSumOfWeights(bool, bool)
285 void addHistogram(string, vector[uint16_t], bool, vector[pair[double, double]])
286 void addHistogram(string, vector[vector[double]], bool)
287 void collapseProcessesInHistogram(string)
288 void keepErrorsInHistogram(string, bool)
289 void specializeWCInWeights(string, vector[double complex])
290 void specializeWCInWeights(string, map[string, double complex])
291 void specializeWCInHistogram(string, string, vector[double complex])
292 void resetSpecializeWCInWeights(string)
293 void specializeWCInHistogram(string, string, map[string, double complex])
294 void specializeFFInHistogram(string, string, string, vector[double])
295 void specializeFFInHistogram(string, string, string, map[string, double])
296 void resetSpecializationInHistogram(string)
297 void createProjectedHistogram(string, string, cset[uint16_t])
298 void removeHistogram(string)
299 void addFFScheme(string, map[string, string])
300 void setFFInputScheme(map[string, string])
301 vector[string] getFFSchemeNames()
302 void includeDecay(vector[string])
303 void includeDecay(string)
304 void forbidDecay(vector[string])
305 void forbidDecay(string)
306 void addPurePSVertices(cset[string], WTerm)
307 void clearPurePSVertices(WTerm)
308 void setUnits(string)
309 void setWilsonCoefficients(string, vector[double complex], WTerm)
310 void setWilsonCoefficients(string, map[string, double complex], WTerm)
311 void setWilsonCoefficientsLocal(string, vector[double complex])
312 void setWilsonCoefficientsLocal(string, map[string, double complex])
313 void resetWilsonCoefficients(string, WTerm)
314 void setFFEigenvectors(string, string, vector[double])
315 void setFFEigenvectors(string, string, map[string, double])
316 void setFFEigenvectorsLocal(string, string, vector[double])
317 void setFFEigenvectorsLocal(string, string, map[string, double])
318 void resetFFEigenvectors(string, string)
319 double getWeight(string, vector[size_t])
320 double getWeight(string, vector[vector[string]])
321 map[size_t, double] getWeights(string)
322 double getRate(size_t, string)
323 double getRate(int, vector[int], string)
324 double getRate(string, string)
325 double getDenominatorRate(size_t)
326 double getDenominatorRate(int, vector[int])
327 double getDenominatorRate(string)
328 vector[BinContents] getHistogram(string, string)
329 UMap[cset[cset[size_t]], vector[BinContents]] getHistograms(string, string)
330 cset[cset[size_t]] getHistogramEventIds(string, string)
331 vector[uint16_t] getHistogramShape(string)
332 vector[vector[double]] getHistogramBinEdges(string)
333 bool histogramHasUnderOverFlows(string)
from libcpp map cimport map from libcpp set cimport set as cset from libcpp string cimport string from libcpp pair cimport pair from libcpp vector cimport vector from libcpp unordered_map cimport unordered_map from libcpp cimport bool from libc stdint cimport uint32_t
std::unordered_map< K, V, boost::hash< K >> UMap
auto begin(reversion_wrapper< T > w)
from libcpp map cimport map from libcpp set cimport set as cset from libcpp string cimport string from libcpp pair cimport pair from libcpp vector cimport vector from libcpp unordered_map cimport unordered_map from libcpp cimport bool from libc stdint cimport uintptr_t
from libcpp map cimport map from libcpp set cimport set as cset from libcpp string cimport string from libcpp pair cimport pair from libcpp vector cimport vector from libcpp unordered_map cimport unordered_map from libcpp cimport bool from libc stdint cimport uint8_t
auto end(reversion_wrapper< T > w)