CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ImpactParameter Class Reference
Inheritance diagram for ImpactParameter:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ImpactParameter (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~ImpactParameter () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

ImpactParameterAlgorithmalgo
 
edm::InputTag jetTrackSrc
 
bool usingVertex
 
edm::InputTag vertexSrc
 

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)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 30 of file ImpactParameter.cc.

Constructor & Destructor Documentation

◆ ImpactParameter()

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

Definition at line 47 of file ImpactParameter.cc.

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

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

◆ ~ImpactParameter()

ImpactParameter::~ImpactParameter ( )
override

Definition at line 60 of file ImpactParameter.cc.

60 { delete algo; }

References algo.

Member Function Documentation

◆ produce()

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

Implements edm::EDProducer.

Definition at line 66 of file ImpactParameter.cc.

66  {
67  using namespace reco;
68 
70  iEvent.getByLabel(jetTrackSrc, isolatedTaus);
71 
72  std::unique_ptr<JetTagCollection> tagCollection;
73  auto extCollection = std::make_unique<TauImpactParameterInfoCollection>();
74  if (not isolatedTaus->empty()) {
76  tagCollection = std::make_unique<JetTagCollection>(prod);
77  } else {
78  tagCollection = std::make_unique<JetTagCollection>();
79  }
80 
82  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder", builder);
84 
85  Vertex PV;
86  if (usingVertex) {
88  iEvent.getByLabel(vertexSrc, vertices);
89 
90  const reco::VertexCollection vertCollection = *(vertices.product());
91  reco::VertexCollection::const_iterator iVertex;
92 
93  for (iVertex = vertCollection.begin(); iVertex != vertCollection.end(); iVertex++) {
94  PV = *iVertex;
95  }
96 
97  } else {
99  e(0, 0) = 0;
100  e(1, 1) = 0;
101  e(2, 2) = 0;
102  Vertex::Point p(0, 0, 0);
103 
104  Vertex dummyPV(p, e, 1, 1, 1);
105  PV = dummyPV;
106  }
107 
108  for (unsigned int i = 0; i < isolatedTaus->size(); ++i) {
109  IsolatedTauTagInfoRef tauRef(isolatedTaus, i);
110  std::pair<float, TauImpactParameterInfo> ipInfo = algo->tag(tauRef, PV);
111  tagCollection->setValue(i, ipInfo.first);
112  extCollection->push_back(ipInfo.second);
113  }
114 
115  iEvent.put(std::move(extCollection));
116  iEvent.put(std::move(tagCollection));
117 }

References algo, MillePedeFileConverter_cfg::e, edm::EventSetup::get(), get, mps_fire::i, iEvent, jetTrackSrc, edm::makeRefToBaseProdFrom(), eostools::move(), AlCaHLTBitMon_ParallelJobs::p, dumpMFGeometry_cfg::prod, edm::ESHandle< T >::product(), nanoDQM_cfi::PV, ImpactParameterAlgorithm::setTransientTrackBuilder(), ImpactParameterAlgorithm::tag(), usingVertex, vertexSrc, and AlignmentTracksFromVertexSelector_cfi::vertices.

Member Data Documentation

◆ algo

ImpactParameterAlgorithm* ImpactParameter::algo
private

Definition at line 38 of file ImpactParameter.cc.

Referenced by ImpactParameter(), produce(), and ~ImpactParameter().

◆ jetTrackSrc

edm::InputTag ImpactParameter::jetTrackSrc
private

Definition at line 39 of file ImpactParameter.cc.

Referenced by ImpactParameter(), and produce().

◆ usingVertex

bool ImpactParameter::usingVertex
private

Definition at line 41 of file ImpactParameter.cc.

Referenced by ImpactParameter(), and produce().

◆ vertexSrc

edm::InputTag ImpactParameter::vertexSrc
private

Definition at line 40 of file ImpactParameter.cc.

Referenced by ImpactParameter(), and produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
mps_fire.i
i
Definition: mps_fire.py:428
reco::Vertex::Error
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:44
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
ImpactParameter::usingVertex
bool usingVertex
Definition: ImpactParameter.cc:41
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
ImpactParameterAlgorithm::tag
std::pair< float, reco::TauImpactParameterInfo > tag(const reco::IsolatedTauTagInfoRef &, const reco::Vertex &)
Definition: ImpactParameterAlgorithm.cc:29
edm::Handle
Definition: AssociativeIterator.h:50
nanoDQM_cfi.PV
PV
Definition: nanoDQM_cfi.py:576
AlignmentTracksFromVertexSelector_cfi.vertices
vertices
Definition: AlignmentTracksFromVertexSelector_cfi.py:5
ImpactParameterAlgorithm
Definition: ImpactParameterAlgorithm.h:19
edm::Ref< IsolatedTauTagInfoCollection >
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
ImpactParameter::vertexSrc
edm::InputTag vertexSrc
Definition: ImpactParameter.cc:40
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
TransientTrackRecord
Definition: TransientTrackRecord.h:11
edm::ESHandle< TransientTrackBuilder >
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::makeRefToBaseProdFrom
RefToBaseProd< T > makeRefToBaseProdFrom(RefToBase< T > const &iRef, Event const &iEvent)
Definition: makeRefToBaseProdFrom.h:34
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
reco::Vertex::Point
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
eostools.move
def move(src, dest)
Definition: eostools.py:511
ImpactParameterAlgorithm::setTransientTrackBuilder
void setTransientTrackBuilder(const TransientTrackBuilder *)
Definition: ImpactParameterAlgorithm.cc:25
ImpactParameter::algo
ImpactParameterAlgorithm * algo
Definition: ImpactParameter.cc:38
ImpactParameter::jetTrackSrc
edm::InputTag jetTrackSrc
Definition: ImpactParameter.cc:39
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
edm::RefToBaseProd
Definition: RefToBase.h:65
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37