CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
EgammaHLTPixelMatchElectronAlgo Class Reference

#include <EgammaHLTPixelMatchElectronAlgo.h>

Public Member Functions

 EgammaHLTPixelMatchElectronAlgo (const edm::ParameterSet &conf)
 
void run (edm::Event &, reco::ElectronCollection &)
 
void setupES (const edm::EventSetup &setup)
 
 ~EgammaHLTPixelMatchElectronAlgo ()
 

Private Member Functions

void process (edm::Handle< reco::TrackCollection > tracksH, reco::ElectronCollection &outEle, Global3DPoint &bs)
 

Private Attributes

edm::InputTag BSProducer_
 
edm::ESHandle
< GeometricSearchTracker
theGeomSearchTracker
 
edm::ESHandle< MagneticFieldtheMagField
 
edm::InputTag trackProducer_
 

Detailed Description

Class to reconstruct electron tracks from electron pixel seeds keep track of information about the initiating supercluster

Author
Monica Vazquez Acosta (CERN)

Description: top algorithm producing TrackCandidate and Electron objects from supercluster driven pixel seeded Ckf tracking for HLT

Definition at line 76 of file EgammaHLTPixelMatchElectronAlgo.h.

Constructor & Destructor Documentation

EgammaHLTPixelMatchElectronAlgo::EgammaHLTPixelMatchElectronAlgo ( const edm::ParameterSet conf)

Definition at line 52 of file EgammaHLTPixelMatchElectronAlgo.cc.

52  :
53  trackProducer_( conf.getParameter<edm::InputTag>("TrackProducer") ),
54  BSProducer_( conf.getParameter<edm::InputTag>("BSProducer") )
55 {}
T getParameter(std::string const &) const
EgammaHLTPixelMatchElectronAlgo::~EgammaHLTPixelMatchElectronAlgo ( )

Definition at line 57 of file EgammaHLTPixelMatchElectronAlgo.cc.

57  {
58 
59  // delete theInitialStateEstimator;
60  //delete theNavigationSchool;
61  //delete theTrajectoryCleaner;
62 
63 }

Member Function Documentation

void EgammaHLTPixelMatchElectronAlgo::process ( edm::Handle< reco::TrackCollection tracksH,
reco::ElectronCollection outEle,
Global3DPoint bs 
)
private

Definition at line 90 of file EgammaHLTPixelMatchElectronAlgo.cc.

References reco::TrackBase::charge(), i, TrajectoryStateTransform::innerFreeState(), PV3DBase< T, PVType, FrameType >::mag(), TrajectoryStateClosestToPoint::momentum(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), reco::Electron::setSuperCluster(), matplotRender::t, theMagField, testEve_cfg::tracks, reco::TrackBase::vertex(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by run().

90  {
91  const TrackCollection *tracks=tracksH.product();
92  for (unsigned int i=0;i<tracks->size();++i) {
93  const Track & t=(*tracks)[i];
94 
95  const TrackRef trackRef = edm::Ref<TrackCollection>(tracksH,i);
96  edm::RefToBase<TrajectorySeed> seed = trackRef->extra()->seedRef();
97  ElectronSeedRef elseed=seed.castTo<ElectronSeedRef>();
98 
99  edm::RefToBase<CaloCluster> caloCluster = elseed->caloCluster() ;
100  SuperClusterRef scRef = caloCluster.castTo<SuperClusterRef>() ;
101 
102  //const SuperClusterRef & scRef=elseed->superCluster();
103 
104  // Get the momentum at vertex (not at the innermost layer)
105  TSCPBuilderNoMaterial tscpBuilder;
106  TrajectoryStateTransform tsTransform;
107  FreeTrajectoryState fts = tsTransform.innerFreeState(t,theMagField.product());
108  TrajectoryStateClosestToPoint tscp = tscpBuilder(fts, bs );
109 
110  float scale = scRef->energy()/tscp.momentum().mag();
111 
112  const math::XYZTLorentzVector momentum(tscp.momentum().x()*scale,
113  tscp.momentum().y()*scale,
114  tscp.momentum().z()*scale,
115  scRef->energy());
116 
117 
118  Electron ele(t.charge(),momentum, t.vertex() );
119  ele.setSuperCluster(scRef);
120  edm::Ref<TrackCollection> myRef(tracksH,i);
121  ele.setTrack(myRef);
122  outEle.push_back(ele);
123 
124  } // loop over tracks
125 }
int i
Definition: DBlmapReader.cc:9
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
T y() const
Definition: PV3DBase.h:57
FreeTrajectoryState innerFreeState(const reco::Track &tk, const MagneticField *field) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
T mag() const
Definition: PV3DBase.h:61
T z() const
Definition: PV3DBase.h:58
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
Definition: TrackBase.h:156
tuple tracks
Definition: testEve_cfg.py:39
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:74
edm::ESHandle< MagneticField > theMagField
int charge() const
track electric charge
Definition: TrackBase.h:113
void setSuperCluster(const reco::SuperClusterRef &r)
set refrence to Photon component
Definition: Electron.h:33
T x() const
Definition: PV3DBase.h:56
void EgammaHLTPixelMatchElectronAlgo::run ( edm::Event e,
reco::ElectronCollection outEle 
)

Definition at line 71 of file EgammaHLTPixelMatchElectronAlgo.cc.

References BSProducer_, edm::Event::getByLabel(), process(), and trackProducer_.

Referenced by EgammaHLTPixelMatchElectronProducers::produce().

71  {
72 
73  // get the input
75  // e.getByLabel(trackLabel_,trackInstanceName_,tracksH);
76  e.getByLabel(trackProducer_,tracksH);
77 
78  //Get the Beam Spot position
79  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
80  // iEvent.getByType(recoBeamSpotHandle);
81  e.getByLabel(BSProducer_,recoBeamSpotHandle);
82  // gets its position
83  const BeamSpot::Point& BSPosition = recoBeamSpotHandle->position();
84  Global3DPoint bs(BSPosition.x(),BSPosition.y(),0);
85  process(tracksH,outEle,bs);
86 
87  return;
88 }
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:30
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
void process(edm::Handle< reco::TrackCollection > tracksH, reco::ElectronCollection &outEle, Global3DPoint &bs)
void EgammaHLTPixelMatchElectronAlgo::setupES ( const edm::EventSetup setup)

Member Data Documentation

edm::InputTag EgammaHLTPixelMatchElectronAlgo::BSProducer_
private

Definition at line 97 of file EgammaHLTPixelMatchElectronAlgo.h.

Referenced by run().

edm::ESHandle<GeometricSearchTracker> EgammaHLTPixelMatchElectronAlgo::theGeomSearchTracker
private

Definition at line 104 of file EgammaHLTPixelMatchElectronAlgo.h.

Referenced by setupES().

edm::ESHandle<MagneticField> EgammaHLTPixelMatchElectronAlgo::theMagField
private

Definition at line 103 of file EgammaHLTPixelMatchElectronAlgo.h.

Referenced by process(), and setupES().

edm::InputTag EgammaHLTPixelMatchElectronAlgo::trackProducer_
private

Definition at line 96 of file EgammaHLTPixelMatchElectronAlgo.h.

Referenced by run().