Skip to content

Commit

Permalink
Merge pull request cms-sw#14 from richard-cms/match_gt
Browse files Browse the repository at this point in the history
I didn't see any complaints and this doesn't break anything outright, so I'm merging to make sure future work happens on top of this.
  • Loading branch information
R. Alex Barbieri committed May 16, 2014
2 parents e4432b3 + 746f865 commit 2ae9df3
Show file tree
Hide file tree
Showing 26 changed files with 513 additions and 540 deletions.
42 changes: 22 additions & 20 deletions CondFormats/L1TObjects/interface/CaloParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// Description: Placeholder for calorimeter trigger parameters
///
/// Implementation:
///
///
///
/// \author: Jim Brooke
///
Expand All @@ -20,9 +20,9 @@
#include <cmath>

namespace l1t {

class CaloParams {

public:

CaloParams() {}
Expand Down Expand Up @@ -73,7 +73,7 @@ namespace l1t {
double egMaxHcalEt() const { return egMaxHcalEt_; }
int egEtToRemoveHECutHw() const {return floor(egEtToRemoveHECut_/egLsb_);}
double egEtToRemoveHECut() const {return egEtToRemoveHECut_;}
double egMaxHOverE() const { return egMaxHOverE_; }
double egMaxHOverE() const { return egMaxHOverE_; }
double egRelativeJetIsolationCut() const { return egRelativeJetIsolationCut_; }
unsigned egIsoAreaNrTowersEta()const{return egIsoAreaNrTowersEta_;}
unsigned egIsoAreaNrTowersPhi()const{return egIsoAreaNrTowersPhi_;}
Expand All @@ -86,15 +86,14 @@ namespace l1t {
std::string egCalibrationType() const { return egCalibrationType_; }
std::vector<double> egCalibrationParams() { return egCalibrationParams_; }


void setEgLsb(double lsb) { egLsb_ = lsb; }
void setEgSeedThreshold(double thresh) { egSeedThreshold_ = thresh; }
void setEgNeighbourThreshold(double thresh) { egNeighbourThreshold_ = thresh; }
void setEgMaxHcalEt(double cut) { egMaxHcalEt_ = cut; }
void setEgEtToRemoveHECut(double thresh) { egEtToRemoveHECut_ = thresh;}
void setEgMaxHOverE(double cut) { egMaxHOverE_ = cut; }
void setEgRelativeJetIsolationCut(double cutValue) { egRelativeJetIsolationCut_ = cutValue; }

void setEgIsoAreaNrTowersEta(unsigned iEgIsoAreaNrTowersEta){egIsoAreaNrTowersEta_=iEgIsoAreaNrTowersEta;}
void setEgIsoAreaNrTowersPhi(unsigned iEgIsoAreaNrTowersPhi){egIsoAreaNrTowersPhi_=iEgIsoAreaNrTowersPhi;}
void setEgIsoVetoNrTowersPhi(unsigned iEgIsoVetoNrTowersPhi){egIsoVetoNrTowersPhi_=iEgIsoVetoNrTowersPhi;}
Expand Down Expand Up @@ -147,18 +146,18 @@ namespace l1t {
void setJetCalibrationType(std::string type) { jetCalibrationType_ = type; }
void setJetCalibrationParams(std::vector<double> params) { jetCalibrationParams_ = params; }


// sums
double etSumLsb() const { return etSumLsb_; }
int etSumEtaMin(unsigned isum) const;
int etSumEtaMax(unsigned isum) const;
int etSumEtThresholdHw(unsigned isum) const { return floor(etSumEtThreshold(isum)/etSumLsb_); }
double etSumEtThreshold(unsigned isum) const;

void setEtSumLsb(double lsb) { etSumLsb_ = lsb; }
void setEtSumEtaMin(unsigned isum, int eta);
void setEtSumEtaMax(unsigned isum, int eta);
void setEtSumEtThreshold(unsigned isum, double thresh);
void setEtSumEtThreshold(unsigned isum, double thresh);

// print parameters to stream:
void print(std::ostream&) const;
Expand Down Expand Up @@ -214,7 +213,7 @@ namespace l1t {

// bitmask for storing ECAL/HCAL ratio in tower object
int towerMaskRatio_;

// turn encoding on/off
bool towerDoEncoding_;

Expand Down Expand Up @@ -249,24 +248,24 @@ namespace l1t {

// Et threshold to remove the H/E cut from the EGammas
double egEtToRemoveHECut_;

// EG maximum value of H/E
double egMaxHOverE_;

// Relative jet isolation cut for EG (Stage1Layer2)
double egRelativeJetIsolationCut_;

// isolation area in eta is seed tower +/- <=egIsoAreaNrTowersPhi
unsigned egIsoAreaNrTowersEta_;
unsigned egIsoAreaNrTowersEta_;

// isolation area in phi is seed tower +/- <=egIsoAreaNrTowersPhi
unsigned egIsoAreaNrTowersPhi_;
unsigned egIsoAreaNrTowersPhi_;

// veto region is seed tower +/- <=egIsoVetoNrTowersPhi
unsigned egIsoVetoNrTowersPhi_;
unsigned egIsoVetoNrTowersPhi_;

// for # towers based PU estimator, estimator is #towers/egIsoPUEstTowerGranularity_
unsigned egIsoPUEstTowerGranularity_;
unsigned egIsoPUEstTowerGranularity_;

// eta range over which # towers is estimated
unsigned egIsoMaxEtaAbsForTowerSum_;
Expand All @@ -279,14 +278,15 @@ namespace l1t {

// EG calibration coefficients
std::vector<double> egCalibrationParams_;

// EG isolation PUS
std::string egIsoPUSType_;

// EG isolation LUT (indexed by eta, Et ?)
std::shared_ptr<l1t::LUT> egIsolationLUT_;





/* Tau */

Expand All @@ -298,7 +298,7 @@ namespace l1t {

// Et threshold on tau neighbour towers
double tauNeighbourThreshold_;

// Relative jet isolation cut for Taus (Stage1Layer2)
double tauRelativeJetIsolationCut_;
// Tau isolation PUS
Expand Down Expand Up @@ -327,7 +327,7 @@ namespace l1t {
double jetNeighbourThreshold_;

// jet PUS scheme ("None" means no PU)
std::string jetPUSType_;
std::string jetPUSType_;

// jet PU params
std::vector<double> jetPUSParams_;
Expand All @@ -340,6 +340,7 @@ namespace l1t {




/* Sums */

// EtSum LSB
Expand All @@ -361,6 +362,7 @@ namespace l1t {
int minGctEtaForSums_;
int maxGctEtaForSums_;


};

}// namespace
Expand Down
46 changes: 46 additions & 0 deletions L1Trigger/L1TCalorimeter/interface/CaloParamsStage1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// CaloParamsStage1.h
// Author: R. Alex Barbieri
//
// Wrapper class for CaloParams and Et scales

#include "CondFormats/L1TObjects/interface/CaloParams.h"

#include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
#include "CondFormats/DataRecord/interface/L1EmEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1JetEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HfRingEtScaleRcd.h"

#ifndef CaloParamsStage1_h
#define CaloParamsStage1_h

namespace l1t {

class CaloParamsStage1 : public CaloParams {

public:
CaloParamsStage1() {}
CaloParamsStage1(const CaloParams);
~CaloParamsStage1() {}

L1CaloEtScale emScale() { return emScale_; }
void setEmScale(L1CaloEtScale emScale) { emScale_ = emScale; }
L1CaloEtScale jetScale() { return jetScale_; }
void setJetScale(L1CaloEtScale jetScale) { jetScale_ = jetScale; }
L1CaloEtScale HtMissScale() {return HtMissScale_;}
L1CaloEtScale HfRingScale() {return HfRingScale_;}
void setHtMissScale(L1CaloEtScale HtMissScale){HtMissScale_ = HtMissScale;}
void setHfRingScale(L1CaloEtScale HfRingScale){HfRingScale_ = HfRingScale;}



private:
L1CaloEtScale emScale_;
L1CaloEtScale jetScale_;
L1CaloEtScale HtMissScale_;
L1CaloEtScale HfRingScale_;

};
}

#endif
8 changes: 4 additions & 4 deletions L1Trigger/L1TCalorimeter/interface/JetCalibrationMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
#ifndef JETCALIBRATIONMETHODS_H
#define JETCALIBRATIONMETHODS_H

#include "CondFormats/L1TObjects/interface/CaloParams.h"
#include "L1Trigger/L1TCalorimeter/interface/CaloParamsStage1.h"
#include "DataFormats/L1Trigger/interface/Jet.h"

#include <vector>

namespace l1t {

void JetCalibration(std::vector<l1t::Jet> * uncalibjets,
std::vector<double> jetCalibrationParams,
std::vector<l1t::Jet> * jets,
std::string jetCalibrationType,
double jetLSB);
double jetLSB);

}

#endif
11 changes: 6 additions & 5 deletions L1Trigger/L1TCalorimeter/interface/PUSubtractionMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#include "DataFormats/L1TCalorimeter/interface/CaloRegion.h"
#include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
#include "DataFormats/L1TCalorimeter/interface/CaloEmCand.h"
#include "CondFormats/L1TObjects/interface/CaloParams.h"
//#include "CondFormats/L1TObjects/interface/CaloParams.h"
#include "L1Trigger/L1TCalorimeter/interface/CaloParamsStage1.h"

#include <vector>

Expand All @@ -20,13 +21,13 @@ namespace l1t {
void HICaloRingSubtraction(const std::vector<l1t::CaloRegion> & regions,
std::vector<l1t::CaloRegion> *subRegions);

void RegionCorrection(const std::vector<l1t::CaloRegion> & regions,
const std::vector<l1t::CaloEmCand> & EMCands,
void RegionCorrection(const std::vector<l1t::CaloRegion> & regions,
const std::vector<l1t::CaloEmCand> & EMCands,
std::vector<l1t::CaloRegion> *subRegions,
std::vector<double> regionPUSparams,
std::string regionPUSType);
std::string regionPUSType);



}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@
#define L1TCALOSTAGE1EGAMMAALGORITHMIMP_H

#include "L1Trigger/L1TCalorimeter/interface/Stage1Layer2EGammaAlgorithm.h"
#include "CondFormats/L1TObjects/interface/CaloParams.h"
//#include "CondFormats/L1TObjects/interface/CaloParams.h"
#include "L1Trigger/L1TCalorimeter/interface/CaloParamsStage1.h"

namespace l1t {

class Stage1Layer2EGammaAlgorithmImpPP : public Stage1Layer2EGammaAlgorithm {
public:
Stage1Layer2EGammaAlgorithmImpPP(CaloParams* params);
Stage1Layer2EGammaAlgorithmImpPP(CaloParamsStage1* params);
virtual ~Stage1Layer2EGammaAlgorithmImpPP();
virtual void processEvent(const std::vector<l1t::CaloEmCand> & EMCands,
const std::vector<l1t::CaloRegion> & regions,
const std::vector<l1t::Jet> * jets,
std::vector<l1t::EGamma>* egammas);
private:
CaloParams* const params_;
CaloParamsStage1* const params_;
double Isolation(int ieta, int iphi,
const std::vector<l1t::CaloRegion> & regions) const;
double HoverE(int et, int ieta, int iphi,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,29 @@

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "L1Trigger/L1TCalorimeter/interface/Stage1Layer2EtSumAlgorithm.h"
#include "CondFormats/L1TObjects/interface/CaloParams.h"
//#include "CondFormats/L1TObjects/interface/CaloParams.h"
#include "L1Trigger/L1TCalorimeter/interface/CaloParamsStage1.h"


namespace l1t {

class Stage1Layer2EtSumAlgorithmImpPP : public Stage1Layer2EtSumAlgorithm {
public:
Stage1Layer2EtSumAlgorithmImpPP(CaloParams* params);
Stage1Layer2EtSumAlgorithmImpPP(CaloParamsStage1* params);
virtual ~Stage1Layer2EtSumAlgorithmImpPP();
virtual void processEvent(const std::vector<l1t::CaloRegion> & regions,
const std::vector<l1t::CaloEmCand> & EMCands,
std::vector<l1t::EtSum> * sums);

// input parameters
// input parameters
int regionETCutForHT;
int regionETCutForMET;
int minGctEtaForSums;
int maxGctEtaForSums;
int maxGctEtaForSums;

double egLsb,jetLsb;
private:
CaloParams* const params_;
CaloParamsStage1* const params_;
double regionPhysicalEt(const l1t::CaloRegion&) const;

std::vector<double> sinPhi;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

#include <boost/shared_ptr.hpp>

#include "CondFormats/L1TObjects/interface/CaloParams.h"
//#include "CondFormats/L1TObjects/interface/CaloParams.h"
#include "L1Trigger/L1TCalorimeter/interface/CaloParamsStage1.h"

#include "FWCore/Framework/interface/Event.h"

#include "L1Trigger/L1TCalorimeter/interface/Stage1Layer2MainProcessor.h"
Expand All @@ -24,8 +26,8 @@ namespace l1t {
public:
typedef boost::shared_ptr<Stage1Layer2MainProcessor> ReturnType;

// ReturnType create(const FirmwareVersion & fwv /*,const CaloParams & dbPars*/);
ReturnType create(const int fwv ,CaloParams* dbPars);
// ReturnType create(const FirmwareVersion & fwv /*,const CaloParamsStage1 & dbPars*/);
ReturnType create(const int fwv ,CaloParamsStage1* dbPars);

// (Why not make "create" a static member function? You could...
// But this way allows you to add additional customizations to the
Expand Down
12 changes: 7 additions & 5 deletions L1Trigger/L1TCalorimeter/interface/Stage1Layer2JetAlgorithmImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,33 @@

#include "L1Trigger/L1TCalorimeter/interface/Stage1Layer2JetAlgorithm.h"
#include "DataFormats/L1TCalorimeter/interface/CaloEmCand.h"
#include "CondFormats/L1TObjects/interface/CaloParams.h"
//#include "CondFormats/L1TObjects/interface/CaloParams.h"
#include "L1Trigger/L1TCalorimeter/interface/CaloParamsStage1.h"


namespace l1t {

class Stage1Layer2JetAlgorithmImpHI : public Stage1Layer2JetAlgorithm {
public:
Stage1Layer2JetAlgorithmImpHI(CaloParams* params);
Stage1Layer2JetAlgorithmImpHI(CaloParamsStage1* params);
virtual ~Stage1Layer2JetAlgorithmImpHI();
virtual void processEvent(const std::vector<l1t::CaloRegion> & regions,
const std::vector<l1t::CaloEmCand> & EMCands,
std::vector<l1t::Jet> * jets);
private:
CaloParams* const params_;
CaloParamsStage1* const params_;
//double regionLSB_;
};

class Stage1Layer2JetAlgorithmImpPP : public Stage1Layer2JetAlgorithm {
public:
Stage1Layer2JetAlgorithmImpPP(CaloParams* params);
Stage1Layer2JetAlgorithmImpPP(CaloParamsStage1* params);
virtual ~Stage1Layer2JetAlgorithmImpPP();
virtual void processEvent(const std::vector<l1t::CaloRegion> & regions,
const std::vector<l1t::CaloEmCand> & EMCands,
std::vector<l1t::Jet> * jets);
private:
CaloParams* const params_;
CaloParamsStage1* const params_;
//double regionLSB_;
};
}
Expand Down
Loading

0 comments on commit 2ae9df3

Please sign in to comment.