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
 
const float caPhiCut = 0.1f
 
const float caThetaCut = 0.00125f
 
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 29 of file CAHitQuadrupletGenerator.h.

Member Typedef Documentation

◆ LayerCacheType

Definition at line 31 of file CAHitQuadrupletGenerator.h.

◆ ResultType

Definition at line 34 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  caPhiCut(cfg.getParameter<double>("CAPhiCut")),
36  caHardPtCut(cfg.getParameter<double>("CAHardPtCut")) {
37  edm::ParameterSet comparitorPSet = cfg.getParameter<edm::ParameterSet>("SeedComparitorPSet");
38  std::string comparitorName = comparitorPSet.getParameter<std::string>("ComponentName");
39  if (comparitorName != "none") {
40  theComparitor = SeedComparitorFactory::get()->create(comparitorName, comparitorPSet, iC);
41  }
42 }

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 44 of file CAHitQuadrupletGenerator.cc.

44  {
45  desc.add<double>("extraHitRPhitolerance", 0.1);
46  desc.add<bool>("fitFastCircle", false);
47  desc.add<bool>("fitFastCircleChi2Cut", false);
48  desc.add<bool>("useBendingCorrection", false);
49  desc.add<double>("CAThetaCut", 0.00125);
50  desc.add<double>("CAPhiCut", 10);
51  desc.add<double>("CAHardPtCut", 0);
52  desc.addOptional<bool>("CAOnlyOneLastHitPerLayerFilter")
53  ->setComment(
54  "Deprecated and has no effect. To be fully removed later when the parameter is no longer used in HLT "
55  "configurations.");
56  edm::ParameterSetDescription descMaxChi2;
57  descMaxChi2.add<double>("pt1", 0.2);
58  descMaxChi2.add<double>("pt2", 1.5);
59  descMaxChi2.add<double>("value1", 500);
60  descMaxChi2.add<double>("value2", 50);
61  descMaxChi2.add<bool>("enabled", true);
62  desc.add<edm::ParameterSetDescription>("maxChi2", descMaxChi2);
63 
64  edm::ParameterSetDescription descComparitor;
65  descComparitor.add<std::string>("ComponentName", "none");
66  descComparitor.setAllowAnything(); // until we have moved SeedComparitor too to EDProducers
67  desc.add<edm::ParameterSetDescription>("SeedComparitorPSet", descComparitor);
68 }

References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ fillDescriptionsLabel()

static const char* CAHitQuadrupletGenerator::fillDescriptionsLabel ( )
inlinestatic

Definition at line 44 of file CAHitQuadrupletGenerator.h.

44 { return "caHitQuadruplet"; }

◆ hitNtuplets()

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

Definition at line 146 of file CAHitQuadrupletGenerator.cc.

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

References funct::abs(), HltBtagPostValidation_cff::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_2018_cff::region, mps_fire::result, 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 70 of file CAHitQuadrupletGenerator.cc.

70  {
71  if (theComparitor)
72  theComparitor->init(ev, es);
73 }

References ev, and theComparitor.

Member Data Documentation

◆ caHardPtCut

const float CAHitQuadrupletGenerator::caHardPtCut = 0.f
private

Definition at line 131 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ caPhiCut

const float CAHitQuadrupletGenerator::caPhiCut = 0.1f
private

Definition at line 130 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ caThetaCut

const float CAHitQuadrupletGenerator::caThetaCut = 0.00125f
private

Definition at line 129 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ extraHitRPhitolerance

const float CAHitQuadrupletGenerator::extraHitRPhitolerance
private

Definition at line 122 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ fitFastCircle

const bool CAHitQuadrupletGenerator::fitFastCircle
private

Definition at line 125 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ fitFastCircleChi2Cut

const bool CAHitQuadrupletGenerator::fitFastCircleChi2Cut
private

Definition at line 126 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ maxChi2

const QuantityDependsPt CAHitQuadrupletGenerator::maxChi2
private

Definition at line 124 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

◆ minLayers

constexpr unsigned int CAHitQuadrupletGenerator::minLayers = 4
staticconstexpr

Definition at line 33 of file CAHitQuadrupletGenerator.h.

◆ theComparitor

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

Definition at line 56 of file CAHitQuadrupletGenerator.h.

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

◆ theLayerCache

LayerCacheType CAHitQuadrupletGenerator::theLayerCache
private

Definition at line 54 of file CAHitQuadrupletGenerator.h.

◆ useBendingCorrection

const bool CAHitQuadrupletGenerator::useBendingCorrection
private

Definition at line 127 of file CAHitQuadrupletGenerator.h.

Referenced by hitNtuplets().

DDAxes::y
CAHitQuadrupletGenerator::maxChi2
const QuantityDependsPt maxChi2
Definition: CAHitQuadrupletGenerator.h:124
mps_fire.i
i
Definition: mps_fire.py:355
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
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
edm::ParameterSetDescription::addOptional
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:105
FastCircleFit
Definition: FastCircleFit.h:27
CAHitQuadrupletGenerator::fitFastCircleChi2Cut
const bool fitFastCircleChi2Cut
Definition: CAHitQuadrupletGenerator.h:126
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Point3DBase< float, GlobalTag >
CAHitQuadrupletGenerator::extraHitRPhitolerance
const float extraHitRPhitolerance
Definition: CAHitQuadrupletGenerator.h:122
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CAHitQuadrupletGenerator::QuantityDependsPt::evaluator
QuantityDependsPtEval evaluator(const edm::EventSetup &es) const
Definition: CAHitQuadrupletGenerator.h:105
Basic2DVector< Scalar >
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
edm::ParameterSet
Definition: ParameterSet.h:36
CAHitQuadrupletGenerator::useBendingCorrection
const bool useBendingCorrection
Definition: CAHitQuadrupletGenerator.h:127
CAHitQuadrupletGenerator::fitFastCircle
const bool fitFastCircle
Definition: CAHitQuadrupletGenerator.h:125
GlobalErrorBase< double, ErrorMatrixTag >
CellularAutomaton
Definition: CellularAutomaton.h:12
CAGraph
Definition: CAGraph.h:44
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
looper.cfg
cfg
Definition: looper.py:297
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
RZLine
Definition: RZLine.h:12
CAHitQuadrupletGenerator::theComparitor
std::unique_ptr< SeedComparitor > theComparitor
Definition: CAHitQuadrupletGenerator.h:56
CAHitQuadrupletGenerator::caThetaCut
const float caThetaCut
Definition: CAHitQuadrupletGenerator.h:129
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
CAHitQuadrupletGenerator::caPhiCut
const float caPhiCut
Definition: CAHitQuadrupletGenerator.h:130
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
RZLine::ErrZ2_tag
Definition: RZLine.h:14
CAHitQuadrupletGenerator::caHardPtCut
const float caHardPtCut
Definition: CAHitQuadrupletGenerator.h:131
pixelrecoutilities::LongitudinalBendingCorrection
Definition: LongitudinalBendingCorrection.h:6
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
TrackingRegion
Definition: TrackingRegion.h:38
mps_fire.result
result
Definition: mps_fire.py:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ThirdHitPredictionFromCircle
Definition: ThirdHitPredictionFromCircle.h:10
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
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