#include <G4ExcitedStringDecay.hh>
Inheritance diagram for G4ExcitedStringDecay:
Public Member Functions | |
G4ExcitedStringDecay () | |
G4ExcitedStringDecay (G4VLongitudinalStringDecay *aStringDecay) | |
virtual | ~G4ExcitedStringDecay () |
virtual G4KineticTrackVector * | FragmentStrings (const G4ExcitedStringVector *theStrings) |
Definition at line 38 of file G4ExcitedStringDecay.hh.
G4ExcitedStringDecay::G4ExcitedStringDecay | ( | ) |
Definition at line 32 of file G4ExcitedStringDecay.cc.
00032 : G4VStringFragmentation(), 00033 theStringDecay(0) 00034 {}
G4ExcitedStringDecay::G4ExcitedStringDecay | ( | G4VLongitudinalStringDecay * | aStringDecay | ) |
Definition at line 36 of file G4ExcitedStringDecay.cc.
00037 : G4VStringFragmentation(), 00038 theStringDecay(aStringDecay) 00039 {}
G4ExcitedStringDecay::~G4ExcitedStringDecay | ( | ) | [virtual] |
G4KineticTrackVector * G4ExcitedStringDecay::FragmentStrings | ( | const G4ExcitedStringVector * | theStrings | ) | [virtual] |
Implements G4VStringFragmentation.
Definition at line 79 of file G4ExcitedStringDecay.cc.
References G4cerr, G4cout, and G4endl.
00080 { 00081 G4LorentzVector KTsum(0.,0.,0.,0.); 00082 00083 //G4cout<<"theStrings->size() "<<theStrings->size()<<G4endl; 00084 for ( unsigned int astring=0; astring < theStrings->size(); astring++) 00085 { 00086 KTsum+= theStrings->operator[](astring)->Get4Momentum(); 00087 } 00088 00089 G4KineticTrackVector * theResult = new G4KineticTrackVector; 00090 G4int attempts(0); 00091 G4bool success=false; 00092 G4bool NeedEnergyCorrector=false; 00093 do { 00094 //G4cout<<"Check of momentum at string fragmentations. New try."<<G4endl; 00095 std::for_each(theResult->begin() , theResult->end() , DeleteKineticTrack()); 00096 theResult->clear(); 00097 00098 attempts++; 00099 //G4cout<<G4endl<<"attempts "<<attempts<<G4endl; 00100 G4LorentzVector KTsecondaries(0.,0.,0.,0.); 00101 NeedEnergyCorrector=false; 00102 00103 for ( unsigned int astring=0; astring < theStrings->size(); astring++) 00104 { 00105 //G4cout<<"String No "<<astring+1<<" "<<theStrings->operator[](astring)->Get4Momentum().mag2()<<" "<<theStrings->operator[](astring)->GetRightParton()->GetPDGcode()<<" "<<theStrings->operator[](astring)->GetLeftParton()->GetPDGcode()<<" "<<theStrings->operator[](astring)->Get4Momentum()<<G4endl; 00106 //G4int Uzhi; G4cin >>Uzhi; 00107 G4KineticTrackVector * generatedKineticTracks = NULL; 00108 if ( theStrings->operator[](astring)->IsExcited() ) 00109 { 00110 //G4cout<<"Fragment String"<<G4endl; 00111 generatedKineticTracks=FragmentString(*theStrings->operator[](astring)); 00112 } else { 00113 generatedKineticTracks = new G4KineticTrackVector; 00114 generatedKineticTracks->push_back(theStrings->operator[](astring)->GetKineticTrack()); 00115 } 00116 00117 if (generatedKineticTracks == NULL) 00118 { 00119 G4cerr << "G4VPartonStringModel:No KineticTracks produced" << G4endl; 00120 continue; 00121 } 00122 00123 G4LorentzVector KTsum1(0.,0.,0.,0.); 00124 for ( unsigned int aTrack=0; aTrack<generatedKineticTracks->size();aTrack++) 00125 { 00126 //--debug-- G4cout<<"Prod part "<<(*generatedKineticTracks)[aTrack]->GetDefinition()->GetParticleName()<<" "<<(*generatedKineticTracks)[aTrack]->Get4Momentum()<<G4endl; 00127 theResult->push_back(generatedKineticTracks->operator[](aTrack)); 00128 KTsum1+= (*generatedKineticTracks)[aTrack]->Get4Momentum(); 00129 } 00130 KTsecondaries+=KTsum1; 00131 00132 //--debug--G4cout << "String secondaries(" <<generatedKineticTracks->size()<< ") momentum: " 00133 //--debug--<< theStrings->operator[](astring)->Get4Momentum() << " " << KTsum1 << G4endl; 00134 if ( KTsum1.e() > 0 && std::abs((KTsum1.e()-theStrings->operator[](astring)->Get4Momentum().e()) / KTsum1.e()) > perMillion ) 00135 { 00136 //--debug-- G4cout << "String secondaries(" <<generatedKineticTracks->size()<< ") momentum: " 00137 //--debug-- << theStrings->operator[](astring)->Get4Momentum() << " " << KTsum1 << G4endl; 00138 NeedEnergyCorrector=true; 00139 } 00140 00141 // clean up 00142 delete generatedKineticTracks; 00143 } 00144 //--debug G4cout << "Initial Strings / secondaries total 4 momentum " << KTsum << " " <<KTsecondaries << G4endl; 00145 00146 success=true; 00147 //G4cout<<"success "<<success<<G4endl; 00148 if ( NeedEnergyCorrector ) success=EnergyAndMomentumCorrector(theResult, KTsum); 00149 //G4cout<<"success after Ecorr "<<success<<G4endl; 00150 } while(!success && (attempts < 10)); // It was 100 !!! Uzhi 00151 //G4cout<<"End frag string"<<G4endl; 00152 00153 #ifdef debug_ExcitedStringDecay 00154 G4LorentzVector KTsum1=0; 00155 for ( unsigned int aTrack=0; aTrack<theResult->size();aTrack++) 00156 { 00157 G4cout << " corrected tracks .. " << (*theResult)[aTrack]->GetDefinition()->GetParticleName() 00158 <<" " << (*theResult)[aTrack]->Get4Momentum() << G4endl; 00159 KTsum1+= (*theResult)[aTrack]->Get4Momentum(); 00160 } 00161 00162 G4cout << "Needcorrector/success " << NeedEnergyCorrector << "/" << success << ", Corrected total 4 momentum " << KTsum1 << G4endl; 00163 if ( ! success ) G4cout << "failed to correct E/p" << G4endl; 00164 #endif 00165 00166 return theResult; 00167 }