29 : _verbose(cfg.getParameter<bool>(
"verbose")),
30 _pixelSimLinkSrc(cfg.getParameter<edm::InputTag>(
"pixelSimLinkSrc")),
31 _stripSimLinkSrc(cfg.getParameter<edm::InputTag>(
"stripSimLinkSrc")),
32 _pixelClusterSrc(cfg.getParameter<edm::InputTag>(
"pixelClusterSrc")),
33 _stripClusterSrc(cfg.getParameter<edm::InputTag>(
"stripClusterSrc")),
34 _trackingParticleSrc(cfg.getParameter<edm::InputTag>(
"trackingParticleSrc"))
36 produces<ClusterTPAssociationList>();
68 itp < TPCollectionH.
product()->size(); ++itp) {
74 for (std::vector<SimTrack>::const_iterator itrk = trackingParticle->g4Track_begin();
75 itrk != trackingParticle->g4Track_end(); ++itrk) {
76 std::pair<uint32_t, EncodedEventId> trkid(itrk->trackId(), eid);
78 mapping.insert(std::make_pair(trkid, trackingParticle));
84 iter != pixelClusters->end(); ++iter)
86 uint32_t
detid = iter->id();
90 di != link_pixel.
end(); ++di)
96 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
100 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackId<PixelDigiSimLink>(sipixelSimLinks, detId, channel));
101 if (trkid.size()==0)
continue;
102 simTkIds.insert(trkid.begin(),trkid.end());
105 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
106 iset != simTkIds.end(); iset++) {
107 auto ipos = mapping.find(*iset);
108 if (ipos != mapping.end()) {
110 clusterTPList->push_back(std::make_pair(
OmniClusterRef(c_ref), ipos->second));
118 iter != stripClusters->end(); ++iter) {
119 uint32_t
detid = iter->id();
123 di != link_strip.
end(); di++) {
128 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
132 for (
int istr = first; istr <
last; ++istr) {
133 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackId<StripDigiSimLink>(sistripSimLinks, detId, istr));
134 if (trkid.size()==0)
continue;
135 simTkIds.insert(trkid.begin(),trkid.end());
137 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
138 iset != simTkIds.end(); iset++) {
139 auto ipos = mapping.find(*iset);
140 if (ipos != mapping.end()) {
142 clusterTPList->push_back(std::make_pair(
OmniClusterRef(c_ref), ipos->second));
147 iEvent.
put(clusterTPList);
149 template <
typename T>
150 std::vector<std::pair<uint32_t, EncodedEventId> >
153 const DetId& detId, uint32_t channel)
const
156 std::vector<std::pair<uint32_t, EncodedEventId> > simTrkId;
157 auto isearch = simLinks->find(detId);
158 if (isearch != simLinks->end()) {
162 it != link_detset.
data.end(); ++it) {
163 if (channel == it->channel()) {
164 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)
edm::InputTag _pixelClusterSrc
#define DEFINE_FWK_MODULE(type)
uint16_t firstStrip() const
edm::InputTag _stripClusterSrc
data_type const * const_iterator
edm::InputTag _stripSimLinkSrc
ClusterTPAssociationProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::InputTag _pixelSimLinkSrc
~ClusterTPAssociationProducer()
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag _trackingParticleSrc
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
const std::vector< uint8_t > & amplitudes() const
virtual void produce(edm::Event &, const edm::EventSetup &)