Interaction.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
7  University of Liverpool & STFC Rutherford Appleton Laboratory
8 
9  Changes required to implement the GENIE Boosted Dark Matter module
10  were installed by Josh Berger (Univ. of Wisconsin)
11 
12  Changes required to implement the GENIE Dark Neutrino module
13  were installed by Iker de Icaza (Univ. of Sussex)
14 */
15 //____________________________________________________________________________
16 
17 #include <sstream>
18 
19 #include <TRootIOCtor.h>
20 
27 
28 using namespace genie;
29 using namespace genie::constants;
30 
31 using std::endl;
32 using std::ostringstream;
33 
35 
36 //____________________________________________________________________________
37 namespace genie {
38  ostream & operator<< (ostream& stream, const Interaction & interaction)
39  {
40  interaction.Print(stream);
41  return stream;
42  }
43 }
44 //___________________________________________________________________________
46 TObject()
47 {
48  this->Init();
49 }
50 //___________________________________________________________________________
52 TObject()
53 {
54  this->Init();
55 
56  fInitialState -> Copy (ist);
57  fProcInfo -> Copy (prc);
58 }
59 //___________________________________________________________________________
61 TObject()
62 {
63  this->Init();
64  this->Copy(interaction);
65 }
66 //___________________________________________________________________________
67 Interaction::Interaction(TRootIOCtor*) :
68 TObject(),
69 fInitialState(0),
70 fProcInfo(0),
71 fKinematics(0),
72 fExclusiveTag(0),
73 fKinePhSp(0)
74 {
75 
76 }
77 //___________________________________________________________________________
79 {
80  this->CleanUp();
81 }
82 //___________________________________________________________________________
84 {
85  this->CleanUp();
86  this->Init();
87 }
88 //___________________________________________________________________________
90 {
91  fInitialState = new InitialState ();
92  fProcInfo = new ProcessInfo ();
93  fKinematics = new Kinematics ();
94  fExclusiveTag = new XclsTag ();
95  fKinePhSp = new KPhaseSpace (this);
96 }
97 //___________________________________________________________________________
99 {
100  if ( fInitialState ) delete fInitialState;
101  if ( fProcInfo ) delete fProcInfo;
102  if ( fKinematics ) delete fKinematics;
103  if ( fExclusiveTag ) delete fExclusiveTag;
104  if ( fKinePhSp ) delete fKinePhSp;
105 
106  fInitialState = 0;
107  fProcInfo = 0;
108  fKinematics = 0;
109  fExclusiveTag = 0;
110  fKinePhSp = 0;
111 }
112 //___________________________________________________________________________
114 {
115  const InitialState & init = *interaction.fInitialState;
116  const ProcessInfo & proc = *interaction.fProcInfo;
117  const Kinematics & kine = *interaction.fKinematics;
118  const XclsTag & xcls = *interaction.fExclusiveTag;
119 
120  fInitialState -> Copy (init);
121  fProcInfo -> Copy (proc);
122  fKinematics -> Copy (kine);
123  fExclusiveTag -> Copy (xcls);
124 }
125 //___________________________________________________________________________
126 TParticlePDG * Interaction::FSPrimLepton(void) const
127 {
128  int pdgc = this->FSPrimLeptonPdg();
129 
130  if(pdgc) return PDGLibrary::Instance()->Find(pdgc);
131  else return 0;
132 }
133 //___________________________________________________________________________
135 {
136  const ProcessInfo & proc_info = this -> ProcInfo();
137  const InitialState & init_state = this -> InitState();
138  const XclsTag & xclstag = this -> ExclTag();
139 
140  int pdgc = init_state.ProbePdg();
141 
142  LOG("Interaction", pDEBUG) << "Probe PDG code: " << pdgc;
143 
144  if (proc_info.IsNuElectronElastic())
145  return kPdgElectron;
146 
147  // vN (Weak-NC) or eN (EM)
148  if (proc_info.IsWeakNC() || proc_info.IsEM() || proc_info.IsWeakMix() || proc_info.IsDarkMatter()) return pdgc; // EDIT: DM does not change in FS
149 
150  // vN (Weak-CC)
151  else if (proc_info.IsWeakCC()) {
152  int clpdgc;
153  if (proc_info.IsIMDAnnihilation())
154  clpdgc = kPdgMuon;
155  else if (proc_info.IsGlashowResonance()) {
156  if ( pdg::IsMuon(xclstag.FinalLeptonPdg()) ) clpdgc = kPdgMuon;
157  else if ( pdg::IsTau(xclstag.FinalLeptonPdg()) ) clpdgc = kPdgTau;
158  else if ( pdg::IsElectron(xclstag.FinalLeptonPdg()) ) clpdgc = kPdgElectron;
159  else if ( pdg::IsPion(xclstag.FinalLeptonPdg()) ) clpdgc = kPdgPiP;
160  }
161  else
162  clpdgc = pdg::Neutrino2ChargedLepton(pdgc);
163  return clpdgc;
164  }
165  else if (proc_info.IsDarkNeutralCurrent()){
166  return kPdgDarkNeutrino;
167  }
168  LOG("Interaction", pWARN)
169  << "Could not figure out the final state primary lepton pdg code!!";
170 
171  return 0;
172 }
173 //___________________________________________________________________________
174 TParticlePDG * Interaction::RecoilNucleon(void) const
175 {
176  int rnuc = this->RecoilNucleonPdg();
177 
178  if(rnuc) return PDGLibrary::Instance()->Find(rnuc);
179  else return 0;
180 }
181 //___________________________________________________________________________
183 {
184 // Determine the recoil nucleon PDG code
185 
186  const Target & target = fInitialState->Tgt();
187 
188  int recoil_nuc = 0;
189  int struck_nuc = target.HitNucPdg();
190 
192  bool struck_is_nuc = pdg::IsNucleon(struck_nuc);
193  bool is_weak = fProcInfo->IsWeak();
194  bool is_em = fProcInfo->IsEM();
195  bool is_dm = fProcInfo->IsDarkMatter();
196  assert(struck_is_nuc && (is_weak || is_em || is_dm));
197  if(fProcInfo->IsWeakCC()) {
198  recoil_nuc = pdg::SwitchProtonNeutron(struck_nuc); // CC
199  } else {
200  recoil_nuc = struck_nuc; // NC, EM
201  }
202  }
203 
204  if (fProcInfo->IsMEC()) {
205  bool struck_is_2nuc_cluster = pdg::Is2NucleonCluster(struck_nuc);
206  bool is_weak = fProcInfo->IsWeak();
207  bool is_em = fProcInfo->IsEM();
208  assert(struck_is_2nuc_cluster && (is_weak || is_em));
209  if(fProcInfo->IsWeakCC()) {
210  bool isnu = pdg::IsNeutrino(fInitialState->ProbePdg());
211  // nucleon cluster charge should be incremented by +1 for
212  // neutrino CC and by -1 for antineutrino CC
213  int dQ = (isnu) ? +1 : -1;
214  recoil_nuc = pdg::ModifyNucleonCluster(struck_nuc,dQ); // CC
215  }
216  else {
217  recoil_nuc = struck_nuc; // NC, EM
218  }
219  }
220 
221  LOG("Interaction", pDEBUG) << "Recoil nucleon PDG = " << recoil_nuc;
222  return recoil_nuc;
223 }
224 //___________________________________________________________________________
225 void Interaction::SetInitState(const InitialState & init_state)
226 {
228  fInitialState->Copy(init_state);
229 }
230 //___________________________________________________________________________
231 void Interaction::SetProcInfo(const ProcessInfo & proc_info)
232 {
233  if (!fProcInfo) fProcInfo = new ProcessInfo();
234  fProcInfo->Copy(proc_info);
235 }
236 //___________________________________________________________________________
237 void Interaction::SetKine(const Kinematics & kinematics)
238 {
239  if (!fKinematics) fKinematics = new Kinematics();
240  fKinematics->Copy(kinematics);
241 }
242 //___________________________________________________________________________
243 void Interaction::SetExclTag(const XclsTag & xcls_tag)
244 {
245  if (!fExclusiveTag) fExclusiveTag = new XclsTag();
246  fExclusiveTag->Copy(xcls_tag);
247 }
248 //___________________________________________________________________________
249 string Interaction::AsString(void) const
250 {
251 // Code-ify the interaction in a string to be used as (part of a) cache
252 // branch key.
253 // Template:
254 // nu:x;tgt:x;N:x;q:x(s/v);proc:x;xclv_tag
255 
256  const Target & tgt = fInitialState->Tgt();
257 
258  ostringstream interaction;
259 
260  // If the probe has non-zero mass, then it is DM
261  if (fInitialState->Probe()->PdgCode() == kPdgDarkMatter) {
262  interaction << "dm;";
263  }
264  else if (fInitialState->Probe()->PdgCode() == kPdgAntiDarkMatter) {
265  interaction << "dmb;";
266  }
267  else {
268  interaction << "nu:" << fInitialState->ProbePdg() << ";";
269  }
270  interaction << "tgt:" << tgt.Pdg() << ";";
271 
272  if(tgt.HitNucIsSet()) {
273  interaction << "N:" << tgt.HitNucPdg() << ";";
274  }
275  if(tgt.HitQrkIsSet()) {
276  interaction << "q:" << tgt.HitQrkPdg()
277  << (tgt.HitSeaQrk() ? "(s)" : "(v)") << ";";
278  }
279 
280  interaction << "proc:" << fProcInfo->InteractionTypeAsString()
281  << "," << fProcInfo->ScatteringTypeAsString() << ";";
282 
283  string xcls = fExclusiveTag->AsString();
284  interaction << xcls;
285  if(xcls.size()>0) interaction << ";";
286 
287  return interaction.str();
288 }
289 //___________________________________________________________________________
290 void Interaction::Print(ostream & stream) const
291 {
292  const string line(110, '-');
293 
294  stream << endl;
295  stream << line << endl;
296 
297  stream << "GENIE Interaction Summary" << endl;
298  stream << line << endl;
299 
300  stream << *fInitialState << endl; // print initial state
301  stream << *fProcInfo; // print process info
302  stream << *fKinematics; // print scattering parameters
303  stream << *fExclusiveTag; // print exclusive process tag
304 
305  stream << line << endl;
306 }
307 //___________________________________________________________________________
309 {
310  this->Copy(interaction);
311  return (*this);
312 }
313 //___________________________________________________________________________
314 //
315 // **** Methods using the "named constructor" C++ idiom ****
316 //
317 //___________________________________________________________________________
319  int target, int probe, ScatteringType_t st, InteractionType_t it)
320 {
321  InitialState init_state (target, probe);
322  ProcessInfo proc_info (st, it);
323 
324  Interaction * interaction = new Interaction(init_state, proc_info);
325  return interaction;
326 }
327 //___________________________________________________________________________
328 Interaction * Interaction::DISCC(int target, int hitnuc, int probe, double E)
329 {
332 
333  InitialState * init_state = interaction->InitStatePtr();
334  init_state->SetProbeE(E);
335  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
336 
337  return interaction;
338 }
339 //___________________________________________________________________________
341  int target, int hitnuc, int hitqrk, bool fromsea, int probe, double E)
342 {
343  Interaction* interaction = Interaction::DISCC(target,hitnuc,probe,E);
344 
345  Target * tgt = interaction->InitStatePtr()->TgtPtr();
346  tgt -> SetHitQrkPdg (hitqrk);
347  tgt -> SetHitSeaQrk (fromsea);
348 
349  return interaction;
350 }
351 //___________________________________________________________________________
353  int target, int hitnuc, int hitqrk, bool fromsea, int fqrk, int probe, double E)
354 {
355  Interaction* interaction = Interaction::DISCC(target,hitnuc,probe,E);
356 
357  Target * tgt = interaction->InitStatePtr()->TgtPtr();
358  tgt -> SetHitQrkPdg (hitqrk);
359  tgt -> SetHitSeaQrk (fromsea);
360 
361  XclsTag * xclstag = interaction->ExclTagPtr();
362  xclstag->SetFinalQuark(fqrk);
363 
364  return interaction;
365 }
366 //___________________________________________________________________________
368  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
369 {
372 
373  InitialState * init_state = interaction->InitStatePtr();
374  init_state->SetProbeP4(p4probe);
375  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
376 
377  return interaction;
378 }
379 //___________________________________________________________________________
381  int target, int hitnuc, int hitqrk, bool fromsea, int probe,
382  const TLorentzVector & p4probe)
383 {
384  Interaction* interaction = Interaction::DISCC(target,hitnuc,probe,p4probe);
385 
386  Target * tgt = interaction->InitStatePtr()->TgtPtr();
387  tgt -> SetHitQrkPdg (hitqrk);
388  tgt -> SetHitSeaQrk (fromsea);
389 
390  return interaction;
391 }
392 //___________________________________________________________________________
393 Interaction * Interaction::DISNC(int target, int hitnuc, int probe, double E)
394 {
397 
398  InitialState * init_state = interaction->InitStatePtr();
399  init_state->SetProbeE(E);
400  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
401 
402  return interaction;
403 }
404 //___________________________________________________________________________
406  int target, int hitnuc, int hitqrk, bool fromsea, int probe, double E)
407 {
408  Interaction* interaction = Interaction::DISNC(target,hitnuc,probe,E);
409 
410  Target * tgt = interaction->InitStatePtr()->TgtPtr();
411  tgt -> SetHitQrkPdg (hitqrk);
412  tgt -> SetHitSeaQrk (fromsea);
413 
414  return interaction;
415 }
416 //___________________________________________________________________________
418  int target, int hitnuc, int hitqrk, bool fromsea, int fqrk, int probe, double E)
419 {
420  Interaction* interaction = Interaction::DISNC(target,hitnuc,probe,E);
421 
422  Target * tgt = interaction->InitStatePtr()->TgtPtr();
423  tgt -> SetHitQrkPdg (hitqrk);
424  tgt -> SetHitSeaQrk (fromsea);
425 
426  XclsTag * xclstag = interaction->ExclTagPtr();
427  xclstag->SetFinalQuark(fqrk);
428 
429  return interaction;
430 }
431 //___________________________________________________________________________
433  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
434 {
437 
438  InitialState * init_state = interaction->InitStatePtr();
439  init_state->SetProbeP4(p4probe);
440  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
441 
442  return interaction;
443 }
444 //___________________________________________________________________________
446  int target, int hitnuc, int hitqrk, bool fromsea, int probe,
447  const TLorentzVector & p4probe)
448 {
449  Interaction * interaction = Interaction::DISNC(target,hitnuc,probe,p4probe);
450 
451  Target * tgt = interaction->InitStatePtr()->TgtPtr();
452  tgt -> SetHitQrkPdg (hitqrk);
453  tgt -> SetHitSeaQrk (fromsea);
454 
455  return interaction;
456 }
457 //___________________________________________________________________________
458 Interaction * Interaction::DISEM(int target, int hitnuc, int probe, double E)
459 {
462 
463  InitialState * init_state = interaction->InitStatePtr();
464  init_state->SetProbeE(E);
465  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
466 
467  return interaction;
468 }
469 //___________________________________________________________________________
471  int target, int hitnuc, int hitqrk, bool fromsea, int probe, double E)
472 {
473  Interaction* interaction = Interaction::DISEM(target,hitnuc,probe,E);
474 
475  Target * tgt = interaction->InitStatePtr()->TgtPtr();
476  tgt -> SetHitQrkPdg (hitqrk);
477  tgt -> SetHitSeaQrk (fromsea);
478 
479  return interaction;
480 }
481 //___________________________________________________________________________
483  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
484 {
487 
488  InitialState * init_state = interaction->InitStatePtr();
489  init_state->SetProbeP4(p4probe);
490  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
491 
492  return interaction;
493 }
494 //___________________________________________________________________________
496  int target, int hitnuc, int hitqrk, bool fromsea, int probe,
497  const TLorentzVector & p4probe)
498 {
499  Interaction * interaction = Interaction::DISEM(target,hitnuc,probe,p4probe);
500 
501  Target * tgt = interaction->InitStatePtr()->TgtPtr();
502  tgt -> SetHitQrkPdg (hitqrk);
503  tgt -> SetHitSeaQrk (fromsea);
504 
505  return interaction;
506 }
507 //___________________________________________________________________________
508 Interaction * Interaction::QELCC(int target, int hitnuc, int probe, double E)
509 {
512 
513  InitialState * init_state = interaction->InitStatePtr();
514  init_state->SetProbeE(E);
515  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
516 
517  return interaction;
518 }
519 //___________________________________________________________________________
521  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
522 {
525 
526  InitialState * init_state = interaction->InitStatePtr();
527  init_state->SetProbeP4(p4probe);
528  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
529 
530  return interaction;
531 }
532 //___________________________________________________________________________
533 Interaction * Interaction::QELNC(int target, int hitnuc, int probe, double E)
534 {
537 
538  InitialState * init_state = interaction->InitStatePtr();
539  init_state->SetProbeE(E);
540  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
541 
542  return interaction;
543 }
544 //___________________________________________________________________________
546  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
547 {
550 
551  InitialState * init_state = interaction->InitStatePtr();
552  init_state->SetProbeP4(p4probe);
553  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
554 
555  return interaction;
556 }
557 //___________________________________________________________________________
558 Interaction * Interaction::QELEM(int target, int hitnuc, int probe, double E)
559 {
562 
563  InitialState * init_state = interaction->InitStatePtr();
564  init_state->SetProbeE(E);
565  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
566 
567  return interaction;
568 }
569 //___________________________________________________________________________
571  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
572 {
575 
576  InitialState * init_state = interaction->InitStatePtr();
577  init_state->SetProbeP4(p4probe);
578  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
579 
580  return interaction;
581 }
582 //___________________________________________________________________________
583 Interaction * Interaction::IBD(int target, int hitnuc, int probe, double E)
584 {
587 
588  InitialState * init_state = interaction->InitStatePtr();
589  init_state->SetProbeE(E);
590  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
591 
592  return interaction;
593 }
594 //___________________________________________________________________________
596  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
597 {
600 
601  InitialState * init_state = interaction->InitStatePtr();
602  init_state->SetProbeP4(p4probe);
603  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
604 
605  return interaction;
606 }
607 //___________________________________________________________________________
608 Interaction * Interaction::RESCC(int target, int hitnuc, int probe, double E)
609 {
612 
613  InitialState * init_state = interaction->InitStatePtr();
614  init_state->SetProbeE(E);
615  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
616 
617  return interaction;
618 }
619 //___________________________________________________________________________
621  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
622 {
625 
626  InitialState * init_state = interaction->InitStatePtr();
627  init_state->SetProbeP4(p4probe);
628  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
629 
630  return interaction;
631 }
632 //___________________________________________________________________________
633 Interaction * Interaction::RESNC(int target, int hitnuc, int probe, double E)
634 {
637 
638  InitialState * init_state = interaction->InitStatePtr();
639  init_state->SetProbeE(E);
640  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
641 
642  return interaction;
643 }
644 //___________________________________________________________________________
646  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
647 {
650 
651  InitialState * init_state = interaction->InitStatePtr();
652  init_state->SetProbeP4(p4probe);
653  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
654 
655  return interaction;
656 }
657 //___________________________________________________________________________
658 Interaction * Interaction::RESEM(int target, int hitnuc, int probe, double E)
659 {
661  Interaction::Create(target,probe,kScResonant, kIntEM);
662 
663  InitialState * init_state = interaction->InitStatePtr();
664  init_state->SetProbeE(E);
665  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
666 
667  return interaction;
668 }
669 //___________________________________________________________________________
671  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
672 {
674  Interaction::Create(target,probe,kScResonant, kIntEM);
675 
676  InitialState * init_state = interaction->InitStatePtr();
677  init_state->SetProbeP4(p4probe);
678  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
679 
680  return interaction;
681 }
682 //___________________________________________________________________________
683 Interaction * Interaction::DFRCC(int tgt,int hitnuc, int probe, double E)
684 {
687 
688  InitialState * init_state = interaction->InitStatePtr();
689  init_state->SetProbeE(E);
690  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
691 
692  return interaction;
693 }
694 //___________________________________________________________________________
696  int tgt, int hitnuc, int probe, const TLorentzVector & p4probe)
697 {
700 
701  InitialState * init_state = interaction->InitStatePtr();
702  init_state->SetProbeP4(p4probe);
703  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
704 
705  return interaction;
706 }
707 //___________________________________________________________________________
708 Interaction * Interaction::COHCC(int tgt, int probe, unsigned int prod_pdg, double E)
709 {
712 
713  XclsTag * xcl = interaction -> ExclTagPtr() ;
714  if ( pdg::IsPion( prod_pdg ) ) {
715  if ( pdg::IsNeutrino( probe ) ) xcl -> SetNPions( 1,0,0 ) ;
716  else if ( pdg::IsAntiNeutrino( probe ) ) xcl -> SetNPions( 0,0,1 ) ;
717  }
718 
719  InitialState * init_state = interaction->InitStatePtr();
720  init_state->SetProbeE(E);
721 
722  return interaction;
723 }
724 //___________________________________________________________________________
726  int tgt, int probe, unsigned int prod_pdg, const TLorentzVector & p4probe)
727 {
730 
731  XclsTag * xcl = interaction -> ExclTagPtr() ;
732  if ( pdg::IsPion( prod_pdg ) ) {
733  if ( pdg::IsNeutrino( probe ) ) xcl -> SetNPions( 1,0,0 ) ;
734  else if ( pdg::IsAntiNeutrino( probe ) ) xcl -> SetNPions( 0,0,1 ) ;
735  }
736 
737  InitialState * init_state = interaction->InitStatePtr();
738  init_state->SetProbeP4(p4probe);
739 
740  return interaction;
741 }
742 //___________________________________________________________________________
743 Interaction * Interaction::COHNC(int tgt, int probe, unsigned int prod_pdg, double E)
744 {
747 
748  XclsTag * xcl = interaction -> ExclTagPtr() ;
749  if ( pdg::IsPion( prod_pdg ) ) xcl -> SetNPions( 0,1,0 ) ;
750  else if ( prod_pdg == kPdgGamma ) xcl -> SetNSingleGammas(1) ;
751 
752  InitialState * init_state = interaction->InitStatePtr();
753  init_state->SetProbeE(E);
754 
755  return interaction;
756 }
757 //___________________________________________________________________________
759  int tgt, int probe, unsigned int prod_pdg, const TLorentzVector & p4probe)
760 {
763 
764  XclsTag * xcl = interaction -> ExclTagPtr() ;
765  if ( pdg::IsPion( prod_pdg ) ) xcl -> SetNPions( 0,1,0 ) ;
766  else if ( prod_pdg == kPdgGamma ) xcl -> SetNSingleGammas(1) ;
767 
768  InitialState * init_state = interaction->InitStatePtr();
769  init_state->SetProbeP4(p4probe);
770 
771  return interaction;
772 }
773 //___________________________________________________________________________
774 Interaction * Interaction::CEvNS(int tgt, int probe, double E)
775 {
778 
779  InitialState * init_state = interaction->InitStatePtr();
780  init_state->SetProbeE(E);
781 
782  return interaction;
783 }
784 //___________________________________________________________________________
786  int tgt, int probe, const TLorentzVector & p4probe)
787 {
790 
791  InitialState * init_state = interaction->InitStatePtr();
792  init_state->SetProbeP4(p4probe);
793 
794  return interaction;
795 }
796 //___________________________________________________________________________
798 {
801 
802  InitialState * init_state = interaction->InitStatePtr();
803  init_state->SetProbeE(E);
804 
805  return interaction;
806 }
807 //___________________________________________________________________________
808 Interaction * Interaction::IMD(int target, const TLorentzVector & p4probe)
809 {
812 
813  InitialState * init_state = interaction->InitStatePtr();
814  init_state->SetProbeP4(p4probe);
815 
816  return interaction;
817 }
818 //___________________________________________________________________________
819 Interaction * Interaction::AMNuGamma(int tgt, int nuc, int probe, double E)
820 {
823 
824  InitialState * init_state = interaction->InitStatePtr();
825  init_state->SetProbeE(E);
826  init_state->TgtPtr()->SetHitNucPdg(nuc);
827 
828  return interaction;
829 }
830 //___________________________________________________________________________
832  int tgt, int nuc, int probe, const TLorentzVector & p4probe)
833 {
836 
837  InitialState * init_state = interaction->InitStatePtr();
838  init_state->SetProbeP4(p4probe);
839  init_state->TgtPtr()->SetHitNucPdg(nuc);
840 
841  return interaction;
842 }
843 //___________________________________________________________________________
844 Interaction * Interaction::MECCC(int tgt, int ncluster, int probe, double E)
845 {
847  Interaction::Create(tgt, probe, kScMEC, kIntWeakCC);
848 
849  InitialState * init_state = interaction->InitStatePtr();
850  init_state->SetProbeE(E);
851  init_state->TgtPtr()->SetHitNucPdg(ncluster);
852 
853  return interaction;
854 }
855 //___________________________________________________________________________
857  int tgt, int ncluster, int probe, const TLorentzVector & p4probe)
858 {
860  Interaction::Create(tgt, probe, kScMEC, kIntWeakCC);
861 
862  InitialState * init_state = interaction->InitStatePtr();
863  init_state->SetProbeP4(p4probe);
864  init_state->TgtPtr()->SetHitNucPdg(ncluster);
865 
866  return interaction;
867 }
868 //___________________________________________________________________________
869 Interaction * Interaction::MECCC(int tgt, int probe, double E)
870 {
872  Interaction::Create(tgt, probe, kScMEC, kIntWeakCC);
873 
874  InitialState * init_state = interaction->InitStatePtr();
875  init_state->SetProbeE(E);
876 
877  return interaction;
878 }
879 //___________________________________________________________________________
881  int tgt, int probe, const TLorentzVector & p4probe)
882 {
884  Interaction::Create(tgt, probe, kScMEC, kIntWeakCC);
885 
886  InitialState * init_state = interaction->InitStatePtr();
887  init_state->SetProbeP4(p4probe);
888 
889  return interaction;
890 }
891 
892 //___________________________________________________________________________
893 Interaction * Interaction::MECNC(int tgt, int ncluster, int probe, double E)
894 {
896  Interaction::Create(tgt, probe, kScMEC, kIntWeakNC);
897 
898  InitialState * init_state = interaction->InitStatePtr();
899  init_state->SetProbeE(E);
900  init_state->TgtPtr()->SetHitNucPdg(ncluster);
901 
902  return interaction;
903 }
904 //___________________________________________________________________________
906  int tgt, int ncluster, int probe, const TLorentzVector & p4probe)
907 {
909  Interaction::Create(tgt, probe, kScMEC, kIntWeakNC);
910 
911  InitialState * init_state = interaction->InitStatePtr();
912  init_state->SetProbeP4(p4probe);
913  init_state->TgtPtr()->SetHitNucPdg(ncluster);
914 
915  return interaction;
916 }
917 //___________________________________________________________________________
918 Interaction * Interaction::MECEM(int tgt, int probe, double E)
919 {
920 
922  Interaction::Create(tgt, probe, kScMEC, kIntEM);
923 
924  InitialState * init_state = interaction->InitStatePtr();
925  init_state->SetProbeE(E);
926 
927  return interaction;
928 }
929 //___________________________________________________________________________
930 Interaction * Interaction::MECEM(int tgt, int ncluster, int probe, double E)
931 {
933  Interaction::Create(tgt, probe, kScMEC, kIntEM);
934 
935  InitialState * init_state = interaction->InitStatePtr();
936  init_state->SetProbeE(E);
937  init_state->TgtPtr()->SetHitNucPdg(ncluster);
938 
939  return interaction;
940 }
941 //___________________________________________________________________________
943  int tgt, int ncluster, int probe, const TLorentzVector & p4probe)
944 {
946  Interaction::Create(tgt, probe, kScMEC, kIntEM);
947 
948  InitialState * init_state = interaction->InitStatePtr();
949  init_state->SetProbeP4(p4probe);
950  init_state->TgtPtr()->SetHitNucPdg(ncluster);
951 
952  return interaction;
953 }
954 //___________________________________________________________________________
955 Interaction * Interaction::GLR(int tgt, double E)
956 {
959 
960  InitialState * init_state = interaction->InitStatePtr();
961  init_state->SetProbeE(E);
962  init_state->TgtPtr()->SetHitNucPdg(0);
963 
964  return interaction;
965 }
966 //___________________________________________________________________________
967 Interaction * Interaction::GLR(int tgt, const TLorentzVector & p4probe)
968 {
971 
972  InitialState * init_state = interaction->InitStatePtr();
973  init_state->SetProbeP4(p4probe);
974  init_state->TgtPtr()->SetHitNucPdg(0);
975 
976  return interaction;
977 }
978 //___________________________________________________________________________
979 Interaction * Interaction::NDecay(int tgt, int decay_mode, int decayed_nucleon)
980 {
983  interaction->ExclTagPtr()->SetDecayMode(decay_mode);
984 
985  InitialState * init_state = interaction->InitStatePtr();
986  init_state->TgtPtr()->SetHitNucPdg(decayed_nucleon);
987 
988  return interaction;
989 }
990 //___________________________________________________________________________
991 Interaction * Interaction::NOsc(int tgt, int annihilation_mode)
992 {
995  interaction->ExclTagPtr()->SetDecayMode(annihilation_mode);
996  return interaction;
997 }
998 //___________________________________________________________________________
999 Interaction * Interaction::NHL(double E, int decayed_mode)
1000 {
1003  interaction->ExclTagPtr()->SetDecayMode(decayed_mode);
1004 
1005  InitialState * init_state = interaction->InitStatePtr();
1006  init_state->SetProbeE(E);
1007 
1008  return interaction;
1009 }
1010 //___________________________________________________________________________
1011 Interaction * Interaction::ASK(int tgt, int probe, double E)
1012 {
1015 
1016  InitialState * init_state = interaction->InitStatePtr();
1017  init_state->SetProbeE(E);
1018 
1019  return interaction;
1020 }
1021 //___________________________________________________________________________
1023  int tgt, int probe, const TLorentzVector & p4probe)
1024 {
1027 
1028  InitialState * init_state = interaction->InitStatePtr();
1029  init_state->SetProbeP4(p4probe);
1030 
1031  return interaction;
1032 }
1033 //___________________________________________________________________________
1034 Interaction * Interaction::DME(int target, int hitnuc, int probe, double E)
1035 {
1036  // EDIT: need to be able to create dark matter elastic
1039 
1040  InitialState * init_state = interaction->InitStatePtr();
1041  init_state->SetProbeE(E);
1042  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
1043 
1044  return interaction;
1045 }
1046 //___________________________________________________________________________
1048  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
1049 {
1050  // EDIT: need to be able to create dark matter elastic
1053 
1054  InitialState * init_state = interaction->InitStatePtr();
1055  init_state->SetProbeP4(p4probe);
1056  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
1057 
1058  return interaction;
1059 }
1060 //___________________________________________________________________________
1061 Interaction * Interaction::DMDI(int target, int hitnuc, int probe, double E)
1062 {
1065 
1066  InitialState * init_state = interaction->InitStatePtr();
1067  init_state->SetProbeE(E);
1068  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
1069 
1070  return interaction;
1071 }
1072 //___________________________________________________________________________
1074  int target, int hitnuc, int hitqrk, bool fromsea, int probe, double E)
1075 {
1076  Interaction* interaction = Interaction::DMDI(target,hitnuc,probe,E);
1077 
1078  Target * tgt = interaction->InitStatePtr()->TgtPtr();
1079  tgt -> SetHitQrkPdg (hitqrk);
1080  tgt -> SetHitSeaQrk (fromsea);
1081 
1082  return interaction;
1083 }
1084 //___________________________________________________________________________
1086  int target, int hitnuc, int probe, const TLorentzVector & p4probe)
1087 {
1090 
1091  InitialState * init_state = interaction->InitStatePtr();
1092  init_state->SetProbeP4(p4probe);
1093  init_state->TgtPtr()->SetHitNucPdg(hitnuc);
1094 
1095  return interaction;
1096 }
1097 //___________________________________________________________________________
1099  int target, int hitnuc, int hitqrk, bool fromsea, int probe,
1100  const TLorentzVector & p4probe)
1101 {
1102  Interaction * interaction = Interaction::DMDI(target,hitnuc,probe,p4probe);
1103 
1104  Target * tgt = interaction->InitStatePtr()->TgtPtr();
1105  tgt -> SetHitQrkPdg (hitqrk);
1106  tgt -> SetHitSeaQrk (fromsea);
1107 
1108  return interaction;
1109 }
bool IsPion(int pdgc)
Definition: PDGUtils.cxx:323
Basic constants.
bool IsWeak(void) const
static Interaction * IMD(int tgt, double E=0)
bool IsWeakMix(void) const
bool HitSeaQrk(void) const
Definition: Target.cxx:299
bool IsWeakCC(void) const
int FinalLeptonPdg(void) const
Definition: XclsTag.h:74
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
void SetProbeP4(const TLorentzVector &P4)
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
static Interaction * DME(int tgt, int nuc, int probe, double E=0)
string ScatteringTypeAsString(void) const
static Interaction * GLR(int tgt, double E=0)
int HitNucPdg(void) const
Definition: Target.cxx:304
TParticlePDG * RecoilNucleon(void) const
recoil nucleon
bool IsDarkNeutralCurrent(void) const
bool IsNucleon(int pdgc)
Definition: PDGUtils.cxx:343
int RecoilNucleonPdg(void) const
recoil nucleon pdg
int HitQrkPdg(void) const
Definition: Target.cxx:242
InitialState * fInitialState
Initial State info.
Definition: Interaction.h:179
bool IsQuasiElastic(void) const
Definition: ProcessInfo.cxx:69
const int kPdgAntiNuE
Definition: PDGCodes.h:29
const int kPdgDarkMatter
Definition: PDGCodes.h:218
int Pdg(void) const
Definition: Target.h:71
const int kPdgNuMu
Definition: PDGCodes.h:30
static Interaction * CEvNS(int tgt, int probe, double E=0)
Generated/set kinematical variables for an event.
Definition: Kinematics.h:39
int SwitchProtonNeutron(int pdgc)
Definition: PDGUtils.cxx:353
void Copy(const XclsTag &xcls)
copy input XclsTag object
Definition: XclsTag.cxx:173
bool IsInverseBetaDecay(void) const
TParticlePDG * Probe(void) const
static Interaction * IBD(int tgt, int nuc, int probe, double E=0)
static Interaction * NDecay(int tgt, int decay_mode=-1, int decayed_nucleon=0)
void SetProbeE(double E)
bool IsIMDAnnihilation(void) const
void SetKine(const Kinematics &kine)
const int kPdgElectron
Definition: PDGCodes.h:35
init
Definition: train.py:42
XclsTag * fExclusiveTag
Additional info for exclusive channels.
Definition: Interaction.h:182
static Interaction * QELCC(int tgt, int nuc, int probe, double E=0)
static Interaction * MECNC(int tgt, int nuccluster, int probe, double E=0)
string AsString(void) const
static Interaction * RESNC(int tgt, int nuc, int probe, double E=0)
static Interaction * COHCC(int tgt, int probe, unsigned int prod_pdg, double E=0)
Contains minimal information for tagging exclusive processes.
Definition: XclsTag.h:39
int FSPrimLeptonPdg(void) const
final state primary lepton pdg
int ModifyNucleonCluster(int pdgc, int dQ)
Definition: PDGUtils.cxx:361
Summary information for an interaction.
Definition: Interaction.h:56
static Interaction * DMDI(int tgt, int nuc, int probe, double E=0)
static Interaction * RESEM(int tgt, int nuc, int probe, double E=0)
bool IsWeakNC(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
const int kPdgTau
Definition: PDGCodes.h:39
bool IsNuElectronElastic(void) const
void Copy(const InitialState &init_state)
const int kPdgAntiDarkMatter
Definition: PDGCodes.h:219
string AsString(void) const
pack into a string code
Definition: XclsTag.cxx:212
static Interaction * MECEM(int tgt, int nuccluster, int probe, double E=0)
static Interaction * QELNC(int tgt, int nuc, int probe, double E=0)
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
Definition: ProcessInfo.h:46
void Copy(const Kinematics &kine)
Definition: Kinematics.cxx:83
const int kPdgGamma
Definition: PDGCodes.h:189
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:115
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
int ProbePdg(void) const
Definition: InitialState.h:64
Kinematical phase space.
Definition: KPhaseSpace.h:33
void CleanUp(void)
Definition: Interaction.cxx:98
bool IsTau(int pdgc)
Definition: PDGUtils.cxx:205
string InteractionTypeAsString(void) const
const int kPdgPiP
Definition: PDGCodes.h:158
bool IsDarkMatterElastic(void) const
Definition: ProcessInfo.cxx:74
void Copy(const Interaction &i)
bool IsMuon(int pdgc)
Definition: PDGUtils.cxx:195
void SetDecayMode(int decay_mode)
Definition: XclsTag.cxx:133
#define pWARN
Definition: Messenger.h:60
TParticlePDG * FSPrimLepton(void) const
final state primary lepton
bool IsMEC(void) const
bool IsEM(void) const
XclsTag * ExclTagPtr(void) const
Definition: Interaction.h:77
bool Is2NucleonCluster(int pdgc)
Definition: PDGUtils.cxx:399
void SetExclTag(const XclsTag &xcls)
Kinematics * fKinematics
kinematical variables
Definition: Interaction.h:181
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
static Interaction * ASK(int tgt, int probe, double E=0)
bool HitNucIsSet(void) const
Definition: Target.cxx:283
bool HitQrkIsSet(void) const
Definition: Target.cxx:292
void Print(ostream &stream) const
static Interaction * QELEM(int tgt, int nuc, int probe, double E=0)
enum genie::EScatteringType ScatteringType_t
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
bool IsDarkMatter(void) const
void SetHitNucPdg(int pdgc)
Definition: Target.cxx:171
const XclsTag & ExclTag(void) const
Definition: Interaction.h:72
void line(double t, double *p, double &x, double &y, double &z)
static Interaction * DISCC(int tgt, int nuc, int probe, double E=0)
Target * TgtPtr(void) const
Definition: InitialState.h:67
static Interaction * DFRCC(int tgt, int nuc, int probe, double E=0)
int Neutrino2ChargedLepton(int pdgc)
Definition: PDGUtils.cxx:215
InitialState * InitStatePtr(void) const
Definition: Interaction.h:74
const InitialState & InitState(void) const
Definition: Interaction.h:69
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:70
ClassImp(Interaction) namespace genie
Definition: Interaction.cxx:34
Interaction & operator=(const Interaction &i)
copy
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
ProcessInfo * fProcInfo
Process info (scattering, weak current,...)
Definition: Interaction.h:180
const Target & Tgt(void) const
Definition: InitialState.h:66
const int kPdgMuon
Definition: PDGCodes.h:37
static Interaction * NHL(double E=0, int decayed_mode=-1)
static Interaction * RESCC(int tgt, int nuc, int probe, double E=0)
bool IsGlashowResonance(void) const
static Interaction * MECCC(int tgt, int nuccluster, int probe, double E=0)
static Interaction * COHNC(int tgt, int probe, unsigned int prod_pdg, double E=0)
void SetFinalQuark(int finalquark_pdgc=0)
Definition: XclsTag.cxx:138
static Interaction * DISEM(int tgt, int nuc, int probe, double E=0)
static Interaction * Create(int tgt, int probe, ScatteringType_t st, InteractionType_t it)
const int kPdgDarkNeutrino
Definition: PDGCodes.h:222
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
enum genie::EInteractionType InteractionType_t
void SetInitState(const InitialState &init)
static Interaction * AMNuGamma(int tgt, int nuc, int probe, double E=0)
void SetProcInfo(const ProcessInfo &proc)
void Copy(const ProcessInfo &proc)
bool IsElectron(int pdgc)
Definition: PDGUtils.cxx:185
QTextStream & endl(QTextStream &s)
KPhaseSpace * fKinePhSp
Kinematic phase space.
Definition: Interaction.h:183
static Interaction * NOsc(int tgt, int annihilation_mode=-1)
static Interaction * DISNC(int tgt, int nuc, int probe, double E=0)
Initial State information.
Definition: InitialState.h:48
#define pDEBUG
Definition: Messenger.h:63