46 std::vector<std::pair<uint32_t, EncodedEventId> >
67 produces<ClusterTPAssociation>();
83 descriptions.
add(
"tpClusterProducerDefault", desc);
116 auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH);
121 itp < TPCollectionH.
product()->size(); ++itp) {
127 for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin();
128 itrk != trackingParticle->g4Track_end(); ++itrk) {
129 std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(),
eid);
131 mapping.insert(std::make_pair(trkid, trackingParticle));
135 if ( foundPixelClusters ) {
137 clusterTPList->addKeyID(pixelClusters.
id());
139 iter != pixelClusters->end(); ++iter) {
140 uint32_t detid = iter->id();
144 di != link_pixel.
end(); ++di) {
149 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
153 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackId<PixelDigiSimLink>(sipixelSimLinks, detId, channel));
154 if (trkid.empty())
continue;
155 simTkIds.insert(trkid.begin(),trkid.end());
158 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
159 iset != simTkIds.end(); iset++) {
160 auto ipos = mapping.find(*iset);
161 if (ipos != mapping.end()) {
170 if ( foundStripClusters ) {
172 clusterTPList->addKeyID(stripClusters.
id());
174 iter != eter; ++iter) {
175 if (!(*iter).isValid())
continue;
176 uint32_t detid = iter->id();
180 di != link_strip.
end(); di++) {
185 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
189 for (
int istr = first; istr <
last; ++istr) {
190 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackId<StripDigiSimLink>(sistripSimLinks, detId, istr));
191 if (trkid.empty())
continue;
192 simTkIds.insert(trkid.begin(),trkid.end());
194 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
195 iset != simTkIds.end(); iset++) {
196 auto ipos = mapping.find(*iset);
197 if (ipos != mapping.end()) {
206 if ( foundPhase2OTClusters ) {
208 clusterTPList->addKeyID(phase2OTClusters.
id());
209 if(phase2OTClusters.
isValid()){
211 iter != eter; ++iter) {
212 if (!(*iter).isValid())
continue;
213 uint32_t detid = iter->id();
217 di != link_phase2.
end(); di++) {
222 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
224 for (
unsigned int istr(0); istr < cluster.
size(); ++istr) {
226 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackId<PixelDigiSimLink>(siphase2OTSimLinks, detId, channel));
227 if (trkid.empty())
continue;
228 simTkIds.insert(trkid.begin(),trkid.end());
231 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
232 iset != simTkIds.end(); iset++) {
233 auto ipos = mapping.find(*iset);
234 if (ipos != mapping.end()) {
243 clusterTPList->sortAndUnique();
247 template <
typename T>
248 std::vector<std::pair<uint32_t, EncodedEventId> >
251 const DetId& detId, uint32_t channel)
const 254 std::vector<std::pair<uint32_t, EncodedEventId> > simTrkId;
255 auto isearch = simLinks->find(detId);
256 if (isearch != simLinks->end()) {
260 it != link_detset.
data.end(); ++it) {
261 if (channel == it->channel()) {
262 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.
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