diff --git a/DDG4/lcio/Geant4Output2LCIO.cpp b/DDG4/lcio/Geant4Output2LCIO.cpp index d5adee47045faa3436e6f9da5fed22c26c08bc4c..2aa8ff6ded5a733769886ecf6bd34aab50425f84 100644 --- a/DDG4/lcio/Geant4Output2LCIO.cpp +++ b/DDG4/lcio/Geant4Output2LCIO.cpp @@ -183,17 +183,17 @@ lcio::LCCollectionVec* Geant4Output2LCIO::saveParticles(Geant4ParticleMap* parti MCParticleImpl* q = new lcio::MCParticleImpl(); q->setPDG(p->pdgID); - float ps_fa[3] = {float(p->psx/GeV),float(p->psy/GeV),float(p->psz/GeV)}; + float ps_fa[3] = {float(p->psx/CLHEP::GeV),float(p->psy/CLHEP::GeV),float(p->psz/CLHEP::GeV)}; q->setMomentum( ps_fa ); - double vs_fa[3] = { p->vsx/mm, p->vsy/mm, p->vsz/mm } ; + double vs_fa[3] = { p->vsx/CLHEP::mm, p->vsy/CLHEP::mm, p->vsz/CLHEP::mm } ; q->setVertex( vs_fa ); - double ve_fa[3] = { p->vex/mm, p->vey/mm, p->vez/mm } ; + double ve_fa[3] = { p->vex/CLHEP::mm, p->vey/CLHEP::mm, p->vez/CLHEP::mm } ; q->setEndpoint( ve_fa ); - q->setTime(p->time/ns); - q->setMass(p->mass/GeV); + q->setTime(p->time/CLHEP::ns); + q->setMass(p->mass/CLHEP::GeV); q->setCharge(def ? def->GetPDGCharge() : 0); // Charge(e+) = 1 ! // Set generator status diff --git a/DDG4/lcio/LCIOEventReader.cpp b/DDG4/lcio/LCIOEventReader.cpp index 1a0cf097b1c039882db48f84ee4adfe3748972b0..5bda98d11ec22d5971a62b790a5c48d1d6b7da57 100644 --- a/DDG4/lcio/LCIOEventReader.cpp +++ b/DDG4/lcio/LCIOEventReader.cpp @@ -95,24 +95,24 @@ LCIOEventReader::readParticles(int event_number, vector<Particle*>& particles) PropertyMask status(p->status); p->pdgID = pdg; p->charge = int(mcp->getCharge()*3.0); - p->psx = mom[0]*GeV; - p->psy = mom[1]*GeV; - p->psz = mom[2]*GeV; - p->time = mcp->getTime()*ns; - p->properTime = mcp->getTime()*ns; - p->vsx = vsx[0]*mm; - p->vsy = vsx[1]*mm; - p->vsz = vsx[2]*mm; - p->vex = vex[0]*mm; - p->vey = vex[1]*mm; - p->vez = vex[2]*mm; + p->psx = mom[0]*CLHEP::GeV; + p->psy = mom[1]*CLHEP::GeV; + p->psz = mom[2]*CLHEP::GeV; + p->time = mcp->getTime()*CLHEP::ns; + p->properTime = mcp->getTime()*CLHEP::ns; + p->vsx = vsx[0]*CLHEP::mm; + p->vsy = vsx[1]*CLHEP::mm; + p->vsz = vsx[2]*CLHEP::mm; + p->vex = vex[0]*CLHEP::mm; + p->vey = vex[1]*CLHEP::mm; + p->vez = vex[2]*CLHEP::mm; p->process = 0; p->spin[0] = spin[0]; p->spin[1] = spin[1]; p->spin[2] = spin[2]; p->colorFlow[0] = color[0]; p->colorFlow[0] = color[1]; - p->mass = mcp->getMass()*GeV; + p->mass = mcp->getMass()*CLHEP::GeV; const EVENT::MCParticleVec &par = mcp->getParents(), &dau=mcp->getDaughters(); for(int num=dau.size(),k=0; k<num; ++k) p->daughters.insert(GET_ENTRY(mcparts,dau[k])); diff --git a/DDG4/plugins/Geant4FieldTrackingSetup.cpp b/DDG4/plugins/Geant4FieldTrackingSetup.cpp index a373565cb665a3a06dc4c3563d099563b47e73b7..6d89b84fedca72a8ab768ff3a474e82c3777ae06 100644 --- a/DDG4/plugins/Geant4FieldTrackingSetup.cpp +++ b/DDG4/plugins/Geant4FieldTrackingSetup.cpp @@ -141,7 +141,7 @@ namespace { Geant4FieldTrackingSetup::Geant4FieldTrackingSetup() : eq_typ(), stepper_typ() { eps_min = -1.0; eps_max = -1.0; - min_chord_step = 1.0e-2 *mm; + min_chord_step = 1.0e-2 *CLHEP::mm; delta_chord = -1.0; delta_one_step = -1.0; delta_intersection = -1.0; diff --git a/DDG4/plugins/Geant4SDActions.cpp b/DDG4/plugins/Geant4SDActions.cpp index f309cb56689a7509ebb6cc7a933e52a17415ca24..5b66094fa9d3e3d9b2c20fe8f138d30f50d5e62a 100644 --- a/DDG4/plugins/Geant4SDActions.cpp +++ b/DDG4/plugins/Geant4SDActions.cpp @@ -248,8 +248,8 @@ namespace DD4hep { collection->add(hit); sensitive->printM2("+++ TrackID:%6d [%s] CREATE hit combination with %2d deposit(s):" " %e MeV Pos:%8.2f %8.2f %8.2f", - pre.truth.trackID,sensitive->c_name(),combined,pre.truth.deposit/MeV, - pos.X()/mm,pos.Y()/mm,pos.Z()/mm); + pre.truth.trackID,sensitive->c_name(),combined,pre.truth.deposit/CLHEP::MeV, + pos.X()/CLHEP::mm,pos.Y()/CLHEP::mm,pos.Z()/CLHEP::mm); clear(); } @@ -265,7 +265,7 @@ namespace DD4hep { extractHit(coll); } /// There must be something in. - if ( h.deposit()/keV <= 0 ) { + if ( h.deposit()/CLHEP::keV <= 0 ) { return false; } /// Initialize the deposits of the next hit. diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp index ba905b05920a7f713341e6ffb9f7b266ec99fa17..bd834e28da3dd2ff9c2b97f5bcb1a235445cafa5 100644 --- a/DDG4/src/Geant4Converter.cpp +++ b/DDG4/src/Geant4Converter.cpp @@ -294,7 +294,7 @@ void* Geant4Converter::handleElement(const string& name, const Atom element) con } } else { - g4e = new G4Element(element->GetTitle(), name, element->Z(), element->A() * (g / mole)); + g4e = new G4Element(element->GetTitle(), name, element->Z(), element->A() * (CLHEP::g / CLHEP::mole)); } stringstream str; str << (*g4e); @@ -313,7 +313,7 @@ void* Geant4Converter::handleMaterial(const string& name, Material medium) const if (!mat) { TGeoMaterial* m = medium->GetMaterial(); G4State state = kStateUndefined; - double density = m->GetDensity() * (gram / cm3); + double density = m->GetDensity() * (CLHEP::gram / CLHEP::cm3); if (density < 1e-25) density = 1e-25; switch (m->GetState()) { diff --git a/DDG4/src/Geant4InputHandling.cpp b/DDG4/src/Geant4InputHandling.cpp index fb34c11eeecea1a15c368e22e19aa8ffbeffbb09..2adb54e2222aef555ee72086d8da60ffb14bd64b 100644 --- a/DDG4/src/Geant4InputHandling.cpp +++ b/DDG4/src/Geant4InputHandling.cpp @@ -156,8 +156,8 @@ int DD4hep::Simulation::boostInteraction(const Geant4Action* /* caller */, // Now move begin and end-vertex of all primary vertices accordingly for(iv=inter->vertices.begin(); iv != inter->vertices.end(); ++iv) { Geant4Vertex* v = (*iv).second; - double t = gamma * v->time + betagamma * v->x / c_light; - double x = gamma * v->x + betagamma * c_light * v->time; + double t = gamma * v->time + betagamma * v->x / CLHEP::c_light; + double x = gamma * v->x + betagamma * CLHEP::c_light * v->time; double y = v->y; double z = v->z; v->x = x; @@ -169,8 +169,8 @@ int DD4hep::Simulation::boostInteraction(const Geant4Action* /* caller */, // Now move begin and end-vertex of all primary and generator particles accordingly for(ip=inter->particles.begin(); ip != inter->particles.end(); ++ip) { Geant4ParticleHandle p = (*ip).second; - double t = gamma * p->time + betagamma * p->vsx / c_light; - double x = gamma * p->vsx + betagamma * c_light * p->time; + double t = gamma * p->time + betagamma * p->vsx / CLHEP::c_light; + double x = gamma * p->vsx + betagamma * CLHEP::c_light * p->time; double y = p->vsx; double z = p->vsz; @@ -318,7 +318,7 @@ int DD4hep::Simulation::generatePrimaries(const Geant4Action* caller, G4PrimaryVertex* v4 = new G4PrimaryVertex(v->x,v->y,v->z,v->time); event->AddPrimaryVertex(v4); caller->print("+++++ G4PrimaryVertex at (%+.2e,%+.2e,%+.2e) [mm] %+.2e [ns]", - v->x/mm,v->y/mm,v->z/mm,v->time/ns); + v->x/CLHEP::mm,v->y/CLHEP::mm,v->z/CLHEP::mm,v->time/CLHEP::ns); for(Geant4Vertex::Particles::const_iterator ip=v->out.begin(); ip!=v->out.end(); ++ip) { Geant4ParticleHandle p = pm[*ip]; if ( p->daughters.size() > 0 ) { diff --git a/DDG4/src/Geant4IsotropeGenerator.cpp b/DDG4/src/Geant4IsotropeGenerator.cpp index b0b83b06e7866c77920766ae83857c5b8bfd07b0..c0ea420f382d1c628e603617f845c66f57db028c 100644 --- a/DDG4/src/Geant4IsotropeGenerator.cpp +++ b/DDG4/src/Geant4IsotropeGenerator.cpp @@ -33,7 +33,7 @@ Geant4IsotropeGenerator::Geant4IsotropeGenerator(Geant4Context* context, const s InstanceCount::increment(this); m_needsControl = true; declareProperty("Particle", m_particleName = "e-"); - declareProperty("Energy", m_energy = 50 * MeV); + declareProperty("Energy", m_energy = 50 * CLHEP::MeV); declareProperty("Multiplicity", m_multiplicity = 1); declareProperty("Mask", m_mask = 0); declareProperty("Position", m_position); @@ -94,7 +94,7 @@ void Geant4IsotropeGenerator::operator()(G4Event*) { inter->particles.insert(make_pair(p->id,p)); vtx->out.insert(p->id); printout(INFO,name(),"Particle [%d] %s %.3f GeV direction:(%6.3f %6.3f %6.3f)", - p->id, m_particleName.c_str(), momentum/GeV, x1, x2, x3); + p->id, m_particleName.c_str(), momentum/CLHEP::GeV, x1, x2, x3); } } diff --git a/DDG4/src/Geant4Particle.cpp b/DDG4/src/Geant4Particle.cpp index b9c7a7dda7dbcd469c6fbf082f7d26a27383ba00..581333e7ec636dbb22afc9c18d58d66bf7fb2f64 100644 --- a/DDG4/src/Geant4Particle.cpp +++ b/DDG4/src/Geant4Particle.cpp @@ -283,7 +283,7 @@ void Geant4ParticleHandle::dumpWithVertex(int level, const std::string& src, con "+++ %s ID:%3d %-12s status:%08X PDG:%6d Vtx:(%+.2e,%+.2e,%+.2e)[mm] " "time: %+.2e [ns] #Dau:%3d #Par:%1d%-6s", tag,p->id,p.particleName().c_str(),p->status,p->pdgID, - p->vsx/mm,p->vsy/mm,p->vsz/mm,p->time/ns, + p->vsx/CLHEP::mm,p->vsy/CLHEP::mm,p->vsz/CLHEP::mm,p->time/CLHEP::ns, p->daughters.size(), p->parents.size(), text); @@ -306,7 +306,7 @@ void Geant4ParticleHandle::dumpWithMomentum(int level, const std::string& src, c "+++%s ID:%3d %-12s stat:%08X PDG:%6d Mom:(%+.2e,%+.2e,%+.2e)[MeV] " "time: %+.2e [ns] #Dau:%3d #Par:%1d%-6s", tag,p->id,p.particleName().c_str(),p->status,p->pdgID, - p->psx/MeV,p->psy/MeV,p->psz/MeV,p->time/ns, + p->psx/CLHEP::MeV,p->psy/CLHEP::MeV,p->psz/CLHEP::MeV,p->time/CLHEP::ns, int(p->daughters.size()), int(p->parents.size()), text); @@ -328,8 +328,8 @@ void Geant4ParticleHandle::dumpWithMomentumAndVertex(int level, const std::strin "+++%s %3d %-12s stat:%08X PDG:%6d Mom:(%+.2e,%+.2e,%+.2e)[MeV] " "Vtx:(%+.2e,%+.2e,%+.2e)[mm] #Dau:%3d #Par:%1d%-6s", tag,p->id,p.particleName().c_str(),p->status,p->pdgID, - p->psx/MeV,p->psy/MeV,p->psz/MeV, - p->vsx/mm,p->vsy/mm,p->vsz/mm, + p->psx/CLHEP::MeV,p->psy/CLHEP::MeV,p->psz/CLHEP::MeV, + p->vsx/CLHEP::mm,p->vsy/CLHEP::mm,p->vsz/CLHEP::mm, int(p->daughters.size()), int(p->parents.size()), text); diff --git a/DDG4/src/Geant4ParticleGun.cpp b/DDG4/src/Geant4ParticleGun.cpp index 7a0705a5f669f84069ef8213c058002f8114e401..8b873c69bc4e7848f5152c92673f917fe6a3a383 100644 --- a/DDG4/src/Geant4ParticleGun.cpp +++ b/DDG4/src/Geant4ParticleGun.cpp @@ -36,7 +36,7 @@ Geant4ParticleGun::Geant4ParticleGun(Geant4Context* context, const string& name) InstanceCount::increment(this); m_needsControl = true; declareProperty("particle", m_particleName = "e-"); - declareProperty("energy", m_energy = 50 * MeV); + declareProperty("energy", m_energy = 50 * CLHEP::MeV); declareProperty("multiplicity", m_multiplicity = 1); declareProperty("position", m_position); declareProperty("direction", m_direction); @@ -82,7 +82,7 @@ void Geant4ParticleGun::operator()(G4Event* event) { } } print("Shoot [%d] %.3f GeV %s pos:(%.3f %.3f %.3f)[mm] dir:(%6.3f %6.3f %6.3f)", - m_shotNo, m_energy/GeV, m_particleName.c_str(), + m_shotNo, m_energy/CLHEP::GeV, m_particleName.c_str(), m_position.X(), m_position.Y(), m_position.Z(), m_direction.X(),m_direction.Y(), m_direction.Z()); diff --git a/DDG4/src/Geant4ParticleHandler.cpp b/DDG4/src/Geant4ParticleHandler.cpp index 050a546f821c1658323ed65f74e15683d8d1cd5d..cc538c2babc95cc11ae183f2e91c846de31b3fc1 100644 --- a/DDG4/src/Geant4ParticleHandler.cpp +++ b/DDG4/src/Geant4ParticleHandler.cpp @@ -70,7 +70,7 @@ Geant4ParticleHandler::Geant4ParticleHandler(Geant4Context* context, const strin declareProperty("PrintStartTracking", m_printStartTracking = false); declareProperty("KeepAllParticles", m_keepAll = false); declareProperty("SaveProcesses", m_processNames); - declareProperty("MinimalKineticEnergy",m_kinEnergyCut = 100e0*MeV); + declareProperty("MinimalKineticEnergy",m_kinEnergyCut = 100e0*CLHEP::MeV); m_needsControl = true; }