ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/src/GoldenPattern.cc
(Generate patch)

Comparing UserCode/L1RpcTriggerAnalysis/src/GoldenPattern.cc (file contents):
Revision 1.3 by konec, Fri May 24 16:47:50 2013 UTC vs.
Revision 1.5 by akalinow, Tue Jun 25 10:49:35 2013 UTC

# Line 20 | Line 20 | void GoldenPattern::Result::runNoCheck()
20    for (auto i=benCscResult.begin(); i!=benCscResult.end();i++) fract *= norm(BENCSC,i->second);
21    for (auto i=benDtResult.begin();  i!=benDtResult.end();i++)  fract *= norm(BENDT, i->second);
22    unsigned int nTot = nMatchedPosRpc+nMatchedPosCsc+nMatchedPosDt+nMatchedBenCsc+nMatchedBenDt;
23 <  theValue = ( nTot > 2) ? pow(fract, 1./((double) nTot)) : 0.;
23 >  theValue = ( nTot > 4) ? pow(fract, 1./((double) nTot)) : 0.;
24    if (posRpcResult.size() != nMatchedPosRpc) theValue = 0.;
25    if (posCscResult.size() != nMatchedPosCsc) theValue = 0.;
26    if (posDtResult.size()  != nMatchedPosDt)  theValue = 0.;
# Line 71 | Line 71 | unsigned int GoldenPattern::Result::nMat
71    return nMatchedPosRpc+nMatchedPosCsc+nMatchedBenCsc+nMatchedPosDt+nMatchedBenDt;
72   }
73  
74 +
75   std::ostream & operator << (std::ostream &out, const GoldenPattern::Result& o)
76   {
77    o.run();
# Line 130 | Line 131 | void GoldenPattern::add(const Pattern &
131   GoldenPattern::Result GoldenPattern::compare(const Pattern &p) const
132   {
133    Result result;
134 +
135    const Pattern::DataType & detdigi = p;
136    for (Pattern::DataType::const_iterator is = detdigi.begin(); is != detdigi.end(); ++is) {
137      uint32_t rawId = is->first;
# Line 196 | Line 198 | double GoldenPattern::whereInDistributio
198  
199   void GoldenPattern::purge()
200   {
201 +
202    for (DetFreq::iterator idf=posRpc.begin(); idf != posRpc.end(); idf++) {
203      MFreq & mfreq = idf->second;
204      MFreq::iterator imf =  mfreq.begin();
# Line 210 | Line 213 | void GoldenPattern::purge()
213        if (mfreq[pos]==1 && bef1==0 && aft1==0) remove = true;
214        if (mfreq[pos]==1 && aft1==1 && aft2==0 && aft3==0 && bef1==0 && bef2==0)  remove = true;
215        if (mfreq[pos]==2 && aft1==0 && aft2==0 && bef1==0 && bef2==0)  remove = true;
216 +      //if(remove) std::cout<<"Cleaning pattern: "<<*this<<std::endl;      
217        if (remove) { mfreq.erase(imf++); } else { ++imf; }
218      }
219    }
220    DetFreq::iterator idf=posRpc.begin();  
221    while (idf != posRpc.end()) if (idf->second.size()==0) posRpc.erase(idf++);  else  ++idf;
222  
223 < }
223 >  }
224  
225   std::ostream & operator << (std::ostream &out, const GoldenPattern & o) {
226     out <<"GoldenPattern"<< o.theKey <<std::endl;
227     // RPC
228     for (GoldenPattern::DetFreq::const_iterator im = o.posRpc.begin(); im != o.posRpc.end(); im++) {
229 <     out <<"RPC Det:"<< im->first<<" Pos: ";
229 >     out <<"POSRPC Det: "<< im->first<<" Value: ";
230       for (GoldenPattern::MFreq::const_iterator it = im->second.begin(); it !=  im->second.end(); it++) { out << it->first<<":"<<it->second<<", "; }
231       out << std::endl;
232     }
233 <   // DT pos
234 <   for (GoldenPattern::DetFreq::const_iterator im = o.posDt.begin(); im != o.posDt.end(); im++) {
235 <     out <<"DT  Det:"<< im->first<<" Pos: ";
233 >   // Csc pos
234 >   for (GoldenPattern::DetFreq::const_iterator im = o.posCsc.begin(); im != o.posCsc.end(); im++) {
235 >     out <<"POSCSC Det: "<< im->first<<" Value: ";
236       for (GoldenPattern::MFreq::const_iterator it = im->second.begin(); it !=  im->second.end(); it++) { out << it->first<<":"<<it->second<<", "; }
237       out << std::endl;
238     }
239 <   // DT bending
240 <   for (GoldenPattern::DetFreq::const_iterator im = o.bendingDt.begin(); im != o.bendingDt.end(); im++) {
241 <     out <<"DT  Det:"<< im->first<<" Ben: ";
239 >   // Csc bending
240 >   for (GoldenPattern::DetFreq::const_iterator im = o.bendingCsc.begin(); im != o.bendingCsc.end(); im++) {
241 >     out <<"BENCSC Det: "<< im->first<<" Value: ";
242       for (GoldenPattern::MFreq::const_iterator it = im->second.begin(); it !=  im->second.end(); it++) { out << it->first<<":"<<it->second<<", "; }
243       out << std::endl;
244     }
245 <
246 <   // Csc pos
247 <   for (GoldenPattern::DetFreq::const_iterator im = o.posCsc.begin(); im != o.posCsc.end(); im++) {
244 <     out <<"Csc  Det:"<< im->first<<" Pos: ";
245 >   // DT pos
246 >   for (GoldenPattern::DetFreq::const_iterator im = o.posDt.begin(); im != o.posDt.end(); im++) {
247 >     out <<"POSDT Det: "<< im->first<<" Value: ";
248       for (GoldenPattern::MFreq::const_iterator it = im->second.begin(); it !=  im->second.end(); it++) { out << it->first<<":"<<it->second<<", "; }
249       out << std::endl;
250     }
251 <   // Csc bending
252 <   for (GoldenPattern::DetFreq::const_iterator im = o.bendingCsc.begin(); im != o.bendingCsc.end(); im++) {
253 <     out <<"Csc  Det:"<< im->first<<" Ben: ";
251 >   // DT bending
252 >   for (GoldenPattern::DetFreq::const_iterator im = o.bendingDt.begin(); im != o.bendingDt.end(); im++) {
253 >     out <<"BENDT Det: "<< im->first<<" Value: ";
254       for (GoldenPattern::MFreq::const_iterator it = im->second.begin(); it !=  im->second.end(); it++) { out << it->first<<":"<<it->second<<", "; }
255       out << std::endl;
256     }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines