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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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(), 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:136
void push_back(const T &t)
Definition: DetSet.h:68
bool isValid() const
edm::ESWatcher< VeryForwardRealGeometryRecord > geometryWatcher
A watcher to detect geometry changes.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
void reset()
Resets the reconstruction-data cache.
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
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:44
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().