38 if ((*iter)->isME0()) {
44 station1Hits.push_back(*iter);
48 station2Hits.push_back(*iter);
52 station3Hits.push_back(*iter);
56 station4Hits.push_back(*iter);
67 if(!station2Hits.empty() && !station3Hits.empty())
72 betterSecondHits = &station3Hits;
73 notAsGoodSecondHits = &station2Hits;
78 if(
makeSeed(station1Hits, *betterSecondHits, result))
82 if(
makeSeed(station1Hits, *notAsGoodSecondHits, result))
86 if(
makeSeed(station2Hits, station3Hits, result))
90 if(
makeSeed(station1Hits, station4Hits, result))
106 for ( MuonRecHitContainer::const_iterator itr1 = hits1.begin(), end1 = hits1.end();
107 itr1 != end1; ++itr1)
109 CSCDetId cscId1((*itr1)->geographicalId().rawId());
112 for ( MuonRecHitContainer::const_iterator itr2 = hits2.begin(), end2 = hits2.end();
113 itr2 != end2; ++itr2)
116 CSCDetId cscId2((*itr2)->geographicalId().rawId());
123 double sigmapt = pts[1];
129 double maxpt = 2000.;
161 int nhits = segment->recHits().size();
162 if ( segment->chi2()/(nhits*2.-4.) > 3. ) Nchi2 = 1;
163 if ( segment->chi2()/(nhits*2.-4.) > 9. ) Nchi2 = 2;
165 if ( nhits > 4 ) quality = 1 + Nchi2;
166 if ( nhits == 4 ) quality = 3 + Nchi2;
167 if ( nhits == 3 ) quality = 5 + Nchi2;
169 float dPhiGloDir = fabs (
deltaPhi(segment->globalPosition().barePhi(), segment->globalDirection().barePhi()) );
171 if ( dPhiGloDir > .2 ) ++
quality;
173 if ( segment->isCSC() and
CSCDetId(segment->geographicalId()).
ring() == 4 )
176 if (
chamber->specs()->gangedStrips() ) ++quality;
188 float dPhiGloDir = .0;
189 float bestdPhiGloDir =
M_PI;
192 for ( MuonRecHitContainer::const_iterator iter = endcapHits.begin(); iter!= endcapHits.end(); iter++ ){
193 if ( !(*iter)->isCSC() && !(*iter)->isME0() )
continue;
201 dPhiGloDir = fabs (
deltaPhi(meit->globalPosition().barePhi(), meit->globalDirection().barePhi()) );
206 bestdPhiGloDir = dPhiGloDir;
211 if ( !me1->isValid() ) {
214 bestdPhiGloDir = dPhiGloDir;
217 if ( me1->isValid() &&
quality < quality1 ) {
220 bestdPhiGloDir = dPhiGloDir;
223 if ( me1->isValid() && bestdPhiGloDir > .03 ) {
224 if ( dPhiGloDir < bestdPhiGloDir - .01 &&
quality == quality1 ) {
227 bestdPhiGloDir = dPhiGloDir;
244 if(me1 && me1->isValid() )
260 seed =
createSeed(momentum[0],momentum[1],last);
268 for ( MuonRecHitContainer::const_iterator iter =
theRhits.begin(); iter!=
theRhits.end(); iter++ ){
269 if ( !(*iter)->isCSC() )
continue;
270 for ( MuonRecHitContainer::const_iterator iter2 = iter + 1; iter2 !=
theRhits.end(); ++iter2)
272 if( !(*iter2)->isCSC() )
continue;
274 CSCDetId cscId1((*iter)->geographicalId().rawId());
275 CSCDetId cscId2((*iter2)->geographicalId().rawId());
276 double dphi =
deltaPhi((**iter).globalPosition().barePhi(), (**iter2).globalPosition().barePhi());
278 int type1 = cscId1.iChamberType();
279 int type2 = cscId2.iChamberType();
284 std::cout <<
"HITPAIRA," << type1 << type2 <<
"," <<
285 dphi <<
"," << (**iter).globalPosition().eta() << std::endl;
289 std::cout <<
"HITPAIRB," << type2 << type1 <<
"," <<
290 -dphi <<
"," << (**iter2).globalPosition().eta() << std::endl;
294 std::cout <<
"HITPAIRSAMESTATION," << type1 << cscId1.ring() << cscId2.ring()
295 <<
"," << dphi <<
"," << (**iter).globalPosition().eta() << std::endl;
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
virtual TrajectorySeed seed() const
MuonTransientTrackingRecHit::MuonRecHitContainer theRhits
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
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