CMS 3D CMS Logo

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

#include <CAHitTripletGenerator.h>

Classes

class  QuantityDependsPt
 
class  QuantityDependsPtEval
 

Public Types

typedef LayerHitMapCache LayerCacheType
 
typedef OrderedHitSeeds ResultType
 

Public Member Functions

 CAHitTripletGenerator (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
 CAHitTripletGenerator (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)
 
 ~CAHitTripletGenerator ()=default
 

Static Public Member Functions

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

Static Public Attributes

static constexpr unsigned int minLayers = 3
 

Private Attributes

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

Detailed Description

Definition at line 29 of file CAHitTripletGenerator.h.

Member Typedef Documentation

◆ LayerCacheType

Definition at line 31 of file CAHitTripletGenerator.h.

◆ ResultType

Definition at line 34 of file CAHitTripletGenerator.h.

Constructor & Destructor Documentation

◆ CAHitTripletGenerator() [1/2]

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

Definition at line 37 of file CAHitTripletGenerator.h.

37 : CAHitTripletGenerator(cfg, iC) {}

◆ CAHitTripletGenerator() [2/2]

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

Definition at line 28 of file CAHitTripletGenerator.cc.

30  : extraHitRPhitolerance(cfg.getParameter<double>(
31  "extraHitRPhitolerance")), //extra window in ThirdHitPredictionFromCircle range (divide by R to get phi)
32  maxChi2(cfg.getParameter<edm::ParameterSet>("maxChi2")),
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.

◆ ~CAHitTripletGenerator()

CAHitTripletGenerator::~CAHitTripletGenerator ( )
default

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 44 of file CAHitTripletGenerator.cc.

44  {
45  desc.add<double>("extraHitRPhitolerance", 0.06);
46  desc.add<bool>("useBendingCorrection", false);
47  desc.add<double>("CAThetaCut", 0.00125);
48  desc.add<double>("CAPhiCut", 0.1);
49  desc.add<double>("CAHardPtCut", 0);
50 
51  edm::ParameterSetDescription descMaxChi2;
52  descMaxChi2.add<double>("pt1", 0.8);
53  descMaxChi2.add<double>("pt2", 2);
54  descMaxChi2.add<double>("value1", 50);
55  descMaxChi2.add<double>("value2", 8);
56  descMaxChi2.add<bool>("enabled", true);
57  desc.add<edm::ParameterSetDescription>("maxChi2", descMaxChi2);
58 
59  edm::ParameterSetDescription descComparitor;
60  descComparitor.add<std::string>("ComponentName", "none");
61  descComparitor.setAllowAnything(); // until we have moved SeedComparitor too to EDProducers
62  desc.add<edm::ParameterSetDescription>("SeedComparitorPSet", descComparitor);
63 }

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

◆ fillDescriptionsLabel()

static const char* CAHitTripletGenerator::fillDescriptionsLabel ( )
inlinestatic

Definition at line 43 of file CAHitTripletGenerator.h.

43 { return "caHitTriplet"; }

◆ hitNtuplets()

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

Definition at line 145 of file CAHitTripletGenerator.cc.

148  {
149  CAGraph g;
150 
151  std::vector<const HitDoublets*> hitDoublets;
152 
153  std::vector<CACell::CAntuplet> foundTriplets;
154 
155  int index = 0;
156  for (const auto& regionLayerPairs : regionDoublets) {
157  const TrackingRegion& region = regionLayerPairs.region();
158  hitDoublets.clear();
159  foundTriplets.clear();
160 
161  if (index == 0) {
162  createGraphStructure(layers, g);
163  } else {
164  clearGraphStructure(layers, g);
165  }
166  fillGraph(layers, regionLayerPairs, g, hitDoublets);
167  CellularAutomaton ca(g);
168  ca.findTriplets(hitDoublets, foundTriplets, region, caThetaCut, caPhiCut, caHardPtCut);
169 
170  auto& allCells = ca.getAllCells();
171 
172  const QuantityDependsPtEval maxChi2Eval = maxChi2.evaluator(es);
173 
174  // re-used thoughout, need to be vectors because of RZLine interface
175  std::array<float, 3> bc_r;
176  std::array<float, 3> bc_z;
177  std::array<float, 3> bc_errZ2;
178  std::array<GlobalPoint, 3> gps;
179  std::array<GlobalError, 3> ges;
180  std::array<bool, 3> barrels;
181 
182  unsigned int numberOfFoundTriplets = foundTriplets.size();
183  for (unsigned int tripletId = 0; tripletId < numberOfFoundTriplets; ++tripletId) {
184  OrderedHitTriplet tmpTriplet(allCells[foundTriplets[tripletId][0]].getInnerHit(),
185  allCells[foundTriplets[tripletId][0]].getOuterHit(),
186  allCells[foundTriplets[tripletId][1]].getOuterHit());
187 
188  auto isBarrel = [](const unsigned id) -> bool { return id == PixelSubdetector::PixelBarrel; };
189  for (unsigned int i = 0; i < 2; ++i) {
190  auto const& ahit = allCells[foundTriplets[tripletId][i]].getInnerHit();
191  gps[i] = ahit->globalPosition();
192  ges[i] = ahit->globalPositionError();
193  barrels[i] = isBarrel(ahit->geographicalId().subdetId());
194  }
195 
196  auto const& ahit = allCells[foundTriplets[tripletId][1]].getOuterHit();
197  gps[2] = ahit->globalPosition();
198  ges[2] = ahit->globalPositionError();
199  barrels[2] = isBarrel(ahit->geographicalId().subdetId());
200 
201  PixelRecoLineRZ line(gps[0], gps[2]);
202  ThirdHitPredictionFromCircle predictionRPhi(gps[0], gps[2], extraHitRPhitolerance);
203  const float curvature = predictionRPhi.curvature(ThirdHitPredictionFromCircle::Vector2D(gps[1].x(), gps[1].y()));
204  const float abscurv = std::abs(curvature);
205  const float thisMaxChi2 = maxChi2Eval.value(abscurv);
206  float chi2 = std::numeric_limits<float>::quiet_NaN();
207  // TODO: Do we have any use case to not use bending correction?
208 
209  if (useBendingCorrection) {
210  // Following PixelFitterByConformalMappingAndLine
211  const float simpleCot = (gps.back().z() - gps.front().z()) / (gps.back().perp() - gps.front().perp());
212  const float pt = 1.f / PixelRecoUtilities::inversePt(abscurv, es);
213  for (int i = 0; i < 3; ++i) {
214  const GlobalPoint& point = gps[i];
215  const GlobalError& error = ges[i];
216  bc_r[i] = sqrt(sqr(point.x() - region.origin().x()) + sqr(point.y() - region.origin().y()));
218  bc_z[i] = point.z() - region.origin().z();
219  bc_errZ2[i] = (barrels[i]) ? error.czz() : error.rerr(point) * sqr(simpleCot);
220  }
221  RZLine rzLine(bc_r, bc_z, bc_errZ2, RZLine::ErrZ2_tag());
222  chi2 = rzLine.chi2();
223  } else {
224  RZLine rzLine(gps, ges, barrels);
225  chi2 = rzLine.chi2();
226  }
227 
228  if (edm::isNotFinite(chi2) || chi2 > thisMaxChi2) {
229  continue;
230  }
231 
232  if (theComparitor) {
233  if (!theComparitor->compatible(tmpTriplet)) {
234  continue;
235  }
236  }
237  result[index].emplace_back(tmpTriplet);
238  }
239  index++;
240  }
241 }

References funct::abs(), caHardPtCut, caPhiCut, caThetaCut, hltPixelTracks_cff::chi2, RZLine::chi2(), ThirdHitPredictionFromCircle::curvature(), PixelRecoUtilities::curvature(), relativeConstraints::error, CAHitTripletGenerator::QuantityDependsPt::evaluator(), extraHitRPhitolerance, CellularAutomaton::findTriplets(), g, CellularAutomaton::getAllCells(), mps_fire::i, triggerObjects_cff::id, PixelRecoUtilities::inversePt(), PixelPluginsPhase0_cfi::isBarrel, edm::isNotFinite(), hgcalTopologyTester_cfi::layers, mps_splice::line, maxChi2, PixelSubdetector::PixelBarrel, point, DiDispStaMuonMonitor_cfi::pt, ihd::RegionLayerSets< T >::region(), HLT_2018_cff::region, mps_fire::result, sqr(), mathSSE::sqrt(), theComparitor, useBendingCorrection, CAHitTripletGenerator::QuantityDependsPtEval::value(), x, and y.

◆ initEvent()

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

Definition at line 65 of file CAHitTripletGenerator.cc.

65  {
66  if (theComparitor)
67  theComparitor->init(ev, es);
68 }

References ev, and theComparitor.

Member Data Documentation

◆ caHardPtCut

const float CAHitTripletGenerator::caHardPtCut = 0.f
private

Definition at line 129 of file CAHitTripletGenerator.h.

Referenced by hitNtuplets().

◆ caPhiCut

const float CAHitTripletGenerator::caPhiCut = 1.f
private

Definition at line 128 of file CAHitTripletGenerator.h.

Referenced by hitNtuplets().

◆ caThetaCut

const float CAHitTripletGenerator::caThetaCut = 0.00125f
private

Definition at line 127 of file CAHitTripletGenerator.h.

Referenced by hitNtuplets().

◆ extraHitRPhitolerance

const float CAHitTripletGenerator::extraHitRPhitolerance
private

Definition at line 122 of file CAHitTripletGenerator.h.

Referenced by hitNtuplets().

◆ maxChi2

const QuantityDependsPt CAHitTripletGenerator::maxChi2
private

Definition at line 124 of file CAHitTripletGenerator.h.

Referenced by hitNtuplets().

◆ minLayers

constexpr unsigned int CAHitTripletGenerator::minLayers = 3
staticconstexpr

Definition at line 33 of file CAHitTripletGenerator.h.

◆ theComparitor

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

Definition at line 55 of file CAHitTripletGenerator.h.

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

◆ theLayerCache

LayerCacheType CAHitTripletGenerator::theLayerCache
private

Definition at line 53 of file CAHitTripletGenerator.h.

◆ useBendingCorrection

const bool CAHitTripletGenerator::useBendingCorrection
private

Definition at line 125 of file CAHitTripletGenerator.h.

Referenced by hitNtuplets().

DDAxes::y
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
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
CAHitTripletGenerator::maxChi2
const QuantityDependsPt maxChi2
Definition: CAHitTripletGenerator.h:124
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
CAHitTripletGenerator::QuantityDependsPt::evaluator
QuantityDependsPtEval evaluator(const edm::EventSetup &es) const
Definition: CAHitTripletGenerator.h:104
DDAxes::x
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
CAHitTripletGenerator::caHardPtCut
const float caHardPtCut
Definition: CAHitTripletGenerator.h:129
PixelRecoUtilities::curvature
T curvature(T InversePt, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:42
CAHitTripletGenerator::CAHitTripletGenerator
CAHitTripletGenerator(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: CAHitTripletGenerator.h:37
relativeConstraints.error
error
Definition: relativeConstraints.py:53
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CAHitTripletGenerator::extraHitRPhitolerance
const float extraHitRPhitolerance
Definition: CAHitTripletGenerator.h:122
Point3DBase< float, GlobalTag >
CAHitTripletGenerator::theComparitor
std::unique_ptr< SeedComparitor > theComparitor
Definition: CAHitTripletGenerator.h:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Basic2DVector< Scalar >
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
edm::ParameterSet
Definition: ParameterSet.h:36
PixelRecoLineRZ
Definition: PixelRecoLineRZ.h:12
CAHitTripletGenerator::caThetaCut
const float caThetaCut
Definition: CAHitTripletGenerator.h:127
GlobalErrorBase< double, ErrorMatrixTag >
CellularAutomaton
Definition: CellularAutomaton.h:12
CAGraph
Definition: CAGraph.h:44
get
#define get
looper.cfg
cfg
Definition: looper.py:297
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
RZLine
Definition: RZLine.h:12
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
OrderedHitTriplet
Definition: OrderedHitTriplet.h:11
RZLine::ErrZ2_tag
Definition: RZLine.h:14
pixelrecoutilities::LongitudinalBendingCorrection
Definition: LongitudinalBendingCorrection.h:6
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
TrackingRegion
Definition: TrackingRegion.h:40
mps_fire.result
result
Definition: mps_fire.py:303
CAHitTripletGenerator::useBendingCorrection
const bool useBendingCorrection
Definition: CAHitTripletGenerator.h:125
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ThirdHitPredictionFromCircle
Definition: ThirdHitPredictionFromCircle.h:10
CAHitTripletGenerator::caPhiCut
const float caPhiCut
Definition: CAHitTripletGenerator.h:128
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
mps_splice.line
line
Definition: mps_splice.py:76
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