CMS 3D CMS Logo

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::ProductRegistryHelper

List of all members.

Public Member Functions

 PATHemisphereProducer (const edm::ParameterSet &)
 ~PATHemisphereProducer ()

Private Types

typedef std::vector< float > HemiAxis

Private Member Functions

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

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

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.

                                                                           :
  _patJets       ( iConfig.getParameter<edm::InputTag>( "patJets" ) ),
  _patMuons      ( iConfig.getParameter<edm::InputTag>( "patMuons" ) ),
  _patElectrons  ( iConfig.getParameter<edm::InputTag>( "patElectrons" ) ),
  _patPhotons    ( iConfig.getParameter<edm::InputTag>( "patPhotons" ) ),
  _patTaus       ( iConfig.getParameter<edm::InputTag>( "patTaus" ) ),

  _minJetEt       ( iConfig.getParameter<double>("minJetEt") ),
  _minMuonEt       ( iConfig.getParameter<double>("minMuonEt") ),
  _minElectronEt       ( iConfig.getParameter<double>("minElectronEt") ),
  _minTauEt       ( iConfig.getParameter<double>("minTauEt") ), 
  _minPhotonEt       ( iConfig.getParameter<double>("minPhotonEt") ),

  _maxJetEta       ( iConfig.getParameter<double>("maxJetEta") ),
  _maxMuonEta       ( iConfig.getParameter<double>("maxMuonEta") ),
  _maxElectronEta       ( iConfig.getParameter<double>("maxElectronEta") ),
  _maxTauEta       ( iConfig.getParameter<double>("maxTauEta") ), 
  _maxPhotonEta       ( iConfig.getParameter<double>("maxPhotonEta") ),

  _seedMethod    ( iConfig.getParameter<int>("seedMethod") ),
  _combinationMethod ( iConfig.getParameter<int>("combinationMethod") )

{


  produces< std::vector<pat::Hemisphere> >();
}
PATHemisphereProducer::~PATHemisphereProducer ( )

Definition at line 85 of file PATHemisphereProducer.cc.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

void PATHemisphereProducer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 204 of file PATHemisphereProducer.cc.

                              {
  
}
void PATHemisphereProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

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.

{
   using namespace edm;
   using namespace std;

   //Jets   
   Handle<reco::CandidateView> pJets;
   iEvent.getByLabel(_patJets,pJets);

   //Muons   
   Handle<reco::CandidateView> pMuons;
   iEvent.getByLabel(_patMuons,pMuons);

   //Electrons   
   Handle<reco::CandidateView> pElectrons;
   iEvent.getByLabel(_patElectrons,pElectrons);

   //Photons   
   Handle<reco::CandidateView> pPhotons;
   iEvent.getByLabel(_patPhotons,pPhotons);

   //Taus   
   Handle<reco::CandidateView> pTaus;
   iEvent.getByLabel(_patTaus,pTaus);


   //fill e,p vector with information from all objects (hopefully cleaned before)
   for(int i = 0; i < (int) (*pJets).size() ; i++){
     if((*pJets)[i].pt() <  _minJetEt || fabs((*pJets)[i].eta()) >  _maxJetEta) continue;
   
     componentPtrs_.push_back(pJets->ptrAt(i));
   }

   for(int i = 0; i < (int) (*pMuons).size() ; i++){
     if((*pMuons)[i].pt() <  _minMuonEt || fabs((*pMuons)[i].eta()) >  _maxMuonEta) continue; 
 
     componentPtrs_.push_back(pMuons->ptrAt(i));
   }
  
   for(int i = 0; i < (int) (*pElectrons).size() ; i++){
     if((*pElectrons)[i].pt() <  _minElectronEt || fabs((*pElectrons)[i].eta()) >  _maxElectronEta) continue;  
    
     componentPtrs_.push_back(pElectrons->ptrAt(i));
   } 

   for(int i = 0; i < (int) (*pPhotons).size() ; i++){
     if((*pPhotons)[i].pt() <  _minPhotonEt || fabs((*pPhotons)[i].eta()) >  _maxPhotonEta) continue;   
    
     componentPtrs_.push_back(pPhotons->ptrAt(i));
   } 

   //aren't taus included in jets?
   for(int i = 0; i < (int) (*pTaus).size() ; i++){
     if((*pTaus)[i].pt() <  _minTauEt || fabs((*pTaus)[i].eta()) >  _maxTauEta) continue;   
    
     componentPtrs_.push_back(pTaus->ptrAt(i));
   }  

   // create product
   std::auto_ptr< std::vector<Hemisphere> > hemispheres(new std::vector<Hemisphere>);;
   hemispheres->reserve(2);

  //calls HemiAlgorithm for seed method 3 (transv. inv. Mass) and association method 3 (Lund algo)
  HemisphereAlgo myHemi(componentPtrs_,_seedMethod,_combinationMethod);

  //get Hemisphere Axis 
  vA1 = myHemi.getAxis1();
  vA2 = myHemi.getAxis2();

  reco::Particle::LorentzVector p1(vA1[0]*vA1[3],vA1[1]*vA1[3],vA1[2]*vA1[3],vA1[4]);
  hemispheres->push_back(Hemisphere(p1));

  reco::Particle::LorentzVector p2(vA2[0]*vA2[3],vA2[1]*vA2[3],vA2[2]*vA2[3],vA2[4]);
  hemispheres->push_back(Hemisphere(p2));
 
  //get information to which Hemisphere each object belongs
  vgroups = myHemi.getGrouping(); 

  for ( unsigned int i=0; i<vgroups.size(); ++i ) {
    if ( vgroups[i]==1 ) {
      (*hemispheres)[0].addDaughter(componentPtrs_[i]);
    }
    else {
      (*hemispheres)[1].addDaughter(componentPtrs_[i]);
    }
  }


  iEvent.put(hemispheres);

  //clean up

    vPx.clear();
    vPy.clear();
    vPz.clear();
    vE.clear();
    vgroups.clear();
    componentPtrs_.clear();
}

Member Data Documentation

Definition at line 72 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 67 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 65 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 66 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 69 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 68 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 61 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 59 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 60 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 63 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 62 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 55 of file PATHemisphereProducer.h.

Referenced by produce().

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

Definition at line 52 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 53 of file PATHemisphereProducer.h.

Definition at line 54 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 56 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 57 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 71 of file PATHemisphereProducer.h.

Referenced by produce().

Definition at line 79 of file PATHemisphereProducer.h.

Referenced by produce().

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