CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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, bool verbose)
 

Typedef Documentation

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

Definition at line 11 of file MkFitHitWrapper.h.

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

Definition at line 8 of file MkFitOutputWrapper.h.

Function Documentation

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.

References RecoTauCleanerPlugins::charge, submitPVValidationJobs::err, Exception, validate-o2o-wbm::f, 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().

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  }
unsigned int uniqueIdInLayer(int layer, unsigned int detId) const
Definition: MkFitGeometry.h:35
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
bool isStereo(const DetId &id) const
#define LogTrace(id)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
SeedingHitSet::ConstRecHitPointer Hit
Definition: DetId.h:17
int mkFitLayerNumber(DetId detId) const
unsigned int layer(const DetId &id) const
#define UNLIKELY(x)
Definition: Likely.h:21
ProductIndex id() const
Definition: ProductID.h:35
ROOT::Math::SVector< double, 3 > SVector3
Definition: V0Fitter.cc:47
tuple size
Write out results.
void mkfit::createPhase1TrackerGeometry ( TrackerInfo &  ti,
bool  verbose 
)

Definition at line 18 of file createPhase1TrackerGeometry.cc.

References mps_fire::i, and gpuVertexFinder::printf().

Referenced by MkFitGeometryESProducer::produce().

18  {
19  // TODO: these writes to global variables need to be removed
20  Config::nTotalLayers = 18 + 2 * 27;
21 
22  Config::useCMSGeom = true;
23 
24  Config::finding_requires_propagation_to_hit_pos = true;
25  Config::finding_inter_layer_pflags = PropagationFlags(PF_use_param_b_field | PF_apply_material);
26  Config::finding_intra_layer_pflags = PropagationFlags(PF_none);
27  Config::backward_fit_pflags = PropagationFlags(PF_use_param_b_field | PF_apply_material);
28  Config::forward_fit_pflags = PropagationFlags(PF_use_param_b_field | PF_apply_material);
29  Config::seed_fit_pflags = PropagationFlags(PF_none);
30  Config::pca_prop_pflags = PropagationFlags(PF_none);
31 
32  ti.set_eta_regions(0.9, 1.7, 2.45, false);
33  ti.create_layers(18, 27, 27);
34  createPhase1TrackerGeometryAutoGen(ti);
35 
36  // TODO: replace with MessageLogger
37  if (verbose) {
38  printf("==========================================================================================\n");
39  printf("Phase1 tracker -- Create_TrackerInfo finished\n");
40  printf("==========================================================================================\n");
41  for (auto &i : ti.m_layers)
42  i.print_layer();
43  printf("==========================================================================================\n");
44  }
45  }
static constexpr int verbose
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)