103 auto out = std::make_unique<std::vector<pat::Muon>>();
104 out->reserve(
src->size());
106 auto outDTSegments = std::make_unique<DTRecSegment4DCollection>();
107 std::set<DTRecSegment4DRef> dtSegmentsRefs;
108 auto outCSCSegments = std::make_unique<CSCSegmentCollection>();
109 std::set<CSCSegmentRef> cscSegmentsRefs;
115 std::map<reco::CandidatePtr, pat::PackedCandidateRef> mu2pc;
119 for (
unsigned int ipfh = 0, npfh =
pf_.size(); ipfh < npfh; ++ipfh) {
122 const auto &pfcoll = (*pf);
123 const auto &pfmap = (*pf2pc);
124 for (
unsigned int i = 0,
n =
pf->size();
i <
n; ++
i) {
126 if (
p.muonRef().isNonnull())
133 for (
const auto &
mu : *
src) {
135 if (
track.isNonnull() && trk2LT.contains(
track.id())) {
136 const auto &lostTrack = trk2LT[
track];
137 if (lostTrack.isNonnull())
138 mu2pc[
mu.refToOrig_] = lostTrack;
148 for (vector<pat::Muon>::const_iterator
it =
src->begin(), ed =
src->end();
it != ed; ++
it) {
166 mu.setPFIsolation(
"pfIsoMeanDRProfileR03",
zero);
167 mu.setPFIsolation(
"pfIsoSumDRProfileR03",
zero);
168 mu.setPFIsolation(
"pfIsoMeanDRProfileR04",
zero);
169 mu.setPFIsolation(
"pfIsoSumDRProfileR04",
zero);
176 ene.
tower = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(ene.
tower);
178 ene.
towerS9 = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(ene.
towerS9);
180 ene.
had = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(ene.
had);
182 ene.
hadS9 = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(ene.
hadS9);
184 ene.
hadMax = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(ene.
hadMax);
186 ene.
em = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(ene.
em);
188 ene.
emS25 = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(ene.
emS25);
190 ene.
emMax = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(ene.
emMax);
200 MiniFloatConverter::reduceMantissaToNbitsRounding<14>(ene.
ecal_position.Y()),
201 MiniFloatConverter::reduceMantissaToNbitsRounding<14>(ene.
ecal_position.Z()));
203 MiniFloatConverter::reduceMantissaToNbitsRounding<12>(ene.
hcal_position.Y()),
204 MiniFloatConverter::reduceMantissaToNbitsRounding<12>(ene.
hcal_position.Z()));
205 mu.setCalEnergy(ene);
209 qual.tkKink_position =
210 math::XYZPointF(MiniFloatConverter::reduceMantissaToNbitsRounding<12>(
qual.tkKink_position.X()),
211 MiniFloatConverter::reduceMantissaToNbitsRounding<12>(
qual.tkKink_position.Y()),
212 MiniFloatConverter::reduceMantissaToNbitsRounding<12>(
qual.tkKink_position.Z()));
213 mu.setCombinedQuality(
qual);
218 MiniFloatConverter::reduceMantissaToNbitsRounding<10>(corrs.
corrX()),
219 MiniFloatConverter::reduceMantissaToNbitsRounding<10>(corrs.
corrY()));
220 mu.embedCaloMETMuonCorrs(corrs);
224 cmatch.edgeX = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(cmatch.edgeX);
225 cmatch.edgeY = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(cmatch.edgeY);
226 cmatch.xErr = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(cmatch.xErr);
227 cmatch.yErr = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(cmatch.yErr);
228 cmatch.dXdZErr = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(cmatch.dXdZErr);
229 cmatch.dYdZErr = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(cmatch.dYdZErr);
231 smatch.
xErr = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(smatch.
xErr);
232 smatch.
yErr = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(smatch.
yErr);
233 smatch.
dXdZErr = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(smatch.
dXdZErr);
234 smatch.
dYdZErr = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(smatch.
dYdZErr);
249 std::map<DTRecSegment4DRef, size_t> dtMap;
250 std::vector<DTRecSegment4D> outDTSegmentsTmp;
251 std::map<CSCSegmentRef, size_t> cscMap;
252 std::vector<CSCSegment> outCSCSegmentsTmp;
253 for (
auto &seg : dtSegmentsRefs) {
254 dtMap[seg] = outDTSegments->size();
255 outDTSegmentsTmp.push_back(*seg);
257 for (
auto &seg : cscSegmentsRefs) {
258 cscMap[seg] = outCSCSegments->size();
259 outCSCSegmentsTmp.push_back(*seg);
261 outDTSegments->put(
DTChamberId(), outDTSegmentsTmp.begin(), outDTSegmentsTmp.end());
262 outCSCSegments->put(
CSCDetId(), outCSCSegmentsTmp.begin(), outCSCSegmentsTmp.end());
265 for (
auto &
mu : *
out) {
266 if (
mu.isMatchesValid()) {
const edm::EDGetTokenT< pat::MuonCollection > src_
DTRecSegment4DRef dtSegmentRef
const StringCutObjectSelector< pat::Muon > dropDirectionalIso_
const StringCutObjectSelector< pat::Muon > slimKinkVars_
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
CSCSegmentRef cscSegmentRef
const bool linkToPackedPF_
std::vector< edm::EDGetTokenT< reco::PFCandidateCollection > > pf_
bool isNonnull() const
Checks for non-null.
const StringCutObjectSelector< pat::Muon > slimCaloVars_
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
std::unique_ptr< pat::ObjectModifier< pat::Muon > > muonModifier_
float towerS9
total energy in 3x3 tower shape
float ecal_time
Calorimeter timing.
const StringCutObjectSelector< pat::Muon > segmentsMuonSelection_
float emS25
energy deposited in 5x5 ECAL crystal shape around central crystal
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > track2LostTrack_
math::XYZPointF hcal_position
float emMax
maximal energy of ECAL crystal in the 5x5 shape
const StringCutObjectSelector< pat::Muon > dropPfP4_
float hadMax
maximal energy of HCAL tower in the 3x3 shape
std::vector< edm::EDGetTokenT< edm::Association< reco::TrackExtraCollection > > > trackExtraAssocs_
const StringCutObjectSelector< pat::Muon > slimMatches_
const bool linkToLostTrack_
Particle reconstructed by the particle flow algorithm.
std::vector< edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > > pf2pc_
const StringCutObjectSelector< pat::Muon > saveTeVMuons_
const StringCutObjectSelector< pat::Muon > slimCaloMETCorr_
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Analysis-level muon class.
float hadS9
energy deposited in 3x3 HCAL tower shape around central tower