CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
gen::ExhumeHadronizer Class Reference

#include <ExhumeHadronizer.h>

Inheritance diagram for gen::ExhumeHadronizer:
gen::BaseHadronizer

Public Member Functions

const char * classname () const
 
bool decay ()
 
bool declareSpecialSettings (const std::vector< std::string > &)
 
bool declareStableParticles (const std::vector< int > &)
 
 ExhumeHadronizer (edm::ParameterSet const &ps)
 
void finalizeEvent ()
 
bool generatePartonsAndHadronize ()
 
bool hadronize ()
 
bool initializeForExternalPartons ()
 
bool initializeForInternalPartons ()
 
bool readSettings (int)
 
bool residualDecay ()
 
void statistics ()
 
 ~ExhumeHadronizer ()
 
- Public Member Functions inherited from gen::BaseHadronizer
 BaseHadronizer (edm::ParameterSet const &ps)
 
edm::EventgetEDMEvent () const
 
HepMC::GenEvent * getGenEvent ()
 
GenEventInfoProductgetGenEventInfo ()
 
GenRunInfoProductgetGenRunInfo ()
 
const boost::shared_ptr
< lhef::LHERunInfo > & 
getLHERunInfo () const
 
void resetEvent (HepMC::GenEvent *event)
 
void resetEventInfo (GenEventInfoProduct *eventInfo)
 
virtual bool select (HepMC::GenEvent *) const
 
void setEDMEvent (edm::Event &event)
 
void setLHEEvent (lhef::LHEEvent *event)
 
void setLHERunInfo (lhef::LHERunInfo *runInfo)
 
void setRandomEngine (CLHEP::HepRandomEngine *v)
 
std::vector< std::string > const & sharedResources () const
 
 ~BaseHadronizer ()
 

Private Attributes

double comEnergy_
 
bool convertToPDG_
 
Exhume::EventexhumeEvent_
 
Exhume::CrossSectionexhumeProcess_
 
bool hepMCVerbosity_
 
unsigned int maxEventsToPrint_
 
edm::ParameterSet myPSet_
 
Pythia6Servicepythia6Service_
 
unsigned int pythiaListVerbosity_
 
CLHEP::HepRandomEngine * randomEngine_
 

Additional Inherited Members

- Protected Member Functions inherited from gen::BaseHadronizer
std::auto_ptr< HepMC::GenEvent > & event ()
 
std::auto_ptr
< GenEventInfoProduct > & 
eventInfo ()
 
lhef::LHEEventlheEvent ()
 
lhef::LHERunInfolheRunInfo ()
 
GenRunInfoProductrunInfo ()
 

Detailed Description

Definition at line 40 of file ExhumeHadronizer.h.

Constructor & Destructor Documentation

gen::ExhumeHadronizer::ExhumeHadronizer ( edm::ParameterSet const &  ps)

Definition at line 75 of file ExhumeHadronizer.cc.

References convertToPDG_, edm::ParameterSet::exists(), and edm::ParameterSet::getParameter().

76  : BaseHadronizer(pset),
77  pythia6Service_(new Pythia6Service(pset)),
79  comEnergy_(pset.getParameter<double>("comEnergy")),
80  myPSet_(pset),
81  hepMCVerbosity_(pset.getUntrackedParameter<bool>("pythiaHepMCVerbosity",false)),
82  maxEventsToPrint_(pset.getUntrackedParameter<int>("maxEventsToPrint", 0)),
83  pythiaListVerbosity_(pset.getUntrackedParameter<int>("pythiaPylistVerbosity", 0))
84 {
85 
86  convertToPDG_ = false;
87  if ( pset.exists( "doPDGConvert" ) )
88  {
89  convertToPDG_ = pset.getParameter<bool>("doPDGConvert");
90  }
91 
92  //pythia6Hadronizer_ = new Pythia6Hadronizer(pset);
93 }
BaseHadronizer(edm::ParameterSet const &ps)
unsigned int maxEventsToPrint_
CLHEP::HepRandomEngine & getEngineReference()
unsigned int pythiaListVerbosity_
Pythia6Service * pythia6Service_
edm::ParameterSet myPSet_
CLHEP::HepRandomEngine * randomEngine_
gen::ExhumeHadronizer::~ExhumeHadronizer ( )

Definition at line 95 of file ExhumeHadronizer.cc.

References exhumeEvent_, exhumeProcess_, and pythia6Service_.

95  {
96  //delete pythia6Hadronizer_;
97  delete pythia6Service_;
98  delete exhumeEvent_;
99  delete exhumeProcess_;
100 }
Exhume::Event * exhumeEvent_
Pythia6Service * pythia6Service_
Exhume::CrossSection * exhumeProcess_

Member Function Documentation

const char * gen::ExhumeHadronizer::classname ( ) const

Definition at line 289 of file ExhumeHadronizer.cc.

290 {
291  return "gen::ExhumeHadronizer";
292 }
bool gen::ExhumeHadronizer::decay ( )

Definition at line 168 of file ExhumeHadronizer.cc.

169 {
170  return true;
171 }
bool gen::ExhumeHadronizer::declareSpecialSettings ( const std::vector< std::string > &  )

Definition at line 261 of file ExhumeHadronizer.cc.

262 {
263  return true;
264 }
bool gen::ExhumeHadronizer::declareStableParticles ( const std::vector< int > &  _pdg)

Definition at line 243 of file ExhumeHadronizer.cc.

References gen::call_pygive(), gather_cfg::cout, i, and pycomp.

244 {
245  std::vector<int> pdg = _pdg;
246  //return pythia6Hadronizer_->declareStableParticles(pdg);
247 
248  for ( size_t i=0; i < pdg.size(); i++ )
249  {
250  int pyCode = pycomp( pdg[i] );
251  std::ostringstream pyCard ;
252  pyCard << "MDCY(" << pyCode << ",1)=0";
253  std::cout << pyCard.str() << std::endl;
254  call_pygive( pyCard.str() );
255  }
256 
257  return true;
258 
259 }
int i
Definition: DBlmapReader.cc:9
bool call_pygive(const std::string &line)
#define pycomp
tuple cout
Definition: gather_cfg.py:121
void gen::ExhumeHadronizer::finalizeEvent ( )

Definition at line 102 of file ExhumeHadronizer.cc.

References gen::call_pylist(), convertToPDG_, gather_cfg::cout, gen::BaseHadronizer::event(), hepMCVerbosity_, maxEventsToPrint_, pyint1, pypars, and pythiaListVerbosity_.

103 {
104  //pythia6Hadronizer_->finalizeEvent();
105 
106  event()->set_signal_process_id( pypars.msti[0] );
107  event()->set_event_scale( pypars.pari[16] );
108 
109  HepMC::PdfInfo pdf;
110  pdf.set_id1( pyint1.mint[14] == 21 ? 0 : pyint1.mint[14] );
111  pdf.set_id2( pyint1.mint[15] == 21 ? 0 : pyint1.mint[15] );
112  pdf.set_x1( pyint1.vint[40] );
113  pdf.set_x2( pyint1.vint[41] );
114  pdf.set_pdf1( pyint1.vint[38] / pyint1.vint[40] );
115  pdf.set_pdf2( pyint1.vint[39] / pyint1.vint[41] );
116  pdf.set_scalePDF( pyint1.vint[50] );
117 
118  event()->set_pdf_info( pdf ) ;
119 
120  event()->weights().push_back( pyint1.vint[96] );
121 
122  // convert particle IDs Py6->PDG, if requested
123  if(convertToPDG_) {
124  for ( HepMC::GenEvent::particle_iterator part = event()->particles_begin();
125  part != event()->particles_end(); ++part) {
126  (*part)->set_pdg_id(HepPID::translatePythiatoPDT((*part)->pdg_id()));
127  }
128  }
129 
130  // service printouts, if requested
131  //
132  if (maxEventsToPrint_ > 0)
133  {
136  if (hepMCVerbosity_)
137  {
138  std::cout << "Event process = " << pypars.msti[0] << std::endl
139  << "----------------------" << std::endl;
140  event()->print();
141  }
142  }
143 
144  return;
145 }
std::auto_ptr< HepMC::GenEvent > & event()
unsigned int maxEventsToPrint_
void call_pylist(int mode)
#define pyint1
unsigned int pythiaListVerbosity_
#define pypars
part
Definition: HCALResponse.h:20
tuple cout
Definition: gather_cfg.py:121
bool gen::ExhumeHadronizer::generatePartonsAndHadronize ( )

Definition at line 147 of file ExhumeHadronizer.cc.

References conv, gen::BaseHadronizer::event(), exhumeEvent_, exhumeProcess_, Exhume::Event::Generate(), gen::FortranCallback::getInstance(), Exhume::CrossSection::Hadronise(), pythia6Service_, and gen::FortranCallback::resetIterationsPerEvent().

148 {
149  Pythia6Service::InstanceWrapper guard(pythia6Service_);
150 
152 
153  // generate event
154 
157 
158  event().reset( conv.read_next_event() );
159 
160  return true;
161 }
Exhume::Event * exhumeEvent_
static HepMC::IO_HEPEVT conv
std::auto_ptr< HepMC::GenEvent > & event()
Pythia6Service * pythia6Service_
static FortranCallback * getInstance()
Exhume::CrossSection * exhumeProcess_
bool gen::ExhumeHadronizer::hadronize ( )

Definition at line 163 of file ExhumeHadronizer.cc.

164 {
165  return false;
166 }
bool gen::ExhumeHadronizer::initializeForExternalPartons ( )

Definition at line 178 of file ExhumeHadronizer.cc.

179 {
180  return false;
181 }
bool gen::ExhumeHadronizer::initializeForInternalPartons ( )

Definition at line 194 of file ExhumeHadronizer.cc.

References edm::errors::Configuration, edm::hlt::Exception, exhumeEvent_, exhumeProcess_, edm::ParameterSet::getParameter(), myPSet_, pypars, pythia6Service_, randomEngine_, Exhume::Event::SetMassRange(), Exhume::Event::SetParameterSpace(), and AlCaHLTBitMon_QueryRunRegistry::string.

195 {
196  Pythia6Service::InstanceWrapper guard(pythia6Service_);
197 
198  // pythia6Service_->setGeneralParams();
199 
200  //Exhume Initialization
201  edm::ParameterSet processPSet = myPSet_.getParameter<edm::ParameterSet>("ExhumeProcess");
202  std::string processType = processPSet.getParameter<std::string>("ProcessType");
203  int sigID = -1;
204  if(processType == "Higgs"){
206  int higgsDecay = processPSet.getParameter<int>("HiggsDecay");
207  (static_cast<Exhume::Higgs*>(exhumeProcess_))->SetHiggsDecay(higgsDecay);
208  sigID = 100 + higgsDecay;
209  } else if(processType == "QQ"){
211  int quarkType = processPSet.getParameter<int>("QuarkType");
212  double thetaMin = processPSet.getParameter<double>("ThetaMin");
213  ((Exhume::QQ*)exhumeProcess_)->SetQuarkType(quarkType);
214  (static_cast<Exhume::QQ*>(exhumeProcess_))->SetThetaMin(thetaMin);
215  sigID = 200 + quarkType;
216  } else if(processType == "GG"){
218  double thetaMin = processPSet.getParameter<double>("ThetaMin");
219  (static_cast<Exhume::GG*>(exhumeProcess_))->SetThetaMin(thetaMin);
220  sigID = 300;
221  } else if(processType == "DiPhoton"){
223  double thetaMin = processPSet.getParameter<double>("ThetaMin");
224  (static_cast<Exhume::DiPhoton*>(exhumeProcess_))->SetThetaMin(thetaMin);
225  sigID = 400;
226  } else{
227  sigID = -1;
228  throw edm::Exception(edm::errors::Configuration,"ExhumeError") <<" No valid Exhume Process";
229  }
230 
231  pypars.msti[0] = sigID;
232  //exhumeEvent_ = new Exhume::Event(*exhumeProcess_,&getEngineReference());
234 
235  double massRangeLow = processPSet.getParameter<double>("MassRangeLow");
236  double massRangeHigh = processPSet.getParameter<double>("MassRangeHigh");
237  exhumeEvent_->SetMassRange(massRangeLow,massRangeHigh);
239 
240  return true;
241 }
T getParameter(std::string const &) const
Exhume::Event * exhumeEvent_
Definition: QQ.h:11
void SetMassRange(const double &Min_, const double &Max_)
Definition: Event.h:48
Pythia6Service * pythia6Service_
void SetParameterSpace()
#define pypars
Definition: GG.h:11
edm::ParameterSet myPSet_
Exhume::CrossSection * exhumeProcess_
CLHEP::HepRandomEngine * randomEngine_
bool gen::ExhumeHadronizer::readSettings ( int  )

Definition at line 183 of file ExhumeHadronizer.cc.

References pythia6Service_, and gen::Pythia6Service::setGeneralParams().

184 {
185 
186  Pythia6Service::InstanceWrapper guard(pythia6Service_);
187 
189 
190  return true;
191 
192 }
Pythia6Service * pythia6Service_
bool gen::ExhumeHadronizer::residualDecay ( )

Definition at line 173 of file ExhumeHadronizer.cc.

174 {
175  return true;
176 }
void gen::ExhumeHadronizer::statistics ( )

Definition at line 266 of file ExhumeHadronizer.cc.

References Exhume::Event::CrossSectionCalculation(), fwrapper::cs, exhumeEvent_, exhumeProcess_, Exhume::Event::GetEfficiency(), Exhume::CrossSection::GetName(), mergeVDriftHistosByStation::name, gen::BaseHadronizer::runInfo(), GenRunInfoProduct::setInternalXSec(), and AlCaHLTBitMon_QueryRunRegistry::string.

267 {
268  std::ostringstream footer_str;
269 
271  double eff = exhumeEvent_->GetEfficiency();
273 
274  footer_str << "\n" <<" You have just been ExHuMEd." << "\n" << "\n";
275  footer_str << " The cross section for process " << name
276  << " is " << cs << " fb" << "\n" << "\n";
277  footer_str << " The efficiency of event generation was " << eff << "%" << "\n" << "\n";
278 
279  edm::LogInfo("") << footer_str.str();
280 
281  if ( !runInfo().internalXSec() )
282  {
283  runInfo().setInternalXSec( cs );
284  }
285 
286  return;
287 }
auto_ptr< ClusterSequence > cs
Exhume::Event * exhumeEvent_
double CrossSectionCalculation()
std::string GetName()
Definition: CrossSection.h:144
void setInternalXSec(const XSec &xsec)
double GetEfficiency()
Definition: Event.h:66
GenRunInfoProduct & runInfo()
Exhume::CrossSection * exhumeProcess_

Member Data Documentation

double gen::ExhumeHadronizer::comEnergy_
private

Definition at line 69 of file ExhumeHadronizer.h.

bool gen::ExhumeHadronizer::convertToPDG_
private

Definition at line 79 of file ExhumeHadronizer.h.

Referenced by ExhumeHadronizer(), and finalizeEvent().

Exhume::Event* gen::ExhumeHadronizer::exhumeEvent_
private
Exhume::CrossSection* gen::ExhumeHadronizer::exhumeProcess_
private
bool gen::ExhumeHadronizer::hepMCVerbosity_
private

Definition at line 75 of file ExhumeHadronizer.h.

Referenced by finalizeEvent().

unsigned int gen::ExhumeHadronizer::maxEventsToPrint_
private

Definition at line 76 of file ExhumeHadronizer.h.

Referenced by finalizeEvent().

edm::ParameterSet gen::ExhumeHadronizer::myPSet_
private

Definition at line 73 of file ExhumeHadronizer.h.

Referenced by initializeForInternalPartons().

Pythia6Service* gen::ExhumeHadronizer::pythia6Service_
private
unsigned int gen::ExhumeHadronizer::pythiaListVerbosity_
private

Definition at line 77 of file ExhumeHadronizer.h.

Referenced by finalizeEvent().

CLHEP::HepRandomEngine* gen::ExhumeHadronizer::randomEngine_
private

Definition at line 67 of file ExhumeHadronizer.h.

Referenced by initializeForInternalPartons().