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

63 {}

Member Function Documentation

void CMSMonopolePhysics::ConstructParticle ( )
override

Definition at line 65 of file CMSMonopolePhysics.cc.

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

65  {
66 
67  for (unsigned int ii=0; ii<names.size(); ++ii) {
68  // monopoles are created once in the master thread
69  if (!monopoles[ii]) {
70  G4int mc = (pdgEncodings[ii] >= 0 ) ? magCharge : -magCharge;
71  Monopole* mpl = new Monopole(names[ii], pdgEncodings[ii], masses[ii],
72  mc, elCharges[ii]);
73  monopoles[ii] = mpl;
74  if (verbose > 0) G4cout << "Create Monopole " << names[ii]
75  << " of mass " << masses[ii]/CLHEP::GeV
76  << " GeV, magnetic charge " << mc
77  << ", electric charge " << elCharges[ii]
78  << " and PDG encoding " << pdgEncodings[ii]
79  << " at " << monopoles[ii] << G4endl;
80  }
81  }
82 }
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 84 of file CMSMonopolePhysics.cc.

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

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

Member Data Documentation

G4bool CMSMonopolePhysics::deltaRay
private

Definition at line 30 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics().

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

Definition at line 33 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

G4int CMSMonopolePhysics::magCharge
private

Definition at line 29 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

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

Definition at line 32 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

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

Definition at line 34 of file CMSMonopolePhysics.h.

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

G4bool CMSMonopolePhysics::multiSc
private

Definition at line 30 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructProcess().

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

Definition at line 31 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

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

Definition at line 33 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

G4bool CMSMonopolePhysics::transport
private

Definition at line 30 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics().

G4int CMSMonopolePhysics::verbose
private

Definition at line 29 of file CMSMonopolePhysics.h.