Commit 492803fb authored by John Kenneth Anders's avatar John Kenneth Anders
Browse files

Merge branch 'add_negative_mass_for_anti_proton_neutron_ISF_FastCaloSimV2' into '21.0'

Construct TFCSTruthState with negative mass for anti protons and anti neutrons

See merge request atlas/athena!16708

Former-commit-id: c34d8543700bf326c7dd04c38864a4c91546da93
parents 287d0800 d7d234e8
......@@ -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)
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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment