|
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include "GaudiKernel/IToolSvc.h"
17 #include "CLHEP/Units/SystemOfUnits.h"
30 const std::string&
name,
31 const IInterface*
parent ) :
69 const double pixelSizeX = 0.05;
70 const double pixelSizeY = 0.25;
93 const float planesZDist = 9.;
95 const float pixelSizeX = 0.05;
97 m_aposterioriCov[1][1] = pixelSizeX * pixelSizeX / (planesZDist*planesZDist*3.);
99 const float pixelSizeY = 0.25;
101 m_aposterioriCov[3][3] = pixelSizeY * pixelSizeY / (planesZDist*planesZDist*3.);
114 return StatusCode::FAILURE;
120 ATH_MSG_ERROR(
"Impossible to make seeds when length of m_layersForSeeds is 0 ");
121 return StatusCode::FAILURE;
126 if(lfs->first == lfs->second)
128 ATH_MSG_WARNING(
"Both layer IDs in m_layersForSeeds are equal to "<<lfs->first<<
", removing this pair of layer IDs");
138 if(lfs->first > lfs->second)
140 ATH_MSG_INFO(
"The first layer ID for seeds ("<<lfs->first<<
") is higher than the second layer ID ("<<lfs->second<<
"), swapping");
142 lfs->first=lfs->second;
159 ATH_MSG_WARNING(
"Found duplicity for {"<<lfs2->first<<
","<<lfs2->second<<
"}, removing the duplicity");
172 ATH_MSG_ERROR(
"Nothing is left in m_layersForSeeds after cleaning, please fix the setup");
173 return StatusCode::FAILURE;
176 std::string stringLayersForSeeds=
"{";
181 stringLayersForSeeds.pop_back();
182 ATH_MSG_DEBUG(
"Pairs of layer IDs that will make track seeds = "<<stringLayersForSeeds<<
"}");
191 return StatusCode::SUCCESS;
196 return StatusCode::SUCCESS;
206 my_stationClusters.
clustersInLayer(theCluster->pixelLayerID()).push_back(theCluster);
208 catch (
const std::out_of_range& outOfRange) {
209 ATH_MSG_WARNING(
"Cluster with station or pixel ID outside expected range. Aborting track reconstruction.");
217 const double dx =
a->xLocal() -
b->xLocal();
218 const double dy =
a->yLocal() -
b->yLocal();
219 const double maxDistanceSq = allowedDistanceBetweenClustersInSeed * allowedDistanceBetweenClustersInSeed;
221 return dx *
dx +
dy *
dy <= maxDistanceSq;
227 if(!hitsClusterContainer.
isValid())
230 return StatusCode::SUCCESS;
234 using LayersIter_t = std::vector<std::vector<const xAOD::AFPSiHitsCluster *>>::const_iterator;
237 std::list<AFPSiDBasicKalmanToolTrack> reconstructedTracks;
253 const LayersIter_t layersEnd = my_stationClusters.
layers().end();
254 const LayersIter_t layersBegin = my_stationClusters.
layers().begin();
257 LayersIter_t firstLayer = layersBegin+layersForSeeds->first;
258 LayersIter_t secondLayer = layersBegin+layersForSeeds->second;
275 for (LayersIter_t remainingLayersIT = layersBegin; remainingLayersIT != layersEnd; ++remainingLayersIT)
277 if(remainingLayersIT==firstLayer || remainingLayersIT==secondLayer)
continue;
280 if (closestCluster !=
nullptr)
290 reconstructedTracks.pop_back();
316 Monitored::Group(
m_monTool, trkStationID, trkXLocal, trkYLocal, trkZLocal, trkXSlope, trkYSlope, trkNClusters, trkNHoles, trkChi2, trkMask);
318 return StatusCode::SUCCESS;
323 auto *
track = containerToFill->
push_back(std::make_unique<xAOD::AFPTrack>());
329 track->setXLocal(firstPoint[0]);
330 track->setYLocal(firstPoint[2]);
332 track->setXSlope(firstPoint[1]);
333 track->setYSlope(firstPoint[3]);
344 track->addCluster(clusterLink);
346 ATH_MSG_DEBUG(
"cluster position: (x="<<theCluster->xLocal()<<
", y="<<theCluster->yLocal()<<
", z="<<theCluster->zLocal()<<
")");
354 while (mainIterator != tracksList.end()) {
356 bool deletedMain =
false;
360 while (compareIterator != tracksList.end())
363 bool removeMain =
false;
364 bool removeCompare =
false;
374 if(mainTrkQuality >= compareTrkQuality)
376 removeCompare =
true;
383 else if(sharedClusters == mainIterator->clustersInTrack().size() && sharedClusters == compareIterator->clustersInTrack().size())
386 removeCompare =
true;
391 tracksList.erase(compareIterator++);
396 tracksList.erase(mainIterator++);
405 if (!deletedMain) ++mainIterator;
412 unsigned int sharedClustersN = 0;
416 if (firstCluster == secondCluster) {
421 return sharedClustersN;
426 const int rowsN =
matrix.num_row();
427 const int columnsN =
matrix.num_col();
430 if ( ((
int)vec1D.size()) == rowsN*columnsN) {
432 for (
int rowID = 0; rowID < rowsN; rowID++)
433 for (
int columnID = 0; columnID < columnsN; columnID++)
434 matrix[rowID][columnID] = vec1D[rowID*columnsN + columnID];
438 std::stringstream warningMessage;
439 warningMessage<<
"Matrix size ("<<rowsN<<
"x"<<columnsN
440 <<
" = "<<rowsN*columnsN<<
") is not compatible with vector size: "
442 warningMessage<<
"Matrix will not be initialised. The vector contains following numbers: ";
443 for (
const float number : vec1D)
444 warningMessage<<
number<<
" ";
JetConstituentVector::iterator iterator
Class representing a track reconstructed in AFP.
Group
Properties of a chain group.
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
void setNumberOfLayers(const unsigned int layersN)
Sets vector containing layers to the specified size.
float ySlope() const
Slope of the reconstructed track along Y axis in local coordinate system.
static constexpr int basicKalman
basic Kalman algorithm id=0
float zLocal() const
Track position along Z axis in station local coordinate system.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
float chi2() const
value of the track fit to the selected clusters.
int nClusters() const
Number of clusters used to reconstruct the track.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< std::vector< const xAOD::AFPSiHitsCluster * > > & layers()
Returns vector layers, each layer is a vector of clusters.
int stationID() const
Index of the station with pixels cluster.
std::vector< const xAOD::AFPSiHitsCluster * > & clustersInLayer(const unsigned int layerID)
Returns vector of clusters in the layer with given ID.
#define CHECK(...)
Evaluate an expression and check for errors.
float xSlope() const
Slope of the reconstructed track along X axis in local coordinate system.
Helper class representing an AFP station used in track reconstruction.
float yLocal() const
Track position along Y axis in station local coordinate system.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
std::string to_string(const DetectorType &type)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
#define ATH_MSG_WARNING(x)
float xLocal() const
Track position along X axis in station local coordinate system.
int stationID() const
Index of the station where track was reconstructed.
Class representing a cluster of AFP pixel hits.
float zLocal() const
Cluster position along Z axis in station local coordinate system.
unsigned int nHoles() const
Number of empty layers that the track passes through.