28 double baseScorePerHit = 17.;
40 double hitQualityScore;
44 hitQualityScore = (1.2 * (baseScorePerHit -
x2 * .5));
46 hitQualityScore = (baseScorePerHit -
x2);
47 if (hitQualityScore < 0.)
50 quality += hitQualityScore;
134 return StatusCode::SUCCESS;
164 if (!
key.key().empty()) {
178 ATH_CHECK(outputTracks.record(std::make_unique<TrackCollection>()));
181 return StatusCode::SUCCESS;
187 std::list<Trk::Vertex> vertices =
m_zvertexmaker->newEvent(ctx, seedEventData);
188 if (not vertices.empty()) ZVE =
true;
192 std::list<Trk::Vertex> vertexList;
196 const bool PIX =
true;
197 const bool SCT =
true;
204 std::multimap<double, Trk::Track*> qualitySortedTrackCandidates;
207 while ((seed =
m_seedsmaker->next(ctx, seedEventData))) {
209 std::list<Trk::Track*> trackList =
m_trackmaker->getTracks(ctx, trackEventData, seed->spacePoints());
211 qualitySortedTrackCandidates.insert(std::make_pair(-trackQuality(
t),
t));
227 for (
const std::pair<const double, Trk::Track*> & qualityAndTrack: qualitySortedTrackCandidates) {
233 outputTracks->push_back(qualityAndTrack.second);
242 outputTracks->clear();
253 return StatusCode::SUCCESS;
263 ATH_CHECK(outputTracks.record(std::make_unique<TrackCollection>()));
266 return StatusCode::SUCCESS;
291 std::list<Trk::Vertex> vertexList;
295 const bool PIX = true ;
296 const bool SCT = true ;
302 std::vector<int> numberHistogram(
m_histsize, 0);
303 std::vector<double> zWeightedHistogram(
m_histsize, 0.);
304 std::vector<double> ptWeightedHistogram(
m_histsize, 0.);
311 std::multimap<double, Trk::Track*> qualitySortedTrackCandidates;
314 bool doWriteNtuple =
m_seedsmaker->getWriteNtupleBoolProperty();
319 if(!eventInfo.
isValid()) {EvNumber = -1.0;}
else {EvNumber = eventInfo->
eventNumber();}
323 while ((seed =
m_seedsmaker->next(ctx, seedEventData))) {
327 bool firstTrack{
true};
330 std::list<Trk::Track*> trackList =
m_trackmaker->getTracks(ctx, trackEventData, seed->spacePoints());
334 qualitySortedTrackCandidates.insert(std::make_pair(-trackQuality(
t),
t));
338 fillZHistogram(
t, beamPosPerigee, numberHistogram, zWeightedHistogram, ptWeightedHistogram);
360 ATH_MSG_WARNING(
"SpacePointsPixelKey is empty. Skipping the second seeding pass that uses pixel seeds.");
364 std::pair<double,double> zBoundaries;
367 findZvertex(vertexList, zBoundaries, numberHistogram, zWeightedHistogram, ptWeightedHistogram);
370 m_seedsmaker->find3Sp(ctx, seedEventData, vertexList, &(zBoundaries.first));
376 while ((seed =
m_seedsmaker->next(ctx, seedEventData))) {
380 std::list<Trk::Track*> trackList =
m_trackmaker->getTracks(ctx, trackEventData, seed->spacePoints());
383 qualitySortedTrackCandidates.insert(std::make_pair(-trackQuality(
t),
t));
401 for (
const std::pair<const double, Trk::Track*> & qualityAndTrack: qualitySortedTrackCandidates) {
419 outputTracks->push_back(qualityAndTrack.second);
427 outputTracks->clear();
437 return StatusCode::SUCCESS;
449 ATH_CHECK(outputTracks.record(std::make_unique<TrackCollection>()));
451 const bool PIX = true ;
452 const bool STRIP = true ;
470 std::list<Trk::Vertex> vertexList;
479 std::multimap<double, Trk::Track*> qualitySortedTrackCandidates;
482 bool doWriteNtuple =
m_seedsmaker->getWriteNtupleBoolProperty();
487 if(!eventInfo.
isValid()) {EvNumber = -1.0;}
else {EvNumber = eventInfo->
eventNumber();}
491 while ((seed =
m_seedsmaker->next(ctx, seedEventData))) {
496 std::list<Trk::Track*> trackList =
m_trackmaker->getTracks(ctx, trackEventData, seed->spacePoints());
500 qualitySortedTrackCandidates.insert(std::make_pair(-trackQuality(
t),
t));
519 for (
const std::pair<const double, Trk::Track*> & qualityAndTrack: qualitySortedTrackCandidates) {
536 outputTracks->push_back(qualityAndTrack.second);
544 outputTracks->clear();
554 return StatusCode::SUCCESS;
567 ATH_CHECK(outputTracks.record(std::make_unique<TrackCollection>()));
570 return StatusCode::SUCCESS;
576 std::unique_ptr<RoiDescriptor> roiComp = std::make_unique<RoiDescriptor>(
true);
581 double beamZ = beamSpotHandle->beamVtx().position().z();
586 for (
const ROIPhiRZ &calo_roi : calo_rois_ref) {
587 double phi = calo_roi.phi();
588 if (std::abs(phi)>=
M_PI && phi!=-
M_PI)
continue;
589 double eta = calo_roi.eta();
597 roi =
new RoiDescriptor( eta, roiEtaMin, roiEtaMax,phi, roiPhiMin ,roiPhiMax,
z,roiZMin,roiZMax);
603 return StatusCode::FAILURE;
606 std::vector<IdentifierHash> listOfStripIds;
607 std::vector<IdentifierHash> listOfPixIds;
612 m_seedsmaker->newRegion(ctx, seedEventData, listOfPixIds, listOfStripIds);
613 std::list<Trk::Vertex> vertexList;
617 const bool PIX = true ;
618 const bool STRIP = true ;
628 std::multimap<double, Trk::Track*> qualitySortedTrackCandidates;
631 bool doWriteNtuple =
m_seedsmaker->getWriteNtupleBoolProperty();
636 if(!eventInfo.
isValid()) {EvNumber = -1.0;}
else {EvNumber = eventInfo->
eventNumber();}
640 while ((seed =
m_seedsmaker->next(ctx, seedEventData))) {
645 std::list<Trk::Track*> trackList =
m_trackmaker->getTracks(ctx, trackEventData, seed->spacePoints());
648 qualitySortedTrackCandidates.insert(std::make_pair(-trackQuality(
t),
t));
667 for (
const std::pair<const double, Trk::Track*> & qualityAndTrack: qualitySortedTrackCandidates) {
685 outputTracks->push_back(qualityAndTrack.second);
693 outputTracks->clear();
703 return StatusCode::SUCCESS;
715 dump(MSG::INFO, &m_counterTotal);
717 return StatusCode::SUCCESS;
726 msg(assign_level) <<std::endl;
727 MsgStream& out_msg=
msg();
741 std::string s1;
for (
int i=0;
i<
n; ++
i) s1.append(
" "); s1.append(
"|");
743 std::string
s2;
for (
int i=0;
i<
n; ++
i)
s2.append(
" ");
s2.append(
"|");
745 std::string
s3;
for (
int i=0;
i<
n; ++
i)
s3.append(
" ");
s3.append(
"|");
747 std::string
s4;
for (
int i=0;
i<
n; ++
i)
s4.append(
" ");
s4.append(
"|");
751 n = 65-s5.size();
for (
int i=0;
i<
n; ++
i) s5.append(
" "); s5.append(
"|");
753 out<<
"|----------------------------------------------------------------"
754 <<
"----------------------------------------------------|"
756 out<<
"| Use primary vertices z-coordinates finding?| "<<s5
759 out<<
"| Tool for primary vertices z-coordinates finding | "<<
m_zvertexmaker.type()<<s1
768 out<<
"|----------------------------------------------------------------"
769 <<
"----------------------------------------------------|"
780 out<<
"|-------------------------------------------------------------------";
781 out<<
"---------------------------------|"
783 out<<
"| Investigated "
784 <<std::setw(9)<<
counter[
kNSeeds]<<
" space points seeds and found ";
789 else out<<
" tracks using old strategy |"<<std::endl;
791 out<<
"|-------------------------------------------------------------------";
792 out<<
"---------------------------------|"
803 out<<
"|-------------------------------------------------------------------";
804 out<<
"-----------------------------|"
829 unsigned int nsp = 0;
832 if (spacePointsPixel.isValid()) {
847 if (spacePointsSCT.isValid()) {
867 std::set<const Trk::PrepRawData*>
clusters;
869 std::vector<const Trk::PrepRawData*> freeClusters;
870 freeClusters.reserve(15);
875 while (it_qualityAndTrack!=qualitySortedTracks.end()) {
876 freeClusters.clear();
892 freeClusters.push_back(
pr);
898 int nFreeClusters =
static_cast<int>(freeClusters.size());
899 if (nFreeClusters >=
m_nfreeCut || nFreeClusters==nClusters) {
902 clusters.insert(freeClusters.begin(), freeClusters.end());
903 ++it_qualityAndTrack;
906 delete (*it_qualityAndTrack).second;
907 qualitySortedTracks.erase(it_qualityAndTrack++);
915 std::set<const Trk::PrepRawData*>
clusters;
917 std::vector<const Trk::PrepRawData*> freeClusters;
918 freeClusters.reserve(15);
923 while (it_qualityAndTrack!=qualitySortedTracks.end()) {
924 freeClusters.clear();
949 freeClusters.push_back(
pr);
955 clusters.insert(freeClusters.begin(), freeClusters.end());
957 int nFreeClusters =
static_cast<int>(freeClusters.size());
958 if(
passEtaDepCuts( (*it_qualityAndTrack).second, nClusters, nFreeClusters, nPixels) ){
960 ++it_qualityAndTrack;
963 delete (*it_qualityAndTrack).second;
964 qualitySortedTracks.erase(it_qualityAndTrack++);
975 std::vector<int>& numberHistogram,
976 std::vector<double>& zWeightedHistogram,
977 std::vector<double>& ptWeightedHistogram)
const
987 constexpr
double rSquare_max_forZHisto = 60.*60.;
988 if (position.x()*position.x()+position.y()*position.y() >= rSquare_max_forZHisto)
return;
994 if (not TP.
production(paramsAtFirstSurface))
return;
998 if (not
m_proptool->propagate(Gaudi::Hive::currentContext(),
1001 const AmgVector(5)& parsAtBeamSpot = TP.parameters();
1002 if (std::abs(parsAtBeamSpot[0]) >
m_imcut)
return;
1008 ++numberHistogram[
z];
1010 zWeightedHistogram[
z] += parsAtBeamSpot[1];
1012 ptWeightedHistogram[
z] +=
pT;
1022 std::pair<double, double> & zBoundaries,
1023 const std::vector<int>& numberHistogram,
1024 const std::vector<double>& zWeightedHistogram,
1025 const std::vector<double>& ptWeightedHistogram)
const
1027 zBoundaries = {1000., -1000};
1029 std::multimap<int ,double> vertexZ_sortedByNtracks;
1030 std::multimap<double,double> vertexZ_sortedBySumPt;
1033 int minBinContentSum = 3;
1043 if (vertexNtracks>=minBinContentSum and (numberHistogram.at(
binIndex) >= numberHistogram.at(
binIndex-1) and numberHistogram.at(
binIndex) >= numberHistogram.at(
binIndex+1))) {
1045 double vertexZestimate = (zWeightedHistogram.at(
binIndex-1)+zWeightedHistogram.at(
binIndex)+zWeightedHistogram.at(
binIndex+1))/
static_cast<double>(vertexNtracks);
1049 if (vertexZestimate < zBoundaries.first) zBoundaries.first = vertexZestimate;
1050 if (vertexZestimate > zBoundaries.second) zBoundaries.second = vertexZestimate;
1055 vertexZ_sortedByNtracks.insert(std::make_pair(-vertexNtracks, vertexZestimate));
1056 vertexZ_sortedBySumPt.insert(std::make_pair(-
vertexSumPt, vertexZestimate));
1063 std::set<double> leadingVertices;
1066 for (std::pair<int, double> nTrackAndZ: vertexZ_sortedByNtracks) {
1071 leadingVertices.insert(nTrackAndZ.second);
1072 leadingVertices.insert((*vertex_pt_and_z++).second);
1075 for (
double v: leadingVertices) {
1080 if (zBoundaries.first > zBoundaries.second) {
1081 zBoundaries.first = -1000.;
1082 zBoundaries.second = +1000.;
1085 zBoundaries.first -= 20.;
1086 zBoundaries.second += 20.;
1118 if(!
par)
return false;
1120 double eta = std::abs(
par->eta());
1121 if(nClusters < m_etaDependentCutsSvc->getMinSiHitsAtEta(eta))
return false;
1122 if(nFreeClusters < m_etaDependentCutsSvc->getMinSiNotSharedAtEta(eta))
return false;
1124 if(nPixels < m_etaDependentCutsSvc->getMinPixelHitsAtEta(eta))
return false;