Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ExcitedStringDecay Class Reference

#include <G4ExcitedStringDecay.hh>

Inheritance diagram for G4ExcitedStringDecay:

Public Member Functions

 G4ExcitedStringDecay (G4VLongitudinalStringDecay *aStringDecay=nullptr)
virtual ~G4ExcitedStringDecay ()
virtual G4KineticTrackVectorFragmentStrings (const G4ExcitedStringVector *theStrings)
Public Member Functions inherited from G4VStringFragmentation
 G4VStringFragmentation (const G4String &name="StringFragmentation")
 ~G4VStringFragmentation () override
 G4VStringFragmentation (const G4VStringFragmentation &right)=delete
const G4VStringFragmentationoperator= (const G4VStringFragmentation &right)=delete
G4bool operator== (const G4VStringFragmentation &right) const =delete
G4bool operator!= (const G4VStringFragmentation &right) const =delete
Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
virtual ~G4HadronicInteraction ()
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
virtual G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
virtual G4bool IsApplicable (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
G4double GetMinEnergy () const
G4double GetMinEnergy (const G4Material *aMaterial, const G4Element *anElement) const
void SetMinEnergy (G4double anEnergy)
void SetMinEnergy (G4double anEnergy, const G4Element *anElement)
void SetMinEnergy (G4double anEnergy, const G4Material *aMaterial)
G4double GetMaxEnergy () const
G4double GetMaxEnergy (const G4Material *aMaterial, const G4Element *anElement) const
void SetMaxEnergy (const G4double anEnergy)
void SetMaxEnergy (G4double anEnergy, const G4Element *anElement)
void SetMaxEnergy (G4double anEnergy, const G4Material *aMaterial)
G4int GetVerboseLevel () const
void SetVerboseLevel (G4int value)
const G4StringGetModelName () const
void DeActivateFor (const G4Material *aMaterial)
void ActivateFor (const G4Material *aMaterial)
void DeActivateFor (const G4Element *anElement)
void ActivateFor (const G4Element *anElement)
G4bool IsBlocked (const G4Material *aMaterial) const
G4bool IsBlocked (const G4Element *anElement) const
void SetRecoilEnergyThreshold (G4double val)
G4double GetRecoilEnergyThreshold () const
virtual const std::pair< G4double, G4doubleGetFatalEnergyCheckLevels () const
virtual std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
virtual void ModelDescription (std::ostream &outFile) const
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
virtual void InitialiseModel ()
 G4HadronicInteraction (const G4HadronicInteraction &right)=delete
const G4HadronicInteractionoperator= (const G4HadronicInteraction &right)=delete
G4bool operator== (const G4HadronicInteraction &right) const =delete
G4bool operator!= (const G4HadronicInteraction &right) const =delete

Additional Inherited Members

Protected Member Functions inherited from G4HadronicInteraction
void SetModelName (const G4String &nam)
G4bool IsBlocked () const
void Block ()
Protected Attributes inherited from G4HadronicInteraction
G4HadFinalState theParticleChange
G4int verboseLevel
G4double theMinEnergy
G4double theMaxEnergy
G4bool isBlocked

Detailed Description

Definition at line 38 of file G4ExcitedStringDecay.hh.

Constructor & Destructor Documentation

◆ G4ExcitedStringDecay()

G4ExcitedStringDecay::G4ExcitedStringDecay ( G4VLongitudinalStringDecay * aStringDecay = nullptr)

Definition at line 39 of file G4ExcitedStringDecay.cc.

40 : G4VStringFragmentation(), theStringDecay(ptr)
41{
42 if(!ptr) {
44 G4HadronicInteractionRegistry::Instance()->FindModel("LundStringFragmentation");
45 theStringDecay = static_cast<G4VLongitudinalStringDecay*>(p);
46 if(!theStringDecay) { theStringDecay = new G4LundStringFragmentation(); }
47 }
48 SetModelName(theStringDecay->GetModelName());
49}
G4HadronicInteraction * FindModel(const G4String &name)
static G4HadronicInteractionRegistry * Instance()
void SetModelName(const G4String &nam)
G4HadronicInteraction(const G4String &modelName="HadronicModel")
G4VStringFragmentation(const G4String &name="StringFragmentation")

◆ ~G4ExcitedStringDecay()

G4ExcitedStringDecay::~G4ExcitedStringDecay ( )
virtual

Definition at line 51 of file G4ExcitedStringDecay.cc.

52{}

Member Function Documentation

◆ FragmentStrings()

G4KineticTrackVector * G4ExcitedStringDecay::FragmentStrings ( const G4ExcitedStringVector * theStrings)
virtual

Implements G4VStringFragmentation.

Definition at line 59 of file G4ExcitedStringDecay.cc.

60{
61 G4LorentzVector KTsum(0.,0.,0.,0.);
62
63 #ifdef debug_G4ExcitedStringDecay
65 G4cout<<"--------------------------- G4ExcitedStringDecay ----------------------"<<G4endl;
66 G4cout<<"Hadronization of Excited Strings: theStrings->size() "<<theStrings->size()<<G4endl;
67 #endif
68
69 for ( unsigned int astring=0; astring < theStrings->size(); astring++)
70 // for ( unsigned int astring=0; astring < 1; astring++)
71 {
72 // G4cout<<"theStrings->operator[](astring)->IsExcited() "<<" "<<astring<<" "<<theStrings->operator[](astring)->IsExcited()<<G4endl;
73 if ( theStrings->operator[](astring)->IsExcited() )
74 {KTsum+= theStrings->operator[](astring)->Get4Momentum();}
75 else {KTsum+=theStrings->operator[](astring)->GetKineticTrack()->Get4Momentum();}
76 }
77
78 G4LorentzRotation toCms( -1 * KTsum.boostVector() );
79 G4LorentzRotation toLab(toCms.inverse());
80 G4LorentzVector Ptmp;
81 KTsum=G4LorentzVector(0.,0.,0.,0.);
82
83 for ( unsigned int astring=0; astring < theStrings->size(); astring++)
84 // for ( unsigned int astring=0; astring < 1; astring++)
85 {
86 if ( theStrings->operator[](astring)->IsExcited() )
87 {
88 Ptmp=toCms * theStrings->operator[](astring)->GetLeftParton()->Get4Momentum();
89 theStrings->operator[](astring)->GetLeftParton()->Set4Momentum(Ptmp);
90
91 Ptmp=toCms * theStrings->operator[](astring)->GetRightParton()->Get4Momentum();
92 theStrings->operator[](astring)->GetRightParton()->Set4Momentum(Ptmp);
93
94 KTsum+= theStrings->operator[](astring)->Get4Momentum();
95 }
96 else
97 {
98 Ptmp=toCms * theStrings->operator[](astring)->GetKineticTrack()->Get4Momentum();
99 theStrings->operator[](astring)->GetKineticTrack()->Set4Momentum(Ptmp);
100 KTsum+= theStrings->operator[](astring)->GetKineticTrack()->Get4Momentum();
101 }
102 }
103
104 G4SampleResonance BrW;
105 const G4ParticleDefinition* TrackDefinition=0;
106
107 G4KineticTrackVector * theResult = new G4KineticTrackVector;
108 G4int attempts(0);
109 G4bool success=false;
110 G4bool NeedEnergyCorrector=false;
111 do {
112 #ifdef debug_G4ExcitedStringDecay
113 G4cout<<"New try No "<<attempts<<" to hadronize strings"<<G4endl;
114 #endif
115
116 std::for_each(theResult->begin() , theResult->end() , DeleteKineticTrack());
117 theResult->clear();
118
119 attempts++;
120
121 G4LorentzVector KTsecondaries(0.,0.,0.,0.);
122 NeedEnergyCorrector=false;
123
124 for ( unsigned int astring=0; astring < theStrings->size(); astring++)
125 // for ( unsigned int astring=0; astring < 1; astring++) // Proj. Last Str. Decay for FTF
126 // for ( unsigned int astring=1; astring < 2; astring++) // Proj. Last Str. Decay for QGS
127 // for ( unsigned int astring=0; astring < 1; astring++) // For testing purposes
128 {
129 #ifdef debug_G4ExcitedStringDecay
130 G4cout<<"String No "<<astring+1<<" Excited? "<<theStrings->operator[](astring)->IsExcited()<<G4endl;
131
132 G4cout<<"String No "<<astring+1<<" 4Momentum "<<theStrings->operator[](astring)->Get4Momentum()
133 <<" "<<theStrings->operator[](astring)->Get4Momentum().mag()<<G4endl;
134 #endif
135
136 G4KineticTrackVector * generatedKineticTracks = NULL;
137 if ( theStrings->operator[](astring)->IsExcited() )
138 {
139 #ifdef debug_G4ExcitedStringDecay
140 G4cout<<"Fragment String with partons: "
141 <<theStrings->operator[](astring)->GetLeftParton()->GetPDGcode() <<" "
142 <<theStrings->operator[](astring)->GetRightParton()->GetPDGcode()<<" "
143 <<"Direction "<<theStrings->operator[](astring)->GetDirection()<<G4endl;
144 #endif
145 generatedKineticTracks=FragmentString(*theStrings->operator[](astring));
146 #ifdef debug_G4ExcitedStringDecay
147 G4cout<<"(G4ExcitedStringDecay) Number of produced hadrons = "
148 <<generatedKineticTracks->size()<<G4endl;
149 #endif
150 } else {
151 #ifdef debug_G4ExcitedStringDecay
152 G4cout<<" GetTrack from the String"<<G4endl;
153 #endif
154 G4LorentzVector Mom=theStrings->operator[](astring)->GetKineticTrack()->Get4Momentum();
155 G4KineticTrack * aTrack= new G4KineticTrack(
156 theStrings->operator[](astring)->GetKineticTrack()->GetDefinition(),
157 theStrings->operator[](astring)->GetKineticTrack()->GetFormationTime(),
158 G4ThreeVector(0), Mom);
159
160 aTrack->SetPosition(theStrings->operator[](astring)->GetKineticTrack()->GetPosition());
161
162 #ifdef debug_G4ExcitedStringDecay
163 G4cout<<" A particle stored in the track is "<<aTrack->GetDefinition()->GetParticleName()<<G4endl;
164 #endif
165
166 generatedKineticTracks = new G4KineticTrackVector;
167 generatedKineticTracks->push_back(aTrack);
168 }
169
170 if (generatedKineticTracks == nullptr || generatedKineticTracks->size() == 0)
171 {
172 // G4cerr << "G4VPartonStringModel:No KineticTracks produced" << G4endl;
173 delete generatedKineticTracks;
174 generatedKineticTracks = nullptr;
175 continue;
176 }
177
178 G4LorentzVector KTsum1(0.,0.,0.,0.);
179 for ( unsigned int aTrack=0; aTrack<generatedKineticTracks->size();aTrack++)
180 {
181 #ifdef debug_G4ExcitedStringDecay
182 G4cout<<"Prod part No. "<<aTrack+1<<" "
183 <<(*generatedKineticTracks)[aTrack]->GetDefinition()->GetParticleName()<<" "
184 <<(*generatedKineticTracks)[aTrack]->Get4Momentum()
185 <<(*generatedKineticTracks)[aTrack]->Get4Momentum().mag()<<G4endl;
186 #endif
187 // --------------- Sampling mass of unstable hadronic resonances ----------------
188 TrackDefinition = (*generatedKineticTracks)[aTrack]->GetDefinition();
189
190 if (TrackDefinition->IsShortLived())
191 {
192 G4double NewTrackMass =
193 BrW.SampleMass( TrackDefinition->GetPDGMass(), TrackDefinition->GetPDGWidth(),
194 BrW.GetMinimumMass( TrackDefinition ) + 10.0*MeV,
195 TrackDefinition->GetPDGMass() + 5.0*TrackDefinition->GetPDGWidth() );
196 G4LorentzVector Tmp=G4LorentzVector((*generatedKineticTracks)[aTrack]->Get4Momentum());
197 Tmp.setE(std::sqrt(sqr(NewTrackMass) + Tmp.vect().mag2()));
198
199 (*generatedKineticTracks)[aTrack]->Set4Momentum(Tmp);
200
201 #ifdef debug_G4ExcitedStringDecay
202 G4cout<<"Resonance *** "<<aTrack+1<<" "
203 <<(*generatedKineticTracks)[aTrack]->GetDefinition()->GetParticleName()<<" "
204 <<(*generatedKineticTracks)[aTrack]->Get4Momentum()
205 <<(*generatedKineticTracks)[aTrack]->Get4Momentum().mag()<<G4endl;
206 #endif
207 }
208 //-------------------------------------------------------------------------------
209
210 theResult->push_back(generatedKineticTracks->operator[](aTrack));
211 KTsum1+= (*generatedKineticTracks)[aTrack]->Get4Momentum();
212 }
213 KTsecondaries+=KTsum1;
214
215 #ifdef debug_G4ExcitedStringDecay
216 G4cout << "String secondaries(" <<generatedKineticTracks->size()<< ")"<<G4endl
217 <<"Init string momentum: "<< theStrings->operator[](astring)->Get4Momentum()<<G4endl
218 <<"Final hadrons momentum: "<< KTsum1 << G4endl;
219 #endif
220
221 if ( KTsum1.e() > 0 &&
222 std::abs((KTsum1.e()-theStrings->operator[](astring)->Get4Momentum().e()) / KTsum1.e()) > perMillion )
223 {
224 NeedEnergyCorrector=true;
225 }
226
227 #ifdef debug_G4ExcitedStringDecay
228 G4cout<<"NeedEnergyCorrection yes/no "<<NeedEnergyCorrector<<G4endl;
229 #endif
230
231 // clean up
232 delete generatedKineticTracks;
233 success=true;
234 }
235
236 if ( NeedEnergyCorrector ) success=EnergyAndMomentumCorrector(theResult, KTsum);
237 } while (!success && (attempts < 100)); /* Loop checking, 07.08.2015, A.Ribon */
238
239 for ( unsigned int aTrack=0; aTrack<theResult->size();aTrack++)
240 {
241 Ptmp=(*theResult)[aTrack]->Get4Momentum();
242 Ptmp.transform( toLab);
243 (*theResult)[aTrack]->Set4Momentum(Ptmp);
244 }
245
246 #ifdef debug_G4ExcitedStringDecay
247 G4cout<<"End of the strings fragmentation (G4ExcitedStringDecay)"<<G4endl;
248
249 G4LorentzVector KTsum1(0.,0.,0.,0.);
250
251 for ( unsigned int aTrack=0; aTrack<theResult->size();aTrack++)
252 {
253 G4cout << " corrected tracks .. " << (*theResult)[aTrack]->GetDefinition()->GetParticleName()
254 <<" " << (*theResult)[aTrack]->Get4Momentum()
255 <<" " << (*theResult)[aTrack]->Get4Momentum().mag()<< G4endl;
256 KTsum1+= (*theResult)[aTrack]->Get4Momentum();
257 }
258
259 G4cout << "Needcorrector/success " << NeedEnergyCorrector << "/" << success
260 << ", Corrected total 4 momentum " << KTsum1 << G4endl;
261 if ( ! success ) G4cout << "failed to correct E/p" << G4endl;
262
263 G4cout<<"End of the Hadronization (G4ExcitedStringDecay)"<<G4endl;
264 #endif
265
266 if (!success)
267 {
268 if (theResult->size() != 0)
269 {
270 std::for_each(theResult->begin() , theResult->end() , DeleteKineticTrack());
271 theResult->clear();
272 delete theResult; theResult=0;
273 }
274 for ( unsigned int astring=0; astring < theStrings->size(); astring++)
275 // for ( unsigned int astring=0; astring < 1; astring++) // Need more correct. For testing purposes.
276 {
277 if ( theStrings->operator[](astring)->IsExcited() )
278 {
279 Ptmp=theStrings->operator[](astring)->GetLeftParton()->Get4Momentum();
280 Ptmp.transform( toLab);
281 theStrings->operator[](astring)->GetLeftParton()->Set4Momentum(Ptmp);
282
283 Ptmp=theStrings->operator[](astring)->GetRightParton()->Get4Momentum();
284 Ptmp.transform( toLab);
285 theStrings->operator[](astring)->GetRightParton()->Set4Momentum(Ptmp);
286 }
287 else
288 {
289 Ptmp=theStrings->operator[](astring)->GetKineticTrack()->Get4Momentum();
290 Ptmp.transform( toLab);
291 theStrings->operator[](astring)->GetKineticTrack()->Set4Momentum(Ptmp);
292 }
293 }
294 }
295 return theResult;
296}
CLHEP::HepLorentzRotation G4LorentzRotation
CLHEP::HepLorentzVector G4LorentzVector
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
double mag2() const
Hep3Vector vect() const
HepLorentzVector & transform(const HepRotation &)
void SetPosition(const G4ThreeVector aPosition)
const G4ParticleDefinition * GetDefinition() const
const G4String & GetParticleName() const
G4double SampleMass(const G4double poleMass, const G4double gamma, const G4double minMass, const G4double maxMass) const
G4double GetMinimumMass(const G4ParticleDefinition *p) const
T sqr(const T &x)
Definition templates.hh:128

The documentation for this class was generated from the following files: