24 : _verbose(cfg.getParameter<bool>(
"verbose")),
25 _pixelSimLinkSrc(cfg.getParameter<edm::InputTag>(
"pixelSimLinkSrc")),
26 _stripSimLinkSrc(cfg.getParameter<edm::InputTag>(
"stripSimLinkSrc")),
27 _pixelClusterSrc(cfg.getParameter<edm::InputTag>(
"pixelClusterSrc")),
28 _stripClusterSrc(cfg.getParameter<edm::InputTag>(
"stripClusterSrc")),
29 _trackingParticleSrc(cfg.getParameter<edm::InputTag>(
"trackingParticleSrc"))
38 produces<ClusterTPAssociationList>();
72 itp < TPCollectionH.
product()->size(); ++itp) {
78 for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin();
79 itrk != trackingParticle->g4Track_end(); ++itrk) {
80 std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(), eid);
82 mapping.insert(std::make_pair(trkid, trackingParticle));
88 iter != pixelClusters->end(); ++
iter)
94 di != link_pixel.
end(); ++di)
100 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
104 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackId<PixelDigiSimLink>(sipixelSimLinks, detId, channel));
105 if (trkid.size()==0)
continue;
106 simTkIds.insert(trkid.begin(),trkid.end());
109 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
110 iset != simTkIds.end(); iset++) {
111 auto ipos = mapping.find(*iset);
112 if (ipos != mapping.end()) {
114 clusterTPList->push_back(std::make_pair(
OmniClusterRef(c_ref), ipos->second));
120 if ( foundStripClusters ) {
124 if (!(*iter).isValid())
continue;
129 di != link_strip.
end(); di++) {
134 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
138 for (
int istr = first; istr <
last; ++istr) {
139 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackId<StripDigiSimLink>(sistripSimLinks, detId, istr));
140 if (trkid.size()==0)
continue;
141 simTkIds.insert(trkid.begin(),trkid.end());
143 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
144 iset != simTkIds.end(); iset++) {
145 auto ipos = mapping.find(*iset);
146 if (ipos != mapping.end()) {
148 clusterTPList->push_back(std::make_pair(
OmniClusterRef(c_ref), ipos->second));
154 iEvent.
put(clusterTPList);
156 template <
typename T>
157 std::vector<std::pair<uint32_t, EncodedEventId> >
160 const DetId& detId, uint32_t channel)
const
163 std::vector<std::pair<uint32_t, EncodedEventId> > simTrkId;
164 auto isearch = simLinks->find(detId);
165 if (isearch != simLinks->end()) {
169 it != link_detset.
data.end(); ++it) {
170 if (channel == it->channel()) {
171 simTrkId.
push_back(std::make_pair(it->SimTrackId(), it->eventId()));
T getParameter(std::string const &) const
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)
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_
ClusterTPAssociationProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
~ClusterTPAssociationProducer()
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleToken_
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > sipixelSimLinksToken_
std::vector< std::pair< OmniClusterRef, TrackingParticleRef > > ClusterTPAssociationList
T const * product() const
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
virtual void produce(edm::Event &, const edm::EventSetup &)