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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Attributes

TotemRPLocalTrackFitterAlgorithm fitter_
 The instance of the fitter module. More...
 
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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Fits tracks trough a single RP.

Definition at line 34 of file TotemRPLocalTrackFitter.cc.

Constructor & Destructor Documentation

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

Definition at line 66 of file TotemRPLocalTrackFitter.cc.

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

67  : verbosity_(conf.getParameter<int>("verbosity")), fitter_(conf) {
68  tagUVPattern = conf.getParameter<edm::InputTag>("tagUVPattern");
69  patternCollectionToken = consumes<DetSetVector<TotemRPUVPattern>>(tagUVPattern);
70 
71  produces<DetSetVector<TotemRPLocalTrack>>();
72 }
T getParameter(std::string const &) const
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 ( )
inlineoverride

Member Function Documentation

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

Definition at line 178 of file TotemRPLocalTrackFitter.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, and HLT_2018_cff::InputTag.

Referenced by ~TotemRPLocalTrackFitter().

178  {
180 
181  desc.add<edm::InputTag>("tagUVPattern", edm::InputTag("totemRPUVPatternFinder"))
182  ->setComment("input U-V patterns collection to retrieve");
183  desc.add<int>("verbosity", 0);
184 
185  descr.add("totemRPLocalTrackFitter", desc);
186 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void TotemRPLocalTrackFitter::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 76 of file TotemRPLocalTrackFitter.cc.

References edm::ESWatcher< T >::check(), edm::DetSetVector< T >::find_or_insert(), fitter_, TotemRPLocalTrackFitterAlgorithm::fitTrack(), geometry, geometryWatcher, edm::EventSetup::get(), edm::Event::getByToken(), h, hfClusterShapes_cfi::hits, TotemRPLocalTrack::hits(), photons_cff::ids, input, TotemRPLocalTrack::isValid(), convertSQLitetoXML_cfg::output, topSingleLeptonDQM_PU_cfi::pattern, patternCollectionToken, pi, TotemRPUVPattern::projection(), TotemRPUVPattern::projU, TotemRPUVPattern::projV, edm::DetSet< T >::push_back(), edm::Event::put(), TotemRPLocalTrackFitterAlgorithm::reset(), CTPPSGeometry::rpTranslation(), HLT_2018_cff::track, verbosity_, and HLTMuonOfflineAnalyzer_cfi::z0.

Referenced by ~TotemRPLocalTrackFitter().

76  {
77  if (verbosity_ > 5)
78  LogVerbatim("TotemRPLocalTrackFitter") << ">> TotemRPLocalTrackFitter::produce";
79 
80  // get geometry
82  setup.get<VeryForwardRealGeometryRecord>().get(geometry);
83 
85  fitter_.reset();
86 
87  // get input
90 
91  // run fit for each RP
93 
94  for (const auto &rpv : *input) {
95  CTPPSDetId rpId(rpv.detId());
96 
97  // is U-V association unique?
98  unsigned int n_U = 0, n_V = 0;
99  unsigned int idx_U = 0, idx_V = 0;
100  for (unsigned int pi = 0; pi < rpv.size(); pi++) {
101  const TotemRPUVPattern &pattern = rpv[pi];
102 
103  // here it would make sense to skip non-fittable patterns, but to keep the logic
104  // equivalent to version 7_0_4, nothing is skipped
105  /*
106  if (pattern.fittable() == false)
107  continue;
108  */
109 
110  switch (pattern.projection()) {
112  n_U++;
113  idx_U = pi;
114  break;
115 
117  n_V++;
118  idx_V = pi;
119  break;
120 
121  default:
122  break;
123  }
124  }
125 
126  if (n_U != 1 || n_V != 1) {
127  if (verbosity_)
128  LogVerbatim("TotemRPLocalTrackFitter")
129  << ">> TotemRPLocalTrackFitter::produce > Impossible to combine U and V patterns in RP " << rpId
130  << " (n_U=" << n_U << ", n_V=" << n_V << ").";
131 
132  continue;
133  }
134 
135  // again, to follow the logic from version 7_0_4, skip the non-fittable patterns here
136  if (!rpv[idx_U].fittable() || !rpv[idx_V].fittable())
137  continue;
138 
139  // combine U and V hits
141  for (auto &ids : rpv[idx_U].hits()) {
142  auto &ods = hits.find_or_insert(ids.detId());
143  for (auto &h : ids)
144  ods.push_back(h);
145  }
146 
147  for (auto &ids : rpv[idx_V].hits()) {
148  auto &ods = hits.find_or_insert(ids.detId());
149  for (auto &h : ids)
150  ods.push_back(h);
151  }
152 
153  // run fit
154  double z0 = geometry->rpTranslation(rpId).z();
155 
157  fitter_.fitTrack(hits, z0, *geometry, track);
158 
159  DetSet<TotemRPLocalTrack> &ds = output.find_or_insert(rpId);
160  ds.push_back(track);
161 
162  if (verbosity_ > 5) {
163  unsigned int n_hits = 0;
164  for (auto &hds : track.hits())
165  n_hits += hds.size();
166 
167  LogVerbatim("TotemRPLocalTrackFitter")
168  << " track in RP " << rpId << ": valid = " << track.isValid() << ", hits = " << n_hits;
169  }
170  }
171 
172  // save results
173  e.put(make_unique<DetSetVector<TotemRPLocalTrack>>(output));
174 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
void push_back(const T &t)
Definition: DetSet.h:67
bool isValid() const
edm::ESWatcher< VeryForwardRealGeometryRecord > geometryWatcher
A watcher to detect geometry changes.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void reset()
Resets the reconstruction-data cache.
A track fit through a single RP.
Event setup record containing the real (actual) geometry information.
static std::string const input
Definition: EdmProvDump.cc:48
reference find_or_insert(det_id_type id)
Definition: DetSetVector.h:234
const Double_t pi
CLHEP::Hep3Vector rpTranslation(unsigned int id) const
const edm::DetSetVector< FittedRecHit > & hits() const
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:52
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
ESHandle< TrackerGeometry > geometry
ProjectionType projection() const
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > patternCollectionToken

Member Data Documentation

TotemRPLocalTrackFitterAlgorithm TotemRPLocalTrackFitter::fitter_
private

The instance of the fitter module.

Definition at line 55 of file TotemRPLocalTrackFitter.cc.

Referenced by produce().

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

A watcher to detect geometry changes.

Definition at line 52 of file TotemRPLocalTrackFitter.cc.

Referenced by produce().

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

Definition at line 49 of file TotemRPLocalTrackFitter.cc.

Referenced by produce(), and TotemRPLocalTrackFitter().

edm::InputTag TotemRPLocalTrackFitter::tagUVPattern
private

Selection of the pattern-recognition module.

Definition at line 47 of file TotemRPLocalTrackFitter.cc.

Referenced by TotemRPLocalTrackFitter().

int TotemRPLocalTrackFitter::verbosity_
private

Definition at line 44 of file TotemRPLocalTrackFitter.cc.

Referenced by produce().