Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
evgen::GENIENeutronOscGen Class Reference
Inheritance diagram for evgen::GENIENeutronOscGen:
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

 GENIENeutronOscGen (fhicl::ParameterSet const &pset)
 
virtual ~GENIENeutronOscGen ()
 
void produce (art::Event &evt)
 
void beginJob ()
 
void beginRun (art::Run &run)
 
void endSubRun (art::SubRun &sr)
 
void initializeNeutronOscGenerator ()
 
int selectAnnihilationMode (int pdgCode)
 
void fillMCTruth (const genie::EventRecord *record, simb::MCTruth &truth)
 
void setRandomEventVertexPosition (genie::EventRecord *record)
 
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 Attributes

TStopwatch stopwatch_
 keep track of how long it takes to run the job More...
 
int cycle_
 cycle number in the MC generation More...
 
int target_
 pdg code of the target More...
 
genie::NNBarOscMode_t gOptDecayMode_
 neutron oscillation mode More...
 
bool randomVertexPosition_
 
double vertexX_
 
double vertexY_
 
double vertexZ_
 
double vertexT_
 
const genie::EventRecordVisitorImcgen_
 
genie::RandomGenrnd_
 
double fdWidth_
 
double fdHeight_
 
double fdLength_
 

Detailed Description

Definition at line 65 of file GENIENeutronOscGen_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::GENIENeutronOscGen::GENIENeutronOscGen ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 103 of file GENIENeutronOscGen_module.cc.

References geo::GeometryBase::DetHalfHeight(), geo::GeometryBase::DetHalfWidth(), geo::GeometryBase::DetLength(), exit(), fdHeight_, fdLength_, fdWidth_, fhicl::ParameterSet::get(), gOptDecayMode_, initializeNeutronOscGenerator(), genie::RandomGen::Instance(), genie::utils::nnbar_osc::IsValidMode(), rnd_, genie::RandomGen::SetSeed(), and stopwatch_.

104  : cycle_(pset.get<int>("Cycle", 0))
105  , target_(pset.get<int>("Target", 1000060120))
106  , randomVertexPosition_(pset.get<bool>("RandomVertexPosition", false))
107  , vertexX_(pset.get<double>("VertexX", 0.))
108  , vertexY_(pset.get<double>("VertexY", 0.))
109  , vertexZ_(pset.get<double>("VertexZ", 30.))
110  , vertexT_(pset.get<double>("VertexT", 225.e-6))
111  {
112  stopwatch_.Start();
113 
114  gOptDecayMode_ = (genie::NNBarOscMode_t) pset.get<int>("AnnihilationMode", 0);
116  if (!validMode) {
117  mf::LogError("GENIENeutronOscGen") << "You need to specify a valid annihilation mode (0-16)";
118  exit(0);
119  }
120 
122  fdWidth_ = 2. * geo->DetHalfWidth() / 100.; // m
123  fdHeight_ = 2. * geo->DetHalfHeight() / 100.; // m
124  fdLength_ = geo->DetLength() / 100.; // m
125 
127 
129  rnd_->SetSeed(0);
130 
131  produces<std::vector<simb::MCTruth>>();
132  produces<sumdata::SubRunData, art::InSubRun>();
133  produces<sumdata::RunData, art::InRun>();
134  }
TStopwatch stopwatch_
keep track of how long it takes to run the job
static RandomGen * Instance()
Access instance.
Definition: RandomGen.cxx:79
int cycle_
cycle number in the MC generation
double DetLength() const
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
enum genie::ENNBarOscMode NNBarOscMode_t
double DetHalfHeight() const
genie::NNBarOscMode_t gOptDecayMode_
neutron oscillation mode
double DetHalfWidth() const
exit(0)
bool IsValidMode(NNBarOscMode_t ndm)
Helper for AttenCurve.
Definition: Path.h:10
int target_
pdg code of the target
void SetSeed(long int seed)
Definition: RandomGen.cxx:90
evgen::GENIENeutronOscGen::~GENIENeutronOscGen ( )
virtual

Definition at line 137 of file GENIENeutronOscGen_module.cc.

References stopwatch_.

138  {
139  // delete mcgen_;
140 
141  stopwatch_.Stop();
142  mf::LogInfo("GENIENeutronOscGen") << "real time to produce file: "
143  << stopwatch_.RealTime();
144  }
TStopwatch stopwatch_
keep track of how long it takes to run the job
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo

Member Function Documentation

void evgen::GENIENeutronOscGen::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 147 of file GENIENeutronOscGen_module.cc.

148  {
149  }
void evgen::GENIENeutronOscGen::beginRun ( art::Run run)
virtual

Reimplemented from art::EDProducer.

Definition at line 152 of file GENIENeutronOscGen_module.cc.

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

153  {
155 
156  std::unique_ptr<sumdata::RunData>
157  runcol(new sumdata::RunData(geo->DetId(),
158  geo->FileBaseName(),
159  geo->ExtractGDML()));
160 
161  run.put(std::move(runcol));
162 
163  return;
164  }
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::GENIENeutronOscGen::endSubRun ( art::SubRun sr)
virtual

Reimplemented from art::EDProducer.

Definition at line 167 of file GENIENeutronOscGen_module.cc.

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

168  {
170  std::unique_ptr< sumdata::SubRunData > sd(new sumdata::SubRunData(cycle_));
171  sr.put(std::move(sd));
172  }
int cycle_
cycle number in the MC generation
double sd(Eigen::VectorXd x)
ProductID put(std::unique_ptr< PROD > &&)
Helper for AttenCurve.
Definition: Path.h:10
void evgen::GENIENeutronOscGen::fillMCTruth ( const genie::EventRecord record,
simb::MCTruth truth 
)

Definition at line 283 of file GENIENeutronOscGen_module.cc.

References simb::MCTruth::Add(), DEFINE_ART_MODULE(), genie::GHepParticle::E(), genie::GHepParticle::FirstMother(), genie::kIStStableFinalState, genie::GHepParticle::Mass(), make_training::momentum, part, genie::GHepParticle::Pdg(), makeBrightnessMap::position, genie::GHepParticle::Px(), genie::GHepParticle::Py(), genie::GHepParticle::Pz(), genie::GHepParticle::Status(), string, genie::GHepRecord::Vertex(), genie::GHepParticle::Vt(), genie::GHepParticle::Vx(), genie::GHepParticle::Vy(), and genie::GHepParticle::Vz().

Referenced by produce().

284  {
285  TIter partitr(record);
287  int trackid = 0;
288  std::string primary("primary");
289 
290  while( (part = dynamic_cast<genie::GHepParticle*>(partitr.Next())) ) {
291  if (part->Status() != genie::kIStStableFinalState ) {
292  continue;
293  }
294 
295  simb::MCParticle tpart(trackid,
296  part->Pdg(),
297  primary,
298  part->FirstMother(),
299  part->Mass(),
300  part->Status());
301 
302  TLorentzVector* vertex = record->Vertex();
303  double vtx[4] = {
304  100. * (part->Vx() * 1.e-15 + vertex->X()), // cm
305  100. * (part->Vy() * 1.e-15 + vertex->Y()), // cm
306  100. * (part->Vz() * 1.e-15 + vertex->Z()), // cm
307  part->Vt() + vertex->T() * 1.e9 // ns
308  };
309 
310  TLorentzVector position(vtx[0], vtx[1], vtx[2], vtx[3]);
311  TLorentzVector momentum(part->Px(), part->Py(), part->Pz(), part->E());
312  tpart.AddTrajectoryPoint(position, momentum);
313  truth.Add(tpart);
314  trackid++;
315  }
316  }
Definition: event.h:34
double E(void) const
Get energy.
Definition: GHepParticle.h:92
double Mass(void) const
Mass that corresponds to the PDG code.
void Add(simb::MCParticle &part)
Definition: MCTruth.h:79
double Pz(void) const
Get Pz.
Definition: GHepParticle.h:91
GHepStatus_t Status(void) const
Definition: GHepParticle.h:65
virtual TLorentzVector * Vertex(void) const
Definition: GHepRecord.h:141
double Px(void) const
Get Px.
Definition: GHepParticle.h:89
double Vt(void) const
Get production time.
Definition: GHepParticle.h:98
int Pdg(void) const
Definition: GHepParticle.h:64
int FirstMother(void) const
Definition: GHepParticle.h:67
TString part[npart]
Definition: Style.C:32
double Vz(void) const
Get production z.
Definition: GHepParticle.h:97
double Vy(void) const
Get production y.
Definition: GHepParticle.h:96
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
double Vx(void) const
Get production x.
Definition: GHepParticle.h:95
double Py(void) const
Get Py.
Definition: GHepParticle.h:90
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
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  }
void evgen::GENIENeutronOscGen::initializeNeutronOscGenerator ( )

Definition at line 214 of file GENIENeutronOscGen_module.cc.

References exit(), genie::AlgFactory::GetAlgorithm(), genie::AlgFactory::Instance(), and mcgen_.

Referenced by GENIENeutronOscGen().

215  {
216  string sname = "genie::EventGenerator";
217  string sconfig = "NeutronOsc";
219  mcgen_ = dynamic_cast<const genie::EventRecordVisitorI *> (algf->GetAlgorithm(sname,sconfig));
220 
221  if (!mcgen_) {
222  mf::LogError("GENIENeutronOscGen") << "Couldn't instantiate the neutron oscillation generator";
223  // genie::gAbortingInErr = true;
224  exit(1);
225  }
226  }
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the &#39;Visito...
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
const Algorithm * GetAlgorithm(const AlgId &algid)
Definition: AlgFactory.cxx:86
static AlgFactory * Instance()
Definition: AlgFactory.cxx:75
exit(0)
The GENIE Algorithm Factory.
Definition: AlgFactory.h:40
const genie::EventRecordVisitorI * mcgen_
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::GENIENeutronOscGen::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 175 of file GENIENeutronOscGen_module.cc.

References genie::GHepRecord::AttachSummary(), fillMCTruth(), mcgen_, genie::Interaction::NOsc(), genie::EventRecordVisitorI::ProcessEventRecord(), art::Event::put(), randomVertexPosition_, selectAnnihilationMode(), setRandomEventVertexPosition(), target_, vertexT_, vertexX_, vertexY_, and vertexZ_.

176  {
177  std::unique_ptr< std::vector<simb::MCTruth> > truthcol(new std::vector<simb::MCTruth>);
178  simb::MCTruth truth;
179 
181  genie::Interaction* interaction = genie::Interaction::NOsc(target_, decay);
183  event->AttachSummary(interaction);
184  mcgen_->ProcessEventRecord(event);
185  // mf::LogInfo("GENIENeutronOscGen") << "Generated event: " << *event;
186 
187  event->SetVertex(vertexX_, vertexY_, vertexZ_, vertexT_); // in si unit, m and s
188  if (randomVertexPosition_) {
190  }
191 
192  fillMCTruth(event, truth);
193  truthcol->push_back(truth);
194 
195  evt.put(std::move(truthcol));
196  }
void setRandomEventVertexPosition(genie::EventRecord *record)
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
virtual void AttachSummary(Interaction *interaction)
Definition: GHepRecord.cxx:143
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
Summary information for an interaction.
Definition: Interaction.h:56
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Definition: EventRecord.h:38
Definition: decay.py:1
void fillMCTruth(const genie::EventRecord *record, simb::MCTruth &truth)
Event generator information.
Definition: MCTruth.h:32
const genie::EventRecordVisitorI * mcgen_
static Interaction * NOsc(int tgt, int annihilation_mode=-1)
int target_
pdg code of the target
int evgen::GENIENeutronOscGen::selectAnnihilationMode ( int  pdgCode)

Definition at line 229 of file GENIENeutronOscGen_module.cc.

References getBrightness::br, exit(), gOptDecayMode_, MECModelEnuComparisons::i, makeTrainCVSamples::int, genie::kNORandom, submit_nova_art::mode, rnd_, genie::RandomGen::RndNum(), string, dump_to_simple_cpp::threshold, and art::to_string().

Referenced by produce().

230  {
232  int mode;
233 
234  std::string pdgString = std::to_string(static_cast<long long>(pdgCode));
235  if (pdgString.size() != 10) {
236  mf::LogError("GENIENeutronOscGen") << "Expecting PDG code to be a 10-digit integer; instead, it's the following: " << pdgString;
237  // genie::gAbortingInErr = true;
238  exit(1);
239  }
240 
241  int nNucleons = std::stoi(pdgString.substr(6,3)) - 1;
242  int nProtons = std::stoi(pdgString.substr(3,3));
243 
244  double protonFrac = ((double) nProtons) / ((double) nNucleons);
245  double neutronFrac = 1 - protonFrac;
246 
247  const int nModes = 16;
248  double br [nModes] = { 0.010, 0.080, 0.100, 0.220,
249  0.360, 0.160, 0.070, 0.020,
250  0.015, 0.065, 0.110, 0.280,
251  0.070, 0.240, 0.100, 0.100 };
252 
253  for (int i = 0; i < nModes; i++) {
254  if (i < 7)
255  br[i] *= protonFrac;
256  else
257  br[i] *= neutronFrac;
258  }
259 
260  double randomNumber = rnd_->RndNum().Rndm();
261  double threshold = 0.;
262  for (int i = 0; i < nModes; i++) {
263  threshold += br[i];
264  if (randomNumber < threshold) {
265  mode = i + 1;
266  return mode;
267  }
268  }
269 
270  mf::LogError("GENIENeutronOscGen") << "Random selection of final state failed!";
271 
272  // genie::gAbortingInErr = true;
273  exit(1);
274  }
275 
276  else {
277  int mode = (int) gOptDecayMode_;
278  return mode;
279  }
280  }
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
genie::NNBarOscMode_t gOptDecayMode_
neutron oscillation mode
TRandom3 & RndNum(void) const
rnd number generator used by MC integrators & other numerical methods
Definition: RandomGen.h:78
exit(0)
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
enum BeamMode string
void evgen::GENIENeutronOscGen::setRandomEventVertexPosition ( genie::EventRecord record)

Definition at line 199 of file GENIENeutronOscGen_module.cc.

References fdHeight_, fdLength_, fdWidth_, rnd_, genie::RandomGen::RndNum(), genie::GHepRecord::SetVertex(), and genie::GHepRecord::Vertex().

Referenced by produce().

200  {
201  double randomNumber = rnd_->RndNum().Rndm();
202  double randomX = (randomNumber - 0.5) * fdWidth_; // m
203 
204  randomNumber = rnd_->RndNum().Rndm();
205  double randomY = (randomNumber - 0.5) * fdHeight_; // m
206 
207  randomNumber = rnd_->RndNum().Rndm();
208  double randomZ = randomNumber * fdLength_; // m
209 
210  record->SetVertex(randomX, randomY, randomZ, record->Vertex()->T());
211  }
virtual TLorentzVector * Vertex(void) const
Definition: GHepRecord.h:141
TRandom3 & RndNum(void) const
rnd number generator used by MC integrators & other numerical methods
Definition: RandomGen.h:78
virtual void SetVertex(double x, double y, double z, double t)
Definition: GHepRecord.cxx:863
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::GENIENeutronOscGen::cycle_
private

cycle number in the MC generation

Definition at line 84 of file GENIENeutronOscGen_module.cc.

Referenced by endSubRun().

double evgen::GENIENeutronOscGen::fdHeight_
private
double evgen::GENIENeutronOscGen::fdLength_
private
double evgen::GENIENeutronOscGen::fdWidth_
private
genie::NNBarOscMode_t evgen::GENIENeutronOscGen::gOptDecayMode_
private

neutron oscillation mode

Definition at line 86 of file GENIENeutronOscGen_module.cc.

Referenced by GENIENeutronOscGen(), and selectAnnihilationMode().

const genie::EventRecordVisitorI* evgen::GENIENeutronOscGen::mcgen_
private

Definition at line 92 of file GENIENeutronOscGen_module.cc.

Referenced by initializeNeutronOscGenerator(), and produce().

bool evgen::GENIENeutronOscGen::randomVertexPosition_
private

Definition at line 87 of file GENIENeutronOscGen_module.cc.

Referenced by produce().

genie::RandomGen* evgen::GENIENeutronOscGen::rnd_
private
TStopwatch evgen::GENIENeutronOscGen::stopwatch_
private

keep track of how long it takes to run the job

Definition at line 83 of file GENIENeutronOscGen_module.cc.

Referenced by GENIENeutronOscGen(), and ~GENIENeutronOscGen().

int evgen::GENIENeutronOscGen::target_
private

pdg code of the target

Definition at line 85 of file GENIENeutronOscGen_module.cc.

Referenced by produce().

double evgen::GENIENeutronOscGen::vertexT_
private

Definition at line 91 of file GENIENeutronOscGen_module.cc.

Referenced by produce().

double evgen::GENIENeutronOscGen::vertexX_
private

Definition at line 88 of file GENIENeutronOscGen_module.cc.

Referenced by produce().

double evgen::GENIENeutronOscGen::vertexY_
private

Definition at line 89 of file GENIENeutronOscGen_module.cc.

Referenced by produce().

double evgen::GENIENeutronOscGen::vertexZ_
private

Definition at line 90 of file GENIENeutronOscGen_module.cc.

Referenced by produce().


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