Skip to content
Snippets Groups Projects
Commit 36154f60 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'cherry-pick-492803fb [formerly c34d854370]-master' into 'master'

Sweeping !16708 from 21.0 to master.
Construct TFCSTruthState with negative mass for anti protons and anti neutrons

See merge request atlas/athena!16773

Former-commit-id: 35e636bf
parents f870dfcc f7205646
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ class ParamsInputFilename(JobProperty):
""" Filename of the input parametrizations file. """
statusOn = True
allowedTypes = ['str']
StoredValue = 'FastCaloSim/MC16/TFCSparam_v008.root'
StoredValue = 'FastCaloSim/MC16/TFCSparam_v009.root'
##-----------------------------------------------------------------------------
## 2nd step
......
......@@ -205,14 +205,27 @@ StatusCode ISF::FastCaloSimSvcV2::simulate(const ISF::ISFParticle& isfp, McEvent
return StatusCode::SUCCESS;
}
TFCSTruthState truth(isfp.momentum().x(),isfp.momentum().y(),isfp.momentum().z(),sqrt(isfp.momentum().mag2()+pow(isfp.mass(),2)),isfp.pdgCode());
/// for anti protons and anti neutrons the kinetic energy should be
/// calculated as Ekin = E() + M() instead of E() - M()
/// this is achieved by constructing the TFCSTruthState with negative mass
float isfp_mass = isfp.mass();
if(isfp.pdgCode() == -2212 or isfp.pdgCode() == -2112) {
isfp_mass = - isfp_mass;
ATH_MSG_VERBOSE("Found anti-proton/neutron, negative mass is used for TFCSTruthState ");
}
TFCSTruthState truth;
truth.SetPtEtaPhiM(particle_direction.perp(), particle_direction.eta(), particle_direction.phi(), isfp_mass);
truth.set_pdgid(isfp.pdgCode());
truth.set_vertex(particle_position[Amg::x], particle_position[Amg::y], particle_position[Amg::z]);
TFCSExtrapolationState extrapol;
m_FastCaloSimCaloExtrapolation->extrapolate(extrapol,&truth);
TFCSSimulationState simulstate(m_randomEngine);
ATH_MSG_DEBUG(" particle: " << isfp.pdgCode() << " Ekin: " << isfp.ekin() << " position eta: " << particle_position.eta() << " direction eta: " << particle_direction.eta() << " position phi: " << particle_position.phi() << "direction phi: " << particle_direction.phi());
ATH_MSG_DEBUG(" particle: " << isfp.pdgCode() << " Ekin: " << isfp.ekin() << " position eta: " << particle_position.eta() << " direction eta: " << particle_direction.eta() << " position phi: " << particle_position.phi() << " direction phi: " << particle_direction.phi());
m_param->setLevel(MSG::DEBUG);
FCSReturnCode status = m_param->simulate(simulstate, &truth, &extrapol);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment