Skip to content
Snippets Groups Projects
Commit c33ebba7 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'master-ATLASRECT-5078-TrigOnlineSpacePointTool' into 'master'

Partially use SiDetectorElementCollection of condition store in TrigOnlineSpacePointTool (ATLASRECTS-5078)

See merge request atlas/athena!26328
parents 8e981f7a 54414339
No related branches found
No related tags found
No related merge requests found
...@@ -113,7 +113,12 @@ void FastPixelClusterization::initializeGeometry(const InDetDD::PixelDetectorMan ...@@ -113,7 +113,12 @@ void FastPixelClusterization::initializeGeometry(const InDetDD::PixelDetectorMan
void FastPixelClusterization::addHit( const Identifier waferId, const IdentifierHash hashElemId, const unsigned int phi_channel, const unsigned int rz_channel, const PixelRDORawData* pHit ) { void FastPixelClusterization::addHit( const Identifier waferId,
const IdentifierHash hashElemId,
const unsigned int phi_channel,
const unsigned int rz_channel,
const PixelRDORawData* pHit,
const InDetDD::SiDetectorElement* element ) {
#ifdef CLUSTERING_DBG #ifdef CLUSTERING_DBG
std::cout << "phi_channel = " << phi_channel << " rz_channel = " << rz_channel << std::endl; std::cout << "phi_channel = " << phi_channel << " rz_channel = " << rz_channel << std::endl;
...@@ -139,7 +144,7 @@ void FastPixelClusterization::addHit( const Identifier waferId, const Identifier ...@@ -139,7 +144,7 @@ void FastPixelClusterization::addHit( const Identifier waferId, const Identifier
m_element = waferId; m_element = waferId;
m_currentClusterColl = new InDet::PixelClusterCollection(hashElemId); m_currentClusterColl = new InDet::PixelClusterCollection(hashElemId);
m_currentClusterColl->setIdentifier(waferId); m_currentClusterColl->setIdentifier(waferId);
m_detEl=m_man->getDetectorElement(hashElemId); m_detEl=element;
// Add the hit // Add the hit
filling_withHit(phi_channel, rz_channel,tot); filling_withHit(phi_channel, rz_channel,tot);
...@@ -198,7 +203,7 @@ void FastPixelClusterization::addHit( const Identifier waferId, const Identifier ...@@ -198,7 +203,7 @@ void FastPixelClusterization::addHit( const Identifier waferId, const Identifier
m_splittedCollection=false; m_splittedCollection=false;
} }
m_detEl=m_man->getDetectorElement(hashElemId); m_detEl=element;
// Add the hit // Add the hit
......
...@@ -54,8 +54,9 @@ class FastPixelClusterization { ...@@ -54,8 +54,9 @@ class FastPixelClusterization {
void setPixelID(const PixelID* pixelID){ m_pixelID = pixelID; } void setPixelID(const PixelID* pixelID){ m_pixelID = pixelID; }
void addHit( const Identifier waferId, const IdentifierHash hashElemId, void addHit( const Identifier waferId, const IdentifierHash hashElemId,
const unsigned int phi_channel, const unsigned int rz_channel, const unsigned int phi_channel, const unsigned int rz_channel,
const PixelRDORawData* pHit = 0); const PixelRDORawData* pHit,
const InDetDD::SiDetectorElement* element );
void finishHits(); void finishHits();
...@@ -221,7 +222,7 @@ class FastPixelClusterization { ...@@ -221,7 +222,7 @@ class FastPixelClusterization {
private: private:
const InDetDD::PixelDetectorManager* m_man; const InDetDD::PixelDetectorManager* m_man;
InDetDD::SiDetectorElement* m_detEl; const InDetDD::SiDetectorElement* m_detEl;
const ISiLorentzAngleTool* m_lorentzAngleTool; const ISiLorentzAngleTool* m_lorentzAngleTool;
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
#include <algorithm> #include <algorithm>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "InDetIdentifier/PixelID.h" #include "InDetIdentifier/PixelID.h"
#include "Identifier/IdentifierHash.h" #include "Identifier/IdentifierHash.h"
#include "InDetReadoutGeometry/SiDetectorManager.h" #include "InDetReadoutGeometry/PixelDetectorManager.h"
#include "InDetPrepRawData/SiClusterContainer.h" #include "InDetPrepRawData/SiClusterContainer.h"
#include "InDetPrepRawData/PixelClusterCollection.h" #include "InDetPrepRawData/PixelClusterCollection.h"
...@@ -69,8 +69,6 @@ StatusCode PixelClusterCacheTool::initialize() { ...@@ -69,8 +69,6 @@ StatusCode PixelClusterCacheTool::initialize() {
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
p_indet_mgr = mgr;
m_clusterization.setPixelID(m_pixel_id); m_clusterization.setPixelID(m_pixel_id);
m_clusterization.initializeGeometry(mgr); m_clusterization.initializeGeometry(mgr);
m_clusterization.setLorentzAngleTool(m_lorentzAngleTool.get()); m_clusterization.setLorentzAngleTool(m_lorentzAngleTool.get());
...@@ -132,6 +130,8 @@ StatusCode PixelClusterCacheTool::initialize() { ...@@ -132,6 +130,8 @@ StatusCode PixelClusterCacheTool::initialize() {
m_rdoContainer->addRef(); m_rdoContainer->addRef();
} }
ATH_CHECK(m_pixelDetEleCollKey.initialize());
return sc; return sc;
} }
...@@ -151,6 +151,14 @@ StatusCode PixelClusterCacheTool::convertBStoClusters(std::vector<const ROBF*>& ...@@ -151,6 +151,14 @@ StatusCode PixelClusterCacheTool::convertBStoClusters(std::vector<const ROBF*>&
const std::vector<IdentifierHash>& listOfPixIds, const std::vector<IdentifierHash>& listOfPixIds,
std::vector<int>& errorVect, bool isFullScan) std::vector<int>& errorVect, bool isFullScan)
{ {
// Get PixelDetectorElementCollection
SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> pixelDetEle(m_pixelDetEleCollKey);
const InDetDD::SiDetectorElementCollection* elements(pixelDetEle.retrieve());
if (elements==nullptr) {
ATH_MSG_FATAL(m_pixelDetEleCollKey.fullKey() << " could not be retrieved");
return StatusCode::FAILURE;
}
if(!evtStore()->contains<InDet::PixelClusterContainer>(m_containerName)) if(!evtStore()->contains<InDet::PixelClusterContainer>(m_containerName))
{ {
m_clusterContainer->cleanup(); m_clusterContainer->cleanup();
...@@ -285,6 +293,7 @@ StatusCode PixelClusterCacheTool::convertBStoClusters(std::vector<const ROBF*>& ...@@ -285,6 +293,7 @@ StatusCode PixelClusterCacheTool::convertBStoClusters(std::vector<const ROBF*>&
int npixels=0; int npixels=0;
for (std::vector<IdentifierHash>::iterator it=reducedList.begin(); it != reducedList.end(); ++it) for (std::vector<IdentifierHash>::iterator it=reducedList.begin(); it != reducedList.end(); ++it)
{ {
const InDetDD::SiDetectorElement* element = elements->getDetectorElement((*it));
PixelRDO_Container::const_iterator collIt=m_rdoContainer->indexFind((*it)); PixelRDO_Container::const_iterator collIt=m_rdoContainer->indexFind((*it));
if(collIt==m_rdoContainer->end()) if(collIt==m_rdoContainer->end())
continue; continue;
...@@ -302,7 +311,8 @@ StatusCode PixelClusterCacheTool::convertBStoClusters(std::vector<const ROBF*>& ...@@ -302,7 +311,8 @@ StatusCode PixelClusterCacheTool::convertBStoClusters(std::vector<const ROBF*>&
npixels++; npixels++;
m_clusterization.addHit(coll_id,coll_hash_id, m_clusterization.addHit(coll_id,coll_hash_id,
m_pixel_id->phi_index(pixId), m_pixel_id->phi_index(pixId),
m_pixel_id->eta_index(pixId),(*rdoIt)); m_pixel_id->eta_index(pixId),(*rdoIt),
element);
} }
} }
else else
......
...@@ -7,14 +7,15 @@ ...@@ -7,14 +7,15 @@
#include "ByteStreamData/RawEvent.h" #include "ByteStreamData/RawEvent.h"
#include "AthenaBaseComps/AthAlgTool.h" #include "AthenaBaseComps/AthAlgTool.h"
#include "InDetReadoutGeometry/PixelDetectorManager.h"
#include "IPixelClusterCacheTool.h" #include "IPixelClusterCacheTool.h"
#include "InDetPrepRawData/PixelClusterCollection.h" #include "InDetPrepRawData/PixelClusterCollection.h"
#include "InDetPrepRawData/PixelClusterContainer.h" #include "InDetPrepRawData/PixelClusterContainer.h"
#include "InDetRawData/PixelRDO_Container.h" #include "InDetRawData/PixelRDO_Container.h"
#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
#include "PixelRawDataByteStreamCnv/IPixelRodDecoder.h" #include "PixelRawDataByteStreamCnv/IPixelRodDecoder.h"
#include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" #include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h"
#include "SiClusterizationTool/IPixelClusteringTool.h" #include "SiClusterizationTool/IPixelClusteringTool.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ToolHandle.h"
#include "InDetCondTools/ISiLorentzAngleTool.h" #include "InDetCondTools/ISiLorentzAngleTool.h"
#include <vector> #include <vector>
...@@ -45,7 +46,6 @@ private: ...@@ -45,7 +46,6 @@ private:
std::string m_containerName; std::string m_containerName;
FastPixelClusterization m_clusterization; FastPixelClusterization m_clusterization;
//PixelIdMapping *m_IdMapping; //PixelIdMapping *m_IdMapping;
const InDetDD::PixelDetectorManager* p_indet_mgr;
const PixelID* m_pixel_id; const PixelID* m_pixel_id;
IdContext m_cntx_pix; IdContext m_cntx_pix;
ToolHandle<IPixelRodDecoder> m_offlineDecoder; ToolHandle<IPixelRodDecoder> m_offlineDecoder;
...@@ -55,6 +55,7 @@ private: ...@@ -55,6 +55,7 @@ private:
ServiceHandle<IPixelByteStreamErrorsSvc> m_bsErrorSvc; ServiceHandle<IPixelByteStreamErrorsSvc> m_bsErrorSvc;
ToolHandle<InDet::IPixelClusteringTool> m_clusteringTool; ToolHandle<InDet::IPixelClusteringTool> m_clusteringTool;
ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "PixelLorentzAngleTool", "Tool to retreive Lorentz angle"}; ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "PixelLorentzAngleTool", "Tool to retreive Lorentz angle"};
SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
bool m_doBS; bool m_doBS;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment