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));
86 if ( foundPixelClusters ) {
89 iter != pixelClusters->end(); ++
iter) {
94 di != link_pixel.
end(); ++di) {
99 std::set<std::pair<uint32_t, EncodedEventId> > simTkIds;
103 std::vector<std::pair<uint32_t, EncodedEventId> > trkid(getSimTrackId<PixelDigiSimLink>(sipixelSimLinks, detId, channel));
104 if (trkid.size()==0)
continue;
105 simTkIds.insert(trkid.begin(),trkid.end());
108 for (std::set<std::pair<uint32_t, EncodedEventId> >::const_iterator iset = simTkIds.begin();
109 iset != simTkIds.end(); iset++) {
110 auto ipos = mapping.find(*iset);
111 if (ipos != mapping.end()) {
113 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));
155 iEvent.
put(clusterTPList);
158 template <
typename T>
159 std::vector<std::pair<uint32_t, EncodedEventId> >
162 const DetId& detId, uint32_t channel)
const
165 std::vector<std::pair<uint32_t, EncodedEventId> > simTrkId;
166 auto isearch = simLinks->find(detId);
167 if (isearch != simLinks->end()) {
171 it != link_detset.
data.end(); ++it) {
172 if (channel == it->channel()) {
173 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_
T const * product() const
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > sipixelSimLinksToken_
std::vector< std::pair< OmniClusterRef, TrackingParticleRef > > ClusterTPAssociationList
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 &)