MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
WeightCalculator.hh
1
4//
5// This file is part of MARLEY (Model of Argon Reaction Low Energy Yields)
6//
7// MARLEY is free software: you can redistribute it and/or modify it under the
8// terms of version 3 of the GNU General Public License as published by the
9// Free Software Foundation.
10//
11// For the full text of the license please see COPYING or
12// visit http://opensource.org/licenses/GPL-3.0
13//
14// Please respect the MCnet academic usage guidelines. See GUIDELINES
15// or visit https://www.montecarlonet.org/GUIDELINES for details.
16#pragma once
17
18// Standard library includes
19#include <string>
20
21namespace HepMC3 {
22 class GenEvent;
23}
24
25namespace marley {
26
27 class Generator;
28 class JSON;
29
32 class WeightCalculator {
33
34 public:
35
36 WeightCalculator( const marley::JSON& config );
37 WeightCalculator( const std::string& name );
38 virtual ~WeightCalculator() = default;
39
55 virtual double weight( HepMC3::GenEvent& event,
56 marley::Generator& gen ) const = 0;
57
58 const std::string& name() const { return name_; }
59
60 protected:
61
63 std::string name_;
64 };
65
67 class TrivialWeightCalculator : public WeightCalculator {
68
69 public:
70
71 TrivialWeightCalculator( const marley::JSON& config )
72 : WeightCalculator( config ) {}
73 virtual ~TrivialWeightCalculator() = default;
74
75 inline virtual double weight( HepMC3::GenEvent& /*event*/,
76 marley::Generator& /*gen*/ ) const override { return 1.; }
77 };
78
79}
Stores event-related information.
Definition GenEvent.h:47
The MARLEY Event generator.
Definition Generator.hh:54
virtual double weight(HepMC3::GenEvent &, marley::Generator &) const override
Compute the weight for the given event.
virtual double weight(HepMC3::GenEvent &event, marley::Generator &gen) const =0
Compute the weight for the given event.
std::string name_
Name used to label the output event weight.