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::CMSMonopolePhysics ( const HepPDT::ParticleDataTable table_,
const edm::ParameterSet p 
)

Definition at line 17 of file CMSMonopolePhysics.cc.

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 }

References deltaRay, elCharges, ecalTB2006H4_GenSimDigiReco_cfg::G4cout, GeV, cuy::ii, magCharge, EgHLTOffHistBins_cfi::mass, masses, monopoles, multiSc, names, AlCaHLTBitMon_ParallelJobs::p, HiggsValidation_cfi::particleName, pdgEncodings, AlCaHLTBitMon_QueryRunRegistry::string, transport, and verbose.

◆ ~CMSMonopolePhysics()

CMSMonopolePhysics::~CMSMonopolePhysics ( )
override

Definition at line 56 of file CMSMonopolePhysics.cc.

56 {}

Member Function Documentation

◆ ConstructParticle()

void CMSMonopolePhysics::ConstructParticle ( )
override

Definition at line 58 of file CMSMonopolePhysics.cc.

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;
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 }

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

◆ ConstructProcess()

void CMSMonopolePhysics::ConstructProcess ( )
override

Definition at line 73 of file CMSMonopolePhysics.cc.

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 }

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

Member Data Documentation

◆ deltaRay

G4bool CMSMonopolePhysics::deltaRay
private

Definition at line 28 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructProcess().

◆ elCharges

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

Definition at line 31 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

◆ magCharge

G4int CMSMonopolePhysics::magCharge
private

Definition at line 27 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

◆ masses

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

Definition at line 30 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

◆ monopoles

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

Definition at line 32 of file CMSMonopolePhysics.h.

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

◆ multiSc

G4bool CMSMonopolePhysics::multiSc
private

Definition at line 28 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructProcess().

◆ names

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

Definition at line 29 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

◆ pdgEncodings

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

Definition at line 31 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructParticle().

◆ transport

G4bool CMSMonopolePhysics::transport
private

Definition at line 28 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics().

◆ verbose

G4int CMSMonopolePhysics::verbose
private

Definition at line 27 of file CMSMonopolePhysics.h.

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

CMSmplIonisation
Definition: CMSmplIonisation.h:35
CMSMonopolePhysics::masses
std::vector< double > masses
Definition: CMSMonopolePhysics.h:30
CaloTowersParam_cfi.mc
mc
Definition: CaloTowersParam_cfi.py:8
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
ParticleData
HepPDT::ParticleData ParticleData
Definition: ParticleDataTable.h:9
CMSMonopolePhysics::pdgEncodings
std::vector< int > pdgEncodings
Definition: CMSMonopolePhysics.h:31
CMSMonopolePhysics::monopoles
std::vector< Monopole * > monopoles
Definition: CMSMonopolePhysics.h:32
CMSMonopolePhysics::elCharges
std::vector< int > elCharges
Definition: CMSMonopolePhysics.h:31
HiggsValidation_cfi.particleName
particleName
Definition: HiggsValidation_cfi.py:7
CMSMonopolePhysics::transport
G4bool transport
Definition: CMSMonopolePhysics.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CMSMonopolePhysics::multiSc
G4bool multiSc
Definition: CMSMonopolePhysics.h:28
CMSMonopolePhysics::verbose
G4int verbose
Definition: CMSMonopolePhysics.h:27
Monopole
Definition: Monopole.h:12
Monopole::MagneticCharge
G4double MagneticCharge() const
Definition: Monopole.h:20
GeV
const double GeV
Definition: MathUtil.h:16
CMSMonopolePhysics::magCharge
G4int magCharge
Definition: CMSMonopolePhysics.h:27
Exception
Definition: hltDiff.cc:246
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
CMSMonopolePhysics::names
std::vector< std::string > names
Definition: CMSMonopolePhysics.h:29
MonopoleTransportation
Definition: MonopoleTransportation.h:45
ecalTB2006H4_GenSimDigiReco_cfg.G4cout
G4cout
Definition: ecalTB2006H4_GenSimDigiReco_cfg.py:303
edm::errors::Configuration
Definition: EDMException.h:36
cuy.ii
ii
Definition: cuy.py:590
CMSMonopolePhysics::deltaRay
G4bool deltaRay
Definition: CMSMonopolePhysics.h:28