diff --git a/include/MuDecayChannel.hh b/include/MuDecayChannel.hh index 77232a3..90acbf5 100644 --- a/include/MuDecayChannel.hh +++ b/include/MuDecayChannel.hh @@ -38,6 +38,7 @@ #ifndef MuDecayChannel_h #define MuDecayChannel_h 1 +#include #include "G4ios.hh" #include "globals.hh" #include "G4VDecayChannel.hh" diff --git a/include/musrRootOutput.hh b/include/musrRootOutput.hh index 965452b..cb78117 100644 --- a/include/musrRootOutput.hh +++ b/include/musrRootOutput.hh @@ -24,6 +24,7 @@ #ifndef musrRootOutput_h #define musrRootOutput_h 1 //#include "G4UserRunAction.hh" +#include #include "globals.hh" #include "G4ThreeVector.hh" // ROOT diff --git a/src/MuDecayChannelWithSpin.cc b/src/MuDecayChannelWithSpin.cc index cfd06a0..2c12e17 100644 --- a/src/MuDecayChannelWithSpin.cc +++ b/src/MuDecayChannelWithSpin.cc @@ -45,7 +45,6 @@ // ------------------------------------------------------------ // #include "MuDecayChannelWithSpin.hh" - #include "Randomize.hh" #include "G4DecayProducts.hh" #include "G4LorentzVector.hh" @@ -70,11 +69,11 @@ G4DecayProducts *MuDecayChannelWithSpin::DecayIt(G4double) if (GetVerboseLevel()>1) G4cout << "MuDecayChannelWithSpin::DecayIt "; #endif - if (parent == 0) FillParent(); - if (daughters == 0) FillDaughters(); + if (G4MT_parent == 0) FillParent(); + if (G4MT_daughters == 0) FillDaughters(); // parent mass - G4double parentmass = parent->GetPDGMass(); + G4double parentmass = G4MT_parent->GetPDGMass(); EMMU = parentmass; @@ -82,7 +81,7 @@ G4DecayProducts *MuDecayChannelWithSpin::DecayIt(G4double) G4double daughtermass[3]; G4double sumofdaughtermass = 0.0; for (G4int index=0; index<3; index++){ - daughtermass[index] = daughters[index]->GetPDGMass(); + daughtermass[index] = G4MT_daughters[index]->GetPDGMass(); sumofdaughtermass += daughtermass[index]; } @@ -90,7 +89,7 @@ G4DecayProducts *MuDecayChannelWithSpin::DecayIt(G4double) //create parent G4DynamicParticle at rest G4ThreeVector dummy; - G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0); + G4DynamicParticle * parentparticle = new G4DynamicParticle( G4MT_parent, dummy, 0.0); //create G4Decayproducts G4DecayProducts *products = new G4DecayProducts(*parentparticle); delete parentparticle; @@ -176,7 +175,7 @@ G4DecayProducts *MuDecayChannelWithSpin::DecayIt(G4double) rndm = G4UniformRand(); - G4double phi = twopi * rndm; + G4double phi = CLHEP::twopi * rndm; if(energy < EMASS) energy = EMASS; @@ -200,7 +199,7 @@ G4DecayProducts *MuDecayChannelWithSpin::DecayIt(G4double) direction0.rotateUz(parent_polarization); G4DynamicParticle * daughterparticle0 - = new G4DynamicParticle( daughters[0], daughtermomentum[0]*direction0); + = new G4DynamicParticle( G4MT_daughters[0], daughtermomentum[0]*direction0); products->PushProducts(daughterparticle0); @@ -212,15 +211,15 @@ G4DecayProducts *MuDecayChannelWithSpin::DecayIt(G4double) G4double beta = -1.0*daughtermomentum[0]/energy2; G4double costhetan = 2.*G4UniformRand()-1.0; G4double sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan)); - G4double phin = twopi*G4UniformRand()*rad; + G4double phin = CLHEP::twopi*G4UniformRand()*CLHEP::rad; G4double sinphin = std::sin(phin); G4double cosphin = std::cos(phin); G4ThreeVector direction1(sinthetan*cosphin,sinthetan*sinphin,costhetan); G4DynamicParticle * daughterparticle1 - = new G4DynamicParticle( daughters[1], direction1*(vmass/2.)); + = new G4DynamicParticle( G4MT_daughters[1], direction1*(vmass/2.)); G4DynamicParticle * daughterparticle2 - = new G4DynamicParticle( daughters[2], direction1*(-1.0*vmass/2.)); + = new G4DynamicParticle (G4MT_daughters[2], direction1*(-1.0*vmass/2.)); // boost to the muon rest frame G4LorentzVector p4; diff --git a/src/musrSteppingAction.cc b/src/musrSteppingAction.cc index 41d2d9f..0e4bacc 100644 --- a/src/musrSteppingAction.cc +++ b/src/musrSteppingAction.cc @@ -110,10 +110,10 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) { sprintf(eMessage,"musrSteppingAction: Current number of steps for the track > %d ==> TRACK KILLED", musrParameters::maximumNrOfStepsPerTrack); musrErrorMessage::GetInstance()->musrError(WARNING,eMessage,true); - G4double x = postStepPosition.x()/mm; - G4double y = postStepPosition.y()/mm; - G4double z = postStepPosition.z()/mm; - G4double E=aTrack->GetVertexKineticEnergy()/MeV; + G4double x = postStepPosition.x()/CLHEP::mm; + G4double y = postStepPosition.y()/CLHEP::mm; + G4double z = postStepPosition.z()/CLHEP::mm; + G4double E=aTrack->GetVertexKineticEnergy()/CLHEP::MeV; myRootOutput->htest1->Fill(x,y); myRootOutput->htest2->Fill(sqrt(x*x+y*y),z); myRootOutput->htest3->Fill(E); @@ -136,13 +136,13 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) { // Temporary fix to avoid crashes caused by particles with unphysically high energies // (probably corrupted event?) // if ((aStep->GetPreStepPoint()->GetKineticEnergy()) > (1*GeV)) { - if ((preStepPoint->GetKineticEnergy()) > (1*GeV)) { + if ((preStepPoint->GetKineticEnergy()) > (1*CLHEP::GeV)) { musrErrorMessage::GetInstance()->musrError(SERIOUS, "musrSteppingAction: kinetic energy of a particle larger than 1GeV! STRANGE FOR muSR!",false); G4RunManager* fRunManager = G4RunManager::GetRunManager(); G4cout<<" Event nr.:"<GetCurrentEvent()->GetEventID() <<", the particle \""<< aTrack->GetDynamicParticle()->GetDefinition()->GetParticleName() - <<"\" has energy of "<<(preStepPoint->GetKineticEnergy())/GeV<<" GeV."<GetKineticEnergy())/CLHEP::GeV<<" GeV."<SetEventWeight(0);