Classes | Functions | Variables
test Namespace Reference

Classes

class  GaussQuadExperiment
 
class  MyDetectorConstruction
 
class  MyEventAction
 
class  MyField
 
class  MyPrimaryGeneratorAction
 
class  MyRunAction
 
class  MySteppingAction
 
class  MyX
 
class  MyXClass
 
class  MyZClass1
 
class  MyZClass2
 
class  QuadraticParameter
 

Functions

void YouAreHere (const int &location)
 
double LogGauss (double x, double mu, double sigma)
 
void ResetCalculator (osc::IOscCalcAdjustable &calc)
 
std::unique_ptr< IPredictionGetNumuPrediction (osc::IOscCalcAdjustable &calc, const SystShifts &systs, bool doExtrap)
 
std::string FullFilename (const std::string &dir, std::string file)
 
def Setup0 ()
 
def Setup1 ()
 
def Setup3 ()
 
def Configure ()
 
def ConstructGeom ()
 
def DumpTree (atree)
 

Variables

const std::vector< std::stringSYSTS_TO_THROW
 
const std::vector< std::stringTEST_SYSTS
 
std::size_t N_POINTS = 5
 
double TRUE_A = 1.8
 
double SEED_VAL = 25000
 
const QuadraticParameter kQuadParam
 
double POT = 10e20
 
const std::string SAVED_PRED_FILE = "/nova/ana/users/jwolcott/scratch/pred.root"
 
const std::string SAVED_SAMPLES_FILE = "/nova/ana/users/jwolcott/scratch/mcmcsamples.root"
 
double MOCKDATA_TH23 = TMath::Pi()/4
 
double MOCKDATA_DM32 = 0.0025
 
const std::vector< std::stringSYSTS_TO_CHECK
 
string fname = "%s.wrl"
 
 cmdstr
 
 a
 
 b
 
 c
 
 z
 
 myz1
 
 myz2
 
 myx
 
 x
 
 acolor
 
 ival
 
 v
 
 alist
 

Function Documentation

def test.Configure ( )

Definition at line 18 of file test.py.

References python.gControlExecute.

Referenced by ConstructGeom().

18 def Configure():
19  # ------------------------------------------------------------------
20  # setup for materials
21  # ------------------------------------------------------------------
22  # simple materials for Qgeom
23  g4py.NISTmaterials.Construct()
24 
25  # ------------------------------------------------------------------
26  # setup for geometry
27  # ------------------------------------------------------------------
28  #g4py.Qgeom.Construct()
29  g4py.ezgeom.Construct() # initialize
30 
31  # ------------------------------------------------------------------
32  # setup for physics list
33  # ------------------------------------------------------------------
34  g4py.EMSTDpl.Construct()
35 
36  # ------------------------------------------------------------------
37  # setup for primary generator action
38  # ------------------------------------------------------------------
39  g4py.ParticleGun.Construct()
40  gControlExecute("gun.mac")
41 
42 # ==================================================================
43 # constructing geometry
44 # ==================================================================
def Configure()
Definition: test.py:18
gControlExecute
Definition: __init__.py:164
def test.ConstructGeom ( )

Definition at line 45 of file test.py.

References Configure(), python.gControlExecute, print, and PandAna.Demos.demo1.range.

46  print("* Constructing geometry...")
47  # reset world material
48  air= G4Material.GetMaterial("G4_AIR")
49  g4py.ezgeom.SetWorldMaterial(air)
50 
51  # target
52  global target
53  target= G4EzVolume("Target")
54  au= G4Material.GetMaterial("G4_Au")
55  target.CreateTubeVolume(au, 0., 1.*cm, 1.*mm)
56  target.PlaceIt(G4ThreeVector(0.,0.,-10.*cm))
57 
58  # dummy box
59  global detector_box, detector_box_pv
60  detector_box= G4EzVolume("DetectorBox")
61  detector_box.CreateBoxVolume(air, 20.*cm, 20.*cm, 40.*cm)
62  detector_box_pv= detector_box.PlaceIt(G4ThreeVector(0.,0.,20.*cm))
63 
64  # calorimeter
65  global cal
66  cal= G4EzVolume("Calorimeter")
67  nai= G4Material.GetMaterial("G4_SODIUM_IODIDE")
68  cal.CreateBoxVolume(nai, 5.*cm, 5.*cm, 30.*cm)
69  dd= 5.*cm
70  for ical in range(-1, 2):
71  calPos= G4ThreeVector(dd*ical, 0., 0.)
72  print(calPos)
73  cal.PlaceIt(calPos, ical+1, detector_box)
74 
75 
76 # ==================================================================
77 # main
78 # ==================================================================
79 # ------------------------------------------------------------------
80 # randum number
81 # ------------------------------------------------------------------
82 rand_engine= Ranlux64Engine()
83 HepRandom.setTheEngine(rand_engine)
84 HepRandom.setTheSeed(20050830)
85 
86 # setup...
87 Configure()
89 
90 # ------------------------------------------------------------------
91 # go...
92 # ------------------------------------------------------------------
93 gRunManager.Initialize()
94 
95 # visualization
96 gControlExecute("vis.mac")
97 
98 # beamOn
99 #gRunManager.BeamOn(3)
100 
101 
def Configure()
Definition: test.py:18
bool print
def ConstructGeom()
Definition: test.py:45
gControlExecute
Definition: __init__.py:164
def test.DumpTree (   atree)

Definition at line 10 of file test.py.

References print, and PandAna.Demos.demo1.range.

10 def DumpTree(atree):
11  print("@@", atree.GetPathName(), "::", atree.GetTitle())
12  ntree= atree.GetTreeEntry()
13  ncommand= atree.GetCommandEntry()
14 
15  for i in range(1, ncommand+1):
16  icommand= atree.GetCommand(i)
17  print(" **", icommand.GetCommandPath())
18  print(" ", icommand.GetTitle())
19  x= icommand.GetStateList()
20 
21  nparameter= icommand.GetParameterEntries()
22  for j in range(0, nparameter):
23  iparam= icommand.GetParameter(j)
24  print(" +", iparam.GetParameterName(), iparam.GetParameterType())
25 
26  for i in range(1, ntree+1):
27  itree= atree.GetTree(i)
28  DumpTree(itree)
29 
30 # ==================================================================
31 # main
32 # ==================================================================
33 root_tree= gUImanager.GetTree()
34 
35 DumpTree(root_tree)
36 
37 
def DumpTree(atree)
Definition: test.py:10
bool print
std::string test::FullFilename ( const std::string dir,
std::string  file 
)

Definition at line 88 of file test_stanfit_withsysts.C.

References file.

Referenced by test_stanfit_withsysts().

89  {
90  if (!dir.empty())
91  file = dir + "/" + file;
92 
93  return file;
94  }
TDirectory * dir
Definition: macro.C:5
TFile * file
Definition: cellShifts.C:17
std::unique_ptr<IPrediction> test::GetNumuPrediction ( osc::IOscCalcAdjustable calc,
const SystShifts systs,
bool  doExtrap 
)

Definition at line 73 of file test_stanfit_withsysts.C.

References ana::SystShifts::ActiveSysts(), calc, om::cerr, allTimeWatchdog::endl, plot_validation_datamc::fname, cet::getenv(), ana::kNuMu, ana::kNuMuNoExtrap, and string.

Referenced by test_stanfit_withsysts().

76  {
77  auto cvmfs_dir = std::getenv("NUMUDATA_DIR");
78  if (!cvmfs_dir)
79  {
80  std::cerr << "Couldn't find UPS dir for numu prediction!" << std::endl;
81  return nullptr;
82  }
83  auto fname = std::string(cvmfs_dir) + "lib/ana2018/Predictions/pred_fakeNDData_numuconcat_fhc__numu2018.root";
84  return std::make_unique<PredictionSystJoint2018>(doExtrap ? kNuMu : kNuMuNoExtrap,
85  &calc, "fhc", -1, systs.ActiveSysts(), fname);
86  }
OStream cerr
Definition: OStream.cxx:7
osc::OscCalcDumb calc
std::string getenv(std::string const &name)
std::vector< const ISyst * > ActiveSysts() const
Definition: SystShifts.cxx:221
enum BeamMode string
double test::LogGauss ( double  x,
double  mu,
double  sigma 
)

Definition at line 46 of file test_stanfit_dummy.C.

References test_ParserArtEvents::log, PandAna.reco_validation.add_data::offset, util::sqr(), and std::sqrt().

47  {
48  const double offset = log(1./sqrt(2*TMath::Pi()));
49  return offset - util::sqr(x - mu) / (2 * util::sqr(sigma));
50  }
T sqrt(T number)
Definition: d0nt_math.hpp:156
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
double sigma(TH1F *hist, double percentile)
void test::ResetCalculator ( osc::IOscCalcAdjustable calc)

Definition at line 50 of file test_stanfit_statsonly.C.

References std::asin(), e, osc::_IOscCalcAdjustable< T >::SetdCP(), osc::_IOscCalcAdjustable< T >::SetDmsq21(), osc::_IOscCalcAdjustable< T >::SetDmsq32(), osc::_IOscCalcAdjustable< T >::SetL(), osc::_IOscCalcAdjustable< T >::SetRho(), osc::_IOscCalcAdjustable< T >::SetTh12(), osc::_IOscCalcAdjustable< T >::SetTh13(), osc::_IOscCalcAdjustable< T >::SetTh23(), and std::sqrt().

Referenced by test_stanfit_statsonly(), test_stanfit_systpulls(), and test_stanfit_withsysts().

51  {
52  calc.SetL(810);
53  calc.SetRho(2.75);
54  calc.SetDmsq21(7.6e-5);
55  calc.SetDmsq32(2.35e-3);
56  calc.SetTh12(asin(sqrt(.87))/2);
57  calc.SetTh13(asin(sqrt(.10))/2);
58 // calc.SetTh23(TMath::Pi()/4);
59  calc.SetTh23(TMath::DegToRad() * 43);
60  calc.SetdCP(0);
61  }
virtual void SetL(double L)=0
virtual void SetDmsq21(const T &dmsq21)=0
T sqrt(T number)
Definition: d0nt_math.hpp:156
virtual void SetTh13(const T &th13)=0
virtual void SetDmsq32(const T &dmsq32)=0
virtual void SetRho(double rho)=0
virtual void SetTh23(const T &th23)=0
Float_t e
Definition: plot.C:35
virtual void SetTh12(const T &th12)=0
virtual void SetdCP(const T &dCP)=0
T asin(T number)
Definition: d0nt_math.hpp:60
def test.Setup0 ( )

Definition at line 21 of file test.py.

Referenced by Setup3().

21 def Setup0():
22  # simple materials for Qgeom
23  g4py.Qmaterials.Construct()
24 
25  # NIST materials
26  #g4py.NISTmaterials.Construct()
27 
28  # normal way for constructing user geometry
29  #qDC= g4py.Qgeom.QDetectorConstruction()
30  #gRunManager.SetUserInitialization(qDC)
31 
32  # 2nd way, short-cut way
33  g4py.Qgeom.Construct()
34 
35  # primary
36  global primary_position, primary_direction
37  primary_position= G4ThreeVector(0.,0., -14.9*cm)
38  primary_direction= G4ThreeVector(0.2, 0., 1.)
39 
40 
41 # ------------------------------------------------------------------
42 # Setup-1 (ExampleN01)
43 # ------------------------------------------------------------------
def Setup0()
Definition: test.py:21
def test.Setup1 ( )

Definition at line 44 of file test.py.

44 def Setup1():
45  g4py.ExN01geom.Construct()
46 
47  global primary_position, primary_direction
48  primary_position= G4ThreeVector(-2.5*m, 0., 0.)
49  primary_direction= G4ThreeVector(1., 0., 0.)
50 
51 
52 # ------------------------------------------------------------------
53 # Setup-3 (ExampleN03)
54 # ------------------------------------------------------------------
def Setup1()
Definition: test.py:44
def test.Setup3 ( )

Definition at line 55 of file test.py.

References python.gApplyUICommand, and Setup0().

55 def Setup3():
56  #exN03geom= g4py.ExN03geom.ExN03DetectorConstruction()
57  #gRunManager.SetUserInitialization(exN03geom)
58 
59  g4py.ExN03geom.Construct()
60 
61  global primary_position, primary_direction
62  primary_position= G4ThreeVector(-1.*m, 0., 0.)
63  primary_direction= G4ThreeVector(1., 0., 0.)
64 
65 
66 # ==================================================================
67 # main
68 # ==================================================================
69 # ------------------------------------------------------------------
70 # randum number
71 # ------------------------------------------------------------------
72 rand_engine= Ranlux64Engine()
73 HepRandom.setTheEngine(rand_engine)
74 HepRandom.setTheSeed(20050830)
75 
76 # ------------------------------------------------------------------
77 # user setup
78 # ------------------------------------------------------------------
79 Setup0()
80 #Setup1()
81 #Setup3()
82 
83 
84 # ------------------------------------------------------------------
85 # setup for physics list
86 # ------------------------------------------------------------------
87 # normal way for constructing user physics list
88 #exN01PL= ExN01PhysicsList.ExN01PhysicsList()
89 #gRunManager.SetUserInitialization(exN01PL)
90 
91 # 2nd way, short-cut way
92 # geantino + transportation
93 #g4py.ExN01pl.Construct()
94 
95 # electron/gamma standard EM
96 g4py.EMSTDpl.Construct()
97 
98 # ------------------------------------------------------------------
99 # setup for primary generator action
100 # ------------------------------------------------------------------
101 # ------------
102 # Particle Gun
103 # ------------
104 # normal way for constructing user physics list
105 #pgPGA= g4py.ParticleGun.ParticleGunAction()
106 #gRunManager.SetUserAction(pgPGA)
107 #pg= pgPGA.GetParticleGun()
108 
109 # 2nd way, short-cut way
110 pg= g4py.ParticleGun.Construct()
111 
112 # set parameters of particle gun
113 pg.SetParticleByName("e-")
114 pg.SetParticleEnergy(300.*MeV)
115 pg.SetParticlePosition(primary_position)
116 pg.SetParticleMomentumDirection(primary_direction)
117 
118 # ------------
119 # Medical Beam
120 # ------------
121 #beam= g4py.MedicalBeam.Construct()
122 
123 # ------------------------------------------------------------------
124 # go...
125 # ------------------------------------------------------------------
126 gRunManager.Initialize()
127 
128 # visualization
129 gApplyUICommand("/control/execute vis.mac")
130 
131 # beamOn
132 #gRunManager.BeamOn(3)
133 
134 
def Setup3()
Definition: test.py:55
def Setup0()
Definition: test.py:21
gApplyUICommand
Definition: __init__.py:165
void test::YouAreHere ( const int location)

Definition at line 125 of file fit_mcmc_ND_systs.C.

References om::cout, and allTimeWatchdog::endl.

126  {
127  std::cout << "You are at step number: " << location << "." << std::endl;
128  }
#define location
OStream cout
Definition: OStream.cxx:6

Variable Documentation

test.a

Definition at line 11 of file test.py.

test.acolor

Definition at line 9 of file test.py.

test.alist

Definition at line 9 of file test.py.

test.b

Definition at line 12 of file test.py.

test.c

Definition at line 13 of file test.py.

Referenced by test_stanfit_statsonly().

test.cmdstr

Definition at line 123 of file test.py.

test.fname = "%s.wrl"

Definition at line 308 of file test.py.

const QuadraticParameter test::kQuadParam

Definition at line 44 of file test_stanfit_dummy.C.

Referenced by test_stanfit_dummy().

double test::MOCKDATA_DM32 = 0.0025

Definition at line 48 of file test_stanfit_statsonly.C.

Referenced by test_stanfit_statsonly(), and test_stanfit_withsysts().

double test::MOCKDATA_TH23 = TMath::Pi()/4

Definition at line 47 of file test_stanfit_statsonly.C.

Referenced by test_stanfit_statsonly(), and test_stanfit_withsysts().

test.myx

Definition at line 45 of file test.py.

test.myz1

Definition at line 34 of file test.py.

test.myz2

Definition at line 39 of file test.py.

std::size_t test::N_POINTS = 5

Definition at line 28 of file test_stanfit_dummy.C.

Referenced by test::GaussQuadExperiment::LogLikelihood().

double test::POT = 10e20
const std::string test::SAVED_PRED_FILE = "/nova/ana/users/jwolcott/scratch/pred.root"

Definition at line 44 of file test_stanfit_statsonly.C.

Referenced by test_stanfit_statsonly().

const std::string test::SAVED_SAMPLES_FILE = "/nova/ana/users/jwolcott/scratch/mcmcsamples.root"

Definition at line 45 of file test_stanfit_statsonly.C.

Referenced by test_stanfit_statsonly().

double test::SEED_VAL = 25000

Definition at line 32 of file test_stanfit_dummy.C.

Referenced by test_stanfit_dummy().

const std::vector<std::string> test::SYSTS_TO_CHECK
Initial value:
{
"AbsMuEScale2017",
"Calibration",
"MECEnuShapeNu",
"RelativeCalib",
"RPAShapesupp2018",
}

Definition at line 49 of file test_stanfit_systpulls.C.

Referenced by test_stanfit_systpulls().

const std::vector< std::string > test::SYSTS_TO_THROW
Initial value:
{
"MvCCRES"
}

Definition at line 117 of file fit_mcmc_ND_systs.C.

Referenced by fit_mcmc_ND_systs(), and test_stanfit_withsysts().

const std::vector<std::string> test::TEST_SYSTS
Initial value:
{
"LowQ2RESSupp2020",
"FormZone2020",
"hNFSI_MFP_2020",
}

Definition at line 32 of file ThrowNDFDFakeData.C.

Referenced by mcmc_ana::GetSystList().

double test::TRUE_A = 1.8

Definition at line 29 of file test_stanfit_dummy.C.

Referenced by test_stanfit_dummy().

test.v

Definition at line 18 of file test.py.

test.x

Definition at line 50 of file test.py.

test.z

Definition at line 28 of file test.py.

Referenced by abs(), earms::GridSearch.AddHoughIntersections(), genie::BLI2DUnifGrid.AddPoint(), genie::BLI2DNonUnifGrid.AddPoint(), comi::NumiFilteringAna.analyze(), showere::ShowerEnergyAna.analyze(), mono::Monopole.analyze(), comi::Leana.AnaNHit(), genie::utils::gsl::wrap::BardinIMDRadCorIntegrand.BardinIMDRadCorIntegrand(), mcchk::LeptonAna.beginRun(), trk::KalmanGeoHelper.BestTrackPoint(), BinByBinTemplateFit(), BinByBinTemplateFit_TemplateResults(), CalcFiberLoopCorr(), ana.CalcMECDoubleGaussEnh(), ana.CalcMECDoubleGaussEnhDOWN(), ana.CalcMECDoubleGaussEnhNux(), ana.CalcMECDoubleGaussEnhUP(), ana.CalcMECGaussEnh(), geo::GeometryBase.calculateMassesLong(), caf::Proxy< caf::SRVector3D >.CheckEquals(), flat::Flat< caf::SRVector3D >.Clear(), genie::utils::frgmfunc.collins_spiller_func(), bpfit::dEdxCalculator.computeDEDX(), convert_mcnp_txt_to_root(), ConvertToGINuke(), ana::TargetCount.CountMass(), genie::NievesQELCCPXSec.deltaLindhard(), genie::utils::nuclear.Density(), trk::WindowTrackingAlg.DetermineInitialDirection(), bpfit::TrackBasis.DetToTrk(), rb::Prong.Dir(), rb::Track.DistanceFromEnd(), Dot(), caf::Proxy< caf::SRVector3D >.Dot(), evd::RecoBaseDrawer.DrawTrack2D(), evd::RecoBaseDrawer.DrawTrack3D(), evd::RecoBaseDrawer.DrawVertices2D(), genie::BLI2DUnifGrid.Evaluate(), genie::BLI2DNonUnifGrid.Evaluate(), extractBestFitInfo(), fabserrX(), dt::ViewMerger.FakeThirdDimension(), flat::Flat< caf::SRVector3D >.Fill(), ana::SurfaceKrige.FillSurface(), filter::Filter.FillTruthVariables(), comi::NumiFiltering.filter(), showere::ShowerEnergyFilterMC.filter(), trident::DimuonSliceFilter.filter(), trk::KalmanTrack.FilterOnly(), hv::HoughVertexAlg.FindMaximum(), rb::Track.FindNeighbouringPointIndices(), ana::FixGibuuWeight.FixGibuuWeight(), Flatplots(), cet.fourth(), genie::flux::GCylindTH1Flux.GenerateNext(), genie::flux::GAtmoFlux.GenerateNext_1try(), noe.get_int_plane_and_cell(), cosrej::CosRejFxs.getBBC(), slid::ParticleIDAlg.GetCellNodePos(), jmshower::RecoJMShower.GetCellNodePos(), GetDetectorVertex(), moonshadowana::MoonShadowAna.GetDetVec(), moonshadowana::MoonShadowAnaHough.GetDetVec(), ana::LikelihoodCovMxExperiment.GetGradAndHess(), airshower::AirSlicer.GetHitPos(), sim::FLSHit.GetPathLength(), novaddt::MoonShadow.GetPhysLength(), moonshadowana::MoonShadowAnaHough.GetPhysLength(), novaddt::MoonShadow.GetPhysVec(), moonshadowana::MoonShadowAnaHough.GetPhysVec(), evgen::CORSIKAGen.GetSample(), novaddt::DDTEvd.GetX(), moonshadowana::MoonShadowAna.GetX(), moonshadowana::MoonShadowAnaHough.GetX(), novaddt::UpMuTrigger.GetXYZ(), novaddt::UpMuAna.GetXYZ(), novaddt::DDTEvd.GetY(), moonshadowana::MoonShadowAna.GetY(), moonshadowana::MoonShadowAnaHough.GetY(), genie::CharmHadronization.Hadronize(), cheat::BackTracker.HitToXYZ(), genie::flux::GMonoEnergeticFlux.Index(), util.ipow(), geo::GeometryBase.isDetectorBigBoxUsed(), evgen::CORSIKAGen.isIntersectTheBox(), evgen::CosmicsGen.isIntersectTheBox(), calib::ThroughgoingSelection.IsUncontained(), filter::Filter.isVertexInFiducial(), ana::Kriger.Kriger(), Mag2(), caf::Proxy< caf::SRVector3D >.Mag2(), main(), bpfit::BreakPoint.MakeBasis(), trident::DimuonSliceFilter.MakeSelections(), ana::LikelihoodCovMxExperiment.MaskBetas(), evd::SimulationDrawer.MCTruthVertices2D(), evd::SimulationDrawer.MCTruthVertices3D(), genie::utils::intranuke2018.MeanFreePath(), calib::AttenFit.MedianProfile(), calib::AttenuationFit.MedianProfile(), rb::Cluster.MinMaxMeanXYZ(), MostConservative(), genie::KNOHadronization.MultiplicityProb(), neutron_evd(), ana::TargetCount.NNuclei(), genie::alvarezruso::AlvarezRusoCOHPiPDXSec.NuclearCurrent(), operator TVector3(), caf::Proxy< caf::SRVector3D >.operator TVector3(), mono.operator<<(), caf::Proxy< caf::SRVector3D >.operator=(), genie::utils::frgmfunc.peterson_func(), PhotonSim(), ana::Kriger.Predict(), prepare_mcnp_root_for_g4nova(), prob_method0(), numusand::FillSandbox.produce(), evgen::CosmicsGen.ProjectToBox(), bsim.readWeightLocations(), Rebin(), RunOneTrace(), earms::Minimizer.SeedVertex(), earms::ElasticArms.SetHit(), rb::HitList.SetHit(), bpfit::HitList3D.SetHit(), bpfit::Lutz.SetMeasurement(), earms::GridSearch.SetStandardDirections(), vdt::Minimizer2D.SetVertex(), vdt::Minimizer3D.SetVertex(), earms::ElasticArms.SetVertex(), rb::Vertex.SetXYZ(), rb::Vertex.SetZ(), lem::MakeLibrary.SliceMeanPosEWeighted(), TestSpacing(), htk::Track3D.time_fit(), mono::Track3D.time_fit(), dt::Chain.ToTrack(), rb::Track.Trajectory(), TransverseEff(), bpfit::TrackBasis.TrkToDet(), calib::AttenFit.TruncatedMeanProfile(), calib::AttenuationFit.TruncatedMeanProfile(), Unit(), caf::Proxy< caf::SRVector3D >.Unit(), genie::NievesQELCCPXSec.vcr(), trk::KalmanTrackMerge.ViewMergeTracks(), while(), wrong_sign_uncertainty(), bpfit::Lutz.X(), Z(), caf::Proxy< caf::SRVector3D >.Z(), and HEPREP::HepRepFactory.~HepRepFactory().