From 46705b6100dc7ba82adc0333dfc55ca01366fddc Mon Sep 17 00:00:00 2001 From: Michael Nieslony Date: Tue, 24 Aug 2021 04:59:45 -0500 Subject: [PATCH 1/4] add more tuning parameters --- include/WCSimDetectorConstruction.hh | 4 ++- include/WCSimRootOptions.hh | 10 +++++- include/WCSimTuningMessenger.hh | 3 ++ include/WCSimTuningParameters.hh | 12 +++++++ macros/tuning_parameters.mac | 5 ++- src/WCSimConstructMaterials.cc | 54 +++++++++++++++++++--------- src/WCSimConstructPMT.cc | 20 +++++++++-- src/WCSimRootOptions.cc | 3 ++ src/WCSimStackingAction.cc | 14 ++++++-- src/WCSimTuningMessenger.cc | 42 ++++++++++++++++++++++ src/WCSimTuningParameters.cc | 6 ++++ src/WCSimWCSD.cc | 26 ++++++++++---- 12 files changed, 168 insertions(+), 31 deletions(-) diff --git a/include/WCSimDetectorConstruction.hh b/include/WCSimDetectorConstruction.hh index 7e59ce1e7..727cf4605 100644 --- a/include/WCSimDetectorConstruction.hh +++ b/include/WCSimDetectorConstruction.hh @@ -255,7 +255,8 @@ public: G4String GetIDCollectionName(){return WCIDCollectionName;} // ⚠ G4String GetIDCollectionName2(){return WCIDCollectionName2;} - + WCSimTuningParameters* Get_TuningParams(){return WCSimTuningParams;} + private: // Tuning parameters @@ -275,6 +276,7 @@ private: //Glass, Cathode surface in PMTs G4OpticalSurface * OpGlassCathodeSurface; + G4OpticalSurface * OpGlassCathodeSurface_R7081; //Tyvek surface - jl145 G4OpticalSurface * OpWaterTySurface; diff --git a/include/WCSimRootOptions.hh b/include/WCSimRootOptions.hh index 1b8233cc1..72ded149c 100644 --- a/include/WCSimRootOptions.hh +++ b/include/WCSimRootOptions.hh @@ -111,25 +111,30 @@ public: void SetBsrff(double iBsrff) {Bsrff = iBsrff;} void SetAbwff(double iAbwff) {Abwff = iAbwff;} void SetRgcff(double iRgcff) {Rgcff = iRgcff;} + void SetRgcffR7081(double iRgcffR7081) {RgcffR7081 = iRgcffR7081;} void SetMieff(double iMieff) {Mieff = iMieff;} void SetTeflonrff(double iTeflonrff) {Teflonrff = iTeflonrff;} void SetHolderrff(double iHolderrff) {Holderrff = iHolderrff;} void SetHolderrffLUX(double iHolderrffLUX) {HolderrffLUX = iHolderrffLUX;} void SetLinerrff(double iLinerrff) {Linerrff = iLinerrff;} void SetHolder(bool iHolder) {Holder = iHolder;} + void SetQERatio(double iQERatio) {QERatio = iQERatio;} + void SetQERatioWB(double iQERatioWB) {QERatioWB = iQERatioWB;} void SetTvspacing(double iTvspacing) {Tvspacing = iTvspacing;} void SetTopveto(bool iTopveto) {Topveto = iTopveto;} //WCSimTuningParameters gets double GetRayff() {return Rayff;} double GetBsrff() {return Bsrff;} double GetAbwff() {return Abwff;} - double GetRgcff() {return Rgcff;} + double GetRgcffR7081() {return RgcffR7081;} double GetMieff() {return Mieff;} double GetTeflonrff() {return Teflonrff;} double GetLinerrff() {return Linerrff;} double GetHolderrff() {return Holderrff;} double GetHolderrffLUX() {return HolderrffLUX;} bool GetHolder() {return Holder;} + double GetQERatio() {return QERatio;} + double GetQERatioWB() {return QERatioWB;} double GetTvspacing() {return Tvspacing;} bool GetTopveto() {return Topveto;} //WCSimPhysicsListFactory sets @@ -198,12 +203,15 @@ private: double Bsrff; double Abwff; double Rgcff; + double RgcffR7081; double Mieff; double Teflonrff; double Linerrff; double Holderrff; double HolderrffLUX; bool Holder; + double QERatio; + double QERatioWB; double Tvspacing; bool Topveto; diff --git a/include/WCSimTuningMessenger.hh b/include/WCSimTuningMessenger.hh index 88a921cbc..e8da1c7a6 100644 --- a/include/WCSimTuningMessenger.hh +++ b/include/WCSimTuningMessenger.hh @@ -31,6 +31,7 @@ private: G4UIcmdWithADouble* Bsrff; G4UIcmdWithADouble* Abwff; G4UIcmdWithADouble* Rgcff; + G4UIcmdWithADouble* RgcffR7081; G4UIcmdWithADouble* Mieff; //ANNIE commands @@ -39,6 +40,8 @@ private: G4UIcmdWithADouble* Holderrff; G4UIcmdWithADouble* HolderrffLUX; G4UIcmdWithABool *Holder; + G4UIcmdWithADouble* Qeratio; + G4UIcmdWithADouble* QeratioWB; //For Top Veto - jl145 G4UIcmdWithADouble* TVSpacing; diff --git a/include/WCSimTuningParameters.hh b/include/WCSimTuningParameters.hh index 3f0888c0a..73b098ea1 100644 --- a/include/WCSimTuningParameters.hh +++ b/include/WCSimTuningParameters.hh @@ -24,6 +24,9 @@ public: G4double GetRgcff() {return rgcff;} void SetRgcff(G4double rparam) {rgcff=rparam;} + G4double GetRgcffR7081() {return rgcffr7081;} + void SetRgcffR7081(G4double rparam) {rgcffr7081 = rparam;} + G4double GetMieff() {return mieff;} void SetMieff(G4double rparam) {mieff=rparam;} @@ -43,6 +46,12 @@ public: G4bool GetHolder() {return holder;} void SetHolder(G4double hparam) {holder=hparam;} + G4double GetQERatio() {return QEratio;} + void SetQERatio(G4double qeratio) {QEratio = qeratio;} + + G4double GetQERatioWB() {return QEratioWB;} + void SetQERatioWB(G4double qeratiowb) {QEratioWB = qeratiowb;} + //For Top Veto - jl145 G4double GetTVSpacing() {return tvspacing;} void SetTVSpacing(G4double tparam) {tvspacing=tparam;} @@ -64,6 +73,7 @@ private: G4double bsrff; G4double abwff; G4double rgcff; + G4double rgcffr7081; G4double mieff; // ANNIE-specfic tuning parameters @@ -72,6 +82,8 @@ private: G4double holderrfflux; //LUX/ETEL holders --> Reflectivity tuning factor G4double linerrff; //Liner --> Reflectivity tuning factor G4bool holder; //Should ANNIE PMT holders be implemented in the simulation? + G4double QEratio; //Factor by which the PMT Q.E. can be scaled + G4double QEratioWB; //Factor by which the WB PMT Q.E. can be scaled //For Top Veto - jl145 G4double tvspacing; diff --git a/macros/tuning_parameters.mac b/macros/tuning_parameters.mac index a53d3e203..bc7459780 100644 --- a/macros/tuning_parameters.mac +++ b/macros/tuning_parameters.mac @@ -7,10 +7,13 @@ /WCSim/tuning/mieff 0.0 # ANNIE tuning parameters -/WCSim/tuning/teflonrff 0.90 #default: 0.90 +/WCSim/tuning/teflonrff 1.00 #default: 1.00 /WCSim/tuning/holderrff 0.90 #default: 0.90 /WCSim/tuning/holderrfflux 0.70 #default: 0.70 /WCSim/tuning/linerrff 0.87 #default: 0.87 +/WCSim/tuning/QEratio 1.40 #default: 1.40 +/WCSim/tuning/rgcffr7081 0.32 #default: 0.32 +/WCSim/tuning/QEratioWB 1.00 #default: 1.00 #Turning holders on (1) or off (0) /WCSim/tuning/holder 1 diff --git a/src/WCSimConstructMaterials.cc b/src/WCSimConstructMaterials.cc index 48111ca69..5b85a0c3f 100644 --- a/src/WCSimConstructMaterials.cc +++ b/src/WCSimConstructMaterials.cc @@ -226,6 +226,12 @@ void WCSimDetectorConstruction::ConstructMaterials() //Glass->AddMaterial(Al2O3, 2.3*CLHEP::perCent); //Put in 2.3 percent if the other 4 materials = 0.1 percent + G4Material *GlassR7081 = new G4Material("GlassR7081",density,4); + GlassR7081->AddMaterial(SiO2, 80.6*CLHEP::perCent); + GlassR7081->AddMaterial(B2O3, 13.0*CLHEP::perCent); + GlassR7081->AddMaterial(Na2O, 4.0*CLHEP::perCent); + GlassR7081->AddMaterial(Al2O3, 2.4*CLHEP::perCent); + //---Rock // a = 16.00*CLHEP::g/CLHEP::mole; G4Element* elO = new G4Element("Oxygen","O", 8,a); @@ -491,7 +497,7 @@ void WCSimDetectorConstruction::ConstructMaterials() 1.34419, 1.34515, 1.3462, 1.34733, 1.34858, 1.34994, 1.35145, 1.35312, 1.35498, 1.35707, 1.35943, 1.36211, 1.36518, 1.36872, 1.37287, 1.37776, 1.38362, 1.39074, 1.39956, 1.41075, 1.42535}; - + G4double ABWFF = 1.0; @@ -512,8 +518,7 @@ void WCSimDetectorConstruction::ConstructMaterials() 49779.6*CLHEP::cm*ABWFF, 56465.3*CLHEP::cm*ABWFF, 61830*CLHEP::cm*ABWFF, 65174.6*CLHEP::cm*ABWFF, 66143.7*CLHEP::cm*ABWFF, 64820*CLHEP::cm*ABWFF, 61635*CLHEP::cm*ABWFF, 57176.2*CLHEP::cm*ABWFF, 52012.1*CLHEP::cm*ABWFF, 46595.7*CLHEP::cm*ABWFF, 41242.1*CLHEP::cm*ABWFF, 36146.3*CLHEP::cm*ABWFF, 31415.4*CLHEP::cm*ABWFF, 27097.8*CLHEP::cm*ABWFF, 23205.7*CLHEP::cm*ABWFF, - 19730.3*CLHEP::cm*ABWFF, 16651.6*CLHEP::cm*ABWFF, 13943.6*CLHEP::cm*ABWFF, 11578.1*CLHEP::cm*ABWFF, 9526.13*CLHEP::cm*ABWFF - }; + 19730.3*CLHEP::cm*ABWFF, 16651.6*CLHEP::cm*ABWFF, 13943.6*CLHEP::cm*ABWFF, 11578.1*CLHEP::cm*ABWFF, 9526.13*CLHEP::cm*ABWFF}; //Xin Qian: proposed value for absorption length // G4double ABSORPTION_water[NUMENTRIES_water] = @@ -596,8 +601,7 @@ void WCSimDetectorConstruction::ConstructMaterials() 15543*CLHEP::cm*RAYFF, 13696.6*CLHEP::cm*RAYFF, 12020.5*CLHEP::cm*RAYFF, 10504.1*CLHEP::cm*RAYFF, 9137.15*CLHEP::cm*RAYFF, 7909.45*CLHEP::cm*RAYFF, 6811.3*CLHEP::cm*RAYFF, 5833.25*CLHEP::cm*RAYFF, 4966.2*CLHEP::cm*RAYFF, 4201.36*CLHEP::cm*RAYFF, 3530.28*CLHEP::cm*RAYFF, 2944.84*CLHEP::cm*RAYFF, 2437.28*CLHEP::cm*RAYFF, 2000.18*CLHEP::cm*RAYFF, 1626.5*CLHEP::cm*RAYFF, - 1309.55*CLHEP::cm*RAYFF, 1043.03*CLHEP::cm*RAYFF, 821.016*CLHEP::cm*RAYFF, 637.97*CLHEP::cm*RAYFF, 488.754*CLHEP::cm*RAYFF - }; + 1309.55*CLHEP::cm*RAYFF, 1043.03*CLHEP::cm*RAYFF, 821.016*CLHEP::cm*RAYFF, 637.97*CLHEP::cm*RAYFF, 488.754*CLHEP::cm*RAYFF}; /*G4double RAYLEIGH_water[NUMENTRIES_water] = { 167024.4*CLHEP::cm*RAYFF, 158726.7*CLHEP::cm*RAYFF, 150742*CLHEP::cm*RAYFF, @@ -641,8 +645,7 @@ void WCSimDetectorConstruction::ConstructMaterials() 462688*CLHEP::cm*MIEFF, 417027*CLHEP::cm*MIEFF, 374832*CLHEP::cm*MIEFF, 335923*CLHEP::cm*MIEFF, 300125*CLHEP::cm*MIEFF, 267267*CLHEP::cm*MIEFF, 237184*CLHEP::cm*MIEFF, 209715*CLHEP::cm*MIEFF, 184704*CLHEP::cm*MIEFF, 162000*CLHEP::cm*MIEFF, 141456*CLHEP::cm*MIEFF, 122931*CLHEP::cm*MIEFF, 106288*CLHEP::cm*MIEFF, 91395.2*CLHEP::cm*MIEFF, 78125*CLHEP::cm*MIEFF, - 66355.2*CLHEP::cm*MIEFF, 55968.2*CLHEP::cm*MIEFF, 46851.2*CLHEP::cm*MIEFF, 38896.2*CLHEP::cm*MIEFF, 32000*CLHEP::cm*MIEFF - }; + 66355.2*CLHEP::cm*MIEFF, 55968.2*CLHEP::cm*MIEFF, 46851.2*CLHEP::cm*MIEFF, 38896.2*CLHEP::cm*MIEFF, 32000*CLHEP::cm*MIEFF}; //Mie scattering length values when assuming 10 times larger than Rayleigh scattering. /*G4double MIE_water[NUMENTRIES_water] = { @@ -685,7 +688,7 @@ void WCSimDetectorConstruction::ConstructMaterials() 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, 1.600, - 1.600, 1.600 }; + 1.600, 1.600}; //G4double RINDEX_blacksheet[NUMENTRIES] = //{ 2.500, 2.500, 2.500, 2.500, 2.500, 2.500, 2.500, @@ -723,7 +726,7 @@ void WCSimDetectorConstruction::ConstructMaterials() 1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm, 1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm, 1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm,1.0e9*CLHEP::cm, - 1.0e9*CLHEP::cm, 1.0e9*CLHEP::cm }; + 1.0e9*CLHEP::cm, 1.0e9*CLHEP::cm}; G4double BLACKABS_blacksheet[NUMENTRIES_water] = { 1.0e-9*CLHEP::cm, 1.0e-9*CLHEP::cm, 1.0e-9*CLHEP::cm, 1.0e-9*CLHEP::cm, 1.0e-9*CLHEP::cm, 1.0e-9*CLHEP::cm, @@ -775,7 +778,7 @@ void WCSimDetectorConstruction::ConstructMaterials() 0.045*BSRFF, 0.045*BSRFF, 0.045*BSRFF, 0.045*BSRFF, 0.045*BSRFF, 0.045*BSRFF, 0.045*BSRFF, 0.045*BSRFF, 0.045*BSRFF, 0.045*BSRFF, 0.045*BSRFF, 0.045*BSRFF, - 0.045*BSRFF, 0.045*BSRFF }; + 0.045*BSRFF, 0.045*BSRFF}; /* G4double REFLECTIVITY_blacksheet[NUMENTRIES] = @@ -841,7 +844,7 @@ void WCSimDetectorConstruction::ConstructMaterials() G4double MIE_air_const[3]={0.99,0.99,0.8};// gforward, gbackward, forward backward ratio - + //Not used yet, fictional values //G4double SPECULARLOBECONSTANT1[NUMENTRIES] = //{ 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, @@ -884,6 +887,7 @@ void WCSimDetectorConstruction::ConstructMaterials() //{ 2.038E-9*CLHEP::GeV, 4.144E-9*CLHEP::GeV }; G4double PP[NUM] = { 1.4E-9*CLHEP::GeV,6.2E-9*CLHEP::GeV}; + //G4double PP[NUM] = { 1.4E-9*CLHEP::GeV, 20.7e-09*CLHEP::GeV }; G4double RINDEX_blacksheet[NUM] = { 1.6, 1.6 }; @@ -918,6 +922,11 @@ void WCSimDetectorConstruction::ConstructMaterials() */ + OpGlassCathodeSurface_R7081 = new G4OpticalSurface("GlassCathodeSurface_R7081"); + OpGlassCathodeSurface_R7081->SetType(dielectric_dielectric); + OpGlassCathodeSurface_R7081->SetModel(unified); + OpGlassCathodeSurface_R7081->SetFinish(polished); + G4double RGCFF = 0.0; RGCFF = WCSimTuningParams->GetRgcff(); @@ -932,6 +941,10 @@ void WCSimDetectorConstruction::ConstructMaterials() { 0.0, 0.0 }; + G4double RGCFFR7081 = 0.0; + RGCFFR7081 = WCSimTuningParams->GetRgcffR7081(); + G4double REFLECTIVITY_glasscath_R7081[NUM] = {1.0*RGCFFR7081, 1.0*RGCFFR7081}; + // jl145 ---- // OpWaterTySurface = @@ -1008,7 +1021,8 @@ void WCSimDetectorConstruction::ConstructMaterials() myMPT5->AddProperty("RINDEX", ENERGY_water, RINDEX_glass, NUMENTRIES_water); myMPT5->AddProperty("ABSLENGTH",ENERGY_water, ABSORPTION_glass, NUMENTRIES_water); Glass->SetMaterialPropertiesTable(myMPT5); - + GlassR7081->SetMaterialPropertiesTable(myMPT5); + // jl145 ---- // Abs legnth is same as blacksheet, very small. G4MaterialPropertiesTable *myMPT6 = new G4MaterialPropertiesTable(); @@ -1021,6 +1035,7 @@ void WCSimDetectorConstruction::ConstructMaterials() G4double TEFLONRFF = WCSimTuningParams->GetTeflonrff(); const G4int arrEntries = 2; G4double photEneSteel[] = { 1.56962*CLHEP::eV, 6.19998*CLHEP::eV }; + //G4double photEneSteel[] = { 1.56962*CLHEP::eV, 20.7*CLHEP::eV}; G4double rIndexSteel[] = { 1.35, 1.35}; G4double absSteel[] = { 1.0e-9*CLHEP::cm, 1.0e-9*CLHEP::cm}; //G4double refSteel[] = {0.5, 0.5}; // low estimate. --> replaced by tunable teflon reflectivity value (whole structure is wrapped) @@ -1077,10 +1092,12 @@ void WCSimDetectorConstruction::ConstructMaterials() //Should be close to acrylic white as defined in ratpac simulation //Use refractive index for material 'acrylic_white' from ratpac G4double HOLDERRFF = WCSimTuningParams->GetHolderrff(); - const G4int arrEntriesHolder = 62; + const G4int arrEntriesHolder = 61; G4double refHolder[] = {1.00*HOLDERRFF,1.00*HOLDERRFF}; - G4double photEneHolder[] = {1.55*CLHEP::eV, 1.569620253*CLHEP::eV, 1.58974359*CLHEP::eV, 1.61038961*CLHEP::eV, 1.631578947*CLHEP::eV, 1.653333333*CLHEP::eV, 1.675675676*CLHEP::eV, 1.698630137*CLHEP::eV, 1.722222222*CLHEP::eV, 1.746478873*CLHEP::eV, 1.771428571*CLHEP::eV, 1.797101449*CLHEP::eV, 1.823529412*CLHEP::eV, 1.850746269*CLHEP::eV, 1.878787879*CLHEP::eV, 1.907692308*CLHEP::eV, 1.9375*CLHEP::eV, 1.968253968*CLHEP::eV, 2*CLHEP::eV, 2.032786885*CLHEP::eV, 2.066666667*CLHEP::eV, 2.101694915*CLHEP::eV, 2.137931034*CLHEP::eV, 2.175438596*CLHEP::eV, 2.214285714*CLHEP::eV, 2.254545455*CLHEP::eV, 2.296296296*CLHEP::eV, 2.339622642*CLHEP::eV, 2.384615385*CLHEP::eV, 2.431372549*CLHEP::eV, 2.48*CLHEP::eV, 2.530612245*CLHEP::eV, 2.583333333*CLHEP::eV, 2.638297872*CLHEP::eV, 2.695652174*CLHEP::eV, 2.755555556*CLHEP::eV, 2.818181818*CLHEP::eV, 2.88372093*CLHEP::eV, 2.952380952*CLHEP::eV, 3.024390244*CLHEP::eV, 3.1*CLHEP::eV, 3.179487179*CLHEP::eV, 3.263157895*CLHEP::eV, 3.351351351*CLHEP::eV, 3.444444444*CLHEP::eV, 3.542857143*CLHEP::eV, 3.647058824*CLHEP::eV, 3.757575758*CLHEP::eV, 3.875*CLHEP::eV, 4*CLHEP::eV, 4.133333333*CLHEP::eV, 4.275862069*CLHEP::eV, 4.428571429*CLHEP::eV, 4.592592593*CLHEP::eV, 4.769230769*CLHEP::eV, 4.96*CLHEP::eV, 5.166666667*CLHEP::eV, 5.391304348*CLHEP::eV, 5.636363636*CLHEP::eV, 5.904761905*CLHEP::eV, 6.2*CLHEP::eV, 20.66666667*CLHEP::eV}; - G4double rIndexHolder[] = {1.485, 1.485, 1.485, 1.485, 1.486, 1.486, 1.486, 1.486, 1.487, 1.487, 1.487, 1.488, 1.488, 1.488, 1.488, 1.489, 1.489, 1.49, 1.49, 1.49, 1.491, 1.491, 1.492, 1.492, 1.493, 1.493, 1.494, 1.494, 1.495, 1.496, 1.496, 1.497, 1.498, 1.499, 1.499, 1.5, 1.501, 1.502, 1.503, 1.505, 1.506, 1.507, 1.509, 1.51, 1.512, 1.514, 1.516, 1.519, 1.521, 1.524, 1.527, 1.531, 1.534, 1.539, 1.544, 1.55, 1.556, 1.564, 1.573, 1.584, 1.597, 1.597}; + G4double photEneHolder[] = {1.55*CLHEP::eV, 1.569620253*CLHEP::eV, 1.58974359*CLHEP::eV, 1.61038961*CLHEP::eV, 1.631578947*CLHEP::eV, 1.653333333*CLHEP::eV, 1.675675676*CLHEP::eV, 1.698630137*CLHEP::eV, 1.722222222*CLHEP::eV, 1.746478873*CLHEP::eV, 1.771428571*CLHEP::eV, 1.797101449*CLHEP::eV, 1.823529412*CLHEP::eV, 1.850746269*CLHEP::eV, 1.878787879*CLHEP::eV, 1.907692308*CLHEP::eV, 1.9375*CLHEP::eV, 1.968253968*CLHEP::eV, 2*CLHEP::eV, 2.032786885*CLHEP::eV, 2.066666667*CLHEP::eV, 2.101694915*CLHEP::eV, 2.137931034*CLHEP::eV, 2.175438596*CLHEP::eV, 2.214285714*CLHEP::eV, 2.254545455*CLHEP::eV, 2.296296296*CLHEP::eV, 2.339622642*CLHEP::eV, 2.384615385*CLHEP::eV, 2.431372549*CLHEP::eV, 2.48*CLHEP::eV, 2.530612245*CLHEP::eV, 2.583333333*CLHEP::eV, 2.638297872*CLHEP::eV, 2.695652174*CLHEP::eV, 2.755555556*CLHEP::eV, 2.818181818*CLHEP::eV, 2.88372093*CLHEP::eV, 2.952380952*CLHEP::eV, 3.024390244*CLHEP::eV, 3.1*CLHEP::eV, 3.179487179*CLHEP::eV, 3.263157895*CLHEP::eV, 3.351351351*CLHEP::eV, 3.444444444*CLHEP::eV, 3.542857143*CLHEP::eV, 3.647058824*CLHEP::eV, 3.757575758*CLHEP::eV, 3.875*CLHEP::eV, 4*CLHEP::eV, 4.133333333*CLHEP::eV, 4.275862069*CLHEP::eV, 4.428571429*CLHEP::eV, 4.592592593*CLHEP::eV, 4.769230769*CLHEP::eV, 4.96*CLHEP::eV, 5.166666667*CLHEP::eV, 5.391304348*CLHEP::eV, 5.636363636*CLHEP::eV, 5.904761905*CLHEP::eV, 6.2*CLHEP::eV}; +//, 20.66666667*CLHEP::eV}; //60nm + G4double rIndexHolder[] = {1.485, 1.485, 1.485, 1.485, 1.486, 1.486, 1.486, 1.486, 1.487, 1.487, 1.487, 1.488, 1.488, 1.488, 1.488, 1.489, 1.489, 1.49, 1.49, 1.49, 1.491, 1.491, 1.492, 1.492, 1.493, 1.493, 1.494, 1.494, 1.495, 1.496, 1.496, 1.497, 1.498, 1.499, 1.499, 1.5, 1.501, 1.502, 1.503, 1.505, 1.506, 1.507, 1.509, 1.51, 1.512, 1.514, 1.516, 1.519, 1.521, 1.524, 1.527, 1.531, 1.534, 1.539, 1.544, 1.55, 1.556, 1.564, 1.573, 1.584, 1.597}; +//, 1.597}; //60nm G4MaterialPropertiesTable *holderSurfaceMatProps = new G4MaterialPropertiesTable(); holderSurfaceMatProps->AddProperty("RINDEX", photEneHolder, rIndexHolder, arrEntriesHolder); @@ -1120,7 +1137,6 @@ void WCSimDetectorConstruction::ConstructMaterials() LUXHolderOpSurface->SetSigmaAlpha(0.1); LUXHolderOpSurface->SetMaterialPropertiesTable(luxholderSurfaceMatProps); - // ------------- Surfaces -------------- // Blacksheet @@ -1144,6 +1160,12 @@ void WCSimDetectorConstruction::ConstructMaterials() //myST2->AddProperty("ABSLENGTH", PP, abslength_paint , NUM); OpGlassCathodeSurface->SetMaterialPropertiesTable(myST2); + G4MaterialPropertiesTable *myST2_R7081 = new G4MaterialPropertiesTable(); + myST2_R7081->AddProperty("RINDEX", PP, RINDEX_cathode, NUM); + myST2_R7081->AddProperty("REFLECTIVITY",PP,REFLECTIVITY_glasscath_R7081, NUM); + myST2_R7081->AddProperty("EFFICIENCY",PP,EFFICIENCY_glasscath,NUM); + OpGlassCathodeSurface_R7081->SetMaterialPropertiesTable(myST2_R7081); + //Tyvek - jl145 G4MaterialPropertiesTable *myST3 = new G4MaterialPropertiesTable(); myST3->AddProperty("RINDEX", PP, RINDEX_tyvek, NUM); diff --git a/src/WCSimConstructPMT.cc b/src/WCSimConstructPMT.cc index 929a8fb68..059facb3a 100644 --- a/src/WCSimConstructPMT.cc +++ b/src/WCSimConstructPMT.cc @@ -26,6 +26,7 @@ WCSimDetectorConstruction::PMTMap_t WCSimDetectorConstruction::PMTLogicalVolumes G4LogicalVolume* WCSimDetectorConstruction::ConstructPMT(G4String PMTName, G4String CollectionName, G4String detectorElement) { + G4cout <<"Making PMTKey (PMTName="<GetDefinition(); + //G4cout <<"WCIDCollectionName: "<GetTotalEnergy()/CLHEP::eV); - G4float ratio = 1.; //1./(1.0-0.25); ??? increase the reported QE? Why??? + //G4float ratio = 1.; //1./(1.0-0.25); ??? increase the reported QE? Why??? + G4float ratio=1.; G4float wavelengthQE = 1.1; + WCSimTuningParameters *tuning = (WCSimTuningParameters*) DetConstruct->Get_TuningParams(); + G4double QEratio = tuning->GetQERatio(); + ratio = QEratio; + if(aTrack->GetCreatorProcess()==NULL) { // primary photons. I don't see why these should be treated differently... - if (DetConstruct->GetPMT_QE_Method()!=4){ // primary photons use PMT_QE_Method Stacking_Only wavelengthQE = DetConstruct->GetPMTQE(WCIDCollectionName,photonWavelength,1,240,660,ratio); @@ -75,7 +82,8 @@ G4ClassificationOfNewTrack WCSimStackingAction::ClassifyNewTrack //} // prune the photon if desired - if( G4UniformRand() > wavelengthQE ){ classification = fKill; } + if( G4UniformRand() > wavelengthQE ){ + classification = fKill; } } return classification; diff --git a/src/WCSimTuningMessenger.cc b/src/WCSimTuningMessenger.cc index 216717e4b..5e09f3c7d 100644 --- a/src/WCSimTuningMessenger.cc +++ b/src/WCSimTuningMessenger.cc @@ -32,6 +32,11 @@ WCSimTuningMessenger::WCSimTuningMessenger(WCSimTuningParameters* WCTuningPars): Rgcff->SetParameterName("Rgcff",true); Rgcff->SetDefaultValue(0.32); + RgcffR7081 = new G4UIcmdWithADouble("/WCSim/tuning/rgcffr7081",this); + RgcffR7081->SetGuidance("Set the cathode reflectivity parameter (R7081)"); + RgcffR7081->SetParameterName("RgcffR7081",true); + RgcffR7081->SetDefaultValue(0.32); + Mieff = new G4UIcmdWithADouble("/WCSim/tuning/mieff",this); Mieff->SetGuidance("Set the Mie scattering parameter"); Mieff->SetParameterName("Mieff",true); @@ -62,6 +67,16 @@ WCSimTuningMessenger::WCSimTuningMessenger(WCSimTuningParameters* WCTuningPars): Holder->SetParameterName("Holder",true); Holder->SetDefaultValue(0); + Qeratio = new G4UIcmdWithADouble("/WCSim/tuning/QEratio",this); + Qeratio->SetGuidance("Set QE tuning factor"); + Qeratio->SetParameterName("Qeratio",true); + Qeratio->SetDefaultValue(1.00); + + QeratioWB = new G4UIcmdWithADouble("/WCSim/tuning/QEratioWB",this); + QeratioWB->SetGuidance("Set QE tuning factor (WB)"); + QeratioWB->SetParameterName("QeratioWB",true); + QeratioWB->SetDefaultValue(1.00); + //jl145 - for Top Veto TVSpacing = new G4UIcmdWithADouble("/WCSim/tuning/tvspacing",this); TVSpacing->SetGuidance("Set the Top Veto PMT Spacing, in cm."); @@ -81,6 +96,7 @@ WCSimTuningMessenger::~WCSimTuningMessenger() delete Bsrff; delete Abwff; delete Rgcff; + delete RgcffR7081; delete Mieff; //ANNIE-specific variables @@ -89,6 +105,8 @@ WCSimTuningMessenger::~WCSimTuningMessenger() delete HolderrffLUX; delete Linerrff; delete Holder; + delete Qeratio; + delete QeratioWB; //jl145 - for Top Veto delete TVSpacing; @@ -140,6 +158,13 @@ void WCSimTuningMessenger::SetNewValue(G4UIcommand* command,G4String newValue) } + if (command == RgcffR7081) { + + WCSimTuningParams->SetRgcffR7081(RgcffR7081->GetNewDoubleValue(newValue)); + printf("Setting cathode reflectivity parameter (R7081) %f\n",RgcffR7081->GetNewDoubleValue(newValue)); + + } + if(command == Mieff) { // Set the Mie scattering parameter // printf("Input parameter %f\n",Mieff->GetNewDoubleValue(newValue)); @@ -203,6 +228,23 @@ void WCSimTuningMessenger::SetNewValue(G4UIcommand* command,G4String newValue) printf("Setting ANNIE PMT holders Off\n"); } + // ANNIE - Q.E. Ratio factor + else if (command == Qeratio){ + //Set tuning factor for the Q.E. values + WCSimTuningParams->SetQERatio(Qeratio->GetNewDoubleValue(newValue)); + + printf("Setting ANNIE Q.E. ratio factor %f\n",Qeratio->GetNewDoubleValue(newValue)); + + } + + // ANNIE - Q.E. Ratio factor for Watchboy tubes + else if (command == QeratioWB){ + //Set tuning factor for Q.E. values (WB) + WCSimTuningParams->SetQERatioWB(QeratioWB->GetNewDoubleValue(newValue)); + + printf("Setting WB Q.E. ratio factor %f\n",QeratioWB->GetNewDoubleValue(newValue)); + } + //jl145 - For Top Veto else if(command == TVSpacing) { diff --git a/src/WCSimTuningParameters.cc b/src/WCSimTuningParameters.cc index afb50e45b..02ee6859f 100644 --- a/src/WCSimTuningParameters.cc +++ b/src/WCSimTuningParameters.cc @@ -13,6 +13,7 @@ WCSimTuningParameters::WCSimTuningParameters() bsrff=2.50; abwff=1.30; rgcff=0.32; + rgcffr7081=0.32; mieff=0.0; //ANNIE-default values @@ -21,6 +22,8 @@ WCSimTuningParameters::WCSimTuningParameters() holderrfflux=1.00; linerrff=1.00; holder=false; + QEratio=1.00; + QEratioWB=1.00; //jl145 - For Top Veto tvspacing = 100.0; @@ -40,12 +43,15 @@ void WCSimTuningParameters::SaveOptionsToOutput(WCSimRootOptions * wcopt) wcopt->SetBsrff(bsrff); wcopt->SetAbwff(abwff); wcopt->SetRgcff(rgcff); + wcopt->SetRgcffR7081(rgcffr7081); wcopt->SetMieff(mieff); wcopt->SetTeflonrff(teflonrff); wcopt->SetHolderrff(holderrff); wcopt->SetHolderrffLUX(holderrfflux); wcopt->SetLinerrff(linerrff); wcopt->SetHolder(holder); + wcopt->SetQERatio(QEratio); + wcopt->SetQERatioWB(QEratioWB); wcopt->SetTvspacing(tvspacing); wcopt->SetTopveto(topveto); } diff --git a/src/WCSimWCSD.cc b/src/WCSimWCSD.cc index 673781f99..c813dbb8b 100644 --- a/src/WCSimWCSD.cc +++ b/src/WCSimWCSD.cc @@ -1,4 +1,6 @@ #include "WCSimWCSD.hh" +#include "WCSimTuningParameters.hh" +#include "WCSimDetectorConstruction.hh" #include "G4ParticleTypes.hh" #include "G4HCofThisEvent.hh" #include "G4TouchableHistory.hh" @@ -82,6 +84,17 @@ G4bool WCSimWCSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) // Determine from QE whether to reject the hit // =========================================== G4float ratio = 1.; + WCSimTuningParameters *tuning = (WCSimTuningParameters*) fdet->Get_TuningParams(); + G4double QEratio = tuning->GetQERatio(); + G4double QEratioWB = tuning->GetQERatioWB(); + //G4cout <<"QERatio: "<GetPMT_QE_Method()==1){ photonQE = 1.1; }else if (fdet->GetPMT_QE_Method()==2){ - maxQE = fdet->GetPMTQE(volumeName,wavelength,0,240,660,ratio); + maxQE = fdet->GetPMTQE(volumeName,wavelength,0,240,660,QEratio); photonQE = fdet->GetPMTQE(volumeName, wavelength,1,240,660,ratio); photonQE = photonQE/maxQE; }else if (fdet->GetPMT_QE_Method()==3){ - ratio = 1./(1.-0.25); + //ratio = 1./(1.-0.25); + //ratio = 1.; photonQE = fdet->GetPMTQE(volumeName, wavelength,1,240,660,ratio); }else if (fdet->GetPMT_QE_Method()==4){ - maxQE = fdet->GetPMTQE(fdet->GetIDCollectionName(), wavelength,0,240,660,ratio); + //maxQE = fdet->GetPMTQE(fdet->GetIDCollectionName(), wavelength,0,240,660,ratio); + maxQE = fdet->GetPMTQE(fdet->GetIDCollectionName(), wavelength,0,240,660,QEratio); if(maxQE==0){ G4cerr<<"MAXQE FOR PHOTON HIT ON VOLUME "<GetLAPPD_QE_Method()==1){ photonQE = 1.1; }else if (fdet->GetLAPPD_QE_Method()==2){ - maxQE = fdet->GetLAPPDQE(volumeName,wavelength,0,240,660,ratio); + maxQE = fdet->GetLAPPDQE(volumeName,wavelength,0,240,660,QEratio); photonQE = fdet->GetLAPPDQE(volumeName, wavelength,1,240,660,ratio); photonQE = photonQE/maxQE; }else if (fdet->GetLAPPD_QE_Method()==3){ - ratio = 1./(1.-0.25); photonQE = fdet->GetLAPPDQE(volumeName, wavelength,1,240,660,ratio); }else if (fdet->GetLAPPD_QE_Method()==4){ - maxQE = fdet->GetPMTQE(fdet->GetIDCollectionName(), wavelength,0,240,660,ratio); + maxQE = fdet->GetPMTQE(fdet->GetIDCollectionName(), wavelength,0,240,660,QEratio); if(maxQE==0){ G4cerr<<"MAXQE FOR PHOTON HIT ON VOLUME "< Date: Wed, 25 Aug 2021 04:13:45 -0500 Subject: [PATCH 2/4] added updated setup script --- setupenvsfnal | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/setupenvsfnal b/setupenvsfnal index 94ee2c624..5992da61c 100644 --- a/setupenvsfnal +++ b/setupenvsfnal @@ -6,7 +6,10 @@ setup_annie_g410() source /grid/fermiapp/products/common/etc/setup - export PRODUCTS=${PRODUCTS}:/grid/fermiapp/products/larsoft + #export PRODUCTS=${PRODUCTS}:/grid/fermiapp/products/larsoft + export PRODUCTS=${PRODUCTS}:/grid/fermiapp/products/larsoft:/cvmfs/fermilab.opensciencegrid.org/products + + source /cvmfs/fermilab.opensciencegrid.org/products/common/etc/setup # setup genie v2_8_6d -q e9:debug @@ -14,14 +17,17 @@ setup_annie_g410() # setup genie_phyopt v2_8_6 -q dkcharmtau - setup geant4 v4_10_1_p02a -q e9:debug:qt - + #setup geant4 v4_10_1_p02a -q e9:debug:qt + # setup geant4 v4_10_1_p02a + setup geant4 v4_10_1_p03a -q debug:e10:qt } # type at the command line (but NOT in .bashrc!) setup_annie_g410 -setup cmake #sets up 2_8_8 +setup cmake v3_0_1 + +#setup cmake #sets up 2_8_8 #setup -f Linux64bit+2.6-2.12 cmake v3_6_2a # sets compiler to gcc 4.4! doesn't support c++14... #setup -f Linux64bit+2.6-2.12 -q debug:e9:nu root v6_04_06 @@ -32,7 +38,8 @@ source /grid/fermiapp/products/larsoft/root/v6_06_08/Linux64bit+2.6-2.12-e10-nu- setup -f Linux64bit+2.6-2.12 -q debug:e10:r6 genie v2_12_0a #overwrite the clhep setup set by genie -setup -f Linux64bit+2.6-2.12 -q debug:e9 clhep v2_2_0_8 +#setup -f Linux64bit+2.6-2.12 -q debug:e9 clhep v2_2_0_8 +setup clhep v2_3_2_2 -q debug:e10 setup -f Linux64bit+2.6-2.12 -q debug:e10 xerces_c v3_1_3 export XERCESROOT=/grid/fermiapp/products/larsoft/xerces_c/v3_1_3/Linux64bit+2.6-2.12-e10-debug @@ -43,7 +50,15 @@ export G4SYSTEM=Linux-g++ #export ROOT_PATH=/grid/fermiapp/products/larsoft/root/v6_04_06/source/root-6.04.06/etc/cmake export ROOT_PATH=/grid/fermiapp/products/larsoft/root/v6_06_08/Linux64bit+2.6-2.12-e10-nu-debug/cmake -export GEANT4_PATH=/grid/fermiapp/products/larsoft/geant4/v4_10_1_p02a/Linux64bit+2.6-2.12-e9-qt-debug/lib64/Geant4-10.1.2 +#export GEANT4_PATH=/grid/fermiapp/products/larsoft/geant4/v4_10_1_p02a/Linux64bit+2.6-2.12-e9-qt-debug/lib64/Geant4-10.1.2 + +#export GEANT4_MAKEFULL_PATH=/grid/fermiapp/products/larsoft/geant4/v4_10_1_p02a/source/geant4.10.01.p02 + +export GEANT4_PATH=/cvmfs/larsoft.opensciencegrid.org/products/geant4/v4_10_1_p03a/Linux64bit+2.6-2.12-e10-qt-debug/lib64/Geant4-10.1.3 +export GEANT4_MAKEFULL_PATH=/cvmfs/larsoft.opensciencegrid.org/products/geant4/v4_10_1_p03a/source/geant4.10.01.p03 -export GEANT4_MAKEFULL_PATH=/grid/fermiapp/products/larsoft/geant4/v4_10_1_p02a/source/geant4.10.01.p02 +export LIBRARY_PATH=${LIBRARY_PATH}:/cvmfs/annie.opensciencegrid.org/products/toolanalysis/v0_0_0/extras_for_oasis_build +export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/cvmfs/annie.opensciencegrid.org/products/toolanalysis/v0_0_0/extras_for_oasis_build +#export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/cvmfs/larsoft.opensciencegrid.org/products/qt/v5_10_1a/Linux64bit+2.6-2.12-e15/ +export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/cvmfs/larsoft.opensciencegrid.org/products/qt/v5_4_2a/Linux64bit+2.6-2.12-e9/ From 3cc2045aacb044ad5c84a9c065af8c02892f31af Mon Sep 17 00:00:00 2001 From: Michael Nieslony Date: Wed, 25 Aug 2021 04:19:53 -0500 Subject: [PATCH 3/4] added Rgcff back to WCSimRootOptions.hh --- include/WCSimRootOptions.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/include/WCSimRootOptions.hh b/include/WCSimRootOptions.hh index 72ded149c..a12a35120 100644 --- a/include/WCSimRootOptions.hh +++ b/include/WCSimRootOptions.hh @@ -126,6 +126,7 @@ public: double GetRayff() {return Rayff;} double GetBsrff() {return Bsrff;} double GetAbwff() {return Abwff;} + double GetRgcff() {return Rgcff;} double GetRgcffR7081() {return RgcffR7081;} double GetMieff() {return Mieff;} double GetTeflonrff() {return Teflonrff;} From f3e94afb3ff001bb27e1eaa9148d9a099abb3cb8 Mon Sep 17 00:00:00 2001 From: Michael Nieslony Date: Thu, 30 Sep 2021 07:37:58 -0500 Subject: [PATCH 4/4] added PMT-by-PMT scaling factors --- include/WCSimRootOptions.hh | 3 + include/WCSimTuningMessenger.hh | 1 + include/WCSimTuningParameters.hh | 5 ++ include/WCSimWCSD.hh | 7 +- macros/tuning_parameters.mac | 3 + pmt_qe.txt | 132 +++++++++++++++++++++++++++++++ src/WCSimRootOptions.cc | 1 + src/WCSimTuningMessenger.cc | 18 +++++ src/WCSimTuningParameters.cc | 2 + src/WCSimWCSD.cc | 54 +++++++++++-- 10 files changed, 219 insertions(+), 7 deletions(-) create mode 100644 pmt_qe.txt diff --git a/include/WCSimRootOptions.hh b/include/WCSimRootOptions.hh index 72ded149c..abffd909f 100644 --- a/include/WCSimRootOptions.hh +++ b/include/WCSimRootOptions.hh @@ -120,6 +120,7 @@ public: void SetHolder(bool iHolder) {Holder = iHolder;} void SetQERatio(double iQERatio) {QERatio = iQERatio;} void SetQERatioWB(double iQERatioWB) {QERatioWB = iQERatioWB;} + void SetPMTWiseQE(bool iPMTWiseQE) {PMTWiseQE = iPMTWiseQE;} void SetTvspacing(double iTvspacing) {Tvspacing = iTvspacing;} void SetTopveto(bool iTopveto) {Topveto = iTopveto;} //WCSimTuningParameters gets @@ -135,6 +136,7 @@ public: bool GetHolder() {return Holder;} double GetQERatio() {return QERatio;} double GetQERatioWB() {return QERatioWB;} + double GetPMTWiseQE() {return PMTWiseQE;} double GetTvspacing() {return Tvspacing;} bool GetTopveto() {return Topveto;} //WCSimPhysicsListFactory sets @@ -212,6 +214,7 @@ private: bool Holder; double QERatio; double QERatioWB; + bool PMTWiseQE; double Tvspacing; bool Topveto; diff --git a/include/WCSimTuningMessenger.hh b/include/WCSimTuningMessenger.hh index e8da1c7a6..2e809303c 100644 --- a/include/WCSimTuningMessenger.hh +++ b/include/WCSimTuningMessenger.hh @@ -42,6 +42,7 @@ private: G4UIcmdWithABool *Holder; G4UIcmdWithADouble* Qeratio; G4UIcmdWithADouble* QeratioWB; + G4UIcmdWithABool *PMTwiseQE; //For Top Veto - jl145 G4UIcmdWithADouble* TVSpacing; diff --git a/include/WCSimTuningParameters.hh b/include/WCSimTuningParameters.hh index 73b098ea1..59d6d8e30 100644 --- a/include/WCSimTuningParameters.hh +++ b/include/WCSimTuningParameters.hh @@ -52,6 +52,10 @@ public: G4double GetQERatioWB() {return QEratioWB;} void SetQERatioWB(G4double qeratiowb) {QEratioWB = qeratiowb;} + G4bool GetPMTwiseQE() {return PMTWiseQE;} + void SetPMTwiseQE(G4double pmtwiseqe) {PMTWiseQE = pmtwiseqe;} + + //For Top Veto - jl145 G4double GetTVSpacing() {return tvspacing;} void SetTVSpacing(G4double tparam) {tvspacing=tparam;} @@ -84,6 +88,7 @@ private: G4bool holder; //Should ANNIE PMT holders be implemented in the simulation? G4double QEratio; //Factor by which the PMT Q.E. can be scaled G4double QEratioWB; //Factor by which the WB PMT Q.E. can be scaled + G4bool PMTWiseQE; //Should each PMT have its own Q.E. scaling? //For Top Veto - jl145 G4double tvspacing; diff --git a/include/WCSimWCSD.hh b/include/WCSimWCSD.hh index 36a16acee..39f61597d 100644 --- a/include/WCSimWCSD.hh +++ b/include/WCSimWCSD.hh @@ -18,7 +18,9 @@ class WCSimWCSD : public G4VSensitiveDetector G4bool ProcessHits(G4Step*, G4TouchableHistory*); void EndOfEvent(G4HCofThisEvent*); - + + void ReadInPMTWiseQE(); + private: G4int HCID; @@ -27,6 +29,9 @@ class WCSimWCSD : public G4VSensitiveDetector G4String detectorElement; std::map PMTHitMap; // Whether a PMT was hit already + std::vector vector_pmtqe; //Individual PMT tuning factors + + }; #endif diff --git a/macros/tuning_parameters.mac b/macros/tuning_parameters.mac index bc7459780..817aad027 100644 --- a/macros/tuning_parameters.mac +++ b/macros/tuning_parameters.mac @@ -18,6 +18,9 @@ #Turning holders on (1) or off (0) /WCSim/tuning/holder 1 +#Turning PMT-wise Q.E. on (1) or off (0) + /WCSim/tuning/PMTwiseQE 1 + # Parameters to set up Top Veto - jl145 # Set to "1" to turn on top veto. /WCSim/tuning/topveto 0 diff --git a/pmt_qe.txt b/pmt_qe.txt new file mode 100644 index 000000000..641d1e637 --- /dev/null +++ b/pmt_qe.txt @@ -0,0 +1,132 @@ +1.04917 +1 +0.798177 +0.942263 +1 +1 +1.07916 +1 +1.06756 +1.04386 +1 +1 +1.66074 +1 +1 +1.02334 +1.09023 +1 +0.946442 +0.954495 +1 +0.854175 +0.889195 +0.935805 +1.12105 +1.71891 +1.8253 +0.627527 +1.38071 +1.1811 +1.14201 +1.09737 +0.931037 +0.787083 +0.71121 +1.13057 +0.979524 +1.62918 +1.07831 +1.33913 +0.873306 +0.919956 +1.06385 +0.989897 +0.952358 +0.988304 +0.980244 +0.949444 +0.915575 +0.864607 +1.18171 +1.31154 +1.30086 +1.04012 +1.36219 +1.45382 +1.1095 +0.999691 +1.1576 +1.15716 +1.23937 +1.27858 +1.67152 +1.14691 +1.22981 +1.27146 +1.16961 +1.08779 +1.22566 +1.08745 +1.20144 +1.174 +1.08923 +0.74365 +0.886566 +0.971824 +1.07672 +1.18623 +1.05377 +1.22465 +1.1165 +1.00162 +1.03114 +1.19746 +1 +1.39554 +1.62423 +1.28882 +2.09995 +1.38537 +1.40142 +0.555373 +0.839273 +0.963735 +1.41757 +1.77251 +0.695767 +1.31771 +0.41895 +1 +1.29032 +1.56555 +1.36072 +0.987516 +1.92534 +1.81387 +1.24928 +1.24579 +1.01025 +0.895154 +0.942562 +0.679465 +1 +1 +0.522334 +1.11533 +0.566948 +1.20963 +1.35207 +1.09087 +1.18449 +1.67963 +1.44741 +1.42225 +0.607537 +0.814002 +1.11266 +0.406661 +0.905179 +0.776474 +0.762519 +0.892001 diff --git a/src/WCSimRootOptions.cc b/src/WCSimRootOptions.cc index 493122c72..4c8bc461d 100644 --- a/src/WCSimRootOptions.cc +++ b/src/WCSimRootOptions.cc @@ -184,6 +184,7 @@ void WCSimRootOptions::Print(Option_t *) const << "\tHolder: " << Holder << endl << "\tQERatio: "<< QERatio << endl << "\tQERatioWB: "<< QERatioWB << endl + << "\tPMTWiseQE: " << PMTWiseQE << endl << "\tTvspacing: " << Tvspacing << endl << "\tTopveto: " << Topveto << endl << "Physics List Factory:" << endl diff --git a/src/WCSimTuningMessenger.cc b/src/WCSimTuningMessenger.cc index 5e09f3c7d..ebdb09468 100644 --- a/src/WCSimTuningMessenger.cc +++ b/src/WCSimTuningMessenger.cc @@ -77,6 +77,11 @@ WCSimTuningMessenger::WCSimTuningMessenger(WCSimTuningParameters* WCTuningPars): QeratioWB->SetParameterName("QeratioWB",true); QeratioWB->SetDefaultValue(1.00); + PMTwiseQE = new G4UIcmdWithABool("/WCSim/tuning/PMTwiseQE",this); + PMTwiseQE->SetGuidance("Turn on/off PMT-wise tuning factors"); + PMTwiseQE->SetParameterName("PMTwiseQE",true); + PMTwiseQE->SetDefaultValue(0); + //jl145 - for Top Veto TVSpacing = new G4UIcmdWithADouble("/WCSim/tuning/tvspacing",this); TVSpacing->SetGuidance("Set the Top Veto PMT Spacing, in cm."); @@ -107,6 +112,8 @@ WCSimTuningMessenger::~WCSimTuningMessenger() delete Holder; delete Qeratio; delete QeratioWB; + delete PMTwiseQE; + //jl145 - for Top Veto delete TVSpacing; @@ -245,6 +252,17 @@ void WCSimTuningMessenger::SetNewValue(G4UIcommand* command,G4String newValue) printf("Setting WB Q.E. ratio factor %f\n",QeratioWB->GetNewDoubleValue(newValue)); } + // ANNIE - Setting individual PMT-wise Q.E. factors + else if (command == PMTwiseQE){ + //Set individual PMT-wise Q.E. values + WCSimTuningParams->SetPMTwiseQE(PMTwiseQE->GetNewBoolValue(newValue)); + if (PMTwiseQE->GetNewBoolValue(newValue)) + printf("Turning PMT-wise QE tuning On\n"); + else + printf("Turning PMT-wise QE tuning Off\n"); + } + + //jl145 - For Top Veto else if(command == TVSpacing) { diff --git a/src/WCSimTuningParameters.cc b/src/WCSimTuningParameters.cc index 02ee6859f..424aafae2 100644 --- a/src/WCSimTuningParameters.cc +++ b/src/WCSimTuningParameters.cc @@ -24,6 +24,7 @@ WCSimTuningParameters::WCSimTuningParameters() holder=false; QEratio=1.00; QEratioWB=1.00; + PMTWiseQE=false; //jl145 - For Top Veto tvspacing = 100.0; @@ -52,6 +53,7 @@ void WCSimTuningParameters::SaveOptionsToOutput(WCSimRootOptions * wcopt) wcopt->SetHolder(holder); wcopt->SetQERatio(QEratio); wcopt->SetQERatioWB(QEratioWB); + wcopt->SetPMTWiseQE(PMTWiseQE); wcopt->SetTvspacing(tvspacing); wcopt->SetTopveto(topveto); } diff --git a/src/WCSimWCSD.cc b/src/WCSimWCSD.cc index c813dbb8b..2f6d03cdd 100644 --- a/src/WCSimWCSD.cc +++ b/src/WCSimWCSD.cc @@ -16,6 +16,8 @@ #include #include +#include +#include #include "WCSimDetectorConstruction.hh" #include "WCSimTrackInformation.hh" @@ -35,6 +37,10 @@ WCSimWCSD::WCSimWCSD(G4String CollectionName, G4String name,WCSimDetectorConstru fdet = myDet; HCID = -1; + + WCSimTuningParameters *tuning = (WCSimTuningParameters*) fdet->Get_TuningParams(); + G4bool pmtwiseqe = tuning->GetPMTwiseQE(); + if (pmtwiseqe) ReadInPMTWiseQE(); } WCSimWCSD::~WCSimWCSD() {} @@ -81,19 +87,43 @@ G4bool WCSimWCSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) G4float stepEnergy = aStep->GetTrack()->GetTotalEnergy()/CLHEP::eV; G4float wavelength = (stepEnergy>std::numeric_limits::min()) ? (2.0*M_PI*197.3)/(stepEnergy) : 0; + // Get PMT ID before calculating the QE (PMT-by-PMT QE values) + // ========================================================== + G4StepPoint* preStepPoint = aStep->GetPreStepPoint(); + G4TouchableHandle theTouchable = preStepPoint->GetTouchableHandle(); + std::stringstream tubeTag; + for (G4int i = theTouchable->GetHistoryDepth()-1 ; i >= 0; i--){ + tubeTag << ":" << theTouchable->GetVolume(i)->GetName(); + tubeTag << "-" << theTouchable->GetCopyNumber(i); + } + G4int replicaNumber; + if(isPMT){ + if(detectorElement=="tank"){ + replicaNumber = WCSimDetectorConstruction::GetTubeID(tubeTag.str()); + } + } + // Determine from QE whether to reject the hit // =========================================== G4float ratio = 1.; WCSimTuningParameters *tuning = (WCSimTuningParameters*) fdet->Get_TuningParams(); + bool pmtwiseqe = tuning->GetPMTwiseQE(); + double pmtwiseratio=1.; + //G4cout <<"replicaNumber: "<0) pmtwiseratio = vector_pmtqe.at(replicaNumber-1); + G4double QEratio = tuning->GetQERatio(); G4double QEratioWB = tuning->GetQERatioWB(); //G4cout <<"QERatio: "<GetPreStepPoint(); - G4TouchableHandle theTouchable = preStepPoint->GetTouchableHandle(); + //G4StepPoint* preStepPoint = aStep->GetPreStepPoint(); + //G4TouchableHandle theTouchable = preStepPoint->GetTouchableHandle(); G4VPhysicalVolume* thePhysical = theTouchable->GetVolume(); G4ThreeVector worldPosition = preStepPoint->GetPosition(); @@ -218,12 +248,12 @@ G4bool WCSimWCSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) // Make the sensor tubeTag based on the replica numbers // Then use the tubeTag to get the tube ID // See WCSimDetectorConstruction::DescribeAndRegisterPMT() for tag construction. - std::stringstream tubeTag; + /* std::stringstream tubeTag; for (G4int i = theTouchable->GetHistoryDepth()-1 ; i >= 0; i--){ tubeTag << ":" << theTouchable->GetVolume(i)->GetName(); tubeTag << "-" << theTouchable->GetCopyNumber(i); } - G4int replicaNumber; + G4int replicaNumber;*/ if(isPMT){ if(detectorElement=="tank"){ replicaNumber = WCSimDetectorConstruction::GetTubeID(tubeTag.str()); @@ -311,3 +341,15 @@ void WCSimWCSD::EndOfEvent(G4HCofThisEvent*) } } +void WCSimWCSD::ReadInPMTWiseQE(){ + + std::ifstream pmtqefile("../WCSim/pmt_qe.txt"); + double temp_qe; + while (!pmtqefile.eof()){ + pmtqefile >> temp_qe; + vector_pmtqe.push_back(temp_qe); + if (pmtqefile.eof()) break; + } + pmtqefile.close(); + + }