Skip to content

Commit

Permalink
HiggsAnalysis consumes migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Volker Adler committed Mar 19, 2014
1 parent d582151 commit 8b7d4a4
Show file tree
Hide file tree
Showing 12 changed files with 142 additions and 141 deletions.
18 changes: 10 additions & 8 deletions HiggsAnalysis/Skimming/interface/HeavyChHiggsToTauNuSkim.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

/** \class HeavyChHiggsToTauNuSkim
*
*
* Filter to select events passing
*
* Filter to select events passing
* L1 single tau
* HLT tau+MET
* 3 offline jets
Expand All @@ -24,6 +24,8 @@
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/BTauReco/interface/IsolatedTauTagInfo.h"
#include "DataFormats/JetReco/interface/CaloJetCollection.h"

#include <math.h>

Expand All @@ -37,15 +39,15 @@ class HeavyChHiggsToTauNuSkim : public edm::EDFilter {

private:
double deltaPhi(double phi1, double phi2){
const double PI = 3.1415926535;
const double PI = 3.1415926535;
// in ORCA phi = [0,2pi], in TLorentzVector phi = [-pi,pi].
// With the conversion below deltaPhi works ok despite the
// 2*pi difference in phi definitions.
if(phi1 < 0) phi1 += 2*PI;
if(phi2 < 0) phi2 += 2*PI;

double dphi = fabs(phi1-phi2);

if(dphi > PI) dphi = 2*PI - dphi;
return dphi;
}
Expand All @@ -58,8 +60,8 @@ class HeavyChHiggsToTauNuSkim : public edm::EDFilter {

bool debug;

edm::InputTag hltTauLabel;
edm::InputTag jetLabel;
edm::EDGetTokenT<reco::IsolatedTauTagInfoCollection> hltTauToken;
edm::EDGetTokenT<reco::CaloJetCollection> jetToken;
int minNumberOfjets;
double jetEtMin;
double jetEtaMin;
Expand All @@ -71,4 +73,4 @@ class HeavyChHiggsToTauNuSkim : public edm::EDFilter {
#endif



8 changes: 4 additions & 4 deletions HiggsAnalysis/Skimming/interface/HiggsTo2GammaSkim.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*
* Filter to select 2 photon events based on the
* 1 or 2 photon HLT trigger,
* 1 or 2 photon HLT trigger,
*
* \author Kati Lassila-Perini - Helsinki Institute of Physics
*
Expand All @@ -22,9 +22,10 @@
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include <DataFormats/EgammaCandidates/interface/PhotonFwd.h>

class HiggsTo2GammaSkim : public edm::EDFilter {

public:
// Constructor
explicit HiggsTo2GammaSkim(const edm::ParameterSet&);
Expand All @@ -46,8 +47,7 @@ class HiggsTo2GammaSkim : public edm::EDFilter {
int nPhotonMin;

// Reco samples
edm::InputTag thePhotonLabel;
// std::string thePhotonLabel;
edm::EDGetTokenT<reco::PhotonCollection> thePhotonToken;
};

#endif
12 changes: 7 additions & 5 deletions HiggsAnalysis/Skimming/interface/HiggsToWW2LeptonsSkim.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/** \class HWWFilter
*
*
*
* This class is an EDFilter choosing reconstructed di-tracks
*
*
Expand All @@ -23,6 +23,9 @@

#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"

class HiggsToWW2LeptonsSkim : public edm::EDFilter {
public:
explicit HiggsToWW2LeptonsSkim(const edm::ParameterSet&);
Expand All @@ -40,12 +43,11 @@ class HiggsToWW2LeptonsSkim : public edm::EDFilter {
unsigned int nAccepted_;

// Reco samples
edm::InputTag recTrackLabel;
edm::InputTag theGLBMuonLabel;
edm::InputTag theGsfELabel;
edm::EDGetTokenT<reco::TrackCollection> theGLBMuonToken;
edm::EDGetTokenT<reco::GsfElectronCollection> theGsfEToken;

};
#endif



8 changes: 6 additions & 2 deletions HiggsAnalysis/Skimming/interface/HiggsToZZ4LeptonsPreFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include "DataFormats/HepMCCandidate/interface/GenParticle.h"

class HiggsToZZ4LeptonsPreFilter : public edm::EDFilter {

public:
// Constructor
explicit HiggsToZZ4LeptonsPreFilter(const edm::ParameterSet&);
Expand All @@ -38,9 +40,11 @@ class HiggsToZZ4LeptonsPreFilter : public edm::EDFilter {

private:
int evt, ikept;

bool debug;
int leptonFlavour;

edm::EDGetTokenT<reco::GenParticleCollection> genToken;
};

#endif
12 changes: 7 additions & 5 deletions HiggsAnalysis/Skimming/interface/HiggsToZZ4LeptonsSkim.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
*
* Filter to select 4 lepton events based on the
* 1 or 2 electron or 1 or 2 muon HLT trigger,
* 1 or 2 electron or 1 or 2 muon HLT trigger,
* and four leptons (no flavour requirement).
* No charge requirements are applied on event.
*
Expand All @@ -25,8 +25,11 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include <DataFormats/TrackReco/interface/TrackFwd.h>
#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"

class HiggsToZZ4LeptonsSkim : public edm::EDFilter {

public:
// Constructor
explicit HiggsToZZ4LeptonsSkim(const edm::ParameterSet&);
Expand All @@ -49,9 +52,8 @@ class HiggsToZZ4LeptonsSkim : public edm::EDFilter {
int nLeptonMin;

// Reco samples
edm::InputTag recTrackLabel;
edm::InputTag theGLBMuonLabel;
edm::InputTag theGsfELabel;
edm::EDGetTokenT<reco::TrackCollection> theGLBMuonToken;
edm::EDGetTokenT<reco::GsfElectronCollection> theGsfEToken;
};

#endif
12 changes: 8 additions & 4 deletions HiggsAnalysis/Skimming/interface/HiggsToZZ4LeptonsSkimEff.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"

class HiggsToZZ4LeptonsSkimEff : public edm::EDAnalyzer {

public:
// Constructor
explicit HiggsToZZ4LeptonsSkimEff(const edm::ParameterSet&);
Expand All @@ -46,9 +50,9 @@ class HiggsToZZ4LeptonsSkimEff : public edm::EDAnalyzer {
int nFourE, nFourM, nTwoETwoM, nFourL, nTau;

// Reco samples
edm::InputTag recTrackLabel;
edm::InputTag theGLBMuonLabel;
edm::InputTag thePixelGsfELabel;
edm::EDGetTokenT<reco::TrackCollection> theGLBMuonToken;
edm::EDGetTokenT<reco::GsfElectronCollection> theGsfEToken;
edm::EDGetTokenT<reco::GenParticleCollection> genToken;
};

#endif
30 changes: 14 additions & 16 deletions HiggsAnalysis/Skimming/src/HeavyChHiggsToTauNuSkim.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** \class HeavyChHiggsToTauNuSkim
*
*
*
* This class is an EDFilter for heavy H+->taunu events
*
* \author Sami Lehti - HIP Helsinki
Expand All @@ -9,12 +9,10 @@

#include "HiggsAnalysis/Skimming/interface/HeavyChHiggsToTauNuSkim.h"

#include "DataFormats/BTauReco/interface/IsolatedTauTagInfo.h"
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
#include "DataFormats/BTauReco/interface/JetTag.h"
//#include "DataFormats/BTauReco/interface/JetTagFwd.h"
#include "DataFormats/JetReco/interface/Jet.h"
#include "DataFormats/JetReco/interface/CaloJetCollection.h"

#include <iostream>

Expand All @@ -30,8 +28,8 @@ HeavyChHiggsToTauNuSkim::HeavyChHiggsToTauNuSkim(const edm::ParameterSet& iConfi
// Local Debug flag
debug = iConfig.getParameter<bool>("DebugHeavyChHiggsToTauNuSkim");

hltTauLabel = iConfig.getParameter<InputTag>("HLTTauCollection");
jetLabel = iConfig.getParameter<InputTag>("JetTagCollection");
hltTauToken = consumes<IsolatedTauTagInfoCollection>(iConfig.getParameter<InputTag>("HLTTauCollection"));
jetToken = consumes<CaloJetCollection>(iConfig.getParameter<InputTag>("JetTagCollection"));
minNumberOfjets = iConfig.getParameter<int>("minNumberOfJets");
jetEtMin = iConfig.getParameter<double>("jetEtMin");
jetEtaMin = iConfig.getParameter<double>("jetEtaMin");
Expand All @@ -45,7 +43,7 @@ HeavyChHiggsToTauNuSkim::HeavyChHiggsToTauNuSkim(const edm::ParameterSet& iConfi


HeavyChHiggsToTauNuSkim::~HeavyChHiggsToTauNuSkim(){
edm::LogVerbatim("HeavyChHiggsToTauNuSkim")
edm::LogVerbatim("HeavyChHiggsToTauNuSkim")
<< " Number_events_read " << nEvents
<< " Number_events_kept " << nSelectedEvents
<< " Efficiency " << ((double)nSelectedEvents)/((double) nEvents + 0.01) << std::endl;
Expand All @@ -58,7 +56,7 @@ bool HeavyChHiggsToTauNuSkim::filter(edm::Event& iEvent, const edm::EventSetup&
nEvents++;

Handle<IsolatedTauTagInfoCollection> tauTagL3Handle;
iEvent.getByLabel(hltTauLabel, tauTagL3Handle);
iEvent.getByToken(hltTauToken, tauTagL3Handle);

if ( !tauTagL3Handle.isValid() ) return false;

Expand All @@ -77,18 +75,18 @@ bool HeavyChHiggsToTauNuSkim::filter(edm::Event& iEvent, const edm::EventSetup&
}
}
}

if (maxEt == 0) return false;

// jets
Handle<CaloJetCollection> jetHandle;
iEvent.getByLabel(jetLabel,jetHandle);

Handle<CaloJetCollection> jetHandle;
iEvent.getByToken(jetToken,jetHandle);

if ( !jetHandle.isValid() ) return false;

bool accepted = false;

if (jetHandle.isValid() ) {
int nJets = 0;
const reco::CaloJetCollection & jets = *(jetHandle.product());
Expand All @@ -98,13 +96,13 @@ bool HeavyChHiggsToTauNuSkim::filter(edm::Event& iEvent, const edm::EventSetup&
iJet->eta() > jetEtaMin &&
iJet->eta() < jetEtaMax ) {
double DR = deltaR(theTau.eta(),iJet->eta(),theTau.phi(),iJet->phi());
if (DR > minDRFromTau) nJets++;
if (DR > minDRFromTau) nJets++;
}
}
if (nJets >= minNumberOfjets) {
accepted = true;
nSelectedEvents++;
}
}
}
return accepted;
}
21 changes: 10 additions & 11 deletions HiggsAnalysis/Skimming/src/HiggsTo2GammaSkim.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* \class HiggsTo2GammaSkim
/* \class HiggsTo2GammaSkim
*
* Consult header file for description
*
Expand All @@ -19,7 +19,6 @@

// Photons:
#include <DataFormats/EgammaCandidates/interface/Photon.h>
#include <DataFormats/EgammaCandidates/interface/PhotonFwd.h>

// C++
#include <iostream>
Expand All @@ -37,7 +36,7 @@ HiggsTo2GammaSkim::HiggsTo2GammaSkim(const edm::ParameterSet& pset) {
debug = pset.getParameter<bool>("DebugHiggsTo2GammaSkim");

// Reconstructed objects
thePhotonLabel = pset.getParameter<edm::InputTag>("PhotonCollectionLabel");
thePhotonToken = consumes<reco::PhotonCollection>(pset.getParameter<edm::InputTag>("PhotonCollectionLabel"));

// Minimum Pt for photons for skimming
photon1MinPt = pset.getParameter<double>("photon1MinimumPt");
Expand All @@ -53,9 +52,9 @@ HiggsTo2GammaSkim::HiggsTo2GammaSkim(const edm::ParameterSet& pset) {
// Destructor
HiggsTo2GammaSkim::~HiggsTo2GammaSkim() {

edm::LogVerbatim("HiggsTo2GammaSkim")
<< " Number_events_read " << nEvents
<< " Number_events_kept " << nSelectedEvents
edm::LogVerbatim("HiggsTo2GammaSkim")
<< " Number_events_read " << nEvents
<< " Number_events_kept " << nSelectedEvents
<< " Efficiency " << ((double)nSelectedEvents)/((double) nEvents + 0.01) << std::endl;
}

Expand All @@ -76,25 +75,25 @@ bool HiggsTo2GammaSkim::filter(edm::Event& event, const edm::EventSetup& setup )
// Get the photon collection from the event
edm::Handle<reco::PhotonCollection> photonHandle;

event.getByLabel(thePhotonLabel.label(),photonHandle);
event.getByToken(thePhotonToken,photonHandle);

if ( photonHandle.isValid() ) {

const reco::PhotonCollection* phoCollection = photonHandle.product();

reco::PhotonCollection::const_iterator photons;

// Loop over photon collections and count how many photons there are,
// Loop over photon collections and count how many photons there are,
// and how many are above the thresholds

// Question: do we need to take the reconstructed primary vertex at this point?
// Here, I assume that the et is taken with respect to the nominal vertex (0,0,0).
for ( photons = phoCollection->begin(); photons != phoCollection->end(); ++photons ) {
float et_p = photons->et();
float et_p = photons->et();
if ( et_p > photon1MinPt) nPhotons++;
}
}

// Make decision:
if ( nPhotons >= nPhotonMin ) keepEvent = true;

Expand Down
Loading

0 comments on commit 8b7d4a4

Please sign in to comment.