1070 bool acceptThisEvent =
false;
1075 int nGoodSAMuons = 0;
1076 for (reco::TrackCollection::const_iterator
muon = saMuons->begin();
muon != saMuons->end(); ++
muon ) {
1077 float preco =
muon->p();
1080 GlobalPoint iPnt(innerPo.x(), innerPo.y(),innerPo.z());
1082 GlobalPoint oPnt(outerPo.x(), outerPo.y(),outerPo.z());
1083 float zLength =
abs( iPnt.z() - oPnt.z() );
1086 GlobalVector iP(innerMom.x(), innerMom.y(), innerMom.z() );
1088 GlobalVector oP(outerMom.x(), outerMom.y(), outerMom.z() );
1090 const float zRef = 300.;
1091 float xExt = 10000.;
1092 float yExt = 10000.;
1093 if (
abs(oPnt.z()) <
abs(iPnt.z())) {
1096 deltaZ = zRef - oPnt.
z();
1098 deltaZ = -zRef - oPnt.z();
1100 xExt = oPnt.x() + deltaZ * oP.x() / oP.z();
1101 yExt = oPnt.y() + deltaZ * oP.y() / oP.z();
1105 deltaZ = zRef - iPnt.z();
1107 deltaZ = -zRef - iPnt.z();
1109 xExt = iPnt.x() + deltaZ * iP.x() / iP.z();
1110 yExt = iPnt.y() + deltaZ * iP.y() / iP.z();
1112 float rExt =
sqrt( xExt*xExt + yExt*yExt );
1119 const DetId detId( (*hit)->geographicalId() );
1132 if (
abs(iPnt.z()) <
abs(iPnt.z())) {
1139 bool goodSAMuon = (preco >
pMin)
1145 if (goodSAMuon) {nGoodSAMuons++;}
1155 int nGoodTracks = 0;
1156 for (reco::TrackCollection::const_iterator track =
tracks->begin(); track !=
tracks->end(); ++ track ) {
1157 float preco = track->p();
1158 int n = track->recHitsSize();
1161 GlobalPoint iPnt(innerPo.x(), innerPo.y(),innerPo.z());
1163 GlobalPoint oPnt(outerPo.x(), outerPo.y(),outerPo.z());
1164 float zLength =
abs( iPnt.z() - oPnt.z() );
1167 GlobalVector iP(innerMom.x(), innerMom.y(), innerMom.z() );
1169 GlobalVector oP(outerMom.x(), outerMom.y(), outerMom.z() );
1171 const float zRef = 300.;
1172 float xExt = 10000.;
1173 float yExt = 10000.;
1174 if (
abs(oPnt.z()) >
abs(iPnt.z())) {
1177 deltaZ = zRef - oPnt.
z();
1179 deltaZ = -zRef - oPnt.z();
1181 xExt = oPnt.x() + deltaZ * oP.x() / oP.z();
1182 yExt = oPnt.y() + deltaZ * oP.y() / oP.z();
1186 deltaZ = zRef - iPnt.z();
1188 deltaZ = -zRef - iPnt.z();
1190 xExt = iPnt.x() + deltaZ * iP.x() / iP.z();
1191 yExt = iPnt.y() + deltaZ * iP.y() / iP.z();
1193 float rExt =
sqrt( xExt*xExt + yExt*yExt );
1200 if (goodTrack) {nGoodTracks++;}
1208 int nGoodGlobalMuons = 0;
1209 for (reco::MuonCollection::const_iterator global = gMuons->begin(); global != gMuons->end(); ++global ) {
1211 if (global->isGlobalMuon()) {
1213 float pDef = global->p();
1214 float redChiSq = global->globalTrack()->normalizedChi2();
1225 const DetId detId( (*hit)->geographicalId() );
1236 bool goodGlobalMuon = (pDef >
pMin)
1241 if (goodGlobalMuon) {nGoodGlobalMuons++;}
1250 acceptThisEvent = ( (nGoodSAMuons > 0) && (nGoodTracks > 0) ) || (nGoodGlobalMuons > 0) ;
1252 return acceptThisEvent;
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
int numberOfValidTrackerHits() const