1072 bool acceptThisEvent =
false;
1077 int nGoodSAMuons = 0;
1078 for (reco::TrackCollection::const_iterator
muon = saMuons->begin();
muon != saMuons->end(); ++
muon ) {
1079 float preco =
muon->p();
1082 GlobalPoint iPnt(innerPo.x(), innerPo.y(),innerPo.z());
1084 GlobalPoint oPnt(outerPo.x(), outerPo.y(),outerPo.z());
1085 float zLength =
abs( iPnt.z() - oPnt.z() );
1088 GlobalVector iP(innerMom.x(), innerMom.y(), innerMom.z() );
1090 GlobalVector oP(outerMom.x(), outerMom.y(), outerMom.z() );
1092 const float zRef = 300.;
1093 float xExt = 10000.;
1094 float yExt = 10000.;
1095 if (
abs(oPnt.z()) <
abs(iPnt.z())) {
1098 deltaZ = zRef - oPnt.
z();
1100 deltaZ = -zRef - oPnt.z();
1102 xExt = oPnt.x() + deltaZ * oP.x() / oP.z();
1103 yExt = oPnt.y() + deltaZ * oP.y() / oP.z();
1107 deltaZ = zRef - iPnt.z();
1109 deltaZ = -zRef - iPnt.z();
1111 xExt = iPnt.x() + deltaZ * iP.x() / iP.z();
1112 yExt = iPnt.y() + deltaZ * iP.y() / iP.z();
1114 float rExt =
sqrt( xExt*xExt + yExt*yExt );
1121 const DetId detId( (*hit)->geographicalId() );
1133 float zOuter = 20000.;
1135 if (
abs(iPnt.z()) <
abs(iPnt.z())) {
1144 bool goodSAMuon = (preco >
pMin)
1150 if (goodSAMuon) {nGoodSAMuons++;}
1160 int nGoodTracks = 0;
1161 for (reco::TrackCollection::const_iterator track =
tracks->begin(); track !=
tracks->end(); ++ track ) {
1162 float preco = track->p();
1163 int n = track->recHitsSize();
1166 GlobalPoint iPnt(innerPo.x(), innerPo.y(),innerPo.z());
1168 GlobalPoint oPnt(outerPo.x(), outerPo.y(),outerPo.z());
1169 float zLength =
abs( iPnt.z() - oPnt.z() );
1172 GlobalVector iP(innerMom.x(), innerMom.y(), innerMom.z() );
1174 GlobalVector oP(outerMom.x(), outerMom.y(), outerMom.z() );
1176 const float zRef = 300.;
1177 float xExt = 10000.;
1178 float yExt = 10000.;
1179 if (
abs(oPnt.z()) >
abs(iPnt.z())) {
1182 deltaZ = zRef - oPnt.
z();
1184 deltaZ = -zRef - oPnt.z();
1186 xExt = oPnt.x() + deltaZ * oP.x() / oP.z();
1187 yExt = oPnt.y() + deltaZ * oP.y() / oP.z();
1191 deltaZ = zRef - iPnt.z();
1193 deltaZ = -zRef - iPnt.z();
1195 xExt = iPnt.x() + deltaZ * iP.x() / iP.z();
1196 yExt = iPnt.y() + deltaZ * iP.y() / iP.z();
1198 float rExt =
sqrt( xExt*xExt + yExt*yExt );
1201 float zOuter = 20000.;
1203 if (
abs(iPnt.z()) <
abs(iPnt.z())) {
1217 if (goodTrack) {nGoodTracks++;}
1225 int nGoodGlobalMuons = 0;
1226 for (reco::MuonCollection::const_iterator global = gMuons->begin(); global != gMuons->end(); ++global ) {
1228 if (global->isGlobalMuon()) {
1230 float pDef = global->p();
1231 float redChiSq = global->globalTrack()->normalizedChi2();
1242 const DetId detId( (*hit)->geographicalId() );
1253 bool goodGlobalMuon = (pDef >
pMin)
1258 if (goodGlobalMuon) {nGoodGlobalMuons++;}
1267 acceptThisEvent = ( (nGoodSAMuons > 0) && (nGoodTracks > 0) ) || (nGoodGlobalMuons > 0) ;
1269 return acceptThisEvent;
int numberOfValidTrackerHits() const
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