75 int size = clustermap.size();
78 auto clusterIdx = std::make_unique<std::vector<int>>();
79 auto onTrkClusterIdx =
80 std::make_unique<std::vector<int>>(
size, -1);
81 auto onTrkClustersBegin = std::make_unique<std::vector<int>>(
tracks->size(), -1);
82 auto onTrkClustersEnd = std::make_unique<std::vector<int>>(
tracks->size(), -1);
83 auto trackindex = std::make_unique<std::vector<int>>();
84 clusterIdx->reserve(
size);
85 trackindex->reserve(
size);
87 auto trackmulti = std::make_unique<std::vector<unsigned int>>();
88 trackmulti->reserve(
size);
89 auto localtheta = std::make_unique<std::vector<float>>();
90 localtheta->reserve(
size);
91 auto localphi = std::make_unique<std::vector<float>>();
92 localphi->reserve(
size);
93 auto localpitch = std::make_unique<std::vector<float>>();
94 localpitch->reserve(
size);
95 auto localx = std::make_unique<std::vector<float>>();
96 localx->reserve(
size);
97 auto localy = std::make_unique<std::vector<float>>();
98 localy->reserve(
size);
99 auto localz = std::make_unique<std::vector<float>>();
100 localz->reserve(
size);
101 auto strip = std::make_unique<std::vector<float>>();
103 auto globaltheta = std::make_unique<std::vector<float>>();
104 globaltheta->reserve(
size);
105 auto globalphi = std::make_unique<std::vector<float>>();
106 globalphi->reserve(
size);
107 auto globalx = std::make_unique<std::vector<float>>();
108 globalx->reserve(
size);
109 auto globaly = std::make_unique<std::vector<float>>();
110 globaly->reserve(
size);
111 auto globalz = std::make_unique<std::vector<float>>();
112 globalz->reserve(
size);
113 auto insidistance = std::make_unique<std::vector<float>>();
114 insidistance->reserve(
size);
115 auto projwidth = std::make_unique<std::vector<float>>();
116 projwidth->reserve(
size);
117 auto BdotY = std::make_unique<std::vector<float>>();
118 BdotY->reserve(
size);
119 auto covered = std::make_unique<std::vector<float>>();
120 covered->reserve(
size);
121 auto rhlocalx = std::make_unique<std::vector<float>>();
122 rhlocalx->reserve(
size);
123 auto rhlocaly = std::make_unique<std::vector<float>>();
124 rhlocaly->reserve(
size);
125 auto rhlocalxerr = std::make_unique<std::vector<float>>();
126 rhlocalxerr->reserve(
size);
127 auto rhlocalyerr = std::make_unique<std::vector<float>>();
128 rhlocalyerr->reserve(
size);
129 auto rhglobalx = std::make_unique<std::vector<float>>();
130 rhglobalx->reserve(
size);
131 auto rhglobaly = std::make_unique<std::vector<float>>();
132 rhglobaly->reserve(
size);
133 auto rhglobalz = std::make_unique<std::vector<float>>();
134 rhglobalz->reserve(
size);
135 auto rhstrip = std::make_unique<std::vector<float>>();
136 rhstrip->reserve(
size);
137 auto rhmerr = std::make_unique<std::vector<float>>();
138 rhmerr->reserve(
size);
139 auto ubstrip = std::make_unique<std::vector<float>>();
140 ubstrip->reserve(
size);
141 auto ubmerr = std::make_unique<std::vector<float>>();
142 ubmerr->reserve(
size);
143 auto driftx = std::make_unique<std::vector<float>>();
144 driftx->reserve(
size);
145 auto drifty = std::make_unique<std::vector<float>>();
146 drifty->reserve(
size);
147 auto driftz = std::make_unique<std::vector<float>>();
148 driftz->reserve(
size);
149 auto globalZofunitlocalY = std::make_unique<std::vector<float>>();
150 globalZofunitlocalY->reserve(
size);
161 size_t ontrk_cluster_idx = 0;
162 std::map<size_t, std::vector<size_t>>
mapping;
170 size_t trk_strt_idx = ontrk_cluster_idx;
175 combiner(measurement.forwardPredictedState(), measurement.backwardPredictedState());
182 for (
unsigned h = 0;
h < 2;
h++) {
184 if (!matchedhit &&
h == 1)
186 else if (matchedhit &&
h == 0)
188 else if (matchedhit &&
h == 1)
191 cluster_ptr = (hit2D->
cluster()).
get();
193 cluster_ptr = (hit1D->
cluster()).
get();
197 shallow::CLUSTERMAP::const_iterator cluster =
198 clustermap.find(std::make_pair(
hit->geographicalId().rawId(), cluster_ptr->
firstStrip()));
199 if (cluster == clustermap.end())
200 throw cms::Exception(
"Logic Error") <<
"Cluster not found: this could be a configuration error" << std::endl;
202 unsigned i = cluster->second;
205 auto already_visited =
mapping.find(
i);
206 int nassociations = 1;
207 if (already_visited !=
mapping.end()) {
208 nassociations += already_visited->second.size();
209 for (
size_t idx : already_visited->second) {
210 trackmulti->at(
idx)++;
212 already_visited->second.push_back(ontrk_cluster_idx);
214 std::vector<size_t>
single = {ontrk_cluster_idx};
222 if (nassociations == 1)
223 onTrkClusterIdx->at(
i) = ontrk_cluster_idx;
224 clusterIdx->push_back(
i);
225 trackmulti->push_back(nassociations);
226 trackindex->push_back(trk_idx);
229 localpitch->push_back(
240 insidistance->push_back(1. / fabs(
cos(localtheta->at(ontrk_cluster_idx))));
241 projwidth->push_back(
tan(localtheta->at(ontrk_cluster_idx)) *
cos(localphi->at(ontrk_cluster_idx)));
243 covered->push_back(
drift.
z() / localpitch->at(ontrk_cluster_idx) *
244 fabs(projwidth->at(ontrk_cluster_idx) -
drift.
x() /
drift.
z()));
245 rhlocalx->push_back(
hit->localPosition().
x());
246 rhlocaly->push_back(
hit->localPosition().
y());
247 rhlocalxerr->push_back(
sqrt(
hit->localPositionError().xx()));
248 rhlocalyerr->push_back(
sqrt(
hit->localPositionError().yy()));
249 rhglobalx->push_back(theStripDet->
toGlobal(
hit->localPosition()).
x());
250 rhglobaly->push_back(theStripDet->
toGlobal(
hit->localPosition()).
y());
251 rhglobalz->push_back(theStripDet->
toGlobal(
hit->localPosition()).
z());
253 rhmerr->push_back(
sqrt(
259 driftx->push_back(
drift.
x());
260 drifty->push_back(
drift.
y());
261 driftz->push_back(
drift.
z());
268 onTrkClustersBegin->at(trk_idx) = trk_strt_idx;
269 onTrkClustersEnd->at(trk_idx) = ontrk_cluster_idx;
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusters_token_
uint16_t firstStrip() const
friend struct const_iterator
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
int findTrackIndex(const edm::Handle< edm::View< reco::Track > > &h, const reco::Track *t)
Geom::Phi< T > phi() const
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
ClusterRef cluster() const
int single(int argc, char *argv[])
virtual float strip(const LocalPoint &) const =0
DataContainer const & measurements() const
GlobalPoint globalPosition() const
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
SiStripCluster const & monoCluster() const
Cos< T >::type cos(const T &t)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
Tan< T >::type tan(const T &t)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const TrackerGeomDet * idToDet(DetId) const override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const edm::EDGetTokenT< TrajTrackAssociationCollection > association_token_
const Plane & surface() const
The nominal surface of the GeomDet.
auto const & tracks
cannot be loose
const PositionType & position() const
GlobalVector globalDirection() const
const edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleDepRcd > laToken_
SiStripCluster const & stereoCluster() const
CLUSTERMAP make_cluster_map(const edm::Event &, const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > &)
std::map< std::pair< uint32_t, uint16_t >, unsigned int > CLUSTERMAP
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
ClusterRef cluster() const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Geom::Theta< T > theta() const