sherpa is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" (/hepforge/svn/sherpa does not appear to be a Subversion repository.). Look in the Trac log for more information.

Ticket #39: partonic-decay-vertex-position.patch

File partonic-decay-vertex-position.patch, 3.3 KB (added by Frank Siegert, 16 years ago)
  • SHERPA/Single_Events/Hadron_Decays.C

     
    314314
    315315          return true;
    316316        }
    317         DEBUG_INFO("did not find exclusive decay channel, continue.");
     317        else {
     318          DEBUG_INFO("did not find exclusive decay channel, continue.");
     319          Vec4D vertex_position=decayblob->Position();
     320          showerblob->SetPosition(vertex_position);
     321          fragmentationblob->SetPosition(vertex_position);
     322        }
    318323      }
    319324    }
    320325  }
     
    344349void Hadron_Decays::SetPosition(ATOOLS::Blob* blob)
    345350{
    346351  Particle* inpart = blob->InParticle(0);
    347   if(inpart->Flav().Kfcode()==kf_K) return;
     352  if(inpart->Flav().Kfcode()==kf_K) {
     353    blob->SetPosition(inpart->XProd());
     354    return;
     355  }
    348356 
    349357  // boost lifetime into lab
    350358  double gamma = 1./rpa.gen.Accu();
  • SHERPA/SoftPhysics/Fragmentation_Handler.C

     
    116116{
    117117  Particle  * part(NULL);
    118118  Blob      * blob(NULL);
    119   Part_List * plist = new Part_List;
     119  std::vector<Part_List*> plists;
     120  plists.push_back(new Part_List);
    120121  for (Blob_List::iterator blit=bloblist->begin();blit!=bloblist->end();++blit) {
    121122    if ((*blit)->Has(blob_status::needs_hadronization)) {
     123      // If not coming from hadron decays, fill default plists[0].
     124      // If from hadron decays, create separate plist for each blob
     125      // such that there is a one-to-one correspondence between
     126      // fragmentation outcome and hadron decay. This is needed for setting
     127      // the correct vertex position, and to reject exclusive final states
     128      Part_List* plist(plists[0]);
     129      Blob* upstream_blob=(*blit)->UpstreamBlob();
     130      if (upstream_blob && upstream_blob->Type()==btp::Hadron_Decay) {
     131        plist=new Part_List;
     132        plists.push_back(plist);
     133      }
     134
    122135      std::vector<Particle*> taus;
    123136      for (int i=0;i<(*blit)->NOutP();i++) {
    124137        part = (*blit)->OutParticle(i);
     
    149162      (*blit)->UnsetStatus(blob_status::needs_hadronization);
    150163    }
    151164  }
    152   if (plist->empty()) {
     165  if (plists[0]->empty() && plists.size()<2) {
    153166    msg_Debugging()<<"WARNING in Lund_Interface::PrepareFragmentationBlob:"<<endl
    154167                   <<"   No coloured particle found leaving shower blobs."<<endl;
    155     delete plist;
     168    delete plists[0];
    156169    return Return_Value::Nothing;
    157170  }
    158171
    159172
     173  Return_Value::code ret(Return_Value::Success);
     174  for (size_t i=0; i<plists.size(); ++i) {
     175  if (plists[i]->empty()) continue;
     176  Part_List* plist=plists[i];
    160177  int  col1, col2;
    161178  bool hit1, hit2;
    162179  Part_List * pli(NULL);
     
    233250      delete partlists[i];
    234251    }
    235252    delete plist;
    236     return Return_Value::Success;
     253    ret=Return_Value::Success;
     254  }
     255  else {
     256    for(size_t i=0;i<partlists.size();i++) {
     257      delete partlists[i];
     258    }
     259    delete plist;
     260    ret=Return_Value::Error;
     261    break;
    237262  }
    238   for(size_t i=0;i<partlists.size();i++) {
    239     delete partlists[i];
    240263  }
    241   delete plist;
    242   return Return_Value::Error;
     264  return ret;
    243265}
    244266