14 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/RPCDigiSpec.h" |
15 |
|
|
16 |
|
void GoldenPattern::Result::runNoCheck() const { |
17 |
– |
float fract = 1; |
17 |
|
|
18 |
+ |
float fract = 1; |
19 |
|
for(auto mType=myResults.cbegin();mType!=myResults.cend();++mType){ |
20 |
|
for (auto it=mType->second.cbegin(); it!=mType->second.cend();++it) fract *= norm(mType->first,it->second); |
21 |
|
} |
22 |
+ |
|
23 |
|
unsigned int nTot = 0; |
24 |
|
for(auto it=nMatchedPoints.cbegin();it!=nMatchedPoints.cend();++it) nTot+=it->second; |
25 |
|
|
27 |
|
theValue*=(myResults[GoldenPattern::POSDT].size()==nMatchedPoints[GoldenPattern::POSDT]); |
28 |
|
theValue*=(myResults[GoldenPattern::POSCSC].size()==nMatchedPoints[GoldenPattern::POSCSC]); |
29 |
|
theValue = ( nTot > 4) ? pow(fract, 1./((float) nTot)) : 0.; |
30 |
+ |
//AK theValue = ( nTot > 4) ? -log(fract) : 9999.0; |
31 |
|
} |
32 |
|
|
33 |
|
float GoldenPattern::Result::norm(GoldenPattern::PosBenCase where, float whereInDist) const { |
34 |
|
float normValue = 2.*(0.5-fabs(whereInDist-0.5)); |
35 |
< |
//normValue = whereInDist; //AK |
35 |
> |
//normValue = 0.95*whereInDist; //AK |
36 |
> |
|
37 |
|
static const float epsilon = 1.e-9; |
38 |
|
if (normValue > epsilon) ++nMatchedPoints[where]; |
39 |
|
else normValue = 0.05; |
77 |
|
|
78 |
|
out <<"Result: " |
79 |
|
<< " value: "<<o.theValue |
80 |
< |
<<" nPos+Ben: ("; |
80 |
> |
<<" (POSRPC, POSCSC, BENCSC, POSDT, BENDT)("; |
81 |
|
for(auto cit=o.myResults.cbegin();cit!=o.myResults.cend();++cit){ |
82 |
|
out<<o.nMatchedPoints[cit->first]<<"/"<<cit->second.size()<<", "; |
83 |
|
} |
84 |
< |
out <<", tot:"<<o.nMatchedTot()<<")"; |
84 |
> |
out <<"tot:"<<o.nMatchedTot()<<")"; |
85 |
|
|
86 |
|
return out; |
87 |
|
} |
88 |
< |
|
88 |
> |
////////////////////////////////////////////////// |
89 |
> |
////////////////////////////////////////////////// |
90 |
|
void GoldenPattern::add( GoldenPattern::PosBenCase aCase, uint32_t rawId, int posOrBen, unsigned int freq){ |
91 |
|
PattCore[aCase][rawId][posOrBen] += freq; |
92 |
|
} |
93 |
< |
|
94 |
< |
|
93 |
> |
////////////////////////////////////////////////// |
94 |
> |
////////////////////////////////////////////////// |
95 |
|
void GoldenPattern::add(const Pattern & p) { |
96 |
|
|
97 |
|
const Pattern::DataType & detdigi = p ; |
108 |
|
} |
109 |
|
case MuonSubdetId::DT: { |
110 |
|
DTphDigiSpec digi(rawId, is->second); |
111 |
< |
if (digi.bxNum() != 0 || digi.bxCnt() != 0 || digi.ts2() != 0) break; |
111 |
> |
if (digi.bxNum() != 0 || digi.bxCnt() != 0 || digi.ts2() != 0 || digi.code()<4) break; |
112 |
|
PattCore[GoldenPattern::POSDT][rawId][digi.phi()]++; |
113 |
|
PattCore[GoldenPattern::BENDT][rawId][digi.phiB()]++; |
114 |
|
break; |
138 |
|
} |
139 |
|
} |
140 |
|
if(nTot<5) return result; |
141 |
< |
|
141 |
> |
///////////////////////////////////////////////////////////////////// |
142 |
|
|
143 |
|
SystFreq::const_iterator cit; |
144 |
|
DetFreq::const_iterator idm; |