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

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

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

Public Member Functions

 ConeIsolation (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~ConeIsolation ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

edm::InputTag beamSpotProducer
 
edm::InputTag jetTrackSrc
 
ConeIsolationAlgorithmm_algo
 
bool usingBeamSpot
 
bool usingVertex
 
edm::InputTag 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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.

Revision:
1.2
Author
Simone Gennai

Definition at line 24 of file ConeIsolation.h.

Constructor & Destructor Documentation

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

Definition at line 52 of file ConeIsolation.cc.

References edm::ParameterSet::getParameter(), and HLTFastRecoForTau_cff::vertexSrc.

53 {
54  jetTrackSrc = iConfig.getParameter<InputTag>("JetTrackSrc");
55  vertexSrc = iConfig.getParameter<InputTag>("vertexSrc");
56  usingVertex = iConfig.getParameter<bool>("useVertex");
57  usingBeamSpot = iConfig.getParameter<bool>("useBeamSpot"); //If false the OfflinePrimaryVertex will be used.
58  beamSpotProducer = iConfig.getParameter<edm::InputTag>("BeamSpotProducer");
59  m_algo = new ConeIsolationAlgorithm(iConfig);
60 
61  produces<reco::JetTagCollection>();
62  produces<reco::IsolatedTauTagInfoCollection>();
63 
64 
65 
66 }
T getParameter(std::string const &) const
edm::InputTag jetTrackSrc
Definition: ConeIsolation.h:33
ConeIsolationAlgorithm * m_algo
Definition: ConeIsolation.h:32
edm::InputTag vertexSrc
Definition: ConeIsolation.h:34
edm::InputTag beamSpotProducer
Definition: ConeIsolation.h:36
ConeIsolation::~ConeIsolation ( )

Definition at line 69 of file ConeIsolation.cc.

70 {
71  delete m_algo;
72 }
ConeIsolationAlgorithm * m_algo
Definition: ConeIsolation.h:32

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 81 of file ConeIsolation.cc.

References reco::Vertex::chi2(), alignCSCRings::e, reco::Vertex::error(), edm::Event::getByLabel(), i, reco::Vertex::ndof(), AlCaHLTBitMon_ParallelJobs::p, parseEventContent::prod, edm::Event::put(), reco::Vertex::tracksSize(), HLTFastRecoForTau_cff::vertexSrc, and reco::Vertex::z().

82 {
83  using namespace edm;
84  //Get jets with tracks
86  iEvent.getByLabel(jetTrackSrc,jetTracksAssociation);
87 
88  std::auto_ptr<reco::JetTagCollection> tagCollection;
89  std::auto_ptr<reco::IsolatedTauTagInfoCollection> extCollection( new reco::IsolatedTauTagInfoCollection() );
90 if (not jetTracksAssociation->empty()) {
91  RefToBaseProd<reco::Jet> prod( jetTracksAssociation->begin()->first );
92  tagCollection.reset( new reco::JetTagCollection(prod) );
93  } else {
94  tagCollection.reset( new reco::JetTagCollection() );
95  }
96 
98  e(0,0)=1;
99  e(1,1)=1;
100  e(2,2)=1;
101  Vertex::Point p(0,0,-1000);
102  Vertex myPVtmp(p,e);//Fake vertex to be used in case no vertex is found
103  Vertex myPV;
104 
105  //Get pixel vertices
107  iEvent.getByLabel(vertexSrc,vertices);
108  const reco::VertexCollection vertCollection = *(vertices.product());
109  //Check if there is the PV!!!!
110  if(vertCollection.begin() != vertCollection.end())
111  myPVtmp = *(vertCollection.begin());
112 
113  //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
114  reco::BeamSpot vertexBeamSpot;
115  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
116 
117  if(usingBeamSpot)
118  {
119  //Create a new vertex with the information on x0 and Y0 from the beamspot, to be used in HLT.
120  iEvent.getByLabel(beamSpotProducer,recoBeamSpotHandle);
121  vertexBeamSpot = *recoBeamSpotHandle;
122  Vertex::Point bspoint(vertexBeamSpot.x0(),vertexBeamSpot.y0(),myPVtmp.z());
123  Vertex combinedVertex = Vertex(bspoint,myPVtmp.error(),myPVtmp.chi2(),myPVtmp.ndof(),myPVtmp.tracksSize());
124  myPV = combinedVertex;
125  }else{
126  myPV = myPVtmp;
127  }
128 
129  for (unsigned int i = 0; i < jetTracksAssociation->size(); ++i)
130  {
131  pair<float,IsolatedTauTagInfo> myPair =m_algo->tag(edm::Ref<JetTracksAssociationCollection>(jetTracksAssociation,i),myPV);
132  tagCollection->setValue(i, myPair.first);
133  extCollection->push_back(myPair.second);
134  }
135 
136  iEvent.put(extCollection);
137  iEvent.put(tagCollection);
138 
139 }
int i
Definition: DBlmapReader.cc:9
edm::InputTag jetTrackSrc
Definition: ConeIsolation.h:33
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
std::vector< IsolatedTauTagInfo > IsolatedTauTagInfoCollection
ConeIsolationAlgorithm * m_algo
Definition: ConeIsolation.h:32
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::pair< float,reco::IsolatedTauTagInfo > tag(const reco::JetTracksAssociationRef &jetTracks, const reco::Vertex &pv)
edm::InputTag vertexSrc
Definition: ConeIsolation.h:34
edm::InputTag beamSpotProducer
Definition: ConeIsolation.h:36

Member Data Documentation

edm::InputTag ConeIsolation::beamSpotProducer
private

Definition at line 36 of file ConeIsolation.h.

edm::InputTag ConeIsolation::jetTrackSrc
private

Definition at line 33 of file ConeIsolation.h.

ConeIsolationAlgorithm* ConeIsolation::m_algo
private

Definition at line 32 of file ConeIsolation.h.

bool ConeIsolation::usingBeamSpot
private

Definition at line 37 of file ConeIsolation.h.

bool ConeIsolation::usingVertex
private

Definition at line 35 of file ConeIsolation.h.

edm::InputTag ConeIsolation::vertexSrc
private

Definition at line 34 of file ConeIsolation.h.