CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

gen::AMPTHadronizer Class Reference

#include <AMPTHadronizer.h>

Inheritance diagram for gen::AMPTHadronizer:
gen::BaseHadronizer

List of all members.

Public Member Functions

 AMPTHadronizer (const edm::ParameterSet &)
const char * classname () const
bool decay ()
bool declareSpecialSettings (const std::vector< std::string >)
bool declareStableParticles (const std::vector< int >)
void finalizeEvent ()
bool generatePartonsAndHadronize ()
bool hadronize ()
bool initializeForExternalPartons ()
bool initializeForInternalPartons ()
bool readSettings (int)
bool residualDecay ()
void statistics ()
virtual ~AMPTHadronizer ()

Private Member Functions

void add_heavy_ion_rec (HepMC::GenEvent *evt)
bool ampt_init (const edm::ParameterSet &pset)
HepMC::GenParticle * build_ampt (int index, int barcode)
HepMC::GenVertex * build_ampt_vertex (int i, int id)
bool call_amptset (double efrm, std::string frame, std::string proj, std::string targ, int iap, int izp, int iat, int izt)
bool get_particles (HepMC::GenEvent *evt)
void rotateEvtPlane ()

Private Attributes

double alpha_
int amptmode_
double bmax_
double bmin_
double cosphi0_
int deuteronfactor_
int deuteronmode_
int deuteronxsec_
int diquarkembedding_
double diquarkpx_
double diquarkpy_
double diquarkx_
double diquarky_
int doInitialAndFinalRadiation_
double dpcoal_
double drcoal_
double dt_
double efrm_
HepMC::GenEvent * evt
std::string frame_
int iap_
int iat_
int izp_
int izpc_
int izt_
bool ks0decay_
int ktkick_
int maxmiss_
double minijetpt_
double mu_
int nsembd_
int ntmax_
double phi0_
bool phidecay_
bool popcornmode_
double popcornpar_
std::string proj_
double psembd_
edm::ParameterSet pset_
double pthard_
bool quenchingmode_
double quenchingpar_
bool rotate_
double shadowingfactor_
bool shadowingmode_
bool shadowingmodflag_
double sinphi0_
double stringFragA_
double stringFragB_
std::string targ_
double tmaxembd_

Detailed Description

Definition at line 32 of file AMPTHadronizer.h.


Constructor & Destructor Documentation

AMPTHadronizer::AMPTHadronizer ( const edm::ParameterSet pset)

Definition at line 54 of file AMPTHadronizer.cc.

References _amptRandomEngine.

                                                       :
    BaseHadronizer(pset),
    evt(0), 
    pset_(pset),
    bmax_(pset.getParameter<double>("bMax")),
    bmin_(pset.getParameter<double>("bMin")),
    efrm_(pset.getParameter<double>("comEnergy")),
    frame_(pset.getParameter<string>("frame")),
    proj_(pset.getParameter<string>("proj")),
    targ_(pset.getParameter<string>("targ")),
    iap_(pset.getParameter<int>("iap")),
    izp_(pset.getParameter<int>("izp")),
    iat_(pset.getParameter<int>("iat")),
    izt_(pset.getParameter<int>("izt")),
    amptmode_(pset.getParameter<int>("amptmode")),
    ntmax_(pset.getParameter<int>("ntmax")),
    dt_(pset.getParameter<double>("dt")),
    stringFragA_(pset.getParameter<double>("stringFragA")),
    stringFragB_(pset.getParameter<double>("stringFragB")),
    popcornmode_(pset.getParameter<bool>("popcornmode")),
    popcornpar_(pset.getParameter<double>("popcornpar")),
    shadowingmode_(pset.getParameter<bool>("shadowingmode")),
    quenchingmode_(pset.getParameter<bool>("quenchingmode")),
    quenchingpar_(pset.getParameter<double>("quenchingpar")),
    pthard_(pset.getParameter<double>("pthard")),
    mu_(pset.getParameter<double>("mu")),
    izpc_(pset.getParameter<int>("izpc")),
    alpha_(pset.getParameter<double>("alpha")),
    dpcoal_(pset.getParameter<double>("dpcoal")),
    drcoal_(pset.getParameter<double>("drcoal")),
    ks0decay_(pset.getParameter<bool>("ks0decay")),
    phidecay_(pset.getParameter<bool>("phidecay")),
    deuteronmode_(pset.getParameter<int>("deuteronmode")),          
    deuteronfactor_(pset.getParameter<int>("deuteronfactor")),
    deuteronxsec_(pset.getParameter<int>("deuteronxsec")),
    minijetpt_(pset.getParameter<double>("minijetpt")),
    maxmiss_(pset.getParameter<int>("maxmiss")),
    doInitialAndFinalRadiation_(pset.getParameter<int>("doInitialAndFinalRadiation")),
    ktkick_(pset.getParameter<int>("ktkick")),
    diquarkembedding_(pset.getParameter<int>("diquarkembedding")),
    diquarkpx_(pset.getParameter<double>("diquarkpx")),
    diquarkpy_(pset.getParameter<double>("diquarkpy")),
    diquarkx_(pset.getParameter<double>("diquarkx")),
    diquarky_(pset.getParameter<double>("diquarky")),
    phi0_(0.),
    sinphi0_(0.),
    cosphi0_(1.),
    rotate_(pset.getParameter<bool>("rotateEventPlane"))
{
  // Default constructor
  edm::Service<RandomNumberGenerator> rng;
  _amptRandomEngine = &(rng->getEngine());
}
AMPTHadronizer::~AMPTHadronizer ( ) [virtual]

Definition at line 110 of file AMPTHadronizer.cc.

{
}

Member Function Documentation

void AMPTHadronizer::add_heavy_ion_rec ( HepMC::GenEvent *  evt) [private]

Definition at line 115 of file AMPTHadronizer.cc.

References hmain1, hparnt, and phi0_.

Referenced by generatePartonsAndHadronize().

{
  // heavy ion record in the final CMSSW Event
  HepMC::HeavyIon* hi = new HepMC::HeavyIon(
    hmain1.jatt,                               // Ncoll_hard/N of SubEvents
    hmain1.np,                               // Npart_proj
    hmain1.nt,                               // Npart_targ
    hmain1.n0+hmain1.n01+hmain1.n10+hmain1.n11,  // Ncoll
    0,                                   // spectator_neutrons
    0,                                   // spectator_protons
    hmain1.n01,                          // N_Nwounded_collisions
    hmain1.n10,                          // Nwounded_N_collisions
    hmain1.n11,                          // Nwounded_Nwounded_collisions
    hparnt.hint1[18],                   // impact_parameter in [fm]
    phi0_,                              // event_plane_angle
    0,                                   // eccentricity
    hparnt.hint1[11]                    // sigma_inel_NN
  );
  evt->set_heavy_ion(*hi);
  delete hi;
}
bool AMPTHadronizer::ampt_init ( const edm::ParameterSet pset) [private]
HepMC::GenParticle * AMPTHadronizer::build_ampt ( int  index,
int  barcode 
) [private]

Definition at line 138 of file AMPTHadronizer.cc.

References cosphi0_, alignCSCRings::e, configurableAnalysis::GenParticle, hbt, getHLTprescales::index, INVFLV, m, gen::p, sinphi0_, mathSSE::sqrt(), and ntuplemaker::status.

Referenced by get_particles().

{
   // Build particle object corresponding to index in ampt

   float px0 = hbt.plast[index][0];
   float py0 = hbt.plast[index][1];
   float pz0 = hbt.plast[index][2];
   float m = hbt.plast[index][3];

   float px = px0*cosphi0_-py0*sinphi0_;
   float py = py0*cosphi0_+px0*sinphi0_;
   float pz = pz0;
   float e = sqrt(px*px+py*py+pz*pz+m*m); 
   int status = 1;

   HepMC::GenParticle* p = new HepMC::GenParticle(
                                                  HepMC::FourVector(px,                                                                            
                                                                    py,                                                                            
                                                                    pz,                                                         
                                                                    e),                                                           
                                                  INVFLV(hbt.lblast[index]),// id                                                                             
                                                  status // status                                                          
                                                  );

   p->suggest_barcode(barcode);
   return p;
}
HepMC::GenVertex * AMPTHadronizer::build_ampt_vertex ( int  i,
int  id 
) [private]

Definition at line 167 of file AMPTHadronizer.cc.

Referenced by get_particles().

{
   // build verteces for the ampt stored events                        
   HepMC::GenVertex* vertex = new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),id);
   return vertex;
}
bool AMPTHadronizer::call_amptset ( double  efrm,
std::string  frame,
std::string  proj,
std::string  targ,
int  iap,
int  izp,
int  iat,
int  izt 
) [private]

Definition at line 256 of file AMPTHadronizer.cc.

References AMPTSET.

Referenced by initializeForInternalPartons().

{
  // initialize hydjet  
   AMPTSET(efrm,frame.data(),proj.data(),targ.data(),iap,izp,iat,izt,strlen(frame.data()),strlen(proj.data()),strlen(targ.data()));
        return true;
}
const char * AMPTHadronizer::classname ( ) const

Definition at line 351 of file AMPTHadronizer.cc.

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

Definition at line 333 of file AMPTHadronizer.cc.

{
   return true;
}
bool gen::AMPTHadronizer::declareSpecialSettings ( const std::vector< std::string >  ) [inline]

Definition at line 45 of file AMPTHadronizer.h.

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

Definition at line 313 of file AMPTHadronizer.cc.

{
   return true;
}
void AMPTHadronizer::finalizeEvent ( )

Definition at line 343 of file AMPTHadronizer.cc.

                                  {
    return;
}
bool AMPTHadronizer::generatePartonsAndHadronize ( )

Definition at line 174 of file AMPTHadronizer.cc.

References add_heavy_ion_rec(), AMPT, bmax_, bmin_, gen::BaseHadronizer::event(), evt, frame_, get_particles(), rotate_, and rotateEvtPlane().

{
   // generate single event
   if(rotate_) rotateEvtPlane();

   // generate a AMPT event
   AMPT(frame_.data(), bmin_, bmax_, strlen(frame_.data()));

   // event information
   HepMC::GenEvent *evt = new HepMC::GenEvent();
   get_particles(evt); 

   add_heavy_ion_rec(evt);

   event().reset(evt);


   return true;
}
bool AMPTHadronizer::get_particles ( HepMC::GenEvent *  evt) [private]

Definition at line 195 of file AMPTHadronizer.cc.

References build_ampt(), build_ampt_vertex(), configurableAnalysis::GenParticle, hbt, i, and LogDebug.

Referenced by generatePartonsAndHadronize().

{
      HepMC::GenVertex*  vertice;

      vector<HepMC::GenParticle*> particles;
      vector<int>                 mother_ids;
      vector<HepMC::GenVertex*>   prods;

      vertice = new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),0);
      evt->add_vertex(vertice);
      if(!evt->signal_process_vertex()) evt->set_signal_process_vertex(vertice);

      const unsigned int knumpart = hbt.nlast;
      for (unsigned int ipart = 0; ipart<knumpart; ipart++) {
         int mid = 0;
         particles.push_back(build_ampt(ipart,ipart+1));
         prods.push_back(build_ampt_vertex(ipart,0));
         mother_ids.push_back(mid);
         LogDebug("DecayChain")<<"Mother index : "<<mid;
      }
      
      LogDebug("AMPT")<<"Number of particles in vector "<<particles.size();

      for (unsigned int ipart = 0; ipart<particles.size(); ipart++) {
         HepMC::GenParticle* part = particles[ipart];

         int mid = mother_ids[ipart];
         LogDebug("DecayChain")<<"Particle "<<ipart;
         LogDebug("DecayChain")<<"Mother's ID "<<mid;
         LogDebug("DecayChain")<<"Particle's PDG ID "<<part->pdg_id();

         if(mid <= 0){
            vertice->add_particle_out(part);
            continue;
         }

         if(mid > 0){
            HepMC::GenParticle* mother = particles[mid];
            LogDebug("DecayChain")<<"Mother's PDG ID "<<mother->pdg_id();

            HepMC::GenVertex* prod_vertex = mother->end_vertex();
            if(!prod_vertex){
               prod_vertex = prods[ipart];
               prod_vertex->add_particle_in(mother);
               evt->add_vertex(prod_vertex);
               prods[ipart]=0; // mark to protect deletion                                                                                                   

            }
            prod_vertex->add_particle_out(part);
         }
      }

      // cleanup vertices not assigned to evt                                                                                                            
      for (unsigned int i = 0; i<prods.size(); i++) {
         if(prods[i]) delete prods[i];
      }

   return true;
}
bool AMPTHadronizer::hadronize ( )

Definition at line 328 of file AMPTHadronizer.cc.

{
   return false;
}
bool gen::AMPTHadronizer::initializeForExternalPartons ( )
bool AMPTHadronizer::initializeForInternalPartons ( )

Definition at line 300 of file AMPTHadronizer.cc.

References ampt_init(), call_amptset(), efrm_, frame_, iap_, iat_, izp_, izt_, proj_, pset_, and targ_.

                                                 {

   // ampt running options
   ampt_init(pset_);

   // initialize ampt
   LogInfo("AMPTinAction") << "##### Calling AMPTSET(" << efrm_ << "," <<frame_<<","<<proj_<<","<<targ_<<","<<iap_<<","<<izp_<<","<<iat_<<","<<izt_<<") ####";

   call_amptset(efrm_,frame_,proj_,targ_,iap_,izp_,iat_,izt_);

   return true;
}
bool gen::AMPTHadronizer::readSettings ( int  ) [inline]

Definition at line 41 of file AMPTHadronizer.h.

{ return true; }
bool AMPTHadronizer::residualDecay ( )

Definition at line 338 of file AMPTHadronizer.cc.

{  
   return true;
}
void AMPTHadronizer::rotateEvtPlane ( ) [private]

Definition at line 319 of file AMPTHadronizer.cc.

References funct::cos(), cosphi0_, phi0_, pi, gen::ranart_(), funct::sin(), sinphi0_, run_regression::test, and zero.

Referenced by generatePartonsAndHadronize().

                                   {
   int zero = 0;
   double test = (double)gen::ranart_(&zero);
   phi0_ = 2.*pi*test - pi;
   sinphi0_ = sin(phi0_);
   cosphi0_ = cos(phi0_);
}
void AMPTHadronizer::statistics ( )

Definition at line 347 of file AMPTHadronizer.cc.

                               {
    return;
}

Member Data Documentation

double gen::AMPTHadronizer::alpha_ [private]

Definition at line 89 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 76 of file AMPTHadronizer.h.

Referenced by ampt_init().

double gen::AMPTHadronizer::bmax_ [private]

Definition at line 64 of file AMPTHadronizer.h.

Referenced by generatePartonsAndHadronize().

double gen::AMPTHadronizer::bmin_ [private]

Definition at line 66 of file AMPTHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 113 of file AMPTHadronizer.h.

Referenced by build_ampt(), and rotateEvtPlane().

Definition at line 95 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 94 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 96 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 101 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 102 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 103 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 104 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 105 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 99 of file AMPTHadronizer.h.

Referenced by ampt_init().

double gen::AMPTHadronizer::dpcoal_ [private]

Definition at line 90 of file AMPTHadronizer.h.

Referenced by ampt_init().

double gen::AMPTHadronizer::drcoal_ [private]

Definition at line 91 of file AMPTHadronizer.h.

Referenced by ampt_init().

double gen::AMPTHadronizer::dt_ [private]

Definition at line 78 of file AMPTHadronizer.h.

Referenced by ampt_init().

double gen::AMPTHadronizer::efrm_ [private]

Definition at line 68 of file AMPTHadronizer.h.

Referenced by initializeForInternalPartons().

HepMC::GenEvent* gen::AMPTHadronizer::evt [private]

Definition at line 62 of file AMPTHadronizer.h.

Referenced by generatePartonsAndHadronize().

std::string gen::AMPTHadronizer::frame_ [private]

Definition at line 69 of file AMPTHadronizer.h.

Referenced by generatePartonsAndHadronize(), and initializeForInternalPartons().

Definition at line 72 of file AMPTHadronizer.h.

Referenced by initializeForInternalPartons().

Definition at line 74 of file AMPTHadronizer.h.

Referenced by initializeForInternalPartons().

Definition at line 73 of file AMPTHadronizer.h.

Referenced by initializeForInternalPartons().

Definition at line 88 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 75 of file AMPTHadronizer.h.

Referenced by initializeForInternalPartons().

Definition at line 92 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 100 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 98 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 97 of file AMPTHadronizer.h.

Referenced by ampt_init().

double gen::AMPTHadronizer::mu_ [private]

Definition at line 87 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 106 of file AMPTHadronizer.h.

Definition at line 77 of file AMPTHadronizer.h.

Referenced by ampt_init().

double gen::AMPTHadronizer::phi0_ [private]

Definition at line 111 of file AMPTHadronizer.h.

Referenced by add_heavy_ion_rec(), and rotateEvtPlane().

Definition at line 93 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 81 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 82 of file AMPTHadronizer.h.

Referenced by ampt_init().

std::string gen::AMPTHadronizer::proj_ [private]

Definition at line 70 of file AMPTHadronizer.h.

Referenced by initializeForInternalPartons().

double gen::AMPTHadronizer::psembd_ [private]

Definition at line 107 of file AMPTHadronizer.h.

Definition at line 63 of file AMPTHadronizer.h.

Referenced by initializeForInternalPartons().

double gen::AMPTHadronizer::pthard_ [private]

Definition at line 86 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 84 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 85 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 114 of file AMPTHadronizer.h.

Referenced by generatePartonsAndHadronize().

Definition at line 110 of file AMPTHadronizer.h.

Definition at line 83 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 109 of file AMPTHadronizer.h.

Definition at line 112 of file AMPTHadronizer.h.

Referenced by build_ampt(), and rotateEvtPlane().

Definition at line 79 of file AMPTHadronizer.h.

Referenced by ampt_init().

Definition at line 80 of file AMPTHadronizer.h.

Referenced by ampt_init().

std::string gen::AMPTHadronizer::targ_ [private]

Definition at line 71 of file AMPTHadronizer.h.

Referenced by initializeForInternalPartons().

Definition at line 108 of file AMPTHadronizer.h.