CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
CMSHadronPhysicsFTFP_BERT Class Reference

#include <CMSHadronPhysicsFTFP_BERT.h>

Inheritance diagram for CMSHadronPhysicsFTFP_BERT:

Public Member Functions

 CMSHadronPhysicsFTFP_BERT (G4int verbose=1)
 
void ConstructParticle () override
 
void ConstructProcess () override
 
void TerminateWorker () override
 
 ~CMSHadronPhysicsFTFP_BERT () override
 

Protected Member Functions

virtual void CreateModels ()
 
virtual void DumpBanner ()
 
virtual void ExtraConfiguration ()
 
virtual void Kaon ()
 
virtual void Neutron ()
 
virtual void Others ()
 
virtual void Pion ()
 
virtual void Proton ()
 

Protected Attributes

G4double maxBERT_kaon
 
G4double maxBERT_neutron
 
G4double maxBERT_pion
 
G4double maxBERT_proton
 
G4double minFTFP_kaon
 
G4double minFTFP_neutron
 
G4double minFTFP_pion
 
G4double minFTFP_proton
 
G4bool QuasiElastic
 
G4VectorCache< G4VCrossSectionDataSet * > xs_ds
 
G4Cache< G4ComponentGGHadronNucleusXsc * > xs_k
 

Detailed Description

Definition at line 24 of file CMSHadronPhysicsFTFP_BERT.h.

Constructor & Destructor Documentation

CMSHadronPhysicsFTFP_BERT::CMSHadronPhysicsFTFP_BERT ( G4int  verbose = 1)
explicit

Definition at line 49 of file CMSHadronPhysicsFTFP_BERT.cc.

References GeV, maxBERT_kaon, maxBERT_neutron, maxBERT_pion, maxBERT_proton, minFTFP_kaon, minFTFP_neutron, minFTFP_pion, and minFTFP_proton.

50  : G4VPhysicsConstructor("hInelastic CMS FTFP_BERT")
51  , QuasiElastic(false)
52 {
53  minFTFP_pion = 4.0 * GeV;
54  maxBERT_pion = 5.0 * GeV;
55  minFTFP_kaon = 4.0 * GeV;
56  maxBERT_kaon = 5.0 * GeV;
57  minFTFP_proton = 4.0 * GeV;
58  maxBERT_proton = 5.0 * GeV;
59  minFTFP_neutron = 4.0 * GeV;
60  maxBERT_neutron = 5.0 * GeV;
61 }
const double GeV
Definition: MathUtil.h:16
CMSHadronPhysicsFTFP_BERT::~CMSHadronPhysicsFTFP_BERT ( )
override

Definition at line 63 of file CMSHadronPhysicsFTFP_BERT.cc.

References xs_ds, and xs_k.

64 {
65  //Detele master-owned stuff
66  delete xs_k.Get();
67  std::for_each( xs_ds.Begin(), xs_ds.End(),[](G4VCrossSectionDataSet* el){ delete el;});
68 }
G4Cache< G4ComponentGGHadronNucleusXsc * > xs_k
G4VectorCache< G4VCrossSectionDataSet * > xs_ds

Member Function Documentation

void CMSHadronPhysicsFTFP_BERT::ConstructParticle ( )
override

Definition at line 70 of file CMSHadronPhysicsFTFP_BERT.cc.

71 {
72  G4MesonConstructor pMesonConstructor;
73  pMesonConstructor.ConstructParticle();
74 
75  G4BaryonConstructor pBaryonConstructor;
76  pBaryonConstructor.ConstructParticle();
77 
78  G4ShortLivedConstructor pShortLivedConstructor;
79  pShortLivedConstructor.ConstructParticle();
80 }
void CMSHadronPhysicsFTFP_BERT::ConstructProcess ( )
override

Definition at line 192 of file CMSHadronPhysicsFTFP_BERT.cc.

References CreateModels(), DumpBanner(), and ExtraConfiguration().

193 {
194  if(G4Threading::IsMasterThread()) {
195  DumpBanner();
196  }
197  CreateModels();
199 }
void CMSHadronPhysicsFTFP_BERT::CreateModels ( )
protectedvirtual

Definition at line 101 of file CMSHadronPhysicsFTFP_BERT.cc.

References Kaon(), Neutron(), Others(), Pion(), and Proton().

Referenced by ConstructProcess().

void CMSHadronPhysicsFTFP_BERT::DumpBanner ( )
protectedvirtual

Definition at line 90 of file CMSHadronPhysicsFTFP_BERT.cc.

References ecalTB2006H4_GenSimDigiReco_cfg::G4cout, GeV, maxBERT_kaon, maxBERT_neutron, maxBERT_pion, maxBERT_proton, minFTFP_kaon, minFTFP_neutron, minFTFP_pion, and minFTFP_proton.

Referenced by ConstructProcess().

91 {
92  G4cout << G4endl
93  << " FTFP_BERT : new threshold between BERT and FTFP is over the interval " << G4endl
94  << " for pions : " << minFTFP_pion/GeV << " to " << maxBERT_pion/GeV << " GeV" << G4endl
95  << " for kaons : " << minFTFP_kaon/GeV << " to " << maxBERT_kaon/GeV << " GeV" << G4endl
96  << " for proton : " << minFTFP_proton/GeV << " to " << maxBERT_proton/GeV << " GeV" << G4endl
97  << " for neutron : " << minFTFP_neutron/GeV << " to " << maxBERT_neutron/GeV << " GeV" << G4endl
98  << G4endl;
99 }
const double GeV
Definition: MathUtil.h:16
void CMSHadronPhysicsFTFP_BERT::ExtraConfiguration ( )
protectedvirtual

Definition at line 201 of file CMSHadronPhysicsFTFP_BERT.cc.

References ztee::capture(), mps_fire::i, MetAnalyzer::pv(), xs_ds, and xs_k.

Referenced by ConstructProcess().

202 {
203  //Modify XS for kaons
204  auto xsk = new G4ComponentGGHadronNucleusXsc();
205  xs_k.Put(xsk);
206  G4VCrossSectionDataSet * kaonxs = new G4CrossSectionInelastic(xsk);
207  xs_ds.Push_back(kaonxs);
208  G4PhysListUtil::FindInelasticProcess(G4KaonMinus::KaonMinus())->AddDataSet(kaonxs);
209  G4PhysListUtil::FindInelasticProcess(G4KaonPlus::KaonPlus())->AddDataSet(kaonxs);
210  G4PhysListUtil::FindInelasticProcess(G4KaonZeroShort::KaonZeroShort())->AddDataSet(kaonxs);
211  G4PhysListUtil::FindInelasticProcess(G4KaonZeroLong::KaonZeroLong())->AddDataSet(kaonxs);
212 
213  //Modify Neutrons
214  auto xs_n_in = (G4NeutronInelasticXS*)G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(G4NeutronInelasticXS::Default_Name());
215  xs_ds.Push_back(xs_n_in);//TODO: Is this needed? Who owns the pointer?
216  G4PhysListUtil::FindInelasticProcess(G4Neutron::Neutron())->AddDataSet( xs_n_in );
217  G4HadronicProcess* capture = nullptr;
218  G4ProcessManager* pmanager = G4Neutron::Neutron()->GetProcessManager();
219  G4ProcessVector* pv = pmanager->GetProcessList();
220  for ( size_t i=0; i < static_cast<size_t>(pv->size()); ++i ) {
221  if ( fCapture == ((*pv)[i])->GetProcessSubType() ) {
222  capture = static_cast<G4HadronicProcess*>((*pv)[i]);
223  }
224  }
225  if ( ! capture ) {
226  capture = new G4HadronCaptureProcess("nCapture");
227  pmanager->AddDiscreteProcess(capture);
228  }
229  auto xs_n_c = (G4NeutronCaptureXS*)G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(G4NeutronCaptureXS::Default_Name());
230  xs_ds.Push_back(xs_n_c);
231  capture->AddDataSet( xs_n_c );
232  capture->RegisterMe( new G4NeutronRadCapture() );
233 }
G4Cache< G4ComponentGGHadronNucleusXsc * > xs_k
def capture(fd, args)
Definition: ztee.py:94
G4VectorCache< G4VCrossSectionDataSet * > xs_ds
def pv(vc)
Definition: MetAnalyzer.py:7
void CMSHadronPhysicsFTFP_BERT::Kaon ( )
protectedvirtual

Definition at line 161 of file CMSHadronPhysicsFTFP_BERT.cc.

References gen::k, maxBERT_kaon, minFTFP_kaon, and QuasiElastic.

Referenced by CreateModels().

162 {
163  auto k = new G4KaonBuilder;
164  AddBuilder(k);
165  auto ftfpk = new G4FTFPKaonBuilder(QuasiElastic);
166  AddBuilder(ftfpk);
167  k->RegisterMe(ftfpk);
168  ftfpk->SetMinEnergy(minFTFP_kaon);
169  auto bertk = new G4BertiniKaonBuilder;
170  AddBuilder(bertk);
171  k->RegisterMe(bertk);
172  bertk->SetMaxEnergy(maxBERT_kaon);
173  k->Build();
174 }
int k[5][pyjets_maxn]
void CMSHadronPhysicsFTFP_BERT::Neutron ( )
protectedvirtual

Definition at line 110 of file CMSHadronPhysicsFTFP_BERT.cc.

References GeV, maxBERT_neutron, minFTFP_neutron, and QuasiElastic.

Referenced by CreateModels().

111 {
112  //General schema:
113  // 1) Create a builder
114  // 2) Call AddBuilder
115  // 3) Configure the builder, possibly with sub-builders
116  // 4) Call builder->Build()
117  auto neu = new G4NeutronBuilder;
118  AddBuilder(neu);
119  auto ftfpn = new G4FTFPNeutronBuilder(QuasiElastic);
120  AddBuilder( ftfpn );
121  neu->RegisterMe(ftfpn);
122  ftfpn->SetMinEnergy(minFTFP_neutron);
123  auto bertn = new G4BertiniNeutronBuilder;
124  AddBuilder(bertn);
125  neu->RegisterMe(bertn);
126  bertn->SetMinEnergy(0.*GeV);
127  bertn->SetMaxEnergy(maxBERT_neutron);
128  neu->Build();
129 }
const double GeV
Definition: MathUtil.h:16
void CMSHadronPhysicsFTFP_BERT::Others ( )
protectedvirtual

===== Anti-barions==== //

Definition at line 176 of file CMSHadronPhysicsFTFP_BERT.cc.

References QuasiElastic.

Referenced by CreateModels().

177 {
178  //===== Hyperons ====== //
179  auto hyp = new G4HyperonFTFPBuilder;
180  AddBuilder( hyp );
181  hyp->Build();
182 
184  auto abar = new G4AntiBarionBuilder;
185  AddBuilder(abar);
186  auto ftfpabar = new G4FTFPAntiBarionBuilder(QuasiElastic);
187  AddBuilder(ftfpabar);
188  abar->RegisterMe(ftfpabar);
189  abar->Build();
190 }
void CMSHadronPhysicsFTFP_BERT::Pion ( )
protectedvirtual

Definition at line 146 of file CMSHadronPhysicsFTFP_BERT.cc.

References maxBERT_pion, minFTFP_pion, pi, and QuasiElastic.

Referenced by CreateModels().

147 {
148  auto pi = new G4PionBuilder;
149  AddBuilder(pi);
150  auto ftfppi = new G4FTFPPionBuilder(QuasiElastic);
151  AddBuilder(ftfppi);
152  pi->RegisterMe(ftfppi);
153  ftfppi->SetMinEnergy(minFTFP_pion);
154  auto bertpi = new G4BertiniPionBuilder;
155  AddBuilder(bertpi);
156  pi->RegisterMe(bertpi);
157  bertpi->SetMaxEnergy(maxBERT_pion);
158  pi->Build();
159 }
const Double_t pi
void CMSHadronPhysicsFTFP_BERT::Proton ( )
protectedvirtual

Definition at line 131 of file CMSHadronPhysicsFTFP_BERT.cc.

References maxBERT_proton, minFTFP_proton, and QuasiElastic.

Referenced by CreateModels().

132 {
133  auto pro = new G4ProtonBuilder;
134  AddBuilder(pro);
135  auto ftfpp = new G4FTFPProtonBuilder(QuasiElastic);
136  AddBuilder(ftfpp);
137  pro->RegisterMe(ftfpp);
138  ftfpp->SetMinEnergy(minFTFP_proton);
139  auto bertp = new G4BertiniProtonBuilder;
140  AddBuilder(bertp);
141  pro->RegisterMe(bertp);
142  bertp->SetMaxEnergy(maxBERT_proton);
143  pro->Build();
144 }
void CMSHadronPhysicsFTFP_BERT::TerminateWorker ( )
override

Definition at line 82 of file CMSHadronPhysicsFTFP_BERT.cc.

References xs_ds, and xs_k.

83 {
84  delete xs_k.Get();
85  std::for_each( xs_ds.Begin(), xs_ds.End(),[](G4VCrossSectionDataSet* el){ delete el;});
86  xs_ds.Clear();
87  G4VPhysicsConstructor::TerminateWorker();
88 }
G4Cache< G4ComponentGGHadronNucleusXsc * > xs_k
G4VectorCache< G4VCrossSectionDataSet * > xs_ds

Member Data Documentation

G4double CMSHadronPhysicsFTFP_BERT::maxBERT_kaon
protected

Definition at line 54 of file CMSHadronPhysicsFTFP_BERT.h.

Referenced by CMSHadronPhysicsFTFP_BERT(), DumpBanner(), and Kaon().

G4double CMSHadronPhysicsFTFP_BERT::maxBERT_neutron
protected

Definition at line 58 of file CMSHadronPhysicsFTFP_BERT.h.

Referenced by CMSHadronPhysicsFTFP_BERT(), DumpBanner(), and Neutron().

G4double CMSHadronPhysicsFTFP_BERT::maxBERT_pion
protected

Definition at line 52 of file CMSHadronPhysicsFTFP_BERT.h.

Referenced by CMSHadronPhysicsFTFP_BERT(), DumpBanner(), and Pion().

G4double CMSHadronPhysicsFTFP_BERT::maxBERT_proton
protected

Definition at line 56 of file CMSHadronPhysicsFTFP_BERT.h.

Referenced by CMSHadronPhysicsFTFP_BERT(), DumpBanner(), and Proton().

G4double CMSHadronPhysicsFTFP_BERT::minFTFP_kaon
protected

Definition at line 53 of file CMSHadronPhysicsFTFP_BERT.h.

Referenced by CMSHadronPhysicsFTFP_BERT(), DumpBanner(), and Kaon().

G4double CMSHadronPhysicsFTFP_BERT::minFTFP_neutron
protected

Definition at line 57 of file CMSHadronPhysicsFTFP_BERT.h.

Referenced by CMSHadronPhysicsFTFP_BERT(), DumpBanner(), and Neutron().

G4double CMSHadronPhysicsFTFP_BERT::minFTFP_pion
protected

Definition at line 51 of file CMSHadronPhysicsFTFP_BERT.h.

Referenced by CMSHadronPhysicsFTFP_BERT(), DumpBanner(), and Pion().

G4double CMSHadronPhysicsFTFP_BERT::minFTFP_proton
protected

Definition at line 55 of file CMSHadronPhysicsFTFP_BERT.h.

Referenced by CMSHadronPhysicsFTFP_BERT(), DumpBanner(), and Proton().

G4bool CMSHadronPhysicsFTFP_BERT::QuasiElastic
protected

Definition at line 39 of file CMSHadronPhysicsFTFP_BERT.h.

Referenced by Kaon(), Neutron(), Others(), Pion(), and Proton().

G4VectorCache<G4VCrossSectionDataSet*> CMSHadronPhysicsFTFP_BERT::xs_ds
protected
G4Cache<G4ComponentGGHadronNucleusXsc*> CMSHadronPhysicsFTFP_BERT::xs_k
protected