21.1.2011 Kamil Sedlak
This version contains many changes!
1) Optical photon simulation is now possible - some work still may need to be done
(e.g. the manual is not updated yet), but it should basically work already now.
2) Changes in the musrSimAna - correction of some bugs (mainly in the coincidence
of coincidence and veto detectors) and some other improvements
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4OpticalSurface.hh"
|
||||
#include <map>
|
||||
|
||||
class G4Tubs;
|
||||
@@ -47,7 +48,7 @@ class musrDetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
musrDetectorConstruction();
|
||||
musrDetectorConstruction(G4String steeringFileName);
|
||||
~musrDetectorConstruction();
|
||||
|
||||
public:
|
||||
@@ -61,6 +62,7 @@ public:
|
||||
void ReportProblemInStearingFile(char* myString);
|
||||
G4Material* CharToMaterial(char myString[100]);
|
||||
G4LogicalVolume* FindLogicalVolume(G4String LogicalVolumeName);
|
||||
G4VPhysicalVolume* FindPhysicalVolume(G4String PhysicalVolumeName);
|
||||
void SetColourOfLogicalVolume(G4LogicalVolume* pLogVol,char* colour);
|
||||
|
||||
private:
|
||||
@@ -73,6 +75,10 @@ private:
|
||||
|
||||
std::map<std::string,G4RotationMatrix*> pointerToRotationMatrix;
|
||||
std::map<std::string,G4FieldManager*> pointerToField;
|
||||
|
||||
std::map<std::string,G4MaterialPropertiesTable*> materialPropertiesTableMap;
|
||||
std::map<std::string,G4MaterialPropertiesTable*>::iterator itMPT;
|
||||
|
||||
|
||||
private:
|
||||
void DefineMaterials();
|
||||
|
||||
@@ -79,6 +79,9 @@ class musrRootOutput {
|
||||
G4double ekVertex, G4double xVertex, G4double yVertex, G4double zVertex,
|
||||
G4int idVolVertex, G4int idProcVertex, G4int idTrackVertex, G4int particleID) ;
|
||||
|
||||
void SetOPSAinfo (G4int nDetectors, G4int ID, G4int nPhot, G4double timeFirst, G4double timeA,
|
||||
G4double timeB, G4double timeC, G4double timeD, G4double timeE, G4double timeLast);
|
||||
|
||||
void SetSaveDetectorInfo (G4int ID, G4int particleID, G4double ke, G4double x, G4double y, G4double z, G4double time,
|
||||
G4double px, G4double py, G4double pz, G4double polx, G4double poly, G4double polz) ;
|
||||
|
||||
@@ -208,7 +211,15 @@ class musrRootOutput {
|
||||
static G4bool store_fieldIntegralBz1;
|
||||
static G4bool store_fieldIntegralBz2;
|
||||
static G4bool store_fieldIntegralBz3;
|
||||
|
||||
static G4bool store_odet_ID;
|
||||
static G4bool store_odet_nPhot;
|
||||
static G4bool store_odet_timeFirst;
|
||||
static G4bool store_odet_timeA;
|
||||
static G4bool store_odet_timeB;
|
||||
static G4bool store_odet_timeC;
|
||||
static G4bool store_odet_timeD;
|
||||
static G4bool store_odet_timeE;
|
||||
static G4bool store_odet_timeLast;
|
||||
|
||||
static G4int oldEventNumberInG4EqEMFieldWithSpinFunction;
|
||||
|
||||
@@ -299,6 +310,21 @@ class musrRootOutput {
|
||||
G4int det_VvvTrackID[det_nMax];
|
||||
G4int det_VvvParticleID[det_nMax];
|
||||
|
||||
public:
|
||||
static const Int_t odet_nMax=det_nMax;
|
||||
|
||||
private:
|
||||
G4int odet_n;
|
||||
G4int odet_ID[odet_nMax];
|
||||
G4int odet_nPhot[odet_nMax];
|
||||
G4double odet_timeFirst[odet_nMax];
|
||||
G4double odet_timeA[odet_nMax];
|
||||
G4double odet_timeB[odet_nMax];
|
||||
G4double odet_timeC[odet_nMax];
|
||||
G4double odet_timeD[odet_nMax];
|
||||
G4double odet_timeE[odet_nMax];
|
||||
G4double odet_timeLast[odet_nMax];
|
||||
|
||||
public:
|
||||
static const Int_t save_nMax=1000;
|
||||
|
||||
|
||||
@@ -31,26 +31,87 @@
|
||||
class G4Step;
|
||||
class G4HCofThisEvent;
|
||||
|
||||
class signalInfo {
|
||||
public:
|
||||
signalInfo(G4int id, G4int nP, G4double tFirst,
|
||||
G4double tA, G4double tB, G4double tC, G4double tD, G4double tE, G4double tLast) {
|
||||
detID=id; nPhot=nP; timeFirst=tFirst;
|
||||
timeA=tA; timeB=tB; timeC=tC; timeD=tD; timeE=tE; timeLast=tLast;}
|
||||
~signalInfo() {}
|
||||
void transferDataToRoot(musrRootOutput* myRootOut, G4int nn) {
|
||||
myRootOut->SetOPSAinfo(nn,detID,nPhot,timeFirst,timeA,timeB,timeC,timeD,timeE,timeLast);
|
||||
}
|
||||
|
||||
private:
|
||||
G4int detID;
|
||||
G4int nPhot;
|
||||
G4int nPhot_abs;
|
||||
G4int nPhot_refl;
|
||||
G4int nPhot_other;
|
||||
G4double timeFirst;
|
||||
G4double timeA;
|
||||
G4double timeB;
|
||||
G4double timeC;
|
||||
G4double timeD;
|
||||
G4double timeE;
|
||||
G4double timeLast;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class musrScintSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
musrScintSD(G4String);
|
||||
~musrScintSD();
|
||||
static musrScintSD* GetInstance();
|
||||
musrScintSD(G4String);
|
||||
~musrScintSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*);
|
||||
G4bool ProcessHits(G4Step*, G4TouchableHistory*);
|
||||
void EndOfEvent(G4HCofThisEvent*);
|
||||
void Initialize(G4HCofThisEvent*);
|
||||
G4bool ProcessHits(G4Step*, G4TouchableHistory*);
|
||||
void EndOfEvent(G4HCofThisEvent*);
|
||||
|
||||
// Optical Photon Signal Analysis (OPSA)
|
||||
void Set_OPSA_minNrOfDetectedPhotons(G4int val) {OPSA_minNrOfDetectedPhotons=val;}
|
||||
void Set_OPSA_SignalSeparationTime(G4double val) {OPSA_signalSeparationTime=val;}
|
||||
void Set_OPSA_frac(G4double a, G4double b, G4double c, G4double d, G4double e)
|
||||
{OPSA_fracA=a; OPSA_fracB=b; OPSA_fracC=c; OPSA_fracD=d; OPSA_fracE=e;}
|
||||
void AddEventIDToMultimapOfEventIDsForOPSAhistos (G4int ev_ID, G4int detector_ID)
|
||||
{bool_multimapOfEventIDsForOPSAhistosEXISTS=true; multimapOfEventIDsForOPSAhistos.insert(std::pair<G4int,G4int>(ev_ID,detector_ID));}
|
||||
void SetOPSAhistoBinning(Int_t nBins, Double_t min, Double_t max) {OPSAhistoNbin=nBins; OPSAhistoMin=min; OPSAhistoMax=max;}
|
||||
void ProcessOpticalPhoton(G4Step*);
|
||||
void EndOfEvent_OptiacalPhotons();
|
||||
|
||||
private:
|
||||
static musrScintSD* pointer;
|
||||
musrScintHitsCollection* scintCollection;
|
||||
G4bool myStoreOnlyEventsWithHits;
|
||||
G4int myStoreOnlyEventsWithHitInDetID;
|
||||
G4double mySignalSeparationTime;
|
||||
G4bool myStoreOnlyTheFirstTimeHit;
|
||||
G4bool boolIsVvvInfoRequested;
|
||||
musrRootOutput* myRootOutput;
|
||||
|
||||
// for optical photon counting
|
||||
typedef std::multimap<G4double,Int_t> optHitDetectorMapType;
|
||||
typedef std::map<Int_t,optHitDetectorMapType*> optHitMapType;
|
||||
optHitMapType optHitMap;
|
||||
// for optical photon signal analysis (OPSA)
|
||||
G4int OPSA_minNrOfDetectedPhotons;
|
||||
G4double OPSA_signalSeparationTime;
|
||||
G4double OPSA_fracA;
|
||||
G4double OPSA_fracB;
|
||||
G4double OPSA_fracC;
|
||||
G4double OPSA_fracD;
|
||||
G4double OPSA_fracE;
|
||||
typedef std::multimap<G4int,signalInfo*> OPSA_signal_MapType;
|
||||
OPSA_signal_MapType OPSA_signal_Map;
|
||||
|
||||
G4bool bool_multimapOfEventIDsForOPSAhistosEXISTS;
|
||||
typedef std::multimap<G4int,G4int> multimapOfEventIDsForOPSAhistos_Type;
|
||||
multimapOfEventIDsForOPSAhistos_Type multimapOfEventIDsForOPSAhistos;
|
||||
TH1D* OPSAhisto;
|
||||
Int_t OPSAhistoNbin;
|
||||
Double_t OPSAhistoMin, OPSAhistoMax;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#ifndef musrSteppingAction_h
|
||||
#define musrSteppingAction_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "globals.hh"
|
||||
@@ -32,6 +31,7 @@
|
||||
|
||||
class G4Timer;
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class musrSteppingAction : public G4UserSteppingAction
|
||||
@@ -55,10 +55,10 @@ class musrSteppingAction : public G4UserSteppingAction
|
||||
void SetCalculationOfFieldIntegralRequested(G4bool decision) {boolCalculateFieldIntegral = decision;}
|
||||
|
||||
private:
|
||||
musrRootOutput* myRootOutput;
|
||||
G4Timer* timer;
|
||||
time_t realTimeWhenThisEventStarted;
|
||||
static musrSteppingAction* pointer;
|
||||
musrRootOutput* myRootOutput;
|
||||
|
||||
G4bool muAlreadyWasInTargetInThisEvent;
|
||||
G4bool muAlreadyWasInM0InThisEvent;
|
||||
|
||||
Reference in New Issue
Block a user