|
|
Go to the documentation of this file.
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();
220 s = dynamic_cast<const DTGeometry*>(
geometry_)->layer(
DTLayerId(
d))->specificTopology().channel(lp);
235 int max_nwires = dynamic_cast<const DTGeometry*>(
geometry_)->layer(
id)->specificTopology().channels();
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";
301 result.insert(p5.begin(), p5.end());
314 result.insert(p5.begin(), p5.end());
327 result.insert(p5.begin(), p5.end());
340 result.insert(p5.begin(), p5.end());
const edm::PSimHitContainer & hitsInSuperLayer(unsigned int) const
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
Log< level::Info, false > LogInfo
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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::ESGetToken< DTGeometry, MuonGeometryRecord > geomToken_
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
bool getData(T &iHolder) const
std::set< unsigned int > hitWiresInDTLayerId(unsigned int, int margin_n_wires=0) const
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
constexpr uint32_t rawId() const
get the raw id
T getParameter(std::string const &) const
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.