93 |
|
// check reference muon |
94 |
|
// |
95 |
|
const reco::Muon * theMuon = theBestMuonFinder.result(ev,es); |
96 |
< |
if (theConfig.getParameter<bool>("onlyBestMuEvents") && (!theMuon || !theBestMuonFinder.isUnique(ev,es)) ) return; |
96 |
> |
if (theConfig.getParameter<bool>("onlyBestMuEvents") && (!theMuon) ) return; |
97 |
|
theCounter++; |
98 |
|
|
99 |
|
// |
127 |
|
// |
128 |
|
// fill muon info |
129 |
|
// |
130 |
+ |
muon->isUnique = theBestMuonFinder.isUnique(ev,es); |
131 |
+ |
muon->nAllMuons = theBestMuonFinder.numberOfAllMuons(ev,es); |
132 |
|
if (theMuon) { |
133 |
< |
muon->setKine(theMuon->track()->pt(), theMuon->track()->eta(), theMuon->track()->phi(), theMuon->track()->charge()); |
133 |
> |
muon->setKine(theMuon->bestTrack()->pt(), theMuon->bestTrack()->eta(), theMuon->bestTrack()->phi(), theMuon->bestTrack()->charge()); |
134 |
|
muon->setBits(theMuon->isGlobalMuon(), theMuon->isTrackerMuon(), theMuon->isStandAloneMuon(), theMuon->isCaloMuon(), theMuon->isMatchesValid()); |
135 |
|
muon->nMatchedStations = theMuon->numberOfMatchedStations(); |
136 |
|
if (theMuon->isGlobalMuon()) { |
158 |
|
// |
159 |
|
// hits and detectors compatible with muon track |
160 |
|
// |
161 |
< |
if (theMuon && muon->pt() > 10.) { |
161 |
> |
if (theMuon && muon->pt() > 10. && theMuon->isGlobalMuon()) { |
162 |
|
detsHitsCompatibleWithMuon = theDetHitCollector.compatibleHits( theMuon, ev, es); |
163 |
|
detsCrossedByMuon = theDetHitCollector.compatibleDets( theMuon, ev, es, false); |
164 |
|
detsCrossedByMuonDeepInside = theDetHitCollector.compatibleDets( theMuon, ev, es, true); |
169 |
|
// |
170 |
|
// fill LinkSynchroAnalysis data |
171 |
|
// |
172 |
< |
if (theMuon) { |
172 |
> |
if (theMuon && theMuon->isGlobalMuon()) { |
173 |
|
theSynchroGrabber.setMuon(theMuon); |
174 |
|
RPCRawSynchro::ProdItem rawCounts = theSynchroGrabber.counts(ev,es); |
175 |
|
counts = ConverterRPCRawSynchroSynchroCountsObj::toSynchroObj(rawCounts); |
182 |
|
std::vector<L1Obj> l1Obj = theL1ObjMaker(ev); |
183 |
|
l1ObjColl->set( l1Obj); |
184 |
|
std::vector<bool> matching(l1Obj.size(), false); |
185 |
< |
std::vector<double> deltaR(l1Obj.size(), 0.); |
185 |
> |
std::vector<double> deltaR(l1Obj.size(), 999.); |
186 |
|
TrackToL1ObjMatcher matcher(theConfig.getParameter<edm::ParameterSet>("matcherPSet")); |
187 |
< |
if (theMuon){ |
187 |
> |
if (theMuon && theMuon->isGlobalMuon()){ |
188 |
|
for(unsigned int i=0; i< l1Obj.size(); ++i) { |
189 |
|
if (matcher(l1Obj[i].eta, l1Obj[i].phi, theMuon, ev,es)) matching[i]=true; |
190 |
|
TrackToL1ObjMatcher::LastResult result = matcher.lastResult(); |
193 |
|
} |
194 |
|
l1ObjColl->set( matching ); |
195 |
|
l1ObjColl->set( deltaR ); |
196 |
< |
std::cout <<"----------"<<std::endl; |
197 |
< |
std::cout <<*l1ObjColl << std::endl; |
196 |
> |
// std::cout <<"----------"<<std::endl; |
197 |
> |
// std::cout <<*l1ObjColl << std::endl; |
198 |
|
|
199 |
|
// |
200 |
|
// fill ntuple + cleanup |