CMS 3D CMS Logo

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

#include <VZeroProducer.h>

Inheritance diagram for VZeroProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::Event &ev, const edm::EventSetup &es) override
 
 VZeroProducer (const edm::ParameterSet &pset)
 
 ~VZeroProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

float minImpactNegativeDaughter
 
float minImpactPositiveDaughter
 
edm::ParameterSet pset_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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
 
- Static Public Member Functions inherited from edm::EDProducer
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

Definition at line 9 of file VZeroProducer.h.

Constructor & Destructor Documentation

VZeroProducer::VZeroProducer ( const edm::ParameterSet pset)
explicit

Definition at line 20 of file VZeroProducer.cc.

References edm::ParameterSet::getParameter(), minImpactNegativeDaughter, and minImpactPositiveDaughter.

21  : pset_(pset)
22 {
23  LogInfo("VZeroProducer") << " constructor";
24  produces<reco::VZeroCollection>();
25 
26  // Get track level cuts
28  pset.getParameter<double>("minImpactPositiveDaughter");
30  pset.getParameter<double>("minImpactNegativeDaughter");
31 }
T getParameter(std::string const &) const
float minImpactNegativeDaughter
Definition: VZeroProducer.h:22
float minImpactPositiveDaughter
Definition: VZeroProducer.h:22
edm::ParameterSet pset_
Definition: VZeroProducer.h:20
VZeroProducer::~VZeroProducer ( )
override

Definition at line 34 of file VZeroProducer.cc.

35 {
36  LogInfo("VZeroProducer") << " destructor";
37 }

Member Function Documentation

void VZeroProducer::produce ( edm::Event ev,
const edm::EventSetup es 
)
override

Definition at line 40 of file VZeroProducer.cc.

References reco::Vertex::add(), edm::RefVector< C, T, F >::begin(), ALCARECOTkAlJpsiMuMu_cff::charge, VZeroFinder::checkTrackPair(), reco::VZeroData::crossingPoint, allConversions_cfi::d0, data, edm::RefVector< C, T, F >::empty(), edm::RefVector< C, T, F >::end(), edm::Event::getByLabel(), edm::ParameterSet::getParameter(), mps_fire::i, LogTrace, minImpactNegativeDaughter, minImpactPositiveDaughter, eostools::move(), edm::Handle< T >::product(), pset_, edm::RefVector< C, T, F >::push_back(), edm::Event::put(), mps_fire::result, edm::RefVector< C, T, F >::size(), findElectronsInSiStrips_cfi::trackCollection, l1t::tracks, particleFlowSuperClusterECAL_cfi::vertexCollection, and electrons_cff::vertices.

41 {
42  // Get tracks
44  ev.getByLabel(pset_.getParameter<InputTag>("trackCollection"),
45  trackCollection);
46  const reco::TrackCollection tracks = *(trackCollection.product());
47 
48  // Get primary vertices
50  ev.getByLabel(pset_.getParameter<InputTag>("vertexCollection"),
51  vertexCollection);
52  const reco::VertexCollection* vertices = vertexCollection.product();
53 
54  // Find vzeros
55  VZeroFinder theFinder(es,pset_);
56 
57  // Selection based on track impact parameter
58  reco::TrackRefVector positives;
59  reco::TrackRefVector negatives;
60 
61  for(unsigned int i=0; i<tracks.size(); i++)
62  {
63  if(tracks[i].charge() > 0 &&
64  fabs(tracks[i].d0()) > minImpactPositiveDaughter)
65  positives.push_back(reco::TrackRef(trackCollection, i));
66 
67  if(tracks[i].charge() < 0 &&
68  fabs(tracks[i].d0()) > minImpactNegativeDaughter)
69  negatives.push_back(reco::TrackRef(trackCollection, i));
70  }
71 
72  LogTrace("MinBiasTracking") << "[VZeroProducer] using tracks :"
73  << " +" << positives.size()
74  << " -" << negatives.size();
75 
76  auto result = std::make_unique<reco::VZeroCollection>();
77 
78  // Check all combination of positives and negatives
79  if(!positives.empty() && !negatives.empty())
80  for(reco::track_iterator ipos = positives.begin();
81  ipos!= positives.end(); ipos++)
82  for(reco::track_iterator ineg = negatives.begin();
83  ineg!= negatives.end(); ineg++)
84  {
86 
87  if(theFinder.checkTrackPair(**ipos,**ineg, vertices, data) == true)
88  {
89  // Create vertex (creation point)
91  data.crossingPoint.y(),
92  data.crossingPoint.z()),
93  reco::Vertex::Error(), 0.,0.,0);
94 
95  // Add references to daughters
96  vertex.add(reco::TrackBaseRef(*ipos));
97  vertex.add(reco::TrackBaseRef(*ineg));
98 
99  // Store vzero
100  result->push_back(reco::VZero(vertex,data));
101  }
102  }
103 
104  LogTrace("MinBiasTracking")
105  << "[VZeroProducer] found candidates : " << result->size();
106 
107  // Put result back to the event
108  ev.put(std::move(result));
109 }
T getParameter(std::string const &) const
math::GlobalPoint crossingPoint
Definition: VZero.h:18
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
float minImpactNegativeDaughter
Definition: VZeroProducer.h:22
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:253
bool empty() const
Is the RefVector empty.
Definition: RefVector.h:104
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:464
#define LogTrace(id)
void add(const TrackBaseRef &r, float w=1.0)
add a reference to a Track
T const * product() const
Definition: Handle.h:81
float minImpactPositiveDaughter
Definition: VZeroProducer.h:22
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
size_type size() const
Size of the RefVector.
Definition: RefVector.h:107
def move(src, dest)
Definition: eostools.py:510
edm::ParameterSet pset_
Definition: VZeroProducer.h:20

Member Data Documentation

float VZeroProducer::minImpactNegativeDaughter
private

Definition at line 22 of file VZeroProducer.h.

Referenced by produce(), and VZeroProducer().

float VZeroProducer::minImpactPositiveDaughter
private

Definition at line 22 of file VZeroProducer.h.

Referenced by produce(), and VZeroProducer().

edm::ParameterSet VZeroProducer::pset_
private

Definition at line 20 of file VZeroProducer.h.

Referenced by produce().