#include <RecoVZero/VZeroFinding/plugins/VZeroProducer.h>
Public Member Functions | |
virtual void | produce (edm::Event &ev, const edm::EventSetup &es) |
VZeroProducer (const edm::ParameterSet &pset) | |
~VZeroProducer () | |
Private Attributes | |
float | minImpactNegativeDaughter |
float | minImpactPositiveDaughter |
edm::ParameterSet | pset_ |
Definition at line 9 of file VZeroProducer.h.
VZeroProducer::VZeroProducer | ( | const edm::ParameterSet & | pset | ) | [explicit] |
Definition at line 16 of file VZeroProducer.cc.
References edm::ParameterSet::getParameter(), minImpactNegativeDaughter, and minImpactPositiveDaughter.
00017 : pset_(pset) 00018 { 00019 edm::LogInfo("VZeroProducer") << " constructor"; 00020 produces<reco::VZeroCollection>(); 00021 00022 // Get track level cuts 00023 minImpactPositiveDaughter = 00024 pset.getParameter<double>("minImpactPositiveDaughter"); 00025 minImpactNegativeDaughter = 00026 pset.getParameter<double>("minImpactNegativeDaughter"); 00027 }
VZeroProducer::~VZeroProducer | ( | ) |
Definition at line 30 of file VZeroProducer.cc.
00031 { 00032 edm::LogInfo("VZeroProducer") << " destructor"; 00033 }
void VZeroProducer::produce | ( | edm::Event & | ev, | |
const edm::EventSetup & | es | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 36 of file VZeroProducer.cc.
References edm::RefVector< C, T, F >::begin(), VZeroFinder::checkTrackPair(), reco::VZeroData::crossingPoint, debug_cff::d0, data, edm::RefVector< C, T, F >::end(), edm::Event::getByLabel(), i, LogTrace, minImpactNegativeDaughter, minImpactPositiveDaughter, edm::Handle< T >::product(), pset_, edm::RefVector< C, T, F >::push_back(), edm::Event::put(), HLT_VtxMuL3::result, edm::RefVector< C, T, F >::size(), and tracks.
00037 { 00038 // Get tracks 00039 edm::Handle<reco::TrackCollection> trackCollection; 00040 ev.getByLabel("allTracks", trackCollection); 00041 const reco::TrackCollection tracks = *(trackCollection.product()); 00042 00043 // Get primary vertices 00044 edm::Handle<reco::VertexCollection> vertexCollection; 00045 ev.getByLabel("pixelVertices", vertexCollection); 00046 const reco::VertexCollection* vertices = vertexCollection.product(); 00047 00048 // Find vzeros 00049 VZeroFinder theFinder(es,pset_); 00050 00051 // Selection based on track impact parameter 00052 reco::TrackRefVector positives; 00053 reco::TrackRefVector negatives; 00054 00055 for(unsigned int i=0; i<tracks.size(); i++) 00056 { 00057 if(tracks[i].charge() > 0 && 00058 fabs(tracks[i].d0()) > minImpactPositiveDaughter) 00059 positives.push_back(reco::TrackRef(trackCollection, i)); 00060 00061 if(tracks[i].charge() < 0 && 00062 fabs(tracks[i].d0()) > minImpactNegativeDaughter) 00063 negatives.push_back(reco::TrackRef(trackCollection, i)); 00064 } 00065 00066 LogTrace("MinBiasTracking") << "[VZeroProducer] using tracks :" 00067 << " +" << positives.size() 00068 << " -" << negatives.size(); 00069 00070 std::auto_ptr<reco::VZeroCollection> result(new reco::VZeroCollection); 00071 00072 // Check all combination of positives and negatives 00073 if(positives.size() > 0 && negatives.size() > 0) 00074 for(reco::track_iterator ipos = positives.begin(); 00075 ipos!= positives.end(); ipos++) 00076 for(reco::track_iterator ineg = negatives.begin(); 00077 ineg!= negatives.end(); ineg++) 00078 { 00079 reco::VZeroData data; 00080 00081 if(theFinder.checkTrackPair(**ipos,**ineg, vertices, data) == true) 00082 { 00083 // Create vertex (creation point) 00084 reco::Vertex vertex(reco::Vertex::Point(data.crossingPoint.x(), 00085 data.crossingPoint.y(), 00086 data.crossingPoint.z()), 00087 reco::Vertex::Error(), 0.,0.,0); 00088 00089 // Add references to daughters 00090 vertex.add(reco::TrackBaseRef(*ipos)); 00091 vertex.add(reco::TrackBaseRef(*ineg)); 00092 00093 // Store vzero 00094 result->push_back(reco::VZero(vertex,data)); 00095 } 00096 } 00097 00098 LogTrace("MinBiasTracking") 00099 << "[VZeroProducer] found candidates : " << result->size(); 00100 00101 // Put result back to the event 00102 ev.put(result); 00103 }
float VZeroProducer::minImpactNegativeDaughter [private] |
float VZeroProducer::minImpactPositiveDaughter [private] |
edm::ParameterSet VZeroProducer::pset_ [private] |