21 #include "CLHEP/Units/GlobalPhysicalConstants.h" 22 #include "CLHEP/Geometry/Point3D.h" 23 #include "CLHEP/Geometry/Vector3D.h" 24 #include "CLHEP/Geometry/Transform3D.h" 36 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder CTOR " 50 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder DTOR " 73 LogDebug(
"OutInConversionSeedFinder") <<
" OutInConversionSeedFinder::makeSeeds() All BC in the event " 75 for (
unsigned i = 0;
i < allBC->size(); ++
i) {
97 LogDebug(
"OutInConversionSeedFinder")
98 <<
" OutInConversionSeedFinder::makeSeeds() Passing the >=1.5 GeV cut BC eta " << theBcEta <<
" phi " 101 if (fabs(theBcEta - theSCEta) < 0.015 &&
reco::deltaPhi(theBcPhi, theSCPhi) < 0.3) {
102 LogDebug(
"OutInConversionSeedFinder")
103 <<
" OutInConversionSeedFinder::makeSeeds() in et and phi range passed to the analysis " 166 if (fabs(theBcEta - theSCEta) < 0.015 && fabs(theBcPhi - theSCPhi) < 0.25) {
176 if (stateNeg.second) {
182 if (statePos.second) {
189 std::pair<FreeTrajectoryState, bool>
result;
199 HepGeom::Point3D<double> radiusBc(gvBcRadius.x(), gvBcRadius.y(), gvBcRadius.z());
200 HepGeom::Point3D<double> momentumWithoutCurvature = radiusBc.unit() *
theBCEnergy_;
208 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder::makeTrackState gpOrigine " << gpOrigine.x()
209 <<
" " << gpOrigine.y() <<
" " << gpOrigine.z() <<
" momentumWithoutCurvature " 210 << momentumWithoutCurvature.mag() <<
" curvature " <<
curvature <<
"\n";
214 float r = gpOrigine.perp();
227 double sinAlpha = 0.5 * u /
R;
228 if (sinAlpha > (1. - 10 * DBL_EPSILON))
229 sinAlpha = 1. - 10 * DBL_EPSILON;
230 else if (sinAlpha < -(1. - 10 * DBL_EPSILON))
231 sinAlpha = -(1. - 10 * DBL_EPSILON);
233 double newdphi =
charge * asin(sinAlpha);
235 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder::makeTrackState charge " <<
charge <<
" R " <<
R 236 <<
" u/R " << u /
R <<
" asin(0.5*u/R) " << asin(sinAlpha) <<
"\n";
238 HepGeom::Transform3D
rotation = HepGeom::Rotate3D(newdphi, HepGeom::Vector3D<double>(0., 0., 1.));
240 HepGeom::Point3D<double> momentumInTracker = momentumWithoutCurvature.transform(
rotation);
241 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder::makeTrackState R " <<
R <<
" r " <<
r <<
" rho " 242 <<
rho <<
" d " <<
d <<
" u " << u <<
" newdphi " << newdphi
243 <<
" momentumInTracker " << momentumInTracker <<
"\n";
245 HepGeom::Point3D<double> hepStartingPoint(gpOrigine.x(), gpOrigine.y(), gpOrigine.z());
247 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder::makeTrackState hepStartingPoint " 248 << hepStartingPoint <<
"\n";
250 hepStartingPoint.transform(
rotation);
252 GlobalPoint startingPoint(hepStartingPoint.x(), hepStartingPoint.y(), hepStartingPoint.z());
254 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder::makeTrackState startingPoint " << startingPoint
256 GlobalVector gvTracker(momentumInTracker.x(), momentumInTracker.y(), momentumInTracker.z());
276 std::vector<const DetLayer*> myLayers =
layerList();
277 if (myLayers.size() > 3) {
278 for (
unsigned int ilayer = myLayers.size() - 1; ilayer >= myLayers.size() - 2; --ilayer) {
292 LogDebug(
"OutInConversionSeedFinder") <<
"OutInSeedFinder::startSeed after TSOS tsos(fts, layer->surface() ) " 307 LogDebug(
"OutInConversionSeedFinder") <<
"OutInSeedFinder::startSeed Layer " << ilayer
312 if (m1.
recHit()->isValid()) {
316 LogDebug(
"OutInConversionSeedFinder")
317 <<
" Valid hit at R " << m1.
recHit()->globalPosition().perp() <<
" Z " 318 << m1.
recHit()->globalPosition().z() <<
" eta " << m1.
recHit()->globalPosition().eta() <<
" phi " 319 << m1.
recHit()->globalPosition().phi() <<
" xyz " << m1.
recHit()->globalPosition() <<
"\n";
323 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder::startSeed newfts " << newfts <<
"\n";
324 LogDebug(
"OutInConversionSeedFinder")
325 <<
"OutInConversionSeedFinder::startSeed propagationDirection after switching " 331 if (ilayer == myLayers.size() - 1) {
348 LogDebug(
"OutInConversionSeedFinder")
349 <<
"OutInConversionSeedFinder::makeEstimator Barrel r = " << barrelLayer->
specificSurface().radius() <<
" " 358 LogDebug(
"OutInConversionSeedFinder")
359 <<
"OutInConversionSeedFinder::makeEstimator Endcap r = " << forwardLayer->
specificSurface().innerRadius()
394 float m1dr =
sqrt(m1.
recHit()->localPositionError().yy());
400 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder::completeSeed ilayer " << ilayer <<
"\n";
404 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder::completeSeed propagationDirection " 406 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder::completeSeed pointer to estimator " 407 << newEstimator <<
"\n";
410 std::vector<TrajectoryMeasurement> measurements =
415 for (
unsigned int i = 0;
i < measurements.size(); ++
i) {
416 if (measurements[
i].
recHit()->isValid()) {
431 LogDebug(
"OutInConversionSeedFinder") <<
"OutInConversionSeedFinder::createSeed First point errors " 432 << m1.
recHit()->parametersError() <<
"\n";
433 LogDebug(
"OutInConversionSeedFinder") <<
"original cluster FTS " << fts <<
"\n";
456 myHits.
push_back(meas1.recHit()->hit()->clone());
457 myHits.push_back(meas2.recHit()->hit()->clone());
465 LogDebug(
"OutInConversionSeedFinder")
466 <<
"OutInConversionSeedFinder::createSeed new seed from state " << state2.
globalPosition() <<
"\n";
467 LogDebug(
"OutInConversionSeedFinder")
468 <<
"OutInConversionSeedFinder::createSeed new seed ptsod " << ptsod.
parameters().
position() <<
" R " 490 int charge =
m2.predictedState().charge();
498 double RadCurv = 100 *
pt / (BInTesla * 0.29979);
499 double alpha = asin(0.5 * xdiff.
perp() / RadCurv);
502 double pxNew = ca * pxOld + sa * pyOld;
503 double pyNew = -sa * pxOld + ca * pyOld;
525 float phi =
p1.phi();
constexpr double deltaPhi(double phi1, double phi2)
const math::XYZPoint & position() const
cluster centroid position
const Propagator * thePropagatorAlongMomentum_
GlobalPoint theSCPosition_
T getParameter(std::string const &) const
const Point & position() const
position
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
virtual Location location() const =0
Which part of the detector (barrel, endcap)
MeasurementEstimator * makeEstimator(const DetLayer *, float dphi) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
Geom::Phi< T > phi() const
GlobalPoint fixPointRadius(const TrajectoryMeasurement &) const
Sin< T >::type sin(const T &t)
FreeTrajectoryState createSeedFTS(const TrajectoryMeasurement &m1, const TrajectoryMeasurement &m2) const
Global3DPoint GlobalPoint
virtual PropagationDirection propagationDirection() const final
std::vector< const DetLayer * > theLayerList_
int maxNumberOfOutInSeedsPerBC_
reco::BeamSpot theBeamSpot_
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
TrajectorySeedCollection theSeeds_
double ptFast(const double energy, const math::XYZPoint &position, const math::XYZPoint &origin)
void fillClusterSeeds(const reco::CaloClusterPtr &bc)
T curvature(T InversePt, const MagneticField &field)
const Propagator * thePropagatorOppositeToMomentum_
constexpr std::array< uint8_t, layerIndexSize > layer
void makeSeeds(const edm::Handle< edm::View< reco::CaloCluster > > &allBc) override
GlobalPoint globalPosition() const
TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const override
TrackCharge charge() const
Cos< T >::type cos(const T &t)
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
void createSeed(const TrajectoryMeasurement &m1, const TrajectoryMeasurement &m2)
Tan< T >::type tan(const T &t)
GlobalPoint theBCPosition_
const LocalTrajectoryParameters & parameters() const
~OutInConversionSeedFinder() override
double energy() const
cluster energy
edm::ESHandle< MagneticField > theMF_
const PositionType & position() const
XYZPointD XYZPoint
point in space with cartesian internal representation
void startSeed(const FreeTrajectoryState &)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
std::pair< FreeTrajectoryState, bool > makeTrackState(int charge) const
static int position[264][3]
std::vector< const DetLayer * > const & layerList() const
const MeasurementTracker * getMeasurementTracker() const
virtual const BoundDisk & specificSurface() const final
void completeSeed(const TrajectoryMeasurement &m1, const FreeTrajectoryState &fts, const Propagator *, int layer)
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
edm::Handle< MeasurementTrackerEvent > theTrackerData_
LocalPoint position() const
Local x and y position coordinates.
Geom::Theta< T > theta() const
std::vector< TrajectoryMeasurement > theFirstMeasurements_
FreeTrajectoryState trackStateFromClusters(int aCharge, const GlobalPoint &gpOrigine, PropagationDirection dir, float scaleFactor) const
const DetLayer * layer() const
ConstRecHitPointer const & recHit() const
Geom::Theta< T > theta() const
OutInConversionSeedFinder(const edm::ParameterSet &config, edm::ConsumesCollector &&iC)