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);
126 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
135 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
144 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
153 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
158 auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH);
161 std::unordered_map<UniqueSimTrackId, TrackingParticleRef, UniqueSimTrackIdHash>
mapping;
162 auto const& tpColl = *TPCollectionH.
product();
165 auto const& trackingParticle = tpColl[itp];
169 for (
auto const& trk : trackingParticle.g4Tracks()) {
172 mapping.insert(std::make_pair(trkid, trackingParticleRef));
176 std::unordered_set<UniqueSimTrackId, UniqueSimTrackIdHash> simTkIds;
177 std::vector<UniqueSimTrackId> trkid;
178 if (foundPixelClusters) {
184 uint32_t detid = iter->id();
196 getSimTrackId<PixelDigiSimLink>(trkid, sipixelSimLinks,
detId, channel);
197 simTkIds.insert(trkid.begin(), trkid.end());
200 for (
auto iset = simTkIds.begin(); iset != simTkIds.end(); iset++) {
201 auto ipos =
mapping.find(*iset);
211 if (foundStripClusters) {
218 if (!(*iter).isValid())
220 uint32_t detid = iter->id();
231 for (
int istr =
first; istr <
last; ++istr) {
233 getSimTrackId<StripDigiSimLink>(trkid, sistripSimLinks,
detId, istr);
234 simTkIds.insert(trkid.begin(), trkid.end());
236 for (
auto iset = simTkIds.begin(); iset != simTkIds.end(); iset++) {
237 auto ipos =
mapping.find(*iset);
247 if (foundPhase2OTClusters) {
255 if (!(*iter).isValid())
257 uint32_t detid = iter->id();
268 for (
unsigned int istr(0); istr < cluster.
size(); ++istr) {
271 getSimTrackId<PixelDigiSimLink>(trkid, siphase2OTSimLinks,
detId, channel);
272 simTkIds.insert(trkid.begin(), trkid.end());
275 for (
auto iset = simTkIds.begin(); iset != simTkIds.end(); iset++) {
276 auto ipos =
mapping.find(*iset);
285 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
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
#define DEFINE_FWK_MODULE(type)
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_