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 Member Functions | Private Attributes
InvariantMass< T1, T2 > Class Template Reference

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

Inheritance diagram for InvariantMass< T1, T2 >:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

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

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

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

EDProducer of the tagged TauJet with the InvariantMassAlgorithm. 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.0
Author
Suchandra Dutta

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

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

51 {
52  jetTrackSrc = iConfig.getParameter<string>("JetTrackSrc");
53  m_ecalBClSrc = iConfig.getParameter<string>("ecalbcl");
54 
55  m_algo = new InvariantMassAlgorithm(iConfig);
56 
57  produces<reco::JetTagCollection>();
58  produces<reco::TauMassTagInfoCollection>();
59 }
T getParameter(std::string const &) const
std::string m_ecalBClSrc
Definition: InvariantMass.h:38
InvariantMassAlgorithm * m_algo
Definition: InvariantMass.h:36
std::string jetTrackSrc
Definition: InvariantMass.h:37
template<typename T1 , typename T2 = T1>
InvariantMass< T1, T2 >::~InvariantMass ( )

Definition at line 62 of file InvariantMass.cc.

63 {
64  delete m_algo;
65 }
InvariantMassAlgorithm * m_algo
Definition: InvariantMass.h:36

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.

7  {
8  return ( t1.momentum() + t2.momentum() ).mass();
9  }
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 72 of file InvariantMass.cc.

References edm::Event::getByLabel(), i, metsig::jet, parseEventContent::prod, edm::Event::put(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), and dt_dqm_sourceclient_common_cff::reco.

73 {
74  using namespace edm;
75  using namespace reco;
76 
78  iEvent.getByLabel(jetTrackSrc, isolatedTaus);
79 
80  std::auto_ptr<JetTagCollection> tagCollection;
81  std::auto_ptr<TauMassTagInfoCollection> extCollection( new TauMassTagInfoCollection() );
82 
83  // Island basic cluster collection
84  Handle<BasicClusterCollection> barrelBasicClusterHandle;
85  iEvent.getByLabel(m_ecalBClSrc, "islandBarrelBasicClusters", barrelBasicClusterHandle);
86 
87  Handle<BasicClusterCollection> endcapBasicClusterHandle;
88  iEvent.getByLabel(m_ecalBClSrc, "islandEndcapBasicClusters", endcapBasicClusterHandle);
89 
90  if (isolatedTaus->empty()) {
91  tagCollection.reset( new JetTagCollection() );
92  } else {
93  RefToBaseProd<reco::Jet> prod( isolatedTaus->begin()->jet() );
94  tagCollection.reset( new JetTagCollection(RefToBaseProd<reco::Jet>(prod)) );
95 
96  for (unsigned int i = 0; i < isolatedTaus->size(); ++i)
97  {
98  IsolatedTauTagInfoRef tauRef(isolatedTaus, i);
99  const Jet & jet = *(tauRef->jet());
100  math::XYZVector jetDir(jet.px(),jet.py(),jet.pz());
101  pair<double,TauMassTagInfo> jetTauPair;
102  if (jetDir.eta() < 1.2) // barrel
103  jetTauPair = m_algo->tag(iEvent, iSetup, tauRef, barrelBasicClusterHandle);
104  else // endcap
105  jetTauPair = m_algo->tag(iEvent, iSetup, tauRef, endcapBasicClusterHandle);
106  tagCollection->setValue( i, jetTauPair.first );
107  extCollection->push_back( jetTauPair.second );
108  }
109  }
110 
111  iEvent.put( tagCollection );
112  iEvent.put( extCollection );
113 }
int i
Definition: DBlmapReader.cc:9
Base class for all types of Jets.
Definition: Jet.h:21
std::string m_ecalBClSrc
Definition: InvariantMass.h:38
JetFloatAssociation::Container JetTagCollection
Definition: JetTag.h:18
InvariantMassAlgorithm * m_algo
Definition: InvariantMass.h:36
std::string jetTrackSrc
Definition: InvariantMass.h:37
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
std::pair< double, reco::TauMassTagInfo > tag(edm::Event &theEvent, const edm::EventSetup &theEventSetup, const reco::IsolatedTauTagInfoRef &tauRef, const edm::Handle< reco::BasicClusterCollection > &clus_handle)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
virtual double px() const
x coordinate of momentum vector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
virtual double pz() const
z coordinate of momentum vector
virtual double py() const
y coordinate of momentum vector

Member Data Documentation

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

Definition at line 37 of file InvariantMass.h.

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

Definition at line 36 of file InvariantMass.h.

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

Definition at line 38 of file InvariantMass.h.