43 vector<TransientTrack> unusedTrackswithIPSig;
44 for( vector<TransientTrack>::const_iterator itT = unusedTracks.begin() ;
45 itT != unusedTracks.end() ; itT++ ) {
53 if (
debug)
cout <<
"[AddTvTrack] tip val,err"<<val<<
","<<error<<endl;
59 if(
abs(val/err)>
theIPSig ) unusedTrackswithIPSig.push_back(*itT);
62 if (
debug)
cout<<
"[AddTvTrack] tracks surviving IPSig cut: "
63 <<unusedTrackswithIPSig.size()<<endl;
70 double px = (*theSecondaryVertices)[0].position().x()
71 - (*thePrimaryVertices)[0].position().x();
72 double py = (*theSecondaryVertices)[0].position().y()
73 - (*thePrimaryVertices)[0].position().y();
74 double pz = (*theSecondaryVertices)[0].position().z()
75 - (*thePrimaryVertices)[0].position().z();
77 Line bFlightLine( PVposition , bVector);
86 vector<TransientTrack> TracksToAdd;
89 for( vector<TransientTrack>::const_iterator itT =
90 unusedTrackswithIPSig.begin() ; itT != unusedTrackswithIPSig.end() ;
114 if (cptl.isValid()) {
120 -cptl.globalPosition();
122 -cptl.globalPosition();
128 MyTransientTrackTrajectory=cptl2;
131 MyTransientTrackTrajectory=cptl;
135 GlobalPoint GlobalPoint2 = MyTransientTrackTrajectory.globalPosition();
139 GlobalVector VecDistTrackbFlightLine=bFlightLine.distance(GlobalPoint2);
140 double X = GlobalPoint2.
x() + VecDistTrackbFlightLine.
x();
141 double Y = GlobalPoint2.
y() + VecDistTrackbFlightLine.
y();
142 double Z = GlobalPoint2.
z() + VecDistTrackbFlightLine.
z();
146 pair<GlobalPoint,GlobalPoint> TheTwoPoints(GlobalPoint1, GlobalPoint2);
152 MyLineCovMatrix.GetMatrix( TheTwoPoints.first );
155 vector<TransientTrack> emptyVectorTracks;
157 VertexState theState1 (TheTwoPoints.first , ErrOnBFlightTraj );
160 MyTransientTrackTrajectory.cartesianError().position() );
169 bool HemisphereOk =
false;
177 < TheTwoPoints.first.x() ) HemisphereOk =
true;
179 > (*theSecondaryVertices)[0].position().x() &&
180 (*thePrimaryVertices)[0].position().x()
181 > TheTwoPoints.first.x() ) HemisphereOk =
true;
185 < (*theSecondaryVertices)[0].position().y() &&
186 (*thePrimaryVertices)[0].position().y()
187 < TheTwoPoints.first.y() ) HemisphereOk =
true;
189 > (*theSecondaryVertices)[0].position().y() &&
190 (*thePrimaryVertices)[0].position().y()
191 > TheTwoPoints.first.y() ) HemisphereOk =
true;
194 double HemisOK = 0.0;
195 if( HemisphereOk ) HemisOK = 1.0;
203 double Dist_X=TheTwoPoints.second.x()
204 -(*thePrimaryVertices)[0].position().x();
205 double Dist_Y=TheTwoPoints.second.y()
206 -(*thePrimaryVertices)[0].position().y();
207 double Dist_Z=TheTwoPoints.second.z()
208 -(*thePrimaryVertices)[0].position().z();
209 double Dist_to_PV =
sqrt(Dist_X*Dist_X + Dist_Y*Dist_Y + Dist_Z*Dist_Z);
216 Dist_X = TheTwoPoints.second.x();
217 Dist_Y = TheTwoPoints.second.y();
218 double Dist_to_Beam =
sqrt(Dist_X*Dist_X + Dist_Y*Dist_Y);
219 if( Dist_to_Beam < 0.01 || Dist_to_Beam > 2.5 ) HemisphereOk =
false;
235 double IPSig = IP/err;
239 InfArray[1] = Dist_to_Beam;
240 InfArray[2] = Dist_to_PV;
241 InfArray[3] = HemisOK;
244 if (Sig > 10.0) Sig = 10.0 ;
245 if ( HemisphereOk ) InfArray[6]=Sig;
246 else InfArray[6]=-Sig;
272 if (
debug)
cout <<
"[AddTvTrack] tracks to add: "<<TracksToAdd.size()<<endl;
274 if( ! TracksToAdd.empty() ) {
278 vector<TransientTrack> VertexTracks =
279 NewSecondaryVertices[0].originalTracks();
282 NewSecondaryVertices[0].positionError() );
288 if( NewSecondaryVertices[0].hasTrackWeight() ) {
289 TrackWeightMap = NewSecondaryVertices[0].weightMap() ;
291 TransientTrackToFloatMap::iterator itMapEnd = TrackWeightMap.end();
292 for(vector<TransientTrack>::const_iterator itT = TracksToAdd.begin();
293 itT != TracksToAdd.end(); itT++) {
296 pair< TransientTrack , float > TrackMapPair( (*itT) , 0.0);
297 itMapEnd = TrackWeightMap.insert( itMapEnd, TrackMapPair );
303 TransientTrackToFloatMap::iterator itMapEnd = TrackWeightMap.end();
304 for(vector<TransientTrack>::const_iterator itT = VertexTracks.begin();
305 itT != VertexTracks.end(); itT++) {
308 pair< TransientTrack , float > TrackMapPair( (*itT) , 1.0);
309 itMapEnd = TrackWeightMap.insert( itMapEnd, TrackMapPair );
311 for(vector<TransientTrack>::const_iterator itT = TracksToAdd.begin();
312 itT != TracksToAdd.end(); itT++) {
315 pair< TransientTrack , float > TrackMapPair( (*itT) , 0.0);
316 itMapEnd = TrackWeightMap.insert( itMapEnd, TrackMapPair );
320 for(vector<TransientTrack>::const_iterator itT = TracksToAdd.begin();
321 itT!=TracksToAdd.end(); itT++)
322 VertexTracks.push_back(*itT);
329 NewSecondaryVertices[0].totalChiSquared(),
330 NewSecondaryVertices[0].degreesOfFreedom());
331 NewVertex.weightMap(TrackWeightMap);
335 NewSecondaryVertices[0] = NewVertex;
336 return NewSecondaryVertices;
const double Z[kNumberCalorimeter]
virtual Measurement1D distance(const GlobalPoint &vtx1Position, const GlobalError &vtx1PositionError, const GlobalPoint &vtx2Position, const GlobalError &vtx2PositionError) const
const PerigeeTrajectoryError & perigeeError() const
const GlobalTrajectoryParameters & parameters() const
std::map< reco::TransientTrack, float > TransientTrackToFloatMap
GlobalPoint globalPosition() const
const MagneticField * field() const
TrajectoryStateOnSurface innermostMeasurementState() const
const PerigeeTrajectoryParameters & perigeeParameters() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
double transverseImpactParameter() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
Abs< T >::type abs(const T &t)
TrajectoryStateOnSurface outermostMeasurementState() const
const AlgebraicSymMatrix55 & covarianceMatrix() const
std::vector< TransientVertex > * thePrimaryVertices
TrackInfoVector theTrackInfoVector
double significance() const
static int position[264][3]
std::vector< TransientVertex > * theSecondaryVertices
TrajectoryStateOnSurface impactPointState() const
Power< A, B >::type pow(const A &a, const B &b)
double MaxSigOnDistTrackToB