Belle II Software development
ElossHarvestingModule Class Reference
Inheritance diagram for ElossHarvestingModule:
HarvestingModule

Public Member Functions

 __init__ (self, output_file_name)
 
 initialize (self)
 
 prepare (self)
 
 pick (self, track)
 
 peel (self, track)
 
 id (self)
 
 event (self)
 
 terminate (self)
 
 barn (self)
 
 gather (self)
 
 refine (self, crops)
 

Static Public Member Functions

 create_crop_part_collection ()
 
 iter_store_obj (store_obj)
 

Public Attributes

 mc_track_lookup = None
 by default, there is no method to find matching MC tracks
 
 track_fitter = origin_track_fitter
 Use the CDCReimannFitter with a constrained origin for track fitting.
 
 mc_hit_lookup = TFCDC.CDCMCHitLookUp.getInstance()
 Method to find matching MC tracks.
 
 eloss_estimator = TFCDC.EnergyLossEstimator.forCDC()
 Method to estimate dE/dx in the CDC.
 
 bfield = TFCDC.CDCBFieldUtil
 Method to interrogate the magnetic field values.
 
 foreach = foreach
 Name of the StoreArray or iterable StoreObjPtr that contains the objects to be harvested.
 
 output_file_name = output_file_name
 Name of the ROOT output file to be generated.
 
 title = title or self.name()
 Name of this harvest.
 
 contact = contact
 Contact email address to be displayed on the validation page.
 
int expert_level = self.default_expert_level if expert_level is None else expert_level
 Integer expert level that controls to detail of plots to be generated.
 
list refiners = []
 A list of additional refiner instances to be executed on top of the refiner methods that are members of this class.
 
 show_results = show_results
 Switch to show the result ROOT file in a TBrowser on terminate.
 
 stash = self.barn()
 stash of the harvested crops (start with those in the barn)
 
 crops
 the dictionaries from peel
 
 raw_crops = raw_crops
 the dictionaries from peel as a numpy.array of doubles
 

Static Public Attributes

 save_tree = refiners.save_tree()
 Refiners to be executed at the end of the harvesting / termination of the module Save a tree of all collected variables in a sub folder.
 
 save_histograms
 Save histograms in a sub folder.
 
 save_histograms_stackby_charge
 Save the histograms, stacked by charge, in a sub folder.
 
 save_scatter
 Save the scatterplots in a sub folder.
 
 save_profiles
 Save the profile histograms to the output ROOT file.
 
 save_bz_profiles
 Save the magnetic-field profile histogram in a sub folder.
 
 save_cid_histogram
 Save the eloss-displacement histograms in a sub folder.
 
 save_cid_profiles
 Save the eloss-displacement profile histograms in a sub folder.
 
 save_cid_scatters
 Save the eloss-displacement scatterplots in a sub folder.
 
 save_energy_cid_histogram
 Save the eloss histograms in a sub folder.
 
 save_energy_cid_profiles
 Save the eloss profile histograms in a sub folder.
 
 save_energy_cid_scatters
 Save the eloss profile scatterplots in a sub folder.
 
int default_expert_level = 1
 The default value of expert_level if not specified explicitly by the caller.
 

Detailed Description

Module to collect information about the generated segments and
compose validation plots on terminate.

Definition at line 141 of file record.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
output_file_name )
Constructor

Definition at line 146 of file record.py.

146 def __init__(self, output_file_name):
147 """Constructor"""
148 super().__init__(foreach='CDCTrackVector',
149 output_file_name=output_file_name)
150
151 ## by default, there is no method to find matching MC tracks
152 self.mc_track_lookup = None
153
154 origin_track_fitter = TFCDC.CDCRiemannFitter()
155 origin_track_fitter.setOriginConstrained()
156 ## Use the CDCReimannFitter with a constrained origin for track fitting
157 self.track_fitter = origin_track_fitter
158

Member Function Documentation

◆ barn()

barn ( self)
inherited
Coroutine that receives the dictionaries of names and values from peel and store them.

Reimplemented in PickleHarvestingModule.

Definition at line 287 of file harvesting.py.

287 def barn(self):
288 """Coroutine that receives the dictionaries of names and values from peel and store them."""
289 crop = (yield)
290 raw_crops = copy.copy(crop)
291 crops = copy.copy(crop)
292
293 if isinstance(crop, numbers.Number):
294 raw_crops = self.create_crop_part_collection()
295 try:
296 while True:
297 raw_crops.append(crop)
298 # next crop
299 crop = (yield)
300 except GeneratorExit:
301 crops = np.array(raw_crops)
302
303 elif isinstance(crop, collections.abc.MutableMapping):
304 for part_name in crop:
305 raw_crops[part_name] = self.create_crop_part_collection()
306
307 try:
308 while True:
309 for part_name, parts in list(raw_crops.items()):
310 if part_name in crop:
311 parts.append(crop[part_name])
312 else:
313 parts.append(np.NaN)
314 # next crop
315 crop = (yield)
316 except GeneratorExit:
317 for part_name, parts in list(raw_crops.items()):
318 crops[part_name] = np.array(parts)
319
320 else:
321 msg = f"Unrecognised crop {crop} of type {type(crop)}"
322 raise ValueError(msg)
323
324
325 self.raw_crops = raw_crops
326
327 self.crops = crops
328

◆ create_crop_part_collection()

create_crop_part_collection ( )
staticinherited
Create the storing objects for the crop values

Currently a numpy.array of doubles is used to store all values in memory.

Definition at line 279 of file harvesting.py.

279 def create_crop_part_collection():
280 """Create the storing objects for the crop values
281
282 Currently a numpy.array of doubles is used to store all values in memory.
283 """
284 return array.array("d")
285

◆ event()

event ( self)
inherited
Event method of the module

* Does invoke the prepare method before the iteration starts.
* In each event fetch the StoreArray / iterable StoreObjPtr,
* Iterate through all instances
* Feed each instance to the pick method to decide it the instance is relevant
* Forward it to the peel method that should generated a dictionary of values
* Store each dictionary of values

Definition at line 239 of file harvesting.py.

239 def event(self):
240 """Event method of the module
241
242 * Does invoke the prepare method before the iteration starts.
243 * In each event fetch the StoreArray / iterable StoreObjPtr,
244 * Iterate through all instances
245 * Feed each instance to the pick method to decide it the instance is relevant
246 * Forward it to the peel method that should generated a dictionary of values
247 * Store each dictionary of values
248 """
249 self.prepare()
250 stash = self.stash.send
251 pick = self.pick
252 peel = self.peel
253 for crop in self.gather():
254 if pick(crop):
255 crop = peel(crop)
256 if isinstance(crop, types.GeneratorType):
257 many_crops = crop
258 for crop in many_crops:
259 stash(crop)
260 else:
261 stash(crop)
262

◆ gather()

gather ( self)
inherited
Iterator that yield the instances form the StoreArray / iterable StoreObj.

Yields
------
Object instances from the StoreArray, iterable StoreObj or the StoreObj itself
in case it is not iterable.

Definition at line 329 of file harvesting.py.

329 def gather(self):
330 """Iterator that yield the instances form the StoreArray / iterable StoreObj.
331
332 Yields
333 ------
334 Object instances from the StoreArray, iterable StoreObj or the StoreObj itself
335 in case it is not iterable.
336 """
337
338 registered_store_arrays = Belle2.PyStoreArray.list()
339 registered_store_objs = Belle2.PyStoreObj.list()
340
341 foreach = self.foreach
342 foreach_is_store_obj = foreach in registered_store_objs
343 foreach_is_store_array = foreach in registered_store_arrays
344
345 if foreach is not None:
346 if foreach_is_store_array:
347 store_array = Belle2.PyStoreArray(self.foreach)
348 yield from store_array
349
350 elif foreach_is_store_obj:
351 store_obj = Belle2.PyStoreObj(self.foreach)
352 try:
353 yield from self.iter_store_obj(store_obj)
354 except TypeError:
355 # Cannot iter the store object. Yield it instead.
356 yield store_obj.obj()
357
358 else:
359 msg = f"Name {self.foreach} does not refer to a valid object on the data store"
360 raise KeyError(msg)
361 else:
362 yield None
363
A (simplified) python wrapper for StoreArray.
static std::vector< std::string > list(DataStore::EDurability durability=DataStore::EDurability::c_Event)
Return list of available arrays for given durability.
a (simplified) python wrapper for StoreObjPtr.
Definition PyStoreObj.h:67
static std::vector< std::string > list(DataStore::EDurability durability=DataStore::EDurability::c_Event)
Return list of available objects for given durability.
Definition PyStoreObj.cc:28

◆ id()

id ( self)
inherited
Working around that name() is a method.

Exposing the name as a property using a different name

Definition at line 224 of file harvesting.py.

224 def id(self):
225 """Working around that name() is a method.
226
227 Exposing the name as a property using a different name
228 """
229 return self.name()
230

◆ initialize()

initialize ( self)
Receive signal at the start of event processing

Reimplemented from HarvestingModule.

Definition at line 159 of file record.py.

159 def initialize(self):
160 """Receive signal at the start of event processing"""
161 super().initialize()
162
163 self.mc_track_lookup = TFCDC.CDCMCTrackLookUp.getInstance()
164
165 self.mc_hit_lookup = TFCDC.CDCMCHitLookUp.getInstance()
166
167 self.eloss_estimator = TFCDC.EnergyLossEstimator.forCDC()
168
169 self.bfield = TFCDC.CDCBFieldUtil
170

◆ iter_store_obj()

iter_store_obj ( store_obj)
staticinherited
Obtain a iterator from a StoreObj

Repeatedly calls iter(store_obj) or store_obj.__iter__()
until the final iterator returns itself

Returns
-------
iterator of the StoreObj

Definition at line 443 of file harvesting.py.

443 def iter_store_obj(store_obj):
444 """Obtain a iterator from a StoreObj
445
446 Repeatedly calls iter(store_obj) or store_obj.__iter__()
447 until the final iterator returns itself
448
449 Returns
450 -------
451 iterator of the StoreObj
452 """
453 iterable = store_obj.obj()
454 last_iterable = None
455 while iterable is not last_iterable:
456 if hasattr(iterable, "__iter__"):
457 iterable, last_iterable = iterable.__iter__(), iterable
458 else:
459 iterable, last_iterable = iter(iterable), iterable
460 return iterable
461
462

◆ peel()

peel ( self,
track )
Aggregate the track and MC information for dE/dx analysis

Reimplemented from HarvestingModule.

Definition at line 192 of file record.py.

192 def peel(self, track):
193 """Aggregate the track and MC information for dE/dx analysis"""
194 mc_track_lookup = self.mc_track_lookup
195
196 # rl_drift_circle = 1
197 # unit_variance = 0
198 # observations2D = TFCDC.CDCObservations2D(rl_drift_circle, unit_variance)
199
200 # for recoHit3D in track:
201 # observations2D.append(recoHit3D)
202
203 # trajectory2D = track_fitter.fit(observations2D)
204 # trajectory2D.setLocalOrigin(TFCDC.Vector2D(0, 0))
205
206 mc_particle = mc_track_lookup.getMCParticle(track)
207 pdg_code = mc_particle.getPDG()
208 t_vertex = mc_particle.getVertex()
209 t_mom = mc_particle.getMomentum()
210 charge = mc_particle.getCharge()
211 mass = mc_particle.getMass()
212 mc_energy = mc_particle.getEnergy()
213
214 mc_vertex2D = TFCDC.Vector2D(t_vertex.XYvector())
215 mc_mom2D = TFCDC.Vector2D(t_mom.XYvector())
216 mc_trajectory2D = TFCDC.CDCTrajectory2D(mc_vertex2D, 0, mc_mom2D, charge)
217 mc_pt = mc_mom2D.norm()
218
219 first_hit = self.mc_track_lookup.getFirstHit(track)
220 first_sim_hit = first_hit.getRelated("CDCSimHits")
221 if first_sim_hit is None:
222 return
223 # Make sure we start the track in the first layer to avoid some confusion
224 if first_sim_hit.getWireID().getICLayer() != 0:
225 return
226
227 last_hit = self.mc_track_lookup.getLastHit(track)
228 last_sim_hit = last_hit.getRelated("CDCSimHits")
229 if last_sim_hit is None:
230 return
231 # Make sure we start the track in the last layer to avoid some confusion
232 # if last_sim_hit.getWireID().getICLayer() != 55: return
233 # last_sim_mom3D = TFCDC.Vector3D(last_sim_hit.getMomentum())
234
235 first_sim_pos3D = TFCDC.Vector3D(first_sim_hit.getPosTrack())
236 first_sim_mom3D = TFCDC.Vector3D(first_sim_hit.getMomentum())
237 first_sim_tof = first_sim_hit.getFlightTime()
238 first_sim_energy = np.sqrt(first_sim_mom3D.norm() ** 2 + mass ** 2)
239 first_sim_pt = first_sim_mom3D.cylindricalR()
240 first_sim_pz = first_sim_mom3D.z()
241
242 first_sim_mom2D = first_sim_mom3D.xy()
243
244 # first_sim_mom2D.normalizeTo(last_sim_mom3D.cylindricalR())
245 first_sim_trajectory2D = TFCDC.CDCTrajectory2D(first_sim_pos3D.xy(), first_sim_tof, first_sim_mom2D, charge)
246
247 # mc_trajectory3D = mc_track_lookup.getTrajectory3D(track)
248 # mc_trajectory2D = mc_trajectory3D.getTrajectory2D()
249
250 for reco_hit3D in track:
251 sim_hit = self.mc_hit_lookup.getSimHit(reco_hit3D.getWireHit().getHit())
252 if sim_hit is None:
253 continue
254
255 sim_mom3D = TFCDC.Vector3D(sim_hit.getMomentum())
256 sim_energy = np.sqrt(sim_mom3D.norm() ** 2 + mass ** 2)
257 sim_pt = sim_mom3D.cylindricalR()
258 sim_pz = sim_mom3D.z()
259
260 mc_eloss_truth = mc_energy - sim_energy
261 first_eloss_truth = first_sim_energy - sim_energy
262
263 sim_pos3D = TFCDC.Vector3D(sim_hit.getPosTrack())
264 sim_pos2D = sim_pos3D.xy()
265
266 layer_cid = reco_hit3D.getWire().getICLayer()
267 bz = self.bfield.getBFieldZ(sim_pos3D)
268 r = sim_pos3D.cylindricalR()
269
270 # recoPos3D = reco_hit3D.getRecoPos3D()
271 # recoPos3D = TFCDC.Vector3D(sim_hit.getPosTrack())
272 # recoPos2D = recoPos3D.xy()
273 # refPos2D = reco_hit3D.getRefPos2D()
274 # l = reco_hit3D.getSignedRecoDriftLength()
275
276 mc_s2D = mc_trajectory2D.calcArcLength2D(sim_pos2D)
277 first_s2D = first_sim_trajectory2D.calcArcLength2D(sim_pos2D)
278
279 if mc_s2D < 0:
280 # mc_s2D += mc_trajectory2D.getArcLength2DPeriod()
281 continue
282
283 mc_eloss_estimate = self.eloss_estimator.getEnergyLoss(mc_pt, pdg_code, mc_s2D)
284 first_eloss_estimate = self.eloss_estimator.getEnergyLoss(first_sim_pt, pdg_code, first_s2D)
285 first_ploss_factor = self.eloss_estimator.getMomentumLossFactor(first_sim_pt, pdg_code, first_s2D)
286
287 sasha_eloss_estimate = getBetheEnergyLoss(first_sim_pt, pdg_code, first_s2D)
288 sasha_ploss_factor = DeltaR(first_s2D, pdg_code, first_sim_pt)
289
290 # first_residual2D = first_trajectory2D.getDist2D(refPos2D) - l
291 first_residual2D = first_sim_trajectory2D.getDist2D(sim_pos2D)
292 first_disp2D = charge * first_residual2D
293
294 first_loss_disp2D_estimate = abs(self.eloss_estimator.getLossDist2D(first_sim_pt, pdg_code, first_s2D))
295 first_delossed_disp2D = first_disp2D - first_loss_disp2D_estimate
296
297 # mc_residual2D = mc_trajectory2D.getDist2D(refPos2D) - l
298 mc_residual2D = mc_trajectory2D.getDist2D(sim_pos2D)
299 mc_disp2D = charge * mc_residual2D
300
301 mc_loss_disp2D_estimate = abs(self.eloss_estimator.getLossDist2D(mc_pt, pdg_code, mc_s2D))
302 mc_delossed_disp2D = mc_disp2D - mc_loss_disp2D_estimate
303
304 # s2D = trajectory2D.calcArcLength2D(recoPos2D)
305 # if s2D < 0: s2D += trajectory2D.getArcLength2DPeriod()
306
307 # residual2D = trajectory2D.getDist2D(recoPos2D)
308 # disp2D = charge * residual2D
309
310 # # Original approach
311 # center2D = trajectory2D.getGlobalCircle().center()
312 # radius2D = recoPos2D - center2D;
313
314 # eLoss = self.eloss_estimator.getEnergyLoss(mc_pt, pdg_code, mc_s2D)
315 # dx = self.eloss_estimator.getMomentumLossFactor(mc_pt, pdg_code, mc_s2D)
316 # deloss_radius2D = recoPos2D - center2D;
317 # deloss_radius2D.scale (1.0 / dx)
318 # loss_disp2D_estimate2 = (deloss_radius2D - radius2D).norm()
319
320 # loss_disp2D_estimate3 = radius2D.norm() * (1.0 /dx - 1.0)
321 # loss_disp2D_estimate3 = radius2D.norm() * ((1.0 - dx) /dx)
322 # loss_disp2D_estimate3 = radius2D.norm() * (eLoss / (mc_pt - eLoss))
323
324 if abs(mc_residual2D) > 6:
325 continue
326
327 if abs(first_residual2D) > 6:
328 continue
329
330 yield dict(
331 layer_cid=layer_cid,
332 r=r,
333 bz=bz,
334 # pt=trajectory2D.getAbsMom2D(),
335 pdg_code=abs(pdg_code),
336 mass=mass,
337 charge=charge,
338 mc_pt=mc_pt,
339 first_sim_pt=first_sim_pt,
340 sim_pt=sim_pt,
341
342 diff_pt=first_sim_pt - sim_pt,
343 diff_pz=first_sim_pz - sim_pz,
344
345 mc_eloss_truth=mc_eloss_truth,
346 mc_eloss_estimate=mc_eloss_estimate,
347
348 first_eloss_truth=first_eloss_truth,
349
350 first_eloss_estimate=first_eloss_estimate,
351 sasha_eloss_estimate=sasha_eloss_estimate,
352
353 first_ploss_factor=first_ploss_factor,
354 sasha_ploss_factor=sasha_ploss_factor,
355
356 # l=l,
357
358 first_s2D=first_s2D,
359 first_residual2D=first_residual2D,
360 first_disp2D=first_disp2D,
361 first_loss_disp2D_estimate=first_loss_disp2D_estimate,
362 first_delossed_disp2D=first_delossed_disp2D,
363
364 mc_s2D=mc_s2D,
365 mc_residual2D=mc_residual2D,
366 mc_disp2D=mc_disp2D,
367 mc_loss_disp2D_estimate=mc_loss_disp2D_estimate,
368 mc_delossed_disp2D=mc_delossed_disp2D,
369
370 # s2D=s2D,
371 # disp2D=disp2D,
372 # residual2D=residual2D,
373
374 # loss_disp2D_estimate2=loss_disp2D_estimate2,
375 # loss_disp2D_estimate3=loss_disp2D_estimate3,
376 )
377

◆ pick()

pick ( self,
track )
Select tracks with at least 4 segments and associated primary MC particle with pt >= 0.25 GeV/c

Reimplemented from HarvestingModule.

Definition at line 175 of file record.py.

175 def pick(self, track):
176 """Select tracks with at least 4 segments and associated primary MC particle with pt >= 0.25 GeV/c"""
177 if track.size() < 4:
178 return False
179
180 mc_track_lookup = self.mc_track_lookup
181 mc_particle = mc_track_lookup.getMCParticle(track)
182
183 # Check that mc_particle is not a nullptr
184 if mc_particle is None:
185 return False
186
187 if mc_particle.getMomentum().Rho() < 0.250:
188 return False
189
190 return is_primary(mc_particle)
191

◆ prepare()

prepare ( self)
Initialize the MC-hit lookup method

Reimplemented from HarvestingModule.

Definition at line 171 of file record.py.

171 def prepare(self):
172 """Initialize the MC-hit lookup method"""
173 TFCDC.CDCMCHitLookUp.getInstance().fill()
174

◆ refine()

refine ( self,
crops )
inherited
Receive the gathered crops and forward them to the refiners.

Reimplemented in PickleHarvestingModule.

Definition at line 398 of file harvesting.py.

398 def refine(self, crops):
399 """Receive the gathered crops and forward them to the refiners."""
400
401 kwds = {}
402 if self.output_file_name:
403 # Save everything to a ROOT file
404 if isinstance(self.output_file_name, ROOT.TFile):
405 output_tdirectory = self.output_file_name
406 else:
407 output_tfile = ROOT.TFile(self.output_file_name, 'recreate')
408 output_tdirectory = output_tfile
409
410 else:
411 output_tdirectory = None
412
413 try:
414 with root_cd(output_tdirectory):
415 for refiner in self.refiners:
416 refiner(self, crops, tdirectory=output_tdirectory, **kwds)
417
418 # Get the methods marked as refiners from the class
419 cls = type(self)
420 for name in dir(cls):
421 if isinstance(getattr(cls, name), Refiner):
422 refiner = getattr(self, name)
423 # Getattr already binds self
424 refiner(crops, tdirectory=output_tdirectory, **kwds)
425
426 finally:
427 # If we opened the TFile ourself, close it again
428 if self.output_file_name:
429 if isinstance(self.output_file_name, str):
430 output_tfile.Close()
431
432 if self.show_results and self.output_file_name:
433 if isinstance(self.output_file_name, str):
434 output_tfile = ROOT.TFile(self.output_file_name)
435 root_browse(output_tfile)
436 input("Press enter to close")
437 output_tfile.Close()
438 else:
439 root_browse(self.output_file_name)
440 input("Press enter to close")
441

◆ terminate()

terminate ( self)
inherited
Termination method of the module.

Finalize the collected crops.
Start the refinement.

Reimplemented in ClusterFilterValidationModule.

Definition at line 263 of file harvesting.py.

263 def terminate(self):
264 """Termination method of the module.
265
266 Finalize the collected crops.
267 Start the refinement.
268 """
269
270 self.stash.close()
271 del self.stash
272
273 try:
274 self.refine(self.crops)
275 except AttributeError:
276 pass
277

Member Data Documentation

◆ bfield

bfield = TFCDC.CDCBFieldUtil

Method to interrogate the magnetic field values.

Definition at line 169 of file record.py.

◆ contact

contact = contact
inherited

Contact email address to be displayed on the validation page.

Definition at line 211 of file harvesting.py.

◆ crops

crops
inherited

the dictionaries from peel

Definition at line 274 of file harvesting.py.

◆ default_expert_level

int default_expert_level = 1
staticinherited

The default value of expert_level if not specified explicitly by the caller.

Definition at line 156 of file harvesting.py.

◆ eloss_estimator

eloss_estimator = TFCDC.EnergyLossEstimator.forCDC()

Method to estimate dE/dx in the CDC.

Definition at line 167 of file record.py.

◆ expert_level

int expert_level = self.default_expert_level if expert_level is None else expert_level
inherited

Integer expert level that controls to detail of plots to be generated.

Definition at line 214 of file harvesting.py.

◆ foreach

foreach = foreach
inherited

Name of the StoreArray or iterable StoreObjPtr that contains the objects to be harvested.

Definition at line 196 of file harvesting.py.

◆ mc_hit_lookup

mc_hit_lookup = TFCDC.CDCMCHitLookUp.getInstance()

Method to find matching MC tracks.

Method to find matching MC hits

Definition at line 165 of file record.py.

◆ mc_track_lookup

mc_track_lookup = None

by default, there is no method to find matching MC tracks

Definition at line 152 of file record.py.

◆ output_file_name

output_file_name = output_file_name
inherited

Name of the ROOT output file to be generated.

Definition at line 199 of file harvesting.py.

◆ raw_crops

raw_crops = raw_crops
inherited

the dictionaries from peel as a numpy.array of doubles

Definition at line 325 of file harvesting.py.

◆ refiners

list refiners = []
inherited

A list of additional refiner instances to be executed on top of the refiner methods that are members of this class.

Definition at line 218 of file harvesting.py.

◆ save_bz_profiles

save_bz_profiles
static
Initial value:
= refiners.save_profiles(
x='r',
y='bz',
)

Save the magnetic-field profile histogram in a sub folder.

Definition at line 425 of file record.py.

◆ save_cid_histogram

save_cid_histogram
static
Initial value:
= refiners.save_histograms(
select=[
# 'mc_disp2D',
# 'mc_delossed_disp2D',
'first_disp2D',
'first_delossed_disp2D',
'bz',
# 'disp2D',
],
outlier_z_score=5.0,
groupby=["layer_cid"],
# stackby="pdg_code",
)

Save the eloss-displacement histograms in a sub folder.

Definition at line 434 of file record.py.

◆ save_cid_profiles

save_cid_profiles
static
Initial value:
= refiners.save_profiles(
x=["mc_pt"],
y=[
# 'mc_disp2D',
# 'mc_delossed_disp2D',
'first_disp2D',
'first_delossed_disp2D',
],
outlier_z_score=5.0,
groupby=["layer_cid"],
stackby="pdg_code",
)

Save the eloss-displacement profile histograms in a sub folder.

Definition at line 449 of file record.py.

◆ save_cid_scatters

save_cid_scatters
static
Initial value:
= refiners.save_scatters(
x=["mc_pt"],
y=[
# 'mc_disp2D',
# 'mc_delossed_disp2D',
'first_disp2D',
'first_delossed_disp2D',
],
outlier_z_score=5.0,
groupby=["layer_cid"],
stackby="pdg_code",
)

Save the eloss-displacement scatterplots in a sub folder.

Definition at line 463 of file record.py.

◆ save_energy_cid_histogram

save_energy_cid_histogram
static
Initial value:
= refiners.save_histograms(
select=[
'pdg_code',
'first_eloss_estimate',
'first_eloss_truth',
],
outlier_z_score=5.0,
groupby=["layer_cid"],
stackby="pdg_code",
folder_name='energy/{groupby_addition}',
)

Save the eloss histograms in a sub folder.

Definition at line 479 of file record.py.

◆ save_energy_cid_profiles

save_energy_cid_profiles
static
Initial value:
= refiners.save_profiles(
x=["mc_pt"],
y=[
'first_eloss_truth',
'first_eloss_estimate',
],
outlier_z_score=5.0,
groupby=["layer_cid"],
stackby="pdg_code",
folder_name='energy/{groupby_addition}',
)

Save the eloss profile histograms in a sub folder.

Definition at line 492 of file record.py.

◆ save_energy_cid_scatters

save_energy_cid_scatters
static
Initial value:
= refiners.save_scatters(
x=["mc_pt"],
y=[
'first_eloss_truth',
'first_eloss_estimate',
],
outlier_z_score=5.0,
groupby=["layer_cid"],
stackby="pdg_code",
folder_name='energy/{groupby_addition}',
)

Save the eloss profile scatterplots in a sub folder.

Definition at line 505 of file record.py.

◆ save_histograms

save_histograms
static
Initial value:
= refiners.save_histograms(
outlier_z_score=5.0,
allow_discrete=True,
)

Save histograms in a sub folder.

Definition at line 382 of file record.py.

◆ save_histograms_stackby_charge

save_histograms_stackby_charge
static
Initial value:
= refiners.save_histograms(
select=[
# "mc_disp2D",
"first_disp2D",
"charge",
],
outlier_z_score=5.0,
allow_discrete=True,
fit="gaus",
fit_z_score=1,
groupby="charge",
)

Save the histograms, stacked by charge, in a sub folder.

Definition at line 388 of file record.py.

◆ save_profiles

save_profiles
static
Initial value:
= refiners.save_profiles(
x=['mc_s2D'],
y=[
# 'mc_disp2D',
'first_disp2D',
'disp2D',
],
groupby=[None, "charge"],
)

Save the profile histograms to the output ROOT file.

Definition at line 414 of file record.py.

◆ save_scatter

save_scatter
static
Initial value:
= refiners.save_scatters(
x=['mc_s2D'],
y=[
# 'mc_disp2D',
'disp2D',
],
groupby=[None, "charge"],
filter=lambda x: x == 211,
filter_on="pdg_code",
)

Save the scatterplots in a sub folder.

Definition at line 402 of file record.py.

◆ save_tree

save_tree = refiners.save_tree()
static

Refiners to be executed at the end of the harvesting / termination of the module Save a tree of all collected variables in a sub folder.

Definition at line 380 of file record.py.

◆ show_results

show_results = show_results
inherited

Switch to show the result ROOT file in a TBrowser on terminate.

Definition at line 221 of file harvesting.py.

◆ stash

stash = self.barn()
inherited

stash of the harvested crops (start with those in the barn)

Definition at line 237 of file harvesting.py.

◆ title

title = title or self.name()
inherited

Name of this harvest.

Title particle of this harvest

Definition at line 208 of file harvesting.py.

◆ track_fitter

track_fitter = origin_track_fitter

Use the CDCReimannFitter with a constrained origin for track fitting.

Definition at line 157 of file record.py.


The documentation for this class was generated from the following file: