1083 bool acceptThisEvent =
false;
1088 int nGoodSAMuons = 0;
1089 for (reco::TrackCollection::const_iterator
muon = saMuons->begin();
muon != saMuons->end(); ++
muon ) {
1090 float preco =
muon->p();
1093 GlobalPoint iPnt(innerPo.x(), innerPo.y(),innerPo.z());
1095 GlobalPoint oPnt(outerPo.x(), outerPo.y(),outerPo.z());
1096 float zLength =
abs( iPnt.z() - oPnt.z() );
1099 GlobalVector iP(innerMom.x(), innerMom.y(), innerMom.z() );
1101 GlobalVector oP(outerMom.x(), outerMom.y(), outerMom.z() );
1103 const float zRef = 300.;
1104 float xExt = 10000.;
1105 float yExt = 10000.;
1106 if (
abs(oPnt.z()) <
abs(iPnt.z())) {
1109 deltaZ = zRef - oPnt.
z();
1111 deltaZ = -zRef - oPnt.z();
1113 xExt = oPnt.x() + deltaZ * oP.x() / oP.z();
1114 yExt = oPnt.y() + deltaZ * oP.y() / oP.z();
1118 deltaZ = zRef - iPnt.z();
1120 deltaZ = -zRef - iPnt.z();
1122 xExt = iPnt.x() + deltaZ * iP.x() / iP.z();
1123 yExt = iPnt.y() + deltaZ * iP.y() / iP.z();
1125 float rExt =
sqrt( xExt*xExt + yExt*yExt );
1132 const DetId detId( (*hit)->geographicalId() );
1145 if (
abs(iPnt.z()) <
abs(iPnt.z())) {
1152 bool goodSAMuon = (preco >
pMin)
1158 if (goodSAMuon) {nGoodSAMuons++;}
1168 int nGoodTracks = 0;
1169 for (reco::TrackCollection::const_iterator track =
tracks->begin(); track !=
tracks->end(); ++ track ) {
1170 float preco = track->p();
1171 int n = track->recHitsSize();
1174 GlobalPoint iPnt(innerPo.x(), innerPo.y(),innerPo.z());
1176 GlobalPoint oPnt(outerPo.x(), outerPo.y(),outerPo.z());
1177 float zLength =
abs( iPnt.z() - oPnt.z() );
1180 GlobalVector iP(innerMom.x(), innerMom.y(), innerMom.z() );
1182 GlobalVector oP(outerMom.x(), outerMom.y(), outerMom.z() );
1184 const float zRef = 300.;
1185 float xExt = 10000.;
1186 float yExt = 10000.;
1187 if (
abs(oPnt.z()) >
abs(iPnt.z())) {
1190 deltaZ = zRef - oPnt.
z();
1192 deltaZ = -zRef - oPnt.z();
1194 xExt = oPnt.x() + deltaZ * oP.x() / oP.z();
1195 yExt = oPnt.y() + deltaZ * oP.y() / oP.z();
1199 deltaZ = zRef - iPnt.z();
1201 deltaZ = -zRef - iPnt.z();
1203 xExt = iPnt.x() + deltaZ * iP.x() / iP.z();
1204 yExt = iPnt.y() + deltaZ * iP.y() / iP.z();
1206 float rExt =
sqrt( xExt*xExt + yExt*yExt );
1213 if (goodTrack) {nGoodTracks++;}
1221 int nGoodGlobalMuons = 0;
1222 for (reco::MuonCollection::const_iterator global = gMuons->begin(); global != gMuons->end(); ++global ) {
1224 if (global->isGlobalMuon()) {
1226 float pDef = global->p();
1227 float redChiSq = global->globalTrack()->normalizedChi2();
1238 const DetId detId( (*hit)->geographicalId() );
1249 bool goodGlobalMuon = (pDef >
pMin)
1254 if (goodGlobalMuon) {nGoodGlobalMuons++;}
1263 acceptThisEvent = ( (nGoodSAMuons > 0) && (nGoodTracks > 0) ) || (nGoodGlobalMuons > 0) ;
1265 return acceptThisEvent;
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
Abs< T >::type abs(const T &t)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
int numberOfValidTrackerHits() const