26 <<
"+++ Info: GEM geometry is unavailable. +++\n";
41 <<
"nTrackIds " <<
track_ids_.size() <<
" nSelectedGEMSimHits " 42 <<
hits_.size() << endl;
44 <<
"detids GEM " <<
detIds(0).size() << endl;
46 const auto& gem_ch_ids =
detIds();
47 for (
const auto&
id : gem_ch_ids) {
51 <<
"gemchid " <<
GEMDetId(
id) <<
": nHits " << gem_simhits.size()
52 <<
" phi " << gem_simhits_gp.phi() <<
" nCh " 62 for (
const auto&
id : gem_sch_ids) {
67 <<
" | " << gem_simhits.size() <<
" " << gem_simhits_gp.phi() <<
" " 77 if (
h.trackId() != track_id)
continue;
78 int pdgid =
h.particleType();
92 const auto& detids =
detIds();
94 for (
const auto&
d : detids) {
101 for (
const auto&
h :
hits) {
103 pads.insert(1 + static_cast<int>(roll->padTopology().channel(lp)));
109 for (
const auto&
d : detids) {
111 if (id1.
layer() != 1)
continue;
121 for (
const auto&
h : hits1) {
123 pads1.insert(1 + static_cast<int>(roll1->padTopology().channel(lp)));
126 <<
"GEMHits detid1 " << id1 <<
" pad1 " 127 << 1 +
static_cast<int>(roll1->padTopology().channel(lp))
132 for (
const auto& d2 : detids) {
143 for (
const auto&
h : hits2) {
145 pads2.insert(1 + static_cast<int>(roll2->padTopology().channel(lp)));
148 <<
"GEMHits detid2 " << id2 <<
" pad2 " 149 << 1 +
static_cast<int>(roll2->padTopology().channel(lp))
154 for (
const auto& pad1 : pads1) {
155 for (
const auto& pad2 : pads2) {
156 if (
abs(pad1 - pad2) <= 2) {
157 if (copads.find(pad1) == copads.end()) copads.insert(pad1);
158 if (copads.find(pad2) == copads.end()) copads.insert(pad2);
163 if (copads.empty())
continue;
171 std::set<unsigned int>
result;
173 const auto&
id =
p.first;
185 std::set<unsigned int>
result;
191 std::set<unsigned int>
result;
193 const auto&
id =
p.first;
205 std::set<unsigned int>
result;
211 std::set<unsigned int>
result;
220 unsigned int detid)
const {
233 set<int> layers_with_hits;
235 for (
const auto&
h :
hits) {
237 layers_with_hits.insert(idd.layer());
239 return layers_with_hits.size();
246 if (
id.
station() != st)
continue;
249 if (nl < nlayers)
continue;
261 if (sim_hits.empty())
return -0.0;
265 for (
const auto&
h : sim_hits) {
274 <<
"warning! find more than one simhits in GEM chamber " << std::endl;
283 if (sim_hits.empty())
return -1.
f;
287 for (
const auto&
h : sim_hits) {
289 const auto&
d =
h.detUnitId();
294 if (n == 0)
return -1.f;
299 int margin_n_strips)
const {
305 for (
const auto&
h : simhits) {
312 int smin = central_strip - margin_n_strips;
313 smin = (smin > 0) ? smin : 1;
314 int smax = central_strip + margin_n_strips;
315 smax = (smax <= max_nstrips) ? smax : max_nstrips;
316 for (
int ss = smin; ss <= smax; ++ss) result.insert(ss);
336 const auto& detids =
detIds();
337 for (
const auto&
id : detids) {
339 result.insert(idd.
roll());
346 const auto& pad_ids =
detIds();
347 for (
const auto&
id : pad_ids) {
356 for (
const auto&
id : copad_ids) {
T getParameter(std::string const &) const
float simHitsGEMCentralPosition(const edm::PSimHitContainer &sim_hits) const
bool hitStation(int, int) const
const TrackingGeometry * geometry_
std::map< unsigned int, std::set< int > > detids_to_pads_
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
edm::PSimHitContainer hits_
std::set< int > hitStripsInDetId(unsigned int, int margin_n_strips=0) const
int nPadsWithHits() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
std::set< unsigned int > chamberIds(int gem_type=MuonHitHelper::GEM_ALL) const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
constexpr uint32_t rawId() const
get the raw id
virtual const GeomDet * idToDet(DetId) const =0
GEMSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
GEMDetId superChamberId() const
Return the corresponding superChamberId.
static int toGEMType(int st, int ri)
std::vector< unsigned > track_ids_
std::set< unsigned int > superChamberIds() const
std::set< unsigned int > detIds(int gem_type=MuonHitHelper::GEM_ALL) const
int nCoincidencePadsWithHits() const
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
std::set< int > hitPadsInDetId(unsigned int) const
edm::PSimHitContainer simHits_
edm::ParameterSet simHitPSet_
int nStations(int nl=2) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::set< unsigned int > detIdsCoincidences() const
std::map< unsigned int, edm::PSimHitContainer > superchamber_to_hits_
int layer() const
Layer id: each station have two layers of chambers: layer 1 is the inner chamber and layer 2 is the o...
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
int station() const
Station id : the station is the pair of chambers at same disk.
Abs< T >::type abs(const T &t)
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
std::set< int > hitPartitions() const
edm::PSimHitContainer no_hits_
ParameterSet const & getParameterSet(std::string const &) const
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
std::set< int > hitCoPadsInDetId(unsigned int) const
std::map< unsigned int, std::set< int > > detids_to_copads_
void match(const SimTrack &t, const SimVertex &v)
do the matching
static bool isGEM(unsigned int detId)
int nLayersWithHitsInSuperChamber(unsigned int) const
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
float simHitsMeanStrip(const edm::PSimHitContainer &sim_hits) const
void matchSimHitsToSimTrack()
void match(const SimTrack &t, const SimVertex &v)
do the matching
std::vector< PSimHit > PSimHitContainer
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
const edm::PSimHitContainer & hitsInSuperChamber(unsigned int) const
std::set< unsigned int > superChamberIdsCoincidences() const
edm::ESHandle< GEMGeometry > gem_geom_