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.9 by konec, Mon May 27 11:02:41 2013 UTC vs.
Revision 1.10 by akalinow, Tue Jun 25 10:49:35 2013 UTC

# Line 50 | Line 50 | PatternManager::~PatternManager()
50  
51   void PatternManager::run(const EventObj* ev, const TrackObj * simu, const HitSpecObj * hitSpec,  const VDigiSpec & vDigi)
52   {
53 +
54 +
55    if (!hitSpec) return;
56    if (hitSpec->rawId() == 0 ) return;
57    double phiref = hitSpec->position().phi();
# Line 74 | Line 76 | void PatternManager::run(const EventObj*
76      bool isOK = pattern.add(*is);
77      if (!isOK) return;
78    }
79 +
80    if (pattern.size() == 0) return;
81    theEvUsePatCounter++;
82  
# Line 85 | Line 88 | void PatternManager::run(const EventObj*
88   L1Obj PatternManager::check(const EventObj* ev, const TrackObj * simu, const HitSpecObj * hitSpec,  const VDigiSpec & vDigi)
89   {
90    L1Obj candidate;
91 +
92    if (!hitSpec) return candidate;
93    if (hitSpec->rawId() == 0 ) return candidate;
94    double phiref = hitSpec->position().phi();
# Line 92 | Line 96 | L1Obj PatternManager::check(const EventO
96    int    chargeref = simu->charge();
97    unsigned int detref =  hitSpec->rawId();
98   /*
99 <  if (detref != 637602109 && detref != 637634877 &&
99 >   if (detref != 637602109 && detref != 637634877 &&
100        detref != 637599914 && detref != 637632682 ) return candidate;
101  
102    bool precisePos = ( fabs(hitSpec->position().phi()-1.025) < 0.001);
# Line 109 | Line 113 | L1Obj PatternManager::check(const EventO
113      DetId detId( is->first);
114      if (skipRpcData   && detId.subdetId()==MuonSubdetId::RPC) continue;
115      if (skipDtCscData && (detId.subdetId()==MuonSubdetId::DT || detId.subdetId()==MuonSubdetId::CSC) ) continue;
116 < //    std::cout << "adding------- "<< is-vDigi.begin()+1 <<" digi det: "<<is->first<<"(rpc:"<<(detId.subdetId()==MuonSubdetId::RPC)<<") data: "<<is->second<< std::endl;
116 >    //std::cout << "adding------- "<< is-vDigi.begin()+1 <<" digi det: "<<is->first<<"(rpc:"<<(detId.subdetId()==MuonSubdetId::RPC)<<") data: "<<is->second<< std::endl;
117      Pattern::add(vpattern,*is);
118 < //    std::cout <<" after vpattern has size: "<<vpattern.size() << std::endl;
118 >    //std::cout <<" after vpattern has size: "<<vpattern.size() << std::endl;
119      if (vpattern.size() > 100) break;
120    }
121    if (vpattern[0].size() == 0) return candidate;
122 < //  std::cout <<" ------------------ END EVENT, NOW COMPARE, has #patterns: "<<vpattern.size()<<" vpattern[0].size="<<vpattern[0].size() << std::endl;
122 >  //std::cout <<" ------------------ END EVENT, NOW COMPARE, has #patterns: "<<vpattern.size()<<" vpattern[0].size="<<vpattern[0].size() << std::endl;
123  
124    GoldenPattern::Key thisKey(detref, ptref, chargeref, phiref );
125 < //  std::cout << thisKey << std::endl;
125 >  //std::cout << thisKey << std::endl;
126  
127    GoldenPattern::Result bestMatching;
128    GoldenPattern::Key    bestKey;
129    for (auto ip=vpattern.begin(); ip!= vpattern.end();++ip) {
130    const Pattern & pattern = *ip;
131 < //  std::cout << " HAS PATTERN "<<pattern << std::endl;
132 <  for (std::map< GoldenPattern::Key, GoldenPattern>::iterator igps = theGPs.begin(); igps != theGPs.end(); igps++) {
131 >  //std::cout << " HAS PATTERN "<<pattern << std::endl;
132 >  for (auto igps = theGPs.begin(); igps != theGPs.end(); ++igps) {
133   //    if (!(thisKey==igps->first)) continue;
134      GoldenPattern & gp = igps->second;
135      GoldenPattern::Result result = gp.compare(pattern);
# Line 133 | Line 137 | L1Obj PatternManager::check(const EventO
137   //    if (!result.hasRpcDet(igps->first.theDet)) continue;
138   //    if (result.nMatchedTot() < 5 )continue;
139   //    if (!result) continue;
140 < //     std::cout <<"PATT KEY: "<<igps->first<<" "<<result ; //<<std::endl;
140 >    //std::cout <<"PATT KEY: "<<igps->first<<" "<<result ; //<<std::endl;
141      if (bestMatching < result) {
142        bestMatching = result;
143        bestKey =  igps->first;
144 < //      std::cout <<" ----"<<" pt: "<< bestKey.ptValue()<<std::endl;
144 >      //std::cout <<" ----"<<" pt: "<< bestKey.ptValue()<<std::endl;
145      }
146 < //else std::cout <<std::endl;
146 >    //else std::cout <<std::endl;
147    }
148    }
149  
150 < //  std::cout <<" ------------------ END COMPARE: " << std::endl;
151 < //  std::cout <<"BEST KEY: "<<bestKey<<" "<< bestMatching<<std::cout <<" ######"<<" pt: "<< bestKey.ptValue()<<std::endl;
150 >  //std::cout <<" ------------------ END COMPARE: " << std::endl;
151 >  //std::cout <<"BEST KEY: "<<bestKey<<" "<< bestMatching<<std::cout <<" ######"<<" pt: "<< bestKey.ptValue()<<std::endl;
152   //  abort();
153    if (bestMatching) {
154      candidate.pt = bestKey.ptValue();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines