36 |
|
PatternManager::~PatternManager() |
37 |
|
{ |
38 |
|
std::cout <<" Events checked for pattenrs: " << theEvForPatCounter << std::endl; |
39 |
< |
std::cout <<" Events used for pattenrs: " << theEvForPatCounter << std::endl; |
39 |
> |
std::cout <<" Events used for pattenrs: " << theEvUsePatCounter << std::endl; |
40 |
|
std::cout <<" Size of GoldenPatterns: " << theGPs.size() << std::endl; |
41 |
|
if (theConfig.getUntrackedParameter<bool>("dump",false)) { |
42 |
|
for (std::map< GoldenPattern::Key, GoldenPattern>::const_iterator |
85 |
|
{ |
86 |
|
L1Obj candidate; |
87 |
|
if (!hitSpec) return candidate; |
88 |
– |
/* |
88 |
|
if (hitSpec->rawId() == 0 ) return candidate; |
89 |
|
double phiref = hitSpec->position().phi(); |
90 |
|
double ptref = simu->pt(); |
91 |
|
int chargeref = simu->charge(); |
92 |
|
unsigned int detref = hitSpec->rawId(); |
93 |
+ |
/* |
94 |
|
if (detref != 637602109 && detref != 637634877 && |
95 |
|
detref != 637599914 && detref != 637632682 ) return candidate; |
96 |
|
|
98 |
|
if (!precisePos) return candidate; |
99 |
|
if ( simu->pt() < 26. || simu->pt() > 27. ) return candidate; |
100 |
|
|
101 |
– |
std::cout <<" ------------------ EVENT: " << std::endl; |
101 |
|
*/ |
102 |
< |
Pattern pattern; |
102 |
> |
// std::cout <<" ------------------ EVENT: " << std::endl; |
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 ); |
112 |
< |
// std::cout << thisKey << std::endl; |
111 |
> |
GoldenPattern::Key thisKey(detref, ptref, chargeref, phiref ); |
112 |
> |
// std::cout << thisKey <<" PATTENR_SIZE: "<<pattern.size()<< std::endl; |
113 |
|
|
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 > bestMatching) { |
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; |
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; |
130 |
|
bestKey = igps->first; |
131 |
< |
} |
132 |
< |
// std::cout <<result << std::endl; |
131 |
> |
// std::cout <<" ----"<<" pt: "<< bestKey.ptValue()<<std::endl; |
132 |
> |
} |
133 |
> |
//else std::cout <<std::endl; |
134 |
|
} |
135 |
+ |
} |
136 |
+ |
|
137 |
|
// std::cout <<" ------------------ END COMPARE: " << std::endl; |
138 |
< |
// std::cout <<"BEST: "<< bestMatching<<" pt: "<<bestKey.ptValue()<<std::endl; |
138 |
> |
// std::cout <<"BEST KEY: "<<bestKey<<" "<< bestMatching<<std::cout <<" ######"<<" pt: "<< bestKey.ptValue()<<std::endl; |
139 |
|
if (bestMatching) { |
140 |
|
candidate.pt = bestKey.ptValue(); |
141 |
|
candidate.eta = 1.; |