9 minBX_ =
gemRecHit.getParameter<
int>(
"minBX");
10 maxBX_ =
gemRecHit.getParameter<
int>(
"maxBX");
11 verbose_ =
gemRecHit.getParameter<
int>(
"verbose");
21 gemDigiMatcher_->init(
iEvent, iSetup);
23 iEvent.getByToken(gemRecHitToken_, gemRecHitH_);
25 gemGeometry_ = &iSetup.
getData(geomToken_);
31 gemDigiMatcher_->match(
t,
v);
42 const auto& det_ids = gemDigiMatcher_->detIdsDigi();
45 for (
auto id : det_ids) {
47 const auto& hit_digis = gemDigiMatcher_->stripNumbersInDetId(
id);
49 cout <<
"hit_digis_fat ";
50 copy(hit_digis.begin(), hit_digis.end(), ostream_iterator<int>(
cout,
" "));
55 const auto& rechits_in_det =
rechits.get(p_id);
57 for (
auto d = rechits_in_det.first;
d != rechits_in_det.second; ++
d) {
59 edm::LogInfo(
"GEMDigiMatcher") <<
"recHit " << p_id <<
" " << *
d << endl;
62 if (
d->BunchX() < minBX_ ||
d->BunchX() > maxBX_)
65 int firstStrip =
d->firstClusterStrip();
66 int cls =
d->clusterSize();
67 bool stripFound =
false;
70 for (
int i = firstStrip;
i < (firstStrip + cls);
i++) {
71 if (hit_digis.find(
i) != hit_digis.end())
81 recHits_.push_back(*
d);
82 detid_to_recHits_[
id].push_back(*
d);
90 std::set<unsigned int>
result;
91 for (
const auto&
p : detid_to_recHits_)
97 std::set<unsigned int>
result;
98 for (
const auto&
p : chamber_to_recHits_)
104 std::set<unsigned int>
result;
105 for (
const auto&
p : superchamber_to_recHits_)
111 if (detid_to_recHits_.find(detid) == detid_to_recHits_.end())
113 return detid_to_recHits_.at(detid);
117 if (chamber_to_recHits_.find(detid) == chamber_to_recHits_.end())
119 return chamber_to_recHits_.at(detid);
123 if (superchamber_to_recHits_.find(detid) == superchamber_to_recHits_.end())
125 return superchamber_to_recHits_.at(detid);
130 for (
const auto&
d : recHitsInSuperChamber(detid)) {
131 layers.insert(
d.gemId().layer());
138 for (
const auto&
d : recHitsInDetId(detid)) {
140 for (
int iStrip =
d.firstClusterStrip(); iStrip <
d.firstClusterStrip() +
d.clusterSize(); ++iStrip) {
150 for (
auto id : detIds()) {
160 return gemGeometry_->idToDet(idd)->surface().toGlobal(lp);
168 float sumx, sumy, sumz;
169 sumx = sumy = sumz = 0.f;
171 for (
const auto&
d : rechit) {
173 if (gp == point_zero)
188 for (
const auto& thisRH :
c)
189 if (areGEMRecHitSame(thisRH, rh))
195 return recHitInContainer(thisRh,
recHits());
199 return l.localPosition() == r.localPosition() and
l.BunchX() == r.BunchX();
LocalPoint localPosition() const override
Return the 3-dimensional local position.
GlobalPoint recHitPosition(const GEMRecHit &rechit) const
bool recHitInContainer(const GEMRecHit &rh, const GEMRecHitContainer &c) const
Global3DPoint GlobalPoint
std::vector< GEMRecHit > GEMRecHitContainer
bool areGEMRecHitSame(const GEMRecHit &l, const GEMRecHit &r) const
std::set< unsigned int > chamberIds() const
std::set< int > partitionNumbers() const
bool isGEMRecHitMatched(const GEMRecHit &thisRh) const
bool getData(T &iHolder) const
void matchRecHitsToSimTrack(const GEMRecHitCollection &recHits)
std::set< int > stripNumbersInDetId(unsigned int) const
const GEMRecHitContainer & recHitsInChamber(unsigned int) const
std::set< unsigned int > detIds() const
Log< level::Info, false > LogInfo
const GEMRecHitContainer & recHitsInDetId(unsigned int) const
GlobalPoint recHitMeanPosition(const GEMRecHitContainer &rechits) const
GEMDetId gemId() const
Return the gemId.
constexpr uint32_t rawId() const
get the raw id
const GEMRecHitContainer & recHitsInSuperChamber(unsigned int) const
GEMRecHitMatcher(edm::ParameterSet const &iPS, edm::ConsumesCollector &&iC)
int nLayersWithRecHitsInSuperChamber(unsigned int) const
constexpr GEMDetId superChamberId() const
constexpr int roll() const
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
constexpr GEMDetId chamberId() const
void match(const SimTrack &t, const SimVertex &v)
do the matching
std::set< unsigned int > superChamberIds() const