22 edm::LogWarning(
"GEMSimHitMatcher") <<
"+++ Info: GEM geometry is unavailable. +++\n";
40 const auto& gem_ch_ids =
detIds();
41 for (
const auto&
id : gem_ch_ids) {
44 edm::LogInfo(
"GEMSimHitMatcher") <<
"gemchid " <<
GEMDetId(
id) <<
": nHits " << gem_simhits.size() <<
" phi " 54 for (
const auto&
id : gem_sch_ids) {
58 << gem_simhits.size() <<
" " << gem_simhits_gp.phi() <<
" " 68 if (
h.trackId() != track_id)
70 int pdgid =
h.particleType();
86 const auto& detids =
detIds();
88 for (
const auto&
d : detids) {
94 for (
const auto&
h :
hits) {
96 pads.insert(1 + static_cast<int>(roll->padTopology().channel(lp)));
102 for (
const auto&
d : detids) {
104 if (id1.
layer() != 1)
114 for (
const auto&
h : hits1) {
116 pads1.insert(1 + static_cast<int>(roll1->padTopology().channel(lp)));
118 edm::LogInfo(
"GEMSimHitMatcher") <<
"GEMHits detid1 " << id1 <<
" pad1 " 119 << 1 +
static_cast<int>(roll1->padTopology().channel(lp)) << std::endl;
123 for (
const auto& d2 : detids) {
132 for (
const auto&
h : hits2) {
134 pads2.insert(1 + static_cast<int>(roll2->padTopology().channel(lp)));
136 edm::LogInfo(
"GEMSimHitMatcher") <<
"GEMHits detid2 " << id2 <<
" pad2 " 137 << 1 +
static_cast<int>(roll2->padTopology().channel(lp)) << std::endl;
141 for (
const auto& pad1 : pads1) {
142 for (
const auto& pad2 : pads2) {
143 if (
abs(pad1 - pad2) <= 2) {
144 if (copads.find(pad1) == copads.end())
146 if (copads.find(pad2) == copads.end())
161 std::set<unsigned int>
result;
163 const auto&
id =
p.first;
175 std::set<unsigned int>
result;
177 result.insert(
p.first);
182 std::set<unsigned int>
result;
184 const auto&
id =
p.first;
196 std::set<unsigned int>
result;
198 result.insert(
p.first);
203 std::set<unsigned int>
result;
223 set<int> layers_with_hits;
225 for (
const auto&
h :
hits) {
227 layers_with_hits.insert(idd.layer());
229 return layers_with_hits.size();
250 if (sim_hits.empty())
255 for (
const auto&
h : sim_hits) {
263 edm::LogWarning(
"GEMSimHitMatcher") <<
"warning! find more than one simhits in GEM chamber " << std::endl;
271 if (sim_hits.empty())
276 for (
const auto&
h : sim_hits) {
278 const auto&
d =
h.detUnitId();
295 static_cast<int>(
dynamic_cast<const GEMGeometry*
>(
geometry_)->etaPartition(
id)->topology().channel(lp));
296 int smin = central_strip - margin_n_strips;
297 smin = (smin > 0) ? smin : 1;
298 int smax = central_strip + margin_n_strips;
299 smax = (smax <= max_nstrips) ? smax : max_nstrips;
300 for (
int ss = smin;
ss <= smax; ++
ss)
323 const auto& detids =
detIds();
324 for (
const auto&
id : detids) {
326 result.insert(idd.
roll());
333 const auto& pad_ids =
detIds();
334 for (
const auto&
id : pad_ids) {
343 for (
const auto&
id : copad_ids) {
T getParameter(std::string const &) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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
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
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_
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
Abs< T >::type abs(const T &t)
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
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
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_