|
|
Go to the documentation of this file.
22 edm::LogWarning(
"CSCSimHitMatcher") <<
"+++ Info: CSC geometry is unavailable. +++\n";
40 for (
const auto&
id :
detIds(0)) {
62 if (
h.trackId() != track_id)
64 int pdgid =
h.particleType();
80 std::set<unsigned int>
result;
82 const auto&
id =
p.first;
94 std::set<unsigned int>
result;
96 const auto&
id =
p.first;
108 set<int> layers_with_hits;
111 layers_with_hits.insert(idd.layer());
113 return layers_with_hits.size();
125 if (st == 1 and ri == 4) {
134 else if (st == 1 and ri == 1) {
161 float phi_layer1 = -10;
162 float phi_layer6 = 10;
172 if (!hits1a.empty() and !hits1b.empty())
173 phi_layer1 = (gp1a.phi() + gp1b.
phi()) / 2.0;
174 else if (!hits1a.empty())
175 phi_layer1 = gp1a.phi();
176 else if (!hits1b.empty())
177 phi_layer1 = gp1b.
phi();
186 if (!hits6a.empty() and !hits6b.empty())
187 phi_layer6 = (gp6a.phi() + gp6b.
phi()) / 2.0;
188 else if (!hits6a.empty())
189 phi_layer6 = gp6a.phi();
190 else if (!hits6b.empty())
191 phi_layer6 = gp6b.
phi();
197 phi_layer1 = gp1.phi();
202 phi_layer6 = gp6.phi();
204 return deltaPhi(phi_layer6, phi_layer1);
208 if (sim_hits.empty())
213 for (
const auto&
h : sim_hits) {
216 const auto&
d =
h.detUnitId();
217 s = dynamic_cast<const CSCGeometry*>(
geometry_)->layer(
d)->geometry()->strip(lp);
229 if (sim_hits.empty())
234 for (
const auto&
h : sim_hits) {
237 const auto&
d =
h.detUnitId();
239 const auto& layerG(dynamic_cast<const CSCGeometry*>(
geometry_)->layer(
d)->
geometry());
240 int nearestWire(layerG->nearestWire(lp));
242 s = layerG->wireGroup(nearestWire);
255 int max_nstrips = dynamic_cast<const CSCGeometry*>(
geometry_)->layer(
id)->geometry()->numberOfStrips();
258 int central_strip = dynamic_cast<const CSCGeometry*>(
geometry_)->layer(
id)->geometry()->nearestStrip(lp);
259 int smin = central_strip - margin_n_strips;
260 smin = (smin > 0) ? smin : 1;
261 int smax = central_strip + margin_n_strips;
262 smax = (smax <= max_nstrips) ? smax : max_nstrips;
263 for (
int ss = smin;
ss <= smax; ++
ss)
273 int max_n_wg = dynamic_cast<const CSCGeometry*>(
geometry_)->layer(
id)->geometry()->numberOfWireGroups();
276 const auto& layer_geo = dynamic_cast<const CSCGeometry*>(
geometry_)->layer(
id)->geometry();
277 int central_wg = layer_geo->wireGroup(layer_geo->nearestWire(lp));
278 int wg_min = central_wg - margin_n_wg;
279 wg_min = (wg_min > 0) ? wg_min : 1;
280 int wg_max = central_wg + margin_n_wg;
281 wg_max = (wg_max <= max_n_wg) ? wg_max : max_n_wg;
282 for (
int wg = wg_min; wg <= wg_max; ++wg)
291 for (
const auto&
id : chamber_ids) {
299 for (
const auto&
p : set) {
301 edm::LogInfo(
"CSCSimHitMatcher") <<
" " << detId <<
"\n";
float simHitsMeanStrip(const edm::PSimHitContainer &sim_hits) const
ESHandle< TrackerGeometry > geometry
edm::ESHandle< CSCGeometry > csc_geom_
float LocalBendingInChamber(unsigned int detid) const
const TrackingGeometry * geometry_
std::set< int > hitWiregroupsInDetId(unsigned int, int margin_n_wg=0) const
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
std::set< int > hitStripsInDetId(unsigned int, int margin_n_strips=0) const
edm::PSimHitContainer simHits_
std::set< unsigned int > detIds(int type=MuonHitHelper::CSC_ALL) const
edm::ParameterSet simHitPSet_
std::vector< unsigned > track_ids_
void match(const SimTrack &t, const SimVertex &v)
do the matching
void match(const SimTrack &t, const SimVertex &v)
do the matching
void matchSimHitsToSimTrack()
int nStations(int nl=4) const
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
int nCoincidenceChambers(int min_n_layers=4) const
std::set< unsigned int > chamberIdsStation(int station) const
T getParameter(std::string const &) const
float simHitsMeanWG(const edm::PSimHitContainer &sim_hits) const
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
constexpr uint32_t rawId() const
get the raw id
bool hitStation(int, int) const
CSCSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
const edm::PSimHitContainer & hitsInChamber(unsigned int) const
Abs< T >::type abs(const T &t)
std::vector< PSimHit > PSimHitContainer
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
static int toCSCType(int st, int ri)
edm::PSimHitContainer hits_
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
std::set< unsigned int > chamberIds(int type=MuonHitHelper::CSC_ALL) const
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers....
Geom::Phi< T > phi() const
ParameterSet const & getParameterSet(std::string const &) const
int nLayersWithHitsInChamber(unsigned int) const
void chamberIdsToString(const std::set< unsigned int > &set) const