CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
SeedForPhotonConversion1Leg Class Reference

#include <SeedForPhotonConversion1Leg.h>

Public Member Functions

 SeedForPhotonConversion1Leg (const edm::ParameterSet &cfg)
 
const TrajectorySeedtrajectorySeed (TrajectorySeedCollection &seedCollection, const SeedingHitSet &hits, const GlobalPoint &vertex, const GlobalVector &vertexBounds, float ptmin, const edm::EventSetup &es, float cotTheta, std::stringstream &ss)
 
 ~SeedForPhotonConversion1Leg ()
 

Static Public Attributes

static const int cotTheta_Max = 99999
 

Protected Member Functions

const TrajectorySeedbuildSeed (TrajectorySeedCollection &seedCollection, const SeedingHitSet &hits, const FreeTrajectoryState &fts, const edm::EventSetup &es) const
 
bool checkHit (const TrajectoryStateOnSurface &, const SeedingHitSet::ConstRecHitPointer &hit, const edm::EventSetup &es) const
 
CurvilinearTrajectoryError initialError (const GlobalVector &vertexBounds, float ptMin, float sinTheta) const
 
GlobalTrajectoryParameters initialKinematic (const SeedingHitSet &hits, const GlobalPoint &vertexPos, const edm::EventSetup &es, const float cotTheta) const
 
SeedingHitSet::RecHitPointer refitHit (SeedingHitSet::ConstRecHitPointer hit, const TrajectoryStateOnSurface &state, const TkClonerImpl &cloner) const
 

Protected Attributes

PrintRecoObjects po
 
std::stringstream * pss
 
double theBOFFMomentum
 
std::string thePropagatorLabel
 
std::string TTRHBuilder
 

Detailed Description

Definition at line 20 of file SeedForPhotonConversion1Leg.h.

Constructor & Destructor Documentation

◆ SeedForPhotonConversion1Leg()

SeedForPhotonConversion1Leg::SeedForPhotonConversion1Leg ( const edm::ParameterSet cfg)
inline

Definition at line 24 of file SeedForPhotonConversion1Leg.h.

25  : thePropagatorLabel(cfg.getParameter<std::string>("propagator")),
26  theBOFFMomentum(cfg.getParameter<double>("SeedMomentumForBOFF")),
27  TTRHBuilder(cfg.getParameter<std::string>("TTRHBuilder")) {}

◆ ~SeedForPhotonConversion1Leg()

SeedForPhotonConversion1Leg::~SeedForPhotonConversion1Leg ( )
inline

Definition at line 30 of file SeedForPhotonConversion1Leg.h.

30 {}

Member Function Documentation

◆ buildSeed()

const TrajectorySeed * SeedForPhotonConversion1Leg::buildSeed ( TrajectorySeedCollection seedCollection,
const SeedingHitSet hits,
const FreeTrajectoryState fts,
const edm::EventSetup es 
) const
protected

Definition at line 124 of file SeedForPhotonConversion1Leg.cc.

127  {
128  // FIXME all this stuff shoould go in an initialized...
129 
130  // get tracker
133 
134  // get propagator
135  edm::ESHandle<Propagator> propagatorHandle;
136  es.get<TrackingComponentsRecord>().get(thePropagatorLabel, propagatorHandle);
137  const Propagator* propagator = &(*propagatorHandle);
138 
140  es.get<TransientRecHitRecord>().get(TTRHBuilder, builderH);
141  auto builder = (TkTransientTrackingRecHitBuilder const*)(builderH.product());
142  auto cloner = (*builder).cloner();
143 
144  // get updator
146 
147  // Now update initial state track using information from seed hits.
148 
149  TrajectoryStateOnSurface updatedState;
151 
152  const TrackingRecHit* hit = nullptr;
153  for (unsigned int iHit = 0; iHit < hits.size() && iHit < 1; iHit++) {
154  hit = hits[iHit];
156  (iHit == 0) ? propagator->propagate(fts, tracker->idToDet(hit->geographicalId())->surface())
157  : propagator->propagate(updatedState, tracker->idToDet(hit->geographicalId())->surface());
158  if (!state.isValid())
159  return nullptr;
160 
162 
163  std::unique_ptr<BaseTrackerRecHit> newtth(refitHit(tth, state, cloner));
164 
165  if (!checkHit(state, &*newtth, es))
166  return nullptr;
167 
168  updatedState = updator.update(state, *newtth);
169  if (!updatedState.isValid())
170  return nullptr;
171 
172  seedHits.push_back(newtth.release());
173 #ifdef mydebug_seed
174  uint32_t detid = hit->geographicalId().rawId();
175  (*pss) << "\n[SeedForPhotonConversion1Leg] hit " << iHit;
176  po.print(*pss, detid);
177  (*pss) << " " << detid << "\t lp " << hit->localPosition() << " tth " << tth->localPosition() << " newtth "
178  << newtth->localPosition() << " state " << state.globalMomentum().perp();
179 #endif
180  }
181 
182  if (!hit)
183  return nullptr;
184 
185  PTrajectoryStateOnDet const& PTraj =
186  trajectoryStateTransform::persistentState(updatedState, hit->geographicalId().rawId());
187 
188  seedCollection.push_back(TrajectorySeed(PTraj, seedHits, alongMomentum));
189  return &seedCollection.back();
190 }

References alongMomentum, checkHit(), edm::EventSetup::get(), get, hfClusterShapes_cfi::hits, TrajectoryStateOnSurface::isValid(), trajectoryStateTransform::persistentState(), po, PrintRecoObjects::print(), edm::ESHandle< T >::product(), TrackCandidateProducer_cfi::propagator, edm::OwnVector< T, P >::push_back(), refitHit(), ElectronSeedTrackRefFix_cfi::seedCollection, thePropagatorLabel, PbPb_ZMuSkimMuonDPG_cff::tracker, TTRHBuilder, and HLT_FULL_cff::updator.

Referenced by trajectorySeed().

◆ checkHit()

bool SeedForPhotonConversion1Leg::checkHit ( const TrajectoryStateOnSurface ,
const SeedingHitSet::ConstRecHitPointer hit,
const edm::EventSetup es 
) const
inlineprotected

Definition at line 42 of file SeedForPhotonConversion1Leg.h.

44  {
45  return true;
46  }

Referenced by buildSeed().

◆ initialError()

CurvilinearTrajectoryError SeedForPhotonConversion1Leg::initialError ( const GlobalVector vertexBounds,
float  ptMin,
float  sinTheta 
) const
protected

Definition at line 101 of file SeedForPhotonConversion1Leg.cc.

103  {
104  // Set initial uncertainty on track parameters, using only P.V. constraint and no hit
105  // information.
106  GlobalError vertexErr(sqr(vertexBounds.x()), 0, sqr(vertexBounds.y()), 0, 0, sqr(vertexBounds.z()));
107 
108  AlgebraicSymMatrix55 C = ROOT::Math::SMatrixIdentity();
109 
110  // FIXME: minC00. Prevent apriori uncertainty in 1/P from being too small,
111  // to avoid instabilities.
112  // N.B. This parameter needs optimising ...
113  float sin2th = sqr(sinTheta);
114  float minC00 = 1.0;
115  C[0][0] = std::max(sin2th / sqr(ptMin), minC00);
116  float zErr = vertexErr.czz();
117  float transverseErr = vertexErr.cxx(); // assume equal cxx cyy
118  C[3][3] = transverseErr;
119  C[4][4] = zErr * sin2th + transverseErr * (1 - sin2th);
120 
122 }

References gen::C, GlobalErrorBase< T, ErrorWeightType >::cxx(), GlobalErrorBase< T, ErrorWeightType >::czz(), SiStripPI::max, ptMin, sqr(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by trajectorySeed().

◆ initialKinematic()

GlobalTrajectoryParameters SeedForPhotonConversion1Leg::initialKinematic ( const SeedingHitSet hits,
const GlobalPoint vertexPos,
const edm::EventSetup es,
const float  cotTheta 
) const
protected

Definition at line 48 of file SeedForPhotonConversion1Leg.cc.

51  {
53 
56 
57  // FIXME optimize: move outside loop
59  es.get<IdealMagneticFieldRecord>().get(bfield);
60  float nomField = bfield->nominalValue();
61 
62  FastHelix helix(tth2->globalPosition(), tth1->globalPosition(), vertexPos, nomField, &*bfield, vertexPos);
63  kine = helix.stateAtVertex();
64 
65  //force the pz/pt equal to the measured one
66  if (fabs(cotTheta) < cotTheta_Max)
68  kine.position(),
69  GlobalVector(kine.momentum().x(), kine.momentum().y(), kine.momentum().perp() * cotTheta),
70  kine.charge(),
71  &kine.magneticField());
72  else
74  kine.position(),
75  GlobalVector(kine.momentum().x(), kine.momentum().y(), kine.momentum().perp() * cotTheta_Max),
76  kine.charge(),
77  &kine.magneticField());
78 
79 #ifdef mydebug_seed
80  uint32_t detid;
81  (*pss) << "[SeedForPhotonConversion1Leg] initialKinematic tth1 ";
82  detid = tth1->geographicalId().rawId();
83  po.print(*pss, detid);
84  (*pss) << " \t " << detid << " " << tth1->localPosition() << " " << tth1->globalPosition();
85  detid = tth2->geographicalId().rawId();
86  (*pss) << " \n\t tth2 ";
87  po.print(*pss, detid);
88  (*pss) << " \t " << detid << " " << tth2->localPosition() << " " << tth2->globalPosition() << "\nhelix momentum "
89  << kine.momentum() << " pt " << kine.momentum().perp() << " radius " << 1 / kine.transverseCurvature();
90 #endif
91 
92  bool isBOFF = (0 == nomField);
93  ;
94  if (isBOFF && (theBOFFMomentum > 0)) {
95  kine =
96  GlobalTrajectoryParameters(kine.position(), kine.momentum().unit() * theBOFFMomentum, kine.charge(), &*bfield);
97  }
98  return kine;
99 }

References GlobalTrajectoryParameters::charge(), cotTheta_Max, edm::EventSetup::get(), get, hfClusterShapes_cfi::hits, GlobalTrajectoryParameters::magneticField(), GlobalTrajectoryParameters::momentum(), MagneticField::nominalValue(), PV3DBase< T, PVType, FrameType >::perp(), po, GlobalTrajectoryParameters::position(), PrintRecoObjects::print(), theBOFFMomentum, GlobalTrajectoryParameters::transverseCurvature(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by trajectorySeed().

◆ refitHit()

SeedingHitSet::RecHitPointer SeedForPhotonConversion1Leg::refitHit ( SeedingHitSet::ConstRecHitPointer  hit,
const TrajectoryStateOnSurface state,
const TkClonerImpl cloner 
) const
protected

Definition at line 192 of file SeedForPhotonConversion1Leg.cc.

194  {
195  //const TransientTrackingRecHit* a= hit.get();
196  //return const_cast<TransientTrackingRecHit*> (a);
197  //This was modified otherwise the rechit will have just the local x component and local y=0
198  // To understand how to modify for pixels
199 
200  //const TSiStripRecHit2DLocalPos* b = dynamic_cast<const TSiStripRecHit2DLocalPos*>(a);
201  //return const_cast<TSiStripRecHit2DLocalPos*>(b);
202  return (SeedingHitSet::RecHitPointer)(cloner(*hit, state));
203 }

Referenced by buildSeed().

◆ trajectorySeed()

const TrajectorySeed * SeedForPhotonConversion1Leg::trajectorySeed ( TrajectorySeedCollection seedCollection,
const SeedingHitSet hits,
const GlobalPoint vertex,
const GlobalVector vertexBounds,
float  ptmin,
const edm::EventSetup es,
float  cotTheta,
std::stringstream &  ss 
)

Member Data Documentation

◆ cotTheta_Max

const int SeedForPhotonConversion1Leg::cotTheta_Max = 99999
static

Definition at line 22 of file SeedForPhotonConversion1Leg.h.

Referenced by initialKinematic().

◆ po

PrintRecoObjects SeedForPhotonConversion1Leg::po
protected

Definition at line 70 of file SeedForPhotonConversion1Leg.h.

Referenced by buildSeed(), and initialKinematic().

◆ pss

std::stringstream* SeedForPhotonConversion1Leg::pss
protected

Definition at line 69 of file SeedForPhotonConversion1Leg.h.

◆ theBOFFMomentum

double SeedForPhotonConversion1Leg::theBOFFMomentum
protected

Definition at line 66 of file SeedForPhotonConversion1Leg.h.

Referenced by initialKinematic().

◆ thePropagatorLabel

std::string SeedForPhotonConversion1Leg::thePropagatorLabel
protected

Definition at line 65 of file SeedForPhotonConversion1Leg.h.

Referenced by buildSeed().

◆ TTRHBuilder

std::string SeedForPhotonConversion1Leg::TTRHBuilder
protected

Definition at line 67 of file SeedForPhotonConversion1Leg.h.

Referenced by buildSeed().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
SeedForPhotonConversion1Leg::thePropagatorLabel
std::string thePropagatorLabel
Definition: SeedForPhotonConversion1Leg.h:65
SeedForPhotonConversion1Leg::initialKinematic
GlobalTrajectoryParameters initialKinematic(const SeedingHitSet &hits, const GlobalPoint &vertexPos, const edm::EventSetup &es, const float cotTheta) const
Definition: SeedForPhotonConversion1Leg.cc:48
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
PrintRecoObjects::print
void print(std::stringstream &ss, const SiStripCluster &clus)
Definition: PrintRecoObjects.cc:5
GlobalTrajectoryParameters::position
GlobalPoint position() const
Definition: GlobalTrajectoryParameters.h:60
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
FastHelix
Definition: FastHelix.h:26
pss
std::pair< ALIstring, ALIstring > pss
Definition: Fit.h:25
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
SeedForPhotonConversion1Leg::refitHit
SeedingHitSet::RecHitPointer refitHit(SeedingHitSet::ConstRecHitPointer hit, const TrajectoryStateOnSurface &state, const TkClonerImpl &cloner) const
Definition: SeedForPhotonConversion1Leg.cc:192
SeedingHitSet::ConstRecHitPointer
BaseTrackerRecHit const * ConstRecHitPointer
Definition: SeedingHitSet.h:10
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
ptMin
constexpr float ptMin
Definition: PhotonIDValueMapProducer.cc:155
GlobalTrajectoryParameters::charge
TrackCharge charge() const
Definition: GlobalTrajectoryParameters.h:72
sqr
int sqr(const T &t)
Definition: pfalgo_common_ref.h:9
SeedForPhotonConversion1Leg::checkHit
bool checkHit(const TrajectoryStateOnSurface &, const SeedingHitSet::ConstRecHitPointer &hit, const edm::EventSetup &es) const
Definition: SeedForPhotonConversion1Leg.h:42
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
relativeConstraints.error
error
Definition: relativeConstraints.py:53
TkTransientTrackingRecHitBuilder
Definition: TkTransientTrackingRecHitBuilder.h:15
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
Propagator
Definition: Propagator.h:44
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
CurvilinearTrajectoryError
Definition: CurvilinearTrajectoryError.h:27
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
SeedForPhotonConversion1Leg::TTRHBuilder
std::string TTRHBuilder
Definition: SeedForPhotonConversion1Leg.h:67
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
ElectronSeedTrackRefFix_cfi.seedCollection
seedCollection
Definition: ElectronSeedTrackRefFix_cfi.py:9
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerGeometry >
MagneticField::nominalValue
int nominalValue() const
The nominal field value for this map in kGauss.
Definition: MagneticField.h:49
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
SeedForPhotonConversion1Leg::buildSeed
const TrajectorySeed * buildSeed(TrajectorySeedCollection &seedCollection, const SeedingHitSet &hits, const FreeTrajectoryState &fts, const edm::EventSetup &es) const
Definition: SeedForPhotonConversion1Leg.cc:124
GlobalTrajectoryParameters::momentum
GlobalVector momentum() const
Definition: GlobalTrajectoryParameters.h:65
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
HLT_FULL_cff.updator
updator
Definition: HLT_FULL_cff.py:123
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
GlobalTrajectoryParameters::transverseCurvature
float transverseCurvature() const
Definition: GlobalTrajectoryParameters.h:89
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
SeedForPhotonConversion1Leg::theBOFFMomentum
double theBOFFMomentum
Definition: SeedForPhotonConversion1Leg.h:66
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
GlobalErrorBase< double, ErrorMatrixTag >
get
#define get
looper.cfg
cfg
Definition: looper.py:297
SeedForPhotonConversion1Leg::po
PrintRecoObjects po
Definition: SeedForPhotonConversion1Leg.h:70
TrackingRecHit
Definition: TrackingRecHit.h:21
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
gen::C
C
Definition: PomwigHadronizer.cc:78
ptmin
double ptmin
Definition: HydjetWrapper.h:84
TrajectorySeed
Definition: TrajectorySeed.h:18
GlobalTrajectoryParameters::magneticField
const MagneticField & magneticField() const
Definition: GlobalTrajectoryParameters.h:106
SeedForPhotonConversion1Leg::initialError
CurvilinearTrajectoryError initialError(const GlobalVector &vertexBounds, float ptMin, float sinTheta) const
Definition: SeedForPhotonConversion1Leg.cc:101
edm::OwnVector::push_back
void push_back(D *&d)
Definition: OwnVector.h:326
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
SeedForPhotonConversion1Leg::cotTheta_Max
static const int cotTheta_Max
Definition: SeedForPhotonConversion1Leg.h:22
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
alongMomentum
Definition: PropagationDirection.h:4
KFUpdator
Definition: KFUpdator.h:32
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector< TrackingRecHit >
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12