11.2.2011 Kamil Sedlak
1) correction of GNUmakefile - by mistake a musrSimTest was set there instead of musrSim 2) replacing odet_timeE variable by odet_timeMean 3) replacing one obsolete method from stepping action (Geant 4.9.4 was complaining) by a proper method 4) update of the first part of the documentation 5) implementing a possibility to write out output Root data into a different directory 6) perhaps some other minor changes
This commit is contained in:
@ -711,9 +711,9 @@ G4VPhysicalVolume* musrDetectorConstruction::Construct() {
|
||||
myMusrScintSD -> Set_OPSA_SignalSeparationTime(fVarValue*nanosecond);
|
||||
}
|
||||
else if (strcmp(varName,"photonFractions")==0) {
|
||||
double a, b, c, d, e;
|
||||
sscanf(&line[0],"%*s %*s %*s %lf %lf %lf %lf %lf",&a, &b, &c, &d, &e);
|
||||
myMusrScintSD -> Set_OPSA_frac(a,b,c,d,e);
|
||||
double a, b, c, d;
|
||||
sscanf(&line[0],"%*s %*s %*s %lf %lf %lf %lf",&a, &b, &c, &d);
|
||||
myMusrScintSD -> Set_OPSA_frac(a,b,c,d);
|
||||
}
|
||||
else if (strcmp(varName,"eventsForOPSAhistos")==0) {
|
||||
int i_eventID, i_detectorID;
|
||||
@ -1169,7 +1169,7 @@ G4VPhysicalVolume* musrDetectorConstruction::Construct() {
|
||||
if (strcmp(tmpString2,"odet_timeB")==0) {musrRootOutput::store_odet_timeB = false;}
|
||||
if (strcmp(tmpString2,"odet_timeC")==0) {musrRootOutput::store_odet_timeC = false;}
|
||||
if (strcmp(tmpString2,"odet_timeD")==0) {musrRootOutput::store_odet_timeD = false;}
|
||||
if (strcmp(tmpString2,"odet_timeE")==0) {musrRootOutput::store_odet_timeE = false;}
|
||||
if (strcmp(tmpString2,"odet_timeMean")==0) {musrRootOutput::store_odet_timeMean = false;}
|
||||
if (strcmp(tmpString2,"odet_timeLast")==0) {musrRootOutput::store_odet_timeLast = false;}
|
||||
}
|
||||
else if(strcmp(storeIt,"on")==0) {
|
||||
|
@ -156,7 +156,7 @@ G4bool musrRootOutput::store_odet_timeA = true;
|
||||
G4bool musrRootOutput::store_odet_timeB = true;
|
||||
G4bool musrRootOutput::store_odet_timeC = true;
|
||||
G4bool musrRootOutput::store_odet_timeD = true;
|
||||
G4bool musrRootOutput::store_odet_timeE = true;
|
||||
G4bool musrRootOutput::store_odet_timeMean = true;
|
||||
G4bool musrRootOutput::store_odet_timeLast = true;
|
||||
G4bool musrRootOutput::store_odet_timeCFD = true;
|
||||
G4bool musrRootOutput::store_odet_amplCFD = true;
|
||||
@ -173,6 +173,11 @@ void musrRootOutput::BeginOfRunAction() {
|
||||
// sprintf(RootOutputFileName, "data/musr_%i.root", tmpRunNr);
|
||||
sprintf(RootOutputFileName, "%s/musr_%i.root",rootOutputDirectoryName,tmpRunNr);
|
||||
rootFile=new TFile(RootOutputFileName,"recreate");
|
||||
if (rootFile->IsZombie()) {
|
||||
char message[200];
|
||||
sprintf(message,"musrRootOutput::BeginOfRunAction() Root output file %s can not be created",RootOutputFileName);
|
||||
musrErrorMessage::GetInstance()->musrError(FATAL,message,false);
|
||||
}
|
||||
rootTree=new TTree("t1","a simple Tree with simple variables");
|
||||
if (store_runID) {rootTree->Branch("runID",&runID,"runID/I");}
|
||||
if (store_eventID) {rootTree->Branch("eventID",&eventID,"eventID/I");}
|
||||
@ -283,7 +288,7 @@ void musrRootOutput::BeginOfRunAction() {
|
||||
}
|
||||
|
||||
if (store_odet_ID || store_odet_nPhot || store_odet_timeFirst || store_odet_timeA || store_odet_timeB ||
|
||||
store_odet_timeC || store_odet_timeD || store_odet_timeE || store_odet_timeLast || store_odet_timeCFD || store_odet_amplCFD)
|
||||
store_odet_timeC || store_odet_timeD || store_odet_timeMean || store_odet_timeLast || store_odet_timeCFD || store_odet_amplCFD)
|
||||
{rootTree->Branch("odet_n",&odet_n,"odet_n/I");}
|
||||
if (store_odet_ID) {rootTree->Branch("odet_ID",&odet_ID,"odet_ID[odet_n]/I");}
|
||||
if (store_odet_nPhot) {rootTree->Branch("odet_nPhot",&odet_nPhot,"odet_nPhot[odet_n]/I");}
|
||||
@ -292,7 +297,7 @@ void musrRootOutput::BeginOfRunAction() {
|
||||
if (store_odet_timeB) {rootTree->Branch("odet_timeB",&odet_timeB,"odet_timeB[odet_n]/D");}
|
||||
if (store_odet_timeC) {rootTree->Branch("odet_timeC",&odet_timeC,"odet_timeC[odet_n]/D");}
|
||||
if (store_odet_timeD) {rootTree->Branch("odet_timeD",&odet_timeD,"odet_timeD[odet_n]/D");}
|
||||
if (store_odet_timeE) {rootTree->Branch("odet_timeE",&odet_timeE,"odet_timeE[odet_n]/D");}
|
||||
if (store_odet_timeMean) {rootTree->Branch("odet_timeMean",&odet_timeMean,"odet_timeMean[odet_n]/D");}
|
||||
if (store_odet_timeLast) {rootTree->Branch("odet_timeLast",&odet_timeLast,"odet_timeLast[odet_n]/D");}
|
||||
if (store_odet_timeCFD) {rootTree->Branch("odet_timeCFD",&odet_timeCFD,"odet_timeCFD[odet_n]/D");}
|
||||
if (store_odet_amplCFD) {rootTree->Branch("odet_amplCFD",&odet_amplCFD,"odet_amplCFD[odet_n]/D");}
|
||||
@ -534,7 +539,7 @@ void musrRootOutput::SetDetectorInfoVvv (G4int nDetectors,
|
||||
|
||||
|
||||
void musrRootOutput::SetOPSAinfo (G4int nDetectors, G4int ID, G4int nPhot, G4double timeFirst, G4double timeA,
|
||||
G4double timeB, G4double timeC, G4double timeD, G4double timeE, G4double timeLast, G4double timeCFD, G4double amplCFD)
|
||||
G4double timeB, G4double timeC, G4double timeD, G4double timeMean, G4double timeLast, G4double timeCFD, G4double amplCFD)
|
||||
{
|
||||
if ((nDetectors<0)||(nDetectors>=(odet_nMax-1))) {
|
||||
char message[200];
|
||||
@ -551,7 +556,7 @@ void musrRootOutput::SetOPSAinfo (G4int nDetectors, G4int ID, G4int nPhot, G4
|
||||
odet_timeB[nDetectors]=timeB/microsecond;
|
||||
odet_timeC[nDetectors]=timeC/microsecond;
|
||||
odet_timeD[nDetectors]=timeD/microsecond;
|
||||
odet_timeE[nDetectors]=timeE/microsecond;
|
||||
odet_timeMean[nDetectors]=timeMean/microsecond;
|
||||
odet_timeLast[nDetectors]=timeLast/microsecond;
|
||||
odet_timeCFD[nDetectors]=timeCFD/microsecond;
|
||||
odet_amplCFD[nDetectors]=amplCFD;
|
||||
|
@ -72,8 +72,9 @@ musrScintSD::musrScintSD(G4String name)
|
||||
OPSA_fracB = 0.05;
|
||||
OPSA_fracC = 0.10;
|
||||
OPSA_fracD = 0.20;
|
||||
OPSA_fracE = 0.5;
|
||||
bool_multimapOfEventIDsForOPSAhistosEXISTS = false;
|
||||
bool_StoreThisOPSAhistSUMMED = false;
|
||||
bool_StoreThisOPSAhistALL = false;
|
||||
OPSAhistoNbin = 100;
|
||||
OPSAhistoMin =0;
|
||||
OPSAhistoMax = 10.;
|
||||
@ -530,13 +531,14 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
||||
|
||||
for (optHitMapType::const_iterator it=optHitMap.begin() ; it != optHitMap.end(); it++ ) {
|
||||
G4bool boolStoreThisOPSAhist = false;
|
||||
G4bool boolStoreThisOPSAhistSUMMED = false;
|
||||
// G4bool boolStoreThisOPSAhistSUMMED = false;
|
||||
G4int OPSA_detID= it->first;
|
||||
optHitDetectorMapType* optHitDetectorMap = it->second;
|
||||
|
||||
// Check whether OPSA histograming of times of optical photon detection is required for this eventID.
|
||||
if (bool_multimapOfEventIDsForOPSAhistosEXISTS) {
|
||||
if (multimapOfEventIDsForOPSAhistos.find(eeeventID)!=multimapOfEventIDsForOPSAhistos.end()) {
|
||||
if (bool_StoreThisOPSAhistALL) boolStoreThisOPSAhist = true;
|
||||
else if (multimapOfEventIDsForOPSAhistos.find(eeeventID)!=multimapOfEventIDsForOPSAhistos.end()) {
|
||||
// Now check whether the histogramming is required for the currently analysed detector.
|
||||
std::pair<multimapOfEventIDsForOPSAhistos_Type::iterator,multimapOfEventIDsForOPSAhistos_Type::iterator> retOPSAhist;
|
||||
multimapOfEventIDsForOPSAhistos_Type::iterator itOPSAhist;
|
||||
@ -547,10 +549,10 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
||||
if ( (itOPSAhist->second == 0) || (itOPSAhist->second == OPSA_detID) ) boolStoreThisOPSAhist = true;
|
||||
}
|
||||
}
|
||||
if (multimapOfEventIDsForOPSAhistos.find(-1)!=multimapOfEventIDsForOPSAhistos.end()) {
|
||||
// The user requires to store OPSA timing histograms summed up for all events together
|
||||
boolStoreThisOPSAhistSUMMED = true;
|
||||
}
|
||||
// if (multimapOfEventIDsForOPSAhistos.find(-1)!=multimapOfEventIDsForOPSAhistos.end()) {
|
||||
// // The user requires to store OPSA timing histograms summed up for all events together
|
||||
// boolStoreThisOPSAhistSUMMED = true;
|
||||
// }
|
||||
}
|
||||
|
||||
if (optHitDetectorMap->empty()) continue;
|
||||
@ -564,7 +566,7 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
||||
G4double OPSA_timeB = -1000000;
|
||||
G4double OPSA_timeC = -1000000;
|
||||
G4double OPSA_timeD = -1000000;
|
||||
G4double OPSA_timeE = -1000000;
|
||||
G4double OPSA_timeMean = -1000000;
|
||||
G4double OPSA_timeLast = -1000000;
|
||||
G4double OPSA_CFD_time = -1000000;
|
||||
G4double OPSA_CFD_ampl = -1000;
|
||||
@ -593,7 +595,6 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
||||
G4int NB = int (OPSA_fracB * OPSA_f_nPhot + 0.5); if (NB<=0) NB=1;
|
||||
G4int NC = int (OPSA_fracC * OPSA_f_nPhot + 0.5); if (NC<=0) NC=1;
|
||||
G4int ND = int (OPSA_fracD * OPSA_f_nPhot + 0.5); if (ND<=0) ND=1;
|
||||
G4int NE = int (OPSA_fracE * OPSA_f_nPhot + 0.5); if (NE<=0) NE=1;
|
||||
|
||||
Int_t nP=0;
|
||||
// Define OPSA histograms if required for this event
|
||||
@ -614,7 +615,7 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
||||
OPSA_CFD = new TH1D(nameHist, nameHistTitle, OPSAhistoNbin, OPSAhistoMin, OPSAhistoMax);
|
||||
}
|
||||
}
|
||||
if (boolStoreThisOPSAhistSUMMED) {
|
||||
if (bool_StoreThisOPSAhistSUMMED) {
|
||||
iHistNrSUM++;
|
||||
char nameHist[200]; sprintf(nameHist,"OPSAhistSUM_%d_%d",OPSA_detID,iHistNrSUM);
|
||||
char nameHist0[200]; sprintf(nameHist0,"OPSAhistSUM0_%d_%d",OPSA_detID,iHistNrSUM);
|
||||
@ -642,10 +643,9 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
||||
if (nP==NB) OPSA_timeB = timePhot;
|
||||
if (nP==NC) OPSA_timeC = timePhot;
|
||||
if (nP==ND) OPSA_timeD = timePhot;
|
||||
if (nP==NE) OPSA_timeE = timePhot;
|
||||
if (nP==OPSA_nPhot) OPSA_timeLast = timePhot;
|
||||
if ((boolStoreThisOPSAhist)||(bool_pulseShapeExists)) OPSAhisto->Fill(timePhot-OPSA_timeFirst+0.00000000001);
|
||||
if (boolStoreThisOPSAhistSUMMED) {
|
||||
if (bool_StoreThisOPSAhistSUMMED) {
|
||||
OPSAhistoSUM ->Fill(timePhot-OPSA_timeFirst+0.00000000001);
|
||||
OPSAhistoSUM0->Fill(timePhot+0.00000000001);
|
||||
}
|
||||
@ -653,6 +653,7 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
||||
|
||||
// OPSAhisto->Fit(poiss,"Q");
|
||||
if (boolStoreThisOPSAhist) OPSAhisto->Write();
|
||||
OPSA_timeMean = OPSAhisto->GetMean();
|
||||
|
||||
// if required, convert the histogram with photon times to histogram of electronic pulse shape
|
||||
if (bool_pulseShapeExists) {
|
||||
@ -674,7 +675,7 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
||||
Double_t xValue = (iBin-0.5)*OPSAhistoBinWidth;
|
||||
OPSA_CFD->Fill(xValue,signalValue*OPSA_CFD_a1);
|
||||
Double_t xValueShifted = xValue + OPSA_CFD_delay;
|
||||
if (xValueShifted>OPSAhistoMax) break; //return if out of range;
|
||||
if (xValueShifted>OPSAhistoMax) continue; //return if out of range;
|
||||
OPSA_CFD->Fill(xValueShifted,signalValue);
|
||||
}
|
||||
if (boolStoreThisOPSAhist) OPSA_CFD -> Write();
|
||||
@ -708,7 +709,7 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
||||
}
|
||||
|
||||
signalInfo* mySignalInfo = new signalInfo(OPSA_detID,OPSA_nPhot,OPSA_timeFirst,OPSA_timeA,OPSA_timeB,OPSA_timeC,
|
||||
OPSA_timeD,OPSA_timeE,OPSA_timeLast,OPSA_CFD_time,OPSA_CFD_ampl);
|
||||
OPSA_timeD,OPSA_timeMean,OPSA_timeLast,OPSA_CFD_time,OPSA_CFD_ampl);
|
||||
OPSA_signal_Map.insert(std::pair<G4int,signalInfo*>(OPSA_nPhot,mySignalInfo) );
|
||||
}
|
||||
OPSA_nPhot = 0;
|
||||
@ -717,7 +718,7 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
||||
OPSA_timeB = -1000000;
|
||||
OPSA_timeC = -1000000;
|
||||
OPSA_timeD = -1000000;
|
||||
OPSA_timeE = -1000000;
|
||||
OPSA_timeMean = -1000000;
|
||||
OPSA_timeLast = -1000000;
|
||||
OPSA_CFD_time = -1000000;
|
||||
OPSA_CFD_ampl = -1000;
|
||||
|
@ -89,14 +89,21 @@ void musrSteppingAction::DoAtTheBeginningOfEvent() {
|
||||
void musrSteppingAction::UserSteppingAction(const G4Step* aStep) {
|
||||
|
||||
G4Track* aTrack = aStep->GetTrack();
|
||||
G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
|
||||
G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
|
||||
G4ThreeVector preStepPosition = preStepPoint->GetPosition();
|
||||
G4ThreeVector postStepPosition = postStepPoint->GetPosition();
|
||||
|
||||
// suspend the track if too many steps has already happened (relevant at high field)
|
||||
if (aTrack->GetCurrentStepNumber()>100000) {
|
||||
musrErrorMessage::GetInstance()->musrError(WARNING,
|
||||
"musrSteppingAction: Current number of steps for the track > 100000 ==> TRACK KILLED",true);
|
||||
G4double x=aStep->GetPostStepPoint()->GetPosition().x()/mm;
|
||||
G4double y=aStep->GetPostStepPoint()->GetPosition().y()/mm;
|
||||
G4double z=aStep->GetPostStepPoint()->GetPosition().z()/mm;
|
||||
// G4double x=aStep->GetPostStepPoint()->GetPosition().x()/mm;
|
||||
// G4double y=aStep->GetPostStepPoint()->GetPosition().y()/mm;
|
||||
// G4double z=aStep->GetPostStepPoint()->GetPosition().z()/mm;
|
||||
G4double x = postStepPosition.x()/mm;
|
||||
G4double y = postStepPosition.y()/mm;
|
||||
G4double z = postStepPosition.z()/mm;
|
||||
G4double E=aTrack->GetVertexKineticEnergy()/MeV;
|
||||
myRootOutput->htest1->Fill(x,y);
|
||||
myRootOutput->htest2->Fill(sqrt(x*x+y*y),z);
|
||||
@ -118,13 +125,14 @@ 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 ((aStep->GetPreStepPoint()->GetKineticEnergy()) > (1*GeV)) {
|
||||
if ((preStepPoint->GetKineticEnergy()) > (1*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.:"<<fRunManager->GetCurrentEvent()->GetEventID()
|
||||
<<", the particle \""<< aTrack->GetDynamicParticle()->GetDefinition()->GetParticleName()
|
||||
<<"\" has energy of "<<(aStep->GetPreStepPoint()->GetKineticEnergy())/GeV<<" GeV."<<G4endl;
|
||||
<<"\" has energy of "<<(preStepPoint->GetKineticEnergy())/GeV<<" GeV."<<G4endl;
|
||||
G4cout<<" Deleting the event!"<<G4endl;
|
||||
G4cout.flush();
|
||||
myRootOutput->SetEventWeight(0);
|
||||
@ -188,7 +196,7 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) {
|
||||
if (aTrack->GetCreatorProcess()->GetProcessName() == "RadioactiveDecay") {
|
||||
if (aTrack->GetDefinition()->GetParticleName()=="e-") {
|
||||
if (aTrack->GetCurrentStepNumber()==1) {
|
||||
G4double electron_kinetic_energy=aStep->GetPreStepPoint()->GetKineticEnergy();
|
||||
G4double electron_kinetic_energy=preStepPoint->GetKineticEnergy();
|
||||
myRootOutput->htest4->Fill(electron_kinetic_energy);
|
||||
}
|
||||
}
|
||||
@ -211,17 +219,17 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) {
|
||||
G4int tmpVolumeID=saveVolumeMapping[actualVolume];
|
||||
if (tmpVolumeID!=0) {
|
||||
G4int particle_id_save=p_definition->GetPDGEncoding();
|
||||
G4double ke_save=aStep->GetPreStepPoint()->GetKineticEnergy();
|
||||
G4double x_save=aStep->GetPreStepPoint()->GetPosition().x();
|
||||
G4double y_save=aStep->GetPreStepPoint()->GetPosition().y();
|
||||
G4double z_save=aStep->GetPreStepPoint()->GetPosition().z();
|
||||
G4double time_save=aStep->GetPreStepPoint()->GetGlobalTime();
|
||||
G4double px_save=aStep->GetPreStepPoint()->GetMomentum().x();
|
||||
G4double py_save=aStep->GetPreStepPoint()->GetMomentum().y();
|
||||
G4double pz_save=aStep->GetPreStepPoint()->GetMomentum().z();
|
||||
G4double polx_save=aStep->GetPreStepPoint()->GetPolarization().x();
|
||||
G4double poly_save=aStep->GetPreStepPoint()->GetPolarization().y();
|
||||
G4double polz_save=aStep->GetPreStepPoint()->GetPolarization().z();
|
||||
G4double ke_save=preStepPoint->GetKineticEnergy();
|
||||
G4double x_save=preStepPosition.x();
|
||||
G4double y_save=preStepPosition.y();
|
||||
G4double z_save=preStepPosition.z();
|
||||
G4double time_save=preStepPoint->GetGlobalTime();
|
||||
G4double px_save=preStepPoint->GetMomentum().x();
|
||||
G4double py_save=preStepPoint->GetMomentum().y();
|
||||
G4double pz_save=preStepPoint->GetMomentum().z();
|
||||
G4double polx_save=preStepPoint->GetPolarization().x();
|
||||
G4double poly_save=preStepPoint->GetPolarization().y();
|
||||
G4double polz_save=preStepPoint->GetPolarization().z();
|
||||
myRootOutput->SetSaveDetectorInfo(tmpVolumeID,particle_id_save,ke_save,x_save,y_save,z_save,time_save,px_save,py_save,pz_save,polx_save,poly_save,polz_save);
|
||||
}
|
||||
}
|
||||
@ -236,10 +244,7 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) {
|
||||
muAlreadyWasInTargetInThisEvent=true;
|
||||
myRootOutput->SetPolInTarget(aTrack->GetPolarization());
|
||||
myRootOutput->SetTimeInTarget(aTrack->GetGlobalTime());
|
||||
G4ThreeVector p_beforeEnteringTarget = aTrack->GetMomentum() - aStep->GetDeltaMomentum(); // must be - sign because DeltaMomentum is negative
|
||||
// std::cout<<"(aStep->GetDeltaMomentum()).z() = "<<(aStep->GetDeltaMomentum()).z()<<std::endl;
|
||||
myRootOutput->SetMomentumInTarget(p_beforeEnteringTarget);
|
||||
// myRootOutput->SetMomentumInTarget(aTrack->GetMomentum());
|
||||
myRootOutput->SetMomentumInTarget(preStepPoint->GetMomentum());
|
||||
}
|
||||
}
|
||||
else if ((actualVolume=="log_M0")||(actualVolume=="log_m0")) {
|
||||
@ -271,10 +276,9 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) {
|
||||
// force Geant to use very small step size.
|
||||
if (boolCalculateFieldIntegral) {
|
||||
if (F04GlobalField::Exists()) {
|
||||
G4ThreeVector position_tmp = aStep->GetPostStepPoint()->GetPosition();
|
||||
CoordinateForFieldIntegral[0] = position_tmp.x();
|
||||
CoordinateForFieldIntegral[1] = position_tmp.y();
|
||||
CoordinateForFieldIntegral[2] = position_tmp.z();
|
||||
CoordinateForFieldIntegral[0] = postStepPosition.x();
|
||||
CoordinateForFieldIntegral[1] = postStepPosition.y();
|
||||
CoordinateForFieldIntegral[2] = postStepPosition.z();
|
||||
CoordinateForFieldIntegral[3] = aTrack->GetGlobalTime();
|
||||
F04GlobalField::getObject() -> GetFieldValue(CoordinateForFieldIntegral,FieldForFieldIntegral);
|
||||
// G4cout<<"B=("<<FieldForFieldIntegral[0]/tesla<<","<<FieldForFieldIntegral[1]/tesla<<","<<FieldForFieldIntegral[2]/tesla<<")"<<G4endl;
|
||||
@ -285,15 +289,15 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) {
|
||||
BxIntegral += stepLength * FieldForFieldIntegral[0];
|
||||
ByIntegral += stepLength * FieldForFieldIntegral[1];
|
||||
BzIntegral += stepLength * FieldForFieldIntegral[2];
|
||||
BzIntegral1 += ( position_tmp.z() - aStep->GetPreStepPoint()->GetPosition().z() ) * FieldForFieldIntegral[2];
|
||||
BzIntegral1 += ( postStepPosition.z() - preStepPoint->GetPosition().z() ) * FieldForFieldIntegral[2];
|
||||
BzIntegral2 += stepLength;
|
||||
BzIntegral3 += ( position_tmp.z() - aStep->GetPreStepPoint()->GetPosition().z() );
|
||||
BzIntegral3 += ( postStepPosition.z() - preStepPoint->GetPosition().z() );
|
||||
// G4cout<<"BzIntegral="<<BzIntegral<<" stepLength="<<stepLength<<"FieldForFieldIntegral[2]="<<FieldForFieldIntegral[2]<<G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Pick up process "DecayWithSpin":
|
||||
const G4VProcess* process = aStep->GetPostStepPoint()->GetProcessDefinedStep();
|
||||
const G4VProcess* process = postStepPoint->GetProcessDefinedStep();
|
||||
if (process!=NULL) {
|
||||
G4String processName = process->GetProcessName();
|
||||
if (processName=="DecayWithSpin") {
|
||||
@ -324,9 +328,8 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) {
|
||||
|
||||
// Store the information about the decaying muon and store it in the Root tree
|
||||
G4double timeOfDecay_tmp=aTrack->GetGlobalTime();
|
||||
G4ThreeVector positionOfDecay_tmp = aStep->GetPostStepPoint()->GetPosition();
|
||||
G4double BFieldAtOrigin[6] = {0.,0.,0.,0.,0.,0.};
|
||||
G4double PointOfDecay[4] ={positionOfDecay_tmp.x(),positionOfDecay_tmp.y(),positionOfDecay_tmp.z(),timeOfDecay_tmp};
|
||||
G4double PointOfDecay[4] ={postStepPosition.x(),postStepPosition.y(),postStepPosition.z(),timeOfDecay_tmp};
|
||||
if (F04GlobalField::Exists()) {
|
||||
F04GlobalField* myGlobalField = F04GlobalField::getObject();
|
||||
myGlobalField->GetFieldValue(PointOfDecay,BFieldAtOrigin);
|
||||
@ -344,7 +347,7 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) {
|
||||
}
|
||||
myRootOutput->SetDecayTime(timeOfDecay_tmp);
|
||||
myRootOutput->SetDecayPolarisation(aTrack->GetPolarization());
|
||||
myRootOutput->SetDecayPosition(positionOfDecay_tmp);
|
||||
myRootOutput->SetDecayPosition(postStepPosition);
|
||||
myRootOutput->SetDecayDetectorID(actualVolume);
|
||||
myRootOutput->SetBField(BFieldAtOrigin);
|
||||
if (boolCalculateFieldIntegral) {
|
||||
@ -362,10 +365,6 @@ void musrSteppingAction::UserSteppingAction(const G4Step* aStep) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// G4ThreeVector position = aStep->GetPostStepPoint()->GetPosition();
|
||||
// G4ThreeVector polarization=aTrack->GetDynamicParticle()->GetPolarization();
|
||||
}
|
||||
|
||||
else { // particle is not muon
|
||||
|
Reference in New Issue
Block a user