CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
CAHitQuadrupletGenerator Class Reference

#include <CAHitQuadrupletGenerator.h>

Classes

class  QuantityDependsPt
 
class  QuantityDependsPtEval
 

Public Types

typedef LayerHitMapCache LayerCacheType
 
typedef OrderedHitSeeds ResultType
 

Public Member Functions

 CAHitQuadrupletGenerator (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
 CAHitQuadrupletGenerator (const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
 
void hitNtuplets (const IntermediateHitDoublets &regionDoublets, std::vector< OrderedHitSeeds > &result, const edm::EventSetup &es, const SeedingLayerSetsHits &layers)
 
void initEvent (const edm::Event &ev, const edm::EventSetup &es)
 
 ~CAHitQuadrupletGenerator ()=default
 

Static Public Member Functions

static void fillDescriptions (edm::ParameterSetDescription &desc)
 
static const char * fillDescriptionsLabel ()
 

Static Public Attributes

static constexpr unsigned int minLayers = 4
 

Private Attributes

const float caHardPtCut = 0.f
 
CACut caPhiCut
 
CACut caThetaCut
 
const float extraHitRPhitolerance
 
const bool fitFastCircle
 
const bool fitFastCircleChi2Cut
 
const QuantityDependsPt maxChi2
 
std::unique_ptr< SeedComparitortheComparitor
 
LayerCacheType theLayerCache
 
const bool useBendingCorrection
 

Detailed Description

Definition at line 30 of file CAHitQuadrupletGenerator.h.

Member Typedef Documentation

◆ LayerCacheType

Definition at line 32 of file CAHitQuadrupletGenerator.h.

◆ ResultType

Definition at line 35 of file CAHitQuadrupletGenerator.h.

Constructor & Destructor Documentation

◆ CAHitQuadrupletGenerator() [1/2]

CAHitQuadrupletGenerator::CAHitQuadrupletGenerator ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 38 of file CAHitQuadrupletGenerator.h.

◆ CAHitQuadrupletGenerator() [2/2]

CAHitQuadrupletGenerator::CAHitQuadrupletGenerator ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)

Definition at line 27 of file CAHitQuadrupletGenerator.cc.

28  : extraHitRPhitolerance(cfg.getParameter<double>(
29  "extraHitRPhitolerance")), //extra window in ThirdHitPredictionFromCircle range (divide by R to get phi)
30  maxChi2(cfg.getParameter<edm::ParameterSet>("maxChi2")),
31  fitFastCircle(cfg.getParameter<bool>("fitFastCircle")),
32  fitFastCircleChi2Cut(cfg.getParameter<bool>("fitFastCircleChi2Cut")),
33  useBendingCorrection(cfg.getParameter<bool>("useBendingCorrection")),
34  caThetaCut(cfg.getParameter<double>("CAThetaCut"),
35  cfg.getParameter<std::vector<edm::ParameterSet>>("CAThetaCut_byTriplets")),
36  caPhiCut(cfg.getParameter<double>("CAPhiCut"),
37  cfg.getParameter<std::vector<edm::ParameterSet>>("CAPhiCut_byTriplets")),
38  caHardPtCut(cfg.getParameter<double>("CAHardPtCut")) {
39  edm::ParameterSet comparitorPSet = cfg.getParameter<edm::ParameterSet>("SeedComparitorPSet");
40  std::string comparitorName = comparitorPSet.getParameter<std::string>("ComponentName");
41  if (comparitorName != "none") {
42  theComparitor = SeedComparitorFactory::get()->create(comparitorName, comparitorPSet, iC);
43  }
44 }

References looper::cfg, get, edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and theComparitor.

◆ ~CAHitQuadrupletGenerator()

CAHitQuadrupletGenerator::~CAHitQuadrupletGenerator ( )
default

Member Function Documentation

◆ fillDescriptions()

void CAHitQuadrupletGenerator::fillDescriptions ( edm::ParameterSetDescription desc)
static

Definition at line 46 of file CAHitQuadrupletGenerator.cc.

46  {
47  desc.add<double>("extraHitRPhitolerance", 0.1);
48  desc.add<bool>("fitFastCircle", false);
49  desc.add<bool>("fitFastCircleChi2Cut", false);
50  desc.add<bool>("useBendingCorrection", false);
51  desc.add<double>("CAThetaCut", 0.00125);
52  desc.add<double>("CAPhiCut", 10);
53 
54  edm::ParameterSetDescription validatorCACut;
55  validatorCACut.add<string>("seedingLayers", "BPix1+BPix2+BPix3");
56  validatorCACut.add<double>("cut", 0.00125);
57  std::vector<edm::ParameterSet> defaultCACutVector;
58  edm::ParameterSet defaultCACut;
59  defaultCACut.addParameter<string>("seedingLayers", "");
60  defaultCACut.addParameter<double>("cut", -1.);
61  defaultCACutVector.push_back(defaultCACut);
62  desc.addVPSet("CAThetaCut_byTriplets", validatorCACut, defaultCACutVector);
63  desc.addVPSet("CAPhiCut_byTriplets", validatorCACut, defaultCACutVector);
64 
65  desc.add<double>("CAHardPtCut", 0);
66  desc.addOptional<bool>("CAOnlyOneLastHitPerLayerFilter")
67  ->setComment(
68  "Deprecated and has no effect. To be fully removed later when the parameter is no longer used in HLT "
69  "configurations.");
70  edm::ParameterSetDescription descMaxChi2;
71  descMaxChi2.add<double>("pt1", 0.2);
72  descMaxChi2.add<double>("pt2", 1.5);
73  descMaxChi2.add<double>("value1", 500);
74  descMaxChi2.add<double>("value2", 50);
75  descMaxChi2.add<bool>("enabled", true);
76  desc.add<edm::ParameterSetDescription>("maxChi2", descMaxChi2);
77 
78  edm::ParameterSetDescription descComparitor;
79  descComparitor.add<std::string>("ComponentName", "none");
80  descComparitor.setAllowAnything(); // until we have moved SeedComparitor too to EDProducers
81  desc.add<edm::ParameterSetDescription>("SeedComparitorPSet", descComparitor);
82 }

References edm::ParameterSetDescription::add(), edm::ParameterSet::addParameter(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ fillDescriptionsLabel()

static const char* CAHitQuadrupletGenerator::fillDescriptionsLabel ( )
inlinestatic

Definition at line 45 of file CAHitQuadrupletGenerator.h.

45 { return "caHitQuadrupletDefault"; }

◆ hitNtuplets()

void CAHitQuadrupletGenerator::hitNtuplets ( const IntermediateHitDoublets regionDoublets,
std::vector< OrderedHitSeeds > &  result,
const edm::EventSetup es,
const SeedingLayerSetsHits layers 
)

Definition at line 160 of file CAHitQuadrupletGenerator.cc.

163  {
164  CAGraph g;
165 
166  std::vector<const HitDoublets*> hitDoublets;
167 
168  const int numberOfHitsInNtuplet = 4;
169  std::vector<CACell::CAntuplet> foundQuadruplets;
170 
171  int index = 0;
172  for (const auto& regionLayerPairs : regionDoublets) {
173  const TrackingRegion& region = regionLayerPairs.region();
174  hitDoublets.clear();
175  foundQuadruplets.clear();
176  if (index == 0) {
177  createGraphStructure(layers, g);
180  } else {
181  clearGraphStructure(layers, g);
182  }
183 
184  fillGraph(layers, regionLayerPairs, g, hitDoublets);
185 
186  CellularAutomaton ca(g);
187 
188  ca.createAndConnectCells(hitDoublets, region, caThetaCut, caPhiCut, caHardPtCut);
189 
190  ca.evolve(numberOfHitsInNtuplet);
191 
192  ca.findNtuplets(foundQuadruplets, numberOfHitsInNtuplet);
193 
194  auto& allCells = ca.getAllCells();
195 
196  const QuantityDependsPtEval maxChi2Eval = maxChi2.evaluator(es);
197 
198  // re-used thoughout
199  std::array<float, 4> bc_r;
200  std::array<float, 4> bc_z;
201  std::array<float, 4> bc_errZ2;
202  std::array<GlobalPoint, 4> gps;
203  std::array<GlobalError, 4> ges;
204  std::array<bool, 4> barrels;
205 
206  unsigned int numberOfFoundQuadruplets = foundQuadruplets.size();
207 
208  // Loop over quadruplets
209  for (unsigned int quadId = 0; quadId < numberOfFoundQuadruplets; ++quadId) {
210  auto isBarrel = [](const unsigned id) -> bool { return id == PixelSubdetector::PixelBarrel; };
211  for (unsigned int i = 0; i < 3; ++i) {
212  auto const& ahit = allCells[foundQuadruplets[quadId][i]].getInnerHit();
213  gps[i] = ahit->globalPosition();
214  ges[i] = ahit->globalPositionError();
215  barrels[i] = isBarrel(ahit->geographicalId().subdetId());
216  }
217 
218  auto const& ahit = allCells[foundQuadruplets[quadId][2]].getOuterHit();
219  gps[3] = ahit->globalPosition();
220  ges[3] = ahit->globalPositionError();
221  barrels[3] = isBarrel(ahit->geographicalId().subdetId());
222  // TODO:
223  // - if we decide to always do the circle fit for 4 hits, we don't
224  // need ThirdHitPredictionFromCircle for the curvature; then we
225  // could remove extraHitRPhitolerance configuration parameter
226  ThirdHitPredictionFromCircle predictionRPhi(gps[0], gps[2], extraHitRPhitolerance);
227  const float curvature = predictionRPhi.curvature(ThirdHitPredictionFromCircle::Vector2D(gps[1].x(), gps[1].y()));
228  const float abscurv = std::abs(curvature);
229  const float thisMaxChi2 = maxChi2Eval.value(abscurv);
230  if (theComparitor) {
231  SeedingHitSet tmpTriplet(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
232  allCells[foundQuadruplets[quadId][2]].getInnerHit(),
233  allCells[foundQuadruplets[quadId][2]].getOuterHit());
234 
235  if (!theComparitor->compatible(tmpTriplet)) {
236  continue;
237  }
238  }
239 
240  float chi2 = std::numeric_limits<float>::quiet_NaN();
241  // TODO: Do we have any use case to not use bending correction?
242  if (useBendingCorrection) {
243  // Following PixelFitterByConformalMappingAndLine
244  const float simpleCot = (gps.back().z() - gps.front().z()) / (gps.back().perp() - gps.front().perp());
245  const float pt = 1.f / PixelRecoUtilities::inversePt(abscurv, es);
246  for (int i = 0; i < 4; ++i) {
247  const GlobalPoint& point = gps[i];
248  const GlobalError& error = ges[i];
249  bc_r[i] = sqrt(sqr(point.x() - region.origin().x()) + sqr(point.y() - region.origin().y()));
251  bc_z[i] = point.z() - region.origin().z();
252  bc_errZ2[i] = (barrels[i]) ? error.czz() : error.rerr(point) * sqr(simpleCot);
253  }
254  RZLine rzLine(bc_r, bc_z, bc_errZ2, RZLine::ErrZ2_tag());
255  chi2 = rzLine.chi2();
256  } else {
257  RZLine rzLine(gps, ges, barrels);
258  chi2 = rzLine.chi2();
259  }
260  if (edm::isNotFinite(chi2) || chi2 > thisMaxChi2) {
261  continue;
262  }
263  // TODO: Do we have any use case to not use circle fit? Maybe
264  // HLT where low-pT inefficiency is not a problem?
265  if (fitFastCircle) {
266  FastCircleFit c(gps, ges);
267  chi2 += c.chi2();
268  if (edm::isNotFinite(chi2))
269  continue;
270  if (fitFastCircleChi2Cut && chi2 > thisMaxChi2)
271  continue;
272  }
273  result[index].emplace_back(allCells[foundQuadruplets[quadId][0]].getInnerHit(),
274  allCells[foundQuadruplets[quadId][1]].getInnerHit(),
275  allCells[foundQuadruplets[quadId][2]].getInnerHit(),
276  allCells[foundQuadruplets[quadId][2]].getOuterHit());
277  }
278  index++;
279  }
280 }

References funct::abs(), c, caHardPtCut, caPhiCut, caThetaCut, hltPixelTracks_cff::chi2, RZLine::chi2(), CellularAutomaton::createAndConnectCells(), PixelRecoUtilities::curvature(), relativeConstraints::error, CAHitQuadrupletGenerator::QuantityDependsPt::evaluator(), CellularAutomaton::evolve(), extraHitRPhitolerance, CellularAutomaton::findNtuplets(), fitFastCircle, fitFastCircleChi2Cut, g, CellularAutomaton::getAllCells(), mps_fire::i, triggerObjects_cff::id, PixelRecoUtilities::inversePt(), PixelPluginsPhase0_cfi::isBarrel, edm::isNotFinite(), hgcalTopologyTester_cfi::layers, maxChi2, PixelSubdetector::PixelBarrel, point, DiDispStaMuonMonitor_cfi::pt, ihd::RegionLayerSets< T >::region(), HLT_FULL_cff::region, mps_fire::result, CACut::setCutValuesByLayerIds(), sqr(), mathSSE::sqrt(), theComparitor, useBendingCorrection, CAHitQuadrupletGenerator::QuantityDependsPtEval::value(), x, and y.

◆ initEvent()

void CAHitQuadrupletGenerator::initEvent ( const edm::Event ev,
const edm::EventSetup es 
)

Definition at line 84 of file CAHitQuadrupletGenerator.cc.

84  {
85  if (theComparitor)
86  theComparitor->init(ev, es);
87 }

References ev, and theComparitor.

Member Data Documentation

◆ caHardPtCut

const float CAHitQuadrupletGenerator::caHardPtCut = 0.f
private

Definition at line 133 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ caPhiCut

CACut CAHitQuadrupletGenerator::caPhiCut
private

Definition at line 132 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ caThetaCut

CACut CAHitQuadrupletGenerator::caThetaCut
private

Definition at line 131 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ extraHitRPhitolerance

const float CAHitQuadrupletGenerator::extraHitRPhitolerance
private

Definition at line 124 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ fitFastCircle

const bool CAHitQuadrupletGenerator::fitFastCircle
private

Definition at line 127 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ fitFastCircleChi2Cut

const bool CAHitQuadrupletGenerator::fitFastCircleChi2Cut
private

Definition at line 128 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ maxChi2

const QuantityDependsPt CAHitQuadrupletGenerator::maxChi2
private

Definition at line 126 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ minLayers

constexpr unsigned int CAHitQuadrupletGenerator::minLayers = 4
staticconstexpr

Definition at line 34 of file CAHitQuadrupletGenerator.h.

◆ theComparitor

std::unique_ptr<SeedComparitor> CAHitQuadrupletGenerator::theComparitor
private

Definition at line 57 of file CAHitQuadrupletGenerator.h.

Referenced by CAHitQuadrupletGenerator(), hitNtuplets(), and initEvent().

◆ theLayerCache

LayerCacheType CAHitQuadrupletGenerator::theLayerCache
private

Definition at line 55 of file CAHitQuadrupletGenerator.h.

◆ useBendingCorrection

const bool CAHitQuadrupletGenerator::useBendingCorrection
private

Definition at line 129 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

DDAxes::y
CAHitQuadrupletGenerator::maxChi2
const QuantityDependsPt maxChi2
Definition: CAHitQuadrupletGenerator.h:126
mps_fire.i
i
Definition: mps_fire.py:428
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
SeedingHitSet
Definition: SeedingHitSet.h:6
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
CACut::setCutValuesByLayerIds
void setCutValuesByLayerIds(CAGraph &caLayers)
Definition: CACut.h:43
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
sqr
int sqr(const T &t)
Definition: pfalgo_common_ref.h:9
PixelRecoUtilities::inversePt
T inversePt(T curvature, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:48
DDAxes::x
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
PixelRecoUtilities::curvature
T curvature(T InversePt, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:42
relativeConstraints.error
error
Definition: relativeConstraints.py:53
FastCircleFit
Definition: FastCircleFit.h:27
CAHitQuadrupletGenerator::fitFastCircleChi2Cut
const bool fitFastCircleChi2Cut
Definition: CAHitQuadrupletGenerator.h:128
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Point3DBase< float, GlobalTag >
CAHitQuadrupletGenerator::extraHitRPhitolerance
const float extraHitRPhitolerance
Definition: CAHitQuadrupletGenerator.h:124
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CAHitQuadrupletGenerator::QuantityDependsPt::evaluator
QuantityDependsPtEval evaluator(const edm::EventSetup &es) const
Definition: CAHitQuadrupletGenerator.h:106
Basic2DVector< Scalar >
CAHitQuadrupletGenerator::caThetaCut
CACut caThetaCut
Definition: CAHitQuadrupletGenerator.h:131
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
edm::ParameterSet
Definition: ParameterSet.h:47
edm::ParameterSet::addParameter
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:135
CAHitQuadrupletGenerator::useBendingCorrection
const bool useBendingCorrection
Definition: CAHitQuadrupletGenerator.h:129
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88267
CAHitQuadrupletGenerator::fitFastCircle
const bool fitFastCircle
Definition: CAHitQuadrupletGenerator.h:127
GlobalErrorBase< double, ErrorMatrixTag >
CellularAutomaton
Definition: CellularAutomaton.h:12
CAGraph
Definition: CAGraph.h:50
get
#define get
looper.cfg
cfg
Definition: looper.py:297
RZLine
Definition: RZLine.h:12
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
CAHitQuadrupletGenerator::theComparitor
std::unique_ptr< SeedComparitor > theComparitor
Definition: CAHitQuadrupletGenerator.h:57
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
RZLine::ErrZ2_tag
Definition: RZLine.h:14
CAHitQuadrupletGenerator::caHardPtCut
const float caHardPtCut
Definition: CAHitQuadrupletGenerator.h:133
pixelrecoutilities::LongitudinalBendingCorrection
Definition: LongitudinalBendingCorrection.h:6
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
TrackingRegion
Definition: TrackingRegion.h:41
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ThirdHitPredictionFromCircle
Definition: ThirdHitPredictionFromCircle.h:10
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
point
*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
CAHitQuadrupletGenerator::CAHitQuadrupletGenerator
CAHitQuadrupletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: CAHitQuadrupletGenerator.h:38
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
CAHitQuadrupletGenerator::caPhiCut
CACut caPhiCut
Definition: CAHitQuadrupletGenerator.h:132
g
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 g
Definition: Activities.doc:4