Skip to content

Commit

Permalink
Merge pull request #27077 from cms-sw/code-format-reconstruction-0f480d
Browse files Browse the repository at this point in the history
Running code-format for reconstruction
  • Loading branch information
cmsbuild committed Jun 5, 2019
2 parents 886cf96 + c1b767c commit 44b0a13
Show file tree
Hide file tree
Showing 184 changed files with 10,487 additions and 11,577 deletions.
77 changes: 32 additions & 45 deletions RecoEcal/EgammaClusterAlgos/interface/BremRecoveryClusterAlgo.h
Expand Up @@ -10,7 +10,6 @@

#include <vector>


/*
The BremRecoveryClusterAlgo class encapsulates the functionality needed
to perform the SuperClustering.
Expand All @@ -19,50 +18,39 @@
from the event are sorted by energy
*/

class BremRecoveryClusterAlgo
{
public:

enum VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };

BremRecoveryClusterAlgo(double eb_sc_road_etasize = 0.06, // Search window in eta - Barrel
double eb_sc_road_phisize = 0.80, // Search window in phi - Barrel
double ec_sc_road_etasize = 0.14, // Search window in eta - Endcap
double ec_sc_road_phisize = 0.40, // Search window in eta - Endcap
double theSeedTransverseEnergyThreshold = 0.40,
VerbosityLevel the_verbosity = pERROR
)
{
// e*_rdeta_ and e*_rdphi_ are half the total window
// because they correspond to one direction (positive or negative)
eb_rdeta_ = eb_sc_road_etasize / 2;
eb_rdphi_ = eb_sc_road_phisize / 2;
ec_rdeta_ = ec_sc_road_etasize / 2;
ec_rdphi_ = ec_sc_road_phisize / 2;

seedTransverseEnergyThreshold = theSeedTransverseEnergyThreshold;
verbosity = the_verbosity;
}

void setVerbosity(VerbosityLevel the_verbosity)
{
verbosity = the_verbosity;
}

class BremRecoveryClusterAlgo {
public:
enum VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };

BremRecoveryClusterAlgo(double eb_sc_road_etasize = 0.06, // Search window in eta - Barrel
double eb_sc_road_phisize = 0.80, // Search window in phi - Barrel
double ec_sc_road_etasize = 0.14, // Search window in eta - Endcap
double ec_sc_road_phisize = 0.40, // Search window in eta - Endcap
double theSeedTransverseEnergyThreshold = 0.40,
VerbosityLevel the_verbosity = pERROR) {
// e*_rdeta_ and e*_rdphi_ are half the total window
// because they correspond to one direction (positive or negative)
eb_rdeta_ = eb_sc_road_etasize / 2;
eb_rdphi_ = eb_sc_road_phisize / 2;
ec_rdeta_ = ec_sc_road_etasize / 2;
ec_rdphi_ = ec_sc_road_phisize / 2;

seedTransverseEnergyThreshold = theSeedTransverseEnergyThreshold;
verbosity = the_verbosity;
}

void setVerbosity(VerbosityLevel the_verbosity) { verbosity = the_verbosity; }

// the method called from outside to do the SuperClustering - returns a vector of SCs:
reco::SuperClusterCollection makeSuperClusters(reco::CaloClusterPtrVector & clusters);

private:

reco::SuperClusterCollection makeSuperClusters(reco::CaloClusterPtrVector &clusters);

private:
// make superclusters out of clusters produced by the Island algorithm:
void makeIslandSuperClusters(reco::CaloClusterPtrVector &clusters_v,
double etaRoad, double phiRoad);

void makeIslandSuperClusters(reco::CaloClusterPtrVector &clusters_v, double etaRoad, double phiRoad);

// return true if the cluster is within the search phi-eta window of the seed
bool match(reco::CaloClusterPtr seed_p,
reco::CaloClusterPtr cluster_p,
double etaRoad, double phiRoad);

bool match(reco::CaloClusterPtr seed_p, reco::CaloClusterPtr cluster_p, double etaRoad, double phiRoad);

//

VerbosityLevel verbosity;
Expand All @@ -71,11 +59,10 @@ class BremRecoveryClusterAlgo
double eb_rdphi_;
double ec_rdeta_;
double ec_rdphi_;

double seedTransverseEnergyThreshold;

reco::SuperClusterCollection superclusters_v;

};

#endif
101 changes: 53 additions & 48 deletions RecoEcal/EgammaClusterAlgos/interface/CosmicClusterAlgo.h
@@ -1,6 +1,6 @@
#ifndef RecoECAL_ECALClusters_CosmicClusterAlgo_h
#define RecoECAL_ECALClusters_CosmicClusterAlgo_h

#include "Geometry/CaloGeometry/interface/CaloGeometry.h"

#include "DataFormats/Math/interface/Point3D.h"
Expand All @@ -24,60 +24,68 @@

typedef std::map<DetId, EcalRecHit> RecHitsMap;

class CosmicClusterAlgo
{
public:

class CosmicClusterAlgo {
public:
enum EcalPart { barrel = 0, endcap = 1 };
enum VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };

CosmicClusterAlgo() {
}

CosmicClusterAlgo(double ebst, double ebSt , double ebDt, double ebSp, double ecst, double ecSt, double ecDt, double ecSp, const PositionCalc& posCalc, VerbosityLevel the_verbosity = pERROR) :
ecalBarrelSeedThreshold(ebst), ecalBarrelSingleThreshold(ebSt), ecalBarrelSecondThreshold(ebDt), ecalBarrelSupThreshold(ebSp), ecalEndcapSeedThreshold(ecst), ecalEndcapSingleThreshold(ecSt), ecalEndcapSecondThreshold(ecDt), ecalEndcapSupThreshold(ecSp), verbosity(the_verbosity) {
enum VerbosityLevel { pDEBUG = 0, pWARNING = 1, pINFO = 2, pERROR = 3 };

CosmicClusterAlgo() {}

CosmicClusterAlgo(double ebst,
double ebSt,
double ebDt,
double ebSp,
double ecst,
double ecSt,
double ecDt,
double ecSp,
const PositionCalc &posCalc,
VerbosityLevel the_verbosity = pERROR)
: ecalBarrelSeedThreshold(ebst),
ecalBarrelSingleThreshold(ebSt),
ecalBarrelSecondThreshold(ebDt),
ecalBarrelSupThreshold(ebSp),
ecalEndcapSeedThreshold(ecst),
ecalEndcapSingleThreshold(ecSt),
ecalEndcapSecondThreshold(ecDt),
ecalEndcapSupThreshold(ecSp),
verbosity(the_verbosity) {
posCalculator_ = posCalc;
}

virtual ~CosmicClusterAlgo()
{
}
virtual ~CosmicClusterAlgo() {}

void setVerbosity(VerbosityLevel the_verbosity)
{
verbosity = the_verbosity;
}
void setVerbosity(VerbosityLevel the_verbosity) { verbosity = the_verbosity; }

// this is the method that will start the clusterisation
std::vector<reco::BasicCluster> makeClusters(const EcalRecHitCollection* hits,
const EcalUncalibratedRecHitCollection* uncalibhits,
const CaloSubdetectorGeometry *geometry,
const CaloSubdetectorTopology *topology_p,
const CaloSubdetectorGeometry *geometryES_p,
EcalPart ecalPart,
bool regional = false,
const std::vector<RectangularEtaPhiRegion>& regions = std::vector<RectangularEtaPhiRegion>());
std::vector<reco::BasicCluster> makeClusters(
const EcalRecHitCollection *hits,
const EcalUncalibratedRecHitCollection *uncalibhits,
const CaloSubdetectorGeometry *geometry,
const CaloSubdetectorTopology *topology_p,
const CaloSubdetectorGeometry *geometryES_p,
EcalPart ecalPart,
bool regional = false,
const std::vector<RectangularEtaPhiRegion> &regions = std::vector<RectangularEtaPhiRegion>());

/// point in the space
typedef math::XYZPoint Point;

private:

private:
//algo to compute position of clusters
PositionCalc posCalculator_;


// Energy required for a seed:
double ecalBarrelSeedThreshold;
double ecalBarrelSingleThreshold;
double ecalBarrelSecondThreshold;
double ecalBarrelSupThreshold;

double ecalEndcapSeedThreshold;
double ecalEndcapSingleThreshold;
double ecalEndcapSecondThreshold;
double ecalEndcapSupThreshold;

// collection of all rechits
const EcalRecHitCollection *recHits_;
// collection of all uncalibrated rechits
Expand All @@ -88,49 +96,46 @@ class CosmicClusterAlgo

// The set of used DetID's
std::set<DetId> used_s;
std::set<DetId> canSeed_s; // set of crystals not to be added but which can seed
// a new 3x3 (e.g. the outer crystals in a 5x5)
std::set<DetId> canSeed_s; // set of crystals not to be added but which can seed
// a new 3x3 (e.g. the outer crystals in a 5x5)

//in EB or EE?
bool inEB;

// The vector of DetId's in the cluster currently reconstructed
std::vector<DetId> current_v9;
std::vector<DetId> current_v25;
std::vector< std::pair<DetId, float> > current_v25Sup;
std::vector<std::pair<DetId, float> > current_v25Sup;

// The vector of clusters
std::vector<reco::BasicCluster> clusters_v;

// The verbosity level
VerbosityLevel verbosity;

void mainSearch( const CaloSubdetectorGeometry *geometry_p,
void mainSearch(const CaloSubdetectorGeometry *geometry_p,
const CaloSubdetectorTopology *topology_p,
const CaloSubdetectorGeometry *geometryES_p,
const CaloSubdetectorGeometry *geometryES_p,
EcalPart ecalPart);

// Is the crystal at the navigator position a
// Is the crystal at the navigator position a
// local maxiumum in energy?
bool checkMaxima(CaloNavigator<DetId> &navigator);

// prepare the 5x5 taking care over which crystals
// are allowed to seed new clusters and which are not
// after the preparation is complete
void prepareCluster(CaloNavigator<DetId> &navigator,
const CaloSubdetectorGeometry *geometry);
void prepareCluster(CaloNavigator<DetId> &navigator, const CaloSubdetectorGeometry *geometry);

// Add the crystal with DetId det to the current
// vector of crystals if it meets certain criteria
void addCrystal(const DetId &det, const bool in9);



// take the crystals in the current_v and build
// take the crystals in the current_v and build
// them into a BasicCluster
void makeCluster(const CaloSubdetectorGeometry *geometry_p,const CaloSubdetectorGeometry *geometryES_p, DetId seedId);


};
void makeCluster(const CaloSubdetectorGeometry *geometry_p,
const CaloSubdetectorGeometry *geometryES_p,
DetId seedId);
};

#endif
Expand Up @@ -11,54 +11,49 @@
#include "DataFormats/DetId/interface/DetId.h"

#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionBaseClass.h"
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionFactory.h"
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionBaseClass.h"
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionFactory.h"

#include <map>
#include <string>

class EgammaSCEnergyCorrectionAlgo {
public:

// public member functions
EgammaSCEnergyCorrectionAlgo(float noise,
reco::CaloCluster::AlgoId theAlgo,
const edm::ParameterSet& pset);
~EgammaSCEnergyCorrectionAlgo(){}

EgammaSCEnergyCorrectionAlgo(float noise, reco::CaloCluster::AlgoId theAlgo, const edm::ParameterSet& pset);
~EgammaSCEnergyCorrectionAlgo() {}

// take a SuperCluster and return a corrected SuperCluster
reco::SuperCluster applyCorrection(const reco::SuperCluster &cl,
const EcalRecHitCollection &rhc,
reco::CaloCluster::AlgoId theAlgo,
const CaloSubdetectorGeometry* geometry,
EcalClusterFunctionBaseClass* energyCorrectionFunction,
std::string energyCorrectorName_,
int modeEB_,
int modeEE_);
reco::SuperCluster applyCorrection(const reco::SuperCluster& cl,
const EcalRecHitCollection& rhc,
reco::CaloCluster::AlgoId theAlgo,
const CaloSubdetectorGeometry* geometry,
EcalClusterFunctionBaseClass* energyCorrectionFunction,
std::string energyCorrectorName_,
int modeEB_,
int modeEE_);

// take a SuperCluster and return a crack-corrected SuperCluster
reco::SuperCluster applyCrackCorrection(const reco::SuperCluster &cl,
EcalClusterFunctionBaseClass* crackCorrectionFunction);
reco::SuperCluster applyCrackCorrection(const reco::SuperCluster& cl,
EcalClusterFunctionBaseClass* crackCorrectionFunction);

// take a SuperCluster and return a local containment corrected SuperCluster

reco::SuperCluster applyLocalContCorrection(const reco::SuperCluster &cl,
EcalClusterFunctionBaseClass* localContCorrectionFunction);
reco::SuperCluster applyLocalContCorrection(const reco::SuperCluster& cl,
EcalClusterFunctionBaseClass* localContCorrectionFunction);

private:

// correction factor as a function of number of crystals,
// BasicCluster algo and location in the detector
// BasicCluster algo and location in the detector
float fNCrystals(int nCry, reco::CaloCluster::AlgoId theAlgo, EcalSubdetector theBase) const;
// Return the number of crystals in a BasicCluster above

// Return the number of crystals in a BasicCluster above
// 2sigma noise level
int nCrystalsGT2Sigma(reco::BasicCluster const & seed, EcalRecHitCollection const & rhc) const;
int nCrystalsGT2Sigma(reco::BasicCluster const& seed, EcalRecHitCollection const& rhc) const;

float sigmaElectronicNoise_;

reco::CaloCluster::AlgoId theAlgo_;

};

#endif /*RecoECAL_ECALClusters_EgammaSCEnergyCorrectionAlgo_h_*/

0 comments on commit 44b0a13

Please sign in to comment.