26 <<
"+++ Info: DT geometry is unavailable. +++\n";
41 <<
"nTrackIds " <<
track_ids_.size() <<
" nSelectedDTSimHits " 42 <<
hits_.size() << endl;
44 <<
"detids DT " <<
detIds(0).size() << endl;
46 const auto& dt_det_ids =
detIds(0);
47 for (
const auto&
id : dt_det_ids) {
51 <<
"DTWireId " <<
DTWireId(
id) <<
": nHits " << dt_simhits.size()
52 <<
" eta " << dt_simhits_gp.eta() <<
" phi " << dt_simhits_gp.phi()
62 if (
h.trackId() != track_id)
continue;
63 int pdgid =
h.particleType();
79 std::set<unsigned int>
result;
81 const auto&
id =
p.first;
93 std::set<unsigned int>
result;
95 const auto&
id =
p.first;
107 std::set<unsigned int>
result;
113 std::set<unsigned int>
result;
119 unsigned int detid)
const {
129 unsigned int detid)
const {
140 unsigned int detid)
const {
153 if (
id.
station() != st)
continue;
157 if (nsl < nsuperlayers)
continue;
161 if (nl < nlayers)
continue;
168 return (
hitStation(1, nsuperlayers, nlayers) +
175 set<int> layers_with_hits;
177 for (
const auto&
h :
hits) {
180 layers_with_hits.insert(idd.wire());
183 return layers_with_hits.size();
187 set<int> layers_with_hits;
189 for (
const auto&
h :
hits) {
192 layers_with_hits.insert(idd.layer());
195 return layers_with_hits.size();
199 set<int> sl_with_hits;
201 for (
const auto&
h :
hits) {
204 sl_with_hits.insert(idd.superLayer());
207 return sl_with_hits.size();
212 const auto& superLayers(dynamic_cast<const DTGeometry*>(
geometry_)
215 for (
const auto& sl : superLayers) {
222 if (sim_hits.empty())
return -1.
f;
226 for (
const auto&
h : sim_hits) {
229 const auto&
d =
h.detUnitId();
241 if (n == 0)
return -1.f;
246 unsigned int detid,
int margin_n_wires)
const {
254 for (
int wn = 0; wn <= max_nwires; ++wn) {
259 <<
"central DTWireId " << wid <<
" simhit " <<
h << endl;
260 int smin = wn - margin_n_wires;
261 smin = (smin > 0) ? smin : 1;
262 int smax = wn + margin_n_wires;
263 smax = (smax <= max_nwires) ? smax : max_nwires;
264 for (
int ss = smin; ss <= smax; ++ss) {
268 <<
"\tadding DTWireId to collection " << widd << endl;
269 result.insert(widd.
rawId());
278 unsigned int detid,
int margin_n_wires)
const {
286 <<
"hitWiresInDTSuperLayerId::l id " <<
l->id() << endl;
288 result.insert(
p.begin(),
p.end());
294 unsigned int detid,
int margin_n_wires)
const {
296 const auto& superLayers(dynamic_cast<const DTGeometry*>(
geometry_)
299 for (
const auto& sl : superLayers) {
302 <<
"hitWiresInDTChamberId::sl id " << sl->id() << endl;
304 result.insert(
p.begin(),
p.end());
310 const std::set<unsigned int>&
set)
const {
311 for (
const auto&
p :
set) {
313 edm::LogInfo(
"DTSimHitMatcher") <<
" " << detId <<
"\n";
326 result.insert(
p1.begin(),
p1.end());
327 result.insert(
p2.begin(),
p2.end());
328 result.insert(
p3.begin(),
p3.end());
329 result.insert(
p4.begin(),
p4.end());
330 result.insert(p5.begin(), p5.end());
339 result.insert(
p1.begin(),
p1.end());
340 result.insert(
p2.begin(),
p2.end());
341 result.insert(
p3.begin(),
p3.end());
342 result.insert(
p4.begin(),
p4.end());
343 result.insert(p5.begin(), p5.end());
352 result.insert(
p1.begin(),
p1.end());
353 result.insert(
p2.begin(),
p2.end());
354 result.insert(
p3.begin(),
p3.end());
355 result.insert(
p4.begin(),
p4.end());
356 result.insert(p5.begin(), p5.end());
365 result.insert(
p1.begin(),
p1.end());
366 result.insert(
p2.begin(),
p2.end());
367 result.insert(
p3.begin(),
p3.end());
368 result.insert(
p4.begin(),
p4.end());
369 result.insert(p5.begin(), p5.end());
static bool isDT(unsigned int detId)
check detid type
T getParameter(std::string const &) const
const TrackingGeometry * geometry_
std::set< unsigned int > detIds(int type=MuonHitHelper::DT_ALL) const
edm::PSimHitContainer hits_
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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_