5#ifndef CALOEXTENSIONHELPERS_H
6#define CALOEXTENSIONHELPERS_H
21 typedef std::map< CaloSampling::CaloSample, std::pair<Amg::Vector3D, Amg::Vector3D> >
EntryExitLayerMap;
136 template<
class T,
class O>
147 if( prev != cur && parsIdHelper.
isEntryToVolume((*prev).cIdentifier()) ) {
166 auto& val =
vec[parsIdHelper.
caloSample(entry.cIdentifier())];
168 val.second = 0.5*( exit.position() + entry.position() );
184 vec.push_back( std::make_tuple(parsIdHelper.
caloSample(entry.cIdentifier()),entry.position(),exit.position()) );
198 thisResult[ parsIdHelper.
caloSample(entry.cIdentifier()) ] = std::make_pair(entry.position(),exit.position());
209 thisResult[ parsIdHelper.
caloSample(entry.cIdentifier()) ] = (entry.position()-exit.position()).mag();
220 thisResult[ parsIdHelper.
caloSample(entry.cIdentifier()) ] = fabs(entry.momentum().mag()-exit.momentum().mag());
231 auto& val =
vec[parsIdHelper.
caloSample(entry.cIdentifier())];
232 std::get<0>(val) =
true;
233 std::get<1>(val) = entry.position().eta();
234 std::get<2>(val) = entry.position().phi();
248 vec.push_back( std::make_tuple(parsIdHelper.
caloSample(entry.cIdentifier()),entry.position().eta(),entry.position().phi()) );
260 auto& val =
vec[parsIdHelper.
caloSample(entry.cIdentifier())];
261 Amg::Vector3D pos = 0.5*( exit.position() + entry.position() );
262 std::get<0>(val) =
true;
263 std::get<1>(val) = pos.eta();
264 std::get<2>(val) = pos.phi();
279 Amg::Vector3D pos = 0.5*( exit.position() + entry.position() );
280 vec.push_back( std::make_tuple(parsIdHelper.
caloSample(entry.cIdentifier()),pos.eta(),pos.phi()) );
std::vector< size_t > vec
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
Tracking class to hold the extrapolation through calorimeter Layers Both the caloEntryLayerIntersecti...
const std::vector< CurvilinearParameters > & caloLayerIntersections() const
access to the intersections with the calorimeter layers.
helper class to encode and decode a TrackParametersIdentifier
bool isEntryToVolume(TrackParametersIdentifier id) const
returns true if the id belongs to the volume entrance
CaloSampling::CaloSample caloSample(TrackParametersIdentifier id) const
CaloSample encoded in id, returns CaloSampling::Unknown if id is not valid.
const std::string selection
Eigen::Matrix< double, 3, 1 > Vector3D
void entryEtaPhiHashLookupVector(const Trk::CaloExtension &extension, EtaPhiHashLookupVector &result)
std::set< CaloSampling::CaloSample > LayersToSelect
void entryExitPerLayerVector(const Trk::CaloExtension &extension, EntryExitPerLayerVector &result, const LayersToSelect *selection=nullptr)
void midPointsHashLookupVector(const Trk::CaloExtension &extension, MidPointsHashLookupVector &result)
void entryExitLayerMap(const Trk::CaloExtension &extension, EntryExitLayerMap &result, const LayersToSelect *selection=nullptr)
std::map< CaloSampling::CaloSample, double > ScalarLayerMap
void pathLenLayerMap(const Trk::CaloExtension &extension, ScalarLayerMap &result)
std::vector< std::pair< bool, Amg::Vector3D > > MidPointsHashLookupVector
void eLossLayerMap(const Trk::CaloExtension &extension, ScalarLayerMap &result)
void entryEtaPhiPerLayerVector(const Trk::CaloExtension &extension, EtaPhiPerLayerVector &result, const LayersToSelect *selection=nullptr)
void entryExitProcessor(const Trk::CaloExtension &extension, T &result, O oper, const LayersToSelect *selection=nullptr)
the header provides a set of helper functions to extract per layer information from the CaloExtension
std::vector< std::tuple< CaloSampling::CaloSample, Amg::Vector3D, Amg::Vector3D > > EntryExitPerLayerVector
void midPointEtaPhiPerLayerVector(const Trk::CaloExtension &extension, EtaPhiPerLayerVector &result, const LayersToSelect *selection=nullptr)
std::map< CaloSampling::CaloSample, std::pair< Amg::Vector3D, Amg::Vector3D > > EntryExitLayerMap
std::vector< std::tuple< bool, double, double > > EtaPhiHashLookupVector
void midPointEtaPhiHashLookupVector(const Trk::CaloExtension &extension, EtaPhiHashLookupVector &result)
std::vector< std::tuple< CaloSampling::CaloSample, double, double > > EtaPhiPerLayerVector
CurvilinearParametersT< TrackParametersDim, Charged, PlaneSurface > CurvilinearParameters