33 const auto& dt_det_ids =
detIds(0);
34 for (
const auto&
id : dt_det_ids) {
37 edm::LogInfo(
"DTSimHitMatcher") <<
"DTWireId " <<
DTWireId(
id) <<
": nHits " << dt_simhits.size() <<
" eta " 38 << dt_simhits_gp.eta() <<
" phi " << dt_simhits_gp.phi() <<
" nCh " 47 if (
h.trackId() != track_id)
49 int pdgid =
h.particleType();
67 std::set<unsigned int>
result;
69 const auto&
id =
p.first;
81 std::set<unsigned int>
result;
83 const auto&
id =
p.first;
95 std::set<unsigned int>
result;
102 std::set<unsigned int>
result;
147 if (nsl < nsuperlayers)
165 set<int> layers_with_hits;
167 for (
const auto&
h :
hits) {
170 layers_with_hits.insert(idd.wire());
173 return layers_with_hits.size();
177 set<int> layers_with_hits;
179 for (
const auto&
h :
hits) {
182 layers_with_hits.insert(idd.layer());
185 return layers_with_hits.size();
189 set<int> sl_with_hits;
191 for (
const auto&
h :
hits) {
194 sl_with_hits.insert(idd.superLayer());
197 return sl_with_hits.size();
203 for (
const auto& sl : superLayers) {
209 if (sim_hits.empty())
214 for (
const auto&
h : sim_hits) {
217 const auto&
d =
h.detUnitId();
236 for (
int wn = 0; wn <= max_nwires; ++wn) {
240 edm::LogInfo(
"DTSimHitMatcher") <<
"central DTWireId " << wid <<
" simhit " <<
h;
241 int smin = wn - margin_n_wires;
242 smin = (smin > 0) ? smin : 1;
243 int smax = wn + margin_n_wires;
244 smax = (smax <= max_nwires) ? smax : max_nwires;
245 for (
int ss = smin;
ss <= smax; ++
ss) {
248 edm::LogInfo(
"DTSimHitMatcher") <<
"\tadding DTWireId to collection " << widd;
262 edm::LogInfo(
"DTSimHitMatcher") <<
"hitWiresInDTSuperLayerId::l id " <<
l->id();
272 for (
const auto& sl : superLayers) {
274 edm::LogInfo(
"DTSimHitMatcher") <<
"hitWiresInDTChamberId::sl id " << sl->id();
282 for (
const auto&
p :
set) {
284 edm::LogInfo(
"DTSimHitMatcher") <<
" " << detId <<
"\n";
300 result.insert(p4.begin(), p4.end());
301 result.insert(p5.begin(), p5.end());
313 result.insert(p4.begin(), p4.end());
314 result.insert(p5.begin(), p5.end());
326 result.insert(p4.begin(), p4.end());
327 result.insert(p5.begin(), p5.end());
339 result.insert(p4.begin(), p4.end());
340 result.insert(p5.begin(), p5.end());
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
static bool isDT(unsigned int detId)
check detid type
int station() const
Return the station number.
std::set< unsigned int > hitWiresInDTChamberId(unsigned int, int margin_n_wires=0) const
const edm::PSimHitContainer & hitsInLayer(unsigned int) const
T getParameter(std::string const &) const
const TrackingGeometry * geometry_
edm::PSimHitContainer hits_
void dtChamberIdsToString(const std::set< unsigned int > &) const
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
std::set< unsigned int > layerIds() const
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
ParameterSet const & getParameterSet(std::string const &) const
void matchSimHitsToSimTrack()
int nLayersWithHitsInChamber(unsigned int) const
float simHitsMeanWire(const edm::PSimHitContainer &sim_hits) const
int nStations(int nsl=1, int nl=3) const
std::vector< unsigned > track_ids_
constexpr std::array< uint8_t, layerIndexSize > layer
DTSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
int nSuperLayersWithHitsInChamber(unsigned int) const
int nLayersWithHitsInSuperLayer(unsigned int) const
edm::PSimHitContainer simHits_
std::set< unsigned int > chamberIds(int type=MuonHitHelper::DT_ALL) const
std::set< unsigned int > detIds(int type=MuonHitHelper::DT_ALL) 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)
bool getData(T &iHolder) const
std::set< unsigned int > hitWiresInDTLayerId(unsigned int, int margin_n_wires=0) const
bool hitStation(int, int, int) const
Log< level::Info, false > LogInfo
edm::PSimHitContainer no_hits_
int nCellsWithHitsInLayer(unsigned int) const
constexpr uint32_t rawId() const
get the raw id
std::set< unsigned int > superlayerIds() 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_
int wheel() const
Return the wheel number.
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
const edm::PSimHitContainer & hitsInSuperLayer(unsigned int) 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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
static int toDTType(int wh, int st)
std::set< unsigned int > hitWiresInDTSuperLayerId(unsigned int, int margin_n_wires=0) const
std::set< unsigned int > chamberIdsStation(int station) const
edm::ESGetToken< DTGeometry, MuonGeometryRecord > geomToken_
std::map< unsigned int, edm::PSimHitContainer > layer_to_hits_