Skip to content

Commit

Permalink
DeepSC graph evaluation move to 12_3_X
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarzocc authored and valsdav committed Mar 1, 2022
1 parent fec3825 commit 9d00a35
Show file tree
Hide file tree
Showing 13 changed files with 1,892 additions and 137 deletions.
46 changes: 29 additions & 17 deletions RecoEcal/EgammaClusterAlgos/interface/PFECALSuperClusterAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,23 @@
#include "DataFormats/EgammaReco/interface/BasicCluster.h"
#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"

#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include "DataFormats/CaloRecHit/interface/CaloCluster.h"
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"

#include "Geometry/CaloTopology/interface/CaloTopology.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/Records/interface/CaloTopologyRecord.h"
#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"

#include "RecoParticleFlow/PFClusterTools/interface/PFEnergyCalibration.h"

#include "RecoEcal/EgammaClusterAlgos/interface/SCEnergyCorrectorSemiParm.h"
#include "RecoEcal/EgammaCoreTools/interface/GraphMatrix.h"
#include "RecoEcal/EgammaCoreTools/interface/EcalClustersGraph.h"
#include "RecoEcal/EgammaCoreTools/interface/CalibratedPFCluster.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/ESHandle.h"
Expand All @@ -37,6 +49,8 @@
#include "CondFormats/EcalObjects/interface/EcalSCDynamicDPhiParameters.h"
#include "CondFormats/DataRecord/interface/EcalSCDynamicDPhiParametersRcd.h"

#include "RecoEcal/EgammaCoreTools/interface/DeepSCGraphEvaluation.h"

#include <vector>
#include <memory>

Expand All @@ -48,31 +62,18 @@
\date July 2012
*/

// class SCProducerCache;

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

// simple class for associating calibrated energies
class CalibratedPFCluster {
public:
CalibratedPFCluster(const edm::Ptr<reco::PFCluster>& p) : cluptr(p) {}

double energy() const { return cluptr->correctedEnergy(); }
double energy_nocalib() const { return cluptr->energy(); }
double eta() const { return cluptr->positionREP().eta(); }
double phi() const { return cluptr->positionREP().phi(); }

edm::Ptr<reco::PFCluster> the_ptr() const { return cluptr; }

private:
edm::Ptr<reco::PFCluster> cluptr;
};
typedef std::shared_ptr<CalibratedPFCluster> CalibratedClusterPtr;
typedef std::vector<CalibratedClusterPtr> CalibratedClusterPtrVector;

/// constructor
PFECALSuperClusterAlgo();
PFECALSuperClusterAlgo(const SCProducerCache* cache);

void setVerbosityLevel(bool verbose) { verbose_ = verbose; }

Expand Down Expand Up @@ -110,6 +111,9 @@ class PFECALSuperClusterAlgo {
void setCrackCorrections(bool applyCrackCorrections) { applyCrackCorrections_ = applyCrackCorrections; }

void setTokens(const edm::ParameterSet&, edm::ConsumesCollector&&);

void setTensorflowObjects();

void update(const edm::EventSetup&);
void updateSCParams(const edm::EventSetup&);

Expand All @@ -132,6 +136,12 @@ class PFECALSuperClusterAlgo {

const reco::BeamSpot* beamSpot_;
const ESChannelStatus* channelStatus_;
const CaloGeometry* geometry_;
const CaloSubdetectorGeometry* ebGeom_;
const CaloSubdetectorGeometry* eeGeom_;
const CaloSubdetectorGeometry* esGeom_;
const CaloTopology* topology_;

const EcalMustacheSCParameters* mustacheSCParams_;
const EcalSCDynamicDPhiParameters* scDynamicDPhiParams_;

Expand Down Expand Up @@ -173,6 +183,8 @@ class PFECALSuperClusterAlgo {
bool applyCrackCorrections_;
bool threshIsET_;

const reco::SCProducerCache* SCProducerCache_;

// OOT photons
bool isOOTCollection_;
edm::EDGetTokenT<EcalRecHitCollection> inputTagBarrelRecHits_;
Expand Down
Loading

0 comments on commit 9d00a35

Please sign in to comment.