53 std::vector<bool> ontrack (clusterColl->data().size(),
false);
54 std::vector<float> corr_charge(clusterColl->data().size(), -1.0f);
56 for (
auto& item : *ttac) {
57 auto trajectory_ref = item.key;
60 bool isBpixtrack =
false, isFpixtrack =
false, crossesPixVol=
false;
63 double d0 = track_ref->d0(), dz = track_ref->dz();
66 for (
auto& measurement : trajectory_ref->measurements()) {
68 if (!measurement.updatedState().isValid())
continue;
69 auto hit = measurement.recHit();
70 if (!
hit->isValid())
continue;
74 uint32_t subdetid = (
id.subdetId());
79 if (!pixhit)
continue;
83 if (clust.isNull())
continue;
84 ontrack[clust.key()] =
true;
88 measurement.backwardPredictedState());
95 float clust_alpha = atan2(localDir.
z(), localDir.
x());
96 float clust_beta = atan2(localDir.
z(), localDir.
y());
97 double corrCharge = clust->charge() *
sqrt( 1.0 / ( 1.0/
pow(
tan(clust_alpha), 2 ) +
98 1.0/
pow(
tan(clust_beta ), 2 ) +
100 corr_charge[clust.key()] = (float) corrCharge;
105 if (isBpixtrack || isFpixtrack)
113 if (isBpixtrack || isFpixtrack)
121 for (it = clusterColl->begin(); it != clusterColl->end(); ++it) {
122 auto id =
DetId(it->detId());
125 const PixelTopology& topol = geomdetunit->specificTopology();
127 for(
auto subit = it->
begin(); subit != it->
end(); ++subit) {
130 bool is_ontrack = ontrack[
key];
131 float corrected_charge = corr_charge[
key];
135 GlobalPoint clustgp = geomdetunit->surface().toGlobal(clustlp);
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
const_iterator end(bool update=false) const
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
const LocalTrajectoryParameters & localParameters() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Geom::Phi< T > phi() const
SiPixelPhase1TrackClusters(const edm::ParameterSet &conf)
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
edm::EDGetTokenT< TrajTrackAssociationCollection > trackAssociationToken_
void analyze(const edm::Event &, const edm::EventSetup &)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
LocalVector momentum() const
Momentum vector in the local frame.
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
ClusterRef cluster() const
std::vector< HistogramManager > histo
Pixel cluster – collection of neighboring pixels above threshold.
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clustersToken_
Power< A, B >::type pow(const A &a, const B &b)
const_iterator begin(bool update=false) const