|
|
Go to the documentation of this file.
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;
110 std::set<unsigned int>
result;
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();
228 s = dynamic_cast<const DTGeometry*>(
geometry_)->layer(
DTLayerId(
d))->specificTopology().channel(lp);
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;
270 edm::LogInfo(
"DTSimHitMatcher") <<
"hitWiresInDTSuperLayerId::l id " <<
l->id() << endl;
280 for (
const auto& sl : superLayers) {
282 edm::LogInfo(
"DTSimHitMatcher") <<
"hitWiresInDTChamberId::sl id " << sl->id() << endl;
290 for (
const auto&
p : set) {
292 edm::LogInfo(
"DTSimHitMatcher") <<
" " << detId <<
"\n";
309 result.insert(p5.begin(), p5.end());
322 result.insert(p5.begin(), p5.end());
335 result.insert(p5.begin(), p5.end());
348 result.insert(p5.begin(), p5.end());
const edm::PSimHitContainer & hitsInSuperLayer(unsigned int) const
edm::ESHandle< DTGeometry > dt_geom_
std::set< unsigned int > hitWiresInDTSuperLayerId(unsigned int, int margin_n_wires=0) const
DTSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
std::set< unsigned int > superlayerIds() const
int nLayersWithHitsInChamber(unsigned int) const
void dtChamberIdsToString(const std::set< unsigned int > &) const
std::map< unsigned int, edm::PSimHitContainer > layer_to_hits_
std::set< unsigned int > layerIds() const
const TrackingGeometry * geometry_
void match(const SimTrack &t, const SimVertex &v)
do the matching
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
const edm::PSimHitContainer & hitsInLayer(unsigned int) const
edm::PSimHitContainer simHits_
int nStations(int nsl=1, int nl=3) const
float simHitsMeanWire(const edm::PSimHitContainer &sim_hits) const
int nCellsWithHitsInLayer(unsigned int) const
int nSuperLayersWithHitsInChamber(unsigned int) const
static int toDTType(int wh, int st)
std::set< unsigned int > chamberIdsStation(int station) const
edm::ParameterSet simHitPSet_
std::set< unsigned int > chamberIds(int type=MuonHitHelper::DT_ALL) const
std::vector< unsigned > track_ids_
edm::PSimHitContainer no_hits_
void matchSimHitsToSimTrack()
std::set< unsigned int > detIds(int type=MuonHitHelper::DT_ALL) const
void match(const SimTrack &t, const SimVertex &v)
do the matching
int nLayersWithHitsInSuperLayer(unsigned int) const
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
std::set< unsigned int > hitWiresInDTLayerId(unsigned int, int margin_n_wires=0) const
T getParameter(std::string const &) const
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
constexpr uint32_t rawId() const
get the raw id
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
std::map< unsigned int, edm::PSimHitContainer > superlayer_to_hits_
bool hitStation(int, int, int) const
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
Abs< T >::type abs(const T &t)
std::vector< PSimHit > PSimHitContainer
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
edm::PSimHitContainer hits_
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
static bool isDT(unsigned int detId)
check detid type
int wheel() const
Return the wheel number.
ParameterSet const & getParameterSet(std::string const &) const
std::set< unsigned int > hitWiresInDTChamberId(unsigned int, int margin_n_wires=0) const
int station() const
Return the station number.