CMS 3D CMS Logo

Public Member Functions | Private Attributes

gen::ExhumeHadronizer Class Reference

#include <ExhumeHadronizer.h>

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

List of all members.

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 residualDecay ()
void statistics ()
 ~ExhumeHadronizer ()

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_

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().

   : BaseHadronizer(pset),
     pythia6Service_(new Pythia6Service(pset)),
     randomEngine_(&getEngineReference()),
     comEnergy_(pset.getParameter<double>("comEnergy")),
     myPSet_(pset),
     hepMCVerbosity_(pset.getUntrackedParameter<bool>("pythiaHepMCVerbosity",false)),
     maxEventsToPrint_(pset.getUntrackedParameter<int>("maxEventsToPrint", 0)),
     pythiaListVerbosity_(pset.getUntrackedParameter<int>("pythiaPylistVerbosity", 0))
{ 

   convertToPDG_ = false;
   if ( pset.exists( "doPDGConvert" ) )
   {
      convertToPDG_ = pset.getParameter<bool>("doPDGConvert");
   }
   
   //pythia6Hadronizer_ = new Pythia6Hadronizer(pset);  
}
gen::ExhumeHadronizer::~ExhumeHadronizer ( )

Definition at line 95 of file ExhumeHadronizer.cc.

References exhumeEvent_, exhumeProcess_, and pythia6Service_.

                                   {
   //delete pythia6Hadronizer_;
   delete pythia6Service_;
   delete exhumeEvent_;
   delete exhumeProcess_;
}

Member Function Documentation

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

Definition at line 277 of file ExhumeHadronizer.cc.

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

Definition at line 168 of file ExhumeHadronizer.cc.

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

Definition at line 249 of file ExhumeHadronizer.cc.

{
   return true;
}
bool gen::ExhumeHadronizer::declareStableParticles ( const std::vector< int >  pdg)

Definition at line 232 of file ExhumeHadronizer.cc.

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

{
   //return pythia6Hadronizer_->declareStableParticles(pdg);

   for ( size_t i=0; i < pdg.size(); i++ )
   {
      int pyCode = pycomp( pdg[i] );
      std::ostringstream pyCard ;
      pyCard << "MDCY(" << pyCode << ",1)=0";
      std::cout << pyCard.str() << std::endl;
      call_pygive( pyCard.str() );
   }
   
   return true;

}
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_.

{
   //pythia6Hadronizer_->finalizeEvent();

   event()->set_signal_process_id( pypars.msti[0] );
   event()->set_event_scale( pypars.pari[16] );

   HepMC::PdfInfo pdf;
   pdf.set_id1( pyint1.mint[14] == 21 ? 0 : pyint1.mint[14] );
   pdf.set_id2( pyint1.mint[15] == 21 ? 0 : pyint1.mint[15] );
   pdf.set_x1( pyint1.vint[40] );
   pdf.set_x2( pyint1.vint[41] );
   pdf.set_pdf1( pyint1.vint[38] / pyint1.vint[40] );
   pdf.set_pdf2( pyint1.vint[39] / pyint1.vint[41] );
   pdf.set_scalePDF( pyint1.vint[50] );

   event()->set_pdf_info( pdf ) ;

   event()->weights().push_back( pyint1.vint[96] );

   // convert particle IDs Py6->PDG, if requested
   if(convertToPDG_) {
      for ( HepMC::GenEvent::particle_iterator part = event()->particles_begin(); 
                                               part != event()->particles_end(); ++part) {
         (*part)->set_pdg_id(HepPID::translatePythiatoPDT((*part)->pdg_id()));
      }
   }

   // service printouts, if requested
   //
   if (maxEventsToPrint_ > 0) 
   {
      --maxEventsToPrint_;
      if (pythiaListVerbosity_) call_pylist(pythiaListVerbosity_);
      if (hepMCVerbosity_) 
      {
         std::cout << "Event process = " << pypars.msti[0] << std::endl 
              << "----------------------" << std::endl;
         event()->print();
      }
   }

   return;
}
bool gen::ExhumeHadronizer::generatePartonsAndHadronize ( )
bool gen::ExhumeHadronizer::hadronize ( )

Definition at line 163 of file ExhumeHadronizer.cc.

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

Definition at line 178 of file ExhumeHadronizer.cc.

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

Definition at line 183 of file ExhumeHadronizer.cc.

References edm::errors::Configuration, Exception, exhumeEvent_, exhumeProcess_, edm::ParameterSet::getParameter(), myPSet_, pypars, pythia6Service_, randomEngine_, gen::Pythia6Service::setGeneralParams(), Exhume::Event::SetMassRange(), and Exhume::Event::SetParameterSpace().

{
   Pythia6Service::InstanceWrapper guard(pythia6Service_);

   pythia6Service_->setGeneralParams();
 
   //Exhume Initialization
   edm::ParameterSet processPSet = myPSet_.getParameter<edm::ParameterSet>("ExhumeProcess");
   std::string processType = processPSet.getParameter<std::string>("ProcessType");
   int sigID = -1;
   if(processType == "Higgs"){
      exhumeProcess_ = new Exhume::Higgs(myPSet_);
      int higgsDecay = processPSet.getParameter<int>("HiggsDecay");
      (static_cast<Exhume::Higgs*>(exhumeProcess_))->SetHiggsDecay(higgsDecay);
      sigID = 100 + higgsDecay;
   } else if(processType == "QQ"){      
      exhumeProcess_ = new Exhume::QQ(myPSet_);
      int quarkType = processPSet.getParameter<int>("QuarkType");
      double thetaMin = processPSet.getParameter<double>("ThetaMin");
      ((Exhume::QQ*)exhumeProcess_)->SetQuarkType(quarkType);
      (static_cast<Exhume::QQ*>(exhumeProcess_))->SetThetaMin(thetaMin);
      sigID = 200 + quarkType;
   } else if(processType == "GG"){
      exhumeProcess_ = new Exhume::GG(myPSet_);
      double thetaMin = processPSet.getParameter<double>("ThetaMin");
      (static_cast<Exhume::GG*>(exhumeProcess_))->SetThetaMin(thetaMin);
      sigID = 300;
   } else if(processType == "DiPhoton"){
      exhumeProcess_ = new Exhume::DiPhoton(myPSet_);
      double thetaMin = processPSet.getParameter<double>("ThetaMin");
      (static_cast<Exhume::DiPhoton*>(exhumeProcess_))->SetThetaMin(thetaMin);
      sigID = 400;
   } else{
      sigID = -1;
      throw edm::Exception(edm::errors::Configuration,"ExhumeError") <<" No valid Exhume Process";
   }
    
   pypars.msti[0] = sigID;
   //exhumeEvent_ = new Exhume::Event(*exhumeProcess_,&getEngineReference());
   exhumeEvent_ = new Exhume::Event(*exhumeProcess_,randomEngine_);

   double massRangeLow = processPSet.getParameter<double>("MassRangeLow");
   double massRangeHigh = processPSet.getParameter<double>("MassRangeHigh");
   exhumeEvent_->SetMassRange(massRangeLow,massRangeHigh);
   exhumeEvent_->SetParameterSpace();

   return true;
}
bool gen::ExhumeHadronizer::residualDecay ( )

Definition at line 173 of file ExhumeHadronizer.cc.

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

Definition at line 254 of file ExhumeHadronizer.cc.

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

{
  std::ostringstream footer_str;

  double cs = exhumeEvent_->CrossSectionCalculation();
  double eff = exhumeEvent_->GetEfficiency();
  std::string name = exhumeProcess_->GetName();

  footer_str << "\n" <<"   You have just been ExHuMEd." << "\n" << "\n";
  footer_str << "   The cross section for process " << name
             << " is " << cs << " fb" << "\n" << "\n";
  footer_str << "   The efficiency of event generation was " << eff << "%" << "\n" << "\n";

  edm::LogInfo("") << footer_str.str();

  if ( !runInfo().internalXSec() )
  {
     runInfo().setInternalXSec( cs );
  }

  return;
}

Member Data Documentation

Definition at line 68 of file ExhumeHadronizer.h.

Definition at line 78 of file ExhumeHadronizer.h.

Referenced by ExhumeHadronizer(), and finalizeEvent().

Definition at line 74 of file ExhumeHadronizer.h.

Referenced by finalizeEvent().

Definition at line 75 of file ExhumeHadronizer.h.

Referenced by finalizeEvent().

Definition at line 72 of file ExhumeHadronizer.h.

Referenced by initializeForInternalPartons().

Definition at line 76 of file ExhumeHadronizer.h.

Referenced by finalizeEvent().

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

Definition at line 66 of file ExhumeHadronizer.h.

Referenced by initializeForInternalPartons().