10#include "FemtoWeightGeneratorSupressed.h"
15#include <RtypesCore.h>
19 FemtoWeightGeneratorSupressed& FemtoWeightGeneratorSupressed::operator=(
const FemtoWeightGeneratorSupressed& other) {
22 if (fWeightGenerator)
delete fWeightGenerator;
29 if (gRandom->Rndm() > fSupressionFactor) {
return fWeightGenerator->
GenerateWeight(pair); }
35 fWeightGenerator = weight.
MakeCopy();
39 if (factor >= 0 && factor <= 1) fSupressionFactor = factor;
43 if (fWeightGenerator ==
nullptr)
return kFALSE;
44 return fWeightGenerator->
Init(task_id, pair);
47 FemtoWeightGeneratorSupressed::~FemtoWeightGeneratorSupressed() {
48 if (fWeightGenerator)
delete fWeightGenerator;
51 Package* FemtoWeightGeneratorSupressed::Report()
const {
52 Package* report =
new Package(
this);
53 report->AddObject(fWeightGenerator->Report());
54 report->AddObject(
new ParameterDouble(
"SupressionFactor", fSupressionFactor));
60 if (other.fWeightGenerator) { fWeightGenerator = other.fWeightGenerator->MakeCopy(); }
61 fSupressionFactor = other.fSupressionFactor;
void SetSupressionFactor(Double_t factor)
virtual Bool_t Init(Int_t task_id, FemtoPair *pair)
virtual Double_t GenerateWeight(FemtoPair *pair)
virtual FemtoWeightGenerator & operator=(const FemtoWeightGenerator &aModel)
virtual Bool_t Init(Int_t task_id, FemtoPair *pair)
virtual Double_t GenerateWeight(FemtoPair *pair)
virtual FemtoWeightGenerator * MakeCopy() const
virtual FemtoWeightGenerator * Clone(const char *="") const