100 |
|
|
101 |
|
*/ |
102 |
|
// std::cout <<" ------------------ EVENT: " << std::endl; |
103 |
< |
Pattern pattern; |
103 |
> |
std::vector<Pattern> vpattern(1); |
104 |
|
theEvForPatCounter++; |
105 |
|
for (VDigiSpec::const_iterator is= vDigi.begin(); is!=vDigi.end(); is++) { |
106 |
< |
bool isOK = pattern.add(*is); |
107 |
< |
if (!isOK) { return candidate; } |
106 |
> |
bool isOK = Pattern::add(vpattern,*is); |
107 |
|
} |
108 |
< |
if (pattern.size() == 0) return candidate; |
108 |
> |
if (vpattern[0].size() == 0) return candidate; |
109 |
|
// std::cout <<" ------------------ END EVENT, COMPARE" << std::endl; |
110 |
|
|
111 |
|
GoldenPattern::Key thisKey(detref, ptref, chargeref, phiref ); |
114 |
|
GoldenPattern::Result bestMatching; |
115 |
|
GoldenPattern::Key bestKey; |
116 |
|
for (std::map< GoldenPattern::Key, GoldenPattern>::iterator igps = theGPs.begin(); igps != theGPs.end(); igps++) { |
117 |
+ |
for (auto ip=vpattern.begin(); ip!= vpattern.end();++ip) { |
118 |
+ |
const Pattern & pattern = *ip; |
119 |
|
// if (!(thisKey==igps->first)) continue; |
120 |
|
// std::cout << " HAS PATTERN "<<pattern << std::endl; |
121 |
|
GoldenPattern & gp = igps->second; |
122 |
|
GoldenPattern::Result result = gp.compare(pattern); |
123 |
|
// if (!result.hasRpcDet(637602109) && !result.hasRpcDet(637634877) && !result.hasRpcDet(637599914) && !result.hasRpcDet(637632682)) continue; |
124 |
< |
if (!result.hasRpcDet(igps->first.theDet)) continue; |
125 |
< |
if (result.nMatchedTot() < 5 )continue; |
126 |
< |
if (!result) continue; |
124 |
> |
// if (!result.hasRpcDet(igps->first.theDet)) continue; |
125 |
> |
// if (result.nMatchedTot() < 5 )continue; |
126 |
> |
// if (!result) continue; |
127 |
|
// std::cout <<"PATT KEY: "<<igps->first<<" "<<result<<" is Less: "<<(result<bestMatching)<<" isBetter: "<<(result>bestMatching)<<" isBerres: "<<(bestMatching<result) ; //<<std::endl; |
128 |
|
if (bestMatching < result) { |
129 |
|
bestMatching = result; |
132 |
|
} |
133 |
|
//else std::cout <<std::endl; |
134 |
|
} |
135 |
+ |
} |
136 |
|
|
137 |
|
// std::cout <<" ------------------ END COMPARE: " << std::endl; |
138 |
|
// std::cout <<"BEST KEY: "<<bestKey<<" "<< bestMatching<<std::cout <<" ######"<<" pt: "<< bestKey.ptValue()<<std::endl; |