CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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_, sim::ChordFinderSetter *cfs_, const edm::ParameterSet &p)
 
void ConstructParticle ()
 
void ConstructProcess ()
 
virtual ~CMSMonopolePhysics ()
 

Private Attributes

sim::ChordFinderSetterchordFinderSetter
 
G4bool deltaRay
 
std::vector< int > elCharges
 
G4int magCharge
 
std::vector< double > masses
 
std::vector< G4Monopole * > 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_,
sim::ChordFinderSetter cfs_,
const edm::ParameterSet p 
)

Definition at line 19 of file CMSMonopolePhysics.cc.

References deltaRay, elCharges, edm::ParameterSet::getUntrackedParameter(), cuy::ii, magCharge, masses, monopoles, multiSc, names, AlCaHLTBitMon_ParallelJobs::p, pdgEncodings, AlCaHLTBitMon_QueryRunRegistry::string, and transport.

21  :
22  G4VPhysicsConstructor("Monopole Physics"), chordFinderSetter(cfs_) {
23 
24  verbose = p.getUntrackedParameter<int>("Verbosity",0);
25  magCharge = p.getUntrackedParameter<int>("MonopoleCharge",1);
26  deltaRay = p.getUntrackedParameter<bool>("MonopoleDeltaRay",true);
27  multiSc = p.getUntrackedParameter<bool>("MonopoleMultiScatter",false);
28  transport = p.getUntrackedParameter<bool>("MonopoleTransport",true);
29  double mass = p.getUntrackedParameter<double>("MonopoleMass",200);
30  if (pdt && mass > 0.0) {
31  int ii=0;
32  for (HepPDT::ParticleDataTable::const_iterator p=pdt->begin();
33  p != pdt->end(); ++p,++ii) {
34  HepPDT::ParticleData particle = (p->second);
35  std::string particleName = (particle.name()).substr(0,8);
36  if (strcmp(particleName.c_str(),"Monopole") == 0) {
37  names.push_back(particle.name());
38  masses.push_back(mass*CLHEP::GeV);
39  elCharges.push_back((int)(particle.charge()));
40  pdgEncodings.push_back(particle.pid());
41  monopoles.push_back(0);
42  //std::cout << "CMSMonopolePhysics: Monopole[" << ii
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());
50  masses.push_back(mass*CLHEP::GeV);
51  elCharges.push_back((int)(particle.charge()));
52  pdgEncodings.push_back(particle.pid());
53  monopoles.push_back(0);
54  //std::cout << "CMSMonopolePhysics: Monopole[" << ii
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;
60  }
61  }
62  }
63  // std::cout << "CMSMonopolePhysics has " << names.size()
64  if (verbose > 0) G4cout << "CMSMonopolePhysics has " << names.size()
65  << " monopole candidates and delta Ray option "
66  << deltaRay << G4endl;
67 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > pdgEncodings
int ii
Definition: cuy.py:588
std::vector< G4Monopole * > monopoles
std::vector< int > elCharges
HepPDT::ParticleData ParticleData
std::vector< std::string > names
sim::ChordFinderSetter * chordFinderSetter
std::vector< double > masses
CMSMonopolePhysics::~CMSMonopolePhysics ( )
virtual

Definition at line 69 of file CMSMonopolePhysics.cc.

69 {}

Member Function Documentation

void CMSMonopolePhysics::ConstructParticle ( )

Definition at line 71 of file CMSMonopolePhysics.cc.

References elCharges, cuy::ii, magCharge, masses, monopoles, names, and pdgEncodings.

71  {
72 
73  for (unsigned int ii=0; ii<names.size(); ++ii) {
74  if (!monopoles[ii]) {
75  G4Monopole* mpl = new G4Monopole(names[ii], pdgEncodings[ii],
76  masses[ii], ((pdgEncodings[ii] > 0 ) ? magCharge : -magCharge), elCharges[ii]);;
77  monopoles[ii] = mpl;
78  //std::cout << "Create G4Monopole " << names[ii]
79  if (verbose > 0) G4cout << "Create G4Monopole " << names[ii]
80  << " of mass " << masses[ii]/CLHEP::GeV
81  << " GeV, magnetic charge " << ((pdgEncodings[ii] > 0) ? magCharge : -magCharge)
82  << ", electric charge " << elCharges[ii]
83  << " and PDG encoding " << pdgEncodings[ii]
84  << " at " << monopoles[ii] << G4endl;
85  }
86  }
87 }
std::vector< int > pdgEncodings
int ii
Definition: cuy.py:588
std::vector< G4Monopole * > monopoles
std::vector< int > elCharges
std::vector< std::string > names
std::vector< double > masses
void CMSMonopolePhysics::ConstructProcess ( )

Definition at line 89 of file CMSMonopolePhysics.cc.

References chordFinderSetter, deltaRay, customizeTrackingMonitorSeedNumber::idx, cuy::ii, max(), mod(), monopoles, multiSc, and transport.

89  {
90  // Add standard EM Processes
91 
92  if (verbose > 0)
93  G4cout << "### CMSMonopolePhysics ConstructProcess()" << G4endl;
94  for (unsigned int ii=0; ii<monopoles.size(); ++ii) {
95  if (monopoles[ii]) {
96  G4Monopole* mpl = monopoles[ii];
97  G4ProcessManager* pmanager = new G4ProcessManager(mpl);
98  mpl->SetProcessManager(pmanager);
99 
100  G4String particleName = mpl->GetParticleName();
101  G4double magn = mpl->MagneticCharge();
102  G4double mass = mpl->GetPDGMass();
103  if (verbose > 1)
104  G4cout << "### CMSMonopolePhysics instantiates for " << particleName
105  << " at " << mpl << " Mass " << mass/CLHEP::GeV
106  << " GeV Mag " << magn << " Process manager " << pmanager
107  << G4endl;
108 
109  // defined monopole parameters and binning
110 
111  G4double emin = mass/20000.;
112  if(emin < CLHEP::keV) emin = CLHEP::keV;
113  G4double emax = std::max(10.*CLHEP::TeV, mass*100);
114  G4int nbin = G4int(std::log10(emax/emin));
115  if (nbin < 1) nbin = 1;
116  nbin *= 10;
117 
118  G4int idx = 1;
119  if (verbose > 1)
120  G4cout << "### Magnetic charge " << magn << " and electric charge "
121  << mpl->GetPDGCharge() <<"\n # of bins in dE/dx table = "
122  << nbin << " in the range " << emin << ":" << emax << G4endl;
123 
124  if (magn == 0.0 || (!transport)) {
125  pmanager->AddProcess( new G4Transportation(verbose), -1, 0, 0);
126  } else {
127  pmanager->AddProcess( new G4MonopoleTransportation(mpl,chordFinderSetter,verbose), -1, 0, 0);
128  }
129 
130  if (mpl->GetPDGCharge() != 0.0) {
131  if (multiSc) {
132  G4hMultipleScattering* hmsc = new G4hMultipleScattering();
133  pmanager->AddProcess(hmsc, -1, idx, idx);
134  ++idx;
135  }
136  if (deltaRay) {
137  G4hIonisation* hhioni = new G4hIonisation();
138  hhioni->SetDEDXBinning(nbin);
139  hhioni->SetMinKinEnergy(emin);
140  hhioni->SetMaxKinEnergy(emax);
141  pmanager->AddProcess(hhioni, -1, idx, idx);
142  } else {
143  G4hhIonisation* hhioni = new G4hhIonisation();
144  hhioni->SetDEDXBinning(nbin);
145  hhioni->SetMinKinEnergy(emin);
146  hhioni->SetMaxKinEnergy(emax);
147  pmanager->AddProcess(hhioni, -1, idx, idx);
148  }
149  ++idx;
150  }
151  if(magn != 0.0) {
152  G4mplIonisation* mplioni = new G4mplIonisation(magn);
153  mplioni->SetDEDXBinning(nbin);
154  mplioni->SetMinKinEnergy(emin);
155  mplioni->SetMaxKinEnergy(emax);
156  if (!deltaRay) {
157  G4mplIonisationWithDeltaModel* mod =
158  new G4mplIonisationWithDeltaModel(magn,"PAI");
159  mplioni->AddEmModel(0,mod,mod);
160  }
161  pmanager->AddProcess(mplioni, -1, idx, idx);
162  ++idx;
163  }
164  pmanager->AddProcess( new G4StepLimiter(), -1, -1, idx);
165  if (verbose > 1) pmanager->DumpInfo();
166  }
167  }
168 }
int ii
Definition: cuy.py:588
const T & max(const T &a, const T &b)
std::vector< G4Monopole * > monopoles
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
sim::ChordFinderSetter * chordFinderSetter
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

Member Data Documentation

sim::ChordFinderSetter* CMSMonopolePhysics::chordFinderSetter
private

Definition at line 28 of file CMSMonopolePhysics.h.

Referenced by ConstructProcess().

G4bool CMSMonopolePhysics::deltaRay
private

Definition at line 30 of file CMSMonopolePhysics.h.

Referenced by CMSMonopolePhysics(), and ConstructProcess().

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<G4Monopole*> 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(), and ConstructProcess().

G4int CMSMonopolePhysics::verbose
private

Definition at line 29 of file CMSMonopolePhysics.h.