26 <<
"+++ Info: CSC geometry is unavailable. +++\n";
41 <<
"nTrackIds " <<
track_ids_.size() <<
" nSelectedCSCSimHits " 42 <<
hits_.size() << endl;
44 <<
"detids CSC " <<
detIds(0).size() << endl;
46 for (
const auto&
id :
detIds(0)) {
53 <<
"cscdetid " <<
CSCDetId(
id) <<
": " << simhits.size() <<
" " 56 <<
"nStrip " <<
strips.size() << endl;
70 if (
h.trackId() != track_id)
continue;
71 int pdgid =
h.particleType();
85 std::set<unsigned int>
result;
87 const auto&
id =
p.first;
99 std::set<unsigned int>
result;
101 const auto&
id =
p.first;
113 set<int> layers_with_hits;
116 layers_with_hits.insert(idd.layer());
118 return layers_with_hits.size();
126 if (
id.
station() != st)
continue;
129 if (st == 1 and ri == 4) {
133 if (nl1a + nl1b < nlayers)
continue;
137 else if (st == 1 and ri == 1) {
141 if (nl1a + nl1b < nlayers)
continue;
147 if (nl < nlayers)
continue;
162 float phi_layer1 = -10;
163 float phi_layer6 = 10;
179 if (!hits1a.empty() and !hits1b.empty())
180 phi_layer1 = (gp1a.phi() + gp1b.
phi()) / 2.0;
181 else if (!hits1a.empty())
182 phi_layer1 = gp1a.phi();
183 else if (!hits1b.empty())
184 phi_layer1 = gp1b.
phi();
199 if (!hits6a.empty() and !hits6b.empty())
200 phi_layer6 = (gp6a.phi() + gp6b.
phi()) / 2.0;
201 else if (!hits6a.empty())
202 phi_layer6 = gp6a.phi();
203 else if (!hits6b.empty())
204 phi_layer6 = gp6b.
phi();
212 phi_layer1 = gp1.phi();
219 phi_layer6 = gp6.phi();
221 return deltaPhi(phi_layer6, phi_layer1);
226 if (sim_hits.empty())
return -1.
f;
230 for (
const auto&
h : sim_hits) {
233 const auto&
d =
h.detUnitId();
243 if (n == 0)
return -1.f;
249 if (sim_hits.empty())
return -1.
f;
253 for (
const auto&
h : sim_hits) {
256 const auto&
d =
h.detUnitId();
260 int nearestWire(layerG->nearestWire(lp));
262 s = layerG->wireGroup(nearestWire);
266 if (n == 0)
return -1.f;
271 int margin_n_strips)
const {
279 for (
const auto&
h : simhits) {
285 int smin = central_strip - margin_n_strips;
286 smin = (smin > 0) ? smin : 1;
287 int smax = central_strip + margin_n_strips;
288 smax = (smax <= max_nstrips) ? smax : max_nstrips;
289 for (
int ss = smin; ss <= smax; ++ss) result.insert(ss);
295 int margin_n_wg)
const {
302 ->numberOfWireGroups();
303 for (
const auto&
h : simhits) {
305 const auto& layer_geo =
307 int central_wg = layer_geo->wireGroup(layer_geo->nearestWire(lp));
308 int wg_min = central_wg - margin_n_wg;
309 wg_min = (wg_min > 0) ? wg_min : 1;
310 int wg_max = central_wg + margin_n_wg;
311 wg_max = (wg_max <= max_n_wg) ? wg_max : max_n_wg;
312 for (
int wg = wg_min; wg <= wg_max; ++wg) result.insert(wg);
320 for (
const auto&
id : chamber_ids) {
327 const std::set<unsigned int>&
set)
const {
328 for (
const auto&
p :
set) {
330 edm::LogInfo(
"CSCSimHitMatcher") <<
" " << detId <<
"\n";
342 result.insert(
p1.begin(),
p1.end());
343 result.insert(
p2.begin(),
p2.end());
344 result.insert(
p3.begin(),
p3.end());
345 result.insert(
p4.begin(),
p4.end());
351 result.insert(
p1.begin(),
p1.end());
352 result.insert(
p2.begin(),
p2.end());
358 result.insert(
p1.begin(),
p1.end());
359 result.insert(
p2.begin(),
p2.end());
365 result.insert(
p1.begin(),
p1.end());
366 result.insert(
p2.begin(),
p2.end());
static int toCSCType(int st, int ri)
T getParameter(std::string const &) const
const TrackingGeometry * geometry_
edm::PSimHitContainer hits_
void match(const SimTrack &t, const SimVertex &v)
do the matching
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
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
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