5 #include "G4ParticleDefinition.hh"
6 #include "G4ProcessManager.hh"
8 #include "G4StepLimiter.hh"
9 #include "G4Transportation.hh"
10 #include "G4MonopoleTransportation.hh"
11 #include "G4mplIonisation.hh"
12 #include "G4mplIonisationWithDeltaModel.hh"
13 #include "G4hMultipleScattering.hh"
14 #include "G4hIonisation.hh"
15 #include "G4hhIonisation.hh"
17 #include "CLHEP/Units/GlobalSystemOfUnits.h"
22 G4VPhysicsConstructor(
"Monopole Physics"), chordFinderSetter(cfs_) {
30 if (pdt && mass > 0.0) {
32 for (HepPDT::ParticleDataTable::const_iterator p=pdt->begin();
33 p != pdt->end(); ++
p,++
ii) {
35 std::string particleName = (particle.name()).substr(0,8);
36 if (strcmp(particleName.c_str(),
"Monopole") == 0) {
37 names.push_back(particle.name());
39 elCharges.push_back((
int)(particle.charge()));
43 if (
verbose > 0) G4cout <<
"CMSMonopolePhysics: Monopole[" << ii
44 <<
"] " << particleName <<
" Mass "
45 << particle.mass() <<
" GeV, Magnetic Charge "
46 << magCharge <<
", Electric Charge "
47 << particle.charge() << G4endl;
48 }
else if(strcmp(particleName.c_str(),
"AntiMono") == 0) {
49 names.push_back(particle.name());
51 elCharges.push_back((
int)(particle.charge()));
55 if (
verbose > 0) G4cout <<
"CMSMonopolePhysics: Monopole[" << ii
56 <<
"] " << particleName <<
" Mass "
57 << particle.mass() <<
" GeV, Magnetic Charge "
58 << magCharge <<
", Electric Charge "
59 << particle.charge() << G4endl;
64 if (
verbose > 0) G4cout <<
"CMSMonopolePhysics has " <<
names.size()
65 <<
" monopole candidates and delta Ray option "
66 << deltaRay << G4endl;
93 G4cout <<
"### CMSMonopolePhysics ConstructProcess()" << G4endl;
97 G4ProcessManager *pmanager = mpl->GetProcessManager();
100 o <<
"Monopole without a Process Manager";
101 G4Exception(
"CMSMonopolePhysics::ConstructProcess()",
"",
102 FatalException,o.str().c_str());
108 const G4int procLength = pmanager->GetProcessListLength();
109 for(G4int ip=procLength-1; ip >= 0; --ip) {
110 G4VProcess *
proc = pmanager->RemoveProcess(ip);
112 std::ostringstream
o;
113 o <<
"Clearing Monopole Process Manager failed for process " << ip <<
", total number of processes " << procLength;
114 G4Exception(
"CMSMonopolePhysics::ConstructProcess()",
"",
115 FatalException,o.str().c_str());
119 G4String particleName = mpl->GetParticleName();
120 G4double magn = mpl->MagneticCharge();
121 G4double
mass = mpl->GetPDGMass();
123 G4cout <<
"### CMSMonopolePhysics instantiates for " << particleName
124 <<
" at " << mpl <<
" Mass " << mass/
CLHEP::GeV
125 <<
" GeV Mag " << magn <<
" Process manager " << pmanager
130 G4double emin = mass/20000.;
131 if(emin < CLHEP::keV) emin = CLHEP::keV;
132 G4double emax =
std::max(10.*CLHEP::TeV, mass*100);
133 G4int nbin = G4int(std::log10(emax/emin));
134 if (nbin < 1) nbin = 1;
139 G4cout <<
"### Magnetic charge " << magn <<
" and electric charge "
140 << mpl->GetPDGCharge() <<
"\n # of bins in dE/dx table = "
141 << nbin <<
" in the range " << emin <<
":" << emax << G4endl;
144 pmanager->AddProcess(
new G4Transportation(
verbose), -1, 0, 0);
149 if (mpl->GetPDGCharge() != 0.0) {
151 G4hMultipleScattering* hmsc =
new G4hMultipleScattering();
152 pmanager->AddProcess(hmsc, -1, idx, idx);
156 G4hIonisation* hhioni =
new G4hIonisation();
157 hhioni->SetDEDXBinning(nbin);
158 hhioni->SetMinKinEnergy(emin);
159 hhioni->SetMaxKinEnergy(emax);
160 pmanager->AddProcess(hhioni, -1, idx, idx);
162 G4hhIonisation* hhioni =
new G4hhIonisation();
163 hhioni->SetDEDXBinning(nbin);
164 hhioni->SetMinKinEnergy(emin);
165 hhioni->SetMaxKinEnergy(emax);
166 pmanager->AddProcess(hhioni, -1, idx, idx);
171 G4mplIonisation* mplioni =
new G4mplIonisation(magn);
172 mplioni->SetDEDXBinning(nbin);
173 mplioni->SetMinKinEnergy(emin);
174 mplioni->SetMaxKinEnergy(emax);
176 G4mplIonisationWithDeltaModel*
mod =
177 new G4mplIonisationWithDeltaModel(magn,
"PAI");
178 mplioni->AddEmModel(0,mod,mod);
180 pmanager->AddProcess(mplioni, -1, idx, idx);
183 pmanager->AddProcess(
new G4StepLimiter(), -1, -1, idx);
184 if (
verbose > 1) pmanager->DumpInfo();
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > pdgEncodings
HepPDT::ParticleDataTable ParticleDataTable
virtual ~CMSMonopolePhysics()
TrainProcessor *const proc
std::vector< G4Monopole * > monopoles
CMSMonopolePhysics(const HepPDT::ParticleDataTable *table_, sim::ChordFinderSetter *cfs_, const edm::ParameterSet &p)
std::vector< int > elCharges
HepPDT::ParticleData ParticleData
std::vector< std::string > names
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
sim::ChordFinderSetter * chordFinderSetter
std::vector< double > masses
T mod(const T &a, const T &b)