24 map<DTWireId, PSimHitContainer> hitWireMapResult;
26 for (PSimHitContainer::const_iterator simhit =
simhits.begin(); simhit !=
simhits.end(); simhit++) {
27 hitWireMapResult[
DTWireId((*simhit).detUnitId())].push_back(*simhit);
30 return hitWireMapResult;
35 const map<DTWireId, PSimHitContainer> &simHitWireMap) {
36 map<DTWireId, const PSimHit *>
ret;
38 for (map<DTWireId, PSimHitContainer>::const_iterator wireAndSimHit = simHitWireMap.begin();
39 wireAndSimHit != simHitWireMap.end();
42 if (muHit !=
nullptr) {
43 ret[(*wireAndSimHit).first] = (muHit);
53 vector<const PSimHit *> muHits;
56 for (PSimHitContainer::const_iterator
hit =
hits.begin();
hit !=
hits.end();
hit++) {
57 if (
abs((*hit).particleType()) == 13)
58 muHits.push_back(&(*
hit));
63 else if (muHits.size() > 1)
65 cout <<
"[DTHitQualityUtils]***WARNING: # muSimHits in a wire = " << muHits.size() << endl;
67 return (muHits.front());
73 const map<DTWireId, const PSimHit *> &mapWireAndMuSimHit) {
78 const PSimHit *inSimHit =
nullptr;
79 const PSimHit *outSimHit =
nullptr;
81 for (map<DTWireId, const PSimHit *>::const_iterator wireAndMuSimHit = mapWireAndMuSimHit.begin();
82 wireAndMuSimHit != mapWireAndMuSimHit.end();
84 const DTWireId wireId = (*wireAndMuSimHit).first;
85 const PSimHit *theMuHit = (*wireAndMuSimHit).second;
87 int sl = ((wireId.
layerId()).superlayerId()).superLayer();
88 int layer = (wireId.
layerId()).layer();
91 if (layer > outLayer) {
102 if (layer < inLayer) {
114 if (inSimHit !=
nullptr) {
116 cout <<
"Innermost SimHit on SL: " << inSL <<
" layer: " << inLayer << endl;
118 cout <<
"[DTHitQualityUtils]***Error: No Innermost SimHit found!!!" << endl;
122 if (outSimHit !=
nullptr) {
124 cout <<
"Outermost SimHit on SL: " << outSL <<
" layer: " << outLayer << endl;
126 cout <<
"[DTHitQualityUtils]***Error: No Outermost SimHit found!!!" << endl;
135 return make_pair(inSimHit, outSimHit);
142 const pair<const PSimHit *, const PSimHit *> &inAndOutSimHit,
const DetId detId,
const DTGeometry *muonGeom) {
145 const PSimHit *innermostMuSimHit = inAndOutSimHit.first;
146 const PSimHit *outermostMuSimHit = inAndOutSimHit.second;
154 simHitDirection = -simHitDirection.
unit();
159 outLocalPos + simHitDirection * (-outLocalPos.
z() / (simHitDirection.
mag() *
cos(simHitDirection.
theta())));
161 return make_pair(simHitDirection, simSegLocalPosition);
169 return make_pair(atan(direction.
x() / direction.
z()), atan(direction.
y() / direction.
z()));
176 double sigma2Angle = 1 / (1 + XdivZ * XdivZ);
177 sigma2Angle *= sigma2Angle * sigma2TanAngle;