CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ConeIsolation Class Reference

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

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

Public Member Functions

 ConeIsolation (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~ConeIsolation () 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
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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 ()
 

Private Attributes

edm::InputTag beamSpotTag
 
edm::EDGetTokenT< reco::BeamSpotbeamSpotToken
 
edm::InputTag jetTrackTag
 
edm::EDGetTokenT< reco::JetTracksAssociationCollectionjetTrackToken
 
ConeIsolationAlgorithmm_algo
 
bool usingBeamSpot
 
edm::InputTag vertexTag
 
edm::EDGetTokenT< reco::VertexCollectionvertexToken
 

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

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

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

EDProducer of the tagged TauJet with the ConeIsolationAlgorithm. It returns two collections: base collection is the JetTag, and extended Collection which is the IsolatedTauTagInfo. The method implemented in the IsolatedTauTagInfo class are used to compute the discriminator variable. A trick is used to link the IsolatedTauTagInfo to a smart reference to the JetTag.

Author
Simone Gennai

Definition at line 21 of file ConeIsolation.h.

Constructor & Destructor Documentation

◆ ConeIsolation()

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

Definition at line 52 of file ConeIsolation.cc.

52  {
53  jetTrackTag = iConfig.getParameter<InputTag>("JetTrackSrc");
54  jetTrackToken = consumes<reco::JetTracksAssociationCollection>(jetTrackTag);
55  vertexTag = iConfig.getParameter<InputTag>("vertexSrc");
56  vertexToken = consumes<reco::VertexCollection>(vertexTag);
57  beamSpotTag = iConfig.getParameter<edm::InputTag>("BeamSpotProducer");
58  beamSpotToken = consumes<reco::BeamSpot>(beamSpotTag);
59  usingBeamSpot = iConfig.getParameter<bool>("useBeamSpot"); //If false the OfflinePrimaryVertex will be used.
60 
61  m_algo = new ConeIsolationAlgorithm(iConfig);
62 
63  produces<reco::JetTagCollection>();
64  produces<reco::IsolatedTauTagInfoCollection>();
65 }

References AlignmentProducer_cff::beamSpotTag, edm::ParameterSet::getParameter(), and StandaloneTrackMonitor_cfi::vertexTag.

◆ ~ConeIsolation()

ConeIsolation::~ConeIsolation ( )
override

Definition at line 67 of file ConeIsolation.cc.

67 { delete m_algo; }

Member Function Documentation

◆ fillDescriptions()

void ConeIsolation::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 73 of file ConeIsolation.cc.

73  {
75  desc.add<edm::InputTag>("JetTrackSrc", edm::InputTag("ic5JetTracksAssociatorAtVertex"));
76  desc.add<edm::InputTag>("vertexSrc", edm::InputTag("offlinePrimaryVertices"));
77  desc.add<edm::InputTag>("BeamSpotProducer", edm::InputTag("offlineBeamSpot"));
78  desc.add<bool>("useBeamSpot", false);
80  descriptions.add("coneIsolationTauJetTags", desc);
81 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), ConeIsolationAlgorithm::fillDescription(), and HLT_2018_cff::InputTag.

◆ produce()

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

Implements edm::EDProducer.

Definition at line 84 of file ConeIsolation.cc.

84  {
85  using namespace edm;
86  //Get jets with tracks
88  iEvent.getByToken(jetTrackToken, jetTracksAssociation);
89 
90  std::unique_ptr<reco::JetTagCollection> tagCollection;
91  std::unique_ptr<reco::IsolatedTauTagInfoCollection> extCollection(new reco::IsolatedTauTagInfoCollection());
92  if (not jetTracksAssociation->empty()) {
93  RefToBaseProd<reco::Jet> prod(edm::makeRefToBaseProdFrom(jetTracksAssociation->begin()->first, iEvent));
94  tagCollection.reset(new reco::JetTagCollection(prod));
95  } else {
96  tagCollection.reset(new reco::JetTagCollection());
97  }
98 
100  e(0, 0) = 1;
101  e(1, 1) = 1;
102  e(2, 2) = 1;
103  Vertex::Point p(0, 0, -1000);
104  Vertex myPVtmp(p, e); //Fake vertex to be used in case no vertex is found
105  Vertex myPV;
106 
107  //Get pixel vertices
109  iEvent.getByToken(vertexToken, vertices);
110  const reco::VertexCollection vertCollection = *(vertices.product());
111  //Check if there is the PV!!!!
112  if (vertCollection.begin() != vertCollection.end())
113  myPVtmp = *(vertCollection.begin());
114 
115  //In case the beam spot is used, the Z of the vertex still comes from the PV, while the (x,y) is taken from the beamspot
116  reco::BeamSpot vertexBeamSpot;
117  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
118 
119  if (usingBeamSpot) {
120  //Create a new vertex with the information on x0 and Y0 from the beamspot, to be used in HLT.
121  iEvent.getByToken(beamSpotToken, recoBeamSpotHandle);
122  vertexBeamSpot = *recoBeamSpotHandle;
123  Vertex::Point bspoint(vertexBeamSpot.x0(), vertexBeamSpot.y0(), myPVtmp.z());
124  Vertex combinedVertex = Vertex(bspoint, myPVtmp.error(), myPVtmp.chi2(), myPVtmp.ndof(), myPVtmp.tracksSize());
125  myPV = combinedVertex;
126  } else {
127  myPV = myPVtmp;
128  }
129 
130  for (unsigned int i = 0; i < jetTracksAssociation->size(); ++i) {
131  pair<float, IsolatedTauTagInfo> myPair =
132  m_algo->tag(edm::Ref<JetTracksAssociationCollection>(jetTracksAssociation, i), myPV);
133  tagCollection->setValue(i, myPair.first);
134  extCollection->push_back(myPair.second);
135  }
136 
137  iEvent.put(std::move(extCollection));
138  iEvent.put(std::move(tagCollection));
139 }

References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::begin(), reco::Vertex::chi2(), MillePedeFileConverter_cfg::e, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::empty(), reco::Vertex::error(), mps_fire::i, iEvent, edm::makeRefToBaseProdFrom(), eostools::move(), reco::Vertex::ndof(), AlCaHLTBitMon_ParallelJobs::p, dumpMFGeometry_cfg::prod, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::size(), reco::Vertex::tracksSize(), HltBtagValidation_cff::Vertex, pwdgSkimBPark_cfi::vertices, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::Vertex::z().

Member Data Documentation

◆ beamSpotTag

edm::InputTag ConeIsolation::beamSpotTag
private

Definition at line 33 of file ConeIsolation.h.

◆ beamSpotToken

edm::EDGetTokenT<reco::BeamSpot> ConeIsolation::beamSpotToken
private

Definition at line 34 of file ConeIsolation.h.

◆ jetTrackTag

edm::InputTag ConeIsolation::jetTrackTag
private

Definition at line 29 of file ConeIsolation.h.

◆ jetTrackToken

edm::EDGetTokenT<reco::JetTracksAssociationCollection> ConeIsolation::jetTrackToken
private

Definition at line 30 of file ConeIsolation.h.

◆ m_algo

ConeIsolationAlgorithm* ConeIsolation::m_algo
private

Definition at line 36 of file ConeIsolation.h.

◆ usingBeamSpot

bool ConeIsolation::usingBeamSpot
private

Definition at line 35 of file ConeIsolation.h.

◆ vertexTag

edm::InputTag ConeIsolation::vertexTag
private

Definition at line 31 of file ConeIsolation.h.

◆ vertexToken

edm::EDGetTokenT<reco::VertexCollection> ConeIsolation::vertexToken
private

Definition at line 32 of file ConeIsolation.h.

mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
reco::IsolatedTauTagInfoCollection
std::vector< IsolatedTauTagInfo > IsolatedTauTagInfoCollection
Definition: IsolatedTauTagInfo.h:95
edm
HLT enums.
Definition: AlignableModifier.h:19
reco::Vertex::Error
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:44
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::AssociationVector::empty
bool empty() const
Definition: AssociationVector.h:232
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref
Definition: AssociativeIterator.h:58
ConeIsolation::vertexTag
edm::InputTag vertexTag
Definition: ConeIsolation.h:31
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::AssociationVector::begin
const_iterator begin() const
Definition: AssociationVector.h:108
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
reco::BeamSpot
Definition: BeamSpot.h:21
ConeIsolation::beamSpotTag
edm::InputTag beamSpotTag
Definition: ConeIsolation.h:33
ConeIsolation::usingBeamSpot
bool usingBeamSpot
Definition: ConeIsolation.h:35
ConeIsolation::jetTrackToken
edm::EDGetTokenT< reco::JetTracksAssociationCollection > jetTrackToken
Definition: ConeIsolation.h:30
edm::AssociationVector
Definition: AssociationVector.h:67
ConeIsolation::jetTrackTag
edm::InputTag jetTrackTag
Definition: ConeIsolation.h:29
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::makeRefToBaseProdFrom
RefToBaseProd< T > makeRefToBaseProdFrom(RefToBase< T > const &iRef, Event const &iEvent)
Definition: makeRefToBaseProdFrom.h:34
ConeIsolation::vertexToken
edm::EDGetTokenT< reco::VertexCollection > vertexToken
Definition: ConeIsolation.h:32
iEvent
int iEvent
Definition: GenABIO.cc:224
ConeIsolationAlgorithm
Definition: ConeIsolationAlgorithm.h:17
ConeIsolation::beamSpotToken
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken
Definition: ConeIsolation.h:34
edm::AssociationVector::size
size_type size() const
Definition: AssociationVector.h:227
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::BeamSpot::x0
double x0() const
x coordinate
Definition: BeamSpot.h:61
ConeIsolationAlgorithm::tag
std::pair< float, reco::IsolatedTauTagInfo > tag(const reco::JetTracksAssociationRef &jetTracks, const reco::Vertex &pv)
Definition: ConeIsolationAlgorithm.cc:51
reco::Vertex::Point
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
eostools.move
def move(src, dest)
Definition: eostools.py:511
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
reco::BeamSpot::y0
double y0() const
y coordinate
Definition: BeamSpot.h:63
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
ConeIsolationAlgorithm::fillDescription
static void fillDescription(edm::ParameterSetDescription &desc)
Definition: ConeIsolationAlgorithm.cc:31
ConeIsolation::m_algo
ConeIsolationAlgorithm * m_algo
Definition: ConeIsolation.h:36
edm::RefToBaseProd
Definition: RefToBase.h:65
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37