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 Types | Private Member Functions | Private Attributes
PATHemisphereProducer Class Reference

#include <PATHemisphereProducer.h>

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

Public Member Functions

 PATHemisphereProducer (const edm::ParameterSet &)
 
 ~PATHemisphereProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef std::vector< float > HemiAxis
 

Private Member Functions

virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

int _combinationMethod
 
float _maxElectronEta
 
float _maxJetEta
 
float _maxMuonEta
 
float _maxPhotonEta
 
float _maxTauEta
 
float _minElectronEt
 
float _minJetEt
 
float _minMuonEt
 
float _minPhotonEt
 
float _minTauEt
 
edm::InputTag _patElectrons
 
edm::InputTag _patJets
 Input: All PAT objects that are to cross-clean or needed for that. More...
 
edm::InputTag _patMets
 
edm::InputTag _patMuons
 
edm::InputTag _patPhotons
 
edm::InputTag _patTaus
 
int _seedMethod
 
std::vector< reco::CandidatePtrcomponentPtrs_
 
HemisphereAlgomyHemi
 
std::vector< float > vA1
 
std::vector< float > vA2
 
std::vector< float > vE
 
std::vector< int > vgroups
 
std::vector< float > vPx
 
std::vector< float > vPy
 
std::vector< float > vPz
 

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 41 of file PATHemisphereProducer.h.

Member Typedef Documentation

typedef std::vector<float> PATHemisphereProducer::HemiAxis
private

Definition at line 82 of file PATHemisphereProducer.h.

Constructor & Destructor Documentation

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

Definition at line 56 of file PATHemisphereProducer.cc.

56  :
57  _patJets ( iConfig.getParameter<edm::InputTag>( "patJets" ) ),
58  _patMuons ( iConfig.getParameter<edm::InputTag>( "patMuons" ) ),
59  _patElectrons ( iConfig.getParameter<edm::InputTag>( "patElectrons" ) ),
60  _patPhotons ( iConfig.getParameter<edm::InputTag>( "patPhotons" ) ),
61  _patTaus ( iConfig.getParameter<edm::InputTag>( "patTaus" ) ),
62 
63  _minJetEt ( iConfig.getParameter<double>("minJetEt") ),
64  _minMuonEt ( iConfig.getParameter<double>("minMuonEt") ),
65  _minElectronEt ( iConfig.getParameter<double>("minElectronEt") ),
66  _minTauEt ( iConfig.getParameter<double>("minTauEt") ),
67  _minPhotonEt ( iConfig.getParameter<double>("minPhotonEt") ),
68 
69  _maxJetEta ( iConfig.getParameter<double>("maxJetEta") ),
70  _maxMuonEta ( iConfig.getParameter<double>("maxMuonEta") ),
71  _maxElectronEta ( iConfig.getParameter<double>("maxElectronEta") ),
72  _maxTauEta ( iConfig.getParameter<double>("maxTauEta") ),
73  _maxPhotonEta ( iConfig.getParameter<double>("maxPhotonEta") ),
74 
75  _seedMethod ( iConfig.getParameter<int>("seedMethod") ),
76  _combinationMethod ( iConfig.getParameter<int>("combinationMethod") )
77 
78 {
79 
80 
81  produces< std::vector<pat::Hemisphere> >();
82 }
T getParameter(std::string const &) const
edm::InputTag _patJets
Input: All PAT objects that are to cross-clean or needed for that.
PATHemisphereProducer::~PATHemisphereProducer ( )

Definition at line 85 of file PATHemisphereProducer.cc.

86 {
87 
88  // do anything here that needs to be done at desctruction time
89  // (e.g. close files, deallocate resources etc.)
90 
91 }

Member Function Documentation

void PATHemisphereProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 204 of file PATHemisphereProducer.cc.

204  {
205 
206 }
void PATHemisphereProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 100 of file PATHemisphereProducer.cc.

References _combinationMethod, _maxElectronEta, _maxJetEta, _maxMuonEta, _maxPhotonEta, _maxTauEta, _minElectronEt, _minJetEt, _minMuonEt, _minPhotonEt, _minTauEt, _patElectrons, _patJets, _patMuons, _patPhotons, _patTaus, _seedMethod, componentPtrs_, eta(), HemisphereAlgo::getAxis1(), HemisphereAlgo::getAxis2(), edm::Event::getByLabel(), HemisphereAlgo::getGrouping(), i, myHemi, p1, p2, edm::Event::put(), vA1, vA2, vE, vgroups, vPx, vPy, and vPz.

101 {
102  using namespace edm;
103  using namespace std;
104 
105  //Jets
107  iEvent.getByLabel(_patJets,pJets);
108 
109  //Muons
111  iEvent.getByLabel(_patMuons,pMuons);
112 
113  //Electrons
114  Handle<reco::CandidateView> pElectrons;
115  iEvent.getByLabel(_patElectrons,pElectrons);
116 
117  //Photons
119  iEvent.getByLabel(_patPhotons,pPhotons);
120 
121  //Taus
123  iEvent.getByLabel(_patTaus,pTaus);
124 
125 
126  //fill e,p vector with information from all objects (hopefully cleaned before)
127  for(int i = 0; i < (int) (*pJets).size() ; i++){
128  if((*pJets)[i].pt() < _minJetEt || fabs((*pJets)[i].eta()) > _maxJetEta) continue;
129 
130  componentPtrs_.push_back(pJets->ptrAt(i));
131  }
132 
133  for(int i = 0; i < (int) (*pMuons).size() ; i++){
134  if((*pMuons)[i].pt() < _minMuonEt || fabs((*pMuons)[i].eta()) > _maxMuonEta) continue;
135 
136  componentPtrs_.push_back(pMuons->ptrAt(i));
137  }
138 
139  for(int i = 0; i < (int) (*pElectrons).size() ; i++){
140  if((*pElectrons)[i].pt() < _minElectronEt || fabs((*pElectrons)[i].eta()) > _maxElectronEta) continue;
141 
142  componentPtrs_.push_back(pElectrons->ptrAt(i));
143  }
144 
145  for(int i = 0; i < (int) (*pPhotons).size() ; i++){
146  if((*pPhotons)[i].pt() < _minPhotonEt || fabs((*pPhotons)[i].eta()) > _maxPhotonEta) continue;
147 
148  componentPtrs_.push_back(pPhotons->ptrAt(i));
149  }
150 
151  //aren't taus included in jets?
152  for(int i = 0; i < (int) (*pTaus).size() ; i++){
153  if((*pTaus)[i].pt() < _minTauEt || fabs((*pTaus)[i].eta()) > _maxTauEta) continue;
154 
155  componentPtrs_.push_back(pTaus->ptrAt(i));
156  }
157 
158  // create product
159  std::auto_ptr< std::vector<Hemisphere> > hemispheres(new std::vector<Hemisphere>);;
160  hemispheres->reserve(2);
161 
162  //calls HemiAlgorithm for seed method 3 (transv. inv. Mass) and association method 3 (Lund algo)
164 
165  //get Hemisphere Axis
166  vA1 = myHemi.getAxis1();
167  vA2 = myHemi.getAxis2();
168 
169  reco::Particle::LorentzVector p1(vA1[0]*vA1[3],vA1[1]*vA1[3],vA1[2]*vA1[3],vA1[4]);
170  hemispheres->push_back(Hemisphere(p1));
171 
172  reco::Particle::LorentzVector p2(vA2[0]*vA2[3],vA2[1]*vA2[3],vA2[2]*vA2[3],vA2[4]);
173  hemispheres->push_back(Hemisphere(p2));
174 
175  //get information to which Hemisphere each object belongs
177 
178  for ( unsigned int i=0; i<vgroups.size(); ++i ) {
179  if ( vgroups[i]==1 ) {
180  (*hemispheres)[0].addDaughter(componentPtrs_[i]);
181  }
182  else {
183  (*hemispheres)[1].addDaughter(componentPtrs_[i]);
184  }
185  }
186 
187 
188  iEvent.put(hemispheres);
189 
190  //clean up
191 
192  vPx.clear();
193  vPy.clear();
194  vPz.clear();
195  vE.clear();
196  vgroups.clear();
197  componentPtrs_.clear();
198 }
int i
Definition: DBlmapReader.cc:9
std::vector< reco::CandidatePtr > componentPtrs_
std::vector< float > vPy
T eta() const
std::vector< float > getAxis1()
std::vector< int > vgroups
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
double p2[4]
Definition: TauolaWrapper.h:90
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
std::vector< int > getGrouping()
std::vector< float > vPz
std::vector< float > vE
std::vector< float > vA1
std::vector< float > vA2
std::vector< float > vPx
double p1[4]
Definition: TauolaWrapper.h:89
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:25
edm::InputTag _patJets
Input: All PAT objects that are to cross-clean or needed for that.
std::vector< float > getAxis2()

Member Data Documentation

int PATHemisphereProducer::_combinationMethod
private

Definition at line 72 of file PATHemisphereProducer.h.

Referenced by produce().

float PATHemisphereProducer::_maxElectronEta
private

Definition at line 67 of file PATHemisphereProducer.h.

Referenced by produce().

float PATHemisphereProducer::_maxJetEta
private

Definition at line 65 of file PATHemisphereProducer.h.

Referenced by produce().

float PATHemisphereProducer::_maxMuonEta
private

Definition at line 66 of file PATHemisphereProducer.h.

Referenced by produce().

float PATHemisphereProducer::_maxPhotonEta
private

Definition at line 69 of file PATHemisphereProducer.h.

Referenced by produce().

float PATHemisphereProducer::_maxTauEta
private

Definition at line 68 of file PATHemisphereProducer.h.

Referenced by produce().

float PATHemisphereProducer::_minElectronEt
private

Definition at line 61 of file PATHemisphereProducer.h.

Referenced by produce().

float PATHemisphereProducer::_minJetEt
private

Definition at line 59 of file PATHemisphereProducer.h.

Referenced by produce().

float PATHemisphereProducer::_minMuonEt
private

Definition at line 60 of file PATHemisphereProducer.h.

Referenced by produce().

float PATHemisphereProducer::_minPhotonEt
private

Definition at line 63 of file PATHemisphereProducer.h.

Referenced by produce().

float PATHemisphereProducer::_minTauEt
private

Definition at line 62 of file PATHemisphereProducer.h.

Referenced by produce().

edm::InputTag PATHemisphereProducer::_patElectrons
private

Definition at line 55 of file PATHemisphereProducer.h.

Referenced by produce().

edm::InputTag PATHemisphereProducer::_patJets
private

Input: All PAT objects that are to cross-clean or needed for that.

Definition at line 52 of file PATHemisphereProducer.h.

Referenced by produce().

edm::InputTag PATHemisphereProducer::_patMets
private

Definition at line 53 of file PATHemisphereProducer.h.

edm::InputTag PATHemisphereProducer::_patMuons
private

Definition at line 54 of file PATHemisphereProducer.h.

Referenced by produce().

edm::InputTag PATHemisphereProducer::_patPhotons
private

Definition at line 56 of file PATHemisphereProducer.h.

Referenced by produce().

edm::InputTag PATHemisphereProducer::_patTaus
private

Definition at line 57 of file PATHemisphereProducer.h.

Referenced by produce().

int PATHemisphereProducer::_seedMethod
private

Definition at line 71 of file PATHemisphereProducer.h.

Referenced by produce().

std::vector<reco::CandidatePtr> PATHemisphereProducer::componentPtrs_
private

Definition at line 79 of file PATHemisphereProducer.h.

Referenced by produce().

HemisphereAlgo* PATHemisphereProducer::myHemi
private

Definition at line 74 of file PATHemisphereProducer.h.

Referenced by produce().

std::vector<float> PATHemisphereProducer::vA1
private

Definition at line 77 of file PATHemisphereProducer.h.

Referenced by produce().

std::vector<float> PATHemisphereProducer::vA2
private

Definition at line 77 of file PATHemisphereProducer.h.

Referenced by produce().

std::vector<float> PATHemisphereProducer::vE
private

Definition at line 76 of file PATHemisphereProducer.h.

Referenced by produce().

std::vector<int> PATHemisphereProducer::vgroups
private

Definition at line 78 of file PATHemisphereProducer.h.

Referenced by produce().

std::vector<float> PATHemisphereProducer::vPx
private

Definition at line 76 of file PATHemisphereProducer.h.

Referenced by produce().

std::vector<float> PATHemisphereProducer::vPy
private

Definition at line 76 of file PATHemisphereProducer.h.

Referenced by produce().

std::vector<float> PATHemisphereProducer::vPz
private

Definition at line 76 of file PATHemisphereProducer.h.

Referenced by produce().