57 fastTrackerClusterCollectionTag_(conf.getParameter<edm::InputTag>(
"fastTrackerClusterCollectionTag"))
59 produces<edmNew::DetSetVector<SiStripCluster> >();
60 produces<edmNew::DetSetVector<SiPixelCluster> >();
61 produces<edm::DetSetVector<StripDigiSimLink> >();
62 produces<edm::DetSetVector<PixelDigiSimLink> >();
90 auto pixelcpe = pixelCPE->clone();
91 pixelcpe->clearParameters();
95 auto stripcpe = stripCPE->clone();
98 std::vector<const CrossingFrame<PSimHit> *> cf_simhitvec;
99 e.
getByLabel(
"mix",
"famosSimHitsTrackerHits", cf_simhit);
100 cf_simhitvec.push_back(cf_simhit.
product());
118 std::map< DetId, std::vector<SiPixelCluster> > temporaryPixelClusters;
119 std::map< DetId, std::vector<SiStripCluster> > temporaryStripClusters;
122 stripcpe->clearParameters();
123 pixelcpe->clearParameters();
128 for ( ; aCluster != theLastHit; ++aCluster ) {
132 DetId det = aCluster->id();
133 unsigned int subdet = det.
subdetId();
135 for (std::vector<std::pair<PSimHit,int> >::const_iterator
137 if((aCluster->simtrackId() == (int)(*simcount).first.trackId())&&(det.
rawId() == (*simcount).first.detUnitId())&&(aCluster->eeId() == (*simcount).first.eventId().rawId()))
138 sim_counter = (*simcount).second;
140 if (sim_counter == 0)
throw cms::Exception(
"SiClusterTranslator") <<
"No Matching SimHit found.";
150 int charge = (int)(aCluster->charge() + 0.5);
165 std::pair<float,float> pixelPos_out = topol.
pixel(position);
169 std::pair<int,int> row_col((
int)pixelPos_out.first,(
int)pixelPos_out.second);
170 pixelcpe->enterLocalParameters((
unsigned int) det.
rawId() , row_col, std::make_pair(position,error));
176 temporaryPixelClusters[det].push_back(temporaryPixelCluster);
182 aCluster->simtrackId(),
189 else if ((subdet > 2) && (subdet < 7)) {
195 uint16_t
charge = (uint16_t)(aCluster->charge() + 0.5);
199 uint16_t strip_num = 0;
200 std::vector<uint16_t> digi_vec;
201 while (charge > 255) {
202 digi_vec.push_back(255);
205 if (charge > 0) digi_vec.push_back(charge);
215 if((subdet == 3) || (subdet == 5)) {
216 const RectangularStripTopology& topol=(
const RectangularStripTopology&)stripDet->
type().
topology();
217 strip_num = (uint16_t)topol.strip(position);
218 }
else if ((subdet == 4) || (subdet == 6)) {
220 strip_num = (uint16_t)topol.
strip(position);
224 stripcpe->enterLocalParameters(det.
rawId(), strip_num, std::make_pair(position,error));
227 SiStripCluster temporaryStripCluster(det.
rawId(), strip_num, digi_vec.begin(), digi_vec.end());
228 temporaryStripClusters[det].push_back(temporaryStripCluster);
234 aCluster->simtrackId(),
244 "Trying to build a cluster that is not in the SiStripTracker or Pixels.\n";
252 std::auto_ptr<edmNew::DetSetVector<SiPixelCluster> >
259 std::auto_ptr<edmNew::DetSetVector<SiStripCluster> >
265 e.
put(siPixelClusterCollection);
266 e.
put(siStripClusterCollection);
267 e.
put(stripoutputlink);
268 e.
put(pixeloutputlink);
276 std::map<DetId,std::vector<SiStripCluster> >::const_iterator
277 it = theClusters.begin();
278 std::map<DetId,std::vector<SiStripCluster> >::const_iterator
279 lastDet = theClusters.end();
280 for( ; it != lastDet ; ++it ) {
283 std::vector<SiStripCluster>::const_iterator clust_it = it->second.begin();
284 std::vector<SiStripCluster>::const_iterator clust_end = it->second.end();
285 for( ; clust_it != clust_end ; ++clust_it) {
297 std::map<DetId,std::vector<SiPixelCluster> >::const_iterator
298 it = theClusters.begin();
299 std::map<DetId,std::vector<SiPixelCluster> >::const_iterator
300 lastCluster = theClusters.end();
301 for( ; it != lastCluster ; ++it ) {
304 std::vector<SiPixelCluster>::const_iterator clust_it = it->second.begin();
305 std::vector<SiPixelCluster>::const_iterator clust_end = it->second.end();
306 for( ; clust_it != clust_end ; ++clust_it) {
virtual const Topology & topology() const
Returns a reference to the pixel proxy topology.
void push_back(data_type const &d)
std::vector< edm::DetSet< PixelDigiSimLink > > thePixelDigiLinkVector
const TrackerGeometry * geometry
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
static int position[TOTALCHAMBERS][3]
SiClusterTranslator(const edm::ParameterSet &conf)
uint32_t rawId() const
get the raw id
edm::InputTag fastTrackerClusterCollectionTag_
virtual ~SiClusterTranslator()
virtual std::pair< float, float > pixel(const LocalPoint &p) const =0
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void loadPixelClusters(std::map< DetId, std::vector< SiPixelCluster > > &theClusters, SiPixelClusterCollectionNew &theClusterCollection) const
std::vector< edm::DetSet< StripDigiSimLink > > theStripDigiLinkVector
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual float strip(const LocalPoint &) const =0
virtual const GeomDetType & type() const
std::vector< std::pair< PSimHit, int > > theNewSimHitList
T const * product() const
virtual const Topology & topology() const =0
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Pixel cluster – collection of neighboring pixels above threshold.
static std::atomic< unsigned int > counter
void loadStripClusters(std::map< DetId, std::vector< SiStripCluster > > &theClusters, edmNew::DetSetVector< SiStripCluster > &theClusterCollection) const
static int pixelToChannel(int row, int col)
virtual void beginRun(edm::Run const &run, const edm::EventSetup &es) override