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
VZeroProducer Class Reference

#include <VZeroProducer.h>

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

Public Member Functions

virtual void produce (edm::Event &ev, const edm::EventSetup &es)
 
 VZeroProducer (const edm::ParameterSet &pset)
 
 ~VZeroProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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 (const std::string &iProcessName, std::vector< const char * > &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

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
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 ( )

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 
)
virtual

Implements edm::EDProducer.

Definition at line 40 of file VZeroProducer.cc.

References reco::Vertex::add(), edm::RefVector< C, T, F >::begin(), RecoTauCleanerPlugins::charge, VZeroFinder::checkTrackPair(), reco::VZeroData::crossingPoint, AlCaHLTBitMon_QueryRunRegistry::data, edm::RefVector< C, T, F >::end(), edm::Event::getByLabel(), edm::ParameterSet::getParameter(), i, LogTrace, minImpactNegativeDaughter, minImpactPositiveDaughter, edm::Handle< T >::product(), pset_, edm::RefVector< C, T, F >::push_back(), edm::Event::put(), query::result, edm::RefVector< C, T, F >::size(), HLT_25ns14e33_v3_cff::trackCollection, testEve_cfg::tracks, GoodVertex_cfg::vertexCollection, and HLT_25ns14e33_v1_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_ptr<reco::VZeroCollection> result(new reco::VZeroCollection);
77 
78  // Check all combination of positives and negatives
79  if(positives.size() > 0 && negatives.size() > 0)
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(result);
109 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
math::GlobalPoint crossingPoint
Definition: VZero.h:18
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:255
std::vector< VZero > VZeroCollection
Definition: VZeroFwd.h:7
tuple vertexCollection
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:250
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
tuple result
Definition: query.py:137
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
#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
tuple tracks
Definition: testEve_cfg.py:39
float minImpactPositiveDaughter
Definition: VZeroProducer.h:22
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:62
size_type size() const
Size of the RefVector.
Definition: RefVector.h:99
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().