Project

General

Profile

Bug #1171

Global recon fails in G4.9.5.p01

Added by Rogers, Chris over 11 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Optics
Target version:
Start date:
20 November 2012
Due date:
% Done:

100%

Estimated time:
Workflow:
New Issue

Description

Since last commit global reconstruction fails in G4.9.5.p01

#1

Updated by Rogers, Chris over 11 years ago

#2

Updated by Lane, Peter over 11 years ago

tests/cpp_unit/Optics/PolynomialOpticsModelTest.cc:223: Failure
The difference between expected_vector[index] and output_vector[index] is 0.0071046097002653852, which exceeds 5.0e-4, where
expected_vector[index] evaluates to 7.5465999999999998,
output_vector[index] evaluates to 7.5537046097002651, and
5.0e-4 evaluates to 0.00050000000000000001.
tests/cpp_unit/Optics/PolynomialOpticsModelTest.cc:223: Failure
The difference between expected_vector[index] and output_vector[index] is 24.764712605030638, which exceeds 5.0e-4, where
expected_vector[index] evaluates to 1,
output_vector[index] evaluates to -23.764712605030638, and
5.0e-4 evaluates to 0.00050000000000000001.
tests/cpp_unit/Optics/PolynomialOpticsModelTest.cc:223: Failure
The difference between expected_vector[index] and output_vector[index] is 2.2421678689759084, which exceeds 5.0e-4, where
expected_vector[index] evaluates to 0,
output_vector[index] evaluates to -2.2421678689759084, and
5.0e-4 evaluates to 0.00050000000000000001.
tests/cpp_unit/Optics/PolynomialOpticsModelTest.cc:223: Failure
The difference between expected_vector[index] and output_vector[index] is 73.646309260739855, which exceeds 5.0e-4, where
expected_vector[index] evaluates to 3,
output_vector[index] evaluates to -70.646309260739855, and
5.0e-4 evaluates to 0.00050000000000000001.
tests/cpp_unit/Optics/PolynomialOpticsModelTest.cc:223: Failure
The difference between expected_vector[index] and output_vector[index] is 6.5644281218144425, which exceeds 5.0e-4, where
expected_vector[index] evaluates to 0,
output_vector[index] evaluates to -6.5644281218144425, and
5.0e-4 evaluates to 0.00050000000000000001.
...
tests/cpp_unit/Optics/PolynomialOpticsModelTest.cc:230: Failure
The difference between expected_vector[index] and output_vector[index] is 0.0026447464054681902, which exceeds 5.0e-4, where
expected_vector[index] evaluates to 3.7732999999999999,
output_vector[index] evaluates to 3.7759447464054681, and
5.0e-4 evaluates to 0.00050000000000000001.
tests/cpp_unit/Optics/PolynomialOpticsModelTest.cc:230: Failure
The difference between expected_vector[index] and output_vector[index] is 4.3820956589048876, which exceeds 5.0e-4, where
expected_vector[index] evaluates to 1,
output_vector[index] evaluates to -3.3820956589048876, and
5.0e-4 evaluates to 0.00050000000000000001.
tests/cpp_unit/Optics/PolynomialOpticsModelTest.cc:230: Failure
The difference between expected_vector[index] and output_vector[index] is 1.9795695685160695, which exceeds 5.0e-4, where
expected_vector[index] evaluates to 0,
output_vector[index] evaluates to -1.9795695685160695, and
5.0e-4 evaluates to 0.00050000000000000001.
tests/cpp_unit/Optics/PolynomialOpticsModelTest.cc:230: Failure
The difference between expected_vector[index] and output_vector[index] is 32.116193332664174, which exceeds 5.0e-4, where
expected_vector[index] evaluates to 3,
output_vector[index] evaluates to -29.116193332664174, and
5.0e-4 evaluates to 0.00050000000000000001.
tests/cpp_unit/Optics/PolynomialOpticsModelTest.cc:230: Failure
The difference between expected_vector[index] and output_vector[index] is 8.9962687902594318, which exceeds 5.0e-4, where
expected_vector[index] evaluates to 0,
output_vector[index] evaluates to -8.9962687902594318, and
5.0e-4 evaluates to 0.00050000000000000001.

These are failures in the simulation-based transfer matrix of a 2m drift to transport vectors accurately. This looks to me like some stochastics aren't being turned off. Here are the input and output vectors used to create the map:

DEBUG PolynomialMap::PolynomialLeastSquaresFit() A = [
[1, 1, 226.1939223, 0, 0, 0, 0]
[1, 0, 227.1939223, 0, 0, 0, 0]
[1, 0, 226.1939223, 1, 0, 0, 0]
[1, 0, 226.1939223, 0, 1, 0, 0]
[1, 0, 226.1939223, 0, 0, 1, 0]
[1, 0, 226.1939223, 0, 0, 0, 1]
[1, 1, 227.1939223, 0, 0, 0, 0]
]
DEBUG PolynomialMap::PolynomialLeastSquaresFit() Y = [
[4.7750322365387, 226.193898989024, -4.37645722410279, -1.97920086775052, -32.074919239022, -8.9945213024947],
[3.77032668518419, 227.193899441379, -4.34738148498707, -1.97729958693374, -31.8620809186776, -8.98551001892789],
[3.77503223653869, 226.193898989024, -3.37645722410279, -1.97920086775052, -32.074919239022, -8.9945213024947],
[3.77486687735336, 226.19390048963, 11.2631913212691, 2.44416034648532, -28.9784230835539, -8.59927355959151],
[3.77503223653869, 226.193898989024, -4.37645722410279, -1.97920086775052, -31.074919239022, -8.9945213024947],
[3.77486687735336, 226.19390048963, 28.9784230835539, 8.59927355959151, 11.2631913212691, 2.44416034648532],
[4.77032668518419, 227.193899441379, -4.34738148498707, -1.97729958693374, -31.8620809186776, -8.98551001892789]
]

The older version of geant4 produces the following output vector which is more accurate:

DEBUG PolynomialMap::PolynomialLeastSquaresFit() Y = [
[4.77250888190114, 226.193906791809, 0, 0, 0, 0],
[3.76789329132502, 227.193906860069, 0, 0, 0, 0],
[3.77250888190114, 226.193906791809, 1, 0, 0, 0],
[3.77255603914636, 226.193906791809, 5.00006250050843, 0.999999912303538, 0, 0],
[3.77250888190114, 226.193906791809, 0, 0, 1, 0],
[3.77255603914636, 226.193906791809, 0, 0, 5.00006250050843, 0.999999912303538],
[4.76789329132502, 227.193906860069, 0, 0, 0, 0]
]

I don't understand why it would be doing this. Have any stochastic settings been changed in the new version of geant4? That would be my immediate suspicion.

#3

Updated by Lane, Peter over 11 years ago

Actually, stochastics shouldn't matter because this is a Galactic volume. There's nothing to collide with to cause energy loss or scattering! I'm very confused.

#4

Updated by Lane, Peter over 11 years ago

Ok, I think I was looking at the wrong Test.dat. There is an lH2 detector at the origin. I'm not sure why this did not affect the previous version, but I will move my drift segment so that it does not pass through this detector and see if that fixes things.

#5

Updated by Lane, Peter over 11 years ago

Moving the drift away from the lH2 detector had no effect. I think we need more tests in MAUSGeant4ManagerTest.cc to verify that the settings in MAUSUnitTest.cc are being accepted (i.e. no energy loss if not passing through the lH2 detector).

#6

Updated by Rogers, Chris over 11 years ago

I can't remember - did I show you where the MAUSPhysicsList stuff is tested (tests/integration/test_simulation/test_physics_list/test_physics_model_brief at integration test level? Do you want me to move that down to unit level? Chat at software phone call?

#7

Updated by Lane, Peter over 11 years ago

Chris, here is the simplest test for no scattering in Galactic I could muster:

TEST(MAUSGeant4ManagerTest, NoScatteringTest) {
    MAUS::MAUSPrimaryGeneratorAction::PGParticle part_in;
    part_in.x = 0.;
    part_in.y = 0.;
    part_in.z = 1000.;
    part_in.time = 0.;
    part_in.px = 0.;
    part_in.py = 0.;
    part_in.pz = 200.;
    part_in.energy = 226.1939223;
    part_in.seed = 10;
    part_in.pid = -13;

    MAUS::VirtualPlaneManager virtual_planes;
    MAUS::VirtualPlane end_plane = MAUS::VirtualPlane::BuildVirtualPlane(
        CLHEP::HepRotation(), CLHEP::Hep3Vector(0., 0., 2000.), -1, true,
        2000., BTTracker::z, MAUS::VirtualPlane::ignore, false);
    virtual_planes.AddPlane(new MAUS::VirtualPlane(end_plane), NULL);
    MAUS::MAUSGeant4Manager::GetInstance()->SetVirtualPlanes(&virtual_planes);
    MAUSGeant4Manager::GetInstance()->GetStepping()->SetWillKeepSteps(false);
    const Json::Value event
        = MAUSGeant4Manager::GetInstance()->RunParticle(part_in);
    const Json::Value hits = event["virtual_hits"];
    const Json::Value hit = hits[static_cast<Json::Value::UInt>(0)];
    EXPECT_EQ(0., hit["momentum"]["x"].asDouble());
    EXPECT_EQ(0., hit["momentum"]["y"].asDouble());
    EXPECT_EQ(200., hit["momentum"]["z"].asDouble());
}

When I ran it I got the following failure messages showing that the momenta are very different:

./tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:204: Failure
Value of: hit["momentum"]["x"].asDouble()
Actual: 0.91425444734230399
Expected: 0.
Which is: 0
./tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:205: Failure
Value of: hit["momentum"]["y"].asDouble()
Actual: -13.938087763539
Expected: 0.
Which is: 0
./tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:206: Failure
Value of: hit["momentum"]["z"].asDouble()
Actual: 199.51163333734533
Expected: 200.
Which is: 200

#8

Updated by Lane, Peter over 11 years ago

Here's a safer version that won't cause other tests to crash:

TEST(MAUSGeant4ManagerTest, NoScatteringTest) {
    MAUS::MAUSPrimaryGeneratorAction::PGParticle part_in;
    part_in.x = 0.;
    part_in.y = 0.;
    part_in.z = 1000.;
    part_in.time = 0.;
    part_in.px = 0.;
    part_in.py = 0.;
    part_in.pz = 200.;
    part_in.energy = 226.1939223;
    part_in.seed = 10;
    part_in.pid = -13;

    MAUS::MAUSGeant4Manager * const simulator
        = MAUS::MAUSGeant4Manager::GetInstance();
    MAUS::VirtualPlaneManager const * const old_virtual_planes
        = simulator->GetVirtualPlanes();
    MAUS::VirtualPlaneManager * const virtual_planes
        = new MAUS::VirtualPlaneManager;
    MAUS::VirtualPlane end_plane = MAUS::VirtualPlane::BuildVirtualPlane(
        CLHEP::HepRotation(), CLHEP::Hep3Vector(0., 0., 2000.), -1, true,
        2000., BTTracker::z, MAUS::VirtualPlane::ignore, false);
    virtual_planes->AddPlane(new MAUS::VirtualPlane(end_plane), NULL);
    simulator->SetVirtualPlanes(virtual_planes);
    simulator->GetStepping()->SetWillKeepSteps(false);
    const Json::Value event = simulator->RunParticle(part_in);
    simulator->SetVirtualPlanes(
        const_cast<MAUS::VirtualPlaneManager *>(old_virtual_planes));
    delete virtual_planes;

    const Json::Value hits = event["virtual_hits"];
    ASSERT_EQ(static_cast<size_t>(1), hits.size());
    const Json::Value hit = hits[static_cast<Json::Value::UInt>(0)];
    EXPECT_EQ(0., hit["momentum"]["x"].asDouble());
    EXPECT_EQ(0., hit["momentum"]["y"].asDouble());
    EXPECT_NEAR(200., hit["momentum"]["z"].asDouble(), 1.0e-4);
}
#9

Updated by Rogers, Chris over 11 years ago

Thanks for that. There was indeed a problem in the physics list, fixed in r854

#10

Updated by Rogers, Chris over 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100
#11

Updated by Rogers, Chris over 11 years ago

Tests failed in heplnm071 with:

[ RUN      ] MAUSGeant4ManagerTest.ScatteringOffMaterialTest
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:222: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:224: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:226: Failure
Expected: (fabs(5000.-get_energy(hits[1u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:234: Failure
Expected: (fabs(5000.-get_energy(hits[2u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:238: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:240: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:242: Failure
Expected: (fabs(5000.-get_energy(hits[3u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -13
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:222: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:224: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:226: Failure
Expected: (fabs(5000.-get_energy(hits[1u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:234: Failure
Expected: (fabs(5000.-get_energy(hits[2u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:238: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:240: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 13
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:242: Failure
Expected: (fabs(5000.-get_energy(hits[3u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 13
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:222: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:224: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:226: Failure
Expected: (fabs(5000.-get_energy(hits[1u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:234: Failure
Expected: (fabs(5000.-get_energy(hits[2u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:238: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:240: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:242: Failure
Expected: (fabs(5000.-get_energy(hits[3u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -11
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:222: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:224: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:226: Failure
Expected: (fabs(5000.-get_energy(hits[1u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:234: Failure
Expected: (fabs(5000.-get_energy(hits[2u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:238: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:240: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 11
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:242: Failure
Expected: (fabs(5000.-get_energy(hits[3u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 11
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:222: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:224: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:226: Failure
Expected: (fabs(5000.-get_energy(hits[1u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:234: Failure
Expected: (fabs(5000.-get_energy(hits[2u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:238: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:240: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:242: Failure
Expected: (fabs(5000.-get_energy(hits[3u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -211
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:222: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:224: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:226: Failure
Expected: (fabs(5000.-get_energy(hits[1u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:234: Failure
Expected: (fabs(5000.-get_energy(hits[2u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:238: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:240: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 211
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:242: Failure
Expected: (fabs(5000.-get_energy(hits[3u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 211
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:222: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 2212
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:224: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 2212
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:226: Failure
Expected: (fabs(5000.-get_energy(hits[1u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 2212
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:234: Failure
Expected: (fabs(5000.-get_energy(hits[2u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 2212
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:238: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 2212
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:240: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 2212
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:242: Failure
Expected: (fabs(5000.-get_energy(hits[3u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 2212
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:218: Failure
The difference between 5000. and get_energy(hits[0u][0u]) is 203.66926687359137, which exceeds 1.0e-3, where
5000. evaluates to 5000,
get_energy(hits[0u][0u]) evaluates to 4796.3307331264086, and
1.0e-3 evaluates to 0.001.
Failed with pid 1000020040
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:222: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 1000020040
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:224: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 1000020040
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:238: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 1000020040
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:240: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 1000020040
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:222: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:224: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:226: Failure
Expected: (fabs(5000.-get_energy(hits[1u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:234: Failure
Expected: (fabs(5000.-get_energy(hits[2u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:238: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:240: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:242: Failure
Expected: (fabs(5000.-get_energy(hits[3u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid 321
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
HepRotation::rotateAxes: bad axis vectors
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:222: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:224: Failure
Expected: (fabs(0.-hits[1u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:226: Failure
Expected: (fabs(5000.-get_energy(hits[1u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:234: Failure
Expected: (fabs(5000.-get_energy(hits[2u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:238: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["x"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:240: Failure
Expected: (fabs(0.-hits[3u][0u]["momentum"]["y"].asDouble())) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -321
tests/cpp_unit/Simulation/MAUSGeant4ManagerTest.cc:242: Failure
Expected: (fabs(5000.-get_energy(hits[3u][0u]))) >= (1.0e-3), actual: 0 vs 0.001
Failed with pid -321
[  FAILED  ] MAUSGeant4ManagerTest.ScatteringOffMaterialTest (46674 ms)
[----------] 7 tests from MAUSGeant4ManagerTest (47007 ms total)

I think this is the old bug that sometimes we don't see volumes. Let me dig...

#12

Updated by Rogers, Chris over 11 years ago

  • Status changed from Closed to Open
  • % Done changed from 100 to 0
#13

Updated by Rogers, Chris over 11 years ago

There are a whole load of error messages like

HepRotation::rotateAxes: bad axis vectors

which look suspicious... I googled around and also added a stack trace to the relevant error handler in CLHEP. Makes it look like some memory problem in G4PVPlacement rotation. I think G4 references the rotation but the memory is owned by MiceModules, it's not documented. Maybe MiceModules are getting deleted/overwritten in some other test and the memory is becoming unallocated (which doesn't happen during normal running, but this is a warning for me to be more careful).

As a test I added explicit memory allocation in MICEDetectorConstruction where the G4PVPlacement is constructed - and indeed the error message disappears. I checked with valgrind and don't see any memory leak complaints, so I guess G4 owns this memory (does that mean it was a double free before? Not clear). I'll commit the code.

Nb: the G4 stuff is quite leaky anyway, legacy memory problems that need to be cleaned up, say before we can run with multiple G4 definitions (e.g. multiple runs in the control room).

#14

Updated by Rogers, Chris almost 11 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

I think this is fixed.

#15

Updated by Rajaram, Durga over 10 years ago

  • Target version changed from Future MAUS release to MAUS-v0.6.0

Also available in: Atom PDF