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" |
100 |
|
if ( simu->pt() < 26. || simu->pt() > 27. ) return candidate; |
101 |
|
|
102 |
|
*/ |
103 |
< |
// std::cout <<" ------------------ EVENT: " << std::endl; |
103 |
> |
// std::cout <<" ------------------ EVENT: "<<*ev <<" number of digis: "<<vDigi.size()<< 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 |
> |
// std::cout << "adding------- "<< is-vDigi.begin()+1 <<" digi det: "<<is->first<<"(rpc:"<<(detId.subdetId()==MuonSubdetId::RPC)<<") data: "<<is->second<< std::endl; |
113 |
> |
Pattern::add(vpattern,*is); |
114 |
> |
// std::cout <<" after vpattern has size: "<<vpattern.size() << std::endl; |
115 |
> |
if (vpattern.size() > 100) break; |
116 |
|
} |
117 |
|
if (vpattern[0].size() == 0) return candidate; |
118 |
< |
// std::cout <<" ------------------ END EVENT, COMPARE" << std::endl; |
118 |
> |
// std::cout <<" ------------------ END EVENT, NOW COMPARE, has #patterns: "<<vpattern.size()<<" vpattern[0].size="<<vpattern[0].size() << std::endl; |
119 |
|
|
120 |
|
GoldenPattern::Key thisKey(detref, ptref, chargeref, phiref ); |
121 |
< |
// std::cout << thisKey <<" PATTENR_SIZE: "<<pattern.size()<< std::endl; |
121 |
> |
// std::cout << thisKey << std::endl; |
122 |
|
|
123 |
|
GoldenPattern::Result bestMatching; |
124 |
|
GoldenPattern::Key bestKey; |
116 |
– |
for (std::map< GoldenPattern::Key, GoldenPattern>::iterator igps = theGPs.begin(); igps != theGPs.end(); igps++) { |
125 |
|
for (auto ip=vpattern.begin(); ip!= vpattern.end();++ip) { |
126 |
< |
const Pattern & pattern = *ip; |
126 |
> |
const Pattern & pattern = *ip; |
127 |
> |
// std::cout << " HAS PATTERN "<<pattern << std::endl; |
128 |
> |
for (std::map< GoldenPattern::Key, GoldenPattern>::iterator igps = theGPs.begin(); igps != theGPs.end(); igps++) { |
129 |
|
// if (!(thisKey==igps->first)) continue; |
120 |
– |
// std::cout << " HAS PATTERN "<<pattern << std::endl; |
130 |
|
GoldenPattern & gp = igps->second; |
131 |
|
GoldenPattern::Result result = gp.compare(pattern); |
132 |
|
// if (!result.hasRpcDet(637602109) && !result.hasRpcDet(637634877) && !result.hasRpcDet(637599914) && !result.hasRpcDet(637632682)) continue; |
133 |
< |
// if (!result.hasRpcDet(igps->first.theDet)) continue; |
134 |
< |
// if (result.nMatchedTot() < 5 )continue; |
135 |
< |
// if (!result) continue; |
136 |
< |
// std::cout <<"PATT KEY: "<<igps->first<<" "<<result<<" is Less: "<<(result<bestMatching)<<" isBetter: "<<(result>bestMatching)<<" isBerres: "<<(bestMatching<result) ; //<<std::endl; |
133 |
> |
// if (!result.hasRpcDet(igps->first.theDet)) continue; |
134 |
> |
// if (result.nMatchedTot() < 5 )continue; |
135 |
> |
// if (!result) continue; |
136 |
> |
// std::cout <<"PATT KEY: "<<igps->first<<" "<<result ; //<<std::endl; |
137 |
|
if (bestMatching < result) { |
138 |
|
bestMatching = result; |
139 |
|
bestKey = igps->first; |
145 |
|
|
146 |
|
// std::cout <<" ------------------ END COMPARE: " << std::endl; |
147 |
|
// std::cout <<"BEST KEY: "<<bestKey<<" "<< bestMatching<<std::cout <<" ######"<<" pt: "<< bestKey.ptValue()<<std::endl; |
148 |
+ |
// abort(); |
149 |
|
if (bestMatching) { |
150 |
|
candidate.pt = bestKey.ptValue(); |
151 |
|
candidate.eta = 1.; |