CMS 3D CMS Logo

edm::ExhumeSource Class Reference

#include <GeneratorInterface/ExhumeInterface/interface/ExhumeSource.h>

Inheritance diagram for edm::ExhumeSource:

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

List of all members.

Public Member Functions

void endRun (Run &r)
 ExhumeSource (const ParameterSet &, const InputSourceDescription &)
 Constructor.
virtual ~ExhumeSource ()
 Destructor.

Private Member Functions

void clear ()
virtual bool produce (Event &e)
 Interface to the PYGIVE pythia routine, with add'l protections.

Private Attributes

double comenergy
HepMC::GenEvent * evt
Exhume::EventExhumeEvent
Exhume::CrossSectionExhumeProcess
double extCrossSect
double extFilterEff
int HiggsDecay
double MassRangeHigh
double MassRangeLow
unsigned int maxEventsToPrint_
 Events to print if verbosity.
std::string ProcessType
bool pythiaHepMCVerbosity_
 HepMC verbosity flag.
unsigned int pythiaPylistVerbosity_
 Pythia PYLIST Verbosity flag.
int QuarkType
int sigID
double ThetaMin


Detailed Description

Definition at line 31 of file ExhumeSource.h.


Constructor & Destructor Documentation

ExhumeSource::ExhumeSource ( const ParameterSet pset,
const InputSourceDescription desc 
)

Constructor.

Definition at line 62 of file ExhumeSource.cc.

References edm::errors::Configuration, ExhumeEvent, ExhumeProcess, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HiggsDecay, MassRangeHigh, MassRangeLow, maxEventsToPrint_, ProcessType, pythiaHepMCVerbosity_, pythiaPylistVerbosity_, QuarkType, Exhume::Event::SetMassRange(), Exhume::Event::SetParameterSpace(), sigID, and ThetaMin.

00063                                                                  :
00064   GeneratedInputSource(pset, desc), evt(0), 
00065   pythiaPylistVerbosity_ (pset.getUntrackedParameter<int>("pythiaPylistVerbosity",0)),
00066   pythiaHepMCVerbosity_ (pset.getUntrackedParameter<bool>("pythiaHepMCVerbosity",false)),
00067   maxEventsToPrint_ (pset.getUntrackedParameter<int>("maxEventsToPrint",1)),
00068   comenergy(pset.getUntrackedParameter<double>("comEnergy",14000.)),
00069   extCrossSect(pset.getUntrackedParameter<double>("crossSection", -1.)),
00070   extFilterEff(pset.getUntrackedParameter<double>("filterEfficiency", -1.))
00071 {
00072   std::ostringstream header_str;
00073 
00074   header_str << "ExhumeSource: initializing Exhume/Pythia.\n";
00075   
00076   // PYLIST Verbosity Level
00077   // Valid PYLIST arguments are: 1, 2, 3, 5, 7, 11, 12, 13
00078   pythiaPylistVerbosity_ = pset.getUntrackedParameter<int>("pythiaPylistVerbosity",0);
00079   header_str << "Pythia PYLIST verbosity level = " << pythiaPylistVerbosity_ << "\n";
00080   
00081   // HepMC event verbosity Level
00082   pythiaHepMCVerbosity_ = pset.getUntrackedParameter<bool>("pythiaHepMCVerbosity",false);
00083   header_str << "Pythia HepMC verbosity = " << pythiaHepMCVerbosity_ << "\n"; 
00084 
00085   //Max number of events printed on verbosity level 
00086   maxEventsToPrint_ = pset.getUntrackedParameter<int>("maxEventsToPrint",0);
00087   header_str << "Number of events to be printed = " << maxEventsToPrint_ << "\n";
00088 
00089   //Exhume Initialization
00090   ParameterSet process_pset = pset.getParameter<ParameterSet>("ExhumeProcess") ;
00091   ProcessType = process_pset.getParameter<string>("ProcessType");
00092   if(ProcessType == "Higgs"){
00093         ExhumeProcess = new Exhume::Higgs(pset);
00094         HiggsDecay = process_pset.getParameter<int>("HiggsDecay");
00095         double m_higgs = pset.getUntrackedParameter<double>("HiggsMass",120.);
00096         MassRangeLow = process_pset.getUntrackedParameter<double>("MassRangeLow",(m_higgs - 5.));
00097         MassRangeHigh = process_pset.getUntrackedParameter<double>("MassRangeHigh",(m_higgs + 5.));
00098         ((Exhume::Higgs*)ExhumeProcess)->SetHiggsDecay(HiggsDecay);
00099         sigID = 100 + HiggsDecay;
00100   } else if(ProcessType == "QQ"){       
00101         ExhumeProcess = new Exhume::QQ(pset);
00102         QuarkType = process_pset.getParameter<int>("QuarkType");
00103         ThetaMin = process_pset.getUntrackedParameter<double>("ThetaMin");
00104         MassRangeLow = process_pset.getUntrackedParameter<double>("MassRangeLow",10.);
00105         MassRangeHigh = process_pset.getUntrackedParameter<double>("MassRangeHigh",200.);
00106         ((Exhume::QQ*)ExhumeProcess)->SetQuarkType(QuarkType);
00107         ((Exhume::QQ*)ExhumeProcess)->SetThetaMin(ThetaMin);
00108         sigID = 200 + QuarkType;
00109   } else if(ProcessType == "GG"){
00110         ExhumeProcess = new Exhume::GG(pset);
00111         ThetaMin = process_pset.getUntrackedParameter<double>("ThetaMin");
00112         MassRangeLow = process_pset.getUntrackedParameter<double>("MassRangeLow",10.);
00113         MassRangeHigh = process_pset.getUntrackedParameter<double>("MassRangeHigh",200.);
00114         ((Exhume::GG*)ExhumeProcess)->SetThetaMin(ThetaMin);
00115         sigID = 300;
00116   } else{
00117         sigID = -1;
00118         throw edm::Exception(edm::errors::Configuration,"ExhumeError") <<" No valid Exhume Process";
00119   }
00120 
00121   edm::Service<RandomNumberGenerator> rng;
00122   uint32_t seed = rng->mySeed();
00123   ExhumeEvent = new Exhume::Event(*ExhumeProcess,seed);
00124 
00125   ExhumeEvent->SetMassRange(MassRangeLow,MassRangeHigh);
00126   ExhumeEvent->SetParameterSpace();
00127 
00128   //my_pythia_init();
00129   //pydata();
00130 
00131   header_str << "\n"; // Stetically add for the output
00132   //********                                      
00133   
00134   produces<HepMCProduct>();
00135   produces<GenInfoProduct, edm::InRun>();
00136 
00137   header_str << "ExhumeSource: starting event generation ...\n";
00138 
00139   edm::LogInfo("")<<header_str.str();
00140 }

ExhumeSource::~ExhumeSource (  )  [virtual]

Destructor.

Definition at line 143 of file ExhumeSource.cc.

References clear().

00143                            {
00144   std::ostringstream footer_str;
00145   footer_str << "ExhumeSource: event generation done.\n";
00146 
00147   edm::LogInfo("") << footer_str.str();
00148 
00149   clear();
00150 }


Member Function Documentation

void ExhumeSource::clear ( void   )  [private]

Definition at line 152 of file ExhumeSource.cc.

References ExhumeEvent, and ExhumeProcess.

Referenced by ~ExhumeSource().

00152                          {
00153   delete ExhumeEvent;
00154   delete ExhumeProcess;
00155 }

void ExhumeSource::endRun ( Run r  )  [virtual]

Reimplemented from edm::ConfigurableInputSource.

Definition at line 157 of file ExhumeSource.cc.

References Exhume::Event::CrossSectionCalculation(), ExhumeEvent, ExhumeProcess, extCrossSect, extFilterEff, Exhume::Event::GetEfficiency(), Exhume::CrossSection::GetName(), name, and edm::Run::put().

00157                                  {
00158  std::ostringstream footer_str;
00159 
00160  double cs = ExhumeEvent->CrossSectionCalculation();
00161  double eff = ExhumeEvent->GetEfficiency();
00162  string name = ExhumeProcess->GetName();
00163 
00164  footer_str << "\n" <<"   You have just been ExHuMEd." << "\n" << "\n";
00165  footer_str << "   The cross section for process " << name
00166             << " is " << cs << " fb" << "\n" << "\n";
00167  footer_str << "   The efficiency of event generation was " << eff << "%" << "\n" << "\n";
00168 
00169  edm::LogInfo("") << footer_str.str();
00170 
00171  auto_ptr<GenInfoProduct> giprod (new GenInfoProduct());
00172  giprod->set_cross_section(cs);
00173  giprod->set_external_cross_section(extCrossSect);
00174  giprod->set_filter_efficiency(extFilterEff);
00175  r.put(giprod);
00176 }

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

Interface to the PYGIVE pythia routine, with add'l protections.

Implements edm::ConfigurableInputSource.

Definition at line 178 of file ExhumeSource.cc.

References call_pylist(), conv, edm::ConfigurableInputSource::event(), evt, ExhumeEvent, ExhumeProcess, Exhume::Event::Generate(), Exhume::CrossSection::GetName(), Exhume::CrossSection::Hadronise(), maxEventsToPrint_, edm::ConfigurableInputSource::numberEventsInRun(), edm::Event::put(), pypars, pythiaHepMCVerbosity_, pythiaPylistVerbosity_, edm::InputSource::remainingEvents(), and sigID.

00178                                     {
00179 
00180     auto_ptr<HepMCProduct> bare_product(new HepMCProduct());  
00181     edm::LogInfo("") << "ExhumeSource: Generating event ...\n";
00182 
00183     //********                                         
00184     //
00185     ExhumeEvent->Generate();
00186     ExhumeProcess->Hadronise();
00187 
00188     HepMC::IO_HEPEVT conv;      
00189     //HepMC::GenEvent* evt = conv.getGenEventfromHEPEVT();
00190     HepMC::GenEvent* evt = conv.read_next_event();
00191     //evt->set_signal_process_id(pypars.msti[0]);
00192     evt->set_signal_process_id(sigID);  
00193     evt->set_event_scale(pypars.pari[16]);
00194     evt->set_event_number(numberEventsInRun() - remainingEvents() - 1);
00195     
00196 
00197     //******** Verbosity ********
00198     
00199     if(event() <= maxEventsToPrint_ &&
00200        (pythiaPylistVerbosity_ || pythiaHepMCVerbosity_)) {
00201 
00202       // Prints PYLIST info
00203       if(pythiaPylistVerbosity_) {
00204         call_pylist(pythiaPylistVerbosity_);
00205       }
00206       
00207       // Prints HepMC event
00208       if(pythiaHepMCVerbosity_) {
00209         edm::LogInfo("") << "Event process = " << ExhumeProcess->GetName() << "\n" 
00210         << "----------------------" << "\n";
00211         evt->print();
00212       }
00213     }
00214     
00215     
00216     //evt = reader_->fillCurrentEventData(); 
00217     //********                                      
00218 
00219     if(evt)  bare_product->addHepMCData(evt );
00220 
00221     e.put(bare_product);
00222 
00223     return true;
00224 }


Member Data Documentation

double edm::ExhumeSource::comenergy [private]

Definition at line 61 of file ExhumeSource.h.

HepMC::GenEvent* edm::ExhumeSource::evt [private]

Definition at line 52 of file ExhumeSource.h.

Referenced by produce().

Exhume::Event* edm::ExhumeSource::ExhumeEvent [private]

Definition at line 70 of file ExhumeSource.h.

Referenced by clear(), endRun(), ExhumeSource(), and produce().

Exhume::CrossSection* edm::ExhumeSource::ExhumeProcess [private]

Definition at line 72 of file ExhumeSource.h.

Referenced by clear(), endRun(), ExhumeSource(), and produce().

double edm::ExhumeSource::extCrossSect [private]

Definition at line 64 of file ExhumeSource.h.

Referenced by endRun().

double edm::ExhumeSource::extFilterEff [private]

Definition at line 65 of file ExhumeSource.h.

Referenced by endRun().

int edm::ExhumeSource::HiggsDecay [private]

Definition at line 75 of file ExhumeSource.h.

Referenced by ExhumeSource().

double edm::ExhumeSource::MassRangeHigh [private]

Definition at line 79 of file ExhumeSource.h.

Referenced by ExhumeSource().

double edm::ExhumeSource::MassRangeLow [private]

Definition at line 78 of file ExhumeSource.h.

Referenced by ExhumeSource().

unsigned int edm::ExhumeSource::maxEventsToPrint_ [private]

Events to print if verbosity.

Definition at line 59 of file ExhumeSource.h.

Referenced by ExhumeSource(), and produce().

std::string edm::ExhumeSource::ProcessType [private]

Definition at line 74 of file ExhumeSource.h.

Referenced by ExhumeSource().

bool edm::ExhumeSource::pythiaHepMCVerbosity_ [private]

HepMC verbosity flag.

Definition at line 57 of file ExhumeSource.h.

Referenced by ExhumeSource(), and produce().

unsigned int edm::ExhumeSource::pythiaPylistVerbosity_ [private]

Pythia PYLIST Verbosity flag.

Definition at line 55 of file ExhumeSource.h.

Referenced by ExhumeSource(), and produce().

int edm::ExhumeSource::QuarkType [private]

Definition at line 76 of file ExhumeSource.h.

Referenced by ExhumeSource().

int edm::ExhumeSource::sigID [private]

Definition at line 81 of file ExhumeSource.h.

Referenced by ExhumeSource(), and produce().

double edm::ExhumeSource::ThetaMin [private]

Definition at line 77 of file ExhumeSource.h.

Referenced by ExhumeSource().


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