CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

HLTJetCollectionsForLeptonPlusJets Class Reference

#include <HLTJetCollectionsForLeptonPlusJets.h>

Inheritance diagram for HLTJetCollectionsForLeptonPlusJets:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)

Private Member Functions

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

Private Attributes

edm::InputTag hltLeptonTag
double minDeltaR_
edm::InputTag sourceJetTag

Detailed Description

This class is an EDProducer implementing an HLT trigger for lepton and jet objects, cutting on variables relating to the jet 4-momentum representation. The producer checks for overlaps between leptons and jets and if a combination of one lepton + jets cleaned against this leptons satisfy the cuts. These jets are then added to a cleaned jet collection which is put into the event.

Date:
2011/08/31 09:14:38
Revision:
1.2
Author:
Lukasz Kreczko

Definition at line 39 of file HLTJetCollectionsForLeptonPlusJets.h.


Constructor & Destructor Documentation

HLTJetCollectionsForLeptonPlusJets::HLTJetCollectionsForLeptonPlusJets ( const edm::ParameterSet iConfig) [explicit]

Definition at line 23 of file HLTJetCollectionsForLeptonPlusJets.cc.

                                                                                                    :
  hltLeptonTag(iConfig.getParameter< edm::InputTag > ("HltLeptonTag")),
  sourceJetTag(iConfig.getParameter< edm::InputTag > ("SourceJetTag")),
  minDeltaR_(iConfig.getParameter< double > ("minDeltaR"))
{
  produces<JetCollectionVector> ();
}
HLTJetCollectionsForLeptonPlusJets::~HLTJetCollectionsForLeptonPlusJets ( )

Definition at line 32 of file HLTJetCollectionsForLeptonPlusJets.cc.

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

}

Member Function Documentation

void HLTJetCollectionsForLeptonPlusJets::fillDescriptions ( edm::ConfigurationDescriptions descriptions) [static]

Reimplemented from edm::EDProducer.

Definition at line 39 of file HLTJetCollectionsForLeptonPlusJets.cc.

References edm::ParameterSetDescription::add(), and edm::ConfigurationDescriptions::add().

                                                                                                    {
    edm::ParameterSetDescription desc;
    desc.add<edm::InputTag> ("HltLeptonTag", edm::InputTag("triggerFilterObjectWithRefs"));
    desc.add<edm::InputTag> ("SourceJetTag", edm::InputTag("caloJetCollection"));
    desc.add<double> ("minDeltaR", 0.5);
    descriptions.add("hltJetCollectionsForLeptonPlusJets", desc);
}
void HLTJetCollectionsForLeptonPlusJets::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 55 of file HLTJetCollectionsForLeptonPlusJets.cc.

References deltaR(), edm::Event::getByLabel(), hltLeptonTag, j, minDeltaR_, p4, position, edm::RefVector< C, T, F >::push_back(), edm::Event::put(), sourceJetTag, trigger::TriggerCluster, trigger::TriggerElectron, and trigger::TriggerMuon.

{
  using namespace edm;
  
  edm::Handle<trigger::TriggerFilterObjectWithRefs> PrevFilterOutput;
  iEvent.getByLabel(hltLeptonTag,PrevFilterOutput);
 
  //its easier on the if statement flow if I try everything at once, shouldnt add to timing
  std::vector<edm::Ref<reco::RecoEcalCandidateCollection> > clusCands;
  PrevFilterOutput->getObjects(trigger::TriggerCluster,clusCands);

  std::vector<edm::Ref<reco::ElectronCollection> > eleCands;
  PrevFilterOutput->getObjects(trigger::TriggerElectron,eleCands);
  
  std::vector<reco::RecoChargedCandidateRef> muonCands;
  PrevFilterOutput->getObjects(trigger::TriggerMuon,muonCands);

  edm::Handle<reco::CaloJetCollection> theCaloJetCollectionHandle;
  iEvent.getByLabel(sourceJetTag, theCaloJetCollectionHandle);
  
  const reco::CaloJetCollection & theCaloJetCollection = *theCaloJetCollectionHandle;
  
  std::auto_ptr < JetCollectionVector > allSelections(new JetCollectionVector());
  
 if(!clusCands.empty()){ //try trigger cluster
    for(size_t candNr=0;candNr<clusCands.size();candNr++){  
        reco::CaloJetRefVector refVector;
        for (unsigned int j = 0; j < theCaloJetCollection.size(); j++) {
          if (deltaR(clusCands[candNr]->superCluster()->position(),theCaloJetCollection[j]) > minDeltaR_) refVector.push_back(reco::CaloJetRef(theCaloJetCollectionHandle, j));
        }
    allSelections->push_back(refVector);
    }
 }

 if(!eleCands.empty()){ //try trigger cluster
    for(size_t candNr=0;candNr<eleCands.size();candNr++){  
        reco::CaloJetRefVector refVector;
        for (unsigned int j = 0; j < theCaloJetCollection.size(); j++) {
          if (deltaR(eleCands[candNr]->superCluster()->position(),theCaloJetCollection[j]) > minDeltaR_) refVector.push_back(reco::CaloJetRef(theCaloJetCollectionHandle, j));
        }
    allSelections->push_back(refVector);
    }
 }

 if(!muonCands.empty()){ //try trigger cluster
    for(size_t candNr=0;candNr<muonCands.size();candNr++){  
        reco::CaloJetRefVector refVector;
        for (unsigned int j = 0; j < theCaloJetCollection.size(); j++) {
          if (deltaR(muonCands[candNr]->p4(),theCaloJetCollection[j]) > minDeltaR_) refVector.push_back(reco::CaloJetRef(theCaloJetCollectionHandle, j));
        }
    allSelections->push_back(refVector);
    }
 }




 iEvent.put(allSelections);
  
  return;
  
}

Member Data Documentation

Definition at line 48 of file HLTJetCollectionsForLeptonPlusJets.h.

Referenced by produce().

Definition at line 51 of file HLTJetCollectionsForLeptonPlusJets.h.

Referenced by produce().

Definition at line 49 of file HLTJetCollectionsForLeptonPlusJets.h.

Referenced by produce().