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().barePhi(), segment->globalDirection().barePhi()) );
166 if ( dPhiGloDir > .2 ) ++
quality;
168 if ( segment->isCSC() and
CSCDetId(segment->geographicalId()).
ring() == 4 )
170 const auto chamber =
dynamic_cast<const CSCChamber*
>(segment->det());
171 if ( chamber->specs()->gangedStrips() ) ++quality;
183 float dPhiGloDir = .0;
184 float bestdPhiGloDir =
M_PI;
187 for ( MuonRecHitContainer::const_iterator iter = endcapHits.begin(); iter!= endcapHits.end(); iter++ ){
188 if ( !(*iter)->isCSC() )
continue;
196 dPhiGloDir = fabs (
deltaPhi(meit->globalPosition().barePhi(), meit->globalDirection().barePhi()) );
201 bestdPhiGloDir = dPhiGloDir;
206 if ( !me1->isValid() ) {
209 bestdPhiGloDir = dPhiGloDir;
212 if ( me1->isValid() &&
quality < quality1 ) {
215 bestdPhiGloDir = dPhiGloDir;
218 if ( me1->isValid() && bestdPhiGloDir > .03 ) {
219 if ( dPhiGloDir < bestdPhiGloDir - .01 &&
quality == quality1 ) {
222 bestdPhiGloDir = dPhiGloDir;
239 if(me1 && me1->isValid() )
255 seed =
createSeed(momentum[0],momentum[1],last);
263 for ( MuonRecHitContainer::const_iterator iter =
theRhits.begin(); iter!=
theRhits.end(); iter++ ){
264 if ( !(*iter)->isCSC() )
continue;
265 for ( MuonRecHitContainer::const_iterator iter2 = iter + 1; iter2 !=
theRhits.end(); ++iter2)
267 if( !(*iter2)->isCSC() )
continue;
269 CSCDetId cscId1((*iter)->geographicalId().rawId());
270 CSCDetId cscId2((*iter2)->geographicalId().rawId());
271 double dphi =
deltaPhi((**iter).globalPosition().barePhi(), (**iter2).globalPosition().barePhi());
273 int type1 = cscId1.iChamberType();
274 int type2 = cscId2.iChamberType();
279 std::cout <<
"HITPAIRA," << type1 << type2 <<
"," <<
280 dphi <<
"," << (**iter).globalPosition().eta() << std::endl;
284 std::cout <<
"HITPAIRB," << type2 << type1 <<
"," <<
285 -dphi <<
"," << (**iter2).globalPosition().eta() << std::endl;
289 std::cout <<
"HITPAIRSAMESTATION," << type1 << cscId1.ring() << cscId2.ring()
290 <<
"," << 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