19 const std::string& name,
20 const IInterface* parent)
21 : base_class(
type, name, parent)
28 std::vector< std::vector<AFPSiClusterLayerBasicObj> > my_layers;
29 my_layers.resize(layersInStations.size());
33 std::vector<std::vector<AFPSiClusterLayerBasicObj> >
::iterator layersIter = my_layers.begin();
34 for (
const int layersN : layersInStations) {
36 std::vector<AFPSiClusterLayerBasicObj>& layersVec = (*layersIter++);
37 layersVec.resize(layersN);
40 theLayer.setStationID(stationID);
41 theLayer.setLayerID(layerID++);
67 return StatusCode::SUCCESS;
72 return StatusCode::SUCCESS;
82 return StatusCode::FAILURE;
88 return StatusCode::FAILURE;
94 return StatusCode::FAILURE;
97 if(
saveToXAOD(clustr, my_layers, ctx).isFailure())
100 return StatusCode::FAILURE;
106 return StatusCode::SUCCESS;
111 for (std::vector<AFPSiClusterLayerBasicObj>& station : my_layers)
113 layer.clearHitsAndClusters();
115 return StatusCode::SUCCESS;
124 return StatusCode::SUCCESS;
128 if(!siHitContainer.
isValid()) {
131 return StatusCode::SUCCESS;
135 ATH_MSG_DEBUG(
"AFPSiClusterTool::fillLayersWithHits(), successfully got siHitContainer, there are "<<siHitContainer->size()<<
" hits");
142 for(
const auto *
const theHit : *siHitContainer)
143 my_layers.at(theHit->stationID()).at(theHit->pixelLayerID()).hits().push_back(theHit);
145 catch (
const std::out_of_range& outOfRange) {
146 ATH_MSG_WARNING(
"Hit with station or pixel ID outside expected range. Aborting pixels clustering.");
148 return StatusCode::FAILURE;
152 return StatusCode::SUCCESS;
157 for (std::vector<AFPSiClusterLayerBasicObj>& station : my_layers)
161 return StatusCode::SUCCESS;
164StatusCode
AFPSiClusterTool::saveToXAOD(std::unique_ptr<xAOD::AFPSiHitsClusterContainer>& clusterContainer, std::vector< std::vector<AFPSiClusterLayerBasicObj> > &my_layers,
const EventContext &ctx)
const
169 return StatusCode::SUCCESS;
176 return StatusCode::SUCCESS;
181 nlohmann::json dataLA, dataGA;
182 bool dataLA_init{
false}, dataGA_init{
false};
184 for (std::vector<AFPSiClusterLayerBasicObj>& station : my_layers)
186 if(layer.clusters().empty())
continue;
188 const int stationID = layer.stationID();
189 const int layerID = layer.layerID();
222 return StatusCode::SUCCESS;
#define ATH_MSG_WARNING(x)
#define CHECK(...)
Evaluate an expression and check for errors.
Class representing basic silicon pixels cluster, designed to be used for creating the clusters.
Class representing basic silicon layer with pixels and their clusters to be used for creating the clu...
Class storing information about alignment.
ElementLink implementation for ROOT usage.
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
void addHitLink(const AFPHitLink_t &newHit)
Add a link to a pixel in this cluster.
int pixelLayerID() const
Index of the silicon layer with the cluster.
int nHits() const
Number of fired pixels (hits) in cluster.
float zLocal() const
Cluster position along Z axis in station local coordinate system.
float xLocal() const
Cluster position along X axis in station local coordinate system.
float yLocal() const
Cluster position along Y axis in station local coordinate system.
AFPSiHitsCluster_v1 AFPSiHitsCluster