|
|
Go to the documentation of this file.
51 debug =
pset.getParameter<
bool>(
"DebugMuonSeed");
73 std::vector<TrajectorySeed>&
seeds) {
76 std::vector<TrajectorySeed> FinalSeeds;
82 for (
size_t i = 0;
i < theCollection.size();
i++) {
89 FinalSeeds.push_back(bestSeed);
92 double eta = fabs(seedgp.
eta());
93 if (goodSeeds.size() > 2 &&
eta > 1.5) {
95 FinalSeeds.push_back(anotherSeed);
100 FinalSeeds.push_back(bestSeed);
103 double eta = fabs(seedgp.
eta());
104 if (otherSeeds.size() > 2 &&
eta > 1.5) {
106 FinalSeeds.push_back(anotherSeed);
111 FinalSeeds.push_back(bestSeed);
114 double eta = fabs(seedgp.
eta());
115 if (theCollection.size() > 2 &&
eta > 1.5) {
117 FinalSeeds.push_back(anotherSeed);
125 if (
seeds.size() == 1)
130 double bestChi2 = 99999.;
131 for (
size_t i = 0;
i <
seeds.size();
i++) {
138 double dChi2 = fabs(1. - (theChi2 / bestChi2));
140 int dHits =
theHits - moreHits;
144 if (theChi2 < bestChi2 && dChi2 > 0.05) {
145 winner = static_cast<int>(
i);
150 if (theChi2 >= bestChi2 && dChi2 < 0.05 && dHits > 0) {
151 winner = static_cast<int>(
i);
163 if (
seeds.size() == 1)
166 float biggerProjErr = 9999.;
169 for (
size_t i = 0;
i <
seeds.size();
i++) {
170 auto r1 =
seeds[
i].recHits().begin();
171 mat =
r1->parametersError().similarityT(
r1->projectionMatrix());
175 float ddx = mat[1][1];
176 float ddy = mat[2][2];
177 float dxx = mat[3][3];
178 float dyy = mat[4][4];
179 float projectErr =
sqrt((ddx * 10000.) + (ddy * 10000.) + dxx + dyy);
183 if (projectErr < biggerProjErr)
186 winner = static_cast<int>(
i);
187 biggerProjErr = projectErr;
195 if (
seeds.size() == 1)
198 double highestPt = 0.;
200 for (
size_t i = 0;
i <
seeds.size();
i++) {
202 double pt =
sqrt((mom.
x() * mom.
x()) + (mom.
y() * mom.
y()));
203 if (
pt > highestPt) {
204 winner = static_cast<int>(
i);
214 if (
seeds.size() == 1)
219 double betterChi2 = 99999.;
220 for (
size_t i = 0;
i <
seeds.size();
i++) {
228 if (
theHits == moreHits && theChi2 < betterChi2) {
229 betterChi2 = theChi2;
230 winner = static_cast<int>(
i);
234 betterChi2 = theChi2;
235 winner = static_cast<int>(
i);
246 for (
size_t i = 0;
i <
seeds.size();
i++) {
247 int theLength = static_cast<int>(
seeds[
i].
nHits());
248 if (theLength > NSegs) {
251 longSeeds.push_back(
seeds[
i]);
252 }
else if (theLength == NSegs) {
253 longSeeds.push_back(
seeds[
i]);
264 bool findgoodMomentum =
false;
267 for (
size_t i = 0;
i < goodMomentumSeeds.size();
i++) {
269 double pt =
sqrt((mom.
x() * mom.
x()) + (mom.
y() * mom.
y()));
270 if (pt < 6. || pt > 2000.)
274 seeds.push_back(goodMomentumSeeds[
i]);
275 findgoodMomentum =
true;
278 seeds = goodMomentumSeeds;
280 return findgoodMomentum;
285 theCandidate.clear();
287 bool longSeed =
false;
288 bool withFirstLayer =
false;
291 for (
size_t i = 0;
i <
seeds.size();
i++) {
305 if (DT_Id.station() != 1)
307 withFirstLayer =
true;
315 withFirstLayer =
true;
318 bool goodseed = (longSeed && withFirstLayer) ?
true :
false;
320 if (goodseed == good)
321 theCandidate.push_back(
seeds[
i]);
329 std::vector<TrajectorySeed> theGroup;
330 std::vector<bool> usedSeed(
seeds.size(),
false);
333 for (
size_t i = 0;
i <
seeds.size();
i++) {
336 theGroup.push_back(
seeds[
i]);
341 for (
size_t j =
i + 1;
j <
seeds.size();
j++) {
344 if (!usedSeed[
j] && overlapping > 0) {
350 theGroup.push_back(
seeds[
j]);
358 double dh = pos1.
eta() - pos2.
eta();
359 double df = pos1.
phi() - pos2.
phi();
366 theGroup.push_back(
seeds[
j]);
378 unsigned int overlapping = 0;
392 double dx = gp1.
x() - gp2.
x();
393 double dy = gp1.
y() - gp2.
y();
394 double dz = gp1.
z() - gp2.
z();
406 for (
auto const&
r1 :
seed.recHits()) {
410 theChi2 = theChi2 /
seed.nHits();
458 std::vector<TrackingRecHit*> DThits = theSeg->recHits();
460 for (
size_t j = 0;
j < DThits.size();
j++) {
461 dt1DHits += (DThits[
j]->recHits()).
size();
467 NRechits = (theSeg->recHits()).
size();
477 std::vector<TrackingRecHit*> DThits = rhit->
recHits();
479 for (
size_t j = 0;
j < DThits.size();
j++) {
480 dt1DHits += (DThits[
j]->recHits()).
size();
493 double NChi2 = 999999.;
498 double dof = static_cast<double>(theSeg->degreesOfFreedom());
499 NChi2 = theSeg->chi2() /
dof;
~MuonSeedCleaner()
Destructor.
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
unsigned int nHits() const
GlobalPoint globalPosition() const
TrajectorySeed MoreRecHits(std::vector< TrajectorySeed > &seeds)
select the seed with more rechits
DetId geographicalId() const
double SeedChi2(const TrajectorySeed &seed)
static bool lengthSorting(const TrajectorySeed &s1, const TrajectorySeed &s2)
GlobalPoint SeedPosition(const TrajectorySeed &seed)
retrieve seed global position
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
int SeedLength(const TrajectorySeed &seed)
unsigned int detId() const
double NChi2OfSegment(const TrackingRecHit &rhit)
retrieve number of rechits& normalized chi2 of associated segments of a seed
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
bool MomentumFilter(std::vector< TrajectorySeed > &seeds)
filter out the bad pt seeds, if all are bad pt seeds then keep all
MuonSeedCleaner(const edm::ParameterSet &, edm::ConsumesCollector &&)
Constructor.
std::vector< TrajectorySeed > SeedContainer
int NRecHitsFromSegment(const TrackingRecHit &rhit)
SeedContainer LengthFilter(std::vector< TrajectorySeed > &seeds)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
unsigned int OverlapSegments(const TrajectorySeed &seed1, const TrajectorySeed &seed2)
check overlapping segment for seeds
void update(const edm::EventSetup &setup, bool duringEvent=true)
update the services each event
TrajectorySeed BiggerCone(std::vector< TrajectorySeed > &seeds)
select the seed with bigger projection cone to next layer
DetId geographicalId() const
The label of this GeomDet.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
MuonServiceProxy * theService
TrajectorySeed LeanHighMomentum(std::vector< TrajectorySeed > &seeds)
select the highest momentum pt seed
SeedContainer SeedCandidates(std::vector< TrajectorySeed > &seeds, bool good)
pick the seeds w/ 1st layer information and w/ more than 1 segments
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< SeedContainer > GroupSeeds(std::vector< TrajectorySeed > &seeds)
group the seeds
GlobalVector SeedMomentum(const TrajectorySeed &seed)
retrieve seed global momentum
RecHitRange recHits() const
virtual TrackingRecHit * clone() const =0
GlobalVector globalMomentum() const
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
get the tracking geometry
const GeomDet * idToDet(DetId) const override
std::vector< TrajectorySeed > seedCleaner(const edm::EventSetup &eventSetup, std::vector< TrajectorySeed > &seeds)
Cache pointer to geometry.
edm::ESHandle< MagneticField > magneticField() const
get the magnetic field
TrajectorySeed Chi2LengthSelection(std::vector< TrajectorySeed > &seeds)
select seed by balance length and chi2
Geom::Phi< T > phi() const