CMS 3D CMS Logo

TrajSeedMatcher.cc
Go to the documentation of this file.
2 
7 
11 
15 
17 
20 
22 
24  cacheIDMagField_(0),
25  minNrHits_(pset.getParameter<std::vector<unsigned int> >("minNrHits")),
26  minNrHitsValidLayerBins_(pset.getParameter<std::vector<int> >("minNrHitsValidLayerBins"))
27 {
28  useRecoVertex_ = pset.getParameter<bool>("useRecoVertex");
29  navSchoolLabel_ = pset.getParameter<std::string>("navSchool");
30  detLayerGeomLabel_ = pset.getParameter<std::string>("detLayerGeom");
31  const auto cutsPSets=pset.getParameter<std::vector<edm::ParameterSet> >("matchingCuts");
32  for(const auto & cutPSet : cutsPSets){
33  int version=cutPSet.getParameter<int>("version");
34  switch(version){
35  case 1:
36  matchingCuts_.emplace_back(std::make_unique<MatchingCutsV1>(cutPSet));
37  break;
38  case 2:
39  matchingCuts_.emplace_back(std::make_unique<MatchingCutsV2>(cutPSet));
40  break;
41  default:
42  throw cms::Exception("InvalidConfig") <<" Error TrajSeedMatcher::TrajSeedMatcher pixel match cuts version "<<version<<" not recognised"<<std::endl;
43  }
44  }
45 
46  if(minNrHitsValidLayerBins_.size()+1!=minNrHits_.size()){
47  throw cms::Exception("InvalidConfig")<<" TrajSeedMatcher::TrajSeedMatcher minNrHitsValidLayerBins should be 1 less than minNrHits when its "<<minNrHitsValidLayerBins_.size()<<" vs "<<minNrHits_.size();
48  }
49 }
50 
52 {
54  desc.add<bool>("useRecoVertex",false);
55  desc.add<std::string>("navSchool","SimpleNavigationSchool");
56  desc.add<std::string>("detLayerGeom","hltESPGlobalDetLayerGeometry");
57  desc.add<std::vector<int> >("minNrHitsValidLayerBins",{4});
58  desc.add<std::vector<unsigned int> >("minNrHits",{2,3});
59 
61  auto cutDescCases =
62  1 >>
63  (edm::ParameterDescription<double>("dPhiMax",0.04,true) and
64  edm::ParameterDescription<double>("dRZMax",0.09,true) and
65  edm::ParameterDescription<double>("dRZMaxLowEtThres",20.,true) and
66  edm::ParameterDescription<std::vector<double> >("dRZMaxLowEtEtaBins",std::vector<double>{1.,1.5},true) and
67  edm::ParameterDescription<std::vector<double> >("dRZMaxLowEt",std::vector<double>{0.09,0.15,0.09},true)) or
68  2 >>
69  (edm::ParameterDescription<std::vector<double> >("dPhiMaxHighEt",{0.003},true) and
70  edm::ParameterDescription<std::vector<double> >("dPhiMaxHighEtThres",{0.0},true) and
71  edm::ParameterDescription<std::vector<double> >("dPhiMaxLowEtGrad",{0.0},true) and
72  edm::ParameterDescription<std::vector<double> >("dRZMaxHighEt",{0.005},true) and
73  edm::ParameterDescription<std::vector<double> >("dRZMaxHighEtThres",{30},true) and
74  edm::ParameterDescription<std::vector<double> >("dRZMaxLowEtGrad",{-0.002},true) and
75  edm::ParameterDescription<std::vector<double> >("etaBins",{},true));
76  cutsDesc.ifValue(edm::ParameterDescription<int>("version",1,true), std::move(cutDescCases));
77 
79  defaults.addParameter<double>("dPhiMax",0.04);
80  defaults.addParameter<double>("dRZMax",0.09);
81  defaults.addParameter<double>("dRZMaxLowEtThres",0.09);
82  defaults.addParameter<std::vector<double> >("dRZMaxLowEtEtaBins",std::vector<double>{1.,1.5});
83  defaults.addParameter<std::vector<double> >("dRZMaxLowEt",std::vector<double>{0.09,0.09,0.09});
84  defaults.addParameter<int>("version",1);
85  desc.addVPSet("matchingCuts",cutsDesc,std::vector<edm::ParameterSet>{defaults,defaults,defaults});
86  return desc;
87 }
88 
90 {
92  iSetup.get<IdealMagneticFieldRecord>().get(magField_);
93  cacheIDMagField_=iSetup.get<IdealMagneticFieldRecord>().cacheIdentifier();
94  forwardPropagator_=std::make_unique<PropagatorWithMaterial>(alongMomentum,kElectronMass_,&*(magField_));
95  backwardPropagator_=std::make_unique<PropagatorWithMaterial>(oppositeToMomentum,kElectronMass_,&*(magField_));
96  }
99 }
100 
101 
102 std::vector<TrajSeedMatcher::SeedWithInfo>
104  const GlobalPoint & vprim, const float energy)
105 {
107  throw cms::Exception("LogicError") <<__FUNCTION__<<" can not make pixel seeds as event setup has not properly been called";
108  }
109 
110  clearCache();
111 
112  std::vector<SeedWithInfo> matchedSeeds;
113  for(const auto& seed : seeds) {
114  std::vector<SCHitMatch> matchedHitsNeg = processSeed(seed,candPos,vprim,energy,-1);
115  std::vector<SCHitMatch> matchedHitsPos = processSeed(seed,candPos,vprim,energy,+1);
116  int nrValidLayersPos = 0;
117  int nrValidLayersNeg = 0;
118  if(matchedHitsNeg.size()>=2){
119  nrValidLayersNeg = getNrValidLayersAlongTraj(matchedHitsNeg[0],
120  matchedHitsNeg[1],
121  candPos,vprim,energy,-1);
122  }
123  if(matchedHitsPos.size()>=2){
124  nrValidLayersPos = getNrValidLayersAlongTraj(matchedHitsPos[0],
125  matchedHitsPos[1],
126  candPos,vprim,energy,+1);
127  }
128 
129  int nrValidLayers = std::max(nrValidLayersNeg,nrValidLayersPos);
130  size_t nrHitsRequired = getNrHitsRequired(nrValidLayers);
131  //so we require the number of hits to exactly match, this is because we currently do not
132  //do any duplicate cleaning for the input seeds
133  //this means is a hit pair with a 3rd hit will appear twice (or however many hits it has)
134  //so if you did >=nrHitsRequired, you would get the same seed multiple times
135  //ideally we should fix this and clean our input seed collection so each seed is only in once
136  //also it should be studied what impact having a 3rd hit has on a GsfTrack
137  //ie will we get a significantly different result seeding with a hit pair
138  //and the same the hit pair with a 3rd hit added
139  //in that case, perhaps it should be >=
140  if(matchedHitsNeg.size()==nrHitsRequired ||
141  matchedHitsPos.size()==nrHitsRequired){
142  matchedSeeds.push_back({seed,matchedHitsPos,matchedHitsNeg,nrValidLayers});
143  }
144 
145 
146  }
147  return matchedSeeds;
148 }
149 
150 //checks if the hits of the seed match within requested selection
151 //matched hits are required to be consecutive, as soon as hit isnt matched,
152 //the function returns, it doesnt allow skipping hits
153 std::vector<TrajSeedMatcher::SCHitMatch>
155  const GlobalPoint & vprim, const float energy, const int charge )
156 {
157  const float candEta = candPos.eta();
158  const float candEt = energy*std::sin(candPos.theta());
159 
160  FreeTrajectoryState trajStateFromVtx = FTSFromVertexToPointFactory::get(*magField_, candPos, vprim, energy, charge);
162  TrajectoryStateOnSurface initialTrajState(trajStateFromVtx,*bpb(trajStateFromVtx.position(),
163  trajStateFromVtx.momentum()));
164 
165  std::vector<SCHitMatch> matchedHits;
166  SCHitMatch firstHit = matchFirstHit(seed,initialTrajState,vprim,*backwardPropagator_);
167  firstHit.setExtra(candEt,candEta,candPos.phi(),charge,1);
168  if(passesMatchSel(firstHit,0)){
169  matchedHits.push_back(firstHit);
170 
171  //now we can figure out the z vertex
172  double zVertex = useRecoVertex_ ? vprim.z() : getZVtxFromExtrapolation(vprim,firstHit.hitPos(),candPos);
173  GlobalPoint vertex(vprim.x(),vprim.y(),zVertex);
174 
175  FreeTrajectoryState firstHitFreeTraj = FTSFromVertexToPointFactory::get(*magField_, firstHit.hitPos(),
176  vertex, energy, charge) ;
177 
178  GlobalPoint prevHitPos = firstHit.hitPos();
179  for(size_t hitNr=1;hitNr<matchingCuts_.size() && hitNr<seed.nHits();hitNr++){
180  SCHitMatch hit = match2ndToNthHit(seed,firstHitFreeTraj,hitNr,prevHitPos,vertex,*forwardPropagator_);
181  hit.setExtra(candEt,candEta,candPos.phi(),charge,1);
182  if(passesMatchSel(hit,hitNr)){
183  matchedHits.push_back(hit);
184  prevHitPos = hit.hitPos();
185  }else break;
186  }
187  }
188  return matchedHits;
189 }
190 
191 // compute the z vertex from the candidate position and the found pixel hit
192 float TrajSeedMatcher::getZVtxFromExtrapolation(const GlobalPoint& primeVtxPos, const GlobalPoint& hitPos,
193  const GlobalPoint& candPos)
194 {
195  auto sq = [](float x){return x*x;};
196  auto calRDiff = [sq](const GlobalPoint& p1,const GlobalPoint& p2){
197  return std::sqrt(sq(p2.x()-p1.x()) + sq(p2.y()-p1.y()));
198  };
199  const double r1Diff = calRDiff(primeVtxPos,hitPos);
200  const double r2Diff = calRDiff(hitPos,candPos);
201  return hitPos.z() - r1Diff*(candPos.z()-hitPos.z())/r2Diff;
202 }
203 
204 bool TrajSeedMatcher::passTrajPreSel(const GlobalPoint& hitPos, const GlobalPoint& candPos)const
205 {
206  float dt = hitPos.x()*candPos.x()+hitPos.y()*candPos.y();
207  if (dt<0) return false;
208  if (dt<kPhiCut_*(candPos.perp()*hitPos.perp())) return false;
209  return true;
210 }
211 
213  const TrajectoryStateOnSurface& initialState,
215 {
216  auto& trajStateFromVtxCache = initialState.charge()==1 ? trajStateFromVtxPosChargeCache_ :
218 
219  auto key = hit.det()->gdetIndex();
220  auto res = trajStateFromVtxCache.find(key);
221  if(res!=trajStateFromVtxCache.end()) return res->second;
222  else{ //doesnt exist, need to make it
223  //FIXME: check for efficiency
224  auto val = trajStateFromVtxCache.emplace(key,propagator.propagate(initialState,hit.det()->surface()));
225  return val.first->second;
226  }
227 }
228 
230  const FreeTrajectoryState& initialState,
231  const GlobalPoint& point,
233 {
234 
235  auto& trajStateFromPointCache = initialState.charge()==1 ? trajStateFromPointPosChargeCache_ :
237 
238  auto key = std::make_pair(hit.det()->gdetIndex(),point);
239  auto res = trajStateFromPointCache.find(key);
240  if(res!=trajStateFromPointCache.end()) return res->second;
241  else{ //doesnt exist, need to make it
242  //FIXME: check for efficiency
243  auto val = trajStateFromPointCache.emplace(key,propagator.propagate(initialState,hit.det()->surface()));
244  return val.first->second;
245  }
246 }
247 
249  const TrajectoryStateOnSurface& initialState,
250  const GlobalPoint& vtxPos,
252 {
253  const TrajectorySeed::range& hits = seed.recHits();
254  auto hitIt = hits.first;
255 
256  if(hitIt->isValid()){
257  const TrajectoryStateOnSurface& trajStateFromVtx = getTrajStateFromVtx(*hitIt,initialState,propagator);
258  if(trajStateFromVtx.isValid()) return SCHitMatch(vtxPos,trajStateFromVtx,*hitIt);
259  }
260  return SCHitMatch();
261 }
262 
264  const FreeTrajectoryState& initialState,
265  const size_t hitNr,
266  const GlobalPoint& prevHitPos,
267  const GlobalPoint& vtxPos,
269 {
270  const TrajectorySeed::range& hits = seed.recHits();
271  auto hitIt = hits.first+hitNr;
272 
273  if(hitIt->isValid()){
274  const TrajectoryStateOnSurface& trajState = getTrajStateFromPoint(*hitIt,initialState,prevHitPos,propagator);
275 
276  if(trajState.isValid()){
277  return SCHitMatch(vtxPos,trajState,*hitIt);
278  }
279  }
280  return SCHitMatch();
281 
282 }
283 
285 {
290 }
291 
293 {
294  if(hitNr<matchingCuts_.size()){
295  return (*matchingCuts_[hitNr])(hit);
296  }else{
297  throw cms::Exception("LogicError") <<" Error, attempting to apply selection to hit "<<hitNr<<" but only cuts for "<<matchingCuts_.size()<<" defined";
298  }
299 }
300 
302  const GlobalPoint& candPos,
303  const GlobalPoint & vprim,
304  const float energy, const int charge)
305 {
306  double zVertex = useRecoVertex_ ? vprim.z() : getZVtxFromExtrapolation(vprim,hit1.hitPos(),candPos);
307  GlobalPoint vertex(vprim.x(),vprim.y(),zVertex);
308 
310  vertex, energy, charge);
311  const TrajectoryStateOnSurface& secondHitTraj = getTrajStateFromPoint(*hit2.hit(),firstHitFreeTraj,hit1.hitPos(),*forwardPropagator_);
312  return getNrValidLayersAlongTraj(hit2.hit()->geographicalId(),secondHitTraj);
313 }
314 
316 {
317 
318  const DetLayer* detLayer = detLayerGeom_->idToLayer(hitId);
319  if(detLayer==nullptr) return 0;
320 
321  const FreeTrajectoryState& hitFreeState = *hitTrajState.freeState();
322  const std::vector<const DetLayer*> inLayers = navSchool_->compatibleLayers(*detLayer,hitFreeState,oppositeToMomentum);
323  const std::vector<const DetLayer*> outLayers = navSchool_->compatibleLayers(*detLayer,hitFreeState,alongMomentum);
324 
325  int nrValidLayers=1; //because our current hit is also valid and wont be included in the count otherwise
326  int nrPixInLayers=0;
327  int nrPixOutLayers=0;
328  for(auto layer : inLayers){
329  if(GeomDetEnumerators::isTrackerPixel(layer->subDetector())){
330  nrPixInLayers++;
331  if(layerHasValidHits(*layer,hitTrajState,*backwardPropagator_)) nrValidLayers++;
332  }
333  }
334  for(auto layer : outLayers){
335  if(GeomDetEnumerators::isTrackerPixel(layer->subDetector())){
336  nrPixOutLayers++;
337  if(layerHasValidHits(*layer,hitTrajState,*forwardPropagator_)) nrValidLayers++;
338  }
339  }
340  return nrValidLayers;
341 }
342 
344  const Propagator& propToLayerFromState)const
345 {
346  //FIXME: do not hardcode with werid magic numbers stolen from ancient tracking code
347  //its taken from https://cmssdt.cern.ch/dxr/CMSSW/source/RecoTracker/TrackProducer/interface/TrackProducerBase.icc#165
348  //which inspires this code
349  Chi2MeasurementEstimator estimator(30.,-3.0,0.5,2.0,0.5,1.e12); // same as defauts....
350 
351  const std::vector<GeometricSearchDet::DetWithState>& detWithState = layer.compatibleDets(hitSurState,propToLayerFromState,estimator);
352  if(detWithState.empty()) return false;
353  else{
354  DetId id = detWithState.front().first->geographicalId();
356  if(measDet.isActive()) return true;
357  else return false;
358  }
359 }
360 
361 
362 size_t TrajSeedMatcher::getNrHitsRequired(const int nrValidLayers)const
363 {
364  for(size_t binNr=0;binNr<minNrHitsValidLayerBins_.size();binNr++){
365  if(nrValidLayers<minNrHitsValidLayerBins_[binNr]) return minNrHits_[binNr];
366  }
367  return minNrHits_.back();
368 
369 }
370 
372  const TrajectoryStateOnSurface& trajState,
373  const TrackingRecHit& hit):
374  detId_(hit.geographicalId()),
375  hitPos_(hit.globalPosition()),
376  hit_(&hit),
377  et_(0),eta_(0),phi_(0),charge_(0),nrClus_(0)
378 {
379  EleRelPointPair pointPair(hitPos_,trajState.globalParameters().position(),vtxPos);
380  dRZ_ = detId_.subdetId()==PixelSubdetector::PixelBarrel ? pointPair.dZ() : pointPair.dPerp();
381  dPhi_ = pointPair.dPhi();
382 }
383 
384 
387  const std::vector<SCHitMatch>& posCharge,
388  const std::vector<SCHitMatch>& negCharge,
389  int nrValidLayers):
390  seed_(seed),nrValidLayers_(nrValidLayers)
391 {
392  size_t nrHitsMax = std::max(posCharge.size(),negCharge.size());
393  for(size_t hitNr=0;hitNr<nrHitsMax;hitNr++){
394  DetId detIdPos = hitNr<posCharge.size() ? posCharge[hitNr].detId() : DetId(0);
395  float dRZPos = hitNr<posCharge.size() ? posCharge[hitNr].dRZ() : std::numeric_limits<float>::max();
396  float dPhiPos = hitNr<posCharge.size() ? posCharge[hitNr].dPhi() : std::numeric_limits<float>::max();
397 
398  DetId detIdNeg = hitNr<negCharge.size() ? negCharge[hitNr].detId() : DetId(0);
399  float dRZNeg = hitNr<negCharge.size() ? negCharge[hitNr].dRZ() : std::numeric_limits<float>::max();
400  float dPhiNeg = hitNr<negCharge.size() ? negCharge[hitNr].dPhi() : std::numeric_limits<float>::max();
401 
402  if(detIdPos!=detIdNeg && (detIdPos.rawId()!=0 && detIdNeg.rawId()!=0)){
403  cms::Exception("LogicError")<<" error in "<<__FILE__<<", "<<__LINE__<<" hits to be combined have different detIDs, this should not be possible and nothing good will come of it";
404  }
405  DetId detId = detIdPos.rawId()!=0 ? detIdPos : detIdNeg;
406  matchInfo_.push_back(MatchInfo(detId,dRZPos,dRZNeg,dPhiPos,dPhiNeg));
407  }
408 }
409 
411  dPhiMax_(pset.getParameter<double>("dPhiMax")),
412  dRZMax_(pset.getParameter<double>("dRZMax")),
413  dRZMaxLowEtThres_(pset.getParameter<double>("dRZMaxLowEtThres")),
414  dRZMaxLowEtEtaBins_(pset.getParameter<std::vector<double> >("dRZMaxLowEtEtaBins")),
415  dRZMaxLowEt_(pset.getParameter<std::vector<double> >("dRZMaxLowEt"))
416 {
417  if(dRZMaxLowEtEtaBins_.size()+1!=dRZMaxLowEt_.size()){
418  throw cms::Exception("InvalidConfig")<<" dRZMaxLowEtEtaBins should be 1 less than dRZMaxLowEt when its "<<dRZMaxLowEtEtaBins_.size()<<" vs "<<dRZMaxLowEt_.size();
419  }
420 }
421 
423 {
424  if(dPhiMax_>=0 && std::abs(scHitMatch.dPhi()) > dPhiMax_) return false;
425 
426  const float dRZMax = getDRZCutValue(scHitMatch.et(),scHitMatch.eta());
427  if(dRZMax_>=0 && std::abs(scHitMatch.dRZ()) > dRZMax) return false;
428 
429  return true;
430 }
431 
432 float TrajSeedMatcher::MatchingCutsV1::getDRZCutValue(const float scEt, const float scEta)const
433 {
434  if(scEt>=dRZMaxLowEtThres_) return dRZMax_;
435  else{
436  const float absEta = std::abs(scEta);
437  for(size_t etaNr=0;etaNr<dRZMaxLowEtEtaBins_.size();etaNr++){
438  if(absEta<dRZMaxLowEtEtaBins_[etaNr]) return dRZMaxLowEt_[etaNr];
439  }
440  return dRZMaxLowEt_.back();
441  }
442 }
443 
445  dPhiHighEt_(pset.getParameter<std::vector<double> >("dPhiMaxHighEt")),
446  dPhiHighEtThres_(pset.getParameter<std::vector<double> >("dPhiMaxHighEtThres")),
447  dPhiLowEtGrad_(pset.getParameter<std::vector<double> >("dPhiMaxLowEtGrad")),
448  dRZHighEt_(pset.getParameter<std::vector<double> >("dRZMaxHighEt")),
449  dRZHighEtThres_(pset.getParameter<std::vector<double> >("dRZMaxHighEtThres")),
450  dRZLowEtGrad_(pset.getParameter<std::vector<double> >("dRZMaxLowEtGrad")),
451  etaBins_(pset.getParameter<std::vector<double> >("etaBins"))
452 {
453  auto binSizeCheck = [](size_t sizeEtaBins,const std::vector<double>& vec,const std::string& name){
454  if(vec.size()!=sizeEtaBins+1){
455  throw cms::Exception("InvalidConfig")<<" when constructing TrajSeedMatcher::MatchingCutsV2 "<< name<<" has "<<vec.size()<<" bins, it should be equal to #bins of etaBins+1"<<sizeEtaBins+1;
456  }
457  };
458  binSizeCheck(etaBins_.size(),dPhiHighEt_,"dPhiMaxHighEt");
459  binSizeCheck(etaBins_.size(),dPhiHighEtThres_,"dPhiMaxHighEtThres");
460  binSizeCheck(etaBins_.size(),dPhiLowEtGrad_,"dPhiMaxLowEtGrad");
461  binSizeCheck(etaBins_.size(),dRZHighEt_,"dRZMaxHighEt");
462  binSizeCheck(etaBins_.size(),dRZHighEtThres_,"dRZMaxHighEtThres");
463  binSizeCheck(etaBins_.size(),dRZLowEtGrad_,"dRZMaxLowEtGrad");
464 }
465 
467 {
468  size_t binNr=getBinNr(scHitMatch.eta());
469  float dPhiMax = getCutValue(scHitMatch.et(),dPhiHighEt_[binNr],dPhiHighEtThres_[binNr],dPhiLowEtGrad_[binNr]);
470  if(dPhiMax>=0 && std::abs(scHitMatch.dPhi()) > dPhiMax) return false;
471  float dRZMax = getCutValue(scHitMatch.et(),dRZHighEt_[binNr],dRZHighEtThres_[binNr],dRZLowEtGrad_[binNr]);
472  if(dRZMax>=0 && std::abs(scHitMatch.dRZ()) > dRZMax) return false;
473 
474  return true;
475 }
476 
477 //eta bins is exactly 1 smaller than the vectors which will be accessed by this bin nr
479 {
480  const float absEta = std::abs(eta);
481  for(size_t etaNr=0;etaNr<etaBins_.size();etaNr++){
482  if(absEta<etaBins_[etaNr]) return etaNr;
483  }
484  return etaBins_.size();
485 }
486 
MatchingCutsV1(const edm::ParameterSet &pset)
const GlobalPoint & hitPos() const
T getParameter(std::string const &) const
unsigned long long cacheIdentifier() const
std::unordered_map< std::pair< int, GlobalPoint >, TrajectoryStateOnSurface > trajStateFromPointNegChargeCache_
MeasurementDetWithData idToDet(const DetId &id) const
Previous MeasurementDetSystem interface.
void doEventSetup(const edm::EventSetup &iSetup)
float dt
Definition: AMPTWrapper.h:126
std::vector< TrajSeedMatcher::SeedWithInfo > compatibleSeeds(const TrajectorySeedCollection &seeds, const GlobalPoint &candPos, const GlobalPoint &vprim, const float energy)
std::unordered_map< int, TrajectoryStateOnSurface > trajStateFromVtxNegChargeCache_
static FreeTrajectoryState get(MagneticField const &magField, GlobalPoint const &xmeas, GlobalPoint const &xvert, float momentum, TrackCharge charge)
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
T perp() const
Definition: PV3DBase.h:72
MatchingCutsV2(const edm::ParameterSet &pset)
DetId detId(size_t hitNr) const
std::vector< double > dRZLowEtGrad_
const TrajectoryStateOnSurface & getTrajStateFromVtx(const TrackingRecHit &hit, const TrajectoryStateOnSurface &initialState, const PropagatorWithMaterial &propagator)
std::vector< double > dPhiLowEtGrad_
int gdetIndex() const
Definition: GeomDet.h:103
std::unordered_map< int, TrajectoryStateOnSurface > trajStateFromVtxPosChargeCache_
const TrackingRecHit * hit() const
bool passesMatchSel(const SCHitMatch &hit, const size_t hitNr) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
edm::ESHandle< DetLayerGeometry > detLayerGeom_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
float dRZPos(size_t hitNr) const
bool passTrajPreSel(const GlobalPoint &hitPos, const GlobalPoint &candPos) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
std::unique_ptr< PropagatorWithMaterial > forwardPropagator_
T y() const
Definition: PV3DBase.h:63
const std::vector< int > minNrHitsValidLayerBins_
TrackCharge charge() const
const std::vector< double > dRZMaxLowEt_
static float getZVtxFromExtrapolation(const GlobalPoint &primeVtxPos, const GlobalPoint &hitPos, const GlobalPoint &candPos)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
#define constexpr
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Definition: Electron.h:6
const TrajectoryStateOnSurface & getTrajStateFromPoint(const TrackingRecHit &hit, const FreeTrajectoryState &initialState, const GlobalPoint &point, const PropagatorWithMaterial &propagator)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
edm::ESHandle< NavigationSchool > navSchool_
std::vector< double > etaBins_
unsigned long long cacheIDMagField_
std::unordered_map< std::pair< int, GlobalPoint >, TrajectoryStateOnSurface > trajStateFromPointPosChargeCache_
def defaults(locpath, dataType, var)
static edm::ParameterSetDescription makePSetDescription()
std::vector< TrajectorySeed > TrajectorySeedCollection
edm::ESHandle< MagneticField > magField_
const GeomDet * det() const
T sqrt(T t)
Definition: SSEVec.h:18
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< MatchInfo > matchInfo_
FreeTrajectoryState const * freeState(bool withErrors=true) const
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:143
T z() const
Definition: PV3DBase.h:64
std::vector< const DetLayer * > compatibleLayers(const DetLayer &detLayer, Args &&...args) const
Returns all layers compatible.
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
std::vector< std::unique_ptr< MatchingCuts > > matchingCuts_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< const_iterator, const_iterator > range
void setExtra(float et, float eta, float phi, int charge, int nrClus)
float dPhiPos(size_t hitNr) const
bool operator()(const SCHitMatch &scHitMatch) const override
bool operator()(const SCHitMatch &scHitMatch) const override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double p2[4]
Definition: TauolaWrapper.h:90
std::vector< double > dPhiHighEt_
size_t getNrHitsRequired(const int nrValidLayers) const
size_t getBinNr(float eta) const
std::string navSchoolLabel_
float getDRZCutValue(const float scEt, const float scEta) const
Definition: DetId.h:18
const std::vector< double > dRZMaxLowEtEtaBins_
const GlobalTrajectoryParameters & globalParameters() const
edm::Handle< MeasurementTrackerEvent > measTkEvt_
static float kElectronMass_
range recHits() const
std::vector< double > dPhiHighEtThres_
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
TrajSeedMatcher::SCHitMatch match2ndToNthHit(const TrajectorySeed &seed, const FreeTrajectoryState &trajState, const size_t hitNr, const GlobalPoint &prevHitPos, const GlobalPoint &vtxPos, const PropagatorWithMaterial &propagator)
T eta() const
Definition: PV3DBase.h:76
unsigned int nHits() const
SeedWithInfo(const TrajectorySeed &seed, const std::vector< SCHitMatch > &posCharge, const std::vector< SCHitMatch > &negCharge, int nrValidLayers)
double p1[4]
Definition: TauolaWrapper.h:89
T get() const
Definition: EventSetup.h:62
TrajSeedMatcher(const edm::ParameterSet &pset)
std::string detLayerGeomLabel_
float dRZNeg(size_t hitNr) const
DetId geographicalId() const
bool isValid() const
Definition: ESHandle.h:47
virtual const DetLayer * idToLayer(const DetId &detId) const
int getNrValidLayersAlongTraj(const SCHitMatch &hit1, const SCHitMatch &hit2, const GlobalPoint &candPos, const GlobalPoint &vprim, const float energy, const int charge)
T x() const
Definition: PV3DBase.h:62
std::unique_ptr< PropagatorWithMaterial > backwardPropagator_
bool layerHasValidHits(const DetLayer &layer, const TrajectoryStateOnSurface &hitSurState, const Propagator &propToLayerFromState) const
TrajSeedMatcher::SCHitMatch matchFirstHit(const TrajectorySeed &seed, const TrajectoryStateOnSurface &trajState, const GlobalPoint &vtxPos, const PropagatorWithMaterial &propagator)
def move(src, dest)
Definition: eostools.py:511
static float kPhiCut_
bool isTrackerPixel(GeomDetEnumerators::SubDetector m)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
std::vector< double > dRZHighEtThres_
std::vector< double > dRZHighEt_
float dPhiNeg(size_t hitNr) const
float getCutValue(float et, float highEt, float highEtThres, float lowEtGrad) const
std::vector< SCHitMatch > processSeed(const TrajectorySeed &seed, const GlobalPoint &candPos, const GlobalPoint &vprim, const float energy, const int charge)
const std::vector< unsigned int > minNrHits_