Skip to content

Commit

Permalink
Merge pull request cms-sw#15 from gpetruc/91X_newClusterer
Browse files Browse the repository at this point in the history
Support for new trigger primitives of Spring17D samples
  • Loading branch information
gpetruc authored May 5, 2017
2 parents 004df25 + cf58284 commit 4ffc074
Show file tree
Hide file tree
Showing 37 changed files with 1,784 additions and 478 deletions.
16 changes: 10 additions & 6 deletions NtupleProducer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ Basic Instructions
cmsrel CMSSW_9_1_0_pre2
cd CMSSW_9_1_0_pre2/src
cmsenv
git clone git@github.com:nhanvtran/FastPUPPI.git -b 91X
git cms-init
git remote add cms-l1t-offline git@github.com:cms-l1t-offline/cmssw.git
git fetch cms-l1t-offline
git cms-merge-topic -u cms-l1t-offline:phase2-l1t-integration-CMSSW_9_1_0_pre2
git-cms-addpkg L1Trigger/L1THGCal
git clone https://github.com/cms-data/L1Trigger-L1THGCal.git L1Trigger/L1THGCal/data
git clone git@github.com:nhanvtran/FastPUPPI.git -b 91X_newClusterer
scram b -j8
```

The current basic config is:
`FastPUPPI/NtupleProducer/python/runNtupleProducer_cfg.py`
The first step is to produce the inputs:
`FastPUPPI/NtupleProducer/python/runInputs.py`

Relval samples are located in:
`/store/relval/CMSSW_9_1_0_pre1/RelValZMM_14/`
n.b. the \_14 samples are for upgrade, and they are not in every pre-release so we are using pre1 instead of pre2
The trigger MC can be found on DAS `dataset=/*/*PhaseIISpring17D*/*`
2 changes: 1 addition & 1 deletion NtupleProducer/interface/CaloClusterer.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace l1pf_calo {
}
}

std::vector<l1tpf::Particle> fetch(bool corrected=true) const ;
std::unique_ptr<std::vector<l1tpf::Particle>> fetch(bool corrected=true) const ;
private:
std::unique_ptr<Grid> grid_;
const SingleCaloClusterer & ecal_, & hcal_;
Expand Down
1 change: 0 additions & 1 deletion NtupleProducer/interface/DiscretePF.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ namespace l1tpf_int {
};

struct PFParticle {
enum PID { CH=0, EL=1, NH=2, GAMMA=3, MU=4 };
int16_t hwPt;
int16_t hwEta; // at calo face
int16_t hwPhi;
Expand Down
38 changes: 26 additions & 12 deletions NtupleProducer/interface/L1TPFParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,51 @@
namespace l1tpf {
class Particle : public reco::LeafCandidate {
public:
enum MyParticleId { CH=0, EL=1, NH=2, GAMMA=3, MU=4 };
Particle() {}
Particle(double iEt,double iEta,double iPhi,double iM,int iId,double iSigma=0,double iDZ=0,double iCaloEta=0,double iCaloPhi=0, double iCharge = 0, double iQuality = -999, double iIsPV = 0, float alphaF = -999, float alphaC = -999, float puppiWeight = -99) :
LeafCandidate(iCharge, reco::LeafCandidate::PolarLorentzVector(iEt,iEta,iPhi,iM), reco::LeafCandidate::Point(), iId),
dZ_(iDZ),
sigma_(iSigma),
caloEta_(iCaloEta),
caloPhi_(iCaloPhi),
eta_(iEta),phi_(iPhi),
caloEta_(-999),
caloPhi_(-999),
quality_(iQuality),
isPV_(iIsPV),
hOverE_(0.), chi2n_(0),
alphaF_(alphaF),
alphaC_(alphaC),
puppiWeight_(puppiWeight) {}

float dz() const { return dZ_; }
float sigma() const { return sigma_; }
float caloEta() const { return caloEta_; }
float caloPhi() const { return caloPhi_; }
float caloEta() const { return caloEta_ == -999 ? eta() : caloEta_; }
float caloPhi() const { return caloPhi_ == -999 ? phi() : caloPhi_; }
//iEta,iPhi (usuals)
int iEta() const { return l1tpf::translateIEta(eta_);}
int iPhi() const { return l1tpf::translateIPhi(phi_,eta_);}
int iEta() const { return l1tpf::translateIEta(eta());}
int iPhi() const { return l1tpf::translateIPhi(phi(),eta());}
//iEta,iPhi as they are stored in Arrays
int aEta() const { return l1tpf::translateAEta(iEta());}
int aPhi() const { return l1tpf::translateAPhi(iPhi());}
//Center of the trigger tower
float dEta() const { return l1tpf::towerEta(l1tpf::translateIEta(eta_));}
float dPhi() const { return l1tpf::towerPhi(l1tpf::translateIEta(eta_),l1tpf::translateIPhi(phi_,eta_));}
float dEta() const { return l1tpf::towerEta(l1tpf::translateIEta(eta()));}
float dPhi() const { return l1tpf::towerPhi(l1tpf::translateIEta(eta()),l1tpf::translateIPhi(phi(),eta()));}
//Other stuff
float quality() const { return quality_; }
float alphaF() const { return alphaF_; }
float alphaC() const { return alphaC_; }
float puppiWeight() const { return puppiWeight_; }
int isPV() const { return isPV_; }
float hOverE() const { return hOverE_; }
float emEt() const {
if (hOverE_ == -1) return 0;
return pt() / ( 1 + hOverE_ );
}
// for L1Tk
float normalizedChi2() const { return chi2n_; }


void setCaloEta(float caloEta) { caloEta_ = caloEta; }
void setCaloPhi(float caloPhi) { caloPhi_ = caloPhi; }
void setEta(float iEta) { eta_ = iEta; }
void setPhi(float iPhi) { phi_ = iPhi; }
void setCaloEtaPhi(float caloEta, float caloPhi) { caloEta_ = caloEta; caloPhi_ = caloPhi; }
//void setIEtaIPhi(int iEta, int iPhi) { iEta_ = iEta; iPhi_ = iPhi; }

Expand All @@ -57,6 +64,13 @@ namespace l1tpf {
void setPuppiWeight(float puppiWeight) { puppiWeight_ = puppiWeight; }
void setIsPV(int isPV) { isPV_ = isPV; }

/// for HGC 3D clusters, or our own linked ecal+hcal clusters
/// -1 if E is zero.
void setHOverE(float hOverE) { hOverE_ = hOverE; }

// for L1Tk
void setNormalizedChi2(float normalizedChi2) { chi2n_ = normalizedChi2; }

TLorentzVector tp4() const {
TLorentzVector ret;
ret.SetPtEtaPhiM(pt(),eta(),phi(),mass());
Expand All @@ -73,9 +87,9 @@ namespace l1tpf {
float dZ_;
float sigma_;
float caloEta_, caloPhi_;
float eta_, phi_;
float quality_;
int isPV_;
float hOverE_, chi2n_;
float alphaF_, alphaC_, puppiWeight_;
}; // class
} // namespace
Expand Down
1 change: 0 additions & 1 deletion NtupleProducer/interface/combiner.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

class combiner {
public:
enum MyParticleId { CH=0, EL=1, NH=2, GAMMA=3, MU=4 };
typedef l1tpf::Particle Particle;

combiner(const std::string &iPionFile,const std::string & iElectronFile,const std::string &iTrackFile,const std::string &iFile,double iEtaCharged,double iPuppiPt,double iVtxRes,int debug=0);
Expand Down
2 changes: 2 additions & 0 deletions NtupleProducer/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<use name="DataFormats/Math"/>
<use name="FastPUPPI/NtupleProducer"/>
<use name="L1Trigger/L1TCalorimeter"/>
<use name="DataFormats/L1TrackTrigger"/>
<use name="DataFormats/L1THGCal"/>
<use name="CommonTools/UtilAlgos"/>
<flags CXXFLAGS="-ggdb"/>
<flags EDM_PLUGIN="1"/>
Loading

0 comments on commit 4ffc074

Please sign in to comment.