CMS 3D CMS Logo

ConeIsolation Class Reference

EDProducer of the tagged TauJet with the ConeIsolationAlgorithm. More...

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

Inheritance diagram for ConeIsolation:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 ConeIsolation (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~ConeIsolation ()

Private Attributes

edm::InputTag beamSpotProducer
edm::InputTag jetTrackSrc
ConeIsolationAlgorithmm_algo
bool usingBeamSpot
bool usingVertex
edm::InputTag vertexSrc


Detailed Description

EDProducer of the tagged TauJet with the ConeIsolationAlgorithm.

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

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.11
Author:
Simone Gennai
Implementation: <Notes on="" implementation>="">

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 beamSpotProducer, edm::ParameterSet::getParameter(), jetTrackSrc, m_algo, usingBeamSpot, usingVertex, and vertexSrc.

00053 {
00054   jetTrackSrc = iConfig.getParameter<InputTag>("JetTrackSrc");
00055   vertexSrc = iConfig.getParameter<InputTag>("vertexSrc");
00056   usingVertex = iConfig.getParameter<bool>("useVertex");
00057   usingBeamSpot = iConfig.getParameter<bool>("useBeamSpot"); //If false the OfflinePrimaryVertex will be used.
00058   beamSpotProducer = iConfig.getParameter<edm::InputTag>("BeamSpotProducer");
00059   m_algo = new ConeIsolationAlgorithm(iConfig);
00060   
00061   produces<reco::JetTagCollection>(); 
00062    produces<reco::IsolatedTauTagInfoCollection>();       
00063 
00064 
00065 
00066 }

ConeIsolation::~ConeIsolation (  ) 

Definition at line 69 of file ConeIsolation.cc.

References m_algo.

00070 {
00071   delete m_algo;
00072 }


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 beamSpotProducer, reco::Vertex::chi2(), e, cond::Error, reco::Vertex::error(), edm::Event::getByLabel(), i, it, jetTrackSrc, m_algo, reco::Vertex::ndof(), p, edm::Handle< T >::product(), edm::Event::put(), ConeIsolationAlgorithm::tag(), reco::Vertex::tracksSize(), usingBeamSpot, vertexSrc, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::Vertex::z().

00082 {
00083    using namespace edm;
00084    //Get jets with tracks
00085    Handle<reco::JetTracksAssociationCollection> jetTracksAssociation;
00086    iEvent.getByLabel(jetTrackSrc,jetTracksAssociation);
00087 
00088    std::auto_ptr<reco::JetTagCollection>             tagCollection;
00089    std::auto_ptr<reco::IsolatedTauTagInfoCollection> extCollection( new reco::IsolatedTauTagInfoCollection() );
00090 if (not jetTracksAssociation->empty()) {
00091      RefToBaseProd<reco::Jet> prod( jetTracksAssociation->begin()->first );
00092      tagCollection.reset( new reco::JetTagCollection(prod) );
00093    } else {
00094      tagCollection.reset( new reco::JetTagCollection() );
00095    }
00096 
00097    Vertex::Error e;
00098    e(0,0)=1;
00099    e(1,1)=1;
00100    e(2,2)=1;
00101    Vertex::Point p(0,0,-1000);
00102    Vertex myPVtmp(p,e);//Fake vertex to be used in case no vertex is found
00103    Vertex myPV;
00104 
00105    //Get pixel vertices
00106    Handle<reco::VertexCollection> vertices;
00107    iEvent.getByLabel(vertexSrc,vertices);
00108    const reco::VertexCollection vertCollection = *(vertices.product());
00109    //Check if there is the PV!!!!
00110    if(vertCollection.begin() != vertCollection.end())
00111      myPVtmp = *(vertCollection.begin());
00112 
00113    //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
00114    reco::BeamSpot vertexBeamSpot;
00115    edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
00116    
00117    if(usingBeamSpot)
00118      {
00119        //Create a new vertex with the information on x0 and Y0 from the beamspot, to be used in HLT.
00120        iEvent.getByLabel(beamSpotProducer,recoBeamSpotHandle);
00121        vertexBeamSpot = *recoBeamSpotHandle;
00122        Vertex::Point bspoint(vertexBeamSpot.x0(),vertexBeamSpot.y0(),myPVtmp.z());
00123        Vertex combinedVertex = Vertex(bspoint,myPVtmp.error(),myPVtmp.chi2(),myPVtmp.ndof(),myPVtmp.tracksSize());
00124        myPV = combinedVertex;
00125          }else{
00126            myPV = myPVtmp;
00127          }
00128 
00129 
00130    
00131    JetTracksAssociationCollection::const_iterator it = jetTracksAssociation->begin();
00132    for (unsigned int i = 0; i < jetTracksAssociation->size(); ++i)
00133      {
00134        pair<float,IsolatedTauTagInfo> myPair =m_algo->tag(edm::Ref<JetTracksAssociationCollection>(jetTracksAssociation,i),myPV); 
00135        tagCollection->setValue(i, myPair.first);
00136        extCollection->push_back(myPair.second);
00137      }
00138 
00139    iEvent.put(extCollection);
00140    iEvent.put(tagCollection);
00141 
00142 
00143 
00144 }


Member Data Documentation

edm::InputTag ConeIsolation::beamSpotProducer [private]

Definition at line 36 of file ConeIsolation.h.

Referenced by ConeIsolation(), and produce().

edm::InputTag ConeIsolation::jetTrackSrc [private]

Definition at line 33 of file ConeIsolation.h.

Referenced by ConeIsolation(), and produce().

ConeIsolationAlgorithm* ConeIsolation::m_algo [private]

Definition at line 32 of file ConeIsolation.h.

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

bool ConeIsolation::usingBeamSpot [private]

Definition at line 37 of file ConeIsolation.h.

Referenced by ConeIsolation(), and produce().

bool ConeIsolation::usingVertex [private]

Definition at line 35 of file ConeIsolation.h.

Referenced by ConeIsolation().

edm::InputTag ConeIsolation::vertexSrc [private]

Definition at line 34 of file ConeIsolation.h.

Referenced by ConeIsolation(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:44 2009 for CMSSW by  doxygen 1.5.4