Skip to content

Commit

Permalink
Merge pull request #11132 from davidsheffield/76X_ScoutingPacking_Lep…
Browse files Browse the repository at this point in the history
…tonsPhoton

Add scouting electron, photon, and muon classes and producers
  • Loading branch information
davidlange6 committed Sep 11, 2015
2 parents 5a416ae + 4cf2b5b commit 439c1ef
Show file tree
Hide file tree
Showing 13 changed files with 705 additions and 1 deletion.
63 changes: 63 additions & 0 deletions DataFormats/Scouting/interface/ScoutingElectron.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#ifndef DataFormats_ScoutingElectron_h
#define DataFormats_ScoutingElectron_h

#include <vector>

// Class for holding electron information, for use in data scouting
// IMPORTANT: the content of this class should be changed only in backwards compatible ways!
class ScoutingElectron
{
public:
//constructor with values for all data fields
ScoutingElectron(float pt, float eta, float phi, float m, float d0, float dz, float dEtaIn,
float dPhiIn, float sigmaIetaIeta, float hOverE, float ooEMOop,
int missingHits, int charge, float ecalIso, float hcalIso, float trackIso):
pt_(pt), eta_(eta), phi_(phi), m_(m), d0_(d0), dz_(dz), dEtaIn_(dEtaIn),
dPhiIn_(dPhiIn), sigmaIetaIeta_(sigmaIetaIeta), hOverE_(hOverE), ooEMOop_(ooEMOop),
missingHits_(missingHits), charge_(charge), ecalIso_(ecalIso), hcalIso_(hcalIso),
trackIso_(trackIso) {}
//default constructor
ScoutingElectron(): pt_(0), eta_(0), phi_(0), m_(0), d0_(0), dz_(0), dEtaIn_(0), dPhiIn_(0),
sigmaIetaIeta_(0), hOverE_(0), ooEMOop_(0), missingHits_(0), charge_(0), ecalIso_(0),
hcalIso_(0), trackIso_(0) {}

//accessor functions
float pt() const { return pt_; }
float eta() const { return eta_; }
float phi() const { return phi_; }
float m() const { return m_; }
float d0() const { return d0_; }
float dz() const { return dz_; }
float dEtaIn() const { return dEtaIn_; }
float dPhiIn() const { return dPhiIn_; }
float sigmaIetaIeta() const { return sigmaIetaIeta_; }
float hOverE() const { return hOverE_; }
float ooEMOop() const { return ooEMOop_; }
int missingHits() const { return missingHits_; }
int charge() const { return charge_; }
float ecalIso() const { return ecalIso_; }
float hcalIso() const { return hcalIso_; }
float trackIso() const { return trackIso_; }

private:
float pt_;
float eta_;
float phi_;
float m_;
float d0_;
float dz_;
float dEtaIn_;
float dPhiIn_;
float sigmaIetaIeta_;
float hOverE_;
float ooEMOop_;
int missingHits_;
int charge_;
float ecalIso_;
float hcalIso_;
float trackIso_;
};

typedef std::vector<ScoutingElectron> ScoutingElectronCollection;

#endif
71 changes: 71 additions & 0 deletions DataFormats/Scouting/interface/ScoutingMuon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#ifndef DataFormats_ScoutingMuon_h
#define DataFormats_ScoutingMuon_h

#include <vector>

// Class for holding muon information, for use in data scouting
// IMPORTANT: the content of this class should be changed only in backwards compatible ways!
class ScoutingMuon
{
public:
//constructor with values for all data fields
ScoutingMuon(float pt, float eta, float phi, float m, float ecalIso, float hcalIso,
float trackIso, float chi2, float ndof, int charge, float dxy, float dz,
int nValidMuonHits, int nValidPixelHits, int nMatchedStations,
int nTrackerLayersWithMeasurement, int type):
pt_(pt), eta_(eta), phi_(phi), m_(m),
ecalIso_(ecalIso), hcalIso_(hcalIso), trackIso_(trackIso),
chi2_(chi2), ndof_(ndof), charge_(charge), dxy_(dxy), dz_(dz),
nValidMuonHits_(nValidMuonHits), nValidPixelHits_(nValidPixelHits),
nMatchedStations_(nMatchedStations),
nTrackerLayersWithMeasurement_(nTrackerLayersWithMeasurement), type_(type) {}
//default constructor
ScoutingMuon():pt_(0), eta_(0), phi_(0), m_(0), ecalIso_(0), hcalIso_(0), trackIso_(0),
chi2_(0), ndof_(0), charge_(0), dxy_(0), dz_(0), nValidMuonHits_(0),
nValidPixelHits_(0), nMatchedStations_(0), nTrackerLayersWithMeasurement_(0),
type_(0) {}

//accessor functions
float pt() const { return pt_; }
float eta() const { return eta_; }
float phi() const { return phi_; }
float m() const { return m_; }
float ecalIso() const { return ecalIso_; }
float hcalIso() const { return hcalIso_; }
float trackIso() const { return trackIso_; }
float chi2() const { return chi2_; }
float ndof() const { return ndof_; }
int charge() const { return charge_; }
float dxy() const { return dxy_; }
float dz() const { return dz_; }
int nValidMuonHits() const { return nValidMuonHits_; }
int nValidPixelHits() const { return nValidPixelHits_; }
int nMatchedStations() const { return nMatchedStations_; }
int nTrackerLayersWithMeasurement() const { return nTrackerLayersWithMeasurement_; }
int type() const { return type_; }
bool isGlobalMuon() const { return type_ & 1<<1; }
bool isTrackerMuon() const { return type_ & 1<<2; }

private:
float pt_;
float eta_;
float phi_;
float m_;
float ecalIso_;
float hcalIso_;
float trackIso_;
float chi2_;
float ndof_;
int charge_;
float dxy_;
float dz_;
int nValidMuonHits_;
int nValidPixelHits_;
int nMatchedStations_;
int nTrackerLayersWithMeasurement_;
int type_;
};

typedef std::vector<ScoutingMuon> ScoutingMuonCollection;

#endif
43 changes: 43 additions & 0 deletions DataFormats/Scouting/interface/ScoutingPhoton.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#ifndef DataFormats_ScoutingPhoton_h
#define DataFormats_ScoutingPhoton_h

#include <vector>

// Class for holding photon information, for use in data scouting
// IMPORTANT: the content of this class should be changed only in backwards compatible ways!
class ScoutingPhoton
{
public:
//constructor with values for all data fields
ScoutingPhoton(float pt, float eta, float phi, float m, float sigmaIetaIeta, float hOverE,
float ecalIso, float hcalIso):
pt_(pt), eta_(eta), phi_(phi), m_(m), sigmaIetaIeta_(sigmaIetaIeta), hOverE_(hOverE),
ecalIso_(ecalIso), hcalIso_(hcalIso) {}
//default constructor
ScoutingPhoton(): pt_(0), eta_(0), phi_(0), m_(0), sigmaIetaIeta_(0), hOverE_(0),
ecalIso_(0), hcalIso_(0) {}

//accessor functions
float pt() const { return pt_; }
float eta() const { return eta_; }
float phi() const { return phi_; }
float m() const { return m_; }
float sigmaIetaIeta() const { return sigmaIetaIeta_; }
float hOverE() const { return hOverE_; }
float ecalIso() const { return ecalIso_; }
float hcalIso() const { return hcalIso_; }

private:
float pt_;
float eta_;
float phi_;
float m_;
float sigmaIetaIeta_;
float hOverE_;
float ecalIso_;
float hcalIso_;
};

typedef std::vector<ScoutingPhoton> ScoutingPhotonCollection;

#endif
6 changes: 6 additions & 0 deletions DataFormats/Scouting/src/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#include "DataFormats/Scouting/interface/ScoutingPFJet.h"
#include "DataFormats/Scouting/interface/ScoutingParticle.h"
#include "DataFormats/Scouting/interface/ScoutingVertex.h"
#include "DataFormats/Scouting/interface/ScoutingElectron.h"
#include "DataFormats/Scouting/interface/ScoutingMuon.h"
#include "DataFormats/Scouting/interface/ScoutingPhoton.h"
#include "DataFormats/Common/interface/Wrapper.h"
#include "DataFormats/Common/interface/Ref.h"

Expand All @@ -12,5 +15,8 @@ namespace DataFormats_Scouting {
edm::Wrapper<ScoutingParticleCollection> sc2;
edm::Wrapper<ScoutingPFJetCollection> sc3;
edm::Wrapper<ScoutingVertexCollection> sc4;
edm::Wrapper<ScoutingElectronCollection> sc5;
edm::Wrapper<ScoutingMuonCollection> sc6;
edm::Wrapper<ScoutingPhotonCollection> sc7;
};
}
15 changes: 15 additions & 0 deletions DataFormats/Scouting/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,27 @@
<class name="ScoutingVertex" ClassVersion="2">
<version ClassVersion="2" checksum="2969738609"/>
</class>
<class name="ScoutingElectron" ClassVersion="2">
<version ClassVersion="2" checksum="1190461538"/>
</class>
<class name="ScoutingMuon" ClassVersion="2">
<version ClassVersion="2" checksum="9151"/>
</class>
<class name="ScoutingPhoton" ClassVersion="2">
<version ClassVersion="2" checksum="2797410539"/>
</class>
<class name="std::vector<ScoutingCaloJet>"/>
<class name="std::vector<ScoutingPFJet>"/>
<class name="std::vector<ScoutingParticle>"/>
<class name="std::vector<ScoutingVertex>"/>
<class name="std::vector<ScoutingElectron>"/>
<class name="std::vector<ScoutingMuon>"/>
<class name="std::vector<ScoutingPhoton>"/>
<class name="edm::Wrapper<std::vector<ScoutingCaloJet> >"/>
<class name="edm::Wrapper<std::vector<ScoutingPFJet> >"/>
<class name="edm::Wrapper<std::vector<ScoutingParticle> >"/>
<class name="edm::Wrapper<std::vector<ScoutingVertex> >"/>
<class name="edm::Wrapper<std::vector<ScoutingElectron> >"/>
<class name="edm::Wrapper<std::vector<ScoutingMuon> >"/>
<class name="edm::Wrapper<std::vector<ScoutingPhoton> >"/>
</lcgdict>
1 change: 1 addition & 0 deletions HLTrigger/Egamma/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<use name="DataFormats/HLTReco"/>
<use name="DataFormats/JetReco"/>
<use name="DataFormats/L1Trigger"/>
<use name="DataFormats/Scouting"/>
<use name="DataFormats/Math"/>
<use name="DataFormats/RecoCandidate"/>
<use name="DataFormats/TrackReco"/>
Expand Down
74 changes: 74 additions & 0 deletions HLTrigger/Egamma/interface/HLTScoutingEgammaProducer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#ifndef HLTScoutingEgammaProducer_h
#define HLTScoutingEgammaProducer_h

// -*- C++ -*-
//
// Package: HLTrigger/Egamma
// Class: HLTScoutingEgammaProducer
//
/**\class HLTScoutingEgammaProducer HLTScoutingEgammaProducer.h HLTrigger/Egamma/interface/HLTScoutingEgammaProducer.h
Description: Producer for ScoutingElectron and ScoutingPhoton
*/
//
// Original Author: David G. Sheffield (Rutgers)
// Created: Mon, 20 Jul 2015
//
//

// system include files
#include <memory>

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/global/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "DataFormats/Common/interface/AssociationMap.h"
#include "DataFormats/Common/interface/getRef.h"
#include "DataFormats/EgammaReco/interface/ElectronSeed.h"
#include "DataFormats/EgammaReco/interface/ElectronSeedFwd.h"
#include "DataFormats/EgammaReco/interface/SuperCluster.h"
#include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
#include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidateFwd.h"
#include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h"
#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"

#include "DataFormats/Scouting/interface/ScoutingElectron.h"
#include "DataFormats/Scouting/interface/ScoutingPhoton.h"

class HLTScoutingEgammaProducer : public edm::global::EDProducer<> {
typedef edm::AssociationMap<edm::OneToValue<std::vector<reco::RecoEcalCandidate>, float,
unsigned int> > RecoEcalCandMap;
public:
explicit HLTScoutingEgammaProducer(const edm::ParameterSet&);
~HLTScoutingEgammaProducer();

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
virtual void produce(edm::StreamID sid, edm::Event & iEvent, edm::EventSetup const & setup)
const override final;

const edm::EDGetTokenT<reco::RecoEcalCandidateCollection> EgammaCandidateCollection_;
const edm::EDGetTokenT<reco::GsfTrackCollection> EgammaGsfTrackCollection_;
const edm::EDGetTokenT<RecoEcalCandMap> SigmaIEtaIEtaMap_;
const edm::EDGetTokenT<RecoEcalCandMap> HoverEMap_;
const edm::EDGetTokenT<RecoEcalCandMap> DetaMap_;
const edm::EDGetTokenT<RecoEcalCandMap> DphiMap_;
const edm::EDGetTokenT<RecoEcalCandMap> MissingHitsMap_;
const edm::EDGetTokenT<RecoEcalCandMap> OneOEMinusOneOPMap_;
const edm::EDGetTokenT<RecoEcalCandMap> EcalPFClusterIsoMap_;
const edm::EDGetTokenT<RecoEcalCandMap> EleGsfTrackIsoMap_;
const edm::EDGetTokenT<RecoEcalCandMap> HcalPFClusterIsoMap_;

const double egammaPtCut;
const double egammaEtaCut;
const double egammaHoverECut;
};

#endif
Loading

0 comments on commit 439c1ef

Please sign in to comment.