CMS 3D CMS Logo

ConversionTrackEcalImpactPoint.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <vector>
3 #include <memory>
5 // Framework
6 //
7 
8 //
9 #include <vector>
10 #include <map>
11 
12 constexpr float epsilon = 0.001;
13 
15 constexpr float barrelRadius = 129.f; // p81, p50, ECAL TDR
16 constexpr float barrelHalfLength = 270.9f; // p81, p50, ECAL TDR
17 constexpr float endcapRadius = 171.1f; // fig 3.26, p81, ECAL TDR
18 constexpr float endcapZ = 320.5f; // fig 3.26, p81, ECAL TDR
19 
21  Surface::RotationType rot; // unit rotation matrix
22 
23  return new Cylinder(
25  Surface::PositionType(0, 0, 0),
26  rot,
28 }
29 
31  Surface::RotationType rot; // unit rotation matrix
32  return new BoundDisk(
34 }
35 
37  Surface::RotationType rot; // unit rotation matrix
38 
39  return new BoundDisk(
41 }
42 
46 
48  :
49 
50  theMF_(field) {
52 }
53 
55 
56 std::vector<math::XYZPointF> ConversionTrackEcalImpactPoint::find(
57  const std::vector<reco::TransientTrack>& tracks, const edm::Handle<edm::View<reco::CaloCluster> >& bcHandle) {
58  std::vector<math::XYZPointF> result;
59  //
60  matchingBC_.clear();
61 
62  std::vector<reco::CaloClusterPtr> matchingBC(2);
63 
64  //
65 
66  int iTrk = 0;
67  for (auto const& track : tracks) {
68  math::XYZPointF ecalImpactPosition(0., 0., 0.);
69  const TrajectoryStateOnSurface myTSOS = track.innermostMeasurementState();
70  if (!(myTSOS.isValid()))
71  continue;
72 
74 
75  if (!stateAtECAL_.isValid() || (stateAtECAL_.isValid() && fabs(stateAtECAL_.globalPosition().eta()) > 1.479)) {
76  if (track.innermostMeasurementState().globalPosition().eta() > 0.) {
78 
79  } else {
81  }
82  }
83 
84  if (stateAtECAL_.isValid())
85  ecalImpactPosition = stateAtECAL_.globalPosition();
86 
87  result.push_back(ecalImpactPosition);
88 
89  if (stateAtECAL_.isValid()) {
90  int goodBC = 0;
91  float bcDistanceToTrack = 9999;
92  reco::CaloClusterPtr matchedBCItr;
93  int ibc = 0;
94  goodBC = 0;
95 
96  for (auto const& bc : *bcHandle) {
97  float dEta = bc.position().eta() - ecalImpactPosition.eta();
98  float dPhi = bc.position().phi() - ecalImpactPosition.phi();
99  if (sqrt(dEta * dEta + dPhi * dPhi) < bcDistanceToTrack) {
100  goodBC = ibc;
101  bcDistanceToTrack = sqrt(dEta * dEta + dPhi * dPhi);
102  }
103  ibc++;
104  }
105 
106  matchingBC[iTrk] = bcHandle->ptrAt(goodBC);
107  }
108 
109  iTrk++;
110  }
111 
113 
114  return result;
115 }
TkRotation< float >
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
ConversionTrackEcalImpactPoint::find
std::vector< math::XYZPointF > find(const std::vector< reco::TransientTrack > &tracks, const edm::Handle< edm::View< reco::CaloCluster > > &bcHandle)
Definition: ConversionTrackEcalImpactPoint.cc:56
initBarrel
static BoundCylinder * initBarrel()
Definition: ConversionTrackEcalImpactPoint.cc:20
PropagatorWithMaterial::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
initNegative
static BoundDisk * initNegative()
Definition: ConversionTrackEcalImpactPoint.cc:30
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
ConversionTrackEcalImpactPoint::matchingBC_
std::vector< reco::CaloClusterPtr > matchingBC_
Definition: ConversionTrackEcalImpactPoint.h:56
ReferenceCountingPointer< BoundCylinder >
ConversionTrackEcalImpactPoint::theNegativeEtaEndcap_
static const ReferenceCountingPointer< BoundDisk > theNegativeEtaEndcap_
Definition: ConversionTrackEcalImpactPoint.h:59
edm::Handle
Definition: AssociativeIterator.h:50
BoundDisk
HLT_2018_cff.dEta
dEta
Definition: HLT_2018_cff.py:12289
barrelHalfLength
constexpr float barrelHalfLength
Definition: ConversionTrackEcalImpactPoint.cc:16
SimpleCylinderBounds
Definition: SimpleCylinderBounds.h:19
SimpleDiskBounds
Definition: SimpleDiskBounds.h:11
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
ConversionTrackEcalImpactPoint::positiveEtaEndcap
static const BoundDisk & positiveEtaEndcap()
Definition: ConversionTrackEcalImpactPoint.h:64
PropagatorWithMaterial
Definition: PropagatorWithMaterial.h:25
ConversionTrackEcalImpactPoint::ConversionTrackEcalImpactPoint
ConversionTrackEcalImpactPoint(const MagneticField *field)
Definition: ConversionTrackEcalImpactPoint.cc:47
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
Point3DBase< float, GlobalTag >
initPositive
static BoundDisk * initPositive()
Definition: ConversionTrackEcalImpactPoint.cc:36
ConversionTrackEcalImpactPoint::dir_
PropagationDirection dir_
Definition: ConversionTrackEcalImpactPoint.h:55
edm::View
Definition: CaloClusterFwd.h:14
endcapRadius
constexpr float endcapRadius
Definition: ConversionTrackEcalImpactPoint.cc:17
ConversionTrackEcalImpactPoint::thePositiveEtaEndcap_
static const ReferenceCountingPointer< BoundDisk > thePositiveEtaEndcap_
Definition: ConversionTrackEcalImpactPoint.h:60
ConversionTrackEcalImpactPoint::barrel
static const BoundCylinder & barrel()
Definition: ConversionTrackEcalImpactPoint.h:62
ConversionTrackEcalImpactPoint::stateAtECAL_
TrajectoryStateOnSurface stateAtECAL_
Definition: ConversionTrackEcalImpactPoint.h:52
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
ConversionTrackEcalImpactPoint::forwardPropagator_
PropagatorWithMaterial * forwardPropagator_
Definition: ConversionTrackEcalImpactPoint.h:54
ConversionTrackEcalImpactPoint.h
epsilon
constexpr float epsilon
Definition: ConversionTrackEcalImpactPoint.cc:12
edm::Ptr< CaloCluster >
endcapZ
constexpr float endcapZ
Definition: ConversionTrackEcalImpactPoint.cc:18
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
ConversionTrackEcalImpactPoint::theMF_
const MagneticField * theMF_
Definition: ConversionTrackEcalImpactPoint.h:50
ConversionTrackEcalImpactPoint::theBarrel_
static const ReferenceCountingPointer< BoundCylinder > theBarrel_
Definition: ConversionTrackEcalImpactPoint.h:58
BoundCylinder
ConversionTrackEcalImpactPoint::matchingBC
std::vector< reco::CaloClusterPtr > matchingBC() const
Definition: ConversionTrackEcalImpactPoint.h:46
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
Cylinder
Definition: Cylinder.h:19
ConversionTrackEcalImpactPoint::~ConversionTrackEcalImpactPoint
~ConversionTrackEcalImpactPoint()
Definition: ConversionTrackEcalImpactPoint.cc:54
mps_fire.result
result
Definition: mps_fire.py:303
barrelRadius
constexpr float barrelRadius
Definition: ConversionTrackEcalImpactPoint.cc:15
math::XYZPointF
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
MagneticField
Definition: MagneticField.h:19
ConversionTrackEcalImpactPoint::negativeEtaEndcap
static const BoundDisk & negativeEtaEndcap()
Definition: ConversionTrackEcalImpactPoint.h:63
BoundDisk
Disk BoundDisk
Definition: BoundDisk.h:54
alongMomentum
Definition: PropagationDirection.h:4
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54