23 const std::string&
name,
27 , m_trackFitter(
"Trk::GlobalChi2Fitter/InDetTrackFitter")
28 , m_scalepmaptogev(false)
29 , m_doTrackSelection (true)
30 , m_constrainedTracks(0)
31 , m_passconstrainedRequirements(0)
32 , m_unconstrainedTracks(0)
33 , m_inputTrackCollection(
"Tracks")
34 , m_constraintInputFile_P(nullptr)
35 , m_etaphiMap_P(nullptr)
36 , m_constraintInputFile_d0(nullptr)
37 , m_etaphiMap_d0(nullptr)
38 , m_constraintInputFile_z0(nullptr)
39 , m_etaphiMap_z0(nullptr)
42 , m_SelectPositive(false)
44 declareInterface<ITrackCollectionProvider>(
this);
87 return StatusCode::FAILURE;
103 return StatusCode::FAILURE;
111 return StatusCode::FAILURE;
122 return StatusCode::FAILURE;
130 return StatusCode::FAILURE;
141 return StatusCode::FAILURE;
149 return StatusCode::FAILURE;
163 return StatusCode::SUCCESS;
188 return StatusCode::SUCCESS;
200 finalTracks = originalTracks;
201 return StatusCode::SUCCESS;
212 for ( ; trackIt != trackItE; ++trackIt ) {
214 ATH_MSG_DEBUG(
"Dealing with track: " << trackCount <<
" / " << originalTracks->
size());
220 ATH_MSG_DEBUG(
"Track selection OK for track: " << trackCount);
221 const Trk::Perigee* measuredPerigee = (*trackIt)->perigeeParameters();
222 if(!measuredPerigee){
227 if(!(measuredPerigee->covariance()) ){
240 double correctedQoverP(0), correctedQoverPError(0);
244 correctedQoverP = measuredPerigee->parameters()[
Trk::qOverP];
245 correctedQoverPError = 1e6;
248 double correctedD0(0), correctedD0Error(0);
252 correctedD0 = measuredPerigee->parameters()[
Trk::d0];
253 correctedD0Error = 1e6;
256 double correctedZ0(0), correctedZ0Error(0);
260 correctedZ0 = measuredPerigee->parameters()[
Trk::z0];
261 correctedZ0Error = 1e6;
269 std::vector<Trk::DefinedParameter> constrainedPars;
270 constrainedPars.push_back( constrainedD0 ) ;
271 constrainedPars.push_back( constrainedZ0 ) ;
272 constrainedPars.push_back( constrainedqOverP ) ;
275 constrainedCov.setZero();
276 constrainedCov( 0, 0 ) = correctedD0Error;
277 constrainedCov( 1, 1 ) = correctedZ0Error;
278 constrainedCov( 2, 2 ) = correctedQoverPError;
284 std::move(constrainedCov), *surf) ;
288 std::vector<const Trk::MeasurementBase*> vecOfMB;
289 if (pmot) vecOfMB.push_back(pmot);
294 for (;
it!=itend;++
it)
295 vecOfMB.push_back(*
it);
298 it = (*trackIt)->outliersOnTrack()->begin();
299 itend = (*trackIt)->outliersOnTrack()->
end();
301 for (;
it!=itend;++
it)
302 vecOfMB.push_back(*
it);
306 vecOfMB, *measuredPerigee,
310 if (constrainedFittedTrack){
313 if(!constrainedPerigee){
318 <<
" d0: " << measuredPerigee->parameters()[
Trk::d0]
319 <<
" z0: " << measuredPerigee->parameters()[
Trk::z0] );
320 ATH_MSG_DEBUG(
"constraint values --> momentum: " << 1/correctedQoverP * 1
e-3
321 <<
" pt: " << 1/correctedQoverP * 1
e-3 *
sin(measuredPerigee->parameters()[
Trk::theta])
322 <<
" d0: " << correctedD0
323 <<
" z0: " << correctedZ0 );
326 <<
" d0: " << constrainedPerigee->parameters()[
Trk::d0]
327 <<
" z0: " << constrainedPerigee->parameters()[
Trk::z0] );
331 constrainedFittedTrack->
setTrackSummary( std::make_unique<Trk::TrackSummary> (*
track->trackSummary()) );
346 ->fit(Gaudi::Hive::currentContext(),
352 if(unconstrainedFittedTrack) {
364 ATH_MSG_WARNING(
"Problem with recording AlignmentConstrainedTracks to StoreGate!");
366 return StatusCode::SUCCESS;
373 return StatusCode::SUCCESS;
386 ATH_MSG_DEBUG(
"== TrackSelection == NO perigee on this track");
393 ATH_MSG_DEBUG(
"== TrackSelection == No summary on this track");
401 const double qoverP = perigee->parameters()[
Trk::qOverP] * 1000.;
402 const double z0 = perigee->parameters()[
Trk::z0];
403 const double d0 = perigee->parameters()[
Trk::d0];
405 if ( qoverP != 0 )
pt = fabs(1.0/qoverP)*
sin(perigee->parameters()[
Trk::theta]);
415 if(pt < m_minPt || pt >
m_maxPt ){
446 ATH_MSG_DEBUG(
"This track did not pass cuts --- nPixHits: " << nPixHits <<
" nSCTHits: " <<
nSCTHits <<
447 " nTRTHits: " <<
nTRTHits <<
" idd0atIP: " <<
d0 <<
" idz0atIP: " <<
z0 );
460 if( measuredPerigee->parameters()[
Trk::qOverP] > 0)
467 double phi = measuredPerigee->parameters()[
Trk::phi];
472 double constraintErr =
m_etaphiMap_P->GetBinError(binNumber);
477 delta = delta * 0.001;
480 correctedQoverPError =
perr;
484 qoverpFracError +=
pow(constraintErr,2);
485 correctedQoverPError = qoverpFracError*correctedQoverP*correctedQoverP;
489 ATH_MSG_DEBUG(
" == input pt: " <<
pt <<
" deltaSagitta: " << delta <<
" final pt: " <<
sin(measuredPerigee->parameters()[
Trk::theta]) * 1
e-3/correctedQoverP);
499 if( measuredPerigee->parameters()[
Trk::qOverP] > 0)
504 double d0 = measuredPerigee->parameters()[
Trk::d0];
506 double phi = measuredPerigee->parameters()[
Trk::phi];
507 double d0err = (*measuredPerigee->covariance())(
Trk::d0,
Trk::d0 );
514 correctedD0 =
d0 -
charge * delta * 0.5 ;
516 correctedD0Error = d0err;
517 ATH_MSG_DEBUG(
"Correcting d0 by delta = " << delta <<
"\t, corrected d0 = "<< correctedD0 <<
"\t, original d0 = "<<
d0 ) ;
520 correctedD0Error = d0err +
pow( constraintErr, 2 );
525 ATH_MSG_DEBUG(
" == input d0: " <<
d0 <<
" deltad0: " << delta <<
" final d0: " << correctedD0 <<
" +- " << correctedD0Error);
535 if( measuredPerigee->parameters()[
Trk::qOverP] > 0)
540 double z0 = measuredPerigee->parameters()[
Trk::z0];
542 double phi = measuredPerigee->parameters()[
Trk::phi];
543 double z0err = (*measuredPerigee->covariance())(
Trk::z0,
Trk::z0 );
549 correctedZ0 =
z0 -
charge * delta * 0.5 ;
550 correctedZ0Error = z0err;
553 correctedZ0Error = z0err +
pow( constraintErr, 2 );
559 ATH_MSG_DEBUG(
" == input z0: " <<
z0 <<
" deltaz0: " << delta <<
" final z0: " << correctedZ0 <<
" +- " << correctedZ0Error);
570 *
m_logStream<<
"*************************************************************"<<std::endl;
571 *
m_logStream<<
"****** ConstrainedTrackProvider Summary ******"<<std::endl;