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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 31 of file ImpactParameter.cc.

Constructor & Destructor Documentation

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

Definition at line 49 of file ImpactParameter.cc.

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

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

Definition at line 64 of file ImpactParameter.cc.

References algo.

64  {
65  delete algo;
66 }
ImpactParameterAlgorithm * algo

Member Function Documentation

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

Definition at line 74 of file ImpactParameter.cc.

References algo, DEFINE_FWK_MODULE, MillePedeFileConverter_cfg::e, edm::EventSetup::get(), edm::Event::getByLabel(), mps_fire::i, iEvent, jetTrackSrc, edm::makeRefToBaseProdFrom(), eostools::move(), AlCaHLTBitMon_ParallelJobs::p, parseEventContent::prod, edm::Handle< T >::product(), edm::Event::put(), nanoDQM_cfi::PV, ImpactParameterAlgorithm::setTransientTrackBuilder(), ImpactParameterAlgorithm::tag(), usingVertex, vertexSrc, and electrons_cff::vertices.

74  {
75 
76  using namespace reco;
77 
79  iEvent.getByLabel(jetTrackSrc,isolatedTaus);
80 
81  std::unique_ptr<JetTagCollection> tagCollection;
82  auto extCollection = std::make_unique<TauImpactParameterInfoCollection>();
83  if (not isolatedTaus->empty()) {
84  edm::RefToBaseProd<reco::Jet> prod( edm::makeRefToBaseProdFrom(isolatedTaus->begin()->jet(), iEvent) );
85  tagCollection = std::make_unique<JetTagCollection>(prod);
86  } else {
87  tagCollection = std::make_unique<JetTagCollection>();
88  }
89 
91  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",builder);
92  algo->setTransientTrackBuilder(builder.product());
93 
94  Vertex PV;
95  if (usingVertex) {
97  iEvent.getByLabel(vertexSrc,vertices);
98 
99  const reco::VertexCollection vertCollection = *(vertices.product());
100  reco::VertexCollection::const_iterator iVertex;
101 
102  for(iVertex = vertCollection.begin();iVertex!=vertCollection.end();iVertex++){
103  PV = *iVertex;
104  }
105 
106  } else {
108  e(0,0)=0;
109  e(1,1)=0;
110  e(2,2)=0;
111  Vertex::Point p(0,0,0);
112 
113  Vertex dummyPV(p,e,1,1,1);
114  PV = dummyPV;
115  }
116 
117  for (unsigned int i = 0; i < isolatedTaus->size(); ++i) {
118  IsolatedTauTagInfoRef tauRef(isolatedTaus, i);
119  std::pair<float, TauImpactParameterInfo> ipInfo = algo->tag(tauRef,PV);
120  tagCollection->setValue(i, ipInfo.first);
121  extCollection->push_back(ipInfo.second);
122  }
123 
124  iEvent.put(std::move(extCollection));
125  iEvent.put(std::move(tagCollection));
126 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
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
int iEvent
Definition: GenABIO.cc:224
void setTransientTrackBuilder(const TransientTrackBuilder *)
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
T const * product() const
Definition: Handle.h:74
edm::InputTag jetTrackSrc
ImpactParameterAlgorithm * algo
edm::InputTag vertexSrc
RefToBaseProd< T > makeRefToBaseProdFrom(RefToBase< T > const &iRef, Event const &iEvent)
fixed size matrix
T get() const
Definition: EventSetup.h:71
std::pair< float, reco::TauImpactParameterInfo > tag(const reco::IsolatedTauTagInfoRef &, const reco::Vertex &)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

ImpactParameterAlgorithm* ImpactParameter::algo
private

Definition at line 39 of file ImpactParameter.cc.

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

edm::InputTag ImpactParameter::jetTrackSrc
private

Definition at line 40 of file ImpactParameter.cc.

Referenced by ImpactParameter(), and produce().

bool ImpactParameter::usingVertex
private

Definition at line 42 of file ImpactParameter.cc.

Referenced by ImpactParameter(), and produce().

edm::InputTag ImpactParameter::vertexSrc
private

Definition at line 41 of file ImpactParameter.cc.

Referenced by ImpactParameter(), and produce().