Commit f0897517 authored by Jeroen van Tilburg's avatar Jeroen van Tilburg
Browse files

Changed MCFTDepositCreator to determine air gap inefficiencies by Boole

parent 9c0e47bc
......@@ -120,31 +120,65 @@ std::tuple<LHCb::MCFTDeposits,LHCb::MCFTPhotons> MCFTDepositCreator::operator()(
for( const LHCb::MCHit* mchit : *mchits ){
// get sensDetID of MCHit
const int sensDetID = mchit->sensDetID();
//const int sensDetID = mchit->sensDetID();
double dZ = 0.5*(mchit->exit().z() - mchit->entry().z() );
const int sensDetID = m_deFT->sensitiveVolumeID( Gaudi::XYZPoint{mchit->entry().x(),
mchit->entry().y(), mchit->entry().z()+dZ});
const int sensDetID2 = m_deFT->sensitiveVolumeID( Gaudi::XYZPoint{mchit->exit().x(),
mchit->exit().y(), mchit->exit().z()-dZ});
if (sensDetID != -1) {
const DeFTMat* mat_ptr = m_deFT->findMat(sensDetID);
if ( mat_ptr == nullptr ) {
error() << "FT module not found for sensDetID = " << sensDetID << endmsg;
return returnContainers;
}
const DeFTMat& mat = *mat_ptr;
// choose which function to call depending on simulation type
switch(m_simulationType){
case SimulationType::detailed:
convertHitToPhotons(mchit, mat, spill.first, photons);
break;
case SimulationType::improved:
convertHitToPhotons(mchit, mat, spill.first, photons);
break;
case SimulationType::effective:
convertHitToDepositsEffective(mchit, mat, spill.first, deposits);
break;
}
}
if ( sensDetID2 != -1 and sensDetID != sensDetID2) {
const DeFTMat* mat_ptr = m_deFT->findMat(sensDetID2);
if ( mat_ptr == nullptr ) {
error() << "FT module not found for sensDetID = " << sensDetID << endmsg;
return returnContainers;
}
const DeFTMat& mat = *mat_ptr;
// choose which function to call depending on simulation type
switch(m_simulationType){
case SimulationType::detailed:
convertHitToPhotons(mchit, mat, spill.first, photons);
break;
case SimulationType::improved:
convertHitToPhotons(mchit, mat, spill.first, photons);
break;
case SimulationType::effective:
convertHitToDepositsEffective(mchit, mat, spill.first, deposits);
break;
}
}
// Check if sensDetID is filled and if a mat can be associated
if (sensDetID == -1) {
if (sensDetID == -1 and sensDetID2 == -1) {
counter("NbOfMissedMCHits")+= 1;
debug() << "Empty sensDetID of MCHit (happens <1 times/event)" << endmsg;
continue;
}
const DeFTMat* mat_ptr = m_deFT->findMat(sensDetID);
if ( mat_ptr == nullptr ) {
error() << "FT module not found for sensDetID = " << sensDetID << endmsg;
return returnContainers;
}
const DeFTMat& mat = *mat_ptr;
// choose which function to call depending on simulation type
switch(m_simulationType){
case SimulationType::detailed:
convertHitToPhotons(mchit, mat, spill.first, photons);
break;
case SimulationType::improved:
convertHitToPhotons(mchit, mat, spill.first, photons);
break;
case SimulationType::effective:
convertHitToDepositsEffective(mchit, mat, spill.first, deposits);
break;
}
} // loop on hits
} // loop on spills
......
Markdown is supported
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