CMS 3D CMS Logo

edm::CosMuoGenSource Class Reference

#include <GeneratorInterface/CosmicMuonGenerator/interface/CosMuoGenSource.h>

Inheritance diagram for edm::CosMuoGenSource:

edm::GeneratedInputSource edm::ConfigurableInputSource edm::InputSource edm::ProductRegistryHelper

List of all members.

Public Member Functions

 CosMuoGenSource (const ParameterSet &, const InputSourceDescription &)
virtual ~CosMuoGenSource ()

Private Member Functions

void clear ()
virtual bool produce (Event &e)

Private Attributes

bool cmVerbosity_
CosmicMuonGeneratorCosMuoGen
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


Detailed Description

Definition at line 20 of file CosMuoGenSource.h.


Constructor & Destructor Documentation

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 }


Member Function Documentation

void edm::CosMuoGenSource::clear ( void   )  [private]

Definition at line 72 of file CosMuoGenSource.cc.

Referenced by ~CosMuoGenSource().

00072 {}

bool edm::CosMuoGenSource::produce ( Event e  )  [private, virtual]

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 }


Member Data Documentation

bool edm::CosMuoGenSource::cmVerbosity_ [private]

Definition at line 57 of file CosMuoGenSource.h.

Referenced by produce().

CosmicMuonGenerator* edm::CosMuoGenSource::CosMuoGen [private]

Definition at line 54 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource(), produce(), and ~CosMuoGenSource().

double edm::CosMuoGenSource::ELSF [private]

Definition at line 40 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

HepMC::GenEvent* edm::CosMuoGenSource::fEvt [private]

Definition at line 56 of file CosMuoGenSource.h.

Referenced by produce().

double edm::CosMuoGenSource::MaxP [private]

Definition at line 33 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::MaxPh [private]

Definition at line 37 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::MaxS [private]

Definition at line 39 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::MaxT [private]

Definition at line 35 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::MinP [private]

Definition at line 31 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::MinP_CMS [private]

Definition at line 32 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::MinPh [private]

Definition at line 36 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::MinS [private]

Definition at line 38 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::MinT [private]

Definition at line 34 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

bool edm::CosMuoGenSource::MTCCHalf [private]

Definition at line 47 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::PlugVtx [private]

Definition at line 51 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::PlugVtz [private]

Definition at line 52 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

int32_t edm::CosMuoGenSource::RanS [private]

Definition at line 30 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::RTarget [private]

Definition at line 41 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

bool edm::CosMuoGenSource::TIFOnly_constant [private]

Definition at line 45 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

bool edm::CosMuoGenSource::TIFOnly_linear [private]

Definition at line 46 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

bool edm::CosMuoGenSource::TrackerOnly [private]

Definition at line 44 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::ZCTarget [private]

Definition at line 43 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().

double edm::CosMuoGenSource::ZTarget [private]

Definition at line 42 of file CosMuoGenSource.h.

Referenced by CosMuoGenSource().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:39:54 2009 for CMSSW by  doxygen 1.5.4