39 station1Hits.push_back(*iter);
43 station2Hits.push_back(*iter);
47 station3Hits.push_back(*iter);
51 station4Hits.push_back(*iter);
62 if(!station2Hits.empty() && !station3Hits.empty())
67 betterSecondHits = &station3Hits;
68 notAsGoodSecondHits = &station2Hits;
73 if(
makeSeed(station1Hits, *betterSecondHits, result))
77 if(
makeSeed(station1Hits, *notAsGoodSecondHits, result))
81 if(
makeSeed(station2Hits, station3Hits, result))
85 if(
makeSeed(station1Hits, station4Hits, result))
101 for ( MuonRecHitContainer::const_iterator itr1 = hits1.begin(), end1 = hits1.end();
102 itr1 != end1; ++itr1)
104 CSCDetId cscId1((*itr1)->geographicalId().rawId());
107 for ( MuonRecHitContainer::const_iterator itr2 = hits2.begin(), end2 = hits2.end();
108 itr2 != end2; ++itr2)
111 CSCDetId cscId2((*itr2)->geographicalId().rawId());
118 double sigmapt = pts[1];
124 double maxpt = 2000.;
156 int nhits = segment->recHits().size();
157 if ( segment->chi2()/(nhits*2.-4.) > 3. ) Nchi2 = 1;
158 if ( segment->chi2()/(nhits*2.-4.) > 9. ) Nchi2 = 2;
160 if ( nhits > 4 ) quality = 1 + Nchi2;
161 if ( nhits == 4 ) quality = 3 + Nchi2;
162 if ( nhits == 3 ) quality = 5 + Nchi2;
164 float dPhiGloDir = fabs (
deltaPhi(segment->globalPosition().phi(), segment->globalDirection().phi()) );
166 if ( dPhiGloDir > .2 ) ++quality;
168 if(segment->isCSC() &&
CSCDetId(segment->geographicalId()).
ring() == 4) ++quality;
178 float dPhiGloDir = .0;
179 float bestdPhiGloDir =
M_PI;
180 int quality1 = 0, quality = 0;
182 for ( MuonRecHitContainer::const_iterator iter = endcapHits.begin(); iter!= endcapHits.end(); iter++ ){
183 if ( !(*iter)->isCSC() )
continue;
191 dPhiGloDir = fabs (
deltaPhi(meit->globalPosition().phi(), meit->globalDirection().phi()) );
196 bestdPhiGloDir = dPhiGloDir;
201 if ( !me1->isValid() ) {
204 bestdPhiGloDir = dPhiGloDir;
207 if ( me1->isValid() && quality < quality1 ) {
210 bestdPhiGloDir = dPhiGloDir;
213 if ( me1->isValid() && bestdPhiGloDir > .03 ) {
214 if ( dPhiGloDir < bestdPhiGloDir - .01 && quality == quality1 ) {
217 bestdPhiGloDir = dPhiGloDir;
234 if(me1 && me1->isValid() )
250 seed =
createSeed(momentum[0],momentum[1],last);
258 for ( MuonRecHitContainer::const_iterator iter =
theRhits.begin(); iter!=
theRhits.end(); iter++ ){
259 if ( !(*iter)->isCSC() )
continue;
260 for ( MuonRecHitContainer::const_iterator iter2 = iter + 1; iter2 !=
theRhits.end(); ++iter2)
262 if( !(*iter2)->isCSC() )
continue;
264 CSCDetId cscId1((*iter)->geographicalId().rawId());
265 CSCDetId cscId2((*iter2)->geographicalId().rawId());
266 double dphi =
deltaPhi((**iter).globalPosition().phi(), (**iter2).globalPosition().phi());
268 int type1 = cscId1.iChamberType();
269 int type2 = cscId2.iChamberType();
274 std::cout <<
"HITPAIRA," << type1 << type2 <<
"," <<
275 dphi <<
"," << (**iter).globalPosition().eta() << std::endl;
279 std::cout <<
"HITPAIRB," << type2 << type1 <<
"," <<
280 -dphi <<
"," << (**iter2).globalPosition().eta() << std::endl;
284 std::cout <<
"HITPAIRSAMESTATION," << type1 << cscId1.ring() << cscId2.ring()
285 <<
"," << dphi <<
"," << (**iter).globalPosition().eta() << std::endl;
virtual TrajectorySeed seed() const
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
const MuonSeedPtExtractor * thePtExtractor
static const double pts[33]
ConstMuonRecHitPointer bestEndcapHit(const MuonRecHitContainer &endcapHits) const
bool createDefaultEndcapSeed(ConstMuonRecHitPointer last, TrajectorySeed &seed) const
int segmentQuality(ConstMuonRecHitPointer muon) const
void makeDefaultSeed(TrajectorySeed &seed) const
TrajectorySeed createSeed(float ptmean, float sptmean, MuonTransientTrackingRecHit::ConstMuonRecHitPointer last) const
bool makeSeed(const MuonRecHitContainer &hits1, const MuonRecHitContainer &hits2, TrajectorySeed &seed) const