CMS 3D CMS Logo

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

#include <ConversionTrackEcalImpactPoint.h>

Public Member Functions

 ConversionTrackEcalImpactPoint (const MagneticField *field)
 
std::vector< math::XYZPointFfind (const std::vector< reco::TransientTrack > &tracks, const edm::Handle< edm::View< reco::CaloCluster > > &bcHandle)
 
std::vector< reco::CaloClusterPtrmatchingBC () const
 
void setMagneticField (const MagneticField *mf)
 
 ~ConversionTrackEcalImpactPoint ()
 

Static Private Member Functions

static const BoundCylinderbarrel ()
 
static const BoundDisknegativeEtaEndcap ()
 
static const BoundDiskpositiveEtaEndcap ()
 

Private Attributes

PropagationDirection dir_
 
PropagatorWithMaterialforwardPropagator_
 
std::vector< reco::CaloClusterPtrmatchingBC_
 
TrajectoryStateOnSurface stateAtECAL_
 
const MagneticFieldtheMF_
 

Static Private Attributes

static const
ReferenceCountingPointer
< BoundCylinder
theBarrel_ = initBarrel()
 
static const
ReferenceCountingPointer
< BoundDisk
theNegativeEtaEndcap_ = initNegative()
 
static const
ReferenceCountingPointer
< BoundDisk
thePositiveEtaEndcap_ = initPositive()
 

Detailed Description

Author
N. Marinelli - Univ. of Notre Dame
Version

Definition at line 39 of file ConversionTrackEcalImpactPoint.h.

Constructor & Destructor Documentation

ConversionTrackEcalImpactPoint::ConversionTrackEcalImpactPoint ( const MagneticField field)
ConversionTrackEcalImpactPoint::~ConversionTrackEcalImpactPoint ( )

Definition at line 62 of file ConversionTrackEcalImpactPoint.cc.

References forwardPropagator_.

62  {
63 
64  delete forwardPropagator_ ;
65 
66 }

Member Function Documentation

static const BoundCylinder& ConversionTrackEcalImpactPoint::barrel ( )
inlinestaticprivate

Definition at line 72 of file ConversionTrackEcalImpactPoint.h.

References theBarrel_.

Referenced by find().

72 { return *theBarrel_;}
static const ReferenceCountingPointer< BoundCylinder > theBarrel_
std::vector< math::XYZPointF > ConversionTrackEcalImpactPoint::find ( const std::vector< reco::TransientTrack > &  tracks,
const edm::Handle< edm::View< reco::CaloCluster > > &  bcHandle 
)

Definition at line 68 of file ConversionTrackEcalImpactPoint.cc.

References barrel(), dPhi(), PV3DBase< T, PVType, FrameType >::eta(), forwardPropagator_, TrajectoryStateOnSurface::globalPosition(), i, TrajectoryStateOnSurface::isValid(), matchingBC(), matchingBC_, negativeEtaEndcap(), positiveEtaEndcap(), query::result, mathSSE::sqrt(), and stateAtECAL_.

Referenced by ConvertedPhotonProducer::buildCollections().

68  {
69 
70 
71  std::vector<math::XYZPointF> result;
72  //
73  matchingBC_.clear();
74 
75  std::vector<reco::CaloClusterPtr> matchingBC(2);
76 
77 
78  //
79 
80 
81 
82  int iTrk=0;
83  for ( std::vector<reco::TransientTrack>::const_iterator iTk=tracks.begin(); iTk!=tracks.end(); ++iTk) {
84 
85  math::XYZPointF ecalImpactPosition(0.,0.,0.);
86  const TrajectoryStateOnSurface myTSOS=(*iTk).innermostMeasurementState();
87  if ( !( myTSOS.isValid() ) ) continue;
88 
89  stateAtECAL_= forwardPropagator_->propagate( myTSOS, barrel() );
90 
91 
92  if (!stateAtECAL_.isValid() || ( stateAtECAL_.isValid() && fabs(stateAtECAL_.globalPosition().eta() ) >1.479 ) ) {
93 
94 
95  if ( (*iTk).innermostMeasurementState().globalPosition().eta() > 0.) {
96  stateAtECAL_= forwardPropagator_->propagate( myTSOS, positiveEtaEndcap());
97 
98  } else {
99 
100  stateAtECAL_= forwardPropagator_->propagate( myTSOS, negativeEtaEndcap());
101 
102  }
103  }
104 
105 
106  if ( stateAtECAL_.isValid() ) ecalImpactPosition = stateAtECAL_.globalPosition();
107 
108 
109  result.push_back(ecalImpactPosition );
110 
111 
112  if ( stateAtECAL_.isValid() ) {
113  int goodBC=0;
114  float bcDistanceToTrack=9999;
115  reco::CaloClusterPtr matchedBCItr;
116  int ibc=0;
117  goodBC=0;
118 
119  for (unsigned i = 0; i < bcHandle->size(); ++i ) {
120  float dEta= bcHandle->ptrAt(i)->position().eta() - ecalImpactPosition.eta() ;
121  float dPhi= bcHandle->ptrAt(i)->position().phi() - ecalImpactPosition.phi() ;
122  if ( sqrt(dEta*dEta + dPhi*dPhi) < bcDistanceToTrack ) {
123  goodBC=ibc;
124  bcDistanceToTrack=sqrt(dEta*dEta + dPhi*dPhi);
125  }
126  ibc++;
127 
128  }
129 
130  matchingBC[iTrk]=bcHandle->ptrAt(goodBC);
131  }
132 
133 
134  iTrk++;
135  }
136 
138 
139  return result;
140 
141 }
int i
Definition: DBlmapReader.cc:9
GlobalPoint globalPosition() const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
static const BoundDisk & positiveEtaEndcap()
std::vector< reco::CaloClusterPtr > matchingBC_
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
static const BoundDisk & negativeEtaEndcap()
T sqrt(T t)
Definition: SSEVec.h:48
tuple result
Definition: query.py:137
static const BoundCylinder & barrel()
tuple tracks
Definition: testEve_cfg.py:39
T eta() const
Definition: PV3DBase.h:76
std::vector< reco::CaloClusterPtr > matchingBC() const
std::vector<reco::CaloClusterPtr> ConversionTrackEcalImpactPoint::matchingBC ( ) const
inline

Definition at line 51 of file ConversionTrackEcalImpactPoint.h.

References matchingBC_.

Referenced by ConvertedPhotonProducer::buildCollections(), and find().

51 {return matchingBC_;}
std::vector< reco::CaloClusterPtr > matchingBC_
static const BoundDisk& ConversionTrackEcalImpactPoint::negativeEtaEndcap ( )
inlinestaticprivate

Definition at line 73 of file ConversionTrackEcalImpactPoint.h.

References theNegativeEtaEndcap_.

Referenced by find().

73 { return *theNegativeEtaEndcap_;}
static const ReferenceCountingPointer< BoundDisk > theNegativeEtaEndcap_
static const BoundDisk& ConversionTrackEcalImpactPoint::positiveEtaEndcap ( )
inlinestaticprivate

Definition at line 74 of file ConversionTrackEcalImpactPoint.h.

References thePositiveEtaEndcap_.

Referenced by find().

74 { return *thePositiveEtaEndcap_;}
static const ReferenceCountingPointer< BoundDisk > thePositiveEtaEndcap_
void ConversionTrackEcalImpactPoint::setMagneticField ( const MagneticField mf)
inline

Definition at line 52 of file ConversionTrackEcalImpactPoint.h.

References theMF_.

52 { theMF_=mf;}

Member Data Documentation

PropagationDirection ConversionTrackEcalImpactPoint::dir_
private

Definition at line 65 of file ConversionTrackEcalImpactPoint.h.

Referenced by ConversionTrackEcalImpactPoint().

PropagatorWithMaterial* ConversionTrackEcalImpactPoint::forwardPropagator_
mutableprivate
std::vector<reco::CaloClusterPtr> ConversionTrackEcalImpactPoint::matchingBC_
private

Definition at line 66 of file ConversionTrackEcalImpactPoint.h.

Referenced by find(), and matchingBC().

TrajectoryStateOnSurface ConversionTrackEcalImpactPoint::stateAtECAL_
private

Definition at line 62 of file ConversionTrackEcalImpactPoint.h.

Referenced by find().

const ReferenceCountingPointer< BoundCylinder > ConversionTrackEcalImpactPoint::theBarrel_ = initBarrel()
staticprivate

Definition at line 68 of file ConversionTrackEcalImpactPoint.h.

Referenced by barrel().

const MagneticField* ConversionTrackEcalImpactPoint::theMF_
private
const ReferenceCountingPointer< BoundDisk > ConversionTrackEcalImpactPoint::theNegativeEtaEndcap_ = initNegative()
staticprivate

Definition at line 69 of file ConversionTrackEcalImpactPoint.h.

Referenced by negativeEtaEndcap().

const ReferenceCountingPointer< BoundDisk > ConversionTrackEcalImpactPoint::thePositiveEtaEndcap_ = initPositive()
staticprivate

Definition at line 70 of file ConversionTrackEcalImpactPoint.h.

Referenced by positiveEtaEndcap().