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);
37 matchRecHitsToSimTrack(gemRecHits);
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_)
92 result.insert(
p.first);
97 std::set<unsigned int>
result;
98 for (
const auto&
p : chamber_to_recHits_)
99 result.insert(
p.first);
104 std::set<unsigned int>
result;
105 for (
const auto&
p : superchamber_to_recHits_)
106 result.insert(
p.first);
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());
133 return layers.size();
138 for (
const auto&
d : recHitsInDetId(detid)) {
140 for (
int iStrip =
d.firstClusterStrip(); iStrip <
d.firstClusterStrip() +
d.clusterSize(); ++iStrip) {
141 result.insert(iStrip);
150 for (
auto id : detIds()) {
152 result.insert(idd.
roll());
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());
bool areGEMRecHitSame(const GEMRecHit &l, const GEMRecHit &r) const
const GEMRecHitContainer & recHitsInDetId(unsigned int) const
std::set< int > stripNumbersInDetId(unsigned int) const
std::set< unsigned int > chamberIds() const
const edm::EventSetup & c
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
uint16_t *__restrict__ id
LocalPoint localPosition() const override
Return the 3-dimensional local position.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
constexpr int roll() const
GlobalPoint recHitMeanPosition(const GEMRecHitContainer &rechits) const
Global3DPoint GlobalPoint
constexpr uint32_t rawId() const
get the raw id
std::vector< GEMRecHit > GEMRecHitContainer
std::set< unsigned int > detIds() const
bool getData(T &iHolder) const
std::set< unsigned int > superChamberIds() const
static constexpr int verbose
GlobalPoint recHitPosition(const GEMRecHit &rechit) const
constexpr GEMDetId chamberId() const
void matchRecHitsToSimTrack(const GEMRecHitCollection &recHits)
Log< level::Info, false > LogInfo
int nLayersWithRecHitsInSuperChamber(unsigned int) const
ParameterSet const & getParameterSet(std::string const &) const
GEMRecHitMatcher(edm::ParameterSet const &iPS, edm::ConsumesCollector &&iC)
bool isGEMRecHitMatched(const GEMRecHit &thisRh) const
const GEMRecHitContainer & recHitsInSuperChamber(unsigned int) const
const GEMRecHitContainer & recHitsInChamber(unsigned int) const
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
bool recHitInContainer(const GEMRecHit &rh, const GEMRecHitContainer &c) const
void match(const SimTrack &t, const SimVertex &v)
do the matching
GEMDetId gemId() const
Return the gemId.
constexpr GEMDetId superChamberId() const
std::set< int > partitionNumbers() const