22 return TMath::Prob(
c1.conversionVertex().chi2(),
c1.conversionVertex().ndof()) >
27 bool atLeastOneInCommon =
false;
28 for (
auto const& tk1 :
c1.tracks()) {
29 for (
auto const& tk2 : c2.
tracks()) {
31 atLeastOneInCommon =
true;
36 return atLeastOneInCommon;
39 bool lt_(std::pair<double, short>
a, std::pair<double, short>
b) {
return a.first <
b.first; }
71 convAlgo_ = StringToEnumValue<reco::Conversion::ConversionAlgorithm>(
algo);
73 std::vector<std::string> qual = ps.
getParameter<std::vector<std::string>>(
"convQuality");
75 convQuality_ = StringToEnumValue<reco::Conversion::ConversionQuality>(qual);
79 produces<pat::CompositeCandidateCollection>(
"conversions");
97 for (reco::ConversionCollection::const_iterator
conv = pConv->begin();
conv != pConv->end(); ++
conv) {
108 if (!
conv->quality(
q)) {
117 outCollection->push_back(*
conv);
122 for (reco::ConversionCollection::const_iterator
conv = outCollection->begin();
conv != outCollection->end(); ++
conv) {
131 bool flagTkVtxCompatibility =
true;
133 flagTkVtxCompatibility =
false;
138 bool flagCompatibleInnerHits =
false;
139 if (
conv->tracks().size() == 2) {
143 flagCompatibleInnerHits =
true;
148 bool flagHighpurity =
true;
150 flagHighpurity =
false;
155 bool pizero_rejected =
false;
156 bool large_pizero_window =
CheckPi0(*
conv, pfphotons, pizero_rejected);
162 if (flag1 && flag2 && flag3 && flag4) {
164 *
conv, flagTkVtxCompatibility, flagCompatibleInnerHits, flagHighpurity, pizero_rejected, large_pizero_window);
166 pat_conv->addUserInt(
"flags",
flags);
167 patoutCollection->push_back(*pat_conv);
170 event.put(
std::move(patoutCollection),
"conversions");
174 bool flagTkVtxCompatibility,
175 bool flagCompatibleInnerHits,
177 bool pizero_rejected,
178 bool large_pizero_window) {
180 if (flagTkVtxCompatibility)
182 if (flagCompatibleInnerHits)
188 if (large_pizero_window)
193 std::vector<std::string> s_quals;
194 s_quals.push_back(
"generalTracksOnly");
195 s_quals.push_back(
"arbitratedEcalSeeded");
196 s_quals.push_back(
"arbitratedMerged");
197 s_quals.push_back(
"arbitratedMergedEcalGeneral");
198 s_quals.push_back(
"highPurity");
199 s_quals.push_back(
"highEfficiency");
200 s_quals.push_back(
"ecalMatched1Track");
201 s_quals.push_back(
"ecalMatched2Track");
202 std::vector<int> i_quals = StringToEnumValue<reco::Conversion::ConversionQuality>(s_quals);
203 for (std::vector<int>::const_iterator qq = i_quals.begin(); qq != i_quals.end(); ++qq) {
208 flags += (q_mask * 32 * 8);
221 while (iter1 < (((
int)
c.size()) - 1)) {
222 int iter2 = iter1 + 1;
223 while (iter2 < (
int)
c.size())
225 c.erase(
c.begin() + iter2);
236 std::vector<std::pair<double, short>>
idx[2];
238 for (
auto const& tk :
conv.tracks()) {
241 for (
auto const&
vtx : priVtxs) {
244 double dz_ = tk->dz(
vtx.position());
245 double dzError_ = tk->dzError();
246 dzError_ =
sqrt(dzError_ * dzError_ +
vtx.covariance(2, 2));
249 idx[ik].push_back(std::pair<double, short>(fabs(dz_),
count));
271 uint32_t oldSubStr = 0;
273 uint32_t hitA = hitPatA.
getHitPattern(reco::HitPattern::HitCategory::TRACK_HITS,
i);
299 int closest_pv_index = 0;
301 for (
auto const&
vtx : priVtxs) {
302 if (
conv.zOfPrimaryVertexFromTracks(
vtx.position()) <
303 conv.zOfPrimaryVertexFromTracks(priVtxs[closest_pv_index].position()))
304 closest_pv_index =
i;
308 for (
auto const& tk :
conv.tracks())
309 if (-tk->dxy(priVtxs[closest_pv_index].position()) * tk->charge() / tk->dxyError() < 0)
313 for (
auto const& tk :
conv.tracks())
318 for (
auto const& tk :
conv.tracks())
347 pfphotons.push_back(*
cand);
354 bool& pizero_rejected) {
358 bool check_small =
false;
359 bool check_large =
false;
366 float inv = (
conv.refittedPair4Momentum() +
photon->p4()).M();
367 if (inv > large1 && inv < large2) {
369 if (inv > small1 && inv < small2) {
375 pizero_rejected = check_small;