45 produces<TrajectorySeedCollection>();
48 theEnableDTFlag = pset.
getParameter<
bool>(
"EnableDTMeasurement");
50 theEnableCSCFlag = pset.
getParameter<
bool>(
"EnableCSCMeasurement");
63 theParameters[
"topmb41"] = 0.87;
64 theParameters[
"bottommb41"] = 1.2;
65 theParameters[
"topmb42"] = 0.67;
66 theParameters[
"bottommb42"] = 0.98;
67 theParameters[
"topmb43"] = 0.34;
68 theParameters[
"bottommb43"] = 0.58;
69 theParameters[
"topmb31"] = 0.54;
70 theParameters[
"bottommb31"] = 0.77;
71 theParameters[
"topmb32"] = 0.35;
72 theParameters[
"bottommb32"] = 0.55;
73 theParameters[
"topmb21"] = 0.21;
74 theParameters[
"bottommb21"] = 0.31;
80 theEnableDTFlag,theEnableCSCFlag,
false);
89 delete muonMeasurements;
108 vector<const DetLayer*> dtLayers = theMuonLayers->allDTLayers();
111 vector<const DetLayer*> cscForwardLayers = theMuonLayers->forwardCSCLayers();
112 vector<const DetLayer*> cscBackwardLayers = theMuonLayers->backwardCSCLayers();
116 muonMeasurements->setEvent(event);
120 vector<MuonRecHitContainer> RHMBs;
121 vector<MuonRecHitContainer> RHMEFs;
122 vector<MuonRecHitContainer> RHMEBs;
126 for (vector<const DetLayer*>::reverse_iterator icsclayer = cscForwardLayers.rbegin();
127 icsclayer != cscForwardLayers.rend() - 1; ++icsclayer) {
130 allHits.insert(allHits.end(),RHMF.begin(),RHMF.end());
134 for (vector<const DetLayer*>::reverse_iterator icsclayer = cscBackwardLayers.rbegin();
135 icsclayer != cscBackwardLayers.rend() - 1; ++icsclayer) {
138 allHits.insert(allHits.end(),RHMF.begin(),RHMF.end());
142 for (vector<const DetLayer*>::reverse_iterator idtlayer = dtLayers.rbegin();
143 idtlayer != dtLayers.rend(); ++idtlayer) {
146 RHMBs.push_back(RHMB);
148 if ( idtlayer != dtLayers.rbegin() ) allHits.insert(allHits.end(),RHMB.begin(),RHMB.end());
154 LogTrace(category)<<
"all RecHits: "<<allHits.size();
163 createSeeds(seeds, mb42, eSetup);
169 createSeeds(seeds, mb31, eSetup);
174 if ( !allHits.empty() ) {
177 LogTrace(category)<<
"good RecHits: "<<goodhits.size();
179 if ( goodhits.empty() ) {
180 LogTrace(category)<<
"No qualified Segments in Event! ";
181 LogTrace(category)<<
"Use 2D RecHit";
183 createSeeds(seeds,allHits,eSetup);
187 createSeeds(seeds,goodhits,eSetup);
191 LogTrace(category)<<
"Seeds built: "<<seeds.size();
193 for(std::vector<TrajectorySeed>::iterator
seed = seeds.begin();
195 output->push_back(*
seed);
209 if ( !hit->
isValid() )
return false;
216 if (hit->
isDT() && ( hit->
chi2()> theMaxDTChi2 )) {
217 LogTrace(category)<<
"DT chi2 too large";
220 else if (hit->
isCSC() &&( hit->
chi2()> theMaxCSCChi2 ) ) {
221 LogTrace(category)<<
"CSC chi2 too large";
234 for (MuonRecHitContainer::const_iterator
hit = hits.begin();
hit != hits.end();
hit++) {
235 if ( checkQuality(*
hit) ) result.push_back(*
hit);
238 if ( result.size() < 2 )
return result;
243 for (MuonRecHitContainer::iterator
hit = result.begin();
hit != result.end();
hit++) {
244 if (*
hit == 0)
continue;
245 if ( !(*hit)->isValid() )
continue;
249 for (MuonRecHitContainer::iterator hit2 =
hit + 1; hit2 != result.end(); hit2++) {
250 if (*hit2 == 0)
continue;
251 if ( !(*hit2)->isValid() )
continue;
256 if ( !areCorrelated((*
hit),(*hit2)) )
continue;
258 if ( !leftIsBetter((*
hit),(*hit2)) ) {
263 if ( good ) result2.push_back(*
hit);
278 if (hits.size() == 0 || results.size() >= theMaxSeeds )
return;
279 for (MuonRecHitContainer::const_iterator ihit = hits.begin(); ihit != hits.end(); ihit++) {
280 const std::vector<TrajectorySeed>& sds = createSeed((*ihit),eSetup);
281 LogTrace(category)<<
"created seeds from rechit "<<sds.size();
282 results.insert(results.end(),sds.begin(),sds.end());
283 if ( results.size() >= theMaxSeeds )
break;
294 if (hitpairs.size() == 0 || results.size() >= theMaxSeeds )
return;
295 for (CosmicMuonSeedGenerator::MuonRecHitPairVector::const_iterator ihitpair = hitpairs.begin(); ihitpair != hitpairs.end(); ihitpair++) {
296 const std::vector<TrajectorySeed>& sds = createSeed((*ihitpair),eSetup);
297 LogTrace(category)<<
"created seeds from rechit "<<sds.size();
298 results.insert(results.end(),sds.begin(),sds.end());
299 if ( results.size() >= theMaxSeeds )
break;
307 std::vector<TrajectorySeed>
result;
333 polar *=fabs(pt)/polar.
perp();
354 LogTrace(category)<<
"Trajectory State on Surface of Seed";
355 LogTrace(category)<<
"mom: "<<tsos.globalMomentum()<<
" phi: "<<tsos.globalMomentum().phi();
356 LogTrace(category)<<
"pos: " << tsos.globalPosition();
357 LogTrace(category) <<
"The RecSegment relies on: ";
376 if ( (deltaR<double>(dir1.
eta(), dir1.
phi(), dir2.
eta(), dir2.
phi()) < 0.1 || deltaR<double>(dir1.
eta(), dir1.
phi(), -dir2.
eta(), -dir2.
phi()) < 0.1 )
380 if ( (deltaR<double>(dir1.
eta(), dir1.
phi(), dir2.
eta(), dir2.
phi()) < 0.1 || deltaR<double>(dir1.
eta(), dir1.
phi(), -dir2.
eta(), -dir2.
phi()) < 0.1 ) &&
381 (deltaR<double>(dir1.
eta(), dir1.
phi(), dis.
eta(), dis.
phi()) < 0.1 || deltaR<double>(dir2.
eta(), dir2.
phi(), dis.
eta(), dis.
phi()) < 0.1 ) )
384 if ( fabs(dir1.
eta()) > 4.0 || fabs(dir2.
eta()) > 4.0 ) {
385 if ( (fabs(dir1.
theta() - dir2.
theta()) < 0.07 ||
403 (lhs)->chi2() < (rhs)->chi2() ) )
return true;
415 if (hits1.empty() || hits2.empty() )
return result;
417 for (MuonRecHitContainer::const_iterator ihit1 = hits1.begin(); ihit1 != hits1.end(); ihit1++) {
418 if ( !checkQuality(*ihit1) )
continue;
420 for (MuonRecHitContainer::const_iterator ihit2 = hits2.begin(); ihit2 != hits2.end(); ihit2++) {
421 if ( !checkQuality(*ihit2) )
continue;
423 float dphi =
deltaPhi((*ihit1)->globalPosition().phi(), (*ihit2)->globalPosition().phi());
425 if ((*ihit1)->globalPosition().y() > 0.0 && ( (*ihit1)->globalPosition().y() > (*ihit2)->globalPosition().y() ) ) {
429 }
else if ((*ihit1)->globalPosition().y() < 0.0 && ( (*ihit1)->globalPosition().y() < (*ihit2)->globalPosition().y() ) ) {
443 std::vector<TrajectorySeed>
result;
449 float dphi =
deltaPhi((hitpair.
first)->globalDirection().phi(), (hitpair.
second)->globalDirection().phi());
453 map<string, float>::const_iterator iterPar = theParameters.find(hitpair.
type);
454 if ( iterPar == theParameters.end() ) {
459 int charge = (dphi > 0) ? -1 : 1;
462 float paraC = (iterPar->second);
464 if (fabs(dphi) > 1
e-5) {
465 pt = paraC/fabs(dphi);
468 if (pt < 10.0 ) {
return result; }
490 polar *=fabs(pt)/polar.
perp();
498 float p_err = 0.004/paraC;
499 if (pt < 10.01) p_err = 0.1;
507 LogTrace(category)<<
"Trajectory State on Surface of Seed";
508 LogTrace(category)<<
"mom: "<<tsos.globalMomentum()<<
" phi: "<<tsos.globalMomentum().phi();
509 LogTrace(category)<<
"pos: " << tsos.globalPosition();
510 LogTrace(category) <<
"The RecSegment relies on: ";
virtual int degreesOfFreedom() const
Degrees of freedom for segments, else 0.
T getParameter(std::string const &) const
bool isCSC() const
if this rec hit is a CSC rec hit
MuonTransientTrackingRecHit::MuonRecHitContainer selectSegments(const MuonTransientTrackingRecHit::MuonRecHitContainer &) const
select seed candidates from Segments in Event
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
virtual double chi2() const
Chi square of the fit for segments, else 0.
virtual GlobalVector globalDirection() const
Direction in 3D for segments, otherwise (0,0,0)
Geom::Phi< T > phi() const
virtual LocalPoint localPosition() const override
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
virtual AlgebraicMatrix projectionMatrix() const
virtual int dimension() const
MuonTransientTrackingRecHit::MuonRecHitPointer first
bool isDT() const
if this rec hit is a DT rec hit
const Plane & surface() const
The nominal surface of the GeomDet.
std::string dumpMuonId(const DetId &id) const
Geom::Theta< T > theta() const
uint32_t rawId() const
get the raw id
bool areCorrelated(const MuonTransientTrackingRecHit::MuonRecHitPointer &, const MuonTransientTrackingRecHit::MuonRecHitPointer &) const
check if two rechits are correlated
std::vector< TrajectorySeed > TrajectorySeedCollection
const GeomDet * det() const
bool leftIsBetter(const MuonTransientTrackingRecHit::MuonRecHitPointer &, const MuonTransientTrackingRecHit::MuonRecHitPointer &) const
compare quality of two rechits
std::vector< TrajectorySeed > createSeed(const MuonTransientTrackingRecHit::MuonRecHitPointer &, const edm::EventSetup &) const
create TrajectorySeed from MuonTransientTrackingRecHit
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< MuonRecHitPair > MuonRecHitPairVector
CLHEP::HepVector AlgebraicVector
bool checkQuality(const MuonTransientTrackingRecHit::MuonRecHitPointer &) const
determine if a MuonTransientTrackingRecHit is qualified to build seed
MuonTransientTrackingRecHit::MuonRecHitPointer second
virtual AlgebraicSymMatrix parametersError() const override
CLHEP::HepSymMatrix AlgebraicSymMatrix
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
virtual void produce(edm::Event &, const edm::EventSetup &) override
reconstruct muon's seeds
DetId geographicalId() const
std::vector< MuonRecHitPair > makeSegPairs(const MuonTransientTrackingRecHit::MuonRecHitContainer &, const MuonTransientTrackingRecHit::MuonRecHitContainer &, std::string) const
TrajectorySeed tsosToSeed(const TrajectoryStateOnSurface &, uint32_t) const
uint32_t dimension(pat::CandKinResolution::Parametrization parametrization)
Returns the number of free parameters in a parametrization (3 or 4)
void createSeeds(TrajectorySeedCollection &results, const MuonTransientTrackingRecHit::MuonRecHitContainer &hits, const edm::EventSetup &eSetup) const
generate TrajectorySeeds and put them into results
std::vector< MuonRecHitPointer > MuonRecHitContainer
CosmicMuonSeedGenerator(const edm::ParameterSet &)
Constructor.
virtual GlobalPoint globalPosition() const
virtual ~CosmicMuonSeedGenerator()
Destructor.