|
|
Go to the documentation of this file.
13 inline double sqr(
double a) {
return a *
a; }
23 theClusterCheck(conf.getParameter<
edm::
ParameterSet>(
"ClusterCheckPSet"), iC),
24 theSilentOnClusterCheck(conf.getParameter<
edm::
ParameterSet>(
"ClusterCheckPSet")
25 .getUntrackedParameter<
bool>(
"silentClusterCheck",
false)),
26 _vtxMinDoF(conf.getParameter<double>(
"vtxMinDoF")),
27 _maxDZSigmas(conf.getParameter<double>(
"maxDZSigmas")),
28 _maxNumSelVtx(conf.getParameter<uint32_t>(
"maxNumSelVtx")),
29 _applyTkVtxConstraint(conf.getParameter<
bool>(
"applyTkVtxConstraint")),
31 _primaryVtxInputTag(conf.getParameter<
edm::
InputTag>(
"primaryVerticesTag")),
32 _beamSpotInputTag(conf.getParameter<
edm::
InputTag>(
"beamSpotInputTag")) {
53 edm::LogError(
"TooManyClusters") <<
"Found too many clusters (" << clustsOrZero <<
"), bailing out.\n";
71 <<
"Error! Can't get the product primary Vertex Collection " <<
_primaryVtxInputTag <<
"\n";
86 ss <<
"\n++++++++++++++++++\n";
107 <<
" could not find track collecion in PhotonConversionTrajectorySeedProducerFromSingleLegAlgo";
122 std::vector<reco::Vertex> selectedPriVtxCompatibleWithTrack;
124 selectedPriVtxCompatibleWithTrack.push_back(*(
vertexHandle->begin()));
135 edm::LogInfo(
"debugTrajSeedFromSingleLeg") <<
"Inspected " <<
sel <<
" tracks over " <<
idx
141 const reco::Track& tk, std::vector<reco::Vertex>& selectedPriVtxCompatibleWithTrack) {
142 std::vector<std::pair<double, short> >
idx;
145 double cosPhi = tk.
px() / tk.
pt();
146 double sinPhi = tk.
py() / tk.
pt();
155 double _dz = tk.
dz(
vtx.position());
156 double _dzError = tk.
dzError();
158 double cotTheta = tk.
pz() / tk.
pt();
159 double dx =
vtx.position().x();
160 double dy =
vtx.position().y();
161 double sx2 =
vtx.covariance(0, 0);
162 double sy2 =
vtx.covariance(1, 1);
164 double sxy2 =
sqr(cosPhi * cotTheta) * sx2 +
sqr(sinPhi * cotTheta) * sy2 +
165 sqr(cotTheta * (-
dx * sinPhi +
dy * cosPhi)) * sphi2 +
166 sqr((1 + cotTheta * cotTheta) * (
dx * cosPhi +
dy * sinPhi)) * stheta2;
169 _dzError * _dzError +
vtx.covariance(2, 2) +
173 ss <<
" primary vtx " <<
vtx.position() <<
" \tk vz " << tk.
vz() <<
" vx " << tk.
vx() <<
" vy " << tk.
vy()
174 <<
" pz/pt " << tk.
pz() / tk.
pt() <<
" \t dz " << _dz <<
" \t " << _dzError <<
" sxy2 " << sxy2
175 <<
" \t dz/dzErr " << _dz / _dzError << std::endl;
181 idx.push_back(std::pair<double, short>(fabs(_dz),
count));
185 ss <<
"no vertex selected " << std::endl;
191 idx.begin(),
idx.end(), [](std::pair<double, short>
a, std::pair<double, short>
b) {
return a.first <
b.first; });
196 ss <<
"selected vtx dz " <<
idx[0].first <<
" position" <<
idx[0].second << std::endl;
204 const reco::Track& tk,
const std::vector<reco::Vertex>& selectedPriVtxCompatibleWithTrack) {
205 bool foundAtLeastASeedCand =
false;
206 for (
auto const&
vtx : selectedPriVtxCompatibleWithTrack) {
213 ss <<
"[PrintRegion] " <<
region.print() << std::endl;
221 foundAtLeastASeedCand =
true;
306 float originRBound = 3;
307 float originZBound = 3.;
323 GlobalVector originBounds(originRBound, originRBound, originZBound);
325 GlobalPoint pvtxPoint(primaryVertexPoint.x(), primaryVertexPoint.y(), primaryVertexPoint.z());
330 ss <<
"\nConversion Point " << originPos <<
" " << originPos.
perp() <<
"\n";
335 unsigned int nHitss = hitss.
size();
341 ss <<
"\n nHitss " << nHitss <<
"\n";
348 for (
unsigned int iHits = 0; iHits < nHitss; ++iHits) {
350 ss <<
"\n iHits " << iHits <<
"\n";
T const * product() const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
edm::Handle< reco::TrackCollection > trackCollectionH
std::vector< TrajectorySeed > TrajectorySeedCollection
bool selectPriVtxCompatibleWithTrack(const reco::Track &tk, std::vector< reco::Vertex > &selectedPriVtxCompatibleWithTrack)
void print(std::stringstream &ss, const SiStripCluster &clus)
constexpr bool isNotFinite(T x)
IdealHelixParameters _IdealHelixParameters
edm::EDGetTokenT< reco::BeamSpot > token_bs
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::Handle< reco::VertexCollection > vertexHandle
void find(const edm::Event &event, const edm::EventSetup &setup, TrajectorySeedCollection &output)
double vx() const
x coordinate of the reference point on track
void setData(const reco::Track *track, const math::XYZVector &refPoint=math::XYZVector(0, 0, 0))
U second(std::pair< T, U > const &p)
PhotonConversionTrajectorySeedProducerFromSingleLegAlgo(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
std::unique_ptr< GlobalTrackingRegionProducerFromBeamSpot > theRegionProducer
double px() const
x coordinate of momentum vector
Log< level::Info, false > LogInfo
edm::InputTag _beamSpotInputTag
double pt() const
track transverse momentum
double py() const
y coordinate of momentum vector
double vz() const
z coordinate of the reference point on track
void setMagnField(const MagneticField *magnField)
std::unique_ptr< CombinedHitPairGeneratorForPhotonConversion > theHitsGenerator
const edm::EventSetup * myEsetup
edm::EDGetTokenT< reco::VertexCollection > token_vertex
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Global3DPoint GlobalPoint
CovarianceMatrix covariance() const
return track covariance matrix
const Point & position() const
position
math::XYZVector GetTangentPoint() const
math::XYZVector GetMomentumAtTangentPoint() const
TrajectorySeedCollection * seedCollection
edm::EDGetTokenT< reco::TrackCollection > token_refitter
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::Handle< reco::BeamSpot > recoBeamSpotHandle
~PhotonConversionTrajectorySeedProducerFromSingleLegAlgo()
virtual unsigned int size() const =0
XYZVectorD XYZVector
spatial vector with cartesian internal representation
double dzError() const
error on dz
void loopOnPriVtx(const reco::Track &tk, const std::vector< reco::Vertex > &selectedPriVtxCompatibleWithTrack)
bool _applyTkVtxConstraint
Log< level::Error, false > LogError
bool theSilentOnClusterCheck
edm::InputTag _primaryVtxInputTag
Regions::const_iterator IR
std::unique_ptr< SeedForPhotonConversion1Leg > theSeedCreator
double vy() const
y coordinate of the reference point on track
bool rejectTrack(const reco::Track &track)
bool inspectTrack(const reco::Track *track, const TrackingRegion ®ion, math::XYZPoint &primaryVertexPoint)
T getParameter(std::string const &) const
double pz() const
z coordinate of momentum vector
ClusterChecker theClusterCheck
Abs< T >::type abs(const T &t)
const edm::Event * myEvent
size_t tooManyClusters(const edm::Event &e) const
const MagneticField * magField
std::vector< Track > TrackCollection
collection of Tracks