#include <SBNDThermalNoiseServiceInTime.h>
SBNDThermalNoiseServiceInTime::SBNDThermalNoiseServiceInTime |
( |
fhicl::ParameterSet const & |
pset | ) |
|
Definition at line 21 of file SBNDThermalNoiseServiceInTime_service.cc.
25 const string myname =
"SBNDThermalNoiseServiceInTime::ctor: ";
27 bool haveSeed = pset.get_if_present<
int>(
"RandomSeed",
fRandomSeed);
32 pset.get_if_present<
int>(
"LogLevel",
fLogLevel);
35 string rname =
"SBNDThermalNoiseServiceInTime";
37 if (
fLogLevel > 0 )
cout << myname <<
"WARNING: Using hardwired seed." << endl;
38 m_pran =
new HepJamesRandom(seed);
40 if (
fLogLevel > 0 )
cout << myname <<
"Using NuRandomService." << endl;
41 art::ServiceHandle<NuRandomService> seedSvc;
42 m_pran =
new HepJamesRandom;
44 seedSvc->registerEngine(NuRandomService::CLHEPengineSeeder(
m_pran), rname);
int fLogLevel
Log message level: 0=quiet, 1=init only, 2+=every event.
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const override
std::map< double, int > fShapingTimeOrder
unsigned int fNoiseArrayPoints
number of points in randomly generated noise array
CLHEP::HepRandomEngine * m_pran
CLHEP::HepRandomEngine * fNoiseEngine
int fRandomSeed
Seed for random number service. If absent or zero, use SeedSvc.
BEGIN_PROLOG could also be cout
SBNDThermalNoiseServiceInTime::SBNDThermalNoiseServiceInTime |
( |
fhicl::ParameterSet const & |
pset, |
|
|
art::ActivityRegistry & |
|
|
) |
| |
SBNDThermalNoiseServiceInTime::~SBNDThermalNoiseServiceInTime |
( |
| ) |
|
Definition at line 58 of file SBNDThermalNoiseServiceInTime_service.cc.
59 const string myname =
"SBNDThermalNoiseServiceInTime::dtor: ";
61 cout << myname <<
"Deleting random engine with seed " <<
m_pran->getSeed() << endl;
int fLogLevel
Log message level: 0=quiet, 1=init only, 2+=every event.
CLHEP::HepRandomEngine * m_pran
BEGIN_PROLOG could also be cout
Implements ChannelNoiseService.
Definition at line 68 of file SBNDThermalNoiseServiceInTime_service.cc.
72 art::ServiceHandle<geo::Geometry> geo;
73 art::ServiceHandle<util::SignalShapingServiceSBND> sss;
76 size_t view = (size_t)geo->View(chan);
79 auto tempNoiseVec = sss->GetNoiseFactVec();
80 double shapingTime = 2.0;
81 double asicGain = sss->GetASICGain(chan);
84 noise_factor = tempNoiseVec[view].at(
fShapingTimeOrder.find( shapingTime )->second );
85 noise_factor *= asicGain/4.7;
88 throw cet::exception(
"SBNDThermalNoiseServiceInTime_service")
90 <<
"Shaping Time recieved from signalshapingservices_sbnd.fcl is not one of the allowed values"
92 <<
"Allowed values: 0.5, 1.0, 2.0, 3.0 us"
97 CLHEP::RandGaussQ rGauss(*
fNoiseEngine, 0.0, noise_factor);
105 for (
unsigned int i = 0; i < sigs.size(); i++){
106 sigs.at(i) = rGauss.fire();
std::map< double, int > fShapingTimeOrder
CLHEP::HepRandomEngine * fNoiseEngine
void SBNDThermalNoiseServiceInTime::InitialiseProducerDeps |
( |
art::EDProducer * |
EDProdPointer, |
|
|
fhicl::ParameterSet const & |
pset |
|
) |
| |
|
inlineoverrideprivatevirtual |
Reimplemented from ChannelNoiseService.
Definition at line 79 of file SBNDThermalNoiseServiceInTime.h.
81 CLHEP::HepRandomEngine& NoiseEngine((art::ServiceHandle<rndm::NuRandomService>{}->createEngine(*EDProdPointer,
"HepJamesRandom",
"noise",pset,
"Seed")));
CLHEP::HepRandomEngine * fNoiseEngine
ostream & SBNDThermalNoiseServiceInTime::print |
( |
std::ostream & |
out = std::cout , |
|
|
std::string |
prefix = "" |
|
) |
| const |
|
overridevirtual |
Implements ChannelNoiseService.
Definition at line 115 of file SBNDThermalNoiseServiceInTime_service.cc.
116 out << prefix <<
"SBNDThermalNoiseServiceInTime: " << endl;
118 out << prefix <<
" LogLevel: " <<
fLogLevel << endl;
119 out << prefix <<
" RandomSeed: " <<
fRandomSeed << endl;
int fLogLevel
Log message level: 0=quiet, 1=init only, 2+=every event.
unsigned int fNoiseArrayPoints
number of points in randomly generated noise array
int fRandomSeed
Seed for random number service. If absent or zero, use SeedSvc.
int SBNDThermalNoiseServiceInTime::fLogLevel |
|
private |
unsigned int SBNDThermalNoiseServiceInTime::fNoiseArrayPoints |
|
private |
CLHEP::HepRandomEngine* SBNDThermalNoiseServiceInTime::fNoiseEngine |
|
private |
int SBNDThermalNoiseServiceInTime::fRandomSeed |
|
private |
std::map< double, int > SBNDThermalNoiseServiceInTime::fShapingTimeOrder |
|
private |
CLHEP::HepRandomEngine* SBNDThermalNoiseServiceInTime::m_pran |
|
private |
The documentation for this class was generated from the following files: