CMS 3D CMS Logo

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

#include <CMSMonopolePhysics.h>

Inheritance diagram for CMSMonopolePhysics:

Public Member Functions

 CMSMonopolePhysics (const HepPDT::ParticleDataTable *table_, const edm::ParameterSet &p)
 
void ConstructParticle () override
 
void ConstructProcess () override
 
 ~CMSMonopolePhysics () override
 

Private Attributes

G4bool deltaRay
 
std::vector< int > elCharges
 
G4int magCharge
 
std::vector< double > masses
 
std::vector< Monopole * > monopoles
 
G4bool multiSc
 
std::vector< std::string > names
 
std::vector< int > pdgEncodings
 
G4bool transport
 
G4int verbose
 

Detailed Description

Definition at line 18 of file CMSMonopolePhysics.h.

Constructor & Destructor Documentation

CMSMonopolePhysics::CMSMonopolePhysics ( const HepPDT::ParticleDataTable table_,
const edm::ParameterSet p 
)

Definition at line 17 of file CMSMonopolePhysics.cc.

References deltaRay, elCharges, ecalTB2006H4_GenSimDigiReco_cfg::G4cout, edm::ParameterSet::getUntrackedParameter(), GeV, cuy::ii, magCharge, ResonanceBuilder::mass, masses, monopoles, multiSc, names, AlCaHLTBitMon_ParallelJobs::p, HiggsValidation_cfi::particleName, pdgEncodings, AlCaHLTBitMon_QueryRunRegistry::string, and transport.

18  : G4VPhysicsConstructor("Monopole Physics") {
19  verbose = p.getUntrackedParameter<int>("Verbosity", 0);
20  magCharge = p.getUntrackedParameter<int>("MonopoleCharge", 1);
21  deltaRay = p.getUntrackedParameter<bool>("MonopoleDeltaRay", true);
22  multiSc = p.getUntrackedParameter<bool>("MonopoleMultiScatter", false);
23  transport = p.getUntrackedParameter<bool>("MonopoleTransport", true);
24  double mass = p.getUntrackedParameter<double>("MonopoleMass", 200);
25  if (pdt && mass > 0.0) {
26  int ii = 0;
27  for (HepPDT::ParticleDataTable::const_iterator p = pdt->begin(); p != pdt->end(); ++p, ++ii) {
28  HepPDT::ParticleData particle = (p->second);
29  std::string particleName = (particle.name()).substr(0, 8);
30  if (strcmp(particleName.c_str(), "Monopole") == 0) {
31  names.push_back(particle.name());
32  masses.push_back(mass * CLHEP::GeV);
33  elCharges.push_back((int)(particle.charge()));
34  pdgEncodings.push_back(particle.pid());
35  monopoles.push_back(nullptr);
36  if (verbose > 0)
37  G4cout << "CMSMonopolePhysics: Monopole[" << ii << "] " << particleName << " Mass " << particle.mass()
38  << " GeV, Magnetic Charge " << magCharge << ", Electric Charge " << particle.charge() << G4endl;
39  } else if (strcmp(particleName.c_str(), "AntiMono") == 0) {
40  names.push_back(particle.name());
41  masses.push_back(mass * CLHEP::GeV);
42  elCharges.push_back((int)(particle.charge()));
43  pdgEncodings.push_back(particle.pid());
44  monopoles.push_back(nullptr);
45  if (verbose > 0)
46  G4cout << "CMSMonopolePhysics: Monopole[" << ii << "] " << particleName << " Mass " << particle.mass()
47  << " GeV, Magnetic Charge " << magCharge << ", Electric Charge " << particle.charge() << G4endl;
48  }
49  }
50  }
51  if (verbose > 0)
52  G4cout << "CMSMonopolePhysics has " << names.size() << " monopole candidates and delta Ray option " << deltaRay
53  << G4endl;
54 }
T getUntrackedParameter(std::string const &, T const &) const
const double GeV
Definition: MathUtil.h:16
std::vector< int > pdgEncodings
std::vector< Monopole * > monopoles
std::vector< int > elCharges
HepPDT::ParticleData ParticleData
std::vector< std::string > names
ii
Definition: cuy.py:590
std::vector< double > masses
CMSMonopolePhysics::~CMSMonopolePhysics ( )
override

Definition at line 56 of file CMSMonopolePhysics.cc.

56 {}

Member Function Documentation

void CMSMonopolePhysics::ConstructParticle ( )
override

Definition at line 58 of file CMSMonopolePhysics.cc.

References elCharges, ecalTB2006H4_GenSimDigiReco_cfg::G4cout, GeV, cuy::ii, magCharge, masses, CaloTowersParam_cfi::mc, monopoles, names, and pdgEncodings.

58  {
59  for (unsigned int ii = 0; ii < names.size(); ++ii) {
60  // monopoles are created once in the master thread
61  if (!monopoles[ii]) {
62  G4int mc = (pdgEncodings[ii] >= 0) ? magCharge : -magCharge;
63  Monopole* mpl = new Monopole(names[ii], pdgEncodings[ii], masses[ii], mc, elCharges[ii]);
64  monopoles[ii] = mpl;
65  if (verbose > 0)
66  G4cout << "Create Monopole " << names[ii] << " of mass " << masses[ii] / CLHEP::GeV << " GeV, magnetic charge "
67  << mc << ", electric charge " << elCharges[ii] << " and PDG encoding " << pdgEncodings[ii] << " at "
68  << monopoles[ii] << G4endl;
69  }
70  }
71 }
const double GeV
Definition: MathUtil.h:16
std::vector< int > pdgEncodings
std::vector< Monopole * > monopoles
std::vector< int > elCharges
std::vector< std::string > names
ii
Definition: cuy.py:590
std::vector< double > masses
void CMSMonopolePhysics::ConstructProcess ( )
override

Definition at line 73 of file CMSMonopolePhysics.cc.

References edm::errors::Configuration, deltaRay, Exception, ecalTB2006H4_GenSimDigiReco_cfg::G4cout, GeV, cuy::ii, Monopole::MagneticCharge(), ResonanceBuilder::mass, monopoles, multiSc, and connectstrParser::o.

73  {
74  // Add standard EM Processes
75  if (verbose > 0) {
76  G4cout << "### CMSMonopolePhysics ConstructProcess()" << G4endl;
77  }
78  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
79 
80  for (unsigned int ii = 0; ii < monopoles.size(); ++ii) {
81  if (monopoles[ii]) {
82  Monopole* mpl = monopoles[ii];
83  G4ProcessManager* pmanager = mpl->GetProcessManager();
84  if (!pmanager) {
85  std::ostringstream o;
86  o << "Monopole without a Process Manager";
87  throw edm::Exception(edm::errors::Configuration, o.str().c_str());
88  return;
89  }
90 
91  G4double magn = mpl->MagneticCharge();
92  G4double mass = mpl->GetPDGMass();
93  if (verbose > 1) {
94  G4cout << "### CMSMonopolePhysics instantiates for " << mpl->GetParticleName() << " at " << mpl << " Mass "
95  << mass / CLHEP::GeV << " GeV Mag " << magn << " Process manager " << pmanager << G4endl;
96  }
97 
98  if (magn != 0.0) {
99  G4int idxt(0);
100  pmanager->RemoveProcess(idxt);
101  pmanager->AddProcess(new MonopoleTransportation(mpl, verbose), -1, 0, 0);
102  }
103 
104  if (mpl->GetPDGCharge() != 0.0) {
105  if (multiSc) {
106  G4hMultipleScattering* hmsc = new G4hMultipleScattering();
107  ph->RegisterProcess(hmsc, mpl);
108  }
109  G4hIonisation* hioni = new G4hIonisation();
110  ph->RegisterProcess(hioni, mpl);
111  }
112  if (magn != 0.0) {
113  CMSmplIonisation* mplioni = new CMSmplIonisation(magn);
114  if (!deltaRay) {
115  G4mplIonisationModel* ion = new G4mplIonisationModel(magn, "PAI");
116  ion->SetParticle(mpl);
117  mplioni->AddEmModel(0, ion, ion);
118  }
119  ph->RegisterProcess(mplioni, mpl);
120  }
121  pmanager->AddDiscreteProcess(new G4StepLimiter());
122  if (verbose > 1) {
123  pmanager->DumpInfo();
124  }
125  }
126  }
127 }
const double GeV
Definition: MathUtil.h:16
std::vector< Monopole * > monopoles
ii
Definition: cuy.py:590
G4double MagneticCharge() const
Definition: Monopole.h:20

Member Data Documentation

G4bool CMSMonopolePhysics::deltaRay
private

Definition at line 28 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructProcess().

std::vector<int> CMSMonopolePhysics::elCharges
private

Definition at line 31 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

G4int CMSMonopolePhysics::magCharge
private

Definition at line 27 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

std::vector<double> CMSMonopolePhysics::masses
private

Definition at line 30 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

std::vector<Monopole*> CMSMonopolePhysics::monopoles
private

Definition at line 32 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), ConstructParticle(), and ConstructProcess().

G4bool CMSMonopolePhysics::multiSc
private

Definition at line 28 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructProcess().

std::vector<std::string> CMSMonopolePhysics::names
private

Definition at line 29 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

std::vector<int> CMSMonopolePhysics::pdgEncodings
private

Definition at line 31 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

G4bool CMSMonopolePhysics::transport
private

Definition at line 28 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics().

G4int CMSMonopolePhysics::verbose
private

Definition at line 27 of file CMSMonopolePhysics.h.