38 ISvcLocator* pSvcLocator)
47 ATH_MSG_FATAL(
"SCTs selected and no name set for SCT clusters");
48 return StatusCode::FAILURE;
53 ATH_MSG_FATAL(
"Pixels selected and no name set for Pixel clusters");
54 return StatusCode::FAILURE;
60 return StatusCode::FAILURE;
66 return StatusCode::FAILURE;
72 return StatusCode::FAILURE;
99 ATH_MSG_INFO(
"Use SCT SP overlap cuts based on layer number parity");
102 ATH_MSG_INFO(
"Doing eta overlap space points in strips endcap");
104 return StatusCode::SUCCESS;
123 if (elements==
nullptr) {
125 return StatusCode::SUCCESS;
128 properties = sctProperties.
retrieve();
129 if (properties==
nullptr) {
131 return StatusCode::SUCCESS;
138 r_cache.
vertex = beamSpot->beamVtx().position();
145 std::unique_ptr<DataPool<PixelSpacePoint>> dataItemsPixel =
nullptr;
154 ATH_CHECK( spacePointContainerPixel.
record( std::make_unique<SpacePointContainer>(updateH.
ptr()) ) );
157 const bool hasExternalCache = spacePointContainerPixel->hasExternalCache();
158 if (!hasExternalCache) {
159 dataItemsPixel = std::make_unique<DataPool<PixelSpacePoint>>(ctx);
160 dataItemsPixel->reserve(5000);
162 dataItemsPixel = std::make_unique<DataPool<PixelSpacePoint>>(ctx);
168 std::unique_ptr<DataPool<SCT_SpacePoint>> dataItemsSCT =
nullptr;
177 ATH_CHECK( spacePointContainer_SCT.
record( std::make_unique<SpacePointContainer>(updateH.
ptr()) ) );
180 const bool hasExternalCache = spacePointContainer_SCT->hasExternalCache();
181 if (!hasExternalCache) {
182 dataItemsSCT = std::make_unique<DataPool<SCT_SpacePoint>>(ctx);
183 dataItemsSCT->reserve(10000);
185 dataItemsSCT = std::make_unique<DataPool<SCT_SpacePoint>>(ctx);
193 ATH_CHECK( spacepointoverlapCollection.
record( std::make_unique<SpacePointOverlapCollection>() ) );
198 ATH_MSG_DEBUG(
"Container '" << spacepointoverlapCollection.
name() <<
"' initialised" );
201 int sctCacheCount = 0;
202 int pixCacheCount = 0;
207 if (!sct_clcontainer.
isValid()){
208 msg(MSG:: FATAL) <<
"Could not find the data object "<< sct_clcontainer.
name() <<
" !" <<
endmsg;
209 return StatusCode::RECOVERABLE;
214 ATH_MSG_DEBUG(
"SCT Cluster container found: " << sct_clcontainer->size() <<
" collections" );
220 SCT_ClusterContainer::const_iterator it = sct_clcontainer->begin();
221 SCT_ClusterContainer::const_iterator itend = sct_clcontainer->end();
223 for (; it != itend; ++it){
224 const SCT_ClusterCollection *colNext=&(**it);
230 ATH_MSG_DEBUG(
"SCT Hash " << idHash <<
" is already in cache");
236 auto spacepointCollection = std::make_unique<SpacePointCollection>(idHash);
237 spacepointCollection->setIdentifier(elementID);
245 colNext, properties, elements, spacepointCollection.
get(),
246 spacepointoverlapCollection.
ptr(), r_cache, dataItemsSCT.get());
251 size_t size = spacepointCollection->size();
253 ATH_MSG_VERBOSE(
"SiTrackerSpacePointFinder algorithm found no space points" );
256 StatusCode
sc= lock.
addOrDelete( std::move(spacepointCollection) );
259 return StatusCode::RECOVERABLE;
261 ATH_MSG_VERBOSE( size <<
" SpacePoints successfully added to Container !" );
262 nReceivedSPsSCT += size;
273 if (!pixel_clcontainer.
isValid()){
274 msg(MSG:: FATAL) <<
"Could not find the data object "<< pixel_clcontainer.
name() <<
" !" <<
endmsg;
275 return StatusCode::RECOVERABLE;
281 PixelClusterContainer::const_iterator colNext = pixel_clcontainer->begin();
282 PixelClusterContainer::const_iterator lastCol = pixel_clcontainer->end();
286 for (; colNext != lastCol; ++colNext)
292 ATH_MSG_DEBUG(
"pixel Hash " << idHash <<
" is already in cache");
297 Identifier elementID = (*colNext)->identify();
298 auto spacepointCollection = std::make_unique< SpacePointCollection >(idHash);
299 spacepointCollection->setIdentifier(elementID);
305 if (!(*colNext)->empty())
308 *colNext, spacepointCollection.get(), dataItemsPixel.get());
312 size_t size = spacepointCollection->size();
315 ATH_MSG_DEBUG(
"SiTrackerSpacePointFinder algorithm found no space points" );
319 StatusCode
sc = lock.
addOrDelete( std::move(spacepointCollection) );
323 return StatusCode::RECOVERABLE;
326 <<
" SpacePoints successfully added to Container !" );
327 nReceivedSPsPIX += size;
337 if (spacepointoverlapCollection->empty())
343 ATH_MSG_DEBUG( spacepointoverlapCollection->size() <<
" overlap space points registered." );
354 return StatusCode::SUCCESS;
373 return StatusCode::SUCCESS;
420 enum NeighbourIndices{ThisOne, Opposite, PhiMinus, PhiPlus, EtaMinus, EtaPlus, nNeighbours};
422 std::array<const SCT_ClusterCollection*, nNeighbours> neighbourClusters{};
423 std::array<const InDetDD::SiDetectorElement*, nNeighbours> neighbourElements{};
424 std::array<double, 14> overlapExtents{};
432 const std::vector<IdentifierHash>* others(properties->neighbours(triggerIdHash));
433 if (others==
nullptr || others->empty() )
return;
436 neighbourElements[0] = triggerElement;
437 neighbourClusters[0] = sctClusters;
450 float hwidth(properties->halfWidth(triggerIdHash));
461 const std::array<size_t, nNeighbours> neigbourIndices{ThisOne, Opposite, EtaMinus, EtaPlus, PhiMinus, PhiPlus};
463 for (
const auto& otherHash : *others) {
466 const SCT_ClusterCollection* otherClusters = r_cache.
SCTCContainer->indexFindPtr (otherHash);
469 if(!otherElement || !otherClusters)
continue;
471 neighbourElements[neigbourIndices[n]] = otherElement;
472 neighbourClusters[neigbourIndices[n]] = otherClusters;
482 overlapExtents[ 6] =-hwidth;
485 overlapExtents[ 9] = hwidth;
490 overlapExtents[11] = hwidth;
491 overlapExtents[12] =-hwidth;
518 neighbourElements, neighbourClusters, overlapExtents,
m_allClusters,
519 r_cache.
vertex, spacepointCollection, spacepointOverlapCollection,
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
#define CHECK(...)
Evaluate an expression and check for errors.
Header file to be included by clients of the Monitored infrastructure.
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
const ServiceHandle< StoreGateSvc > & detStore() const
Base class for conditions algorithms.
a typed memory pool that saves time spent allocation small object.
const T * get(size_type n) const
Access an element, as an rvalue.
bool OnlineAndPresentInAnotherView()
This method is to avoid calling an expensive operation in the offline case.
StatusCode addOrDelete(std::unique_ptr< T > ptr)
This is a "hash" representation of an Identifier.
Class to hold the SiDetectorElement objects to be put in the detector store.
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Class to hold geometrical description of a silicon detector element.
bool isStereo() const
Check if it is the stereo side (useful for SCT)
virtual Identifier identify() const override final
identifier of this detector element (inline)
virtual StatusCode initialize() override
SG::WriteHandleKey< SpacePointContainer > m_SpacePointContainer_SCTKey
virtual StatusCode execute(const EventContext &ctx) const override
SG::UpdateHandleKey< SpacePointCache > m_SpacePointCache_PixKey
SG::ReadHandleKey< PixelClusterContainer > m_Pixel_clcontainerKey
SG::WriteHandleKey< SpacePointOverlapCollection > m_spacepointoverlapCollectionKey
const PixelID * m_idHelperPixel
BooleanProperty m_allClusters
FloatProperty m_overlapLimitEtaMin
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
For SCT alignment.
FloatProperty m_overlapLimitEtaMax
FloatProperty m_overlapLimitOpposite
std::atomic< int > m_numberOfPixel
bool m_cachemode
used for online MT counters
ToolHandle< GenericMonitoringTool > m_monTool
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
For beam spot.
BooleanProperty m_useSCTLayerDep_OverlapCuts
BooleanProperty m_overrideBS
SG::WriteHandleKey< SpacePointContainer > m_SpacePointContainerPixelKey
SG::ReadCondHandleKey< InDet::SiElementPropertiesTable > m_SCTPropertiesKey
To get SCT neighbours.
FloatProperty m_overlapLimitPhi
std::atomic< int > m_nspacePointsOverlap
BooleanProperty m_overlap
std::atomic< int > m_nspacePoints
SG::ReadHandleKey< SCT_ClusterContainer > m_Sct_clcontainerKey
std::atomic< int > m_sctCacheHits
BooleanProperty m_useDataPoolWithCache
BooleanProperty m_doEndcapEtaOverlapSP
BooleanProperty m_selectSCTs
const SCT_ID * m_idHelper
void addSCT_SpacePoints(const SCT_ClusterCollection *next, const SiElementPropertiesTable *properties, const InDetDD::SiDetectorElementCollection *elements, SpacePointCollection *spacepointCollection, SpacePointOverlapCollection *spacepointOverlapCollection, SPFCache &, DataPool< SCT_SpacePoint > *dataItemsSCT) const
std::atomic< int > m_numberOfEvents
BooleanProperty m_selectPixels
virtual StatusCode finalize() override
ToolHandle< SiSpacePointMakerTool > m_SiSpacePointMakerTool
std::atomic< int > m_pixCacheHits
SiTrackerSpacePointFinder()=delete
std::atomic< int > m_numberOfSCT
SG::UpdateHandleKey< SpacePointCache > m_SpacePointCache_SCTKey
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
const_pointer_type retrieve()
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
pointer_type ptr()
Dereference the pointer.
const std::string & name() const
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
Eigen::Matrix< double, 3, 1 > Vector3D
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
This is a temporary object to aid reentrant coding.
const SCT_ClusterContainer * SCTCContainer