|
| PhotonGen (fhicl::ParameterSet const &pset) |
|
void | produce (art::Event &evt) |
|
void | beginRun (art::Run &run) |
|
void | doBeginJob (SharedResources const &resources) |
|
void | doEndJob () |
|
void | doRespondToOpenInputFile (FileBlock const &fb) |
|
void | doRespondToCloseInputFile (FileBlock const &fb) |
|
void | doRespondToOpenOutputFiles (FileBlock const &fb) |
|
void | doRespondToCloseOutputFiles (FileBlock const &fb) |
|
bool | doBeginRun (RunPrincipal &rp, ModuleContext const &mc) |
|
bool | doEndRun (RunPrincipal &rp, ModuleContext const &mc) |
|
bool | doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc) |
|
bool | doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc) |
|
bool | doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed) |
|
void | fillProductDescriptions () |
|
void | registerProducts (ProductDescriptions &productsToRegister) |
|
ModuleDescription const & | moduleDescription () const |
|
void | setModuleDescription (ModuleDescription const &) |
|
std::array< std::vector< ProductInfo >, NumBranchTypes > const & | getConsumables () const |
|
void | sortConsumables (std::string const ¤t_process_name) |
|
std::unique_ptr< Worker > | makeWorker (WorkerParams const &wp) |
|
template<typename T , BranchType BT> |
ViewToken< T > | consumesView (InputTag const &tag) |
|
template<typename T , BranchType BT> |
ViewToken< T > | mayConsumeView (InputTag const &tag) |
|
|
ConsumesCollector & | consumesCollector () |
|
template<typename T , BranchType = InEvent> |
ProductToken< T > | consumes (InputTag const &) |
|
template<typename Element , BranchType = InEvent> |
ViewToken< Element > | consumesView (InputTag const &) |
|
template<typename T , BranchType = InEvent> |
void | consumesMany () |
|
template<typename T , BranchType = InEvent> |
ProductToken< T > | mayConsume (InputTag const &) |
|
template<typename Element , BranchType = InEvent> |
ViewToken< Element > | mayConsumeView (InputTag const &) |
|
template<typename T , BranchType = InEvent> |
void | mayConsumeMany () |
|
Definition at line 52 of file PhotonGen_module.cc.
Definition at line 105 of file PhotonGen_module.cc.
References geo::CryostatGeo::Boundaries(), art::detail::EngineCreator::createEngine(), geo::GeometryCore::Cryostat(), fEngine, fEvID, fFillTree, fN, fP, fPDist, fPhotonGen, fPosDist, fPx, fPy, fPz, fScan, fShotMom, fShotPos, fSigmaP, fSigmaT, fT, fTDist, fXmax, fXmin, fYmax, fYmin, fZmax, and fZmin.
108 ,
fScan{pset.get<
bool>(
"Scan")}
109 ,
fPosDist{pset.get<
int>(
"PosDist")}
110 ,
fTDist{pset.get<
int>(
"TDist")}
111 ,
fPDist{pset.get<
int>(
"PDist")}
112 ,
fT{pset.get<
double>(
"T0")}
113 ,
fSigmaT{pset.get<
double>(
"SigmaT")}
114 ,
fP{pset.get<
double>(
"P")}
115 ,
fSigmaP{pset.get<
double>(
"SigmaP")}
116 ,
fN{pset.get<
int>(
"N")}
122 produces<sumdata::RunData, art::InRun>();
123 produces<std::vector<simb::MCTruth>>();
127 fPhotonGen = tfs->make<TTree>(
"PhGen",
"PhGen");
140 fPx = pset.get<
double>(
"X");
141 fPy = pset.get<
double>(
"Y");
142 fPz = pset.get<
double>(
"Z");
143 std::cout <<
"Will generate photons from 3 points." << std::endl;
147 fXmin = boundaries->get<
double>(
"Xmin");
148 fXmax = boundaries->get<
double>(
"Xmax");
149 fYmin = boundaries->get<
double>(
"Ymin");
150 fYmax = boundaries->get<
double>(
"Ymax");
151 fZmin = boundaries->get<
double>(
"Zmin");
152 fZmax = boundaries->get<
double>(
"Zmax");
155 std::cout <<
"\n\nPhoton Emission Region (user-defined) [cm]:" << std::endl;
156 std::cout <<
"Xmin: " <<
fXmin <<
" Xmax: " << fXmax <<
" Ymin: " << fYmin
157 <<
" Ymax: " << fYmax <<
" Zmin: " << fZmin <<
" Zmax: " << fZmax <<
"\n\n" 163 fXmin = CryoBounds.MinX();
164 fXmax = CryoBounds.MaxX();
165 fYmin = CryoBounds.MinY();
166 fYmax = CryoBounds.MaxY();
167 fZmin = CryoBounds.MinZ();
168 fZmax = CryoBounds.MaxZ();
170 std::cout <<
"\n\nPhoton Emission Region (default Cryo Boundaries) [cm]:" << std::endl;
171 std::cout <<
"Xmin: " <<
fXmin <<
" Xmax: " <<
fXmax <<
" Ymin: " <<
fYmin 172 <<
" Ymax: " <<
fYmax <<
" Zmin: " <<
fZmin <<
" Zmax: " <<
fZmax <<
"\n\n" base_engine_t & createEngine(seed_t seed)
CLHEP::HepRandomEngine & fEngine
CryostatGeo const & Cryostat(CryostatID const &cryoid=details::cryostat_zero) const
Returns the specified cryostat.
BoxBoundedGeo const & Boundaries() const
Returns boundaries of the cryostat (in centimetres).
void evgen::PhotonGen::produce |
( |
art::Event & |
evt | ) |
|
|
virtual |
Implements art::EDProducer.
Definition at line 189 of file PhotonGen_module.cc.
References fPy, fPz, fScan, fX, fXmax, fXmin, fY, fYmax, fYmin, fZ, fZmax, fZmin, simb::kSingleParticle, art::Event::put(), art::detail::EngineCreator::rng(), Sample(), and simb::MCTruth::SetOrigin().
192 rng.seed(std::random_device()());
193 std::uniform_real_distribution<double> distX(
fXmin,
fXmax);
194 std::uniform_real_distribution<double> distY(
fYmin,
fYmax);
195 std::uniform_real_distribution<double> distZ(
fZmin,
fZmax);
196 std::uniform_real_distribution<double> width(-2.0, 2.0);
198 std::unique_ptr<std::vector<simb::MCTruth>> truthcol(
new std::vector<simb::MCTruth>);
204 fY =
fPy + width(rng);
205 fZ =
fPz + width(rng);
216 truthcol->push_back(truth);
217 evt.
put(std::move(truthcol));
void SetOrigin(simb::Origin_t origin)
void Sample(simb::MCTruth &truth)
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
single particles thrown at the detector
Event generator information.
static ServiceHandle< RandomNumberGenerator > & rng()
Definition at line 220 of file PhotonGen_module.cc.
References simb::MCTruth::Add(), simb::MCParticle::AddTrajectoryPoint(), DEFINE_ART_MODULE, fEngine, fFillTree, fN, fP, fPDist, fPhotonGen, fShotMom, fShotPos, fSigmaP, fSigmaT, fT, fTDist, fX, fY, fZ, and kGAUS.
Referenced by produce().
222 std::cout <<
"\n\nPhotons Shooting at the Position: " <<
fX <<
" " <<
fY <<
" " <<
fZ <<
"\n\n" 226 CLHEP::RandGaussQ gauss(
fEngine);
228 for (
int j = 0; j !=
fN; ++j) {
237 time =
fT +
fSigmaT * (2.0 * flat.fire() - 1.0);
239 fShotPos = TLorentzVector(pos[0], pos[1], pos[2], time);
245 p =
fP +
fSigmaP * (2.0 * flat.fire() - 1.0);
250 double costh = 2 * flat.fire() - 1;
251 double sinth = std::sqrt(1 - costh * costh);
252 double phi = 2 * M_PI * flat.fire();
255 fShotMom = TLorentzVector(p * sinth * cos(phi), p * sinth * sin(phi), p * costh, p);
CLHEP::HepRandomEngine & fEngine