the header provides a set of helper functions to extract per layer information from the CaloExtension
All functions with HashLookup in the name return a vector that has a length equal to the maximum number of samplings, the first entry in the pair/tuple is a boolean indicating that the layer was crossed
If the vector contains a tuple use std::get<0>(entry),std::get<1>(entry), std::get<2>(entry) to get the elements
void midPointsHashLookupVector( const Trk::CaloExtension& extension, MidPointsHashLookupVector& result )
- fills a vector with the mid-points in the layers.
usage:
CaloExtensionHelpers::MidPointsHashLookupVector result;
CaloExtensionHelpers::midPointsHashLookupVector(extension,result);
check if layer was crossed bool isCrossed; const Amg::Vector3D& position; std::tie(isCrossed, position) = result[CaloSampling::theSample] if( isCrossed ){ std::cout << " radius " << position.perp() << std::endl; }
void entryExitPerLayerVector( const Trk::CaloExtension& extension, EntryExitPerLayerVector& result, const LayersToSelect* selection = nullptr )
- fills a vector with a tuple for every crossed layer. The first element is in the tuple is the Sampling enum,
the second the entry position, the third the exit position
usage:
CaloExtensionHelpers::EntryExitPerLayerVector result;
CaloExtensionHelpers::entryExitPerLayerVector( extension, result );
std::cout << " number of crossed layers " << result.size() << std::endl;
void entryExitLayerMap( const Trk::CaloExtension& extension, EntryExitLayerMap& result, const LayersToSelect* selection = nullptr )
- fills a map with the CaloSampling as key and a pair of entry/exit positions as content
EntryExitLayerMap result;
entryExitPerLayerVector( extension,result );
auto pos = result.find(CaloSampling::theSample);
if( pos != result.end() ){
std::cout << " radius entry " << pos.second.first.perp() << std::endl;
}
void entryEtaPhiHashLookupVector( const Trk::CaloExtension& extension, EtaPhiHashLookupVector& result )
- fills a vector with the eta-phi positions of the entry point in the layers.
usage:
CaloExtensionHelpers::EtaPhiHashLookupVector result;
CaloExtensionHelpers::entryEtaPhiHashLookupVector( extension, result );
bool isCrossed; double eta,phi;
std::tie(isCrossed, eta, phi) = result[CaloSampling::theSample]
check if layer was crossed if( isCrossed ){ std::cout << " eta " << eta << " phi " << phi << std::endl; }
void entryEtaPhiPerLayerVector( const Trk::CaloExtension& extension, EtaPhiPerLayerVector& result, const LayersToSelect* selection = nullptr )
- fills a vector with a tuple for every crossed layer. The first element is in the tuple is the Sampling enum,
the second the entry position, the third the exit position
usage:
CaloExtensionHelpers::EtaPhiPerLayerVector result;
CaloExtensionHelpers::entryEtaPhiPerLayerVector( extension, result );
std::cout << " number of crossed layers " << result.size() << std::endl;
void midPointEtaPhiHashLookupVector( const Trk::CaloExtension& extension, EtaPhiHashLookupVector& result )
- fills a vector with the eta-phi positions of the mid point point in the layers.
usage:
CaloExtensionHelpers::EtaPhiHashLookupVector result;
CaloExtensionHelpers::midPointEtaPhiHashLookupVector( extension, result );
bool isCrossed; double eta,phi;
std::tie(isCrossed, eta, phi) = result[CaloSampling::theSample]
check if layer was crossed if( isCrossed ){ std::cout << " eta " << eta << " phi " << phi << std::endl; }
void midPointEtaPhiPerLayerVector( const Trk::CaloExtension& extension, EtaPhiPerLayerVector& result, const LayersToSelect* selection = nullptr )
- fills a vector with a tuple for every crossed layer. The first element is in the tuple is the Sampling enum,
the second the entry position, the third the exit position
usage:
CaloExtensionHelpers::EtaPhiPerLayerVector result;
CaloExtensionHelpers::midPointEtaPhiPerLayerVector( extension, result );
std::cout << " number of crossed layers " << result.size() << std::endl;
if you need something else, have a look at the functions below, you can easily create your own...
Definition at line 137 of file CaloExtensionHelpers.h.