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

#include <RecoBTag/ImpactParameter/src/ImpactParameter.cc>

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

Public Member Functions

 ImpactParameter (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~ImpactParameter ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

ImpactParameterAlgorithmalgo
 
std::string jetTrackSrc
 
bool usingVertex
 
std::string vertexSrc
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 13 of file ImpactParameter.h.

Constructor & Destructor Documentation

ImpactParameter::ImpactParameter ( const edm::ParameterSet iConfig)
explicit

Definition at line 47 of file ImpactParameter.cc.

References algo, edm::ParameterSet::getParameter(), jetTrackSrc, AlCaHLTBitMon_QueryRunRegistry::string, usingVertex, and vertexSrc.

47  {
48 
49  jetTrackSrc = iConfig.getParameter<std::string>("JetTagProd");
50  vertexSrc = iConfig.getParameter<std::string>("vertexSrc");
51  usingVertex = iConfig.getParameter<bool>("useVertex");
52 
53  algo = new ImpactParameterAlgorithm(iConfig);
54 
55  std::string modulname = iConfig.getParameter<std::string>( "@module_label" );
56  produces<reco::JetTagCollection>().setBranchAlias(modulname);
57  std::string infoBranchName = modulname + "Info";
58  produces<reco::TauImpactParameterInfoCollection>().setBranchAlias(infoBranchName);
59 }
T getParameter(std::string const &) const
std::string jetTrackSrc
ImpactParameterAlgorithm * algo
std::string vertexSrc
ImpactParameter::~ImpactParameter ( )

Definition at line 62 of file ImpactParameter.cc.

References algo.

62  {
63  delete algo;
64 }
ImpactParameterAlgorithm * algo

Member Function Documentation

void ImpactParameter::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 72 of file ImpactParameter.cc.

References algo, alignCSCRings::e, edm::EventSetup::get(), edm::Event::getByLabel(), i, jetTrackSrc, AlCaHLTBitMon_ParallelJobs::p, parseEventContent::prod, edm::Handle< T >::product(), edm::Event::put(), L1Trigger_dataformats::reco, ImpactParameterAlgorithm::setTransientTrackBuilder(), ImpactParameterAlgorithm::tag(), usingVertex, and vertexSrc.

72  {
73 
74  using namespace reco;
75 
77  iEvent.getByLabel(jetTrackSrc,isolatedTaus);
78 
79  std::auto_ptr<JetTagCollection> tagCollection;
80  std::auto_ptr<TauImpactParameterInfoCollection> extCollection( new TauImpactParameterInfoCollection() );
81  if (not isolatedTaus->empty()) {
82  edm::RefToBaseProd<reco::Jet> prod( isolatedTaus->begin()->jet() );
83  tagCollection.reset( new JetTagCollection(prod) );
84  } else {
85  tagCollection.reset( new JetTagCollection() );
86  }
87 
89  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",builder);
90  algo->setTransientTrackBuilder(builder.product());
91 
92  Vertex PV;
93  if (usingVertex) {
95  iEvent.getByLabel(vertexSrc,vertices);
96 
97  const reco::VertexCollection vertCollection = *(vertices.product());
98  reco::VertexCollection::const_iterator iVertex;
99 
100  for(iVertex = vertCollection.begin();iVertex!=vertCollection.end();iVertex++){
101  PV = *iVertex;
102  }
103 
104  } else {
106  e(0,0)=0;
107  e(1,1)=0;
108  e(2,2)=0;
109  Vertex::Point p(0,0,0);
110 
111  Vertex dummyPV(p,e,1,1,1);
112  PV = dummyPV;
113  }
114 
115  for (unsigned int i = 0; i < isolatedTaus->size(); ++i) {
116  IsolatedTauTagInfoRef tauRef(isolatedTaus, i);
117  std::pair<float, TauImpactParameterInfo> ipInfo = algo->tag(tauRef,PV);
118  tagCollection->setValue(i, ipInfo.first);
119  extCollection->push_back(ipInfo.second);
120  }
121 
122  iEvent.put(extCollection);
123  iEvent.put(tagCollection);
124 }
int i
Definition: DBlmapReader.cc:9
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:44
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
JetFloatAssociation::Container JetTagCollection
Definition: JetTag.h:18
std::string jetTrackSrc
void setTransientTrackBuilder(const TransientTrackBuilder *)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
ImpactParameterAlgorithm * algo
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: Handle.h:74
std::string vertexSrc
std::pair< float, reco::TauImpactParameterInfo > tag(const reco::IsolatedTauTagInfoRef &, const reco::Vertex &)

Member Data Documentation

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