#include <GeneratorInterface/CosmicMuonGenerator/interface/CosMuoGenSource.h>
Public Member Functions | |
CosMuoGenSource (const ParameterSet &, const InputSourceDescription &) | |
virtual | ~CosMuoGenSource () |
Private Member Functions | |
void | clear () |
virtual bool | produce (Event &e) |
Private Attributes | |
bool | cmVerbosity_ |
CosmicMuonGenerator * | CosMuoGen |
double | ELSF |
HepMC::GenEvent * | fEvt |
double | MaxP |
double | MaxPh |
double | MaxS |
double | MaxT |
double | MinP |
double | MinP_CMS |
double | MinPh |
double | MinS |
double | MinT |
bool | MTCCHalf |
double | PlugVtx |
double | PlugVtz |
int32_t | RanS |
double | RTarget |
bool | TIFOnly_constant |
bool | TIFOnly_linear |
bool | TrackerOnly |
double | ZCTarget |
double | ZTarget |
Definition at line 20 of file CosMuoGenSource.h.
edm::CosMuoGenSource::CosMuoGenSource | ( | const ParameterSet & | pset, | |
const InputSourceDescription & | desc | |||
) |
Definition at line 6 of file CosMuoGenSource.cc.
References CosMuoGen, ELSF, CosmicMuonGenerator::initialize(), MaxP, MaxPh, MaxS, MaxT, MinP, MinP_CMS, MinPh, MinS, MinT, MTCCHalf, edm::ConfigurableInputSource::numberEventsInRun(), PlugVtx, PlugVtz, RanS, RTarget, CosmicMuonGenerator::setElossScaleFactor(), CosmicMuonGenerator::setMaxP(), CosmicMuonGenerator::setMaxPhi(), CosmicMuonGenerator::setMaxT0(), CosmicMuonGenerator::setMaxTheta(), CosmicMuonGenerator::setMinP(), CosmicMuonGenerator::setMinP_CMS(), CosmicMuonGenerator::setMinPhi(), CosmicMuonGenerator::setMinT0(), CosmicMuonGenerator::setMinTheta(), CosmicMuonGenerator::setMTCCHalf(), CosmicMuonGenerator::setNumberOfEvents(), CosmicMuonGenerator::setPlugVx(), CosmicMuonGenerator::setPlugVz(), CosmicMuonGenerator::setRadiusOfTarget(), CosmicMuonGenerator::setRanSeed(), CosmicMuonGenerator::setTIFOnly_constant(), CosmicMuonGenerator::setTIFOnly_linear(), CosmicMuonGenerator::setTrackerOnly(), CosmicMuonGenerator::setZCentrOfTarget(), CosmicMuonGenerator::setZDistOfTarget(), TIFOnly_constant, TIFOnly_linear, TrackerOnly, ZCTarget, and ZTarget.
00006 : 00007 GeneratedInputSource(pset, desc ) , 00008 //RanS(pset.getParameter<int>("RanSeed", 123456)), //get seed now from Framework 00009 MinP(pset.getParameter<double>("MinP")), 00010 MinP_CMS(pset.getParameter<double>("MinP_CMS")), 00011 MaxP(pset.getParameter<double>("MaxP")), 00012 MinT(pset.getParameter<double>("MinTheta")), 00013 MaxT(pset.getParameter<double>("MaxTheta")), 00014 MinPh(pset.getParameter<double>("MinPhi")), 00015 MaxPh(pset.getParameter<double>("MaxPhi")), 00016 MinS(pset.getParameter<double>("MinT0")), 00017 MaxS(pset.getParameter<double>("MaxT0")), 00018 ELSF(pset.getParameter<double>("ElossScaleFactor")), 00019 RTarget(pset.getParameter<double>("RadiusOfTarget")), 00020 ZTarget(pset.getParameter<double>("ZDistOfTarget")), 00021 ZCTarget(pset.getParameter<double>("ZCentrOfTarget")), 00022 TrackerOnly(pset.getParameter<bool>("TrackerOnly")), 00023 TIFOnly_constant(pset.getParameter<bool>("TIFOnly_constant")), 00024 TIFOnly_linear(pset.getParameter<bool>("TIFOnly_linear")), 00025 MTCCHalf(pset.getParameter<bool>("MTCCHalf")), 00026 PlugVtx(pset.getParameter<double>("PlugVx")), 00027 PlugVtz(pset.getParameter<double>("PlugVz")), 00028 cmVerbosity_(pset.getParameter<bool>("Verbosity")) 00029 { 00030 00031 //if not specified (i.e. negative) then use MinP also for MinP_CMS 00032 if(MinP_CMS < 0) MinP_CMS = MinP; 00033 00034 //get seed now from Framework 00035 edm::Service<edm::RandomNumberGenerator> rng; 00036 RanS = rng->mySeed(); 00037 // set up the generator 00038 CosMuoGen = new CosmicMuonGenerator(); 00039 CosMuoGen->setNumberOfEvents(numberEventsInRun()); 00040 CosMuoGen->setRanSeed(RanS); 00041 CosMuoGen->setMinP(MinP); 00042 CosMuoGen->setMinP_CMS(MinP_CMS); 00043 CosMuoGen->setMaxP(MaxP); 00044 CosMuoGen->setMinTheta(MinT); 00045 CosMuoGen->setMaxTheta(MaxT); 00046 CosMuoGen->setMinPhi(MinPh); 00047 CosMuoGen->setMaxPhi(MaxPh); 00048 CosMuoGen->setMinT0(MinS); 00049 CosMuoGen->setMaxT0(MaxS); 00050 CosMuoGen->setElossScaleFactor(ELSF); 00051 CosMuoGen->setRadiusOfTarget(RTarget); 00052 CosMuoGen->setZDistOfTarget(ZTarget); 00053 CosMuoGen->setZCentrOfTarget(ZCTarget); 00054 CosMuoGen->setTrackerOnly(TrackerOnly); 00055 CosMuoGen->setTIFOnly_constant(TIFOnly_constant); 00056 CosMuoGen->setTIFOnly_linear(TIFOnly_linear); 00057 CosMuoGen->setMTCCHalf(MTCCHalf); 00058 CosMuoGen->setPlugVx(PlugVtx); 00059 CosMuoGen->setPlugVz(PlugVtz); 00060 CosMuoGen->initialize(); 00061 produces<HepMCProduct>(); 00062 // fEvt = new HepMC::GenEvent(); 00063 }
edm::CosMuoGenSource::~CosMuoGenSource | ( | ) | [virtual] |
Definition at line 65 of file CosMuoGenSource.cc.
References clear(), CosMuoGen, and CosmicMuonGenerator::terminate().
00065 { 00066 CosMuoGen->terminate(); 00067 delete CosMuoGen; 00068 // delete fEvt; 00069 clear(); 00070 }
Implements edm::ConfigurableInputSource.
Definition at line 74 of file CosMuoGenSource.cc.
References cmVerbosity_, CosMuoGen, SingleParticleEvent::e(), edm::ConfigurableInputSource::event(), fEvt, SingleParticleEvent::id(), CosmicMuonGenerator::nextEvent(), CosmicMuonGenerator::OneMuoEvt, p, edm::Event::put(), SingleParticleEvent::px(), SingleParticleEvent::py(), SingleParticleEvent::pz(), SingleParticleEvent::t0(), SingleParticleEvent::vx(), SingleParticleEvent::vy(), and SingleParticleEvent::vz().
00075 { 00076 // generate event 00077 CosMuoGen->nextEvent(); 00078 00079 // delete and re-create fEvt (memory) 00080 // delete fEvt; 00081 fEvt = new HepMC::GenEvent(); 00082 HepMC::GenVertex* Vtx = new HepMC::GenVertex(HepMC::FourVector(CosMuoGen->OneMuoEvt.vx(), 00083 CosMuoGen->OneMuoEvt.vy(), 00084 CosMuoGen->OneMuoEvt.vz(), 00085 CosMuoGen->OneMuoEvt.t0())); 00086 HepMC::FourVector p(CosMuoGen->OneMuoEvt.px(),CosMuoGen->OneMuoEvt.py(),CosMuoGen->OneMuoEvt.pz(),CosMuoGen->OneMuoEvt.e()); 00087 HepMC::GenParticle* Part = 00088 new HepMC::GenParticle(p,CosMuoGen->OneMuoEvt.id(),1); 00089 Vtx->add_particle_out(Part); 00090 fEvt->add_vertex(Vtx); 00091 fEvt->set_event_number(event()); 00092 fEvt->set_signal_process_id(13); 00093 00094 if (cmVerbosity_) fEvt->print(); 00095 00096 std::auto_ptr<HepMCProduct> CMProduct(new HepMCProduct()); 00097 CMProduct->addHepMCData( fEvt ); 00098 e.put(CMProduct); 00099 00100 return true; 00101 }
bool edm::CosMuoGenSource::cmVerbosity_ [private] |
Definition at line 54 of file CosMuoGenSource.h.
Referenced by CosMuoGenSource(), produce(), and ~CosMuoGenSource().
double edm::CosMuoGenSource::ELSF [private] |
HepMC::GenEvent* edm::CosMuoGenSource::fEvt [private] |
double edm::CosMuoGenSource::MaxP [private] |
double edm::CosMuoGenSource::MaxPh [private] |
double edm::CosMuoGenSource::MaxS [private] |
double edm::CosMuoGenSource::MaxT [private] |
double edm::CosMuoGenSource::MinP [private] |
double edm::CosMuoGenSource::MinP_CMS [private] |
double edm::CosMuoGenSource::MinPh [private] |
double edm::CosMuoGenSource::MinS [private] |
double edm::CosMuoGenSource::MinT [private] |
bool edm::CosMuoGenSource::MTCCHalf [private] |
double edm::CosMuoGenSource::PlugVtx [private] |
double edm::CosMuoGenSource::PlugVtz [private] |
int32_t edm::CosMuoGenSource::RanS [private] |
double edm::CosMuoGenSource::RTarget [private] |
bool edm::CosMuoGenSource::TIFOnly_constant [private] |
bool edm::CosMuoGenSource::TIFOnly_linear [private] |
bool edm::CosMuoGenSource::TrackerOnly [private] |
double edm::CosMuoGenSource::ZCTarget [private] |
double edm::CosMuoGenSource::ZTarget [private] |