#include <RecoBTag/ImpactParameter/src/ImpactParameter.cc>
Public Member Functions | |
ImpactParameter (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~ImpactParameter () | |
Private Attributes | |
ImpactParameterAlgorithm * | algo |
std::string | jetTrackSrc |
bool | usingVertex |
std::string | vertexSrc |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 13 of file ImpactParameter.h.
ImpactParameter::ImpactParameter | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 47 of file ImpactParameter.cc.
References algo, edm::ParameterSet::getParameter(), jetTrackSrc, usingVertex, and vertexSrc.
{ jetTrackSrc = iConfig.getParameter<std::string>("JetTagProd"); vertexSrc = iConfig.getParameter<std::string>("vertexSrc"); usingVertex = iConfig.getParameter<bool>("useVertex"); algo = new ImpactParameterAlgorithm(iConfig); std::string modulname = iConfig.getParameter<std::string>( "@module_label" ); produces<reco::JetTagCollection>().setBranchAlias(modulname); std::string infoBranchName = modulname + "Info"; produces<reco::TauImpactParameterInfoCollection>().setBranchAlias(infoBranchName); }
ImpactParameter::~ImpactParameter | ( | ) |
void ImpactParameter::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 72 of file ImpactParameter.cc.
References algo, edm::EventSetup::get(), edm::Event::getByLabel(), i, jetTrackSrc, AlCaHLTBitMon_ParallelJobs::p, parseEventContent::prod, edm::Handle< T >::product(), edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, ImpactParameterAlgorithm::setTransientTrackBuilder(), ImpactParameterAlgorithm::tag(), usingVertex, and vertexSrc.
{ using namespace reco; edm::Handle<IsolatedTauTagInfoCollection> isolatedTaus; iEvent.getByLabel(jetTrackSrc,isolatedTaus); std::auto_ptr<JetTagCollection> tagCollection; std::auto_ptr<TauImpactParameterInfoCollection> extCollection( new TauImpactParameterInfoCollection() ); if (not isolatedTaus->empty()) { edm::RefToBaseProd<reco::Jet> prod( isolatedTaus->begin()->jet() ); tagCollection.reset( new JetTagCollection(prod) ); } else { tagCollection.reset( new JetTagCollection() ); } edm::ESHandle<TransientTrackBuilder> builder; iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",builder); algo->setTransientTrackBuilder(builder.product()); Vertex PV; if (usingVertex) { edm::Handle<reco::VertexCollection> vertices; iEvent.getByLabel(vertexSrc,vertices); const reco::VertexCollection vertCollection = *(vertices.product()); reco::VertexCollection::const_iterator iVertex; for(iVertex = vertCollection.begin();iVertex!=vertCollection.end();iVertex++){ PV = *iVertex; } } else { Vertex::Error e; e(0,0)=0; e(1,1)=0; e(2,2)=0; Vertex::Point p(0,0,0); Vertex dummyPV(p,e,1,1,1); PV = dummyPV; } for (unsigned int i = 0; i < isolatedTaus->size(); ++i) { IsolatedTauTagInfoRef tauRef(isolatedTaus, i); std::pair<float, TauImpactParameterInfo> ipInfo = algo->tag(tauRef,PV); tagCollection->setValue(i, ipInfo.first); extCollection->push_back(ipInfo.second); } iEvent.put(extCollection); iEvent.put(tagCollection); }
ImpactParameterAlgorithm* ImpactParameter::algo [private] |
Definition at line 21 of file ImpactParameter.h.
Referenced by ImpactParameter(), produce(), and ~ImpactParameter().
std::string ImpactParameter::jetTrackSrc [private] |
Definition at line 22 of file ImpactParameter.h.
Referenced by ImpactParameter(), and produce().
bool ImpactParameter::usingVertex [private] |
Definition at line 24 of file ImpactParameter.h.
Referenced by ImpactParameter(), and produce().
std::string ImpactParameter::vertexSrc [private] |
Definition at line 23 of file ImpactParameter.h.
Referenced by ImpactParameter(), and produce().