CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

virtual void produce (edm::Event &e, const edm::EventSetup &c) override
 
 TotemRPLocalTrackFitter (const edm::ParameterSet &conf)
 
virtual ~TotemRPLocalTrackFitter ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

TotemRPLocalTrackFitterAlgorithm fitter_
 The instance of the fitter module. More...
 
edm::ESWatcher
< VeryForwardRealGeometryRecord
geometryWatcher
 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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 66 of file TotemRPLocalTrackFitter.cc.

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

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

Definition at line 39 of file TotemRPLocalTrackFitter.cc.

39 {}

Member Function Documentation

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

Implements edm::stream::EDProducerBase.

Definition at line 77 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(), h, input, TotemRPLocalTrack::isValid(), convertSQLitetoXML_cfg::output, listBenchmarks::pattern, patternCollectionToken, pi, TotemRPUVPattern::projU, TotemRPUVPattern::projV, edm::DetSet< T >::push_back(), edm::Event::put(), TotemRPLocalTrackFitterAlgorithm::reset(), and verbosity_.

78 {
79  if (verbosity_ > 5)
80  LogVerbatim("TotemRPLocalTrackFitter") << ">> TotemRPLocalTrackFitter::produce";
81 
82  // get geometry
84  setup.get<VeryForwardRealGeometryRecord>().get(geometry);
85 
87  fitter_.reset();
88 
89  // get input
92 
93  // run fit for each RP
95 
96  for (const auto &rpv : *input)
97  {
98  det_id_type rpId = rpv.detId();
99 
100  // is U-V association unique?
101  unsigned int n_U=0, n_V=0;
102  unsigned int idx_U=0, idx_V=0;
103  for (unsigned int pi = 0; pi < rpv.size(); pi++)
104  {
105  const TotemRPUVPattern &pattern = rpv[pi];
106 
107  // here it would make sense to skip non-fittable patterns, but to keep the logic
108  // equivalent to version 7_0_4, nothing is skipped
109  /*
110  if (pattern.getFittable() == false)
111  continue;
112  */
113 
114  switch (pattern.getProjection())
115  {
117  n_U++;
118  idx_U=pi;
119  break;
120 
122  n_V++;
123  idx_V=pi;
124  break;
125 
126  default:
127  break;
128  }
129  }
130 
131  if (n_U != 1 || n_V != 1)
132  {
133  if (verbosity_)
134  LogVerbatim("TotemRPLocalTrackFitter")
135  << ">> TotemRPLocalTrackFitter::produce > Impossible to combine U and V patterns in RP " << rpId
136  << " (n_U=" << n_U << ", n_V=" << n_V << ").";
137 
138  continue;
139  }
140 
141  // again, to follow the logic from version 7_0_4, skip the non-fittable patterns here
142  if (!rpv[idx_U].getFittable() || !rpv[idx_V].getFittable())
143  continue;
144 
145  // combine U and V hits
147  for (auto &ids : rpv[idx_U].getHits())
148  {
149  auto &ods = hits.find_or_insert(ids.detId());
150  for (auto &h : ids)
151  ods.push_back(h);
152  }
153 
154  for (auto &ids : rpv[idx_V].getHits())
155  {
156  auto &ods = hits.find_or_insert(ids.detId());
157  for (auto &h : ids)
158  ods.push_back(h);
159  }
160 
161  // run fit
162  double z0 = geometry->GetRPGlobalTranslation(rpId).z();
163 
164  TotemRPLocalTrack track;
165  fitter_.fitTrack(hits, z0, *geometry, track);
166 
167  DetSet<TotemRPLocalTrack> &ds = output.find_or_insert(rpId);
168  ds.push_back(track);
169 
170  if (verbosity_ > 5)
171  {
172  unsigned int n_hits = 0;
173  for (auto &hds : track.getHits())
174  n_hits += hds.size();
175 
176  LogVerbatim("TotemRPLocalTrackFitter")
177  << " track in RP " << rpId << ": valid = " << track.isValid() << ", hits = " << n_hits;
178  }
179  }
180 
181  // save results
182  e.put(make_unique<DetSetVector<TotemRPLocalTrack>>(output));
183 }
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:462
void reset()
Resets the reconstruction-data cache.
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
bool fitTrack(const edm::DetSetVector< TotemRPRecHit > &hits, double z_0, const TotemRPGeometry &tot_geom, TotemRPLocalTrack &fitted_track)
performs the track fit, returns true if successful
A linear pattern in U or V projection. The intercept b is taken at the middle of a RP: (geometry-&gt;Get...
uint32_t det_id_type
Definition: DetSet.h:21
TotemRPLocalTrackFitterAlgorithm fitter_
The instance of the fitter module.
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
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 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().