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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 67 of file TotemRPLocalTrackFitter.cc.

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

68  : verbosity_(conf.getParameter<int>("verbosity")), fitter_(conf)
69 {
70  tagUVPattern = conf.getParameter<edm::InputTag>("tagUVPattern");
71  patternCollectionToken = consumes<DetSetVector<TotemRPUVPattern>>(tagUVPattern);
72 
73  produces<DetSetVector<TotemRPLocalTrack>>();
74 }
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 189 of file TotemRPLocalTrackFitter.cc.

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

Referenced by ~TotemRPLocalTrackFitter().

190 {
192 
193  desc.add<edm::InputTag>( "tagUVPattern", edm::InputTag( "totemRPUVPatternFinder" ) )
194  ->setComment( "input U-V patterns collection to retrieve" );
195  desc.add<int>( "verbosity", 0 );
196 
197  descr.add( "totemRPLocalTrackFitter", desc );
198 }
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 78 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(), TotemRPLocalTrack::getHits(), TotemRPUVPattern::getProjection(), CTPPSGeometry::getRPTranslation(), h, hfClusterShapes_cfi::hits, electrons_cff::ids, input, TotemRPLocalTrack::isValid(), convertSQLitetoXML_cfg::output, listBenchmarks::pattern, patternCollectionToken, pi, TotemRPUVPattern::projU, TotemRPUVPattern::projV, edm::DetSet< T >::push_back(), edm::Event::put(), TotemRPLocalTrackFitterAlgorithm::reset(), HiIsolationCommonParameters_cff::track, and verbosity_.

Referenced by ~TotemRPLocalTrackFitter().

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

Member Data Documentation

TotemRPLocalTrackFitterAlgorithm TotemRPLocalTrackFitter::fitter_
private

The instance of the fitter module.

Definition at line 56 of file TotemRPLocalTrackFitter.cc.

Referenced by produce().

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

A watcher to detect geometry changes.

Definition at line 53 of file TotemRPLocalTrackFitter.cc.

Referenced by produce().

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

Definition at line 50 of file TotemRPLocalTrackFitter.cc.

Referenced by produce(), and TotemRPLocalTrackFitter().

edm::InputTag TotemRPLocalTrackFitter::tagUVPattern
private

Selection of the pattern-recognition module.

Definition at line 48 of file TotemRPLocalTrackFitter.cc.

Referenced by TotemRPLocalTrackFitter().

int TotemRPLocalTrackFitter::verbosity_
private

Definition at line 45 of file TotemRPLocalTrackFitter.cc.

Referenced by produce().