File indexing completed on 2024-04-06 12:27:28
0001 #include "TrackFromParentImporter.h"
0002 #include "DataFormats/ParticleFlowReco/interface/PFDisplacedTrackerVertex.h"
0003
0004 namespace {
0005 class VeryLooseNuclAdaptor {
0006 public:
0007 static bool check_importable(const reco::PFDisplacedTrackerVertexCollection::value_type& t) {
0008 const auto& vtx = t.displacedVertexRef();
0009 return ((vtx->isNucl() && vtx->position().rho() > 2.7) || (vtx->isNucl_Loose()) || (vtx->isNucl_Kink()));
0010 }
0011 static const reco::PFRecTrackRefVector& get_track_refs(
0012 const reco::PFDisplacedTrackerVertexCollection::value_type& t) {
0013 return t.pfRecTracks();
0014 }
0015 static void set_element_info(reco::PFBlockElement* elem,
0016 const edm::Ref<reco::PFDisplacedTrackerVertexCollection>& parref) {
0017 const reco::PFBlockElementTrack* tkelem = static_cast<const reco::PFBlockElementTrack*>(elem);
0018 const reco::PFRecTrackRef& reftrack = tkelem->trackRefPF();
0019 reco::PFBlockElement::TrackType tkType = reco::PFBlockElement::DEFAULT;
0020 if (parref->isIncomingTrack(reftrack))
0021 tkType = reco::PFBlockElement::T_TO_DISP;
0022 else if (parref->isOutgoingTrack(reftrack))
0023 tkType = reco::PFBlockElement::T_FROM_DISP;
0024 elem->setDisplacedVertexRef(parref, tkType);
0025 }
0026 };
0027 }
0028
0029 typedef pflow::importers::TrackFromParentImporter<reco::PFDisplacedTrackerVertexCollection, VeryLooseNuclAdaptor>
0030 VeryLooseNuclearInteractionTrackImporter;
0031
0032 DEFINE_EDM_PLUGIN(BlockElementImporterFactory,
0033 VeryLooseNuclearInteractionTrackImporter,
0034 "VeryLooseNuclearInteractionTrackImporter");