CMS 3D CMS Logo

Typedefs | Functions
mkfit Namespace Reference

Typedefs

using HitVec = std::vector< Hit >
 
using TrackVec = std::vector< Track >
 

Functions

template<typename Traits , typename HitCollection >
edm::ProductID convertHits (const Traits &traits, const HitCollection &hits, mkfit::HitVec &mkFitHits, std::vector< TrackingRecHit const * > &clusterIndexToHit, std::vector< float > &clusterChargeVec, const TrackerTopology &ttopo, const TransientTrackingRecHitBuilder &ttrhBuilder, const MkFitGeometry &mkFitGeom)
 
void createPhase1TrackerGeometry (TrackerInfo &ti, IterationsInfo &ii, bool verbose)
 

Typedef Documentation

◆ HitVec

using mkfit::HitVec = typedef std::vector<Hit>

Definition at line 11 of file MkFitHitWrapper.h.

◆ TrackVec

typedef std::vector< Track > mkfit::TrackVec

Definition at line 8 of file MkFitOutputWrapper.h.

Function Documentation

◆ convertHits()

template<typename Traits , typename HitCollection >
edm::ProductID mkfit::convertHits ( const Traits &  traits,
const HitCollection hits,
mkfit::HitVec mkFitHits,
std::vector< TrackingRecHit const * > &  clusterIndexToHit,
std::vector< float > &  clusterChargeVec,
const TrackerTopology ttopo,
const TransientTrackingRecHitBuilder ttrhBuilder,
const MkFitGeometry mkFitGeom 
)

Definition at line 25 of file convertHits.h.

32  {
33  if (hits.empty())
34  return edm::ProductID{};
35 
36  edm::ProductID clusterID;
37  {
38  const auto& lastClusterRef = hits.data().back().firstClusterRef();
39  clusterID = lastClusterRef.id();
40  if (lastClusterRef.index() >= mkFitHits.size()) {
41  auto const size = lastClusterRef.index();
42  mkFitHits.resize(size);
43  clusterIndexToHit.resize(size, nullptr);
44  if constexpr (Traits::applyCCC()) {
45  clusterChargeVec.resize(size, -1.f);
46  }
47  }
48  }
49 
50  for (const auto& detset : hits) {
51  const DetId detid = detset.detId();
52  const auto ilay = mkFitGeom.mkFitLayerNumber(detid);
53 
54  for (const auto& hit : detset) {
55  const auto charge = traits.clusterCharge(hit, detid);
56  if (!traits.passCCC(charge))
57  continue;
58 
59  const auto& gpos = hit.globalPosition();
60  SVector3 pos(gpos.x(), gpos.y(), gpos.z());
61  const auto& gerr = hit.globalPositionError();
62  SMatrixSym33 err;
63  err.At(0, 0) = gerr.cxx();
64  err.At(1, 1) = gerr.cyy();
65  err.At(2, 2) = gerr.czz();
66  err.At(0, 1) = gerr.cyx();
67  err.At(0, 2) = gerr.czx();
68  err.At(1, 2) = gerr.czy();
69 
70  auto clusterRef = hit.firstClusterRef();
71  if UNLIKELY (clusterRef.id() != clusterID) {
72  throw cms::Exception("LogicError")
73  << "Input hit collection has Refs to many cluster collections. Last hit had Ref to product " << clusterID
74  << ", but encountered Ref to product " << clusterRef.id() << " on detid " << detid.rawId();
75  }
76  const auto clusterIndex = clusterRef.index();
77  LogTrace("MkFitHitConverter") << "Adding hit detid " << detid.rawId() << " subdet " << detid.subdetId()
78  << " layer " << ttopo.layer(detid) << " isStereo " << ttopo.isStereo(detid)
79  << " zplus "
80  << " index " << clusterIndex << " ilay " << ilay;
81 
82  if UNLIKELY (clusterIndex >= mkFitHits.size()) {
83  mkFitHits.resize(clusterIndex + 1);
84  clusterIndexToHit.resize(clusterIndex + 1, nullptr);
85  if constexpr (Traits::applyCCC()) {
86  clusterChargeVec.resize(clusterIndex + 1, -1.f);
87  }
88  }
89  mkFitHits[clusterIndex] = mkfit::Hit(pos, err);
90  clusterIndexToHit[clusterIndex] = &hit;
91  if constexpr (Traits::applyCCC()) {
92  clusterChargeVec[clusterIndex] = charge;
93  }
94 
95  const auto uniqueIdInLayer = mkFitGeom.uniqueIdInLayer(ilay, detid.rawId());
96  traits.setDetails(mkFitHits[clusterIndex], *(hit.cluster()), uniqueIdInLayer, charge);
97  }
98  }
99  return clusterID;
100  }

References ALCARECOTkAlJpsiMuMu_cff::charge, submitPVResolutionJobs::err, Exception, f, hfClusterShapes_cfi::hits, edm::ProductID::id(), TrackerTopology::isStereo(), TrackerTopology::layer(), LogTrace, MkFitGeometry::mkFitLayerNumber(), DetId::rawId(), findQualityFiles::size, DetId::subdetId(), MkFitGeometry::uniqueIdInLayer(), and UNLIKELY.

Referenced by MkFitSiPixelHitConverter::produce(), and MkFitSiStripHitConverter::produce().

◆ createPhase1TrackerGeometry()

void mkfit::createPhase1TrackerGeometry ( TrackerInfo &  ti,
IterationsInfo &  ii,
bool  verbose 
)

Definition at line 179 of file createPhase1TrackerGeometry.cc.

179  {
180  // TODO: these writes to global variables need to be removed
181  Config::nTotalLayers = 18 + 2 * 27;
182 
183  Config::useCMSGeom = true;
184 
185  Config::finding_requires_propagation_to_hit_pos = true;
186  Config::finding_inter_layer_pflags = PropagationFlags(PF_use_param_b_field | PF_apply_material);
187  Config::finding_intra_layer_pflags = PropagationFlags(PF_none);
188  Config::backward_fit_pflags = PropagationFlags(PF_use_param_b_field | PF_apply_material);
189  Config::forward_fit_pflags = PropagationFlags(PF_use_param_b_field | PF_apply_material);
190  Config::seed_fit_pflags = PropagationFlags(PF_none);
191  Config::pca_prop_pflags = PropagationFlags(PF_none);
192 
193  ti.set_eta_regions(0.9, 1.7, 2.45, false);
194  ti.create_layers(18, 27, 27);
195 
196  ii.resize(10);
197  ii[0].set_iteration_index_and_track_algorithm(0, (int)TrackBase::TrackAlgorithm::initialStep);
198  ii[0].set_num_regions_layers(5, 72);
199 
200  createPhase1TrackerGeometryAutoGen(ti, ii);
201 
202  setupSteeringParamsIter0(ii[0]);
203  ii[0].m_partition_seeds = partitionSeeds0;
204 
205  ii[1].Clone(ii[0]);
206  ii[1].set_iteration_index_and_track_algorithm(1, (int)TrackBase::TrackAlgorithm::highPtTripletStep);
207 
208  ii[2].Clone(ii[0]);
209  ii[2].set_iteration_index_and_track_algorithm(2, (int)TrackBase::TrackAlgorithm::lowPtQuadStep);
210 
211  ii[3].Clone(ii[0]);
212  ii[3].set_iteration_index_and_track_algorithm(3, (int)TrackBase::TrackAlgorithm::lowPtTripletStep);
213 
214  ii[4].Clone(ii[0]);
215  ii[4].set_iteration_index_and_track_algorithm(4, (int)TrackBase::TrackAlgorithm::detachedQuadStep);
216 
217  ii[5].Clone(ii[0]);
218  ii[5].set_iteration_index_and_track_algorithm(5, (int)TrackBase::TrackAlgorithm::detachedTripletStep);
219 
220  ii[6].Clone(ii[0]);
221  ii[6].set_iteration_index_and_track_algorithm(6, (int)TrackBase::TrackAlgorithm::mixedTripletStep);
222 
223  ii[7].Clone(ii[0]);
224  ii[7].set_iteration_index_and_track_algorithm(7, (int)TrackBase::TrackAlgorithm::pixelLessStep);
225 
226  ii[8].Clone(ii[0]);
227  ii[8].set_iteration_index_and_track_algorithm(8, (int)TrackBase::TrackAlgorithm::tobTecStep);
228 
229  ii[9].Clone(ii[0]);
230  ii[9].set_iteration_index_and_track_algorithm(9, (int)TrackBase::TrackAlgorithm::pixelPairStep);
231 
232  // for iters [7] and [8]: investing in maxCand & stop condition (for time) + QF and Dupl. cleaning (for quality)
233 
234  // TODO: replace with MessageLogger
235  if (verbose) {
236  printf("==========================================================================================\n");
237  printf("Phase1 tracker -- Create_TrackerInfo finished\n");
238  printf("==========================================================================================\n");
239  for (auto &i : ti.m_layers)
240  i.print_layer();
241  printf("==========================================================================================\n");
242  }
243  }

References DetachedQuadStep_cff::detachedQuadStep, DetachedTripletStep_cff::detachedTripletStep, HighPtTripletStep_cff::highPtTripletStep, mps_fire::i, cuy::ii, InitialStep_cff::initialStep, LowPtQuadStep_cff::lowPtQuadStep, LowPtTripletStep_cff::lowPtTripletStep, MixedTripletStep_cff::mixedTripletStep, PixelLessStep_cff::pixelLessStep, PixelPairStep_cff::pixelPairStep, TobTecStep_cff::tobTecStep, and verbose.

Referenced by MkFitGeometryESProducer::produce().

TobTecStep_cff.tobTecStep
tobTecStep
Definition: TobTecStep_cff.py:393
mps_fire.i
i
Definition: mps_fire.py:428
MixedTripletStep_cff.mixedTripletStep
mixedTripletStep
Definition: MixedTripletStep_cff.py:365
MkFitGeometry::mkFitLayerNumber
int mkFitLayerNumber(DetId detId) const
Definition: MkFitGeometry.cc:79
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
pos
Definition: PixelAliasList.h:18
TrackerTopology::layer
unsigned int layer(const DetId &id) const
Definition: TrackerTopology.cc:47
DetId
Definition: DetId.h:17
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
TrackerTopology::isStereo
bool isStereo(const DetId &id) const
Definition: TrackerTopology.cc:158
HighPtTripletStep_cff.highPtTripletStep
highPtTripletStep
Definition: HighPtTripletStep_cff.py:274
verbose
static constexpr int verbose
Definition: HLTExoticaSubAnalysis.cc:25
DetachedQuadStep_cff.detachedQuadStep
detachedQuadStep
Definition: DetachedQuadStep_cff.py:232
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
SVector3
ROOT::Math::SVector< double, 3 > SVector3
Definition: V0Fitter.cc:47
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
InitialStep_cff.initialStep
initialStep
Definition: InitialStep_cff.py:323
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
MkFitGeometry::uniqueIdInLayer
unsigned int uniqueIdInLayer(int layer, unsigned int detId) const
Definition: MkFitGeometry.h:38
DetachedTripletStep_cff.detachedTripletStep
detachedTripletStep
Definition: DetachedTripletStep_cff.py:278
Exception
Definition: hltDiff.cc:245
LowPtQuadStep_cff.lowPtQuadStep
lowPtQuadStep
Definition: LowPtQuadStep_cff.py:223
PixelLessStep_cff.pixelLessStep
pixelLessStep
Definition: PixelLessStep_cff.py:364
LowPtTripletStep_cff.lowPtTripletStep
lowPtTripletStep
Definition: LowPtTripletStep_cff.py:296
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
PixelPairStep_cff.pixelPairStep
pixelPairStep
Definition: PixelPairStep_cff.py:360
cuy.ii
ii
Definition: cuy.py:589
edm::ProductID
Definition: ProductID.h:27
hit
Definition: SiStripHitEffFromCalibTree.cc:88
Hit
SeedingHitSet::ConstRecHitPointer Hit
Definition: SeedGeneratorFromProtoTracksEDProducer.cc:34
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
edm::ProductID::id
ProductIndex id() const
Definition: ProductID.h:35