CMS 3D CMS Logo

InvariantMass< T1, T2 > Class Template Reference

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

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

Inheritance diagram for InvariantMass< T1, T2 >:

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

List of all members.

Public Member Functions

 InvariantMass (const edm::ParameterSet &)
double operator() (const T1 &t1, const T2 &t2) const
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~InvariantMass ()

Private Member Functions

reco::BasicClusterRefProd getSelectedClusters (reco::BasicClusterRefProd bclus, reco::BasicClusterRefProd eclus, reco::Jet &jet)

Private Attributes

std::string jetTrackSrc
InvariantMassAlgorithmm_algo
std::string m_ecalBClSrc


Detailed Description

template<typename T1, typename T2 = T1>
class InvariantMass< T1, T2 >

EDProducer of the tagged TauJet with the InvariantMassAlgorithm.

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.1
Author:
Suchandra Dutta
Implementation: <Notes on="" implementation>="">

Definition at line 6 of file InvariantMass.h.


Constructor & Destructor Documentation

template<typename T1, typename T2 = T1>
InvariantMass< T1, T2 >::InvariantMass ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 50 of file InvariantMass.cc.

References edm::ParameterSet::getParameter(), InvariantMass< T1, T2 >::jetTrackSrc, InvariantMass< T1, T2 >::m_algo, and InvariantMass< T1, T2 >::m_ecalBClSrc.

00051 {
00052   jetTrackSrc = iConfig.getParameter<string>("JetTrackSrc");
00053   m_ecalBClSrc = iConfig.getParameter<string>("ecalbcl");
00054 
00055   m_algo = new InvariantMassAlgorithm(iConfig);
00056   
00057   produces<reco::JetTagCollection>();  //Several producer so I put a label
00058   produces<reco::TauMassTagInfoCollection>();   //Only one producer
00059 
00060 
00061 }

template<typename T1, typename T2 = T1>
InvariantMass< T1, T2 >::~InvariantMass (  ) 

Definition at line 64 of file InvariantMass.cc.

References InvariantMass< T1, T2 >::m_algo.

00065 {
00066   delete m_algo;
00067 }


Member Function Documentation

template<typename T1, typename T2 = T1>
reco::BasicClusterRefProd InvariantMass< T1, T2 >::getSelectedClusters ( reco::BasicClusterRefProd  bclus,
reco::BasicClusterRefProd  eclus,
reco::Jet jet 
) [private]

template<typename T1, typename T2 = T1>
double InvariantMass< T1, T2 >::operator() ( const T1 &  t1,
const T2 &  t2 
) const [inline]

Definition at line 7 of file InvariantMass.h.

00007                                                           {
00008     return ( t1.momentum() + t2.momentum() ).mass();
00009   }

template<typename T1, typename T2 = T1>
void InvariantMass< T1, T2 >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 74 of file InvariantMass.cc.

References edm::Event::getByLabel(), i, metsig::jet, configurableAnalysis::Jet, InvariantMass< T1, T2 >::jetTrackSrc, InvariantMass< T1, T2 >::m_algo, InvariantMass< T1, T2 >::m_ecalBClSrc, edm::Event::put(), HcalSimpleRecAlgoImpl::reco(), and InvariantMassAlgorithm::tag().

00075 {
00076    using namespace edm;
00077    using namespace reco;
00078 
00079    Handle<IsolatedTauTagInfoCollection> isolatedTaus;
00080    iEvent.getByLabel(jetTrackSrc, isolatedTaus);
00081    
00082    std::auto_ptr<JetTagCollection>         tagCollection;
00083    std::auto_ptr<TauMassTagInfoCollection> extCollection( new TauMassTagInfoCollection() );
00084 
00085    // Island basic cluster collection
00086    Handle<BasicClusterCollection> barrelBasicClusterHandle;
00087    iEvent.getByLabel(m_ecalBClSrc, "islandBarrelBasicClusters", barrelBasicClusterHandle);
00088    const reco::BasicClusterCollection & barrelClusters = *(barrelBasicClusterHandle.product());
00089 
00090    Handle<BasicClusterCollection> endcapBasicClusterHandle;
00091    iEvent.getByLabel(m_ecalBClSrc, "islandEndcapBasicClusters", endcapBasicClusterHandle);
00092    const reco::BasicClusterCollection & endcapClusters = *(endcapBasicClusterHandle.product());
00093 
00094    if (isolatedTaus->empty()) {
00095      tagCollection.reset( new JetTagCollection() );
00096    } else {
00097      RefToBaseProd<reco::Jet> prod( isolatedTaus->begin()->jet() );
00098      tagCollection.reset( new JetTagCollection(RefToBaseProd<reco::Jet>(prod)) );
00099 
00100      for (unsigned int i = 0; i < isolatedTaus->size(); ++i)
00101      {
00102        IsolatedTauTagInfoRef tauRef(isolatedTaus, i);
00103        const Jet & jet = *(tauRef->jet()); 
00104        math::XYZVector jetDir(jet.px(),jet.py(),jet.pz());  
00105        pair<double,TauMassTagInfo> jetTauPair;
00106        if (jetDir.eta() < 1.2)      // barrel  
00107          jetTauPair = m_algo->tag(iEvent, iSetup, tauRef, barrelBasicClusterHandle);
00108        else                         // endcap
00109          jetTauPair = m_algo->tag(iEvent, iSetup, tauRef, endcapBasicClusterHandle);
00110        tagCollection->setValue( i, jetTauPair.first );
00111        extCollection->push_back( jetTauPair.second );
00112      }
00113    }
00114 
00115    iEvent.put( tagCollection );
00116    iEvent.put( extCollection );
00117 }


Member Data Documentation

template<typename T1, typename T2 = T1>
std::string InvariantMass< T1, T2 >::jetTrackSrc [private]

Definition at line 37 of file InvariantMass.h.

Referenced by InvariantMass< T1, T2 >::InvariantMass(), and InvariantMass< T1, T2 >::produce().

template<typename T1, typename T2 = T1>
InvariantMassAlgorithm* InvariantMass< T1, T2 >::m_algo [private]

Definition at line 36 of file InvariantMass.h.

Referenced by InvariantMass< T1, T2 >::InvariantMass(), InvariantMass< T1, T2 >::produce(), and InvariantMass< T1, T2 >::~InvariantMass().

template<typename T1, typename T2 = T1>
std::string InvariantMass< T1, T2 >::m_ecalBClSrc [private]

Definition at line 38 of file InvariantMass.h.

Referenced by InvariantMass< T1, T2 >::InvariantMass(), and InvariantMass< T1, T2 >::produce().


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