|
|
|
@ -80,6 +80,26 @@ const G4double musrScintSD::OPSA_C17_threshold (16.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C18_threshold (17.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C19_threshold (18.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C20_threshold (19.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C21_threshold (20.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C22_threshold (22.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C23_threshold (24.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C24_threshold (26.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C25_threshold (28.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C26_threshold (30.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C27_threshold (35.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C28_threshold (40.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C29_threshold (50.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C30_threshold (60.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C31_threshold (70.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C32_threshold (80.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C33_threshold (90.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C34_threshold (100.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C35_threshold (125.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C36_threshold (150.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C37_threshold (170.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C38_threshold (200.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C39_threshold (250.);
|
|
|
|
|
const G4double musrScintSD::OPSA_C40_threshold (300.);
|
|
|
|
|
|
|
|
|
|
musrScintSD::musrScintSD(G4String name)
|
|
|
|
|
:G4VSensitiveDetector(name)
|
|
|
|
@ -715,7 +735,7 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
|
|
|
|
|
|
|
|
|
// if required, convert the histogram with photon times to histogram of electronic pulse shape
|
|
|
|
|
G4double timeCFDarray[1000];
|
|
|
|
|
G4double OPSA_timeC1[21];
|
|
|
|
|
G4double OPSA_timeC1[41];
|
|
|
|
|
if (bool_pulseShapeExists) {
|
|
|
|
|
// for (Int_t iBin=1; iBin<=OPSAhistoNbin; iBin++) { // loop over all bins of photon histogram
|
|
|
|
|
// Double_t photonCount = OPSAhisto ->GetBinContent(iBin);
|
|
|
|
@ -789,7 +809,7 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
|
|
|
|
|
|
|
|
|
if (musrRootOutput::store_odet_timeC1) {
|
|
|
|
|
Double_t yValue=-1000;
|
|
|
|
|
for (Int_t i=1; i<=20; i++) {OPSA_timeC1[i] = -1000000.;}
|
|
|
|
|
for (Int_t i=1; i<=40; i++) {OPSA_timeC1[i] = -1000000.;}
|
|
|
|
|
G4bool OPSA_C1_time_found = false; G4bool OPSA_C2_time_found = false;
|
|
|
|
|
G4bool OPSA_C3_time_found = false; G4bool OPSA_C4_time_found = false;
|
|
|
|
|
G4bool OPSA_C5_time_found = false; G4bool OPSA_C6_time_found = false;
|
|
|
|
@ -800,6 +820,16 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
|
|
|
|
G4bool OPSA_C15_time_found = false; G4bool OPSA_C16_time_found = false;
|
|
|
|
|
G4bool OPSA_C17_time_found = false; G4bool OPSA_C18_time_found = false;
|
|
|
|
|
G4bool OPSA_C19_time_found = false; G4bool OPSA_C20_time_found = false;
|
|
|
|
|
G4bool OPSA_C21_time_found = false; G4bool OPSA_C22_time_found = false;
|
|
|
|
|
G4bool OPSA_C23_time_found = false; G4bool OPSA_C24_time_found = false;
|
|
|
|
|
G4bool OPSA_C25_time_found = false; G4bool OPSA_C26_time_found = false;
|
|
|
|
|
G4bool OPSA_C27_time_found = false; G4bool OPSA_C28_time_found = false;
|
|
|
|
|
G4bool OPSA_C29_time_found = false; G4bool OPSA_C30_time_found = false;
|
|
|
|
|
G4bool OPSA_C31_time_found = false; G4bool OPSA_C32_time_found = false;
|
|
|
|
|
G4bool OPSA_C33_time_found = false; G4bool OPSA_C34_time_found = false;
|
|
|
|
|
G4bool OPSA_C35_time_found = false; G4bool OPSA_C36_time_found = false;
|
|
|
|
|
G4bool OPSA_C37_time_found = false; G4bool OPSA_C38_time_found = false;
|
|
|
|
|
G4bool OPSA_C39_time_found = false; G4bool OPSA_C40_time_found = false;
|
|
|
|
|
Double_t OPSAshape_histoMax = OPSAshape->GetMaximum();
|
|
|
|
|
for (Int_t iBin=1; iBin<=OPSAhistoNbin; iBin++) { // loop over all bins of CFD histogram
|
|
|
|
|
Double_t xValue = (iBin-0.5)*OPSAhistoBinWidth;
|
|
|
|
@ -885,13 +915,98 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
|
|
|
|
OPSA_C20_time_found = true;
|
|
|
|
|
OPSA_timeC1[20] = OPSA_timeFirst + xValue - (yValue-OPSA_C20_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (OPSA_C20_time_found) {
|
|
|
|
|
if ( (yValue>=OPSA_C21_threshold) && (!OPSA_C21_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C21_time_found = true;
|
|
|
|
|
OPSA_timeC1[21] = OPSA_timeFirst + xValue - (yValue-OPSA_C21_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C22_threshold) && (!OPSA_C22_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C22_time_found = true;
|
|
|
|
|
OPSA_timeC1[22] = OPSA_timeFirst + xValue - (yValue-OPSA_C22_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C23_threshold) && (!OPSA_C23_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C23_time_found = true;
|
|
|
|
|
OPSA_timeC1[23] = OPSA_timeFirst + xValue - (yValue-OPSA_C23_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C24_threshold) && (!OPSA_C24_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C24_time_found = true;
|
|
|
|
|
OPSA_timeC1[24] = OPSA_timeFirst + xValue - (yValue-OPSA_C24_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C25_threshold) && (!OPSA_C25_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C25_time_found = true;
|
|
|
|
|
OPSA_timeC1[25] = OPSA_timeFirst + xValue - (yValue-OPSA_C25_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C26_threshold) && (!OPSA_C26_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C26_time_found = true;
|
|
|
|
|
OPSA_timeC1[26] = OPSA_timeFirst + xValue - (yValue-OPSA_C26_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C27_threshold) && (!OPSA_C27_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C27_time_found = true;
|
|
|
|
|
OPSA_timeC1[27] = OPSA_timeFirst + xValue - (yValue-OPSA_C27_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C28_threshold) && (!OPSA_C28_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C28_time_found = true;
|
|
|
|
|
OPSA_timeC1[28] = OPSA_timeFirst + xValue - (yValue-OPSA_C28_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C29_threshold) && (!OPSA_C29_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C29_time_found = true;
|
|
|
|
|
OPSA_timeC1[29] = OPSA_timeFirst + xValue - (yValue-OPSA_C29_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C30_threshold) && (!OPSA_C30_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C30_time_found = true;
|
|
|
|
|
OPSA_timeC1[30] = OPSA_timeFirst + xValue - (yValue-OPSA_C30_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C31_threshold) && (!OPSA_C31_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C31_time_found = true;
|
|
|
|
|
OPSA_timeC1[31] = OPSA_timeFirst + xValue - (yValue-OPSA_C31_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C32_threshold) && (!OPSA_C32_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C32_time_found = true;
|
|
|
|
|
OPSA_timeC1[32] = OPSA_timeFirst + xValue - (yValue-OPSA_C32_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C33_threshold) && (!OPSA_C33_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C33_time_found = true;
|
|
|
|
|
OPSA_timeC1[33] = OPSA_timeFirst + xValue - (yValue-OPSA_C33_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C34_threshold) && (!OPSA_C34_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C34_time_found = true;
|
|
|
|
|
OPSA_timeC1[34] = OPSA_timeFirst + xValue - (yValue-OPSA_C34_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C35_threshold) && (!OPSA_C35_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C35_time_found = true;
|
|
|
|
|
OPSA_timeC1[35] = OPSA_timeFirst + xValue - (yValue-OPSA_C35_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C36_threshold) && (!OPSA_C36_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C36_time_found = true;
|
|
|
|
|
OPSA_timeC1[36] = OPSA_timeFirst + xValue - (yValue-OPSA_C36_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C37_threshold) && (!OPSA_C37_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C37_time_found = true;
|
|
|
|
|
OPSA_timeC1[37] = OPSA_timeFirst + xValue - (yValue-OPSA_C37_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C38_threshold) && (!OPSA_C38_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C38_time_found = true;
|
|
|
|
|
OPSA_timeC1[38] = OPSA_timeFirst + xValue - (yValue-OPSA_C38_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C39_threshold) && (!OPSA_C39_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C39_time_found = true;
|
|
|
|
|
OPSA_timeC1[39] = OPSA_timeFirst + xValue - (yValue-OPSA_C39_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
if ( (yValue>=OPSA_C40_threshold) && (!OPSA_C40_time_found) ) { // signal just moved above the threshold
|
|
|
|
|
OPSA_C40_time_found = true;
|
|
|
|
|
OPSA_timeC1[40] = OPSA_timeFirst + xValue - (yValue-OPSA_C40_threshold)/(yValue-oldYvalue)*OPSAhistoBinWidth; //linear interpolation
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (OPSA_C40_time_found) {
|
|
|
|
|
if (OPSA_C1_time_found && OPSA_C2_time_found && OPSA_C3_time_found && OPSA_C4_time_found &&
|
|
|
|
|
OPSA_C5_time_found && OPSA_C6_time_found && OPSA_C7_time_found && OPSA_C8_time_found &&
|
|
|
|
|
OPSA_C9_time_found && OPSA_C10_time_found && OPSA_C11_time_found && OPSA_C12_time_found &&
|
|
|
|
|
OPSA_C13_time_found && OPSA_C14_time_found && OPSA_C15_time_found && OPSA_C16_time_found &&
|
|
|
|
|
OPSA_C17_time_found && OPSA_C18_time_found && OPSA_C19_time_found) break; // all times found
|
|
|
|
|
OPSA_C17_time_found && OPSA_C18_time_found && OPSA_C19_time_found && OPSA_C20_time_found &&
|
|
|
|
|
OPSA_C21_time_found && OPSA_C22_time_found && OPSA_C23_time_found && OPSA_C24_time_found &&
|
|
|
|
|
OPSA_C25_time_found && OPSA_C26_time_found && OPSA_C27_time_found && OPSA_C28_time_found &&
|
|
|
|
|
OPSA_C29_time_found && OPSA_C30_time_found && OPSA_C31_time_found && OPSA_C32_time_found &&
|
|
|
|
|
OPSA_C33_time_found && OPSA_C34_time_found && OPSA_C35_time_found && OPSA_C36_time_found &&
|
|
|
|
|
OPSA_C37_time_found && OPSA_C38_time_found && OPSA_C39_time_found) break; // all times found
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (yValue==OPSAshape_histoMax) break; // no need for further searching, because maximum was achieved.
|
|
|
|
|