36 void getSimTrackId(std::vector<UniqueSimTrackId>& simTrkId,
40 auto isearch = simLinks->find(detId);
41 if (isearch != simLinks->end()) {
45 if (channel == it->channel()) {
77 : sipixelSimLinksToken_(
79 sistripSimLinksToken_(
81 siphase2OTSimLinksToken_(
89 trackingParticleToken_(
91 throwOnMissingCollections_(
cfg.getParameter<
bool>(
"throwOnMissingCollections")) {
92 produces<ClusterTPAssociation>();
105 desc.add<
bool>(
"throwOnMissingCollections",
true);
106 descriptions.
add(
"tpClusterProducerDefault",
desc);
127 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
136 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
145 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
154 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
159 auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH);
162 std::unordered_map<UniqueSimTrackId, TrackingParticleRef, UniqueSimTrackIdHash>
mapping;
163 auto const& tpColl = *TPCollectionH.
product();
166 auto const& trackingParticle = tpColl[itp];
170 for (
auto const& trk : trackingParticle.g4Tracks()) {
173 mapping.insert(std::make_pair(trkid, trackingParticleRef));
177 std::unordered_set<UniqueSimTrackId, UniqueSimTrackIdHash> simTkIds;
178 std::vector<UniqueSimTrackId> trkid;
179 if (foundPixelClusters) {
185 uint32_t detid = iter->id();
197 getSimTrackId<PixelDigiSimLink>(trkid, sipixelSimLinks, detId, channel);
198 simTkIds.insert(trkid.begin(), trkid.end());
201 for (
auto iset = simTkIds.begin(); iset != simTkIds.end(); iset++) {
202 auto ipos =
mapping.find(*iset);
212 if (foundStripClusters) {
219 if (!(*iter).isValid())
221 uint32_t detid = iter->id();
232 for (
int istr =
first; istr <
last; ++istr) {
234 getSimTrackId<StripDigiSimLink>(trkid, sistripSimLinks, detId, istr);
235 simTkIds.insert(trkid.begin(), trkid.end());
237 for (
auto iset = simTkIds.begin(); iset != simTkIds.end(); iset++) {
238 auto ipos =
mapping.find(*iset);
248 if (foundPhase2OTClusters) {
256 if (!(*iter).isValid())
258 uint32_t detid = iter->id();
269 for (
unsigned int istr(0); istr < cluster.
size(); ++istr) {
272 getSimTrackId<PixelDigiSimLink>(trkid, siphase2OTSimLinks, detId, channel);
273 simTkIds.insert(trkid.begin(), trkid.end());
276 for (
auto iset = simTkIds.begin(); iset != simTkIds.end(); iset++) {
277 auto ipos =
mapping.find(*iset);
286 clusterTPList->sortAndUnique();
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
uint16_t firstStrip() const
std::pair< uint32_t, EncodedEventId > UniqueSimTrackId
std::vector< OmniClusterRef > OmniClusterCollection
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > phase2OTClustersToken_
T const * product() const
data_type const * const_iterator
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > siphase2OTSimLinksToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
ClusterTPAssociationProducer(const edm::ParameterSet &)
decltype(auto) emplace_back(Args &&... args)
SiStripCluster const & amplitudes() const
static PackedDigiType pixelToChannel(unsigned int row, unsigned int col)
unsigned int firstRow() const
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleToken_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
unsigned int column() const
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > sipixelSimLinksToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~ClusterTPAssociationProducer() override=default
Pixel cluster – collection of neighboring pixels above threshold.
bool throwOnMissingCollections_
static int pixelToChannel(int row, int col)
std::vector< TrackingParticle > TrackingParticleCollection
collection_type::const_iterator const_iterator
edm::EDGetTokenT< edm::DetSetVector< StripDigiSimLink > > sistripSimLinksToken_