10 verboseSimTrack_ =
simTrack.getParameter<
int>(
"verbose");
20 iEvent.getByToken(simTrackInput_, simTracksH_);
21 iEvent.getByToken(simVertexInput_, simVerticesH_);
22 iEvent.getByToken(simHitInput_, simHitsH_);
27 simTracks_ = *simTracksH_.product();
28 simVertices_ = *simVerticesH_.product();
29 simHits_ = *simHitsH_.product();
33 trkid_to_index_.clear();
34 for (
const auto&
t : simTracks_) {
35 trkid_to_index_[
t.trackId()] = no;
39 track_ids_ = getIdsOfSimTrackShower(
track.trackId(), simTracks_, simVertices_);
40 if (verboseSimTrack_) {
41 edm::LogInfo(
"MuonSimHitMatcher") <<
"Printing track_ids" << std::endl;
42 for (
const auto&
id : track_ids_)
43 edm::LogInfo(
"MuonSimHitMatcher") <<
"id: " <<
id << std::endl;
50 vector<unsigned int>
result;
51 result.push_back(initial_trk_id);
56 for (
const auto&
t : simTracks_) {
59 bool is_child =
false;
63 if (simVertices_[last_trk.
vertIndex()].noParent())
66 unsigned parentId = simVertices_[last_trk.
vertIndex()].parentIndex();
67 if (parentId == initial_trk_id) {
72 const auto&
association = trkid_to_index_.find(parentId);
88 if (detid_to_hits_.find(detid) == detid_to_hits_.end())
90 return detid_to_hits_.at(detid);
94 if (chamber_to_hits_.find(detid) == chamber_to_hits_.end())
96 return chamber_to_hits_.at(detid);
100 if (sim_hits.empty())
103 float sumx, sumy, sumz;
104 sumx = sumy = sumz = 0.f;
106 for (
const auto&
h : sim_hits) {
108 const GlobalPoint&
gp = geometry_->idToDet(
h.detUnitId())->surface().toGlobal(lp);
120 if (sim_hits.empty())
123 float sumx, sumy, sumz;
124 sumx = sumy = sumz = 0.f;
126 for (
const auto&
h : sim_hits) {
128 const GlobalVector& gv = geometry_->idToDet(
h.detUnitId())->surface().toGlobal(lv);
141 trkid_to_index_.clear();
143 detid_to_hits_.clear();
144 chamber_to_hits_.clear();