12 inline double sqr(
double a) {
return a *
a; }
22 theClusterCheck(conf.getParameter<
edm::
ParameterSet>(
"ClusterCheckPSet"), iC),
23 theSilentOnClusterCheck(conf.getParameter<
edm::
ParameterSet>(
"ClusterCheckPSet")
24 .getUntrackedParameter<
bool>(
"silentClusterCheck",
false)),
25 _vtxMinDoF(conf.getParameter<double>(
"vtxMinDoF")),
26 _maxDZSigmas(conf.getParameter<double>(
"maxDZSigmas")),
27 _maxNumSelVtx(conf.getParameter<uint32_t>(
"maxNumSelVtx")),
28 _applyTkVtxConstraint(conf.getParameter<
bool>(
"applyTkVtxConstraint")),
30 _primaryVtxInputTag(conf.getParameter<
edm::
InputTag>(
"primaryVerticesTag")),
31 _beamSpotInputTag(conf.getParameter<
edm::
InputTag>(
"beamSpotInputTag")) {
53 edm::LogError(
"TooManyClusters") <<
"Found too many clusters (" << clustsOrZero <<
"), bailing out.\n";
69 <<
"Error! Can't get the product primary Vertex Collection " <<
_primaryVtxInputTag <<
"\n";
84 ss <<
"\n++++++++++++++++++\n";
105 <<
" could not find track collecion in PhotonConversionTrajectorySeedProducerFromSingleLegAlgo";
121 std::vector<reco::Vertex> selectedPriVtxCompatibleWithTrack;
123 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;
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);
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";
edm::EDGetTokenT< reco::BeamSpot > token_bs
void setData(const reco::Track *track, const math::XYZVector &refPoint=math::XYZVector(0, 0, 0))
T getParameter(std::string const &) const
PhotonConversionTrajectorySeedProducerFromSingleLegAlgo(const edm::ParameterSet &, edm::ConsumesCollector &&iC)
size_t tooManyClusters(const edm::Event &e) const
IdealHelixParameters _IdealHelixParameters
std::unique_ptr< SeedForPhotonConversion1Leg > theSeedCreator
const Point & position() const
position
void setMagnField(const MagneticField *magnField)
double vx() const
x coordinate of the reference point on track
void find(const edm::Event &event, const edm::EventSetup &setup, TrajectorySeedCollection &output)
constexpr bool isNotFinite(T x)
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
double px() const
x coordinate of momentum vector
ClusterChecker theClusterCheck
Global3DPoint GlobalPoint
edm::InputTag _primaryVtxInputTag
std::vector< Track > TrackCollection
collection of Tracks
math::XYZVector GetTangentPoint() const
double py() const
y coordinate of momentum vector
std::vector< Vertex > VertexCollection
collection of Vertex objects
virtual unsigned int size() const =0
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrajectorySeedCollection * seedCollection
Log< level::Error, false > LogError
U second(std::pair< T, U > const &p)
double pt() const
track transverse momentum
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...
CovarianceMatrix covariance() const
return track covariance matrix
const edm::EventSetup * myEsetup
edm::EDGetTokenT< reco::TrackCollection > token_refitter
double vz() const
z coordinate of the reference point on track
std::vector< TrajectorySeed > TrajectorySeedCollection
double dzError() const
error on dz
const MagneticField * magField
edm::InputTag _beamSpotInputTag
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< reco::VertexCollection > token_vertex
void print(std::stringstream &ss, const SiStripCluster &clus)
bool inspectTrack(const reco::Track *track, const TrackingRegion ®ion, math::XYZPoint &primaryVertexPoint)
~PhotonConversionTrajectorySeedProducerFromSingleLegAlgo()
math::XYZVector GetMomentumAtTangentPoint() const
std::unique_ptr< GlobalTrackingRegionProducerFromBeamSpot > theRegionProducer
bool _applyTkVtxConstraint
Log< level::Info, false > LogInfo
void loopOnPriVtx(const reco::Track &tk, const std::vector< reco::Vertex > &selectedPriVtxCompatibleWithTrack)
const edm::Event * myEvent
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
double pz() const
z coordinate of momentum vector
bool rejectTrack(const reco::Track &track)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > token_magField
edm::Handle< reco::VertexCollection > vertexHandle
std::unique_ptr< CombinedHitPairGeneratorForPhotonConversion > theHitsGenerator
Square< F >::type sqr(const F &f)
double vy() const
y coordinate of the reference point on track
bool theSilentOnClusterCheck
Regions::const_iterator IR
edm::Handle< reco::BeamSpot > recoBeamSpotHandle
edm::Handle< reco::TrackCollection > trackCollectionH
bool selectPriVtxCompatibleWithTrack(const reco::Track &tk, std::vector< reco::Vertex > &selectedPriVtxCompatibleWithTrack)