Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFEGamma Rewrite for CMSSW 70X #143

Merged
merged 29 commits into from Aug 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
57ba31a
Test package for the tutorial.
ktf Jun 26, 2013
81f0a6a
bring in PFEGammaNew development
lgray Jul 11, 2013
62a5f73
remove temps
lgray Jul 11, 2013
4e5607a
start of PS-EE match tracking
lgray Jul 12, 2013
eb49394
checkpoint for persistent EE-PS persistent linking
lgray Jul 12, 2013
ee71556
finish propagating changes to persistify EE-PS associations
lgray Jul 12, 2013
7495c26
PFEGNew + EE-PS link persistency done and working
lgray Jul 12, 2013
8f30b6e
finished squashing thrown exceptions and crashes
lgray Jul 16, 2013
c16c36a
working on comparison studies
lgray Jul 17, 2013
be23b83
fix up PS energy assignment in PFECAL-SCs
lgray Jul 18, 2013
db1e6b7
replace PFEGammaAlgo with PFEGammaAlgoNew
lgray Jul 18, 2013
ae921ca
Merge branch 'CMSSW_7_0_X' of https://github.com/cms-sw/cmssw into CM…
lgray Jul 18, 2013
c3f90ff
fix merge conflict in SuperCluster.h
lgray Jul 18, 2013
c563545
improve processing time by doing partial sort
lgray Jul 19, 2013
f62ccfb
Include speed improvement
lgray Jul 19, 2013
c372c8d
Merge remote-tracking branch 'official-cmssw' into CMSSW_7_0_X_lgray_…
lgray Jul 25, 2013
a8f9ad4
Revert "Test package for the tutorial."
lgray Jul 25, 2013
c3d4d48
move PF SuperClusters and PFEGamma to use consumes interface
lgray Jul 31, 2013
03a8577
bug fix to PFECALSuperCluster + new option to set the energy weightin…
lgray Jul 31, 2013
f65c711
finish work on internal SC association map
lgray Jul 31, 2013
fcbc903
add in the possibility to make the seeding thresholds ET instead of e…
lgray Aug 1, 2013
c0fd7ec
make seeding thresholds use ET by default
lgray Aug 1, 2013
4ddc162
remove internal PS association map, we do not need it
lgray Aug 14, 2013
1477fce
consolidate configuration information / add flag to produce no-SC EG-…
lgray Aug 16, 2013
0d20939
fix logic of skipping no-SC candidates
lgray Aug 16, 2013
b456347
turn off the production of EG candidates with neither input nor outpu…
lgray Aug 16, 2013
092ce81
add back in double and single leg conversion refs in the extra
lgray Aug 16, 2013
a5559ff
move PFSuperClusterTreeMaker to test
lgray Aug 16, 2013
90d7914
remove duplicate dictionary definition
lgray Aug 19, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions DataFormats/EgammaReco/interface/SuperCluster.h
Expand Up @@ -19,7 +19,7 @@
namespace reco {
class SuperCluster : public CaloCluster {
public:

typedef std::vector<std::pair<CaloClusterPtr::key_type,CaloClusterPtr> > EEtoPSAssociation;
typedef math::XYZPoint Point;

/// default constructor
Expand Down Expand Up @@ -67,6 +67,12 @@ namespace reco {
/// seed BasicCluster
const CaloClusterPtr & seed() const { return seed_; }

/// const access to the cluster list itself
const CaloClusterPtrVector& clusters() const { return clusters_; }

/// const access to the preshower cluster list itself
const CaloClusterPtrVector& preshowerClusters() const { return preshowerClusters_; }

/// fist iterator over BasicCluster constituents
CaloCluster_iterator clustersBegin() const { return clusters_.begin(); }

Expand All @@ -77,11 +83,14 @@ namespace reco {
CaloCluster_iterator preshowerClustersBegin() const { return preshowerClusters_.begin(); }

/// last iterator over PreshowerCluster constituents
CaloCluster_iterator preshowerClustersEnd() const { return preshowerClusters_.end(); }
CaloCluster_iterator preshowerClustersEnd() const { return preshowerClusters_.end(); }

/// number of BasicCluster constituents
size_t clustersSize() const { return clusters_.size(); }

/// number of BasicCluster PreShower constituents
size_t preshowerClustersSize() const { return preshowerClusters_.size(); }

/// list of used xtals by DetId // now inherited by CaloCluster
//std::vector<DetId> getHitsByDetId() const { return usedHits_; }

Expand All @@ -92,10 +101,10 @@ namespace reco {
void addCluster( const CaloClusterPtr & r ) {
clusters_.push_back( r );
computeRawEnergy();
}
}

/// add reference to constituent BasicCluster
void addPreshowerCluster( const CaloClusterPtr & r ) { preshowerClusters_.push_back( r ); }
void addPreshowerCluster( const CaloClusterPtr & r ) { preshowerClusters_.push_back( r ); }

/** Set preshower planes status :
0 : both planes working
Expand Down
3 changes: 1 addition & 2 deletions DataFormats/EgammaReco/src/SuperCluster.cc
@@ -1,6 +1,7 @@
// $Id: SuperCluster.cc,v 1.17 2011/02/17 22:42:03 argiro Exp $
#include "DataFormats/EgammaReco/interface/BasicCluster.h"
#include "DataFormats/EgammaReco/interface/SuperCluster.h"
#include <algorithm>
using namespace reco;

SuperCluster::SuperCluster( double energy, const math::XYZPoint& position ) :
Expand Down Expand Up @@ -80,8 +81,6 @@ SuperCluster::SuperCluster( double energy, const math::XYZPoint& position,
computeRawEnergy();
}



void SuperCluster::computeRawEnergy() {

rawEnergy_ = 0.;
Expand Down
4 changes: 4 additions & 0 deletions DataFormats/EgammaReco/src/classes.h
Expand Up @@ -37,6 +37,10 @@ namespace {
edm::Wrapper<edm::RefVector<reco::BasicClusterCollection> > wrv1;
std::vector<reco::BasicClusterRef> vr1;

reco::SuperCluster::EEtoPSAssociation sceepsassoc;
edm::Wrapper<reco::SuperCluster::EEtoPSAssociation> wsceepsassoc;
std::pair<unsigned long,std::vector<size_t> > sceepsassocintval;
std::pair<reco::CaloClusterPtr::key_type,reco::CaloClusterPtr> sceepsassocval;
std::vector<reco::SuperCluster> sv3;
reco::SuperClusterCollection v3;
edm::Wrapper<reco::SuperClusterCollection> w3;
Expand Down
3 changes: 3 additions & 0 deletions DataFormats/EgammaReco/src/classes_def.xml
Expand Up @@ -39,6 +39,9 @@
<class name="edm::Wrapper<edm::RefVector<std::vector<reco::BasicCluster>,reco::BasicCluster,edm::refhelper::FindUsingAdvance<std::vector<reco::BasicCluster>,reco::BasicCluster> > >"/>
<class name="std::vector<edm::Ref<std::vector<reco::BasicCluster>,reco::BasicCluster,edm::refhelper::FindUsingAdvance<std::vector<reco::BasicCluster>,reco::BasicCluster> > >"/>

<class name="std::pair<edm::Ptr<reco::CaloCluster>::key_type,edm::Ptr<reco::CaloCluster> >"/>
<class name="reco::SuperCluster::EEtoPSAssociation"/>
<class name="edm::Wrapper<reco::SuperCluster::EEtoPSAssociation>"/>
<class name="reco::SuperCluster" ClassVersion="11">
<version ClassVersion="11" checksum="83023066"/>
<version ClassVersion="10" checksum="3131732439"/>
Expand Down
Expand Up @@ -87,7 +87,7 @@ namespace reco {
const std::vector<reco::TrackRef>& singleLegConvTrackRef() const {return assoSingleLegRefTrack_;}

/// add Single Leg Conversion mva
void addSingleLegConvMva(float& mvasingleleg);
void addSingleLegConvMva(const float& mvasingleleg);

/// return Single Leg Conversion mva
const std::vector<float>& singleLegConvMva() const {return assoSingleLegMva_;}
Expand Down
Expand Up @@ -157,7 +157,7 @@ void PFCandidateEGammaExtra::addSingleLegConvTrackRef(const reco::TrackRef& trac
assoSingleLegRefTrack_.push_back(trackref);
}

void PFCandidateEGammaExtra::addSingleLegConvMva(float& mvasingleleg){
void PFCandidateEGammaExtra::addSingleLegConvMva(const float& mvasingleleg){
assoSingleLegMva_.push_back(mvasingleleg);
}

Expand Down
24 changes: 12 additions & 12 deletions RecoEcal/EgammaClusterAlgos/interface/PFECALSuperClusterAlgo.h
Expand Up @@ -35,18 +35,11 @@ class TH2F;
Additional Authors (Mustache): Y. Gershtein, R. Patel, L. Gray
\date July 2012
*/
// hash function for edm::Ptr<reco::PFCluster
namespace std {
template <> struct hash<edm::Ptr<reco::PFCluster> > {
size_t operator()(const edm::Ptr<reco::PFCluster> & x) const {
return hash<ptrdiff_t>()((ptrdiff_t)x.get());
}
};
}

class PFECALSuperClusterAlgo {
public:
enum clustering_type{kBOX=1, kMustache=2};
enum energy_weight{kRaw, kCalibratedNoPS, kCalibratedTotal};

// simple class for associating calibrated energies
class CalibratedPFCluster {
Expand Down Expand Up @@ -78,6 +71,10 @@ class PFECALSuperClusterAlgo {

void setClusteringType(clustering_type thetype) { _clustype = thetype; }

void setEnergyWeighting(energy_weight thetype) { _eweight = thetype; }

void setUseETForSeeding(bool useET) { threshIsET_ = useET; }

void setUseDynamicDPhi(bool useit) { _useDynamicDPhi = useit; }

void setThreshPFClusterSeedBarrel(double thresh){ threshPFClusterSeedBarrel_ = thresh;}
Expand Down Expand Up @@ -106,7 +103,9 @@ class PFECALSuperClusterAlgo {
std::auto_ptr<reco::SuperClusterCollection>
getEBOutputSCCollection() { return superClustersEB_; }
std::auto_ptr<reco::SuperClusterCollection>
getEEOutputSCCollection() { return superClustersEE_; }
getEEOutputSCCollection() { return superClustersEE_; }
std::auto_ptr<reco::SuperCluster::EEtoPSAssociation>
getEEtoPSAssociation() { return EEtoPS_; }

void loadAndSortPFClusters(const edm::View<reco::PFCluster>& ecalclusters,
const edm::View<reco::PFCluster>& psclusters);
Expand All @@ -117,12 +116,12 @@ class PFECALSuperClusterAlgo {

CalibratedClusterPtrVector _clustersEB;
CalibratedClusterPtrVector _clustersEE;
std::unordered_map<edm::Ptr<reco::PFCluster>,
edm::PtrVector<reco::PFCluster> > _psclustersforee;
std::auto_ptr<reco::SuperClusterCollection> superClustersEB_;
std::auto_ptr<reco::SuperClusterCollection> superClustersEE_;
std::auto_ptr<reco::SuperCluster::EEtoPSAssociation> EEtoPS_;
std::shared_ptr<PFEnergyCalibration> _pfEnergyCalibration;
clustering_type _clustype;
energy_weight _eweight;
void buildAllSuperClusters(CalibratedClusterPtrVector&,
double seedthresh);
void buildSuperCluster(CalibratedClusterPtr&,
Expand Down Expand Up @@ -152,7 +151,8 @@ class PFECALSuperClusterAlgo {
bool _useDynamicDPhi;

bool applyCrackCorrections_;

bool threshIsET_;

bool usePS;

};
Expand Down