56 #include <boost/range.hpp>
57 #include <boost/foreach.hpp>
58 #include "boost/multi_array.hpp"
128 track(aTrack), state(aState) {}
134 template<
typename Cluster>
175 return test.
cluster == toFind_ || equalClusters<Cluster>(*test.
cluster, *toFind_);
185 template<
typename Cluster>
191 template<
typename Cluster>
192 std::auto_ptr<edmNew::DetSetVector<Cluster> >
193 splitClusters(
const std::map<uint32_t,
197 template<
typename Cluster>
216 void TrackClusterSplitter::splitCluster<SiPixelCluster> (
const SiPixelClusterWithTracks &cluster,
225 void TrackClusterSplitter::splitCluster<SiStripCluster> (
const SiStripClusterWithTracks &cluster,
232 #define foreach BOOST_FOREACH
235 useTrajectories_(iConfig.getParameter<bool>(
"useTrajectories"))
248 produces< edmNew::DetSetVector<SiPixelCluster> >();
250 produces< edmNew::DetSetVector<SiStripCluster> >();
303 if (
typeid(*
hit) ==
typeid(SiStripRecHit2D) )
305 return (static_cast<const SiStripRecHit2D &>(*
hit)).cluster().get();
307 else if (
typeid(*
hit) ==
typeid(SiStripRecHit1D) )
309 return (static_cast<const SiStripRecHit1D &>(*
hit)).cluster().get();
312 throw cms::Exception(
"Unsupported") <<
"Detid of type " <<
typeid(*hit).name() <<
" not supported.\n";
321 return (static_cast<const SiPixelRecHit&>(*
hit)).cluster().get();
324 throw cms::Exception(
"Unsupported") <<
"Detid of type " <<
typeid(*hit).name() <<
" not supported.\n";
389 ed = trajectories->end(); it != ed; ++it )
402 size_t i_hit = 0, last_hit = tms.size()-1;
404 bool first =
true, reversed =
false;
406 for (; it_hit != ed_hit; ++it_hit, ++i_hit)
410 if ((*it_hit)->geographicalId().rawId() == 0)
420 if ((*it_hit)->geographicalId() == tms[i_hit].recHit()->hit()->geographicalId())
424 else if ((*it_hit)->geographicalId() == tms[last_hit-i_hit].recHit()->hit()->geographicalId())
430 throw cms::Exception(
"Aargh") <<
"DetIDs don't match either way :-( \n";
435 if ( hit == 0 || !hit->
isValid() )
442 markClusters<SiStripCluster>(
siStripDetsWithClusters, hit, tk, tms[reversed ? last_hit-i_hit : i_hit].updatedState());
444 else if (subdet >= 1)
446 markClusters<SiPixelCluster>(
siPixelDetsWithClusters, hit, tk, tms[reversed ? last_hit-i_hit : i_hit].updatedState());
450 edm::LogWarning(
"HitNotFound") <<
"Hit of type " <<
typeid(*hit).name() <<
", detid "
467 for (; it_hit != ed_hit; ++it_hit)
470 if ( hit == 0 || !hit->
isValid() )
491 else if (subdet >= 1)
497 edm::LogWarning(
"HitNotFound") <<
"Hit of type " <<
typeid(*hit).name() <<
", detid "
522 iEvent.
put(newPixelClusters);
523 iEvent.
put(newStripClusters);
530 template<
typename Cluster>
538 typedef typename std::vector<ClusterWithTracks<Cluster> >::iterator
IT;
541 if ( match != range.end() )
547 edm::LogWarning(
"ClusterNotFound") <<
"Cluster of type " <<
typeid(Cluster).
name() <<
" on detid "
552 template<
typename Cluster>
553 std::auto_ptr<edmNew::DetSetVector<Cluster> >
558 typedef std::pair<uint32_t, boost::sub_range<std::vector<ClusterWithTracks<Cluster> > > > pair;
560 foreach(
const pair &
p,
input)
566 edm::LogError(
"MissingDetId") <<
"DetIDs " << p.first <<
" is not in geometry.\n";
587 template<
typename Cluster>
606 bool cluster_was_successfully_split =
false;
610 std::vector<SimHitIdpr> associatedIdpr;
614 size_t splittableClusterSize = 0;
615 splittableClusterSize = associatedIdpr.size();
616 std::vector<uint8_t> amp = clust->
amplitudes();
617 int clusiz = amp.size();
618 associatedIdpr.clear();
624 if ( ( splittableClusterSize > 1 && amp.size() > 2 ) &&
634 int last = first + clusiz;
635 uint16_t rawAmpl = 0, currentAmpl = 0;
637 std::vector<uint16_t> tmp1, tmp2;
639 std::vector<int> firstStrip;
640 std::vector<bool> trackInStrip;
641 std::vector<unsigned int> trackID;
642 std::vector<float> trackFraction;
643 std::vector< std::vector<uint16_t> > trackAmp;
644 unsigned int currentChannel( 9999 );
645 unsigned int thisTrackID = 0;
652 linkiter != link_detset.
data.end(); linkiter++)
654 if ( (
int)(linkiter->channel()) >= first && (
int)(linkiter->channel()) < last )
656 int stripIdx = (int)linkiter->channel()-
first;
657 rawAmpl = (uint16_t)(amp[stripIdx]);
661 if ( linkiter->channel() != currentChannel )
666 for (
size_t i=0;
i<trackID.size(); ++
i)
668 if ( trackInStrip[
i] )
670 if ( ( thisAmpl=currentAmpl ) < 254 )
671 thisAmpl =
min( uint16_t(253),
max(uint16_t(0), (uint16_t)(currentAmpl*trackFraction[i]+0.5)) );
672 trackAmp[
i].push_back( thisAmpl );
675 trackFraction[
i] = 0;
676 trackInStrip[
i] =
false;
679 currentChannel = linkiter->channel();
680 currentAmpl = rawAmpl;
684 thisTrackID = linkiter->SimTrackId();
687 bool newTrack =
true;
688 int thisTrackIdx = 9999;
690 for (
size_t i=0;
i<trackID.size(); ++
i)
692 if ( trackID[
i] == thisTrackID )
701 trackInStrip.push_back(
false);
702 trackID.push_back(thisTrackID);
703 firstStrip.push_back(currentChannel);
704 std::vector<uint16_t> ampTmp;
705 trackAmp.push_back(ampTmp);
706 trackFraction.push_back(0);
707 thisTrackIdx = trackID.size()-1;
710 trackInStrip[thisTrackIdx] =
true;
711 trackFraction[thisTrackIdx] += linkiter->fraction();
712 currentAmpl = rawAmpl;
720 std::vector<SiStripCluster> newCluster;
724 for (
size_t i=0;
i < trackID.size(); ++
i)
726 if ( trackInStrip[
i] )
728 if ( ( thisAmpl=rawAmpl ) < 254 )
729 thisAmpl =
min(uint16_t(253),
max(uint16_t(0), (uint16_t)(rawAmpl*trackFraction[i]+0.5)));
732 trackAmp[
i].push_back( thisAmpl );
740 trackAmp[i].
end() ) );
745 for (
size_t i=0;
i<newCluster.size(); ++
i )
749 float clusterAmp = 0.0;
750 for (
size_t j=0;
j<trackAmp[
i].size(); ++
j )
751 clusterAmp += (
float)(trackAmp[
i])[
j];
753 if ( clusterAmp > 0.0 && firstStrip[
i] != 9999 && trackAmp[
i].
size() > 0 )
756 output.push_back( newCluster[
i] );
763 cluster_was_successfully_split =
true;
782 if ( !cluster_was_successfully_split )
783 output.push_back( *
c.cluster );
789 bool cluster_was_successfully_split =
false;
793 if ( theStripCluster )
801 if ( (
int)theStripCluster->
amplitudes().size() <= 1 ||
802 ( (int)ssdid.moduleGeometry() != 1 &&
803 (int)ssdid.moduleGeometry() != 2 &&
804 (int)ssdid.moduleGeometry() != 3 &&
805 (int)ssdid.moduleGeometry() != 4 ) )
822 int is_stereo = (int)( ssdid.stereo() );
824 if ( ssdid.moduleGeometry() == 1 )
831 else if ( ssdid.moduleGeometry() == 2 )
835 else if ( ssdid.moduleGeometry() == 3 )
839 else if ( ssdid.moduleGeometry() == 4 )
849 <<
"\nERROR: Wrong strip teplate ID. Should only use templates for IB1, IB2, OB1 and OB2 !!!" <<
"\n\n";
857 float cotalpha_ = -99999.9;
858 float cotbeta_ = -99999.9;
864 float xcenter = theStripCluster->
barycenter();
872 <<
"\nERROR: Wrong stripDet !!! " <<
"\n\n";
889 GlobalPoint gp(gp0.
x()-vtx.x(), gp0.
y()-vtx.y(), gp0.
z()-vtx.z() );
892 float gp_mod =
sqrt( gp.x()*gp.x() + gp.y()*gp.y() + gp.z()*gp.z() );
893 float gpx = gp.x()/gp_mod;
894 float gpy = gp.y()/gp_mod;
895 float gpz = gp.z()/gp_mod;
907 float gv_dot_gvx = gv.
x()*gvx.
x() + gv.
y()*gvx.
y() + gv.
z()*gvx.
z();
908 float gv_dot_gvy = gv.
x()*gvy.
x() + gv.
y()*gvy.
y() + gv.
z()*gvy.
z();
909 float gv_dot_gvz = gv.
x()*gvz.
x() + gv.
y()*gvz.
y() + gv.
z()*gvz.
z();
915 cotalpha_ = gv_dot_gvx / gv_dot_gvz;
916 cotbeta_ = gv_dot_gvy / gv_dot_gvz;
928 std::vector<TrackAndState> vec_tracks_states =
c.tracks;
930 if ( (
int)vec_tracks_states.size() > 0 )
935 int index_max_pt = -99999;
936 float max_pt = -99999.9;
938 for (
int i=0;
i<(int)vec_tracks_states.size(); ++
i )
940 const reco::Track* one_track = vec_tracks_states[
i].track;
942 if ( one_track->
pt() > max_pt )
945 max_pt = one_track->
pt();
957 float locx = localDir.
x();
958 float locy = localDir.
y();
959 float locz = localDir.
z();
964 cotalpha_ = locx/locz;
965 cotbeta_ = locy/locz;
980 float strip_cluster_charge = 0.0;
981 std::vector<float> vec_cluster_charge;
982 vec_cluster_charge.clear();
983 int cluster_size = (int)( (theStripCluster->
amplitudes()).
size() );
985 int cluster_charge = 0;
986 for (
int i=0;
i<cluster_size; ++
i)
988 float current_strip_charge = (float)( (theStripCluster->
amplitudes())[
i] );
990 strip_cluster_charge += current_strip_charge;
991 vec_cluster_charge.push_back( current_strip_charge );
993 cluster_charge +=current_strip_charge;
1000 int strip_templQbin_ = strip_templ_.
qbin( ID, cotalpha_, cotbeta_, strip_cluster_charge );
1002 if ( strip_templQbin_ < 0 || strip_templQbin_ > 5 )
1009 if ( strip_templQbin_ != 0 )
1022 uint16_t first_strip = theStripCluster->
firstStrip();
1025 float locBy = lbfield.
y();
1028 float stripTemplXrec1_ = -99999.9;
1029 float stripTemplXrec2_ = -99999.9;
1030 float stripTemplSigmaX_ = -99999.9;
1031 float stripTemplProbX_ = -99999.9;
1032 int stripTemplQbin_ = -99999;
1033 float stripTemplProbQ_ = -99999.9;
1053 cotalpha_, cotbeta_,
1066 stripTemplXrec1_ += 2*strip_templ_.
xsize();
1067 stripTemplXrec2_ += 2*strip_templ_.
xsize();
1084 cluster_was_successfully_split =
true;
1086 std::vector<float> strip_cluster1;
1087 std::vector<float> strip_cluster2;
1089 strip_cluster1.clear();
1090 strip_cluster2.clear();
1095 strip_cluster1.push_back(0.0);
1096 strip_cluster2.push_back(0.0);
1102 strip_templ_.
interpolate(ID, cotalpha_, cotbeta_, locBy);
1103 strip_templ_.
sxtemp(stripTemplXrec1_, strip_cluster1);
1104 strip_templ_.
sxtemp(stripTemplXrec2_, strip_cluster2);
1108 vector<SiStripDigi> vecSiStripDigi1;
1109 vecSiStripDigi1.clear();
1110 int strip_cluster1_size = (int)strip_cluster1.size();
1111 for (
int i=2;
i<strip_cluster1_size; ++
i)
1113 if ( strip_cluster1[
i] > 0.0 )
1115 SiStripDigi current_digi1( first_strip +
i-2, strip_cluster1[
i] );
1117 vecSiStripDigi1.push_back( current_digi1 );
1123 vector<SiStripDigi> vecSiStripDigi2;
1124 vecSiStripDigi2.clear();
1125 int strip_cluster2_size = (int)strip_cluster2.size();
1126 for (
int i=2;
i<strip_cluster2_size; ++
i)
1128 if ( strip_cluster2[
i] > 0.0 )
1130 SiStripDigi current_digi2( first_strip +
i-2, strip_cluster2[
i] );
1132 vecSiStripDigi2.push_back( current_digi2 );
1139 std::vector<SiStripDigi>::const_iterator SiStripDigiIterBegin1 = vecSiStripDigi1.begin();
1140 std::vector<SiStripDigi>::const_iterator SiStripDigiIterEnd1 = vecSiStripDigi1.end();
1141 std::pair<std::vector<SiStripDigi>::const_iterator,
1142 std::vector<SiStripDigi>::const_iterator> SiStripDigiRange1
1143 = make_pair(SiStripDigiIterBegin1, SiStripDigiIterEnd1);
1151 std::vector<SiStripDigi>::const_iterator SiStripDigiIterBegin2 = vecSiStripDigi2.begin();
1152 std::vector<SiStripDigi>::const_iterator SiStripDigiIterEnd2 = vecSiStripDigi2.end();
1153 std::pair<std::vector<SiStripDigi>::const_iterator,
1154 std::vector<SiStripDigi>::const_iterator> SiStripDigiRange2
1155 = make_pair(SiStripDigiIterBegin2, SiStripDigiIterEnd2);
1167 if ( SiStripDigiIterBegin1 != SiStripDigiIterEnd1 )
1179 <<
"\nERROR: (1) Wrong split cluster of size = " << (int)cl1.
amplitudes().size() <<
"\n\n";
1184 if ( SiStripDigiIterBegin2 != SiStripDigiIterEnd2 )
1194 <<
"\nERROR: (2) Wrong split cluster of size = " << (int)cl2.
amplitudes().size() <<
"\n\n";
1210 if ( !cluster_was_successfully_split )
1211 output.push_back( *
c.cluster );
1217 <<
"\nERROR: This is not a SiStripCluster !!!" <<
"\n\n";
1224 output.push_back( *
c.cluster );
1240 int minPixelRow = (*
c.cluster).minPixelRow();
1241 int maxPixelRow = (*
c.cluster).maxPixelRow();
1242 int minPixelCol = (*
c.cluster).minPixelCol();
1243 int maxPixelCol = (*
c.cluster).maxPixelCol();
1252 std::vector<int> simTrackIdV;
1253 simTrackIdV.clear();
1255 std::vector<SiPixelCluster> splittedCluster;
1256 splittedCluster.clear();
1258 for ( ; linkiter != digiLink.
data.end(); linkiter++)
1264 if ( pixel_coord.first <= maxPixelRow &&
1265 pixel_coord.first >= minPixelRow &&
1266 pixel_coord.second <= maxPixelCol &&
1267 pixel_coord.second >= minPixelCol )
1269 bool inStock(
false);
1274 int newPixelCharge(0);
1276 const std::vector<SiPixelCluster::Pixel>& pixvector = (*
c.cluster).pixels();
1278 for(std::vector<SiPixelCluster::Pixel>::const_iterator itPix = pixvector.begin(); itPix != pixvector.end(); itPix++)
1280 if (((
int) itPix->x) == ((int) pixel_coord.first)&&(((int) itPix->y) == ((int) pixel_coord.second)))
1282 newPixelCharge = (int) (linkiter->fraction()*itPix->adc);
1286 if ( newPixelCharge < 2500 )
1291 std::vector<int>::const_iterator sTIter = simTrackIdV.begin();
1293 for ( ; sTIter < simTrackIdV.end(); sTIter++)
1295 if (((*sTIter)== (
int) linkiter->SimTrackId()))
1300 splittedCluster.at(clusVecPos).add(newPixelPos,newPixelCharge);
1310 simTrackIdV.push_back(linkiter->SimTrackId());
1311 splittedCluster.push_back(
SiPixelCluster(newPixelPos,newPixelCharge));
1318 if ( ( ( (
int)simTrackIdV.size() ) == 1 ) || ( *
c.cluster).
size()==1 )
1321 output.push_back(*
c.cluster );
1326 for (std::vector<SiPixelCluster>::const_iterator cIter = splittedCluster.begin(); cIter != splittedCluster.end(); cIter++ )
1328 output.push_back( (*cIter) );
1332 simTrackIdV.clear();
1333 splittedCluster.clear();
1338 bool cluster_was_successfully_split =
false;
1342 if ( thePixelCluster )
1345 if ( (
int)thePixelCluster->
size() <= 1 )
1373 float cotalpha_ = -99999.9;
1374 float cotbeta_ = -99999.9;
1379 float xcenter = thePixelCluster->
x();
1380 float ycenter = thePixelCluster->
y();
1394 GlobalPoint gp(gp0.
x()-vtx.x(), gp0.
y()-vtx.y(), gp0.
z()-vtx.z() );
1397 float gp_mod =
sqrt( gp.x()*gp.x() + gp.y()*gp.y() + gp.z()*gp.z() );
1398 float gpx = gp.x()/gp_mod;
1399 float gpy = gp.y()/gp_mod;
1400 float gpz = gp.z()/gp_mod;
1412 float gv_dot_gvx = gv.
x()*gvx.
x() + gv.
y()*gvx.
y() + gv.
z()*gvx.
z();
1413 float gv_dot_gvy = gv.
x()*gvy.
x() + gv.
y()*gvy.
y() + gv.
z()*gvy.
z();
1414 float gv_dot_gvz = gv.
x()*gvz.
x() + gv.
y()*gvz.
y() + gv.
z()*gvz.
z();
1419 cotalpha_ = gv_dot_gvx / gv_dot_gvz;
1420 cotbeta_ = gv_dot_gvy / gv_dot_gvz;
1432 std::vector<TrackAndState> vec_tracks_states =
c.tracks;
1436 if ( (
int)vec_tracks_states.size() > 0 )
1441 int index_max_pt = -99999;
1442 float max_pt = -99999.9;
1444 for (
int i=0;
i<(int)vec_tracks_states.size(); ++
i )
1446 const reco::Track* one_track = vec_tracks_states[
i].track;
1448 if ( one_track->
pt() > max_pt )
1451 max_pt = one_track->
pt();
1463 float locx = localDir.
x();
1464 float locy = localDir.
y();
1465 float locz = localDir.
z();
1470 cotalpha_ = locx/locz;
1471 cotbeta_ = locy/locz;
1486 int templQbin_ = templ_.
qbin( ID, cotalpha_, cotbeta_, thePixelCluster->
charge() );
1488 if ( templQbin_ < 0 || templQbin_ > 5 )
1499 if ( templQbin_ != 0 )
1515 const std::vector<SiPixelCluster::Pixel> & pixVec = thePixelCluster->
pixels();
1516 std::vector<SiPixelCluster::Pixel>::const_iterator pixIter = pixVec.begin(), pixEnd = pixVec.end();
1518 const int cluster_matrix_size_x = 13;
1519 const int cluster_matrix_size_y = 21;
1521 boost::multi_array<float, 2> clust_array_2d(boost::extents[cluster_matrix_size_x][cluster_matrix_size_y]);
1528 for ( ; pixIter != pixEnd; ++pixIter )
1530 int irow = int(pixIter->x) - row_offset;
1531 int icol = int(pixIter->y) - col_offset;
1533 if ( irow<cluster_matrix_size_x && icol<cluster_matrix_size_y )
1535 clust_array_2d[irow][icol] = (float)pixIter->adc;
1540 std::vector<bool> ydouble(cluster_matrix_size_y), xdouble(cluster_matrix_size_x);
1543 for (
int irow = 0; irow < cluster_matrix_size_x; ++irow)
1549 for (
int icol = 0; icol < cluster_matrix_size_y; ++icol)
1555 float templYrec1_ = -99999.9;
1556 float templYrec2_ = -99999.9;
1557 float templSigmaY_ = -99999.9;
1558 float templProbY_ = -99999.9;
1559 float templXrec1_ = -99999.9;
1560 float templXrec2_ = -99999.9;
1561 float templSigmaX_ = -99999.9;
1562 float templProbX_ = -99999.9;
1563 float dchisq = -99999.9;
1564 float templProbQ_ = -99999.9;
1568 cotalpha_, cotbeta_,
1572 templYrec1_, templYrec2_, templSigmaY_, templProbY_,
1573 templXrec1_, templXrec2_, templSigmaX_, templProbX_,
1597 float yrecp1 = -99999.9;
1598 float yrecp2 = -99999.9;
1599 float xrecp1 = -99999.9;
1600 float xrecp2 = -99999.9;
1604 yrecp1 = templYrec1_ +
ysize;
1605 yrecp2 = templYrec2_ +
ysize;
1609 yrecp1 = templYrec1_ + ysize/2.0;
1610 yrecp2 = templYrec2_ + ysize/2.0;
1615 xrecp1 = templXrec1_ +
xsize;
1616 xrecp2 = templXrec2_ +
xsize;
1620 xrecp1 = templXrec1_ + xsize/2.0;
1621 xrecp2 = templXrec2_ + xsize/2.0;
1633 template2d1[
j][
i] = 0.0;
1634 template2d2[
j][
i] = 0.0;
1640 = templ2D_.
xytemp(ID, cotalpha_, cotbeta_,
1647 templ2D_.
xytemp(ID, cotalpha_, cotbeta_,
1661 template2d1[
j][
i] = 0.0;
1662 template2d2[
j][
i] = 0.0;
1670 cluster_was_successfully_split =
false;
1677 cluster_was_successfully_split =
false;
1683 cluster_was_successfully_split =
true;
1688 float q50 = templ_.
s50();
1698 cluster1[
j][
i] = template2d1[
j+1][
i+1];
1700 if ( cluster1[
j][
i] < q50 )
1701 cluster1[
j][
i] = 0.0;
1703 cluster2[
j][
i] = template2d2[
j+1][
i+1];
1705 if ( cluster2[
j][
i] < q50 )
1706 cluster2[
j][
i] = 0.0;
1720 bool done_searching =
false;
1721 for (
int i=0;
i<13 && !done_searching; ++
i)
1723 for (
int j=0;
j<21 && !done_searching; ++
j)
1725 if ( cluster1[
i][
j] > 0 )
1729 done_searching =
true;
1734 done_searching =
false;
1735 for (
int i=0;
i<13 && !done_searching; ++
i)
1737 for (
int j=0;
j<21 && !done_searching; ++
j)
1739 if ( cluster2[
i][
j] > 0 )
1743 done_searching =
true;
1760 for (
int i=0;
i<13; ++
i)
1762 for (
int j=0;
j<21; ++
j)
1765 if ( cluster1[
i][
j] > 0.0 && (
i!=i1 ||
j!=j1 ) )
1774 if ( cluster2[
i][
j] > 0.0 && (
i!=i2 ||
j!=j2 ) )
1803 if ( (
int)cl1.
size() <= 0 )
1806 <<
"1) Cluster of size = " << (int)cl1.
size() <<
" !!! " << endl;
1809 if ( (
int)cl2.
size() <= 0 )
1812 <<
"2) Cluster of size = " << (int)cl2.
size() <<
" !!! " << endl;
1818 <<
"1) Cluster of charge = " << (int)cl1.
charge() <<
" !!! " << endl;
1825 <<
"2) Cluster of charge = " << (int)cl2.
charge() <<
" !!!!!!!!!!!!!!!!!!!!!!!!!! " << endl;
1839 if ( !cluster_was_successfully_split )
1846 <<
"This is not a SiPixelCluster !!! " <<
"\n";
1853 output.push_back( *
c.cluster );
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
edm::ESHandle< Propagator > propagator_
edm::EDGetTokenT< edm::DetSetVector< StripDigiSimLink > > stripdigisimlinkToken
bool operator()(const ClusterWithTracks< Cluster > &test) const
edm::EDGetTokenT< TrajTrackAssociationCollection > trajTrackAssociations_
static const C * equalClusters(const C &c1, const C &c2)
tuple start
Check for commandline option errors.
void setSplitClusterErrorY(float erry)
TrackAndState(const reco::Track *aTrack, TrajectoryStateOnSurface aState)
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
const LocalTrajectoryParameters & localParameters() const
friend struct const_iterator
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
void markClusters(std::map< uint32_t, boost::sub_range< std::vector< ClusterWithTracks< Cluster > > > > &map, const TrackingRecHit *hit, const reco::Track *track, const TrajectoryStateOnSurface &tsos) const
int qbin(int id, float cotalpha, float cotbeta, float locBz, float qclus, float &pixmx, float &sigmay, float &deltay, float &sigmax, float &deltax, float &sy1, float &dy1, float &sy2, float &dy2, float &sx1, float &dx1, float &sx2, float &dx2)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClusters_
void associateSimpleRecHitCluster(const SiStripCluster *clust, const uint32_t &detID, std::vector< SimHitIdpr > &simtrackid) const
#define DEFINE_FWK_MODULE(type)
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
float xsize()
strip x-size (microns)
double y() const
y coordinate
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore2D > &thePixelTemp_)
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore > &thePixelTemp_)
std::vector< SiPixelTemplateStore > thePixelTemp_
std::auto_ptr< edmNew::DetSetVector< Cluster > > splitClusters(const std::map< uint32_t, boost::sub_range< std::vector< ClusterWithTracks< Cluster > > > > &input, const reco::Vertex &vtx) const
uint16_t firstStrip() const
int qbin(int id, float cotalpha, float cotbeta, float qclus)
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > pixeldigisimlink
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
static std::string const input
bool xytemp(int id, float cotalpha, float cotbeta, float locBz, float xhit, float yhit, std::vector< bool > &ydouble, std::vector< bool > &xdouble, float template2d[BXM2][BYM2])
uint32_t rawId() const
get the raw id
std::vector< SiPixelTemplateStore2D > thePixelTemp2D_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClusters_
DataContainer const & measurements() const
edm::ESHandle< MagneticField > magfield_
bool simpletemplate2D(float xhitp, float yhitp, std::vector< bool > &ydouble, std::vector< bool > &xdouble, float template2d[BXM2][BYM2])
Make simple 2-D templates from track angles set in interpolate and hit position.
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
std::vector< TrajectoryMeasurement > DataContainer
const T & max(const T &a, const T &b)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::string propagatorName_
double pt() const
track transverse momentum
int PixelTempSplit(int id, float cotalpha, float cotbeta, array_2d &cluster, std::vector< bool > &ydouble, std::vector< bool > &xdouble, SiPixelTemplate &templ, float &yrec1, float &yrec2, float &sigmay, float &prob2y, float &xrec1, float &xrec2, float &sigmax, float &prob2x, int &q2bin, float &prob2Q, bool resolve, int speed, float &dchisq, bool deadpix, std::vector< std::pair< int, int > > &zeropix, SiPixelTemplate2D &templ2D)
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > pixeldigisimlinkToken
edm::EDGetTokenT< std::vector< reco::Vertex > > vertices_
std::vector< SiPixelClusterWithTracks > allSiPixelClusters
working data
ClusterWithTracks(const Cluster &c)
double z() const
y coordinate
edm::ESHandle< GlobalTrackingGeometry > geometry_
float xsize()
pixel x-size (microns)
void add(const PixelPos &pix, int adc)
LocalVector momentum() const
Momentum vector in the local frame.
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
std::pair< uint32_t, EncodedEventId > SimHitIdpr
std::vector< LinkConnSpec >::const_iterator IT
boost::sub_range< std::vector< SiPixelClusterWithTracks > > SiPixelClustersWithTracks
std::vector< SiStripClusterWithTracks > allSiStripClusters
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
boost::sub_range< std::vector< SiStripClusterWithTracks > > SiStripClustersWithTracks
FindCluster(const TrackingRecHit *hit)
float s50()
1/2 of the pixel threshold signal in electrons
TrackerHitAssociator * hitAssociator
virtual bool isItBigPixelInX(const int ixbin) const =0
edm::Handle< edm::DetSetVector< StripDigiSimLink > > stripdigisimlink
Detector identifier class for the strip tracker.
void setSplitClusterErrorX(float errx)
std::map< uint32_t, SiStripClustersWithTracks > siStripDetsWithClusters
std::vector< SiStripTemplateStore > theStripTemp_
double x() const
x coordinate
void sxtemp(float xhit, std::vector< float > &cluster)
static std::pair< int, int > channelToPixel(int ch)
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
int StripTempSplit(int id, float cotalpha, float cotbeta, float locBy, int speed, std::vector< float > &cluster, SiStripTemplate &templ, float &xrec1, float &xrec2, float &sigmax, float &prob2x, int &q2bin, float &prob2Q)
void setSplitClusterError(float errx)
std::map< uint32_t, SiPixelClustersWithTracks > siPixelDetsWithClusters
Pixel cluster – collection of neighboring pixels above threshold.
std::vector< TrackAndState > tracks
const reco::Track * track
edm::EDGetTokenT< std::vector< reco::Track > > tracks_
virtual LocalPoint localPosition(float strip) const =0
TrajectoryStateOnSurface state
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
DetId geographicalId() const
ModuleGeometry moduleGeometry() const
collection_type::const_iterator const_iterator
void splitCluster(const ClusterWithTracks< Cluster > &cluster, const GlobalVector &dir, typename edmNew::DetSetVector< Cluster >::FastFiller &output, DetId detId) const
collection_type::const_iterator const_iterator
ClusterWithTracks< SiStripCluster > SiStripClusterWithTracks
bool interpolate(int id, float cotalpha, float cotbeta, float locBy)
const PositionType & position() const
float ysize()
pixel y-size (microns)
ClusterWithTracks< SiPixelCluster > SiPixelClusterWithTracks
tuple size
Write out results.
const std::vector< uint8_t > & amplitudes() const
const std::vector< Pixel > pixels() const
static bool pushfile(int filenum, std::vector< SiStripTemplateStore > &theStripTemp_)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
TrackClusterSplitter(const edm::ParameterSet &iConfig)
virtual bool isItBigPixelInY(const int iybin) const =0