7.2.2011 Kamil Sedlak

1) Constant fraction discriminator added to the analysis of the 
     optical photon signal. 
  2) Bug fixes in the optical photon simulation.
  3) A few other small improvements.
This commit is contained in:
2011-02-07 16:07:38 +00:00
parent d11e19a7d8
commit a5e99ed164
10 changed files with 10389 additions and 73 deletions

View File

@ -80,7 +80,8 @@ class musrRootOutput {
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);
G4double timeB, G4double timeC, G4double timeD, G4double timeE, G4double timeLast,
G4double timeCFD, G4double amplCFD);
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) ;
@ -124,7 +125,7 @@ class musrRootOutput {
else {G4cout<<"musrRootOutput.hh::StoreGeantParameter: index="<<i<<" out of range"
<<" (maxNGeantParameters=" <<maxNGeantParameters<<")"<<G4endl;}
};
void setRootOutputDirectoryName(char dirName[1000]);
TH2F *htest1, *htest2;
TH1F *htest3, *htest4, *htest5, *htest6, *htest7, *htest8;
@ -222,6 +223,8 @@ class musrRootOutput {
static G4bool store_odet_timeD;
static G4bool store_odet_timeE;
static G4bool store_odet_timeLast;
static G4bool store_odet_timeCFD;
static G4bool store_odet_amplCFD;
static G4int oldEventNumberInG4EqEMFieldWithSpinFunction;
@ -230,6 +233,7 @@ class musrRootOutput {
TTree* rootTree;
static musrRootOutput* pointerToRoot;
static const Int_t maxNGeantParameters=30;
char rootOutputDirectoryName[1000];
Double_t GeantParametersD[maxNGeantParameters]; // parameters transfered from GEANT to Root
// 0 ... fieldOption: 0 ... no field, 1 ... uniform, 2 ... gaussian, 3 ... from table
// 1 ... fieldValue: intensity of the magnetic field
@ -327,6 +331,8 @@ class musrRootOutput {
G4double odet_timeD[odet_nMax];
G4double odet_timeE[odet_nMax];
G4double odet_timeLast[odet_nMax];
G4double odet_timeCFD[odet_nMax];
G4double odet_amplCFD[odet_nMax];
public:
static const Int_t save_nMax=1000;

View File

@ -34,12 +34,14 @@ class G4HCofThisEvent;
class signalInfo {
public:
signalInfo(G4int id, G4int nP, G4double tFirst,
G4double tA, G4double tB, G4double tC, G4double tD, G4double tE, G4double tLast) {
G4double tA, G4double tB, G4double tC, G4double tD, G4double tE, G4double tLast,
G4double tCFD, G4double aCFD) {
detID=id; nPhot=nP; timeFirst=tFirst;
timeA=tA; timeB=tB; timeC=tC; timeD=tD; timeE=tE; timeLast=tLast;}
timeA=tA; timeB=tB; timeC=tC; timeD=tD; timeE=tE; timeLast=tLast;
timeCFD=tCFD; amplCFD=aCFD;}
~signalInfo() {}
void transferDataToRoot(musrRootOutput* myRootOut, G4int nn) {
myRootOut->SetOPSAinfo(nn,detID,nPhot,timeFirst,timeA,timeB,timeC,timeD,timeE,timeLast);
myRootOut->SetOPSAinfo(nn,detID,nPhot,timeFirst,timeA,timeB,timeC,timeD,timeE,timeLast,timeCFD,amplCFD);
}
private:
@ -55,6 +57,8 @@ class signalInfo {
G4double timeD;
G4double timeE;
G4double timeLast;
G4double timeCFD;
G4double amplCFD;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@ -69,17 +73,26 @@ class musrScintSD : public G4VSensitiveDetector
void Initialize(G4HCofThisEvent*);
G4bool ProcessHits(G4Step*, G4TouchableHistory*);
void EndOfEvent(G4HCofThisEvent*);
void EndOfRun();
// 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 Set_OPSA_CFD(G4double a1, G4double delay, G4double timeShiftOffset)
{OPSA_CFD_a1=a1; OPSA_CFD_delay=delay; OPSA_CFD_timeShiftOffset = timeShiftOffset;}
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;
OPSAhistoBinWidth=(max-min)/nBins; OPSAhistoBinWidth1000=OPSAhistoBinWidth*1000;
}
void ProcessOpticalPhoton(G4Step*);
void EndOfEvent_OptiacalPhotons();
void ReadInPulseShapeArray(const char* filename);
private:
static musrScintSD* pointer;
@ -111,7 +124,19 @@ class musrScintSD : public G4VSensitiveDetector
multimapOfEventIDsForOPSAhistos_Type multimapOfEventIDsForOPSAhistos;
TH1D* OPSAhisto;
Int_t OPSAhistoNbin;
Double_t OPSAhistoMin, OPSAhistoMax;
Double_t OPSAhistoMin, OPSAhistoMax, OPSAhistoBinWidth, OPSAhistoBinWidth1000;
typedef std::map<std::string,TH1D*> mapOfOPSAsumHistograms_Type;
mapOfOPSAsumHistograms_Type mapOfOPSAsumHistograms;
mapOfOPSAsumHistograms_Type mapOfOPSAsum0Histograms;
TH1D* OPSAhistoSUM;
TH1D* OPSAhistoSUM0;
TH1D* OPSAshape;
G4bool bool_pulseShapeExists;
G4int iPSmax;
G4double pulseShapeArray[10001];
TH1D* OPSA_CFD;
G4double OPSA_CFD_a1,OPSA_CFD_delay, OPSA_CFD_timeShiftOffset;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......