33 Events Class
44##############
55
6+ The Event class is a container class that holds the information corresponding to generated events.
7+ The Event class will not store the mother particle and store the N particle tuples with the
8+ element 0 storing the weight and rest of the elements storing the ``Vector4R `` of each particle.
69There are two types of Events one that runs on ``host `` and ``device ``. Events
7- container currently supports up to (N=10) particles in any number of Events.
10+ container currently supports up to (N=10) particles in final state with any number of Events.
811Both Host and Device Event classes add number (1 to 10) as their
912suffix to create Event for that number of particles and the type
1013(host or device) is added as their prefix.
@@ -26,24 +29,24 @@ to instantiate the Events class:
2629
2730 import HydraPython as hp
2831
29- h_events_5 = hp.hostEvents5 () # construc host Event with 5 particles and 0 Events
32+ h_events_5 = hp.host_events_5 () # construct host Event with 5 particles and 0 Events
3033 print (h_events_5.size()) # 0
3134
32- h_events_7_100 = hp.hostEvents7 (100 )
35+ h_events_7_100 = hp.host_events_7 (100 )
3336 print (h_events_7_100.size()) # 100
3437
3538
36- The ``hostEventsN `` object can be copy constructed with the ``hostEventsN ``
37- or ``deviceEventsN `` object.
39+ The ``host_events_N `` object can be copy constructed with the ``host_events_N ``
40+ or ``device_events_N `` object.
3841
3942.. code-block :: python
4043
4144 import HydraPython as hp
42- h_events_3 = hp.hostEvents3 (4 )
45+ h_events_3 = hp.host_events_3 (4 )
4346 print (list (h_events_3.Flags())) # [False, False, False, False]
4447
4548 h_events_3.setFlag(1 , True )
46- h_events_3_copy = hp.hostEvents3 (h_events_3)
49+ h_events_3_copy = hp.host_events_3 (h_events_3)
4750 print (list (h_events_3_copy.Flags())) # [False, True, False, False]
4851
4952 The ``setFlags `` method as demonstrated above can be used to set the
@@ -52,7 +55,7 @@ particular flag value with the index.
5255
5356.. code-block :: python
5457
55- h_event = hp.hostEvents5 (8 )
58+ h_event = hp.host_events_5 (8 )
5659 h_event.setFlag(1 , True )
5760 print (h_event.getFlag(1 )) # True
5861
@@ -61,23 +64,24 @@ object. This is a very useful method to avoid the nasty bugs for example:
6164
6265.. code-block :: python
6366
64- h_event = hp.hostEvents5 (10 )
65- h_event2 = hp.hostEvents5 ()
67+ h_event = hp.host_events_5 (10 )
68+ h_event2 = hp.host_events_5 ()
6669
6770 # Do things and later in the code ...
6871 h_event2.assign(h_event)
6972 # This will create the exact same copy of the h_event in h_event2
7073
7174 The host Events class also provides a method to set the Maximum weight of the
72- Events. The method is useful to set the maximum weight. The complete method
73- list provided by the Event classes can be found on [#f1 ]_.
75+ Events. The method is useful to set the maximum weight. The complete list of the classes
76+ in the Events container can be found on [#f1 ]_. The complete method
77+ list provided by the Event classes can be found on [#f2 ]_.
7478
7579The Events classes also provide a pythonic way to access the events with the
7680``[] `` operator. For example, an event value can be access like this.
7781
7882.. code-block :: python
7983
80- event = hp.hostEvents5 (5 )
84+ event = hp.host_events_5 (5 )
8185 print (event[1 ]) # (0.0, (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0))
8286
8387
@@ -101,14 +105,95 @@ device object of particle 7 you will do something like this,
101105.. code-block :: python
102106
103107 import HydraPython
104- device_event_with_7_particle = HydraPython.deviceEvents7 ()
108+ device_event_with_7_particle = HydraPython.device_events_7 ()
105109
106110 # This will create a device Events with 0 states and 7 particles.
107111
108112
109- The complete list of the classes in the Events container can be found on [ #f2 ]_.
113+ .. [ #f1 ] The list of Events classes
110114
111- .. [#f1 ] The method list for Events classes
115+ - ``host_events_1 `` Generate 1 particle Event. Syntax:
116+
117+ - h_event = hp.host_events_1(entries)
118+
119+ - ``host_events_2 `` Generate 2 particle Event. Syntax:
120+
121+ - h_event = hp.host_events_2(entries)
122+
123+ - ``host_events_3 `` Generate 3 particle Event. Syntax:
124+
125+ - h_event = hp.host_events_3(entries)
126+
127+ - ``host_events_4 `` Generate 4 particle Event. Syntax:
128+
129+ - h_event = hp.host_events_4(entries)
130+
131+ - ``host_events_5 `` Generate 5 particle Event. Syntax:
132+
133+ - h_event = hp.host_events_5(entries)
134+
135+ - ``host_events_6 `` Generate 6 particle Event. Syntax:
136+
137+ - h_event = hp.host_events_6(entries)
138+
139+ - ``host_events_7 `` Generate 7 particle Event. Syntax:
140+
141+ - h_event = hp.host_events_7(entries)
142+
143+ - ``host_events_8 `` Generate 8 particle Event. Syntax:
144+
145+ - h_event = hp.host_events_8(entries)
146+
147+ - ``host_events_9 `` Generate 9 particle Event. Syntax:
148+
149+ - h_event = hp.host_events_9(entries)
150+
151+ - ``host_events_10 `` Generate 10 particle Event. Syntax:
152+
153+ - h_event = hp.host_events_10(entries)
154+
155+ - ``device_events_1 `` Generate 1 particle Event. Syntax:
156+
157+ - d_event = hp.device_events_1(entries)
158+
159+ - ``device_events_2 `` Generate 2 particle Event. Syntax:
160+
161+ - d_event = hp.device_events_2(entries)
162+
163+ - ``device_events_3 `` Generate 3 particle Event. Syntax:
164+
165+ - d_event = hp.device_events_3(entries)
166+
167+ - ``device_events_4 `` Generate 4 particle Event. Syntax:
168+
169+ - d_event = hp.device_events_4(entries)
170+
171+ - ``device_events_5 `` Generate 5 particle Event. Syntax:
172+
173+ - d_event = hp.device_events_5(entries)
174+
175+ - ``device_events_6 `` Generate 6 particle Event. Syntax:
176+
177+ - d_event = hp.device_events_6(entries)
178+
179+ - ``device_events_7 `` Generate 7 particle Event. Syntax:
180+
181+ - d_event = hp.device_events_7(entries)
182+
183+ - ``device_events_8 `` Generate 8 particle Event. Syntax:
184+
185+ - d_event = hp.device_events_8(entries)
186+
187+ - ``device_events_9 `` Generate 9 particle Event. Syntax:
188+
189+ - d_event = hp.device_events_9(entries)
190+
191+ - ``device_events_10 `` Generate 10 particle Event. Syntax:
192+
193+ - d_event = hp.device_events_10(entries)
194+
195+
196+ .. [#f2 ] The method list for Events classes
112197
113198 - ``assign `` Assigns one Events content to other Events. Syntax:
114199
@@ -181,87 +266,3 @@ The complete list of the classes in the Events container can be found on [#f2]_.
181266 - ``getWeight `` Gets the particular event's weight. Syntax:
182267
183268 - event.getWeight(idx)
184-
185-
186-
187- .. [#f2 ] The list of Events classes
188-
189- - ``hostEvents1 `` Generate 1 particle Event. Syntax:
190-
191- - h_event = hp.hostEvents1(entries)
192-
193- - ``hostEvents2 `` Generate 2 particle Event. Syntax:
194-
195- - h_event = hp.hostEvents2(entries)
196-
197- - ``hostEvents3 `` Generate 3 particle Event. Syntax:
198-
199- - h_event = hp.hostEvents3(entries)
200-
201- - ``hostEvents4 `` Generate 4 particle Event. Syntax:
202-
203- - h_event = hp.hostEvents4(entries)
204-
205- - ``hostEvents5 `` Generate 5 particle Event. Syntax:
206-
207- - h_event = hp.hostEvents5(entries)
208-
209- - ``hostEvents6 `` Generate 6 particle Event. Syntax:
210-
211- - h_event = hp.hostEvents6(entries)
212-
213- - ``hostEvents7 `` Generate 7 particle Event. Syntax:
214-
215- - h_event = hp.hostEvents7(entries)
216-
217- - ``hostEvents8 `` Generate 8 particle Event. Syntax:
218-
219- - h_event = hp.hostEvents8(entries)
220-
221- - ``hostEvents9 `` Generate 9 particle Event. Syntax:
222-
223- - h_event = hp.hostEvents9(entries)
224-
225- - ``hostEvents10 `` Generate 10 particle Event. Syntax:
226-
227- - h_event = hp.hostEvents10(entries)
228-
229- - ``deviceEvents1 `` Generate 1 particle Event. Syntax:
230-
231- - d_event = hp.hostEvents1(entries)
232-
233- - ``deviceEvents2 `` Generate 2 particle Event. Syntax:
234-
235- - d_event = hp.hostEvents2(entries)
236-
237- - ``deviceEvents3 `` Generate 3 particle Event. Syntax:
238-
239- - d_event = hp.hostEvents3(entries)
240-
241- - ``deviceEvents4 `` Generate 4 particle Event. Syntax:
242-
243- - d_event = hp.hostEvents4(entries)
244-
245- - ``deviceEvents5 `` Generate 5 particle Event. Syntax:
246-
247- - d_event = hp.hostEvents5(entries)
248-
249- - ``deviceEvents6 `` Generate 6 particle Event. Syntax:
250-
251- - d_event = hp.hostEvents6(entries)
252-
253- - ``deviceEvents7 `` Generate 7 particle Event. Syntax:
254-
255- - d_event = hp.hostEvents7(entries)
256-
257- - ``deviceEvents8 `` Generate 8 particle Event. Syntax:
258-
259- - d_event = hp.hostEvents8(entries)
260-
261- - ``deviceEvents9 `` Generate 9 particle Event. Syntax:
262-
263- - d_event = hp.hostEvents9(entries)
264-
265- - ``devicevents10 `` Generate 10 particle Event. Syntax:
266-
267- - d_event = hp.hostEvents10(entries)
0 commit comments