47 uint32_t channel)
const;
71 cfg.getParameter<
edm::InputTag>(
"phase2OTClusterSrc"))),
75 produces<ClusterTPAssociation>();
90 desc.
add<
bool>(
"throwOnMissingCollections",
true);
91 descriptions.
add(
"tpClusterProducerDefault", desc);
112 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
121 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
130 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
139 auto clusterTPList = std::make_unique<ClusterTPAssociation>();
144 auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH);
154 for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin();
155 itrk != trackingParticle->g4Track_end();
157 std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(),
eid);
159 mapping.insert(std::make_pair(trkid, trackingParticle));
163 if (foundPixelClusters) {
165 clusterTPList->addKeyID(pixelClusters.
id());
167 iter != pixelClusters->end();
169 uint32_t detid = iter->id();
176 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
180 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(
181 getSimTrackId<PixelDigiSimLink>(sipixelSimLinks, detId, channel));
184 simTkIds.insert(trkid.begin(), trkid.end());
187 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
188 iset != simTkIds.end();
190 auto ipos = mapping.find(*iset);
191 if (ipos != mapping.end()) {
200 if (foundStripClusters) {
202 clusterTPList->addKeyID(stripClusters.
id());
204 eter = stripClusters->end(
false);
207 if (!(*iter).isValid())
209 uint32_t detid = iter->id();
216 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
220 for (
int istr = first; istr <
last; ++istr) {
221 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(
222 getSimTrackId<StripDigiSimLink>(sistripSimLinks, detId, istr));
225 simTkIds.insert(trkid.begin(), trkid.end());
227 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
228 iset != simTkIds.end();
230 auto ipos = mapping.find(*iset);
231 if (ipos != mapping.end()) {
240 if (foundPhase2OTClusters) {
242 clusterTPList->addKeyID(phase2OTClusters.
id());
243 if (phase2OTClusters.
isValid()) {
245 eter = phase2OTClusters->end(
false);
248 if (!(*iter).isValid())
250 uint32_t detid = iter->id();
259 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
261 for (
unsigned int istr(0); istr < cluster.
size(); ++istr) {
263 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(
264 getSimTrackId<PixelDigiSimLink>(siphase2OTSimLinks, detId, channel));
267 simTkIds.insert(trkid.begin(), trkid.end());
270 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
271 iset != simTkIds.end();
273 auto ipos = mapping.find(*iset);
274 if (ipos != mapping.end()) {
282 clusterTPList->sortAndUnique();
286 template <
typename T>
287 std::vector<std::pair<uint32_t, EncodedEventId> >
291 uint32_t channel)
const {
293 std::vector<std::pair<uint32_t, EncodedEventId> > simTrkId;
294 auto isearch = simLinks->find(detId);
295 if (isearch != simLinks->end()) {
299 if (channel == it->channel()) {
300 simTrkId.
push_back(std::make_pair(it->SimTrackId(), it->eventId()));
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
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)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void push_back(const T &t)
std::vector< TrackingParticle > TrackingParticleCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edmNew::DetSetVector< Phase2TrackerCluster1D > > phase2OTClustersToken_
uint16_t firstStrip() const
data_type const * const_iterator
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > siphase2OTSimLinksToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
unsigned int firstRow() const
#define DEFINE_FWK_MODULE(type)
ClusterTPAssociationProducer(const edm::ParameterSet &)
std::vector< OmniClusterRef > OmniClusterCollection
unsigned int column() const
static PackedDigiType pixelToChannel(unsigned int row, unsigned int col)
~ClusterTPAssociationProducer() override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleToken_
T const * product() const
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > sipixelSimLinksToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Pixel cluster – collection of neighboring pixels above threshold.
bool throwOnMissingCollections_
static int pixelToChannel(int row, int col)
std::vector< std::pair< uint32_t, EncodedEventId > > getSimTrackId(const edm::Handle< edm::DetSetVector< T > > &simLinks, const DetId &detId, uint32_t channel) const
collection_type::const_iterator const_iterator
edm::EDGetTokenT< edm::DetSetVector< StripDigiSimLink > > sistripSimLinksToken_
const std::vector< uint8_t > & amplitudes() const