CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
TotemRPLocalTrackFitter Class Reference

Fits tracks trough a single RP. More...

Inheritance diagram for TotemRPLocalTrackFitter:
edm::stream::EDProducer<>

Public Member Functions

void produce (edm::Event &e, const edm::EventSetup &c) override
 
 TotemRPLocalTrackFitter (const edm::ParameterSet &conf)
 
 ~TotemRPLocalTrackFitter () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Attributes

TotemRPLocalTrackFitterAlgorithm fitter_
 The instance of the fitter module. More...
 
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecordgeometryToken
 
edm::ESWatcher< VeryForwardRealGeometryRecordgeometryWatcher
 A watcher to detect geometry changes. More...
 
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > patternCollectionToken
 
edm::InputTag tagUVPattern
 Selection of the pattern-recognition module. More...
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Fits tracks trough a single RP.

Definition at line 35 of file TotemRPLocalTrackFitter.cc.

Constructor & Destructor Documentation

◆ TotemRPLocalTrackFitter()

TotemRPLocalTrackFitter::TotemRPLocalTrackFitter ( const edm::ParameterSet conf)
explicit

Definition at line 68 of file TotemRPLocalTrackFitter.cc.

References geometryToken, edm::ParameterSet::getParameter(), patternCollectionToken, and tagUVPattern.

69  : verbosity_(conf.getParameter<int>("verbosity")), fitter_(conf) {
70  tagUVPattern = conf.getParameter<edm::InputTag>("tagUVPattern");
71  patternCollectionToken = consumes<DetSetVector<TotemRPUVPattern>>(tagUVPattern);
72  geometryToken = esConsumes<CTPPSGeometry, VeryForwardRealGeometryRecord>();
73 
74  produces<DetSetVector<TotemRPLocalTrack>>();
75 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geometryToken
TotemRPLocalTrackFitterAlgorithm fitter_
The instance of the fitter module.
edm::InputTag tagUVPattern
Selection of the pattern-recognition module.
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > patternCollectionToken

◆ ~TotemRPLocalTrackFitter()

TotemRPLocalTrackFitter::~TotemRPLocalTrackFitter ( )
inlineoverride

Definition at line 39 of file TotemRPLocalTrackFitter.cc.

39 {}

Member Function Documentation

◆ fillDescriptions()

void TotemRPLocalTrackFitter::fillDescriptions ( edm::ConfigurationDescriptions descr)
static

Definition at line 180 of file TotemRPLocalTrackFitter.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

180  {
182 
183  desc.add<edm::InputTag>("tagUVPattern", edm::InputTag("totemRPUVPatternFinder"))
184  ->setComment("input U-V patterns collection to retrieve");
185  desc.add<int>("verbosity", 0);
186 
187  descr.add("totemRPLocalTrackFitter", desc);
188 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void TotemRPLocalTrackFitter::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 79 of file TotemRPLocalTrackFitter.cc.

References edm::ESWatcher< T >::check(), MillePedeFileConverter_cfg::e, fitter_, TotemRPLocalTrackFitterAlgorithm::fitTrack(), geometryToken, geometryWatcher, h, hfClusterShapes_cfi::hits, input, convertSQLitetoXML_cfg::output, topSingleLeptonDQM_PU_cfi::pattern, patternCollectionToken, pi, TotemRPUVPattern::projU, TotemRPUVPattern::projV, edm::DetSet< T >::push_back(), TotemRPLocalTrackFitterAlgorithm::reset(), singleTopDQM_cfi::setup, HLT_2024v11_cff::track, verbosity_, and HLTMuonOfflineAnalyzer_cfi::z0.

79  {
80  if (verbosity_ > 5)
81  LogVerbatim("TotemRPLocalTrackFitter") << ">> TotemRPLocalTrackFitter::produce";
82 
83  // get geometry
85 
87  fitter_.reset();
88 
89  // get input
91  e.getByToken(patternCollectionToken, input);
92 
93  // run fit for each RP
95 
96  for (const auto &rpv : *input) {
97  CTPPSDetId rpId(rpv.detId());
98 
99  // is U-V association unique?
100  unsigned int n_U = 0, n_V = 0;
101  unsigned int idx_U = 0, idx_V = 0;
102  for (unsigned int pi = 0; pi < rpv.size(); pi++) {
103  const TotemRPUVPattern &pattern = rpv[pi];
104 
105  // here it would make sense to skip non-fittable patterns, but to keep the logic
106  // equivalent to version 7_0_4, nothing is skipped
107  /*
108  if (pattern.fittable() == false)
109  continue;
110  */
111 
112  switch (pattern.projection()) {
114  n_U++;
115  idx_U = pi;
116  break;
117 
119  n_V++;
120  idx_V = pi;
121  break;
122 
123  default:
124  break;
125  }
126  }
127 
128  if (n_U != 1 || n_V != 1) {
129  if (verbosity_)
130  LogVerbatim("TotemRPLocalTrackFitter")
131  << ">> TotemRPLocalTrackFitter::produce > Impossible to combine U and V patterns in RP " << rpId
132  << " (n_U=" << n_U << ", n_V=" << n_V << ").";
133 
134  continue;
135  }
136 
137  // again, to follow the logic from version 7_0_4, skip the non-fittable patterns here
138  if (!rpv[idx_U].fittable() || !rpv[idx_V].fittable())
139  continue;
140 
141  // combine U and V hits
143  for (auto &ids : rpv[idx_U].hits()) {
144  auto &ods = hits.find_or_insert(ids.detId());
145  for (auto &h : ids)
146  ods.push_back(h);
147  }
148 
149  for (auto &ids : rpv[idx_V].hits()) {
150  auto &ods = hits.find_or_insert(ids.detId());
151  for (auto &h : ids)
152  ods.push_back(h);
153  }
154 
155  // run fit
156  double z0 = geometry->rpTranslation(rpId).z();
157 
160 
161  DetSet<TotemRPLocalTrack> &ds = output.find_or_insert(rpId);
162  ds.push_back(track);
163 
164  if (verbosity_ > 5) {
165  unsigned int n_hits = 0;
166  for (auto &hds : track.hits())
167  n_hits += hds.size();
168 
169  LogVerbatim("TotemRPLocalTrackFitter")
170  << " track in RP " << rpId << ": valid = " << track.isValid() << ", hits = " << n_hits;
171  }
172  }
173 
174  // save results
175  e.put(make_unique<DetSetVector<TotemRPLocalTrack>>(output));
176 }
Log< level::Info, true > LogVerbatim
void push_back(const T &t)
Definition: DetSet.h:66
edm::ESWatcher< VeryForwardRealGeometryRecord > geometryWatcher
A watcher to detect geometry changes.
void reset()
Resets the reconstruction-data cache.
A track fit through a single RP.
static std::string const input
Definition: EdmProvDump.cc:50
const Double_t pi
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geometryToken
A linear pattern in U or V projection. The intercept b is taken at the middle of a RP: (geometry->Get...
TotemRPLocalTrackFitterAlgorithm fitter_
The instance of the fitter module.
bool fitTrack(const edm::DetSetVector< TotemRPRecHit > &hits, double z_0, const CTPPSGeometry &tot_geom, TotemRPLocalTrack &fitted_track)
performs the track fit, returns true if successful
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
Definition: output.py:1
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > patternCollectionToken

Member Data Documentation

◆ fitter_

TotemRPLocalTrackFitterAlgorithm TotemRPLocalTrackFitter::fitter_
private

The instance of the fitter module.

Definition at line 57 of file TotemRPLocalTrackFitter.cc.

Referenced by produce().

◆ geometryToken

edm::ESGetToken<CTPPSGeometry, VeryForwardRealGeometryRecord> TotemRPLocalTrackFitter::geometryToken
private

Definition at line 51 of file TotemRPLocalTrackFitter.cc.

Referenced by produce(), and TotemRPLocalTrackFitter().

◆ geometryWatcher

edm::ESWatcher<VeryForwardRealGeometryRecord> TotemRPLocalTrackFitter::geometryWatcher
private

A watcher to detect geometry changes.

Definition at line 54 of file TotemRPLocalTrackFitter.cc.

Referenced by produce().

◆ patternCollectionToken

edm::EDGetTokenT<edm::DetSetVector<TotemRPUVPattern> > TotemRPLocalTrackFitter::patternCollectionToken
private

Definition at line 50 of file TotemRPLocalTrackFitter.cc.

Referenced by produce(), and TotemRPLocalTrackFitter().

◆ tagUVPattern

edm::InputTag TotemRPLocalTrackFitter::tagUVPattern
private

Selection of the pattern-recognition module.

Definition at line 48 of file TotemRPLocalTrackFitter.cc.

Referenced by TotemRPLocalTrackFitter().

◆ verbosity_

int TotemRPLocalTrackFitter::verbosity_
private

Definition at line 45 of file TotemRPLocalTrackFitter.cc.

Referenced by produce().