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

Comparing UserCode/L1RpcTriggerAnalysis/src/PatternManager.cc (file contents):
Revision 1.6 by konec, Thu May 23 18:24:04 2013 UTC vs.
Revision 1.8 by konec, Fri May 24 16:47:50 2013 UTC

# Line 8 | Line 8
8   #include "UserCode/L1RpcTriggerAnalysis/interface/DTphDigiSpec.h"
9   #include "UserCode/L1RpcTriggerAnalysis/interface/CSCDigiSpec.h"
10   #include "UserCode/L1RpcTriggerAnalysis/interface/RPCDigiSpec.h"
11 + #include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
12  
13   #include "UserCode/L1RpcTriggerAnalysis/interface/Pattern.h"
14   #include "UserCode/L1RpcTriggerAnalysis/interface/GoldenPattern.h"
# Line 102 | Line 103 | L1Obj PatternManager::check(const EventO
103   //  std::cout <<" ------------------ EVENT: " << std::endl;
104    std::vector<Pattern> vpattern(1);
105    theEvForPatCounter++;
106 +  static bool skipRpcData   = theConfig.getUntrackedParameter<bool>("skipRpcData",  false);
107 +  static bool skipDtCscData = theConfig.getUntrackedParameter<bool>("skipDtCscData",false);
108    for (VDigiSpec::const_iterator is= vDigi.begin(); is!=vDigi.end(); is++) {
109 <    bool isOK = Pattern::add(vpattern,*is);
109 >    DetId detId( is->first);
110 >    if (skipRpcData   && detId.subdetId()==MuonSubdetId::RPC) continue;
111 >    if (skipDtCscData && (detId.subdetId()==MuonSubdetId::DT || detId.subdetId()==MuonSubdetId::CSC) ) continue;
112 >    Pattern::add(vpattern,*is);
113    }
114    if (vpattern[0].size() == 0) return candidate;
115 < //  std::cout <<" ------------------ END EVENT, COMPARE" << std::endl;
115 > //  std::cout <<" ------------------ END EVENT, NOW COMPARE, has #patterns: "<<vpattern.size()<<" vpattern[0].size="<<vpattern[0].size() << std::endl;
116  
117    GoldenPattern::Key thisKey(detref, ptref, chargeref, phiref );
118 < //  std::cout << thisKey <<" PATTENR_SIZE: "<<pattern.size()<< std::endl;
118 > //  std::cout << thisKey << std::endl;
119  
120    GoldenPattern::Result bestMatching;
121    GoldenPattern::Key    bestKey;
116  for (std::map< GoldenPattern::Key, GoldenPattern>::iterator igps = theGPs.begin(); igps != theGPs.end(); igps++) {
122    for (auto ip=vpattern.begin(); ip!= vpattern.end();++ip) {
123 <    const Pattern & pattern = *ip;
123 >  const Pattern & pattern = *ip;
124 > //  std::cout << " HAS PATTERN "<<pattern << std::endl;
125 >  for (std::map< GoldenPattern::Key, GoldenPattern>::iterator igps = theGPs.begin(); igps != theGPs.end(); igps++) {
126   //    if (!(thisKey==igps->first)) continue;
120 //    std::cout << " HAS PATTERN "<<pattern << std::endl;
127      GoldenPattern & gp = igps->second;
128      GoldenPattern::Result result = gp.compare(pattern);
129   //    if (!result.hasRpcDet(637602109) && !result.hasRpcDet(637634877) && !result.hasRpcDet(637599914) && !result.hasRpcDet(637632682)) continue;
130   //   if (!result.hasRpcDet(igps->first.theDet)) continue;
131   //   if (result.nMatchedTot() < 5 )continue;
132   //   if (!result) continue;
133 < //    std::cout <<"PATT KEY: "<<igps->first<<" "<<result<<" is Less: "<<(result<bestMatching)<<" isBetter: "<<(result>bestMatching)<<" isBerres: "<<(bestMatching<result)  ; //<<std::endl;
133 > //     std::cout <<"PATT KEY: "<<igps->first<<" "<<result ; //<<std::endl;
134      if (bestMatching < result) {
135        bestMatching = result;
136        bestKey =  igps->first;
# Line 136 | Line 142 | L1Obj PatternManager::check(const EventO
142  
143   //  std::cout <<" ------------------ END COMPARE: " << std::endl;
144   //  std::cout <<"BEST KEY: "<<bestKey<<" "<< bestMatching<<std::cout <<" ######"<<" pt: "<< bestKey.ptValue()<<std::endl;
145 + //  abort();
146    if (bestMatching) {
147      candidate.pt = bestKey.ptValue();
148      candidate.eta = 1.;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines