diff --git a/projects/dataclasses/public/SIREN/dataclasses/ParticleID.h b/projects/dataclasses/public/SIREN/dataclasses/ParticleID.h index 5e901a1e3..c01b8a841 100644 --- a/projects/dataclasses/public/SIREN/dataclasses/ParticleID.h +++ b/projects/dataclasses/public/SIREN/dataclasses/ParticleID.h @@ -4,7 +4,7 @@ #include // for uint32_t #include // for ostream #include // for runtime_error -#include +#include #include #include diff --git a/projects/injection/private/TreeWeighter.cxx b/projects/injection/private/TreeWeighter.cxx index 0ffcca65a..da692f3a8 100644 --- a/projects/injection/private/TreeWeighter.cxx +++ b/projects/injection/private/TreeWeighter.cxx @@ -7,7 +7,7 @@ #include // for ini... #include // for ope... #include // for set -#include +#include #include #include #include @@ -153,12 +153,11 @@ TreeWeighter::TreeWeighter(std::vector> injectors, std Initialize(); } -TreeWeighter::TreeWeighter(std::vector> _injectors, std::string filename) -{ +TreeWeighter::TreeWeighter(std::vector> _injectors, std::string filename) { LoadWeighter(filename); if(_injectors.size() > 0) { // overwrite the serialized injectors if the user have provided any - injectors = _injectors; + injectors = _injectors; } Initialize(); } diff --git a/projects/injection/public/SIREN/injection/Injector.h b/projects/injection/public/SIREN/injection/Injector.h index ec32d3d90..867761ccb 100644 --- a/projects/injection/public/SIREN/injection/Injector.h +++ b/projects/injection/public/SIREN/injection/Injector.h @@ -55,7 +55,7 @@ friend cereal::access; unsigned int injected_events = 0; std::shared_ptr random; std::shared_ptr detector_model; - // This funciton returns true if the given secondary index i of the datum should not be simulated + // This function returns true if the given secondary index i of the datum should not be simulated // Defaults to no secondary interactions being saved std::function, size_t)> stopping_condition= [&](std::shared_ptr datum, size_t i) { return true; diff --git a/projects/interactions/private/pybindings/pyDecay.h b/projects/interactions/private/pybindings/pyDecay.h index 7f2ce6bb0..190b227f8 100644 --- a/projects/interactions/private/pybindings/pyDecay.h +++ b/projects/interactions/private/pybindings/pyDecay.h @@ -55,7 +55,7 @@ class pyDecay : public Decay,Pybind11Trampoline { interaction ) } - + double TotalDecayWidth(dataclasses::InteractionRecord const & interaction) const override { SELF_OVERRIDE_PURE( self, diff --git a/python/SIREN_Controller.py b/python/SIREN_Controller.py index 60533778d..7f3050840 100644 --- a/python/SIREN_Controller.py +++ b/python/SIREN_Controller.py @@ -203,7 +203,7 @@ def SetProcesses( """ self.SetInjectionProcesses(primary_type,primary_injection_distributions,secondary_types,secondary_injection_distributions) self.SetPhysicalProcesses(primary_type,primary_physical_distributions,secondary_types,secondary_physical_distributions) - + def InputDarkNewsModel(self, primary_type, table_dir, fill_tables_at_start=False, Emax=None, **kwargs): """ Sets up the relevant processes and cross section/decay objects related to a provided DarkNews model dictionary. @@ -318,7 +318,7 @@ def GetCylinderVolumePositionDistributionFromSector(self, sector_name): det_rotation = geo.placement.Quaternion det_placement = _geometry.Placement(det_position.get(), det_rotation) cylinder = _geometry.Cylinder(det_placement,geo.Radius,geo.InnerRadius,geo.Z) - return _distributions.CylinderVolumePositionDistribution(cylinder) + return _distributions.CylinderVolumePositionDistribution(cylinder) def GetDetectorModelTargets(self): """ @@ -411,7 +411,7 @@ def SetInteractions( # must accept two arguments, assumes first is datum and the second is the index of the secondary particle def SetInjectorStoppingCondition(self, stopping_condition): self.injector.SetStoppingCondition(stopping_condition) - + # Initialize the injector, either from an existing .siren_injector file or from controller injection objects def InitializeInjector(self,filenames=None): if type(filenames)==str: @@ -443,7 +443,6 @@ def InitializeInjector(self,filenames=None): ) self.injectors[-1].ResetInjectedEvents() self.injector = self.injectors[0] # presume that injection happens with only the first provided injector - # Initialize the weighter, either from an existing .siren_weighter file or from controller injection objects def InitializeWeighter(self,filename=None): @@ -462,7 +461,6 @@ def InitializeWeighter(self,filename=None): self.injectors, filename ) - # Initialize the injector and weighter objects # Use existing .siren_injector and/or .siren_weighter files if they exist @@ -474,7 +472,7 @@ def Initialize(self, injection_filenames=None, weighter_filename=None): # Define the weighter object self.InitializeWeighter(filename=weighter_filename) - # Generate events using the self.injector object + # Generate events using the self.injector object def GenerateEvents(self, N=None, fill_tables_at_exit=True): if N is None: N = self.events_to_inject @@ -499,13 +497,13 @@ def LoadEvents(self, filename): self.events = _dataclasses.LoadInteractionTrees(filename) self.gen_times = np.zeros_like(self.events) self.global_times = np.zeros_like(self.events) - + # Save events to hdf5, parquet, and/or custom SIREN filetypes # if the weighter exists, calculate the event weight too def SaveEvents(self, filename, fill_tables_at_exit=True, hdf5=True, parquet=True, siren_events=True # filetypes to save events ): - + if siren_events: _dataclasses.SaveInteractionTrees(self.events, filename) # A dictionary containing each dataset we'd like to save @@ -545,7 +543,6 @@ def SaveEvents(self, filename, fill_tables_at_exit=True, datasets[k].append([]) # loop over interactions for id, datum in enumerate(event.tree): - datasets["vertex"][-1].append(np.array(datum.record.interaction_vertex,dtype=float)) # primary particle stuff @@ -553,7 +550,7 @@ def SaveEvents(self, filename, fill_tables_at_exit=True, datasets["primary_momentum"][-1].append(np.array(datum.record.primary_momentum, dtype=float)) # check parent idx; match on secondary momenta - if datum.depth()==0: + if datum.depth()==0: datasets["parent_idx"][-1].append(-1) else: for _id in range(len(datasets["secondary_momenta"][-1])): @@ -561,7 +558,7 @@ def SaveEvents(self, filename, fill_tables_at_exit=True, if (datasets["primary_momentum"][-1][-1] == secondary_momentum).all(): datasets["parent_idx"][-1].append(_id) break - + if self.fid_vol is not None: pos = _math.Vector3D(datasets["vertex"][-1][-1]) dir = _math.Vector3D(datasets["primary_momentum"][-1][-1][1:]) @@ -572,7 +569,7 @@ def SaveEvents(self, filename, fill_tables_at_exit=True, # target particle stuff datasets["target_type"][-1].append(int(datum.record.signature.target_type)) - + # secondary particle stuff datasets["secondary_types"][-1].append([]) datasets["secondary_momenta"][-1].append([]) @@ -599,7 +596,7 @@ def SaveEvents(self, filename, fill_tables_at_exit=True, fout.close() if parquet: ak.to_parquet(ak_array,filename+".parquet") - + # save darknews cross section tables if hasattr(self, "DN_processes"): self.DN_processes.SaveCrossSectionTables(fill_tables_at_exit=fill_tables_at_exit)