1 #include "Framework/Conventions/GBuild.h"
2 #ifdef __GENIE_INCL_ENABLED__
14 #include "G4INCLConfig.hh"
15 #include "G4INCLCascade.hh"
16 #include "G4INCLConfigEnums.hh"
17 #include "G4INCLParticle.hh"
19 #include "G4INCLSignalHandling.hh"
22 #include "G4INCLIDeExcitation.hh"
25 #ifdef INCL_DEEXCITATION_ABLAXX
26 #include "G4INCLAblaInterface.hh"
30 #ifdef INCL_DEEXCITATION_ABLA07
31 #include "G4INCLAbla07Interface.hh"
35 #ifdef INCL_DEEXCITATION_SMM
36 #include "G4INCLSMMInterface.hh"
40 #ifdef INCL_DEEXCITATION_GEMINIXX
41 #include "G4INCLGEMINIXXInterface.hh"
49 #ifdef HAS_BOOST_TIMER
50 #include <boost/timer/timer.hpp>
51 namespace bt = boost::timer;
57 #include "INCLConvertParticle.hh"
70 using namespace genie;
71 using namespace genie::utils;
72 using namespace G4INCL;
73 using std::ostringstream;
76 HINCLCascadeIntranuke::HINCLCascadeIntranuke() :
78 theINCLConfig(0), theINCLModel(0), theDeExcitation(0)
85 HINCLCascadeIntranuke::HINCLCascadeIntranuke(
string config) :
87 theINCLConfig(0), theINCLModel(0), theDeExcitation(0)
90 <<
"ctor from config " << config;
94 HINCLCascadeIntranuke::~HINCLCascadeIntranuke()
98 if ( theINCLConfig ) { theINCLConfig=0; }
99 if ( theINCLModel ) {
delete theINCLModel; theINCLModel=0; }
100 if ( theDeExcitation ) {
delete theDeExcitation; theDeExcitation=0; }
105 void HINCLCascadeIntranuke::LoadConfig(
void)
107 LOG(
"HINCLCascadeIntranuke",
pINFO) <<
"Settings for INCL++ mode: " ;
109 #ifdef INCL_SIGNAL_HANDLING
110 enableSignalHandling();
114 if ( theINCLConfig ) { theINCLConfig=0; }
115 if ( theINCLModel ) {
delete theINCLModel; theINCLModel=0; }
116 if ( theDeExcitation ) {
delete theDeExcitation; theDeExcitation=0; }
118 INCLConfigParser theParser;
120 size_t maxFlags = 200;
122 char * flags[maxFlags];
125 GetParamDef(
"INCL-infile", infile, std::string(
"NULL"));
126 flags[nflags] = strdup(infile.c_str()); ++nflags;
129 GetParamDef(
"INCL-pflag", pflag, std::string(
"-pp"));
130 flags[nflags] = strdup(pflag.c_str()); ++nflags;
133 GetParamDef(
"INCL-tflag", tflag, std::string(
"-tFe56"));
134 flags[nflags] = strdup(tflag.c_str()); ++nflags;
137 GetParamDef(
"INCL-Nflag", Nflag, std::string(
"-N1"));
138 flags[nflags] = strdup(Nflag.c_str()); ++nflags;
141 GetParamDef(
"INCL-Eflag", Eflag, std::string(
"-E1"));
142 flags[nflags] = strdup(Eflag.c_str()); ++nflags;
145 GetParamDef(
"INCL-dflag", dflag, std::string(
"-dABLA07"));
146 flags[nflags] = strdup(dflag.c_str()); ++nflags;
149 std::string extra_incl_flags;
150 GetParamDef(
"INCL-extra-flags", extra_incl_flags, std::string(
""));
152 for (
size_t j=0; j < extraTokens.size(); ++j) {
153 std::string& token = extraTokens[j];
156 flags[nflags] = strdup(token.c_str()); ++nflags;
161 <<
"LoadConfig() create theINCLConfig";
162 theINCLConfig = theParser.parse(nflags,flags);
167 bool updateNeeded = AddDataPathFlags(nflags,flags);
169 delete theINCLConfig;
170 theINCLConfig = theParser.parse(nflags,flags);
174 <<
"doCascade new G4INCL::INCL";
175 theINCLModel =
new G4INCL::INCL(theINCLConfig);
179 switch(theINCLConfig->getDeExcitationType()) {
180 #ifdef INCL_DEEXCITATION_ABLAXX
181 case G4INCL::DeExcitationABLAv3p:
182 theDeExcitation =
new G4INCLAblaInterface(theINCLConfig);
184 <<
"using ABLAv3p for DeExcitation";
187 #ifdef INCL_DEEXCITATION_ABLA07
188 case G4INCL::DeExcitationABLA07:
189 theDeExcitation =
new ABLA07CXX::Abla07Interface(theINCLConfig);
191 <<
"using ABLA07CXX for DeExcitation";
194 #ifdef INCL_DEEXCITATION_SMM
195 case G4INCL::DeExcitationSMM:
196 theDeExcitation =
new SMMCXX::SMMInterface(theINCLConfig);
198 <<
"using SMMCXX for DeExcitation";
201 #ifdef INCL_DEEXCITATION_GEMINIXX
202 case G4INCL::DeExcitationGEMINIXX:
203 theDeExcitation =
new G4INCLGEMINIXXInterface(theINCLConfig);
205 <<
"using GEMINIXX for DeExcitation";
209 std::stringstream ss;
210 ss <<
"########################################################\n"
211 <<
"### WARNING WARNING WARNING ###\n"
213 <<
"### You are running the code without any coupling to ###\n"
214 <<
"### a de-excitation model! ###\n"
215 <<
"### Results will be INCOMPLETE and UNPHYSICAL! ###\n"
216 <<
"### Are you sure this is what you want to do? ###\n"
217 <<
"########################################################\n";
226 for (
size_t i=0; i < nflags; ++i) {
235 bool HINCLCascadeIntranuke::AddDataPathFlags(
size_t& nflags,
char** flags) {
238 bool needed_update =
false;
239 size_t nflags_in = nflags;
241 std::string validpath;
242 std::vector<std::string> datapaths;
245 <<
"check for data location of INCL";
248 datapaths.push_back(theINCLConfig->getINCLXXDataFilePath());
249 datapaths.push_back(
"!INCL-incl-data-alt1");
250 datapaths.push_back(
"!INCL-incl-data-alt2");
252 LookForAndAddValidPath(datapaths,0,
"--inclxx-datafile-path",nflags,flags);
254 switch(theINCLConfig->getDeExcitationType()) {
255 #ifdef INCL_DEEXCITATION_ABLAXX
256 case G4INCL::DeExcitationABLAv3p:
258 <<
"using ABLAv3p for DeExcitation -- check for data location";
260 datapaths.push_back(theINCLConfig->getABLAv3pCxxDataFilePath());
261 datapaths.push_back(
"!INCL-ablav3p-data-alt1");
262 datapaths.push_back(
"!INCL-ablav3p-data-alt2");
264 LookForAndAddValidPath(datapaths,0,
"--ablav3p-cxx-datafile-path",nflags,flags);
267 #ifdef INCL_DEEXCITATION_ABLA07
268 case G4INCL::DeExcitationABLA07:
270 <<
"using ABLA07 for DeExcitation -- check for data location";
272 datapaths.push_back(theINCLConfig->getABLA07DataFilePath());
273 datapaths.push_back(
"!INCL-abla07-data-alt1");
274 datapaths.push_back(
"!INCL-abla07-data-alt2");
276 LookForAndAddValidPath(datapaths,0,
"--abla07-datafile-path",nflags,flags);
279 #ifdef INCL_DEEXCITATION_SMM
280 case G4INCL::DeExcitationSMM:
282 <<
"using SMMCXX for DeExcitation -- no data files to check for";
285 #ifdef INCL_DEEXCITATION_GEMINIXX
286 case G4INCL::DeExcitationGEMINIXX:
288 <<
"using GEMINIXX for DeExcitation -- check for data location";
290 datapaths.push_back(theINCLConfig->getGEMINIXXDataFilePath());
291 datapaths.push_back(
"!INCL-gemini-data-alt1");
292 datapaths.push_back(
"!INCL-gemini-data-alt2");
294 LookForAndAddValidPath(datapaths,0,
"--geminixx-datafile-path",nflags,flags);
299 <<
"using no DeExcitation -- no data files to check for";
304 std::stringstream ss;
305 for (
size_t i=0; i < nflags; ++i) {
306 if ( i == nflags_in ) ss <<
"---- list prior to AddDataPathFlags()\n";
307 ss <<
"[" << setw(3) << i <<
"] " << flags[i] <<
'\n';
310 <<
"Flags passed to INCLConfigParser"
313 return needed_update;
317 bool HINCLCascadeIntranuke::LookForAndAddValidPath(std::vector<std::string>& datapaths,
319 const char* optString,
320 size_t& nflags,
char** flags) {
332 bool needed_update =
false;
335 <<
"looking for a valid path for " << optString
336 <<
" (default [" << defaultIndx <<
"]";
338 size_t foundIndx = SIZE_MAX;
339 size_t npaths = datapaths.size();
340 for (
size_t ipath = 0; ipath < npaths; ++ipath) {
341 std::string& apath = datapaths[ipath];
343 <<
"looking at " << apath;
344 if ( apath.at(0) ==
'!' ) {
348 std::string newpath =
"";
349 std::string notfoundvalue = std::string(
"no-such-param-") + apath;
350 GetParamDef(apath,newpath,notfoundvalue);
352 <<
"fetch param "<<
"[" << ipath <<
"] "<< apath <<
" got " << newpath;
355 const char* expandedPath = gSystem->ExpandPathName(apath.c_str());
356 if ( ! expandedPath ) {
358 <<
"expandedPath was NULL";
363 <<
"expandedPath " << expandedPath <<
" "
364 << ((valid)?
"valid":
"doesn't exist");
366 apath = std::string(expandedPath);
371 if ( foundIndx == defaultIndx ) {
373 }
else if ( foundIndx > npaths-1 ) {
375 std::stringstream ss;
376 for (
size_t ipath = 0; ipath < npaths; ++ipath) {
377 std::string& apath = datapaths[ipath];
378 ss <<
"[" << ipath <<
"] " << apath <<
"\n";
381 <<
"no valid path found for " << optString
382 <<
", tried: \n" << ss.str();
385 flags[nflags] = strdup(optString); ++nflags;
386 flags[nflags] = strdup(datapaths[foundIndx].c_str()); ++nflags;
387 needed_update =
true;
390 return needed_update;
394 int HINCLCascadeIntranuke::doCascade(
GHepRecord * evrec)
const {
396 if ( ! theINCLConfig || ! theINCLModel )
return 0;
402 const ParticleType theType = toINCLparticletype(pprobe->
Pdg());
404 double E = (pprobe->
E())*1000;
405 double massp = G4INCL::ParticleTable::getRealMass(theType);
406 double EKin = E - massp;
408 G4INCL::ParticleSpecies theSpecies;
409 theSpecies.theType = theType;
410 theSpecies.theA = pdgcpiontoA(pprobe->
Pdg());
411 theSpecies.theZ = pdgcpiontoZ(pprobe->
Pdg());
413 G4INCL::Random::SeedVector
const theInitialSeeds = G4INCL::Random::getSeeds();
415 int pdg_codeProbe = 0;
416 pdg_codeProbe = INCLpartycleSpecietoPDGCODE(theSpecies);
418 G4INCL::EventInfo result;
419 result = theINCLModel->processEvent(theSpecies,EKin,target->
A(),target->
Z());
421 double m_target = ParticleTable::getTableMass(result.At, result.Zt);
424 TLorentzVector p4h (0.,0.,fsProbe->
Pz(),fsProbe->
E());
425 TLorentzVector x4null(0.,0.,0.,0.);
426 TLorentzVector p4tgt (0.,0.,0.,m_target/1000);
429 if ( result.transparent ) {
430 evrec->
AddParticle(pdg_codeProbe, ist1, 0,-1,-1,-1, p4h,x4null);
432 INCL_DEBUG(
"Transparent event" << std::endl);
434 INCL_DEBUG(
"Number of produced particles: " << result.nParticles <<
"\n");
435 if ( theDeExcitation != 0 ) {
436 theDeExcitation->deExcite(&result);
439 for (
int nP = 0; nP < result.nParticles; nP++){
440 if ( nP == result.nParticles-1 ) {
441 int pdgRem=INCLtopdgcode(result.A[nP],result.Z[nP]);
446 <<
"NO Particle with pdg = " << pdgRem <<
" in PDGLibrary!";
448 TVector3 p3M(result.px[nP]/1000,result.py[nP]/1000,result.pz[nP]/1000);
450 double MassRem=0.5*((result.px[nP])*(result.px[nP]) +
451 (result.py[nP])*(result.py[nP]) +
452 (result.pz[nP])*(result.pz[nP]) -
453 result.EKin[nP]*result.EKin[nP]) / (result.EKin[nP]);
454 float ERem=result.EKin[nP]+MassRem;
455 TLorentzVector p4tgtf(p3M,ERem/1000);
457 1,-1,-1,-1, p4tgtf, x4null);;
479 void HINCLCascadeIntranuke::ProcessEventRecord(
GHepRecord * evrec)
const {
482 <<
"************ Running HINCLCascadeIntranuke MODE INTRANUKE ************";
487 HINCLCascadeIntranuke::doCascade(evrec);
489 HINCLCascadeIntranuke::TransportHadrons(evrec);
492 LOG(
"HINCLCascadeIntranuke",
pINFO) <<
"Done with this event";
495 bool HINCLCascadeIntranuke::CanRescatter(
const GHepParticle * p)
const {
508 void HINCLCascadeIntranuke::TransportHadrons(
GHepRecord * evrec)
const {
523 <<
"Propagating hadrons within nucleus found in position = " << inucl;
529 <<
"No nucleus found in position = " << inucl;
538 int A_f(0), Z_f(0), Aft(0), A_i(target->
A()),Z_i(0), Charge_probe(Incident_particle->
Charge());
539 if(Charge_probe==0) Z_i=target->
Z();
540 else if(Charge_probe<0) Z_i=target->
Z()-1;
541 else if(Charge_probe>0)Z_i=target->
Z()+1;
545 <<
"Nucleus (A,Z) = (" << fRemnA <<
", " << fRemnZ <<
")";
547 const TLorentzVector & p4nucl = *(nucl->
P4());
548 TLorentzVector x4null(0.,0.,0.,0.);
551 TObjArrayIter piter(evrec);
558 TLorentzVector * p_4 = nucl->
P4();
560 double pxRemn = p_4->Px();
561 double pyRemn = p_4->Py();
562 double pzRemn = p_4->Pz();
564 TLorentzVector p4tgf(p_4->Px(),p_4->Py(),p_4->Pz(),0.0);
567 std::vector<G4INCL::EventInfo>ListeOfINCLresult;
568 std::vector<int> Postion_evrec,num_of_AZexception;
570 double ExcitaionE(0), the_pxRemn(0), the_pyRemn(0), the_pzRemn(0);
571 int Zl(0), Aresult(0), Zresult(0), Aexception(0), Zexception(0),Pos(0),
572 mother1(0),mother2(0),theA_Remn(0), theZ_Remn(0);
574 if ( fsl->
Charge() == 0. ) Zl = 0;
575 else if ( fsl->
Charge() < 0. ) Zl = -1;
576 else if ( fsl->
Charge() > 0. ) Zl = 1;
577 bool has_remnant =
false;
583 if( ! this->NeedsRescattering(p) )
continue;
590 if ( ! this->CanRescatter(sp) ) {
594 <<
"... Current version can't rescatter a " << sp->
Name();
597 if ( sp->
Charge() == 0. ) {
601 else if ( sp->
Charge() < 0. ) {
605 else if ( sp->
Charge() > 0. ) {
616 TLorentzVector *v4= sp->
GetX4();
618 ThreeVector thePosition(0.,0.,0.);
619 ThreeVector momentum (0.,0.,0.);
620 thePosition.setX(v4->X());
621 thePosition.setY(v4->Y());
622 thePosition.setZ(v4->Z());
623 TLorentzVector * p4 = sp->
P4();
625 momentum.setX(p4->Px()*1000);
626 momentum.setY(p4->Py()*1000);
627 momentum.setZ(p4->Pz()*1000);
629 int pdgc = sp->
Pdg();
631 const ParticleType theType = toINCLparticletype(pdgc);
633 if ( theType == G4INCL::UnknownParticle) {
643 double E = (p4->Energy())*1000;
644 double massp = G4INCL::ParticleTable::getRealMass(theType);
646 double EKin = E - massp;
648 G4INCL::ParticleSpecies theSpecies;
649 theSpecies.theType=theType;
650 theSpecies.theA=pdgcpiontoA(sp->
Pdg());
651 theSpecies.theZ=pdgcpiontoZ(sp->
Pdg());
653 G4INCL::Particle *pincl =
654 new G4INCL::Particle( theType , E , momentum, thePosition);
656 G4INCL::Random::SeedVector
const theInitialSeeds =
657 G4INCL::Random::getSeeds();
659 G4INCL::Random::saveSeeds();
660 G4INCL::EventInfo result;
663 result=theINCLModel->processEvent(theSpecies,pincl,EKin,fRemnA,fRemnZ,
"FSI");
666 Aresult += (fRemnA + pdgcpiontoA(sp->
Pdg())- result.ARem[0]);
667 Zresult += (fRemnZ + pdgcpiontoZ(sp->
Pdg())- result.ZRem[0]);
668 Aexception = A_i - Aresult;
669 Zexception = Z_i - Zresult;
670 bool AZexception(
false);
671 if ( Zexception <= 0 || Aexception <= 0 || Aexception<=Zexception) {
673 Zl+=pdgcpiontoZ(sp->
Pdg());
674 Aft+=pdgcpiontoA(sp->
Pdg());
680 for (
size_t it=0; it<ListeOfINCLresult.size();it++){
681 Pos=Postion_evrec.at(it);
684 theA_Remn+= (fRemnA + pdgcpiontoA(pinthenucleus->
Pdg())- ListeOfINCLresult.at(it).ARem[0]);
685 theZ_Remn+= (fRemnZ + pdgcpiontoZ(pinthenucleus->
Pdg())- ListeOfINCLresult.at(it).ZRem[0]);
686 if ( (A_i-theA_Remn-Aft) < (Z_i-theZ_Remn-Zl) ) {
687 theA_Remn-= (fRemnA + pdgcpiontoA(pinthenucleus->
Pdg())- ListeOfINCLresult.at(it).ARem[0]);
688 theZ_Remn-= (fRemnZ + pdgcpiontoZ(pinthenucleus->
Pdg())- ListeOfINCLresult.at(it).ZRem[0]);
689 Zl+=pdgcpiontoZ(pinthenucleus->
Pdg());
690 Aft+=pdgcpiontoA(pinthenucleus->
Pdg());
697 num_of_AZexception.push_back(it);
699 the_pxRemn+=ListeOfINCLresult.at(it).pxRem[0];
700 the_pyRemn+=ListeOfINCLresult.at(it).pyRem[0];
701 the_pzRemn+=ListeOfINCLresult.at(it).pzRem[0];
702 ExcitaionE+=ListeOfINCLresult.at(it).EStarRem[0];
706 for (
size_t it=0;it<num_of_AZexception.size();it++) {
707 ListeOfINCLresult.pop_back();
710 if(ListeOfINCLresult.size() != 0) {
711 int Number_of_Sec=ListeOfINCLresult.size();
713 mom1=Postion_evrec.at(0);
714 if(Number_of_Sec==1) mom2=-1;
715 if(Number_of_Sec>1) mom2=Postion_evrec.at(Number_of_Sec-1);
717 for (
size_t it=0; it<ListeOfINCLresult.size();it++){
719 if ( it < ListeOfINCLresult.size()-1 ) {
720 for (
int nP=0; nP < ListeOfINCLresult.at(it).nParticles; nP++ ) {
721 GHepParticle *p_outD = INCLtoGenieParticle(ListeOfINCLresult.at(it),
727 ListeOfINCLresult.at(it).ARem[0]=A_i-theA_Remn- Aft;
728 ListeOfINCLresult.at(it).ZRem[0]=Z_i-theZ_Remn- Zl;
730 ListeOfINCLresult.at(it).pxRem[0]= the_pxRemn + (pxRemn*1000);
731 ListeOfINCLresult.at(it).pyRem[0]= the_pyRemn + (pyRemn*1000);
732 ListeOfINCLresult.at(it).pzRem[0]= the_pzRemn + (1000*pzRemn);
733 ListeOfINCLresult.at(it).EStarRem[0]=ExcitaionE;
734 theDeExcitation->deExcite(&ListeOfINCLresult.at(it));
735 for (
int nP=0;nP<ListeOfINCLresult.at(it).nParticles;nP++ ) {
736 int rem_index=FindlargestFragment(ListeOfINCLresult.at(it));
737 if(nP==rem_index||ListeOfINCLresult.at(it).A[nP]>1) {
742 mom1=Postion_evrec.at(0);
743 if(Number_of_Sec==1) mom2=-1;
744 if(Number_of_Sec>1) mom2=Postion_evrec.at(Number_of_Sec-1);
746 GHepParticle *p_outFinal = INCLtoGenieParticle(ListeOfINCLresult.at(it),
754 ListeOfINCLresult.clear();
755 num_of_AZexception.clear();
760 if ( result.transparent ) {
761 Zl+=pdgcpiontoZ(sp->
Pdg());
762 Aft+=pdgcpiontoA(sp->
Pdg());
769 Postion_evrec.push_back(icurr);
770 ListeOfINCLresult.push_back(result);
778 if ( ListeOfINCLresult.size() != 0 ) {
779 bool AZexception=
false;
780 for (
size_t it=0; it<ListeOfINCLresult.size();it++){
781 Pos = Postion_evrec.at(it);
785 theA_Remn+= (fRemnA + pdgcpiontoA(pinthenucleus->
Pdg())- ListeOfINCLresult.at(it).ARem[0]);
786 theZ_Remn+= (fRemnZ + pdgcpiontoZ(pinthenucleus->
Pdg())- ListeOfINCLresult.at(it).ZRem[0]);
787 if ( (A_i-theA_Remn-Aft) < (Z_i-theZ_Remn-Zl) ) {
788 theA_Remn-= (fRemnA + pdgcpiontoA(pinthenucleus->
Pdg())- ListeOfINCLresult.at(it).ARem[0]);
789 theZ_Remn-= (fRemnZ + pdgcpiontoZ(pinthenucleus->
Pdg())- ListeOfINCLresult.at(it).ZRem[0]);
790 Zl+=pdgcpiontoZ(pinthenucleus->
Pdg());
791 Aft+=pdgcpiontoA(pinthenucleus->
Pdg());
797 num_of_AZexception.push_back(it);
799 the_pxRemn+=ListeOfINCLresult.at(it).pxRem[0];
800 the_pyRemn+=ListeOfINCLresult.at(it).pyRem[0];
801 the_pzRemn+=ListeOfINCLresult.at(it).pzRem[0];
802 ExcitaionE+=ListeOfINCLresult.at(it).EStarRem[0];
806 for (
size_t it=0;it<num_of_AZexception.size();it++) {
807 ListeOfINCLresult.pop_back();
809 for (
size_t it=0; it < ListeOfINCLresult.size(); it++) {
812 ListeOfINCLresult.at(it).pxRem[0] += pxRemn*1000;
813 ListeOfINCLresult.at(it).pyRem[0] += pyRemn*1000;
814 ListeOfINCLresult.at(it).pzRem[0] += 1000*pzRemn;
815 if ( theDeExcitation != 0 ) theDeExcitation->deExcite(&ListeOfINCLresult.at(it));
816 int rem_index=FindlargestFragment(ListeOfINCLresult.at(it));
818 for (
int nP=0; nP < ListeOfINCLresult.at(it).nParticles; nP++ ) {
820 if(nP==rem_index) Pos=inucl;
821 else if(nP!=rem_index) Pos=Postion_evrec.at(it);
822 GHepParticle *p_out = INCLtoGenieParticle(ListeOfINCLresult.at(it),
828 if ( it < ListeOfINCLresult.size()-1 ) {
829 for (
int nP=0; nP < ListeOfINCLresult.at(it).nParticles; nP++ ) {
830 A_f+=ListeOfINCLresult.at(it).
A[nP];
831 Z_f+=ListeOfINCLresult.at(it).Z[nP];
832 if(ListeOfINCLresult.at(it).A[nP]>1) {
837 mother1=Postion_evrec.at(0);
838 if(ListeOfINCLresult.size()==1) mother2=-1;
839 else if(ListeOfINCLresult.size()>1){
840 mother2=Postion_evrec.at(ListeOfINCLresult.size()-1);
849 ListeOfINCLresult.at(it).ARem[0]=A_i-theA_Remn-Aft;
850 ListeOfINCLresult.at(it).ZRem[0]=Z_i-theZ_Remn-Zl;
851 ListeOfINCLresult.at(it).pxRem[0]= the_pxRemn + (pxRemn*1000);
852 ListeOfINCLresult.at(it).pyRem[0]= the_pyRemn + (pyRemn*1000);
853 ListeOfINCLresult.at(it).pzRem[0]= the_pzRemn + (1000*pzRemn);
854 ListeOfINCLresult.at(it).EStarRem[0]=ExcitaionE;
855 if ( theDeExcitation != 0 ) theDeExcitation->deExcite(&ListeOfINCLresult.at(it));
856 int rem_index=FindlargestFragment(ListeOfINCLresult.at(it));
857 for (
int nP=0; nP < ListeOfINCLresult.at(it).nParticles; nP++ ) {
858 A_f+=ListeOfINCLresult.at(it).
A[nP];
859 Z_f+=ListeOfINCLresult.at(it).Z[nP];
860 if(nP==rem_index||ListeOfINCLresult.at(it).A[nP]>1) {
865 mother1=Postion_evrec.at(0);
866 if(ListeOfINCLresult.size()==1) mother2=-1;
867 else if(ListeOfINCLresult.size()>1){
868 mother2=Postion_evrec.at(ListeOfINCLresult.size()-1);
871 GHepParticle *p_outR = INCLtoGenieParticle(ListeOfINCLresult.at(it),
882 if ( ListeOfINCLresult.size() == 0 && !has_remnant) {
887 <<
"NO Particle with pdg = " << pdg_codeTargetRemn <<
" in PDGLibrary!";
898 int dau1(0), dau2(0),Nsec=ListeOfINCLresult.size();
903 for(
int ii=1;ii<Nsec;ii++){
904 evrec->
Particle(Postion_evrec.at(ii))->SetFirstDaughter(dau1);
905 evrec->
Particle(Postion_evrec.at(ii))->SetLastDaughter(dau2);
911 int HINCLCascadeIntranuke::pdgcpiontoA(
int pdgc)
const {
913 if ( pdgc == 2212 || pdgc == 2112 )
return 1;
914 else if ( pdgc == 211 || pdgc == -211 || pdgc == 111 )
return 0;
920 int HINCLCascadeIntranuke::pdgcpiontoZ(
int pdgc)
const {
922 if ( pdgc == 2212 || pdgc == 211 )
return 1;
923 else if ( pdgc == 2112 || pdgc == 111 )
return 0;
924 else if ( pdgc == -211 )
return -1;
930 bool HINCLCascadeIntranuke::NeedsRescattering(
const GHepParticle * p)
const {
943 <<
"Configure from Registry: '" << config.
Name() <<
"'\n"
955 <<
"Configure from param_set name: " << param_set;
962 #endif // __GENIE_INCL_ENABLED__
void SetFirstMother(int m)
virtual GHepParticle * Particle(int position) const
TLorentzVector * GetX4(void) const
double E(void) const
Get energy.
virtual Interaction * Summary(void) const
const TLorentzVector * P4(void) const
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
int FirstDaughter(void) const
const int kPdgHadronicBlob
virtual int RemnantNucleusPosition(void) const
bool IsQuasiElastic(void) const
double Pz(void) const
Get Pz.
GHepStatus_t Status(void) const
virtual GHepParticle * Probe(void) const
int FirstMother(void) const
string Name(void) const
get the registry name
string Name(void) const
Name that corresponds to the PDG code.
int LastDaughter(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
virtual GHepParticle * FinalStatePrimaryLepton(void) const
virtual void Configure(const Registry &config)
GEvGenMode_t EventGenerationMode(void) const
double Charge(void) const
Chrg that corresponds to the PDG code.
static PDGLibrary * Instance(void)
vector< string > Split(string input, string delim)
bool DirectoryExists(const char *path)
void SetStatus(GHepStatus_t s)
A registry. Provides the container for algorithm configuration parameters.
void Configure(string mesg)
int IonPdgCode(int A, int Z)
virtual void AddParticle(const GHepParticle &p)
const ProcessInfo & ProcInfo(void) const
TParticlePDG * Find(int pdgc, bool must_exist=true)
GENIE's GHEP MC event record.
STDHEP-like event record entry that can fit a particle or a nucleus.
virtual int TargetNucleusPosition(void) const
enum genie::EGHepStatus GHepStatus_t