CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
G4ProcessHelper Class Reference

#include <G4ProcessHelper.h>

Public Member Functions

G4bool ApplicabilityTester (const G4ParticleDefinition &aPart)
 
 G4ProcessHelper (const edm::ParameterSet &p, CustomParticleFactory *ptr)
 
ReactionProduct GetFinalState (const G4Track &aTrack, G4ParticleDefinition *&aTarget)
 
G4double GetInclusiveCrossSection (const G4DynamicParticle *aParticle, const G4Element *anElement)
 
 ~G4ProcessHelper ()
 

Private Member Functions

 G4ProcessHelper (const G4ProcessHelper &)=delete
 
G4ProcessHelperoperator= (const G4ProcessHelper &)=delete
 
G4double PhaseSpace (const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle)
 
G4double Pom (const double boost)
 
G4bool ReactionGivesBaryon (const ReactionProduct &aReaction)
 
G4bool ReactionIsPossible (const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle)
 
G4double ReactionProductMass (const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle)
 
void ReadAndParse (const G4String &str, std::vector< G4String > &tokens, const G4String &delimiters=" ")
 
G4double Regge (const double boost)
 

Private Attributes

double amplitude
 
G4double checkfraction
 
double ek_0
 
CustomParticleFactoryfParticleFactory
 
double gamma
 
TProfile * h_q_gamma
 
TProfile * h_q_p
 
TH1D * h_sqrts
 
TProfile * h_xsec_cms
 
TProfile * h_xsec_lab
 
double hadronlifetime
 
std::map< const G4ParticleDefinition *, G4bool > known_particles
 
double mixing
 
G4int n_22
 
G4int n_23
 
ReactionMap nReactionMap
 
std::map< G4String, G4double > parameters
 
G4ParticleTable * particleTable
 
ReactionMap pReactionMap
 
bool reggemodel
 
bool resonant
 
double suppressionfactor
 
HistoHelper * theHistoHelper
 
G4ParticleDefinition * theNeutron
 
G4ParticleDefinition * theProton
 
G4ParticleDefinition * theRbaryoncloud
 
ReactionMaptheReactionMap
 
G4ParticleDefinition * theRmesoncloud
 
G4ParticleDefinition * theTarget
 

Detailed Description

Definition at line 26 of file G4ProcessHelper.h.

Constructor & Destructor Documentation

G4ProcessHelper::G4ProcessHelper ( const edm::ParameterSet p,
CustomParticleFactory ptr 
)

Definition at line 19 of file G4ProcessHelper.cc.

References CustomPhysics_cfi::amplitude, edm::FileInPath::fullPath(), CustomPhysics_cfi::gamma, edm::ParameterSet::getParameter(), GeV, mps_fire::i, geometryCSVtoXML::line, CustomPhysics_cfi::mixing, parseEventContent::prod, CustomPhysics_cfi::resonant, alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and edmPickEvents::target.

20  {
21  fParticleFactory = ptr;
22 
23  particleTable = G4ParticleTable::GetParticleTable();
24 
25  theProton = particleTable->FindParticle("proton");
26  theNeutron = particleTable->FindParticle("neutron");
27 
28  G4String line;
29 
30  edm::FileInPath fp = p.getParameter<edm::FileInPath>("processesDef");
31  std::string processDefFilePath = fp.fullPath();
32  std::ifstream process_stream (processDefFilePath.c_str());
33 
34  resonant = p.getParameter<bool>("resonant");
35  ek_0 = p.getParameter<double>("resonanceEnergy")*GeV;
36  gamma = p.getParameter<double>("gamma")*GeV;
37  amplitude = p.getParameter<double>("amplitude")*millibarn;
38  suppressionfactor = p.getParameter<double>("reggeSuppression");
39  hadronlifetime = p.getParameter<double>("hadronLifeTime");
40  reggemodel = p.getParameter<bool>("reggeModel");
41  mixing = p.getParameter<double>("mixing");
42 
43  edm::LogInfo("SimG4CoreCustomPhysics")
44  <<"ProcessHelper: Read in physics parameters:"
45  <<"\n Resonant = "<< resonant
46  <<"\n ResonanceEnergy = "<<ek_0/GeV<<" GeV"
47  <<"\n Gamma = "<<gamma/GeV<<" GeV"
48  <<"\n Amplitude = "<<amplitude/millibarn<<" millibarn"
49  <<"ReggeSuppression = "<<100*suppressionfactor<<" %"
50  <<"HadronLifeTime = "<<hadronlifetime<<" s"
51  <<"ReggeModel = "<< reggemodel
52  <<"Mixing = "<< mixing*100 <<" %";
53 
54  checkfraction = 0;
55  n_22 = 0;
56  n_23 = 0;
57 
58  while(getline(process_stream,line)){
59  std::vector<G4String> tokens;
60  //Getting a line
61  ReadAndParse(line,tokens,"#");
62  //Important info
63  G4String incident = tokens[0];
64 
65  G4ParticleDefinition* incidentDef = particleTable->FindParticle(incident);
66  //particleTable->DumpTable();
67  G4int incidentPDG = incidentDef->GetPDGEncoding();
68  known_particles[incidentDef]=true;
69 
70  G4String target = tokens[1];
71  edm::LogInfo("SimG4CoreCustomPhysics")
72  <<"ProcessHelper: Incident "<<incident
73  <<"; Target "<<target;
74 
75  // Making a ReactionProduct
77  for (size_t i = 2; i != tokens.size();i++){
78  G4String part = tokens[i];
79  if (particleTable->contains(part))
80  {
81  prod.push_back(particleTable->FindParticle(part)->GetPDGEncoding());
82  } else {
83  G4Exception("G4ProcessHelper", "UnkownParticle", FatalException,
84  "Initialization: The reaction product list contained an unknown particle");
85  }
86  }
87  if (target == "proton")
88  {
89  pReactionMap[incidentPDG].push_back(prod);
90  } else if (target == "neutron") {
91  nReactionMap[incidentPDG].push_back(prod);
92  } else {
93  G4Exception("G4ProcessHelper", "IllegalTarget", FatalException,
94  "Initialization: The reaction product list contained an illegal target particle");
95  }
96  }
97 
98  process_stream.close();
99 
100  for(auto part : fParticleFactory->GetCustomParticles()) {
101  CustomParticle* particle = dynamic_cast<CustomParticle*>(part);
102  if(particle) {
103  edm::LogInfo("SimG4CoreCustomPhysics")
104  <<"ProcessHelper: Lifetime of "<<part->GetParticleName()<<" set to "
105  <<particle->GetPDGLifeTime()/s<<" s;"
106  <<" isStable: "<<particle->GetPDGStable();
107  }
108  }
109 }
T getParameter(std::string const &) const
const double GeV
Definition: MathUtil.h:16
G4ParticleTable * particleTable
std::map< const G4ParticleDefinition *, G4bool > known_particles
G4ParticleDefinition * theProton
G4ParticleDefinition * theNeutron
std::vector< G4int > ReactionProduct
void ReadAndParse(const G4String &str, std::vector< G4String > &tokens, const G4String &delimiters=" ")
double suppressionfactor
ReactionMap pReactionMap
ReactionMap nReactionMap
part
Definition: HCALResponse.h:20
const std::vector< G4ParticleDefinition * > & GetCustomParticles()
CustomParticleFactory * fParticleFactory
std::string fullPath() const
Definition: FileInPath.cc:197
G4double checkfraction
G4ProcessHelper::~G4ProcessHelper ( )

Definition at line 111 of file G4ProcessHelper.cc.

111  {
112 }
G4ProcessHelper::G4ProcessHelper ( const G4ProcessHelper )
privatedelete

Member Function Documentation

G4bool G4ProcessHelper::ApplicabilityTester ( const G4ParticleDefinition &  aPart)

Definition at line 114 of file G4ProcessHelper.cc.

Referenced by FullModelHadronicProcess::IsApplicable().

114  {
115  const G4ParticleDefinition* aP = &aPart;
116  if (known_particles[aP]) return true;
117  return false;
118 }
std::map< const G4ParticleDefinition *, G4bool > known_particles
ReactionProduct G4ProcessHelper::GetFinalState ( const G4Track &  aTrack,
G4ParticleDefinition *&  aTarget 
)

Definition at line 193 of file G4ProcessHelper.cc.

References ecalTB2006H4_GenSimDigiReco_cfg::G4cerr, mps_fire::i, createfilelist::int, CustomPhysics_cfi::mixing, CustomPDGParser::s_isMesonino(), CustomPDGParser::s_isRBaryon(), CustomPDGParser::s_isRMeson(), CustomPDGParser::s_isSbaryon(), TauGenJetsDecayModeSelectorAllHadrons_cfi::select, and findQualityFiles::size.

Referenced by FullModelHadronicProcess::PostStepDoIt().

193  {
194 
195  const G4DynamicParticle* aDynamicParticle = aTrack.GetDynamicParticle();
196 
197  //-----------------------------------------------
198  // Choose n / p as target
199  // and get ReactionProductList pointer
200  //-----------------------------------------------
201 
202  G4Material* aMaterial = aTrack.GetMaterial();
203  const G4ElementVector* theElementVector = aMaterial->GetElementVector() ;
204  const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume();
205 
206  G4double NumberOfProtons=0;
207  G4double NumberOfNucleons=0;
208 
209  for ( size_t elm=0 ; elm < aMaterial->GetNumberOfElements() ; elm++ )
210  {
211  //Summing number of protons per unit volume
212  NumberOfProtons += NbOfAtomsPerVolume[elm]*(*theElementVector)[elm]->GetZ();
213  //Summing nucleons (not neutrons)
214  NumberOfNucleons += NbOfAtomsPerVolume[elm]*(*theElementVector)[elm]->GetN();
215  }
216 
217  if(G4UniformRand()<NumberOfProtons/NumberOfNucleons)
218  {
221  } else {
224  }
225  aTarget = theTarget;
226 
227  G4int theIncidentPDG = aDynamicParticle->GetDefinition()->GetPDGEncoding();
228 
229  if(reggemodel
230  &&CustomPDGParser::s_isMesonino(theIncidentPDG)
231  && G4UniformRand()*mixing>0.5
232  &&aDynamicParticle->GetDefinition()->GetPDGCharge()==0.
233  )
234  {
235  // G4cout<<"Oscillating..."<<G4endl;
236  theIncidentPDG *= -1;
237  }
238 
239 
240  bool baryonise=false;
241 
242  if(reggemodel
243  && G4UniformRand()>0.9
244  &&(
245  (CustomPDGParser::s_isMesonino(theIncidentPDG)&&theIncidentPDG>0)
246  ||
247  CustomPDGParser::s_isRMeson(theIncidentPDG)
248  )
249  )
250  baryonise=true;
251 
252  //Making a pointer directly to the ReactionProductList we are looking at. Makes life easier :-)
253  ReactionProductList* aReactionProductList = &((*theReactionMap)[theIncidentPDG]);
254 
255  //-----------------------------------------------
256  // Count processes
257  // kinematic check
258  // compute number of 2 -> 2 and 2 -> 3 processes
259  //-----------------------------------------------
260 
261  G4int N22 = 0; //Number of 2 -> 2 processes
262  G4int N23 = 0; //Number of 2 -> 3 processes. Couldn't think of more informative names
263 
264  //This is the list to be populated
265  ReactionProductList theReactionProductList;
266  std::vector<bool> theChargeChangeList;
267 
268  for (ReactionProductList::iterator prod_it = aReactionProductList->begin();
269  prod_it != aReactionProductList->end();
270  prod_it++){
271  G4int secondaries = prod_it->size();
272  // If the reaction is not possible we will not consider it
273  if(ReactionIsPossible(*prod_it,aDynamicParticle)
274  && (!reggemodel ||
275  (baryonise&&ReactionGivesBaryon(*prod_it))
276  ||
277  (!baryonise&&!ReactionGivesBaryon(*prod_it))
278  ||
279  (CustomPDGParser::s_isSbaryon(theIncidentPDG))
280  ||
281  (CustomPDGParser::s_isRBaryon(theIncidentPDG))
282  )
283  )
284  {
285  // The reaction is possible. Let's store and count it
286  theReactionProductList.push_back(*prod_it);
287  if (secondaries == 2){
288  N22++;
289  } else if (secondaries ==3) {
290  N23++;
291  } else {
292  G4cerr << "ReactionProduct has unsupported number of secondaries: "<<secondaries<<G4endl;
293  }
294  } /*else {
295  edm::LogInfo("SimG4CoreCustomPhysics")<<"There was an impossible process"<<G4endl;
296  }*/
297  }
298  // edm::LogInfo("SimG4CoreCustomPhysics")<<"The size of the ReactionProductList is: "<<theReactionProductList.size()<<G4endl;
299 
300  if (theReactionProductList.empty()) G4Exception("G4ProcessHelper", "NoProcessPossible", FatalException,
301  "GetFinalState: No process could be selected from the given list.");
302 
303  // For the Regge model no phase space considerations. We pick a process at random
304  if(reggemodel)
305  {
306  int n_rps = theReactionProductList.size();
307  int select = (int)( G4UniformRand()*n_rps);
308  // G4cout<<"Possible: "<<n_rps<<", chosen: "<<select<<G4endl;
309  return theReactionProductList[select];
310  }
311 
312  // Fill a probability map. Remember total probability
313  // 2->2 is 0.15*1/n_22 2->3 uses phase space
314  G4double p22 = 0.15;
315  G4double p23 = 1-p22; // :-)
316 
317  std::vector<G4double> Probabilities;
318  std::vector<G4bool> TwotoThreeFlag;
319 
320  G4double CumulatedProbability = 0;
321 
322  // To each ReactionProduct we assign a cumulated probability and a flag
323  // discerning between 2 -> 2 and 2 -> 3
324  for (unsigned int i = 0; i != theReactionProductList.size(); i++){
325  if (theReactionProductList[i].size() == 2) {
326  CumulatedProbability += p22/N22;
327  TwotoThreeFlag.push_back(false);
328  } else {
329  CumulatedProbability += p23/N23;
330  TwotoThreeFlag.push_back(true);
331  }
332  Probabilities.push_back(CumulatedProbability);
333  // edm::LogInfo("SimG4CoreCustomPhysics")<<"Pushing back cumulated probability: "<<CumulatedProbability<<G4endl;
334  }
335 
336  //Renormalising probabilities
337  // edm::LogInfo("SimG4CoreCustomPhysics")<<"Probs: ";
338  for (std::vector<G4double>::iterator it = Probabilities.begin();
339  it != Probabilities.end();
340  it++)
341  {
342  *it /= CumulatedProbability;
343  // edm::LogInfo("SimG4CoreCustomPhysics")<<*it<<" ";
344  }
345  // edm::LogInfo("SimG4CoreCustomPhysics")<<G4endl;
346 
347  // Choosing ReactionProduct
348 
349  G4bool selected = false;
350  G4int tries = 0;
351  // ReactionProductList::iterator prod_it;
352 
353  //Keep looping over the list until we have a choice, or until we have tried 100 times
354  unsigned int i;
355  while(!selected && tries < 100){
356  i=0;
357  G4double dice = G4UniformRand();
358  // edm::LogInfo("SimG4CoreCustomPhysics")<<"What's the dice?"<<dice<<G4endl;
359  while(dice>Probabilities[i] && i<theReactionProductList.size()){
360  // edm::LogInfo("SimG4CoreCustomPhysics")<<"i: "<<i<<G4endl;
361  i++;
362  }
363 
364  // edm::LogInfo("SimG4CoreCustomPhysics")<<"Chosen i: "<<i<<G4endl;
365 
366  if(!TwotoThreeFlag[i]) {
367  // 2 -> 2 processes are chosen immediately
368  selected = true;
369  } else {
370  // 2 -> 3 processes require a phase space lookup
371  if (PhaseSpace(theReactionProductList[i],aDynamicParticle)>G4UniformRand()) selected = true;
372  //selected = true;
373  }
374  // double suppressionfactor=0.5;
375  if(selected&&particleTable->FindParticle(theReactionProductList[i][0])->GetPDGCharge()!=aDynamicParticle->GetDefinition()->GetPDGCharge())
376  {
377  /*
378  edm::LogInfo("SimG4CoreCustomPhysics")<<"Incoming particle "<<aDynamicParticle->GetDefinition()->GetParticleName()
379  <<" has charge "<<aDynamicParticle->GetDefinition()->GetPDGCharge()<<G4endl;
380  edm::LogInfo("SimG4CoreCustomPhysics")<<"Suggested particle "<<particleTable->FindParticle(theReactionProductList[i][0])->GetParticleName()
381  <<" has charge "<<particleTable->FindParticle(theReactionProductList[i][0])->GetPDGCharge()<<G4endl;
382  */
383  if(G4UniformRand()<suppressionfactor) selected = false;
384  }
385  tries++;
386  // edm::LogInfo("SimG4CoreCustomPhysics")<<"Tries: "<<tries<<G4endl;
387  }
388  if(tries>=100) G4cerr<<"Could not select process!!!!"<<G4endl;
389 
390  // edm::LogInfo("SimG4CoreCustomPhysics")<<"So far so good"<<G4endl;
391  // edm::LogInfo("SimG4CoreCustomPhysics")<<"Sec's: "<<theReactionProductList[i].size()<<G4endl;
392 
393  //Updating checkfraction:
394  if (theReactionProductList[i].size()==2) {
395  n_22++;
396  } else {
397  n_23++;
398  }
399 
400  checkfraction = (1.0*n_22)/(n_22+n_23);
401  // edm::LogInfo("SimG4CoreCustomPhysics")<<"n_22: "<<n_22<<" n_23: "<<n_23<<" Checkfraction: "<<checkfraction<<G4endl;
402  // edm::LogInfo("SimG4CoreCustomPhysics") <<"Biig number: "<<n_22+n_23<<G4endl;
403  //Return the chosen ReactionProduct
404  return theReactionProductList[i];
405 }
size
Write out results.
G4ParticleTable * particleTable
std::vector< ReactionProduct > ReactionProductList
G4ParticleDefinition * theProton
static bool s_isSbaryon(int pdg)
G4ParticleDefinition * theNeutron
static bool s_isRMeson(int pdg)
G4double PhaseSpace(const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle)
static bool s_isMesonino(int pdg)
double suppressionfactor
static bool s_isRBaryon(int pdg)
ReactionMap pReactionMap
ReactionMap nReactionMap
ReactionMap * theReactionMap
G4double checkfraction
G4ParticleDefinition * theTarget
G4bool ReactionIsPossible(const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle)
G4bool ReactionGivesBaryon(const ReactionProduct &aReaction)
G4double G4ProcessHelper::GetInclusiveCrossSection ( const G4DynamicParticle *  aParticle,
const G4Element *  anElement 
)

Definition at line 120 of file G4ProcessHelper.cc.

References CustomPhysics_cfi::amplitude, CustomPhysics_cfi::gamma, dataset::name, funct::pow(), dttmaxenums::R, CustomPhysics_cfi::resonant, CustomPDGParser::s_containedQuarks(), CustomPDGParser::s_isMesonino(), CustomPDGParser::s_isRBaryon(), CustomPDGParser::s_isRGlueball(), CustomPDGParser::s_isRMeson(), CustomPDGParser::s_isSbaryon(), and mathSSE::sqrt().

Referenced by FullModelHadronicProcess::GetMicroscopicCrossSection().

121  {
122 
123  //We really do need a dedicated class to handle the cross sections. They might not always be constant
124 
125 
126  //Disassemble the PDG-code
127 
128  G4int thePDGCode = aParticle->GetDefinition()->GetPDGEncoding();
129  double boost = (aParticle->GetKineticEnergy()+aParticle->GetMass())/aParticle->GetMass();
130  // G4cout<<"thePDGCode: "<<thePDGCode<<G4endl;
131  G4double theXsec = 0;
132  G4String name = aParticle->GetDefinition()->GetParticleName();
133  if(!reggemodel)
134  {
135  //Flat cross section
136  if(CustomPDGParser::s_isRGlueball(thePDGCode)) {
137  theXsec = 24 * millibarn;
138  } else {
139  std::vector<G4int> nq=CustomPDGParser::s_containedQuarks(thePDGCode);
140  // edm::LogInfo("SimG4CoreCustomPhysics")<<"Number of quarks: "<<nq.size()<<G4endl;
141  for (std::vector<G4int>::iterator it = nq.begin();
142  it != nq.end();
143  it++)
144  {
145  // edm::LogInfo("SimG4CoreCustomPhysics")<<"Quarkvector: "<<*it<<G4endl;
146  if (*it == 1 || *it == 2) theXsec += 12 * millibarn;
147  if (*it == 3) theXsec += 6 * millibarn;
148  }
149  }
150  }
151  else
152  { //reggemodel
153  double R = Regge(boost);
154  double P = Pom(boost);
155  if(thePDGCode>0)
156  {
157  if(CustomPDGParser::s_isMesonino(thePDGCode)) theXsec=(P+R)*millibarn;
158  if(CustomPDGParser::s_isSbaryon(thePDGCode)) theXsec=2*P*millibarn;
159  if(CustomPDGParser::s_isRMeson(thePDGCode)||CustomPDGParser::s_isRGlueball(thePDGCode)) theXsec=(R+2*P)*millibarn;
160  if(CustomPDGParser::s_isRBaryon(thePDGCode)) theXsec=3*P*millibarn;
161  }
162  else
163  {
164  if(CustomPDGParser::s_isMesonino(thePDGCode)) theXsec=P*millibarn;
165  if(CustomPDGParser::s_isSbaryon(thePDGCode)) theXsec=(2*(P+R)+30/sqrt(boost))*millibarn;
166  if(CustomPDGParser::s_isRMeson(thePDGCode)||CustomPDGParser::s_isRGlueball(thePDGCode)) theXsec=(R+2*P)*millibarn;
167  if(CustomPDGParser::s_isRBaryon(thePDGCode)) theXsec=3*P*millibarn;
168  }
169  }
170  //Adding resonance
171  if(resonant)
172  {
173  double e_0 = ek_0 + aParticle->GetDefinition()->GetPDGMass(); //Now total energy
174 
175  e_0 = sqrt(aParticle->GetDefinition()->GetPDGMass()*aParticle->GetDefinition()->GetPDGMass()
176  + theProton->GetPDGMass()*theProton->GetPDGMass()
177  + 2.*e_0*theProton->GetPDGMass());
178  // edm::LogInfo("SimG4CoreCustomPhysics")<<e_0/GeV<<G4endl;
179  // edm::LogInfo("SimG4CoreCustomPhysics")<<ek_0/GeV<<" "<<aParticle->GetDefinition()->GetPDGMass()/GeV<<" "<<theProton->GetPDGMass()/GeV<<G4endl;
180  double sqrts=sqrt(aParticle->GetDefinition()->GetPDGMass()*aParticle->GetDefinition()->GetPDGMass()
181  + theProton->GetPDGMass()*theProton->GetPDGMass() + 2*aParticle->GetTotalEnergy()*theProton->GetPDGMass());
182 
183  double res_result = amplitude*(gamma*gamma/4.)/((sqrts-e_0)*(sqrts-e_0)+(gamma*gamma/4.));//Non-relativistic Breit Wigner
184 
185  theXsec += res_result;
186  // if(fabs(aParticle->GetKineticEnergy()/GeV-200)<10) std::cout<<sqrts/GeV<<" "<<theXsec/millibarn<<std::endl;
187  }
188 
189  // std::cout<<"Xsec/nucleon: "<<theXsec/millibarn<<"millibarn, Total Xsec: "<<theXsec * anElement->GetN()/millibarn<<" millibarn"<<std::endl;
190  return theXsec * pow(anElement->GetN(),0.7)*1.25;// * 0.523598775598299;
191 }
static bool s_isRGlueball(int pdg)
G4ParticleDefinition * theProton
Definition: CLHEP.h:16
static bool s_isSbaryon(int pdg)
static bool s_isRMeson(int pdg)
static bool s_isMesonino(int pdg)
T sqrt(T t)
Definition: SSEVec.h:18
static bool s_isRBaryon(int pdg)
static std::vector< int > s_containedQuarks(int pdg)
std::pair< OmniClusterRef, TrackingParticleRef > P
G4double Regge(const double boost)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
G4double Pom(const double boost)
G4ProcessHelper& G4ProcessHelper::operator= ( const G4ProcessHelper )
privatedelete
G4double G4ProcessHelper::PhaseSpace ( const ReactionProduct aReaction,
const G4DynamicParticle *  aDynamicParticle 
)
private

Definition at line 438 of file G4ProcessHelper.cc.

References GeV, funct::pow(), and mathSSE::sqrt().

438  {
439  G4double qValue = ReactionProductMass(aReaction,aDynamicParticle);
440  G4double phi = sqrt(1+qValue/(2*0.139*GeV))*pow(qValue/(1.1*GeV),3./2.);
441  return (phi/(1+phi));
442 }
G4double ReactionProductMass(const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle)
const double GeV
Definition: MathUtil.h:16
T sqrt(T t)
Definition: SSEVec.h:18
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double G4ProcessHelper::Pom ( const double  boost)
private

Definition at line 477 of file G4ProcessHelper.cc.

References a, b, EnergyCorrector::c, edmIntegrityCheck::d, funct::pow(), and mathSSE::sqrt().

478 {
479  double a=4.138224000651535;
480  double b=1.50377557581421;
481  double c=-0.05449742257808247;
482  double d=0.0008221235048211401;
483  return a + b*sqrt(boost) + c*boost + d*pow(boost,1.5);
484 }
Definition: CLHEP.h:16
T sqrt(T t)
Definition: SSEVec.h:18
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
G4bool G4ProcessHelper::ReactionGivesBaryon ( const ReactionProduct aReaction)
private

Definition at line 432 of file G4ProcessHelper.cc.

References CustomPDGParser::s_isRBaryon(), and CustomPDGParser::s_isSbaryon().

432  {
433  for (ReactionProduct::const_iterator it = aReaction.begin();it!=aReaction.end();it++)
435  return false;
436 }
static bool s_isSbaryon(int pdg)
static bool s_isRBaryon(int pdg)
G4bool G4ProcessHelper::ReactionIsPossible ( const ReactionProduct aReaction,
const G4DynamicParticle *  aDynamicParticle 
)
private

Definition at line 427 of file G4ProcessHelper.cc.

427  {
428  if (ReactionProductMass(aReaction,aDynamicParticle)>0) return true;
429  return false;
430 }
G4double ReactionProductMass(const ReactionProduct &aReaction, const G4DynamicParticle *aDynamicParticle)
G4double G4ProcessHelper::ReactionProductMass ( const ReactionProduct aReaction,
const G4DynamicParticle *  aDynamicParticle 
)
private

Definition at line 407 of file G4ProcessHelper.cc.

References mathSSE::sqrt().

407  {
408  // Incident energy:
409  G4double E_incident = aDynamicParticle->GetTotalEnergy();
410  //edm::LogInfo("SimG4CoreCustomPhysics")<<"Total energy: "<<E_incident<<" Kinetic: "<<aDynamicParticle->GetKineticEnergy()<<G4endl;
411  // sqrt(s)= sqrt(m_1^2 + m_2^2 + 2 E_1 m_2)
412  G4double m_1 = aDynamicParticle->GetDefinition()->GetPDGMass();
413  G4double m_2 = theTarget->GetPDGMass();
414  //edm::LogInfo("SimG4CoreCustomPhysics")<<"M_R: "<<m_1/GeV<<" GeV, M_np: "<<m_2/GeV<<" GeV"<<G4endl;
415  G4double sqrts = sqrt(m_1*m_1 + m_2*(m_2 + 2 * E_incident));
416  //edm::LogInfo("SimG4CoreCustomPhysics")<<"sqrt(s) = "<<sqrts/GeV<<" GeV"<<G4endl;
417  // Sum of rest masses after reaction:
418  G4double M_after = 0;
419  for (ReactionProduct::const_iterator r_it = aReaction.begin(); r_it !=aReaction.end(); r_it++){
420  //edm::LogInfo("SimG4CoreCustomPhysics")<<"Mass contrib: "<<(particleTable->FindParticle(*r_it)->GetPDGMass())/MeV<<" MeV"<<G4endl;
421  M_after += particleTable->FindParticle(*r_it)->GetPDGMass();
422  }
423  //edm::LogInfo("SimG4CoreCustomPhysics")<<"Intending to return this ReactionProductMass: "<<(sqrts - M_after)/MeV<<" MeV"<<G4endl;
424  return sqrts - M_after;
425 }
G4ParticleTable * particleTable
T sqrt(T t)
Definition: SSEVec.h:18
G4ParticleDefinition * theTarget
void G4ProcessHelper::ReadAndParse ( const G4String &  str,
std::vector< G4String > &  tokens,
const G4String &  delimiters = " " 
)
private

Definition at line 444 of file G4ProcessHelper.cc.

References groupFilesInBlocks::temp.

447 {
448  // Skip delimiters at beginning.
449  G4String::size_type lastPos = str.find_first_not_of(delimiters, 0);
450  // Find first "non-delimiter".
451  G4String::size_type pos = str.find_first_of(delimiters, lastPos);
452 
453  while (G4String::npos != pos || G4String::npos != lastPos)
454  {
455  //Skipping leading / trailing whitespaces
456  G4String temp = str.substr(lastPos, pos - lastPos);
457  while(temp.c_str()[0] == ' ') temp.erase(0,1);
458  while(temp[temp.size()-1] == ' ') temp.erase(temp.size()-1,1);
459  // Found a token, add it to the vector.
460  tokens.push_back(temp);
461  // Skip delimiters. Note the "not_of"
462  lastPos = str.find_first_not_of(delimiters, pos);
463  // Find next "non-delimiter"
464  pos = str.find_first_of(delimiters, lastPos);
465  }
466 }
uint16_t size_type
#define str(s)
double G4ProcessHelper::Regge ( const double  boost)
private

Definition at line 468 of file G4ProcessHelper.cc.

References a, b, EnergyCorrector::c, JetChargeProducer_cfi::exp, and cmsBatch::log.

469 {
470  double a=2.165635078566177;
471  double b=0.1467453738547229;
472  double c=-0.9607903711871166;
473  return 1.5*exp(a+b/boost+c*log(boost));
474 }
Definition: CLHEP.h:16
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121

Member Data Documentation

double G4ProcessHelper::amplitude
private

Definition at line 84 of file G4ProcessHelper.h.

G4double G4ProcessHelper::checkfraction
private

Definition at line 50 of file G4ProcessHelper.h.

double G4ProcessHelper::ek_0
private

Definition at line 82 of file G4ProcessHelper.h.

CustomParticleFactory* G4ProcessHelper::fParticleFactory
private

Definition at line 97 of file G4ProcessHelper.h.

double G4ProcessHelper::gamma
private

Definition at line 83 of file G4ProcessHelper.h.

TProfile* G4ProcessHelper::h_q_gamma
private

Definition at line 104 of file G4ProcessHelper.h.

TProfile* G4ProcessHelper::h_q_p
private

Definition at line 103 of file G4ProcessHelper.h.

TH1D* G4ProcessHelper::h_sqrts
private

Definition at line 102 of file G4ProcessHelper.h.

TProfile* G4ProcessHelper::h_xsec_cms
private

Definition at line 101 of file G4ProcessHelper.h.

TProfile* G4ProcessHelper::h_xsec_lab
private

Definition at line 100 of file G4ProcessHelper.h.

double G4ProcessHelper::hadronlifetime
private

Definition at line 87 of file G4ProcessHelper.h.

std::map<const G4ParticleDefinition*,G4bool> G4ProcessHelper::known_particles
private

Definition at line 75 of file G4ProcessHelper.h.

double G4ProcessHelper::mixing
private

Definition at line 88 of file G4ProcessHelper.h.

G4int G4ProcessHelper::n_22
private

Definition at line 51 of file G4ProcessHelper.h.

G4int G4ProcessHelper::n_23
private

Definition at line 52 of file G4ProcessHelper.h.

ReactionMap G4ProcessHelper::nReactionMap
private

Definition at line 95 of file G4ProcessHelper.h.

std::map<G4String,G4double> G4ProcessHelper::parameters
private
G4ParticleTable* G4ProcessHelper::particleTable
private

Definition at line 98 of file G4ProcessHelper.h.

ReactionMap G4ProcessHelper::pReactionMap
private

Definition at line 92 of file G4ProcessHelper.h.

bool G4ProcessHelper::reggemodel
private

Definition at line 86 of file G4ProcessHelper.h.

bool G4ProcessHelper::resonant
private

Definition at line 81 of file G4ProcessHelper.h.

double G4ProcessHelper::suppressionfactor
private

Definition at line 85 of file G4ProcessHelper.h.

HistoHelper* G4ProcessHelper::theHistoHelper
private

Definition at line 99 of file G4ProcessHelper.h.

G4ParticleDefinition* G4ProcessHelper::theNeutron
private

Definition at line 56 of file G4ProcessHelper.h.

G4ParticleDefinition* G4ProcessHelper::theProton
private

Definition at line 55 of file G4ProcessHelper.h.

G4ParticleDefinition* G4ProcessHelper::theRbaryoncloud
private

Definition at line 58 of file G4ProcessHelper.h.

ReactionMap* G4ProcessHelper::theReactionMap
private

Definition at line 60 of file G4ProcessHelper.h.

G4ParticleDefinition* G4ProcessHelper::theRmesoncloud
private

Definition at line 57 of file G4ProcessHelper.h.

G4ParticleDefinition* G4ProcessHelper::theTarget
private

Definition at line 54 of file G4ProcessHelper.h.