45 produces<TrajectorySeedCollection>();
48 theEnableDTFlag = pset.
getParameter<
bool>(
"EnableDTMeasurement");
50 theEnableCSCFlag = pset.
getParameter<
bool>(
"EnableCSCMeasurement");
62 theForcePointDownFlag = pset.
existsAs<
bool>(
"ForcePointDown") ? pset.
getParameter<
bool>(
"ForcePointDown") :
true;
65 theParameters[
"topmb41"] = 0.87;
66 theParameters[
"bottommb41"] = 1.2;
67 theParameters[
"topmb42"] = 0.67;
68 theParameters[
"bottommb42"] = 0.98;
69 theParameters[
"topmb43"] = 0.34;
70 theParameters[
"bottommb43"] = 0.58;
71 theParameters[
"topmb31"] = 0.54;
72 theParameters[
"bottommb31"] = 0.77;
73 theParameters[
"topmb32"] = 0.35;
74 theParameters[
"bottommb32"] = 0.55;
75 theParameters[
"topmb21"] = 0.21;
76 theParameters[
"bottommb21"] = 0.31;
82 theEnableDTFlag,theEnableCSCFlag,
false);
91 delete muonMeasurements;
110 vector<const DetLayer*> dtLayers = theMuonLayers->allDTLayers();
113 vector<const DetLayer*> cscForwardLayers = theMuonLayers->forwardCSCLayers();
114 vector<const DetLayer*> cscBackwardLayers = theMuonLayers->backwardCSCLayers();
118 muonMeasurements->setEvent(event);
122 vector<MuonRecHitContainer> RHMBs;
123 vector<MuonRecHitContainer> RHMEFs;
124 vector<MuonRecHitContainer> RHMEBs;
128 for (vector<const DetLayer*>::reverse_iterator icsclayer = cscForwardLayers.rbegin();
129 icsclayer != cscForwardLayers.rend() - 1; ++icsclayer) {
132 allHits.insert(allHits.end(),RHMF.begin(),RHMF.end());
136 for (vector<const DetLayer*>::reverse_iterator icsclayer = cscBackwardLayers.rbegin();
137 icsclayer != cscBackwardLayers.rend() - 1; ++icsclayer) {
140 allHits.insert(allHits.end(),RHMF.begin(),RHMF.end());
144 for (vector<const DetLayer*>::reverse_iterator idtlayer = dtLayers.rbegin();
145 idtlayer != dtLayers.rend(); ++idtlayer) {
148 RHMBs.push_back(RHMB);
150 if ( idtlayer != dtLayers.rbegin() ) allHits.insert(allHits.end(),RHMB.begin(),RHMB.end());
156 LogTrace(category)<<
"all RecHits: "<<allHits.size();
165 createSeeds(seeds, mb42, eSetup);
171 createSeeds(seeds, mb31, eSetup);
176 if ( !allHits.empty() ) {
179 LogTrace(category)<<
"good RecHits: "<<goodhits.size();
181 if ( goodhits.empty() ) {
182 LogTrace(category)<<
"No qualified Segments in Event! ";
183 LogTrace(category)<<
"Use 2D RecHit";
185 createSeeds(seeds,allHits,eSetup);
189 createSeeds(seeds,goodhits,eSetup);
193 LogTrace(category)<<
"Seeds built: "<<seeds.size();
195 for(std::vector<TrajectorySeed>::iterator
seed = seeds.begin();
197 output->push_back(*
seed);
211 if ( !hit->
isValid() )
return false;
218 if (hit->
isDT() && ( hit->
chi2()> theMaxDTChi2 )) {
219 LogTrace(category)<<
"DT chi2 too large";
222 else if (hit->
isCSC() &&( hit->
chi2()> theMaxCSCChi2 ) ) {
223 LogTrace(category)<<
"CSC chi2 too large";
236 for (MuonRecHitContainer::const_iterator
hit = hits.begin();
hit != hits.end();
hit++) {
237 if ( checkQuality(*
hit) ) result.push_back(*
hit);
240 if ( result.size() < 2 )
return result;
245 for (MuonRecHitContainer::iterator
hit = result.begin();
hit != result.end();
hit++) {
246 if (*
hit == 0)
continue;
247 if ( !(*hit)->isValid() )
continue;
251 for (MuonRecHitContainer::iterator hit2 =
hit + 1; hit2 != result.end(); hit2++) {
252 if (*hit2 == 0)
continue;
253 if ( !(*hit2)->isValid() )
continue;
258 if ( !areCorrelated((*
hit),(*hit2)) )
continue;
260 if ( !leftIsBetter((*
hit),(*hit2)) ) {
265 if ( good ) result2.push_back(*
hit);
280 if (hits.size() == 0 || results.size() >= theMaxSeeds )
return;
281 for (MuonRecHitContainer::const_iterator ihit = hits.begin(); ihit != hits.end(); ihit++) {
282 const std::vector<TrajectorySeed>& sds = createSeed((*ihit),eSetup);
283 LogTrace(category)<<
"created seeds from rechit "<<sds.size();
284 results.insert(results.end(),sds.begin(),sds.end());
285 if ( results.size() >= theMaxSeeds )
break;
296 if (hitpairs.size() == 0 || results.size() >= theMaxSeeds )
return;
297 for (CosmicMuonSeedGenerator::MuonRecHitPairVector::const_iterator ihitpair = hitpairs.begin(); ihitpair != hitpairs.end(); ihitpair++) {
298 const std::vector<TrajectorySeed>& sds = createSeed((*ihitpair),eSetup);
299 LogTrace(category)<<
"created seeds from rechit "<<sds.size();
300 results.insert(results.end(),sds.begin(),sds.end());
301 if ( results.size() >= theMaxSeeds )
break;
309 std::vector<TrajectorySeed>
result;
328 if(theForcePointDownFlag){
336 polar *=fabs(pt)/polar.
perp();
357 LogTrace(category)<<
"Trajectory State on Surface of Seed";
358 LogTrace(category)<<
"mom: "<<tsos.globalMomentum()<<
" phi: "<<tsos.globalMomentum().phi();
359 LogTrace(category)<<
"pos: " << tsos.globalPosition();
360 LogTrace(category) <<
"The RecSegment relies on: ";
382 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 )
386 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 ) &&
387 (deltaR<double>(dir1.
eta(), dir1.
phi(), dis.
eta(), dis.
phi()) < 0.1 || deltaR<double>(dir2.
eta(), dir2.
phi(), dis.
eta(), dis.
phi()) < 0.1 ) )
390 if ( fabs(dir1.
eta()) > 4.0 || fabs(dir2.
eta()) > 4.0 ) {
391 if ( (fabs(dir1.
theta() - dir2.
theta()) < 0.07 ||
409 (lhs)->chi2() < (rhs)->chi2() ) )
return true;
421 if (hits1.empty() || hits2.empty() )
return result;
423 for (MuonRecHitContainer::const_iterator ihit1 = hits1.begin(); ihit1 != hits1.end(); ihit1++) {
424 if ( !checkQuality(*ihit1) )
continue;
426 for (MuonRecHitContainer::const_iterator ihit2 = hits2.begin(); ihit2 != hits2.end(); ihit2++) {
427 if ( !checkQuality(*ihit2) )
continue;
429 float dphi =
deltaPhi((*ihit1)->globalPosition().phi(), (*ihit2)->globalPosition().phi());
431 if ((*ihit1)->globalPosition().y() > 0.0 && ( (*ihit1)->globalPosition().y() > (*ihit2)->globalPosition().y() ) ) {
435 }
else if ((*ihit1)->globalPosition().y() < 0.0 && ( (*ihit1)->globalPosition().y() < (*ihit2)->globalPosition().y() ) ) {
449 std::vector<TrajectorySeed>
result;
455 float dphi =
deltaPhi((hitpair.
first)->globalDirection().phi(), (hitpair.
second)->globalDirection().phi());
459 map<string, float>::const_iterator iterPar = theParameters.find(hitpair.
type);
460 if ( iterPar == theParameters.end() ) {
465 int charge = (dphi > 0) ? -1 : 1;
468 float paraC = (iterPar->second);
470 if (fabs(dphi) > 1
e-5) {
471 pt = paraC/fabs(dphi);
474 if (pt < 10.0 ) {
return result; }
489 if(theForcePointDownFlag){
497 polar *=fabs(pt)/polar.
perp();
505 float p_err = 0.004/paraC;
506 if (pt < 10.01) p_err = 0.1;
514 LogTrace(category)<<
"Trajectory State on Surface of Seed";
515 LogTrace(category)<<
"mom: "<<tsos.globalMomentum()<<
" phi: "<<tsos.globalMomentum().phi();
516 LogTrace(category)<<
"pos: " << tsos.globalPosition();
517 LogTrace(category) <<
"The RecSegment relies on: ";
532 return tsosToSeed(tsos,
id, container);
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
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
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 const TrackingRecHit * hit() const
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) ...
virtual TrackingRecHit * clone() const =0
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.