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) {
129 if (nl1a + nl1b < nlayers)
134 else if (st == 1 and ri == 1) {
138 if (nl1a + nl1b < nlayers)
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();
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();
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";
313 result.insert(
p1.begin(),
p1.end());
314 result.insert(
p2.begin(),
p2.end());
315 result.insert(
p3.begin(),
p3.end());
316 result.insert(
p4.begin(),
p4.end());
322 result.insert(
p1.begin(),
p1.end());
323 result.insert(
p2.begin(),
p2.end());
329 result.insert(
p1.begin(),
p1.end());
330 result.insert(
p2.begin(),
p2.end());
336 result.insert(
p1.begin(),
p1.end());
337 result.insert(
p2.begin(),
p2.end());
static int toCSCType(int st, int ri)
T getParameter(std::string const &) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const TrackingGeometry * geometry_
edm::PSimHitContainer hits_
void match(const SimTrack &t, const SimVertex &v)
do the matching
std::map< unsigned int, edm::PSimHitContainer > detid_to_hits_
std::set< unsigned int > detIds(int type=MuonHitHelper::CSC_ALL) const
void matchSimHitsToSimTrack()
Geom::Phi< T > phi() const
constexpr uint32_t rawId() const
get the raw id
float LocalBendingInChamber(unsigned int detid) const
float simHitsMeanStrip(const edm::PSimHitContainer &sim_hits) const
CSCSimHitMatcher(const edm::ParameterSet &iPS, edm::ConsumesCollector &&iC)
int nStations(int nl=4) const
std::vector< unsigned > track_ids_
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
std::set< int > hitWiregroupsInDetId(unsigned int, int margin_n_wg=0) const
GlobalPoint simHitsMeanPosition(const edm::PSimHitContainer &sim_hits) const
std::set< int > hitStripsInDetId(unsigned int, int margin_n_strips=0) const
edm::PSimHitContainer simHits_
edm::ParameterSet simHitPSet_
float simHitsMeanWG(const edm::PSimHitContainer &sim_hits) const
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
int nCoincidenceChambers(int min_n_layers=4) const
std::map< unsigned int, edm::PSimHitContainer > chamber_to_hits_
Abs< T >::type abs(const T &t)
std::set< unsigned int > chamberIds(int type=MuonHitHelper::CSC_ALL) const
edm::ESHandle< CSCGeometry > csc_geom_
ParameterSet const & getParameterSet(std::string const &) const
const edm::PSimHitContainer & hitsInDetId(unsigned int) const
int nLayersWithHitsInChamber(unsigned int) const
void match(const SimTrack &t, const SimVertex &v)
do the matching
edm::EDGetTokenT< edm::PSimHitContainer > simHitInput_
ESHandle< TrackerGeometry > geometry
void chamberIdsToString(const std::set< unsigned int > &set) const
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
std::vector< PSimHit > PSimHitContainer
std::set< unsigned int > chamberIdsStation(int station) const
void init(const edm::Event &e, const edm::EventSetup &eventSetup)
initialize the event
bool hitStation(int, int) const
const edm::PSimHitContainer & hitsInChamber(unsigned int) const