test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GSFAndHCALLinker.cc
Go to the documentation of this file.
6 
8 public:
11  _useKDTree(conf.getParameter<bool>("useKDTree")),
12  _debug(conf.getUntrackedParameter<bool>("debug",false)) {}
13 
14  double testLink
15  ( const reco::PFBlockElement*,
16  const reco::PFBlockElement* ) const override;
17 
18 private:
20 };
21 
24  "GSFAndHCALLinker");
25 
27  ( const reco::PFBlockElement* elem1,
28  const reco::PFBlockElement* elem2) const {
31  const reco::PFBlockElementCluster *hcalelem(NULL);
32  const reco::PFBlockElementGsfTrack *gsfelem(NULL);
33  double dist(-1.0);
34  if( elem1->type() < elem2->type() ) {
35  hcalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
36  gsfelem = static_cast<const reco::PFBlockElementGsfTrack*>(elem2);
37  } else {
38  hcalelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
39  gsfelem = static_cast<const reco::PFBlockElementGsfTrack*>(elem1);
40  }
41  const reco::PFRecTrack& track = gsfelem->GsftrackPF();
42  const reco::PFClusterRef& clusterref = hcalelem->clusterRef();
43  const reco::PFTrajectoryPoint& tkAtHCAL =
44  track.extrapolatedPoint( HCALEnt );
45  if( tkAtHCAL.isValid() ) {
46  dist = LinkByRecHit::testTrackAndClusterByRecHit( track, *clusterref,
47  false, _debug );
48  }
49  if ( _debug ) {
50  if ( dist > 0. ) {
51  std::cout << " Here a link has been established"
52  << " between a GSF track an Hcal with dist "
53  << dist << std::endl;
54  } else {
55  if( _debug ) std::cout << " No link found " << std::endl;
56  }
57  }
58 
59  return dist;
60 }
Abstract base class for a PFBlock element (track, cluster...)
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
Type type() const
#define NULL
Definition: scimark2.h:8
const PFClusterRef & clusterRef() const
#define constexpr
GSFAndHCALLinker(const edm::ParameterSet &conf)
const GsfPFRecTrack & GsftrackPF() const
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:76
tuple conf
Definition: dbtoconf.py:185
bool isValid() const
is this point valid ?
tuple cout
Definition: gather_cfg.py:121
#define DEFINE_EDM_PLUGIN(factory, type, name)
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
volatile std::atomic< bool > shutdown_flag false
LayerType
Define the different layers where the track can be propagated.
static double testTrackAndClusterByRecHit(const reco::PFRecTrack &track, const reco::PFCluster &cluster, bool isBrem=false, bool debug=false)
Definition: LinkByRecHit.cc:10
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override