22 edm::LogWarning(
"DTSimHitMatcher") <<
"+++ Info: DT geometry is unavailable. +++\n";
40 const auto& dt_det_ids =
detIds(0);
41 for (
const auto&
id : dt_det_ids) {
44 edm::LogInfo(
"DTSimHitMatcher") <<
"DTWireId " <<
DTWireId(
id) <<
": nHits " << dt_simhits.size() <<
" eta " 45 << dt_simhits_gp.eta() <<
" phi " << dt_simhits_gp.phi() <<
" nCh " 55 if (
h.trackId() != track_id)
57 int pdgid =
h.particleType();
75 std::set<unsigned int>
result;
77 const auto&
id =
p.first;
89 std::set<unsigned int>
result;
91 const auto&
id =
p.first;
103 std::set<unsigned int>
result;
105 result.insert(
p.first);
110 std::set<unsigned int>
result;
112 result.insert(
p.first);
155 if (nsl < nsuperlayers)
173 set<int> layers_with_hits;
175 for (
const auto&
h :
hits) {
178 layers_with_hits.insert(idd.wire());
181 return layers_with_hits.size();
185 set<int> layers_with_hits;
187 for (
const auto&
h :
hits) {
190 layers_with_hits.insert(idd.layer());
193 return layers_with_hits.size();
197 set<int> sl_with_hits;
199 for (
const auto&
h :
hits) {
202 sl_with_hits.insert(idd.superLayer());
205 return sl_with_hits.size();
211 for (
const auto& sl : superLayers) {
217 if (sim_hits.empty())
222 for (
const auto&
h : sim_hits) {
225 const auto&
d =
h.detUnitId();
243 int max_nwires =
dynamic_cast<const DTGeometry*
>(
geometry_)->layer(
id)->specificTopology().channels();
244 for (
int wn = 0; wn <= max_nwires; ++wn) {
248 edm::LogInfo(
"DTSimHitMatcher") <<
"central DTWireId " << wid <<
" simhit " <<
h << endl;
249 int smin = wn - margin_n_wires;
250 smin = (smin > 0) ? smin : 1;
251 int smax = wn + margin_n_wires;
252 smax = (smax <= max_nwires) ? smax : max_nwires;
253 for (
int ss = smin;
ss <= smax; ++
ss) {
256 edm::LogInfo(
"DTSimHitMatcher") <<
"\tadding DTWireId to collection " << widd << endl;
257 result.insert(widd.
rawId());
270 edm::LogInfo(
"DTSimHitMatcher") <<
"hitWiresInDTSuperLayerId::l id " <<
l->id() << endl;
272 result.insert(
p.begin(),
p.end());
280 for (
const auto& sl : superLayers) {
282 edm::LogInfo(
"DTSimHitMatcher") <<
"hitWiresInDTChamberId::sl id " << sl->id() << endl;
284 result.insert(
p.begin(),
p.end());
290 for (
const auto&
p :
set) {
292 edm::LogInfo(
"DTSimHitMatcher") <<
" " << detId <<
"\n";
305 result.insert(
p1.begin(),
p1.end());
306 result.insert(
p2.begin(),
p2.end());
307 result.insert(
p3.begin(),
p3.end());
308 result.insert(
p4.begin(),
p4.end());
309 result.insert(p5.begin(), p5.end());
318 result.insert(
p1.begin(),
p1.end());
319 result.insert(
p2.begin(),
p2.end());
320 result.insert(
p3.begin(),
p3.end());
321 result.insert(
p4.begin(),
p4.end());
322 result.insert(p5.begin(), p5.end());
331 result.insert(
p1.begin(),
p1.end());
332 result.insert(
p2.begin(),
p2.end());
333 result.insert(
p3.begin(),
p3.end());
334 result.insert(
p4.begin(),
p4.end());
335 result.insert(p5.begin(), p5.end());
344 result.insert(
p1.begin(),
p1.end());
345 result.insert(
p2.begin(),
p2.end());
346 result.insert(
p3.begin(),
p3.end());
347 result.insert(
p4.begin(),
p4.end());
348 result.insert(p5.begin(), p5.end());
static bool isDT(unsigned int detId)
check detid type
T getParameter(std::string const &) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TrackingGeometry * geometry_
std::set< unsigned int > detIds(int type=MuonHitHelper::DT_ALL) const
edm::PSimHitContainer hits_
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
constexpr uint32_t rawId() const
get the raw id
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
void matchSimHitsToSimTrack()
int nLayersWithHitsInSuperLayer(unsigned int) const
std::set< unsigned int > hitWiresInDTSuperLayerId(unsigned int, int margin_n_wires=0) const
std::set< unsigned int > chamberIdsStation(int station) const
std::set< unsigned int > hitWiresInDTChamberId(unsigned int, int margin_n_wires=0) const
std::vector< unsigned > track_ids_
DTSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
std::set< unsigned int > chamberIds(int type=MuonHitHelper::DT_ALL) const
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
edm::PSimHitContainer simHits_
const edm::PSimHitContainer & hitsInSuperLayer(unsigned int) const
edm::ParameterSet simHitPSet_
void match(const SimTrack &t, const SimVertex &v)
do the matching
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
Abs< T >::type abs(const T &t)
int nStations(int nsl=1, int nl=3) const
const edm::PSimHitContainer & hitsInLayer(unsigned int) const
edm::ESHandle< DTGeometry > dt_geom_
std::set< unsigned int > hitWiresInDTLayerId(unsigned int, int margin_n_wires=0) const
edm::PSimHitContainer no_hits_
int nLayersWithHitsInChamber(unsigned int) const
std::set< unsigned int > layerIds() const
bool hitStation(int, int, int) const
ParameterSet const & getParameterSet(std::string const &) const
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
void match(const SimTrack &t, const SimVertex &v)
do the matching
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
std::map< unsigned int, edm::PSimHitContainer > superlayer_to_hits_
float simHitsMeanWire(const edm::PSimHitContainer &sim_hits) const
std::vector< PSimHit > PSimHitContainer
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
int station() const
Return the station number.
static int toDTType(int wh, int st)
int wheel() const
Return the wheel number.
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
void dtChamberIdsToString(const std::set< unsigned int > &) const
int nSuperLayersWithHitsInChamber(unsigned int) const
std::set< unsigned int > superlayerIds() const
int nCellsWithHitsInLayer(unsigned int) const
std::map< unsigned int, edm::PSimHitContainer > layer_to_hits_