44 std::vector<std::pair<uint32_t, EncodedEventId> >
55 : sipixelSimLinksToken_(consumes<edm::DetSetVector<
PixelDigiSimLink> >(cfg.getParameter<edm::
InputTag>(
"pixelSimLinkSrc"))),
56 sistripSimLinksToken_(consumes<edm::DetSetVector<
StripDigiSimLink> >(cfg.getParameter<edm::
InputTag>(
"stripSimLinkSrc"))),
57 pixelClustersToken_(consumes<edmNew::DetSetVector<
SiPixelCluster> >(cfg.getParameter<edm::
InputTag>(
"pixelClusterSrc"))),
58 stripClustersToken_(consumes<edmNew::DetSetVector<
SiStripCluster> >(cfg.getParameter<edm::
InputTag>(
"stripClusterSrc"))),
61 produces<ClusterTPAssociation>();
75 descriptions.
add(
"tpClusterProducer", desc);
101 auto clusterTPList = std::make_unique<ClusterTPAssociation>(TPCollectionH);
106 itp < TPCollectionH.
product()->size(); ++itp) {
112 for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin();
113 itrk != trackingParticle->g4Track_end(); ++itrk) {
114 std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(), eid);
116 mapping.insert(std::make_pair(trkid, trackingParticle));
120 if ( foundPixelClusters ) {
123 iter != pixelClusters->end(); ++iter) {
124 uint32_t detid = iter->id();
128 di != link_pixel.
end(); ++di) {
133 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
137 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackId<PixelDigiSimLink>(sipixelSimLinks, detId, channel));
138 if (trkid.size()==0)
continue;
139 simTkIds.insert(trkid.begin(),trkid.end());
142 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
143 iset != simTkIds.end(); iset++) {
144 auto ipos = mapping.find(*iset);
145 if (ipos != mapping.end()) {
154 if ( foundStripClusters ) {
157 iter != eter; ++iter) {
158 if (!(*iter).isValid())
continue;
159 uint32_t detid = iter->id();
163 di != link_strip.
end(); di++) {
168 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
172 for (
int istr = first; istr <
last; ++istr) {
173 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackId<StripDigiSimLink>(sistripSimLinks, detId, istr));
174 if (trkid.size()==0)
continue;
175 simTkIds.insert(trkid.begin(),trkid.end());
177 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
178 iset != simTkIds.end(); iset++) {
179 auto ipos = mapping.find(*iset);
180 if (ipos != mapping.end()) {
189 clusterTPList->sort();
193 template <
typename T>
194 std::vector<std::pair<uint32_t, EncodedEventId> >
197 const DetId& detId, uint32_t channel)
const
200 std::vector<std::pair<uint32_t, EncodedEventId> > simTrkId;
201 auto isearch = simLinks->find(detId);
202 if (isearch != simLinks->end()) {
206 it != link_detset.
data.end(); ++it) {
207 if (channel == it->channel()) {
208 simTrkId.
push_back(std::make_pair(it->SimTrackId(), it->eventId()));
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
void push_back(const T &t)
std::vector< TrackingParticle > TrackingParticleCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
uint16_t firstStrip() const
data_type const * const_iterator
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
ClusterTPAssociationProducer(const edm::ParameterSet &)
std::vector< OmniClusterRef > OmniClusterCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
~ClusterTPAssociationProducer()
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