Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
evgen::SupernovaGen Class Reference
Inheritance diagram for evgen::SupernovaGen:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 SupernovaGen (fhicl::ParameterSet const &p)
 
virtual ~SupernovaGen ()
 
void produce (art::Event &e)
 
void reconfigure (const fhicl::ParameterSet &p)
 
void beginRun (art::Run &r)
 
void endSubRun (art::SubRun &sr)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

void Generate (std::unique_ptr< std::vector< simb::MCTruth >> &truthcol)
 
double GetMomentum (const double &pkf, const double &m) const
 

Private Attributes

int fPDG
 PDG code of particles to generate. More...
 
int fPMeaning
 
int fCycle
 MC production cycle. More...
 
double fXlow
 Lower x position (cm) More...
 
double fXhigh
 Upper x position (cm) More...
 
double fYlow
 Lower y position (cm) More...
 
double fYhigh
 Upper y position (cm) More...
 
double fZlow
 Lower z position (cm) More...
 
double fZhigh
 Upper z position (cm) More...
 
double fTlow
 Lower t position (ns) More...
 
double fThigh
 Upper t position (ns) More...
 
double fCosZ0
 Cosine of central angle wrt z-axis. More...
 
double fPhiXY0
 Central angle in the x-y plane (degrees) More...
 
double fSigmaCosZ
 Size of variation of cosz. More...
 
double fSigmaPhiXY
 Size of variation in phixy (degrees) More...
 
int fAngleDist
 How to distribute angles (0=uniform, 1=gaussian) More...
 
std::string fPositronPDFFile
 ROOT file name where the positron PDFs are stored. More...
 
bool fOnlyNoise
 Generate no signal. More...
 
double fDistanceScaling
 Scaling factor to PDF values. More...
 
art::EventNumber_t fEventPadding
 Number of empty events to place at beginning of file. More...
 
TH2F * fPositronPDF
 
int fNtimePoints
 
int fNenergyBins
 
double fMinPositronEnergy = 0.0007488
 
double fMaxPositronEnergy = 0.09975
 
double fSigmaP
 
int fTimeIndex = 0
 

Static Private Attributes

static const int kUNIF = 0
 
static const int kGAUS = 1
 

Detailed Description

Definition at line 46 of file SupernovaGen_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

using art::EDProducer::WorkerType = WorkerT<EDProducer>
inherited

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

evgen::SupernovaGen::SupernovaGen ( fhicl::ParameterSet const &  p)
explicit

Definition at line 110 of file SupernovaGen_module.cc.

References art::EngineCreator::createEngine(), fhicl::ParameterSet::get(), evgb::GetRandomNumberSeed(), reconfigure(), and seed.

111  : fPMeaning(0)
112  , fCycle (p.get<int>("Cycle", 0))
113  {
114  this->reconfigure(p);
115 
116  // get the random number seed, use a random default if not specified
117  // in the configuration file.
118  int seed = p.get<unsigned int>("Seed", evgb::GetRandomNumberSeed());
119 
120  createEngine( seed );
121 
122  produces<std::vector<simb::MCTruth>>();
123  produces<sumdata::SubRunData, art::InSubRun>();
124  produces<sumdata::RunData, art::InRun >();
125  }
const char * p
Definition: xmltok.h:285
unsigned int GetRandomNumberSeed()
Definition: evgenbase.h:22
base_engine_t & createEngine(seed_t seed)
void reconfigure(const fhicl::ParameterSet &p)
unsigned int seed
Definition: runWimpSim.h:102
int fCycle
MC production cycle.
evgen::SupernovaGen::~SupernovaGen ( )
virtual

Definition at line 128 of file SupernovaGen_module.cc.

128 { }

Member Function Documentation

void evgen::SupernovaGen::beginRun ( art::Run r)
virtual

Reimplemented from art::EDProducer.

Definition at line 176 of file SupernovaGen_module.cc.

References geo::GeometryBase::DetId(), geo::GeometryBase::ExtractGDML(), geo::GeometryBase::FileBaseName(), and art::Run::put().

177  {
178  // Get the detector information and push it into the event as RunData
180  std::unique_ptr<sumdata::RunData> runcol(new sumdata::RunData(geo->DetId(),
181  geo->FileBaseName(),
182  geo->ExtractGDML()));
183  r.put(std::move(runcol));
184  return;
185  }
art::ProductID put(std::unique_ptr< PROD > &&)
Definition: Run.h:149
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
std::string ExtractGDML() const
Extract contents from fGDMLFile and return as a string.
Helper for AttenCurve.
Definition: Path.h:10
std::string FileBaseName() const
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDProducer::currentContext ( ) const
protectedinherited
void evgen::SupernovaGen::endSubRun ( art::SubRun sr)
virtual

Reimplemented from art::EDProducer.

Definition at line 188 of file SupernovaGen_module.cc.

References fCycle, art::SubRun::put(), and sd().

189  {
190  // store the cycle information
192  std::unique_ptr< sumdata::SubRunData > sd(new sumdata::SubRunData(fCycle));
193  sr.put(std::move(sd));
194  }
double sd(Eigen::VectorXd x)
ProductID put(std::unique_ptr< PROD > &&)
int fCycle
MC production cycle.
Helper for AttenCurve.
Definition: Path.h:10
void evgen::SupernovaGen::Generate ( std::unique_ptr< std::vector< simb::MCTruth >> &  truthcol)
private

Definition at line 217 of file SupernovaGen_module.cc.

References simb::MCTruth::Add(), simb::MCParticle::AddTrajectoryPoint(), std::cos(), om::cout, allTimeWatchdog::endl, fAngleDist, fCosZ0, fDistanceScaling, CLHEP::RandGaussQ::fire(), CLHEP::RandFlat::fire(), fMinPositronEnergy, fNenergyBins, fOnlyNoise, fPDG, fPhiXY0, fPositronPDF, fSigmaCosZ, fSigmaP, fSigmaPhiXY, fThigh, fTimeIndex, fTlow, fXhigh, fXlow, fYhigh, fYlow, fZhigh, fZlow, Munits::gauss, art::RandomNumberGenerator::getEngine(), GetMomentum(), kGAUS, simb::kSingleParticle, m, M_PI, part, elec2geo::pos, generate_hists::rnd, art::EngineCreator::rng(), simb::MCTruth::SetOrigin(), std::sin(), std::sqrt(), string, and submit_syst::x.

Referenced by produce().

218  {
219  // Set up the generators
221 
222  CLHEP::HepRandomEngine &engine = rng->getEngine();
223  CLHEP::RandFlat flat(engine);
224  CLHEP::RandGaussQ gauss(engine);
225 
226  //
227  // every event will have the positron distribution from the fPositronPDF array
228  //
229  int generatedPositrons = 0;
230 
231  for (int energyBin = 0; energyBin < fNenergyBins; ++energyBin) {
232  // the central momentum is given by the bin centre
233  double P0 = fMinPositronEnergy + (double(energyBin + 1) * 2. * fSigmaP);
234  double positronPDF = 0.;
235 
236  if (!fOnlyNoise)
237  positronPDF = fPositronPDF->GetBinContent(fTimeIndex, energyBin + 1);
238 
239  TRandom3 rnd(0); // zero seeds randomly
240 
241  int nPositrons = rnd.Poisson(positronPDF * fDistanceScaling);
242 
243  // Silence this output if no positrons produced
244  if (nPositrons > 0) {
245  std::cout << "\tEnergy bin[" << energyBin
246  << "] (" << P0
247  << " GeV), positron PDF: " << positronPDF
248  << std::endl;
249 
250  // Generate a Poisson-fluctated number of positrons based on this
251  std::cout << "\tGenerating " << nPositrons
252  << " positrons" << std::endl;
253  }
254 
255  for (int positronIdx = 0; positronIdx < nPositrons; ++positronIdx) {
256  generatedPositrons++;
257  simb::MCTruth mct;
259 
260  // Momentum, kinetic energy or full energy
261  double pkf = 0.0;
262  pkf = flat.fire(P0 - fSigmaP, P0 + fSigmaP);
263 
264  const TDatabasePDG* pdgt = TDatabasePDG::Instance();
265  const TParticlePDG* pdgp = pdgt->GetParticle(fPDG);
266 
267  // Mass in GeV
268  double m = 0.0;
269  if (pdgp) m = pdgp->Mass();
270 
271  // Momentum in GeV/c
272  const double p = GetMomentum(pkf, m);
273 
274  // Choose position
275  double x[4];
276  x[0] = flat.fire(fXlow, fXhigh);
277  x[1] = flat.fire(fYlow, fYhigh);
278  x[2] = flat.fire(fZlow, fZhigh);
279  x[3] = flat.fire(fTlow, fThigh);
280 
281  std::cout << "\t\tpositron[ " << generatedPositrons-1
282  << "]: p: " << p
283  << " GeV, x: " << x[0]
284  << " cm, y: " << x[1]
285  << " cm, z: " << x[2]
286  << " cm, t: " << x[3]
287  << " ns" << std::endl;
288 
289  const TLorentzVector pos(x[0], x[1], x[2], x[3]);
290 
291  // Choose angles
292  double cosz, phi;
293  unsigned int tryIdx;
294  for (tryIdx = 0; tryIdx < 1000000; ++tryIdx) {
295  if (fAngleDist == kGAUS) {
296  cosz = gauss.fire(fCosZ0, fSigmaCosZ);
297  phi = gauss.fire(fPhiXY0, fSigmaPhiXY);
298  } else {
299  cosz = flat.fire(fCosZ0 - fSigmaCosZ,
300  fCosZ0 + fSigmaCosZ);
301 
302  phi = flat.fire(fPhiXY0 - fSigmaPhiXY,
303  fPhiXY0 + fSigmaPhiXY);
304  }
305  if (cosz >= -1.0 && cosz <= 1.0) break;
306  }
307  if (cosz < -1.0 || cosz > 1.0) {
308  mf::LogError("SupernovaGen") << __FILE__ << ":" << __LINE__
309  << " Failed to find an acceptable cos(theta_z)"
310  << " after many tries.\n"
311  << " Please adjust CosZ0 and SigmaCosZ0 in your"
312  << " SupernovaGen.fcl file and rerun";
313  abort();
314  }
315 
316  const double sinz = sqrt(1.0 - cosz * cosz);
317  const double sinphi = sin(phi * M_PI / 180.0);
318  const double cosphi = cos(phi * M_PI / 180.0);
319 
320  // Set track id to -i as these are all primary particles and have id <= 0
321  const int trackid = -1 * (generatedPositrons + 1);
322 
323  const std::string primary("primary");
324  simb::MCParticle part(trackid, fPDG, primary);
325 
326  const TLorentzVector pvec(cosphi * sinz * p,
327  sinphi * sinz * p,
328  cosz * p,
329  sqrt(p * p + m * m));
330 
331  part.AddTrajectoryPoint(pos, pvec);
332 
333  mct.Add(part);
334  truthcol->push_back(mct);
335  } // end of loop over positrons
336  } // end loop over energy bins particles
337 
338  std::cout << "Generated a total of " << generatedPositrons
339  << " positrons for event " << fTimeIndex << std::endl;
340  }
double fYlow
Lower y position (cm)
int fAngleDist
How to distribute angles (0=uniform, 1=gaussian)
void SetOrigin(simb::Origin_t origin)
Definition: MCTruth.h:80
const char * p
Definition: xmltok.h:285
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
T sqrt(T number)
Definition: d0nt_math.hpp:156
double fYhigh
Upper y position (cm)
int fPDG
PDG code of particles to generate.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
void Add(simb::MCParticle &part)
Definition: MCTruth.h:79
#define M_PI
Definition: SbMath.h:34
static const int kGAUS
double fPhiXY0
Central angle in the x-y plane (degrees)
base_engine_t & getEngine() const
TString part[npart]
Definition: Style.C:32
double fSigmaCosZ
Size of variation of cosz.
double fXhigh
Upper x position (cm)
single particles thrown at the detector
Definition: MCTruth.h:26
double fZhigh
Upper z position (cm)
double fXlow
Lower x position (cm)
static constexpr Double_t gauss
Definition: Munits.h:360
double GetMomentum(const double &pkf, const double &m) const
double fCosZ0
Cosine of central angle wrt z-axis.
OStream cout
Definition: OStream.cxx:6
double fDistanceScaling
Scaling factor to PDF values.
T sin(T number)
Definition: d0nt_math.hpp:132
bool fOnlyNoise
Generate no signal.
double fTlow
Lower t position (ns)
double fZlow
Lower z position (cm)
double fSigmaPhiXY
Size of variation in phixy (degrees)
T cos(T number)
Definition: d0nt_math.hpp:78
double fThigh
Upper t position (ns)
Event generator information.
Definition: MCTruth.h:32
enum BeamMode string
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
double evgen::SupernovaGen::GetMomentum ( const double &  pkf,
const double &  m 
) const
private

Depending on configuration of fPMeaning calculate the momentum of the particle

Definition at line 343 of file SupernovaGen_module.cc.

References DEFINE_ART_MODULE(), fPMeaning, m, and std::sqrt().

Referenced by Generate().

343  {
344 
345  if (fPMeaning == 0) return pkf;
346 
347  double total_energy = 0.0;
348  if (fPMeaning == 1){
349  total_energy = pkf + m;
350  }
351  else if(fPMeaning == 2){
352  total_energy = pkf;
353  }
354  else{
355  total_energy = sqrt(pkf * pkf + m * m);
356  }
357 
358  return sqrt(total_energy * total_energy - m * m);
359  }
T sqrt(T number)
Definition: d0nt_math.hpp:156
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void evgen::SupernovaGen::produce ( art::Event e)
virtual

Implements art::EDProducer.

Definition at line 197 of file SupernovaGen_module.cc.

References art::Event::event(), fEventPadding, fNtimePoints, fTimeIndex, Generate(), and art::Event::put().

198  {
199  std::unique_ptr<std::vector<simb::MCTruth>> truthcol(new std::vector<simb::MCTruth>);
200 
201  // Only generate particles if we're done padding with empty events
202  if (e.event() > fEventPadding){
203  fTimeIndex++;
204 
205  // check that time index is within the available bounds
206  // TODO exit gracefully rather than crashing
207  if (fTimeIndex > fNtimePoints) return;
208 
209  Generate(truthcol);
210  }
211 
212  e.put(std::move(truthcol));
213  return;
214  }
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
void Generate(std::unique_ptr< std::vector< simb::MCTruth >> &truthcol)
EventNumber_t event() const
Definition: Event.h:67
art::EventNumber_t fEventPadding
Number of empty events to place at beginning of file.
void evgen::SupernovaGen::reconfigure ( const fhicl::ParameterSet p)

Definition at line 131 of file SupernovaGen_module.cc.

References om::cout, allTimeWatchdog::endl, fAngleDist, fCosZ0, fDistanceScaling, fEventPadding, fMaxPositronEnergy, fMinPositronEnergy, fNenergyBins, fNtimePoints, fOnlyNoise, fPDG, fPhiXY0, fPMeaning, fPositronPDF, fPositronPDFFile, fSigmaCosZ, fSigmaP, fSigmaPhiXY, fThigh, fTlow, fXhigh, fXlow, fYhigh, fYlow, fZhigh, fZlow, fhicl::ParameterSet::get(), ParseFluxesFile::root_file, and string.

Referenced by SupernovaGen().

132  {
133  fPDG = p.get<int>("PDG");
134  try{
135  fPMeaning = p.get<int>("PMeaning");
136  if (fPMeaning == 1) {
137  std::cout << "SupernovaGen: Using Kinetic energy for the meaning of P0, SigmaP and PDist" << std::endl;
138  }
139  else if(fPMeaning == 2) {
140  std::cout << "SupernovaGen: Using Total energy for the meaning of P0, SigmaP and PDist" << std::endl;
141  }
142  }
143  catch(...){
144  fPMeaning = 0;
145  }
146 
147  fXlow = p.get<double> ("Xlow");
148  fYlow = p.get<double> ("Ylow");
149  fZlow = p.get<double> ("Zlow");
150  fXhigh = p.get<double> ("Xhigh");
151  fYhigh = p.get<double> ("Yhigh");
152  fZhigh = p.get<double> ("Zhigh");
153  fTlow = p.get<double> ("Tlow");
154  fThigh = p.get<double> ("Thigh");
155  fCosZ0 = p.get<double> ("CosZ0");
156  fPhiXY0 = p.get<double> ("PhiXY0");
157  fSigmaPhiXY = p.get<double> ("SigmaPhiXY");
158  fSigmaCosZ = p.get<double> ("SigmaCosZ");
159  fAngleDist = p.get<int> ("AngleDist");
160  fPositronPDFFile = p.get<std::string> ("PositronPDFFile");
161  fOnlyNoise = p.get<bool> ("OnlyNoise");
162  fDistanceScaling = p.get<double> ("DistanceScaling");
163 
164  fEventPadding = p.get<art::EventNumber_t>("EventPadding");
165 
166  TFile *root_file = new TFile(fPositronPDFFile.c_str());
167  root_file->GetObject("ibd", fPositronPDF);
168 
169  fNtimePoints = fPositronPDF->GetNbinsX();
170  fNenergyBins = fPositronPDF->GetNbinsY();
171 
173  }
double fYlow
Lower y position (cm)
int fAngleDist
How to distribute angles (0=uniform, 1=gaussian)
double fYhigh
Upper y position (cm)
int fPDG
PDG code of particles to generate.
double fPhiXY0
Central angle in the x-y plane (degrees)
double fSigmaCosZ
Size of variation of cosz.
double fXhigh
Upper x position (cm)
T get(std::string const &key) const
Definition: ParameterSet.h:231
double fZhigh
Upper z position (cm)
double fXlow
Lower x position (cm)
std::string fPositronPDFFile
ROOT file name where the positron PDFs are stored.
double fCosZ0
Cosine of central angle wrt z-axis.
OStream cout
Definition: OStream.cxx:6
double fDistanceScaling
Scaling factor to PDF values.
bool fOnlyNoise
Generate no signal.
double fTlow
Lower t position (ns)
double fZlow
Lower z position (cm)
double fSigmaPhiXY
Size of variation in phixy (degrees)
IDNumber_t< Level::Event > EventNumber_t
Definition: IDNumber.h:117
double fThigh
Upper t position (ns)
art::EventNumber_t fEventPadding
Number of empty events to place at beginning of file.
enum BeamMode string
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

int evgen::SupernovaGen::fAngleDist
private

How to distribute angles (0=uniform, 1=gaussian)

Definition at line 85 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fCosZ0
private

Cosine of central angle wrt z-axis.

Definition at line 81 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

int evgen::SupernovaGen::fCycle
private

MC production cycle.

Definition at line 72 of file SupernovaGen_module.cc.

Referenced by endSubRun().

double evgen::SupernovaGen::fDistanceScaling
private

Scaling factor to PDF values.

Definition at line 90 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

art::EventNumber_t evgen::SupernovaGen::fEventPadding
private

Number of empty events to place at beginning of file.

Definition at line 91 of file SupernovaGen_module.cc.

Referenced by produce(), and reconfigure().

double evgen::SupernovaGen::fMaxPositronEnergy = 0.09975
private

Definition at line 98 of file SupernovaGen_module.cc.

Referenced by reconfigure().

double evgen::SupernovaGen::fMinPositronEnergy = 0.0007488
private

Definition at line 97 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

int evgen::SupernovaGen::fNenergyBins
private

Definition at line 96 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

int evgen::SupernovaGen::fNtimePoints
private

Definition at line 96 of file SupernovaGen_module.cc.

Referenced by produce(), and reconfigure().

bool evgen::SupernovaGen::fOnlyNoise
private

Generate no signal.

Definition at line 87 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

int evgen::SupernovaGen::fPDG
private

PDG code of particles to generate.

Definition at line 67 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fPhiXY0
private

Central angle in the x-y plane (degrees)

Definition at line 82 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

int evgen::SupernovaGen::fPMeaning
private

Meaning of P0, fSigmaP and fPDist. By default (fP0Meaning=0), P0 and sigmaP is momentum If fPMeaning=1, then P0 and sigmaP is kinetic energy in GeV If fPMeaning=2, then P0and sigmaP is total energy in GeV

Definition at line 68 of file SupernovaGen_module.cc.

Referenced by GetMomentum(), and reconfigure().

TH2F* evgen::SupernovaGen::fPositronPDF
private

Definition at line 94 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

std::string evgen::SupernovaGen::fPositronPDFFile
private

ROOT file name where the positron PDFs are stored.

Definition at line 86 of file SupernovaGen_module.cc.

Referenced by reconfigure().

double evgen::SupernovaGen::fSigmaCosZ
private

Size of variation of cosz.

Definition at line 83 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fSigmaP
private

Definition at line 100 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fSigmaPhiXY
private

Size of variation in phixy (degrees)

Definition at line 84 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fThigh
private

Upper t position (ns)

Definition at line 80 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

int evgen::SupernovaGen::fTimeIndex = 0
private

Definition at line 101 of file SupernovaGen_module.cc.

Referenced by Generate(), and produce().

double evgen::SupernovaGen::fTlow
private

Lower t position (ns)

Definition at line 79 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fXhigh
private

Upper x position (cm)

Definition at line 74 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fXlow
private

Lower x position (cm)

Definition at line 73 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fYhigh
private

Upper y position (cm)

Definition at line 76 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fYlow
private

Lower y position (cm)

Definition at line 75 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fZhigh
private

Upper z position (cm)

Definition at line 78 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

double evgen::SupernovaGen::fZlow
private

Lower z position (cm)

Definition at line 77 of file SupernovaGen_module.cc.

Referenced by Generate(), and reconfigure().

const int evgen::SupernovaGen::kGAUS = 1
staticprivate

Definition at line 65 of file SupernovaGen_module.cc.

Referenced by Generate().

const int evgen::SupernovaGen::kUNIF = 0
staticprivate

Definition at line 64 of file SupernovaGen_module.cc.


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