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 float barrelHalfLength ()
 
static float barrelRadius ()
 
static void check ()
 
static float endcapRadius ()
 
static float endcapZ ()
 
static void initialize ()
 
static const BoundDisknegativeEtaEndcap ()
 
static const BoundDiskpositiveEtaEndcap ()
 

Private Attributes

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

Static Private Attributes

static
ReferenceCountingPointer
< BoundCylinder
theBarrel_ = 0
 
static bool theInit_ = false
 
static
ReferenceCountingPointer
< BoundDisk
theNegativeEtaEndcap_ = 0
 
static
ReferenceCountingPointer
< BoundDisk
thePositiveEtaEndcap_ = 0
 

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 28 of file ConversionTrackEcalImpactPoint.cc.

References forwardPropagator_.

28  {
29 
30  delete forwardPropagator_ ;
31 
32 }

Member Function Documentation

static const BoundCylinder& ConversionTrackEcalImpactPoint::barrel ( )
inlinestaticprivate

Definition at line 86 of file ConversionTrackEcalImpactPoint.h.

References check(), and theBarrel_.

Referenced by find().

86 { check(); return *theBarrel_;}
static ReferenceCountingPointer< BoundCylinder > theBarrel_
static float ConversionTrackEcalImpactPoint::barrelHalfLength ( )
inlinestaticprivate

Definition at line 72 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize().

72 {return 270.9f;} //p81, p50, ECAL TDR
static float ConversionTrackEcalImpactPoint::barrelRadius ( )
inlinestaticprivate

Hard-wired numbers defining the surfaces on which the crystal front faces lie.

Definition at line 71 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize().

71 {return 129.f;} //p81, p50, ECAL TDR
static void ConversionTrackEcalImpactPoint::check ( void  )
inlinestaticprivate
static float ConversionTrackEcalImpactPoint::endcapRadius ( )
inlinestaticprivate

Definition at line 73 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize().

73 {return 171.1f;} // fig 3.26, p81, ECAL TDR
static float ConversionTrackEcalImpactPoint::endcapZ ( )
inlinestaticprivate

Definition at line 74 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize().

74 {return 320.5f;} // fig 3.26, p81, ECAL TDR
std::vector< math::XYZPointF > ConversionTrackEcalImpactPoint::find ( const std::vector< reco::TransientTrack > &  tracks,
const edm::Handle< edm::View< reco::CaloCluster > > &  bcHandle 
)

Definition at line 34 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 BeautifulSoup.Tag::_invert(), ConvertedPhotonProducer::buildCollections(), and BeautifulSoup.PageElement::insert().

34  {
35 
36 
37  std::vector<math::XYZPointF> result;
38  //
39  matchingBC_.clear();
40 
41  std::vector<reco::CaloClusterPtr> matchingBC(2);
42 
43 
44  //
45 
46 
47 
48  int iTrk=0;
49  for ( std::vector<reco::TransientTrack>::const_iterator iTk=tracks.begin(); iTk!=tracks.end(); ++iTk) {
50 
51  math::XYZPointF ecalImpactPosition(0.,0.,0.);
52  const TrajectoryStateOnSurface myTSOS=(*iTk).innermostMeasurementState();
53  if ( !( myTSOS.isValid() ) ) continue;
54 
55  stateAtECAL_= forwardPropagator_->propagate( myTSOS, barrel() );
56 
57 
58  if (!stateAtECAL_.isValid() || ( stateAtECAL_.isValid() && fabs(stateAtECAL_.globalPosition().eta() ) >1.479 ) ) {
59 
60 
61  if ( (*iTk).innermostMeasurementState().globalPosition().eta() > 0.) {
62  stateAtECAL_= forwardPropagator_->propagate( myTSOS, positiveEtaEndcap());
63 
64  } else {
65 
66  stateAtECAL_= forwardPropagator_->propagate( myTSOS, negativeEtaEndcap());
67 
68  }
69  }
70 
71 
72  if ( stateAtECAL_.isValid() ) ecalImpactPosition = stateAtECAL_.globalPosition();
73 
74 
75  result.push_back(ecalImpactPosition );
76 
77 
78  if ( stateAtECAL_.isValid() ) {
79  int goodBC=0;
80  float bcDistanceToTrack=9999;
81  reco::CaloClusterPtr matchedBCItr;
82  int ibc=0;
83  goodBC=0;
84 
85  for (unsigned i = 0; i < bcHandle->size(); ++i ) {
86  float dEta= bcHandle->ptrAt(i)->position().eta() - ecalImpactPosition.eta() ;
87  float dPhi= bcHandle->ptrAt(i)->position().phi() - ecalImpactPosition.phi() ;
88  if ( sqrt(dEta*dEta + dPhi*dPhi) < bcDistanceToTrack ) {
89  goodBC=ibc;
90  bcDistanceToTrack=sqrt(dEta*dEta + dPhi*dPhi);
91  }
92  ibc++;
93 
94  }
95 
96  matchingBC[iTrk]=bcHandle->ptrAt(goodBC);
97  }
98 
99 
100  iTrk++;
101  }
102 
104 
105  return result;
106 
107 }
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:11
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
void ConversionTrackEcalImpactPoint::initialize ( )
staticprivate

Definition at line 112 of file ConversionTrackEcalImpactPoint.cc.

References barrelHalfLength(), barrelRadius(), endcapRadius(), endcapZ(), epsilon, makeMuonMisalignmentScenario::rot, theBarrel_, theInit_, theNegativeEtaEndcap_, and thePositiveEtaEndcap_.

Referenced by check().

112  {
113 
114  const float epsilon = 0.001;
115  Surface::RotationType rot; // unit rotation matrix
116 
117 
119  new SimpleCylinderBounds( barrelRadius()-epsilon,
120  barrelRadius()+epsilon,
121  -barrelHalfLength(),
122  barrelHalfLength()));
124  new BoundDisk( Surface::PositionType( 0, 0, -endcapZ()), rot,
125  new SimpleDiskBounds( 0, endcapRadius(), -epsilon, epsilon));
126 
128  new BoundDisk( Surface::PositionType( 0, 0, endcapZ()), rot,
129  new SimpleDiskBounds( 0, endcapRadius(), -epsilon, epsilon));
130 
131  theInit_ = true;
132 
133 
134 }
static ReferenceCountingPointer< BoundCylinder > theBarrel_
Disk BoundDisk
Definition: BoundDisk.h:64
static ReferenceCountingPointer< BoundDisk > thePositiveEtaEndcap_
static ReferenceCountingPointer< BoundDisk > theNegativeEtaEndcap_
const double epsilon
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 87 of file ConversionTrackEcalImpactPoint.h.

References check(), and theNegativeEtaEndcap_.

Referenced by find().

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

Definition at line 88 of file ConversionTrackEcalImpactPoint.h.

References check(), and thePositiveEtaEndcap_.

Referenced by find().

88 { check(); return *thePositiveEtaEndcap_;}
static 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().

ReferenceCountingPointer< BoundCylinder > ConversionTrackEcalImpactPoint::theBarrel_ = 0
staticprivate

Definition at line 82 of file ConversionTrackEcalImpactPoint.h.

Referenced by barrel(), and initialize().

bool ConversionTrackEcalImpactPoint::theInit_ = false
staticprivate

Definition at line 89 of file ConversionTrackEcalImpactPoint.h.

Referenced by check(), and initialize().

const MagneticField* ConversionTrackEcalImpactPoint::theMF_
private
ReferenceCountingPointer< BoundDisk > ConversionTrackEcalImpactPoint::theNegativeEtaEndcap_ = 0
staticprivate

Definition at line 83 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize(), and negativeEtaEndcap().

ReferenceCountingPointer< BoundDisk > ConversionTrackEcalImpactPoint::thePositiveEtaEndcap_ = 0
staticprivate

Definition at line 84 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize(), and positiveEtaEndcap().