diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index cad86cb..c4434aa 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,3 +1,22 @@ +#[[ +Copyright (c) 2020-2024 Key4hep-Project. + +This file is part of Key4hep. +See https://key4hep.github.io/key4hep-doc/ for further info. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +]] + # ECAL thresholds INSTALL(FILES ECAL_Thresholds_3TeV.root ECAL_Thresholds_10TeV.root DESTINATION ${CMAKE_INSTALL_DATADIR}/k4Reco/data) diff --git a/k4Reco/BIBUtils/README.md b/k4Reco/BIBUtils/README.md index 84d7cad..15fb78e 100644 --- a/k4Reco/BIBUtils/README.md +++ b/k4Reco/BIBUtils/README.md @@ -24,10 +24,12 @@ in the Muon Collider reconstruction. They were originally Marlin processors: | Gaudi algorithm | Original Marlin processor | Original package | |-------------------|---------------------------|------------------| | `FilterConeHits` | `FilterConeHits` | [MarlinTrkProcessors](https://github.com/MuonColliderSoft/MarlinTrkProcessors) | +| `SplitCollectionByPolarAngle` | `SplitCollectionByPolarAngle` | [MarlinTrkProcessors](https://github.com/MuonColliderSoft/MarlinTrkProcessors) | +| `SplitCollectionByLayer` | `SplitCollectionByLayer` | [MarlinTrkProcessors](https://github.com/MuonColliderSoft/MarlinTrkProcessors) | | `CaloConer` | `CaloConer` | [MyBIBUtils](https://github.com/madbaron/MyBIBUtils) | | `CaloHitSelector` | `CaloHitSelector` | [MyBIBUtils](https://github.com/madbaron/MyBIBUtils) | -All three are functional `k4FWCore::MultiTransformer`s. Selected hits are written +All of them are functional `k4FWCore::MultiTransformer`s. Selected hits are written to **subset** collections that reference the original hits, accompanied by a freshly built reco-to-sim link collection. The simulated hit of a given reconstructed hit is resolved through the input link collection rather than by @@ -63,6 +65,53 @@ collection (vertex/inner/outer × barrel/endcap), as in the original steering. | `FillHistograms` | `false` | fill diagnostic histograms | | `TrackerOuterRadius` | `1500` | tracker barrel outer radius used to clip the helix [mm] | +## SplitCollectionByPolarAngle + +Keeps the tracker hits whose polar angle `theta = acos(z/r)` lies inside the +window `[PolarAngleLowerLimit, PolarAngleUpperLimit]` (given in degrees). Unlike +`FilterConeHits` this selection is purely geometric and needs neither the MC +particles nor the detector field, so no `GeoSvc` is required. + +Each instance handles a single tracker collection — configure one instance per +collection, as in the original steering. + +| Property | Default | Description | +|---|---|---| +| `TrackerHitInputCollections` | `VBTrackerHits` | input reco tracker hits | +| `TrackerHitInputRelations` | `VBTrackerHitsRelations` | input reco→sim links | +| `TrackerHitOutputCollections` | `VBTrackerHitsSplit` | output reco hits (subset) | +| `TrackerSimHitOutputCollections` | `VertexBarrelCollectionSplit` | output sim hits (subset) | +| `TrackerHitOutputRelations` | `VBTrackerHitsRelationsSplit` | output reco→sim links | +| `PolarAngleLowerLimit` | `50` | lower limit on the hit polar angle [deg] | +| `PolarAngleUpperLimit` | `130` | upper limit on the hit polar angle [deg] | +| `FillHistograms` | `false` | fill diagnostic histograms | + +## SplitCollectionByLayer + +Splits a single tracker-hit collection into several output collections according +to the `layer` number decoded from each hit's cellID (via the `GeoSvc` and the +`GlobalTrackerReadoutID` encoding). Output collection `i` collects the hits whose +layer lies in the closed interval `[StartLayers[i], EndLayers[i]]`; a hit is +copied into every output whose interval contains its layer, so overlapping +intervals duplicate the hit, as in the original processor. The number of output +collections is arbitrary and follows the length of `OutputCollections`, which +must match `StartLayers` and `EndLayers`. + +Two differences from the Marlin processor: it targets `edm4hep::TrackerHitPlane` +collections (the original dispatched on the LCIO hit type at run time), and it +always writes every configured output collection (the `KeepEmptyCollections` +switch has no equivalent in the functional data flow, where the output handles +are fixed). + +| Property | Default | Description | +|---|---|---| +| `InputCollection` | `VBTrackerHits` | input reco tracker hits | +| `OutputCollections` | `[VBTrackerHitsInner, VBTrackerHitsOuter]` | output reco hits, one subset collection per entry | +| `StartLayers` | `[]` | first layer (inclusive) routed to each output collection | +| `EndLayers` | `[]` | last layer (inclusive) routed to each output collection | +| `EncodingStringParameterName` | `GlobalTrackerReadoutID` | DD4hep constant with the tracker cellID encoding | +| `GeoSvcName` | `GeoSvc` | name of the GeoSvc instance | + ## CaloConer Keeps the calorimeter hits within a fixed angular cone (`ConeWidth`, in radians) diff --git a/k4Reco/BIBUtils/include/SplitCollectionByLayer.h b/k4Reco/BIBUtils/include/SplitCollectionByLayer.h new file mode 100644 index 0000000..974a187 --- /dev/null +++ b/k4Reco/BIBUtils/include/SplitCollectionByLayer.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2020-2024 Key4hep-Project. + * + * This file is part of Key4hep. + * See https://key4hep.github.io/key4hep-doc/ for further info. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef K4RECO_SPLITCOLLECTIONBYLAYER_H +#define K4RECO_SPLITCOLLECTIONBYLAYER_H 1 + +#include "Gaudi/Property.h" + +#include + +#include +#include + +#include + +#include +#include + +/** === SplitCollectionByLayer === + * Splits a single tracker-hit collection into several output collections + * according to the layer number decoded from each hit's cellID. Every output + * collection i collects the hits whose layer lies in the closed interval + * [StartLayers[i], EndLayers[i]]; a hit is copied into every output whose + * interval contains its layer, so overlapping intervals duplicate the hit as + * in the original processor. The outputs are subset collections referencing + * the original hits. + * + * Gaudi-native port of the Marlin SplitCollectionByLayer processor from + * MarlinTrkProcessors (MuonColliderSoft). The original processor dispatched on + * the LCIO hit type at run time; this port targets edm4hep::TrackerHitPlane + * collections, consistent with the other BIBUtils tracker algorithms. The + * number of output collections is arbitrary and follows the length of the + * OutputCollections list, which must match StartLayers and EndLayers. + * + * @author F. Gaede, DESY (original Marlin processor) + */ +struct SplitCollectionByLayer final : k4FWCore::Transformer( + const edm4hep::TrackerHitPlaneCollection&)> { + SplitCollectionByLayer(const std::string& name, ISvcLocator* svcLoc); + + StatusCode initialize() override; + + std::vector + operator()(const edm4hep::TrackerHitPlaneCollection& trackerHits) const override; + +private: + Gaudi::Property> m_startLayers{ + this, "StartLayers", {}, "First layer (inclusive) routed to each output collection"}; + Gaudi::Property> m_endLayers{ + this, "EndLayers", {}, "Last layer (inclusive) routed to each output collection"}; + Gaudi::Property m_encodingStringVariable{ + this, "EncodingStringParameterName", "GlobalTrackerReadoutID", + "The name of the DD4hep constant that contains the cellID encoding string for tracking detectors"}; + Gaudi::Property m_geoSvcName{this, "GeoSvcName", "GeoSvc", "The name of the GeoSvc instance"}; + + SmartIF m_geoSvc; +}; + +#endif diff --git a/k4Reco/BIBUtils/include/SplitCollectionByPolarAngle.h b/k4Reco/BIBUtils/include/SplitCollectionByPolarAngle.h new file mode 100644 index 0000000..5ac203c --- /dev/null +++ b/k4Reco/BIBUtils/include/SplitCollectionByPolarAngle.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2020-2024 Key4hep-Project. + * + * This file is part of Key4hep. + * See https://key4hep.github.io/key4hep-doc/ for further info. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef K4RECO_SPLITCOLLECTIONBYPOLARANGLE_H +#define K4RECO_SPLITCOLLECTIONBYPOLARANGLE_H 1 + +#include "Gaudi/Accumulators/RootHistogram.h" +#include "Gaudi/Property.h" + +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + +#include "GAUDI_VERSION.h" + +#if GAUDI_MAJOR_VERSION < 39 +namespace Gaudi::Accumulators { +template +using StaticRootHistogram = + Gaudi::Accumulators::RootHistogramingCounterBase; +} +#endif + +/** === SplitCollectionByPolarAngle === + * Selects the tracker hits whose polar angle theta = acos(z/r) lies inside the + * configurable window [PolarAngleLowerLimit, PolarAngleUpperLimit] (expressed in + * degrees), together with the corresponding simulated hits and reco-to-sim + * links. The accepted reco and sim hits are written out as subset collections + * and a freshly built link collection connects them. + * + * Gaudi-native port of the Marlin SplitCollectionByPolarAngle processor from + * MarlinTrkProcessors (MuonColliderSoft). Each instance handles a single + * tracker collection; configure one instance per collection. The simulated + * hits are taken from the input reco-to-sim links, so no separate simhit input + * collection is needed. + * + * @author M. Casarsa, INFN Trieste (original Marlin processor) + */ +struct SplitCollectionByPolarAngle final + : k4FWCore::MultiTransformer( + const edm4hep::TrackerHitPlaneCollection&, const edm4hep::TrackerHitSimTrackerHitLinkCollection&)> { + SplitCollectionByPolarAngle(const std::string& name, ISvcLocator* svcLoc); + + StatusCode initialize() override; + + std::tuple + operator()(const edm4hep::TrackerHitPlaneCollection& trackerHits, + const edm4hep::TrackerHitSimTrackerHitLinkCollection& trackerHitLinks) const override; + +private: + Gaudi::Property m_thetaMin{this, "PolarAngleLowerLimit", 50., + "Lower limit on the hit polar angle in degrees"}; + Gaudi::Property m_thetaMax{this, "PolarAngleUpperLimit", 130., + "Upper limit on the hit polar angle in degrees"}; + Gaudi::Property m_fillHistos{this, "FillHistograms", false, "Flag to fill the diagnostic histograms"}; + + enum { hTheta = 0, hSize }; + std::array>, hSize> m_histograms; +}; + +#endif diff --git a/k4Reco/BIBUtils/options/runSplitCollectionByLayer.py b/k4Reco/BIBUtils/options/runSplitCollectionByLayer.py new file mode 100644 index 0000000..202b081 --- /dev/null +++ b/k4Reco/BIBUtils/options/runSplitCollectionByLayer.py @@ -0,0 +1,55 @@ +# +# Copyright (c) 2020-2024 Key4hep-Project. +# +# This file is part of Key4hep. +# See https://key4hep.github.io/key4hep-doc/ for further info. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from Gaudi.Configuration import INFO +from k4FWCore import ApplicationMgr, IOSvc +from Configurables import EventDataSvc +from Configurables import SplitCollectionByLayer +from Configurables import GeoSvc +import os + +geoservice = GeoSvc("GeoSvc") +geoservice.detectors = [ + os.environ["MUONCOLLIDER_GEO"] + if "MUONCOLLIDER_GEO" in os.environ + else os.environ["K4GEO"] + "/MuColl/MuColl_v1/MuColl_v1.xml" +] +geoservice.OutputLevel = INFO +geoservice.EnableGeant4Geo = False + +# The number of output collections is arbitrary and follows the length of +# OutputCollections; StartLayers and EndLayers must have the same length. Each +# output collection i collects the hits whose layer is in [StartLayers[i], +# EndLayers[i]]. +splitter = SplitCollectionByLayer("VBTrackerHitsByLayer") +splitter.InputCollection = ["VBTrackerHits"] +splitter.OutputCollections = ["VBTrackerHitsInner", "VBTrackerHitsOuter"] +splitter.StartLayers = [0, 4] +splitter.EndLayers = [3, 7] + +iosvc = IOSvc() +iosvc.Input = "digi_output.edm4hep.root" +iosvc.Output = "split_by_layer_output.edm4hep.root" + +ApplicationMgr( + TopAlg=[splitter], + EvtSel="NONE", + EvtMax=-1, + ExtSvc=[EventDataSvc("EventDataSvc"), geoservice], + OutputLevel=INFO, +) diff --git a/k4Reco/BIBUtils/options/runSplitCollectionByPolarAngle.py b/k4Reco/BIBUtils/options/runSplitCollectionByPolarAngle.py new file mode 100644 index 0000000..b611f6c --- /dev/null +++ b/k4Reco/BIBUtils/options/runSplitCollectionByPolarAngle.py @@ -0,0 +1,53 @@ +# +# Copyright (c) 2020-2024 Key4hep-Project. +# +# This file is part of Key4hep. +# See https://key4hep.github.io/key4hep-doc/ for further info. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from Gaudi.Configuration import INFO +from k4FWCore import ApplicationMgr, IOSvc +from Configurables import EventDataSvc +from Configurables import SplitCollectionByPolarAngle +from Configurables import RootHistSvc +from Configurables import Gaudi__Histograming__Sink__Root as RootHistoSink + +# One instance per tracker collection. The simulated hits are taken from the +# input reco-to-sim relations, so only the reco hit and relation collections +# are needed as inputs. +splitter = SplitCollectionByPolarAngle("VXDBarrelSplitter") +splitter.TrackerHitInputCollections = ["VBTrackerHits"] +splitter.TrackerHitInputRelations = ["VBTrackerHitsRelations"] +splitter.TrackerHitOutputCollections = ["VBTrackerHitsSplit"] +splitter.TrackerSimHitOutputCollections = ["VertexBarrelCollectionSplit"] +splitter.TrackerHitOutputRelations = ["VBTrackerHitsRelationsSplit"] +splitter.PolarAngleLowerLimit = 50.0 +splitter.PolarAngleUpperLimit = 130.0 +splitter.FillHistograms = False + +iosvc = IOSvc() +iosvc.Input = "digi_output.edm4hep.root" +iosvc.Output = "split_output.edm4hep.root" + +hps = RootHistSvc("HistogramPersistencySvc") +root_hist_svc = RootHistoSink("RootHistoSink") +root_hist_svc.FileName = "splitcollectionbypolarangle_hist.root" + +ApplicationMgr( + TopAlg=[splitter], + EvtSel="NONE", + EvtMax=-1, + ExtSvc=[EventDataSvc("EventDataSvc"), root_hist_svc], + OutputLevel=INFO, +) diff --git a/k4Reco/BIBUtils/src/SplitCollectionByLayer.cc b/k4Reco/BIBUtils/src/SplitCollectionByLayer.cc new file mode 100644 index 0000000..ea1ad39 --- /dev/null +++ b/k4Reco/BIBUtils/src/SplitCollectionByLayer.cc @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2020-2024 Key4hep-Project. + * + * This file is part of Key4hep. + * See https://key4hep.github.io/key4hep-doc/ for further info. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "SplitCollectionByLayer.h" + +#include + +#include +#include +#include + +SplitCollectionByLayer::SplitCollectionByLayer(const std::string& name, ISvcLocator* svcLoc) + : Transformer(name, svcLoc, KeyValues("InputCollection", {"VBTrackerHits"}), + KeyValues("OutputCollections", {"VBTrackerHitsInner", "VBTrackerHitsOuter"})) {} + +StatusCode SplitCollectionByLayer::initialize() { + m_geoSvc = serviceLocator()->service(m_geoSvcName); + if (!m_geoSvc) { + error() << "Unable to retrieve the GeoSvc" << endmsg; + return StatusCode::FAILURE; + } + + // One [start, end] layer interval must be given per output collection. The + // number of output collections itself is enforced by the framework at the + // first event, when the size of the returned vector is matched against the + // OutputCollections list. + if (m_startLayers.empty() || m_startLayers.size() != m_endLayers.size()) { + error() << "StartLayers (" << m_startLayers.size() << ") and EndLayers (" << m_endLayers.size() + << ") must be non-empty and have one entry per output collection" << endmsg; + return StatusCode::FAILURE; + } + + for (std::size_t i = 0; i < m_startLayers.size(); ++i) { + if (m_startLayers[i] > m_endLayers[i]) { + error() << "Output collection " << i << " has StartLayer " << m_startLayers[i] << " > EndLayer " << m_endLayers[i] + << endmsg; + return StatusCode::FAILURE; + } + info() << "Output collection " << i << " will collect layers [" << m_startLayers[i] << ", " << m_endLayers[i] << "]" + << endmsg; + } + + return StatusCode::SUCCESS; +} + +std::vector +SplitCollectionByLayer::operator()(const edm4hep::TrackerHitPlaneCollection& trackerHits) const { + const std::string encoderString = m_geoSvc->constantAsString(m_encodingStringVariable.value()); + const dd4hep::DDSegmentation::BitFieldCoder bitFieldCoder(encoderString); + + const std::size_t nOutputs = m_startLayers.size(); + std::vector outColls(nOutputs); + for (auto& coll : outColls) { + coll.setSubsetCollection(); + } + + for (const auto& hit : trackerHits) { + const int layer = bitFieldCoder.get(hit.getCellID(), "layer"); + for (std::size_t i = 0; i < nOutputs; ++i) { + if (layer >= m_startLayers[i] && layer <= m_endLayers[i]) { + outColls[i].push_back(hit); + } + } + } + + if (msgLevel(MSG::DEBUG)) { + for (std::size_t i = 0; i < nOutputs; ++i) { + debug() << outColls[i].size() << " hits routed to output collection " << i << endmsg; + } + } + + return outColls; +} + +DECLARE_COMPONENT(SplitCollectionByLayer) diff --git a/k4Reco/BIBUtils/src/SplitCollectionByPolarAngle.cc b/k4Reco/BIBUtils/src/SplitCollectionByPolarAngle.cc new file mode 100644 index 0000000..a4baf04 --- /dev/null +++ b/k4Reco/BIBUtils/src/SplitCollectionByPolarAngle.cc @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2020-2024 Key4hep-Project. + * + * This file is part of Key4hep. + * See https://key4hep.github.io/key4hep-doc/ for further info. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "SplitCollectionByPolarAngle.h" + +#include "BIBUtilsHelpers.h" + +#include + +#include +#include +#include +#include + +using k4reco::bibutils::objectKey; + +SplitCollectionByPolarAngle::SplitCollectionByPolarAngle(const std::string& name, ISvcLocator* svcLoc) + : MultiTransformer(name, svcLoc, + {KeyValues("TrackerHitInputCollections", {"VBTrackerHits"}), + KeyValues("TrackerHitInputRelations", {"VBTrackerHitsRelations"})}, + {KeyValues("TrackerHitOutputCollections", {"VBTrackerHitsSplit"}), + KeyValues("TrackerSimHitOutputCollections", {"VertexBarrelCollectionSplit"}), + KeyValues("TrackerHitOutputRelations", {"VBTrackerHitsRelationsSplit"})}) {} + +StatusCode SplitCollectionByPolarAngle::initialize() { + m_histograms[hTheta].reset(new Gaudi::Accumulators::StaticRootHistogram<1>{ + this, "theta", "polar angle of the hit;#theta [rad]", {1000, 0., M_PI}}); + + return StatusCode::SUCCESS; +} + +std::tuple +SplitCollectionByPolarAngle::operator()(const edm4hep::TrackerHitPlaneCollection& trackerHits, + const edm4hep::TrackerHitSimTrackerHitLinkCollection& trackerHitLinks) const { + edm4hep::TrackerHitPlaneCollection outHits; + outHits.setSubsetCollection(); + edm4hep::SimTrackerHitCollection outSimHits; + outSimHits.setSubsetCollection(); + edm4hep::TrackerHitSimTrackerHitLinkCollection outLinks; + + // Map each reconstructed hit to its simulated hit through the input links. + std::unordered_map hitToSim; + hitToSim.reserve(trackerHitLinks.size()); + for (const auto& link : trackerHitLinks) { + hitToSim.emplace(objectKey(link.getFrom().getObjectID()), link.getTo()); + } + + std::size_t nKept = 0; + + for (const auto& hit : trackerHits) { + const auto& pos = hit.getPosition(); + + // Polar angle theta = acos(z / r) of the hit, in radians. + const double posMod = std::sqrt(pos.x * pos.x + pos.y * pos.y + pos.z * pos.z); + if (posMod == 0.) { + continue; + } + const double hitTheta = std::acos(pos.z / posMod); + const double hitThetaDeg = hitTheta * 180. / M_PI; + + if (hitThetaDeg < m_thetaMin || hitThetaDeg > m_thetaMax) { + continue; + } + + if (m_fillHistos) { + ++(*m_histograms[hTheta])[hitTheta]; + } + + const auto simIt = hitToSim.find(objectKey(hit.getObjectID())); + if (simIt == hitToSim.end()) { + continue; + } + + outHits.push_back(hit); + outSimHits.push_back(simIt->second); + auto link = outLinks.create(); + link.setFrom(hit); + link.setTo(simIt->second); + link.setWeight(1.0); + ++nKept; + } + + debug() << nKept << " / " << trackerHits.size() << " tracker hits kept within the polar-angle window" << endmsg; + + return std::make_tuple(std::move(outHits), std::move(outSimHits), std::move(outLinks)); +} + +DECLARE_COMPONENT(SplitCollectionByPolarAngle) diff --git a/k4Reco/CMakeLists.txt b/k4Reco/CMakeLists.txt index 3ab46e9..a93a711 100644 --- a/k4Reco/CMakeLists.txt +++ b/k4Reco/CMakeLists.txt @@ -31,6 +31,8 @@ set(sources BIBUtils/src/CaloConer.cpp BIBUtils/src/CaloHitSelector.cpp BIBUtils/src/FilterConeHits.cpp + BIBUtils/src/SplitCollectionByPolarAngle.cc + BIBUtils/src/SplitCollectionByLayer.cc ) if(DEFINED FASTJETPLUGINS_LIBRARY)