57 #include <boost/range.hpp>
58 #include <boost/foreach.hpp>
59 #include "boost/multi_array.hpp"
125 track(aTrack),
state(aState) {}
131 template<
typename Cluster>
172 return test.
cluster == toFind_ || equalClusters<Cluster>(*test.
cluster, *toFind_);
182 template<
typename Cluster>
188 template<
typename Cluster>
189 std::auto_ptr<edmNew::DetSetVector<Cluster> >
190 splitClusters(
const std::map<uint32_t,
194 template<
typename Cluster>
213 void TrackClusterSplitter::splitCluster<SiPixelCluster> (
const SiPixelClusterWithTracks &cluster,
222 void TrackClusterSplitter::splitCluster<SiStripCluster> (
const SiStripClusterWithTracks &cluster,
229 #define foreach BOOST_FOREACH
232 stripClusters_(iConfig.getParameter<edm::InputTag>(
"stripClusters")),
233 pixelClusters_(iConfig.getParameter<edm::InputTag>(
"pixelClusters")),
234 useTrajectories_(iConfig.getParameter<bool>(
"useTrajectories")),
235 trajectories_(iConfig.getParameter<edm::InputTag>(useTrajectories_ ?
"trajTrackAssociations" :
"tracks")),
236 vertices_(iConfig.getParameter<edm::InputTag>(
"vertices"))
241 produces< edmNew::DetSetVector<SiPixelCluster> >();
243 produces< edmNew::DetSetVector<SiStripCluster> >();
290 if (
typeid(*
hit) ==
typeid(SiStripRecHit2D) )
292 return (static_cast<const SiStripRecHit2D &>(*
hit)).cluster().get();
294 else if (
typeid(*
hit) ==
typeid(SiStripRecHit1D) )
296 return (static_cast<const SiStripRecHit1D &>(*
hit)).cluster().get();
299 throw cms::Exception(
"Unsupported") <<
"Detid of type " <<
typeid(*hit).name() <<
" not supported.\n";
308 return (static_cast<const SiPixelRecHit&>(*
hit)).cluster().get();
311 throw cms::Exception(
"Unsupported") <<
"Detid of type " <<
typeid(*hit).name() <<
" not supported.\n";
376 ed = trajectories->end(); it != ed; ++it )
389 size_t i_hit = 0, last_hit = tms.size()-1;
391 bool first =
true, reversed =
false;
393 for (; it_hit != ed_hit; ++it_hit, ++i_hit)
397 if ((*it_hit)->geographicalId().rawId() == 0)
407 if ((*it_hit)->geographicalId() == tms[i_hit].recHit()->hit()->geographicalId())
411 else if ((*it_hit)->geographicalId() == tms[last_hit-i_hit].recHit()->hit()->geographicalId())
417 throw cms::Exception(
"Aargh") <<
"DetIDs don't match either way :-( \n";
422 if ( hit == 0 || !hit->
isValid() )
429 markClusters<SiStripCluster>(
siStripDetsWithClusters, hit, tk, tms[reversed ? last_hit-i_hit : i_hit].updatedState());
431 else if (subdet >= 1)
433 markClusters<SiPixelCluster>(
siPixelDetsWithClusters, hit, tk, tms[reversed ? last_hit-i_hit : i_hit].updatedState());
437 edm::LogWarning(
"HitNotFound") <<
"Hit of type " <<
typeid(*hit).name() <<
", detid "
454 for (; it_hit != ed_hit; ++it_hit)
457 if ( hit == 0 || !hit->
isValid() )
478 else if (subdet >= 1)
484 edm::LogWarning(
"HitNotFound") <<
"Hit of type " <<
typeid(*hit).name() <<
", detid "
509 iEvent.
put(newPixelClusters);
510 iEvent.
put(newStripClusters);
517 template<
typename Cluster>
525 typedef typename std::vector<ClusterWithTracks<Cluster> >::iterator
IT;
528 if ( match != range.end() )
534 edm::LogWarning(
"ClusterNotFound") <<
"Cluster of type " <<
typeid(Cluster).
name() <<
" on detid "
539 template<
typename Cluster>
540 std::auto_ptr<edmNew::DetSetVector<Cluster> >
545 typedef std::pair<uint32_t, boost::sub_range<std::vector<ClusterWithTracks<Cluster> > > > pair;
547 foreach(
const pair &
p,
input)
553 edm::LogError(
"MissingDetId") <<
"DetIDs " << p.first <<
" is not in geometry.\n";
574 template<
typename Cluster>
593 bool cluster_was_successfully_split =
false;
597 std::vector<SimHitIdpr> associatedIdpr;
601 size_t splittableClusterSize = 0;
602 splittableClusterSize = associatedIdpr.size();
603 std::vector<uint8_t> amp = clust->
amplitudes();
604 int clusiz = amp.size();
605 associatedIdpr.clear();
611 if ( ( splittableClusterSize > 1 && amp.size() > 2 ) &&
621 int last = first + clusiz;
622 uint16_t rawAmpl = 0, currentAmpl = 0;
624 std::vector<uint16_t> tmp1, tmp2;
626 std::vector<int> firstStrip;
627 std::vector<bool> trackInStrip;
628 std::vector<unsigned int> trackID;
629 std::vector<float> trackFraction;
630 std::vector< std::vector<uint16_t> > trackAmp;
631 unsigned int currentChannel( 9999 );
632 unsigned int thisTrackID = 0;
639 linkiter != link_detset.
data.end(); linkiter++)
641 if ( (
int)(linkiter->channel()) >= first && (
int)(linkiter->channel()) < last )
643 int stripIdx = (int)linkiter->channel()-
first;
644 rawAmpl = (uint16_t)(amp[stripIdx]);
648 if ( linkiter->channel() != currentChannel )
653 for (
size_t i=0;
i<trackID.size(); ++
i)
655 if ( trackInStrip[
i] )
657 if ( ( thisAmpl=currentAmpl ) < 254 )
658 thisAmpl =
min( uint16_t(253),
max(uint16_t(0), (uint16_t)(currentAmpl*trackFraction[i]+0.5)) );
659 trackAmp[
i].push_back( thisAmpl );
662 trackFraction[
i] = 0;
663 trackInStrip[
i] =
false;
666 currentChannel = linkiter->channel();
667 currentAmpl = rawAmpl;
671 thisTrackID = linkiter->SimTrackId();
674 bool newTrack =
true;
675 int thisTrackIdx = 9999;
677 for (
size_t i=0;
i<trackID.size(); ++
i)
679 if ( trackID[
i] == thisTrackID )
688 trackInStrip.push_back(
false);
689 trackID.push_back(thisTrackID);
690 firstStrip.push_back(currentChannel);
691 std::vector<uint16_t> ampTmp;
692 trackAmp.push_back(ampTmp);
693 trackFraction.push_back(0);
694 thisTrackIdx = trackID.size()-1;
697 trackInStrip[thisTrackIdx] =
true;
698 trackFraction[thisTrackIdx] += linkiter->fraction();
699 currentAmpl = rawAmpl;
707 std::vector<SiStripCluster> newCluster;
711 for (
size_t i=0;
i < trackID.size(); ++
i)
713 if ( trackInStrip[
i] )
715 if ( ( thisAmpl=rawAmpl ) < 254 )
716 thisAmpl =
min(uint16_t(253),
max(uint16_t(0), (uint16_t)(rawAmpl*trackFraction[i]+0.5)));
719 trackAmp[
i].push_back( thisAmpl );
727 trackAmp[i].
end() ) );
732 for (
size_t i=0;
i<newCluster.size(); ++
i )
736 float clusterAmp = 0.0;
737 for (
size_t j=0;
j<trackAmp[
i].size(); ++
j )
738 clusterAmp += (
float)(trackAmp[
i])[
j];
740 if ( clusterAmp > 0.0 && firstStrip[
i] != 9999 && trackAmp[
i].
size() > 0 )
743 output.push_back( newCluster[
i] );
750 cluster_was_successfully_split =
true;
769 if ( !cluster_was_successfully_split )
770 output.push_back( *
c.cluster );
776 bool cluster_was_successfully_split =
false;
780 if ( theStripCluster )
788 if ( (
int)theStripCluster->
amplitudes().size() <= 1 ||
789 ( (int)ssdid.moduleGeometry() != 1 &&
790 (int)ssdid.moduleGeometry() != 2 &&
791 (int)ssdid.moduleGeometry() != 3 &&
792 (int)ssdid.moduleGeometry() != 4 ) )
809 int is_stereo = (int)( ssdid.stereo() );
811 if ( ssdid.moduleGeometry() == 1 )
818 else if ( ssdid.moduleGeometry() == 2 )
822 else if ( ssdid.moduleGeometry() == 3 )
826 else if ( ssdid.moduleGeometry() == 4 )
836 <<
"\nERROR: Wrong strip teplate ID. Should only use templates for IB1, IB2, OB1 and OB2 !!!" <<
"\n\n";
844 float cotalpha_ = -99999.9;
845 float cotbeta_ = -99999.9;
851 float xcenter = theStripCluster->
barycenter();
859 <<
"\nERROR: Wrong stripDet !!! " <<
"\n\n";
876 GlobalPoint gp(gp0.
x()-vtx.x(), gp0.
y()-vtx.y(), gp0.
z()-vtx.z() );
879 float gp_mod =
sqrt( gp.x()*gp.x() + gp.y()*gp.y() + gp.z()*gp.z() );
880 float gpx = gp.x()/gp_mod;
881 float gpy = gp.y()/gp_mod;
882 float gpz = gp.z()/gp_mod;
894 float gv_dot_gvx = gv.
x()*gvx.
x() + gv.
y()*gvx.
y() + gv.
z()*gvx.
z();
895 float gv_dot_gvy = gv.
x()*gvy.
x() + gv.
y()*gvy.
y() + gv.
z()*gvy.
z();
896 float gv_dot_gvz = gv.
x()*gvz.
x() + gv.
y()*gvz.
y() + gv.
z()*gvz.
z();
902 cotalpha_ = gv_dot_gvx / gv_dot_gvz;
903 cotbeta_ = gv_dot_gvy / gv_dot_gvz;
915 std::vector<TrackAndState> vec_tracks_states =
c.tracks;
917 if ( (
int)vec_tracks_states.size() > 0 )
922 int index_max_pt = -99999;
923 float max_pt = -99999.9;
925 for (
int i=0;
i<(int)vec_tracks_states.size(); ++
i )
927 const reco::Track* one_track = vec_tracks_states[
i].track;
929 if ( one_track->
pt() > max_pt )
932 max_pt = one_track->
pt();
944 float locx = localDir.
x();
945 float locy = localDir.
y();
946 float locz = localDir.
z();
951 cotalpha_ = locx/locz;
952 cotbeta_ = locy/locz;
967 float strip_cluster_charge = 0.0;
968 std::vector<float> vec_cluster_charge;
969 vec_cluster_charge.clear();
970 int cluster_size = (int)( (theStripCluster->
amplitudes()).
size() );
972 int cluster_charge = 0;
973 for (
int i=0;
i<cluster_size; ++
i)
975 float current_strip_charge = (float)( (theStripCluster->
amplitudes())[
i] );
977 strip_cluster_charge += current_strip_charge;
978 vec_cluster_charge.push_back( current_strip_charge );
980 cluster_charge +=current_strip_charge;
986 int strip_templQbin_ =
strip_templ_.
qbin( ID, cotalpha_, cotbeta_, strip_cluster_charge );
988 if ( strip_templQbin_ < 0 || strip_templQbin_ > 5 )
995 if ( strip_templQbin_ != 0 )
1008 uint16_t first_strip = theStripCluster->
firstStrip();
1011 float locBy = lbfield.
y();
1014 float stripTemplXrec1_ = -99999.9;
1015 float stripTemplXrec2_ = -99999.9;
1016 float stripTemplSigmaX_ = -99999.9;
1017 float stripTemplProbX_ = -99999.9;
1018 int stripTemplQbin_ = -99999;
1019 float stripTemplProbQ_ = -99999.9;
1039 cotalpha_, cotbeta_,
1070 cluster_was_successfully_split =
true;
1072 std::vector<float> strip_cluster1;
1073 std::vector<float> strip_cluster2;
1075 strip_cluster1.clear();
1076 strip_cluster2.clear();
1081 strip_cluster1.push_back(0.0);
1082 strip_cluster2.push_back(0.0);
1094 vector<SiStripDigi> vecSiStripDigi1;
1095 vecSiStripDigi1.clear();
1096 int strip_cluster1_size = (int)strip_cluster1.size();
1097 for (
int i=2;
i<strip_cluster1_size; ++
i)
1099 if ( strip_cluster1[
i] > 0.0 )
1101 SiStripDigi current_digi1( first_strip +
i-2, strip_cluster1[
i] );
1103 vecSiStripDigi1.push_back( current_digi1 );
1109 vector<SiStripDigi> vecSiStripDigi2;
1110 vecSiStripDigi2.clear();
1111 int strip_cluster2_size = (int)strip_cluster2.size();
1112 for (
int i=2;
i<strip_cluster2_size; ++
i)
1114 if ( strip_cluster2[
i] > 0.0 )
1116 SiStripDigi current_digi2( first_strip +
i-2, strip_cluster2[
i] );
1118 vecSiStripDigi2.push_back( current_digi2 );
1125 std::vector<SiStripDigi>::const_iterator SiStripDigiIterBegin1 = vecSiStripDigi1.begin();
1126 std::vector<SiStripDigi>::const_iterator SiStripDigiIterEnd1 = vecSiStripDigi1.end();
1127 std::pair<std::vector<SiStripDigi>::const_iterator,
1128 std::vector<SiStripDigi>::const_iterator> SiStripDigiRange1
1129 = make_pair(SiStripDigiIterBegin1, SiStripDigiIterEnd1);
1137 std::vector<SiStripDigi>::const_iterator SiStripDigiIterBegin2 = vecSiStripDigi2.begin();
1138 std::vector<SiStripDigi>::const_iterator SiStripDigiIterEnd2 = vecSiStripDigi2.end();
1139 std::pair<std::vector<SiStripDigi>::const_iterator,
1140 std::vector<SiStripDigi>::const_iterator> SiStripDigiRange2
1141 = make_pair(SiStripDigiIterBegin2, SiStripDigiIterEnd2);
1153 if ( SiStripDigiIterBegin1 != SiStripDigiIterEnd1 )
1162 if ( (
int)cl1.amplitudes().size() <= 0 )
1165 <<
"\nERROR: (1) Wrong split cluster of size = " << (int)cl1.amplitudes().size() <<
"\n\n";
1170 if ( SiStripDigiIterBegin2 != SiStripDigiIterEnd2 )
1177 if ( (
int)cl2.amplitudes().size() <= 0 )
1180 <<
"\nERROR: (2) Wrong split cluster of size = " << (int)cl2.amplitudes().size() <<
"\n\n";
1196 if ( !cluster_was_successfully_split )
1197 output.push_back( *
c.cluster );
1203 <<
"\nERROR: This is not a SiStripCluster !!!" <<
"\n\n";
1210 output.push_back( *
c.cluster );
1226 int minPixelRow = (*
c.cluster).minPixelRow();
1227 int maxPixelRow = (*
c.cluster).maxPixelRow();
1228 int minPixelCol = (*
c.cluster).minPixelCol();
1229 int maxPixelCol = (*
c.cluster).maxPixelCol();
1237 std::vector<int> simTrackIdV;
1238 simTrackIdV.clear();
1240 std::vector<SiPixelCluster> splittedCluster;
1241 splittedCluster.clear();
1243 for ( ; linkiter != digiLink.
data.end(); linkiter++)
1249 if ( pixel_coord.first <= maxPixelRow &&
1250 pixel_coord.first >= minPixelRow &&
1251 pixel_coord.second <= maxPixelCol &&
1252 pixel_coord.second >= minPixelCol )
1254 bool inStock(
false);
1259 int newPixelCharge(0);
1261 const std::vector<SiPixelCluster::Pixel>& pixvector = (*
c.cluster).pixels();
1263 for(std::vector<SiPixelCluster::Pixel>::const_iterator itPix = pixvector.begin(); itPix != pixvector.end(); itPix++)
1265 if (((
int) itPix->x) == ((int) pixel_coord.first)&&(((int) itPix->y) == ((int) pixel_coord.second)))
1267 newPixelCharge = (int) (linkiter->fraction()*itPix->adc);
1271 if ( newPixelCharge < 2500 )
1276 std::vector<int>::const_iterator sTIter = simTrackIdV.begin();
1278 for ( ; sTIter < simTrackIdV.end(); sTIter++)
1280 if (((*sTIter)== (
int) linkiter->SimTrackId()))
1285 splittedCluster.at(clusVecPos).add(newPixelPos,newPixelCharge);
1295 simTrackIdV.push_back(linkiter->SimTrackId());
1296 splittedCluster.push_back(
SiPixelCluster(newPixelPos,newPixelCharge));
1303 if ( ( ( (
int)simTrackIdV.size() ) == 1 ) || ( *
c.cluster).
size()==1 )
1306 output.push_back(*
c.cluster );
1311 for (std::vector<SiPixelCluster>::const_iterator cIter = splittedCluster.begin(); cIter != splittedCluster.end(); cIter++ )
1313 output.push_back( (*cIter) );
1317 simTrackIdV.clear();
1318 splittedCluster.clear();
1322 bool cluster_was_successfully_split =
false;
1326 if ( thePixelCluster )
1329 if ( (
int)thePixelCluster->
size() <= 1 )
1357 float cotalpha_ = -99999.9;
1358 float cotbeta_ = -99999.9;
1363 float xcenter = thePixelCluster->
x();
1364 float ycenter = thePixelCluster->
y();
1378 GlobalPoint gp(gp0.
x()-vtx.x(), gp0.
y()-vtx.y(), gp0.
z()-vtx.z() );
1381 float gp_mod =
sqrt( gp.x()*gp.x() + gp.y()*gp.y() + gp.z()*gp.z() );
1382 float gpx = gp.x()/gp_mod;
1383 float gpy = gp.y()/gp_mod;
1384 float gpz = gp.z()/gp_mod;
1396 float gv_dot_gvx = gv.
x()*gvx.
x() + gv.
y()*gvx.
y() + gv.
z()*gvx.
z();
1397 float gv_dot_gvy = gv.
x()*gvy.
x() + gv.
y()*gvy.
y() + gv.
z()*gvy.
z();
1398 float gv_dot_gvz = gv.
x()*gvz.
x() + gv.
y()*gvz.
y() + gv.
z()*gvz.
z();
1403 cotalpha_ = gv_dot_gvx / gv_dot_gvz;
1404 cotbeta_ = gv_dot_gvy / gv_dot_gvz;
1416 std::vector<TrackAndState> vec_tracks_states =
c.tracks;
1420 if ( (
int)vec_tracks_states.size() > 0 )
1425 int index_max_pt = -99999;
1426 float max_pt = -99999.9;
1428 for (
int i=0;
i<(int)vec_tracks_states.size(); ++
i )
1430 const reco::Track* one_track = vec_tracks_states[
i].track;
1432 if ( one_track->
pt() > max_pt )
1435 max_pt = one_track->
pt();
1447 float locx = localDir.
x();
1448 float locy = localDir.
y();
1449 float locz = localDir.
z();
1454 cotalpha_ = locx/locz;
1455 cotbeta_ = locy/locz;
1468 int templQbin_ =
templ_.
qbin( ID, cotalpha_, cotbeta_, thePixelCluster->
charge() );
1470 if ( templQbin_ < 0 || templQbin_ > 5 )
1481 if ( templQbin_ != 0 )
1497 const std::vector<SiPixelCluster::Pixel> & pixVec = thePixelCluster->
pixels();
1498 std::vector<SiPixelCluster::Pixel>::const_iterator pixIter = pixVec.begin(), pixEnd = pixVec.end();
1503 boost::multi_array<float, 2> clust_array_2d(boost::extents[cluster_matrix_size_x][cluster_matrix_size_y]);
1510 for ( ; pixIter != pixEnd; ++pixIter )
1512 int irow = int(pixIter->x) - row_offset;
1513 int icol = int(pixIter->y) - col_offset;
1515 if ( irow<cluster_matrix_size_x && icol<cluster_matrix_size_y )
1517 clust_array_2d[irow][icol] = (float)pixIter->adc;
1522 std::vector<bool> ydouble(cluster_matrix_size_y), xdouble(cluster_matrix_size_x);
1537 float templYrec1_ = -99999.9;
1538 float templYrec2_ = -99999.9;
1539 float templSigmaY_ = -99999.9;
1540 float templProbY_ = -99999.9;
1541 float templXrec1_ = -99999.9;
1542 float templXrec2_ = -99999.9;
1543 float templSigmaX_ = -99999.9;
1544 float templProbX_ = -99999.9;
1545 float dchisq = -99999.9;
1546 float templProbQ_ = -99999.9;
1550 cotalpha_, cotbeta_,
1554 templYrec1_, templYrec2_, templSigmaY_, templProbY_,
1555 templXrec1_, templXrec2_, templSigmaX_, templProbX_,
1579 float yrecp1 = -99999.9;
1580 float yrecp2 = -99999.9;
1581 float xrecp1 = -99999.9;
1582 float xrecp2 = -99999.9;
1586 yrecp1 = templYrec1_ + ysize;
1587 yrecp2 = templYrec2_ + ysize;
1591 yrecp1 = templYrec1_ + ysize/2.0;
1592 yrecp2 = templYrec2_ + ysize/2.0;
1597 xrecp1 = templXrec1_ + xsize;
1598 xrecp2 = templXrec2_ + xsize;
1602 xrecp1 = templXrec1_ + xsize/2.0;
1603 xrecp2 = templXrec2_ + xsize/2.0;
1615 template2d1[
j][
i] = 0.0;
1616 template2d2[
j][
i] = 0.0;
1643 template2d1[
j][
i] = 0.0;
1644 template2d2[
j][
i] = 0.0;
1652 cluster_was_successfully_split =
false;
1659 cluster_was_successfully_split =
false;
1665 cluster_was_successfully_split =
true;
1680 cluster1[
j][
i] = template2d1[
j+1][
i+1];
1682 if ( cluster1[
j][
i] < q50 )
1683 cluster1[
j][
i] = 0.0;
1685 cluster2[
j][
i] = template2d2[
j+1][
i+1];
1687 if ( cluster2[
j][
i] < q50 )
1688 cluster2[
j][
i] = 0.0;
1702 bool done_searching =
false;
1703 for (
int i=0;
i<13 && !done_searching; ++
i)
1705 for (
int j=0;
j<21 && !done_searching; ++
j)
1707 if ( cluster1[
i][
j] > 0 )
1711 done_searching =
true;
1716 done_searching =
false;
1717 for (
int i=0;
i<13 && !done_searching; ++
i)
1719 for (
int j=0;
j<21 && !done_searching; ++
j)
1721 if ( cluster2[
i][
j] > 0 )
1725 done_searching =
true;
1742 for (
int i=0;
i<13; ++
i)
1744 for (
int j=0;
j<21; ++
j)
1747 if ( cluster1[
i][
j] > 0.0 && (
i!=i1 ||
j!=j1 ) )
1756 if ( cluster2[
i][
j] > 0.0 && (
i!=i2 ||
j!=j2 ) )
1785 if ( (
int)cl1.
size() <= 0 )
1788 <<
"1) Cluster of size = " << (int)cl1.
size() <<
" !!! " << endl;
1791 if ( (
int)cl2.
size() <= 0 )
1794 <<
"2) Cluster of size = " << (int)cl2.
size() <<
" !!! " << endl;
1800 <<
"1) Cluster of charge = " << (int)cl1.
charge() <<
" !!! " << endl;
1807 <<
"2) Cluster of charge = " << (int)cl2.
charge() <<
" !!!!!!!!!!!!!!!!!!!!!!!!!! " << endl;
1821 if ( !cluster_was_successfully_split )
1828 <<
"This is not a SiPixelCluster !!! " <<
"\n";
1835 output.push_back( *
c.cluster );
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
edm::ESHandle< Propagator > propagator_
bool operator()(const ClusterWithTracks< Cluster > &test) const
static const C * equalClusters(const C &c1, const C &c2)
tuple start
Check for commandline option errors.
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, float &lorywidth, float &lorxwidth)
void setSplitClusterErrorY(float erry)
TrackAndState(const reco::Track *aTrack, TrajectoryStateOnSurface aState)
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
const LocalTrajectoryParameters & localParameters() const
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
#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)
SiStripTemplate strip_templ_
double y() const
y coordinate
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.
edm::InputTag stripClusters_
const Plane & surface() const
The nominal surface of the GeomDet.
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
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
void associateSimpleRecHitCluster(const SiStripCluster *clust, const uint32_t &detID, std::vector< SimHitIdpr > &theSimtrackid, std::vector< PSimHit > &simhit)
bool pushfile(int filenum)
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)
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 produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
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) ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
edm::InputTag pixelClusters_
Detector identifier class for the strip tracker.
void setSplitClusterErrorX(float errx)
std::map< uint32_t, SiStripClustersWithTracks > siStripDetsWithClusters
bool pushfile(int filenum)
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.
const int cluster_matrix_size_y
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
virtual LocalPoint localPosition(float strip) const =0
bool pushfile(int filenum)
const int cluster_matrix_size_x
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
SiPixelTemplate2D templ2D_
tuple size
Write out results.
edm::InputTag trajectories_
const std::vector< uint8_t > & amplitudes() const
const std::vector< Pixel > pixels() const
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
TrackClusterSplitter(const edm::ParameterSet &iConfig)
virtual bool isItBigPixelInY(const int iybin) const =0