|
|
Go to the documentation of this file.
26 LogTrace(
"MuonIdentification") <<
"No tracks found";
34 throw cms::Exception(
"FatalError") <<
"Unable to find GlobalTrackingGeometryRecord in event!\n";
36 float bestMatchChi2 = 9999;
38 const unsigned int offset = 0;
40 for (edm::SimTrackContainer::const_iterator simTrk =
simTracks->begin(); simTrk !=
simTracks->end(); simTrk++) {
42 if (
chi2 > bestMatchChi2)
51 int numberOfTruthMatchedChambers = 0;
54 for (std::vector<reco::MuonChamberMatch>::iterator chamberMatch =
matches.begin(); chamberMatch !=
matches.end();
57 edm::LogWarning(
"MuonIdentification") <<
"Detector id of a muon chamber corresponds to not a muon detector";
73 LogTrace(
"MuonIdentification") <<
"No DT simulated hits are found";
77 CSCDetId detId(chamberMatch->id.rawId());
86 LogTrace(
"MuonIdentification") <<
"No CSC simulated hits are found";
89 chamberMatch->truthMatches.push_back(bestSegmentMatch);
90 numberOfTruthMatchedChambers++;
91 LogTrace(
"MuonIdentification") <<
"Best truth matched hit:"
92 <<
"\tDetId: " << chamberMatch->id.rawId() <<
"\n"
93 <<
"\tprojection: ( " << bestSegmentMatch.
x <<
", " << bestSegmentMatch.
y
97 LogTrace(
"MuonIdentification") <<
"Truth matching summary:\n\tnumber of chambers: " <<
matches.size()
98 <<
"\n\tnumber of truth matched chambers: " << numberOfTruthMatchedChambers <<
"\n";
104 const DetId& chamberId,
106 printf(
"DONT FORGET TO CALL REGISTERCONSUMES()\n");
116 if (chamberGeometry && simUnitGeometry) {
120 if (fabs(direction.
z()) > 0.001) {
122 if (fabs(projection.
z()) > 0.001)
123 edm::LogWarning(
"MuonIdentification") <<
"z coordinate of the hit projection must be zero and it's not!\n";
125 double new_distance = 99999;
132 new_distance = fabs(exitPoint.
z());
137 segmentMatch.
x = projection.
x();
138 segmentMatch.
y = projection.
y();
139 segmentMatch.
xErr = 0;
140 segmentMatch.
yErr = 0;
141 segmentMatch.
dXdZ = direction.
x() / direction.
z();
142 segmentMatch.
dYdZ = direction.
y() / direction.
z();
146 LogTrace(
"MuonIdentificationVerbose")
147 <<
"Better truth matched segment found:\n"
148 <<
"\tDetId: " << chamberId.
rawId() <<
"\n"
150 <<
"\texit point: ( " << exitPoint.
x() <<
", " << exitPoint.
y() <<
", " << exitPoint.
z() <<
" )\n"
151 <<
"\tprojection: ( " << projection.
x() <<
", " << projection.
y() <<
", " << projection.
z() <<
" )\n";
155 if (!chamberGeometry)
156 edm::LogWarning(
"MuonIdentification") <<
"Cannot get chamber geomtry for DetId: " << chamberId.
rawId();
157 if (!simUnitGeometry)
158 edm::LogWarning(
"MuonIdentification") <<
"Cannot get detector unit geomtry for DetId: " <<
hit.detUnitId();
const math::XYZTLorentzVectorD & momentum() const
double p() const
momentum vector magnitude
std::vector< MuonChamberMatch > & matches()
get muon matching information
T const * get() const
Returns C++ pointer to the item.
def bestMatch(object, matchCollection)
Log< level::Warning, false > LogWarning
void registerConsumes(edm::ConsumesCollector &iC)
void entryPoint(InputDataCPU const &, InputDataGPU &, OutputDataGPU &, ScratchDataGPU &, OutputDataCPU &, ConditionsProducts const &, cudaStream_t, uint32_t const, uint32_t const)
static double matchChi2(const reco::Track &recoTrk, const SimTrack &simTrk)
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
double phi() const
azimuthal angle of momentum vector
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
static void truthMatchMuon(const edm::Event &iEvent, const edm::EventSetup &iSetup, reco::Muon &aMuon)
TrackRef track() const override
reference to a Track
constexpr uint32_t rawId() const
get the raw id
std::vector< SimTrack > SimTrackContainer
static void checkSimHitForBestMatch(reco::MuonSegmentMatch &segmentMatch, double &distance, const PSimHit &hit, const DetId &chamberId, const edm::ESHandle< GlobalTrackingGeometry > &geometry)
Power< A, B >::type pow(const A &a, const B &b)
std::vector< PSimHit > PSimHitContainer
double theta() const
polar angle