Skip to content

Commit

Permalink
Merge pull request cms-sw#143 from tstreble/ShowerShape_HGC
Browse files Browse the repository at this point in the history
HGC shower shape variables v2
  • Loading branch information
jbsauvan authored Oct 9, 2017
2 parents b2ccbbe + b3fe6ba commit 7d67ea3
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 142 deletions.
6 changes: 6 additions & 0 deletions DataFormats/L1THGCal/interface/HGCalClusterT.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ namespace l1t
float sigmaEtaEtaTot() const { return sigmaEtaEtaTot_; }
float sigmaPhiPhiTot() const { return sigmaPhiPhiTot_; }
float sigmaZZ() const { return sigmaZZ_; }
float sigmaRRTot() const { return sigmaRRTot_; }
float sigmaRRMax() const { return sigmaRRMax_; }

void set_showerLength(int showerLength) { showerLength_ = showerLength;}
void set_firstLayer(int firstLayer) { firstLayer_ = firstLayer;}
Expand All @@ -160,6 +162,8 @@ namespace l1t
void set_sigmaEtaEtaTot(float sigmaEtaEtaTot) { sigmaEtaEtaTot_ = sigmaEtaEtaTot;}
void set_sigmaPhiPhiMax(float sigmaPhiPhiMax) { sigmaPhiPhiMax_ = sigmaPhiPhiMax;}
void set_sigmaPhiPhiTot(float sigmaPhiPhiTot) { sigmaPhiPhiTot_ = sigmaPhiPhiTot;}
void set_sigmaRRMax(float sigmaRRMax) { sigmaRRMax_ = sigmaRRMax;}
void set_sigmaRRTot(float sigmaRRTot) { sigmaRRTot_ = sigmaRRTot;}
void set_sigmaZZ(float sigmaZZ) { sigmaZZ_ = sigmaZZ;}

/* operators */
Expand All @@ -186,8 +190,10 @@ namespace l1t
float eMax_;
float sigmaEtaEtaMax_;
float sigmaPhiPhiMax_;
float sigmaRRMax_;
float sigmaEtaEtaTot_;
float sigmaPhiPhiTot_;
float sigmaRRTot_;
float sigmaZZ_;

ClusterShapes shapes_;
Expand Down
6 changes: 4 additions & 2 deletions DataFormats/L1THGCal/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
<class name="edm::Wrapper<l1t::HGCalTowerBxCollection>"/>

<class name="l1t::HGCalClusterT<l1t::HGCalTriggerCell>" />
<class name="l1t::HGCalCluster" ClassVersion="11">
<class name="l1t::HGCalCluster" ClassVersion="12">
<version ClassVersion="12" checksum="623703096"/>
<version ClassVersion="11" checksum="354623225"/>
<version ClassVersion="10" checksum="607544984"/>
</class>
Expand All @@ -29,7 +30,8 @@
<class name="edm::Wrapper<l1t::HGCalClusterBxCollection>"/>

<class name="l1t::HGCalClusterT<l1t::HGCalCluster>" />
<class name="l1t::HGCalMulticluster" ClassVersion="11">
<class name="l1t::HGCalMulticluster" ClassVersion="12">
<version ClassVersion="12" checksum="4221677522"/>
<version ClassVersion="11" checksum="1508179045"/>
<version ClassVersion="10" checksum="1878482802"/>
</class>
Expand Down
12 changes: 9 additions & 3 deletions L1Trigger/L1THGCal/interface/be_algorithms/HGCalShowerShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
#include <vector>
#include <cmath>
#include "DataFormats/L1THGCal/interface/HGCalMulticluster.h"
#include "DataFormats/Math/interface/LorentzVector.h"

class HGCalShowerShape{

public:
typedef math::XYZTLorentzVector LorentzVector;

HGCalShowerShape(){}

Expand All @@ -28,11 +30,15 @@ class HGCalShowerShape{
float sigmaPhiPhiTot(const l1t::HGCalCluster& c2d) const;
float sigmaPhiPhiMax(const l1t::HGCalMulticluster& c3d) const;

float sigmaRRTot(const l1t::HGCalMulticluster& c3d) const;
float sigmaRRTot(const l1t::HGCalCluster& c2d) const;
float sigmaRRMax(const l1t::HGCalMulticluster& c3d) const;

private:

float sigmaEtaEta(const std::vector<float>& energy, const std::vector<float>& eta) const;
float sigmaPhiPhi(const std::vector<float>& energy, const std::vector<float>& phi) const;
float sigmaZZ(const std::vector<float>& energy, const std::vector<float>& z) const;
float meanX(const std::vector<pair<float,float> >& energy_X_tc) const;
float sigmaXX(const std::vector<pair<float,float> >& energy_X_tc, const float X_cluster) const;
float sigmaPhiPhi(const std::vector<pair<float,float> >& energy_phi_tc, const float phi_cluster) const;

static const int kLayersEE_=28;
static const int kLayersFH_=12;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class HGCalTriggerNtupleHGCMulticlusters : public HGCalTriggerNtupleBase
std::vector<float> cl3d_spptot_;
std::vector<float> cl3d_sppmax_;
std::vector<float> cl3d_szz_;
std::vector<float> cl3d_srrtot_;
std::vector<float> cl3d_srrmax_;
std::vector<float> cl3d_emaxe_;
std::vector<std::vector<unsigned>> cl3d_clusters_;
};
Expand Down Expand Up @@ -66,6 +68,8 @@ initialize(TTree& tree, const edm::ParameterSet& conf, edm::ConsumesCollector&&
tree.Branch("cl3d_spptot", &cl3d_spptot_);
tree.Branch("cl3d_sppmax", &cl3d_sppmax_);
tree.Branch("cl3d_szz", &cl3d_szz_);
tree.Branch("cl3d_srrtot", &cl3d_srrtot_);
tree.Branch("cl3d_srrmax", &cl3d_srrmax_);
tree.Branch("cl3d_emaxe", &cl3d_emaxe_);
tree.Branch("cl3d_clusters", &cl3d_clusters_);

Expand Down Expand Up @@ -102,6 +106,8 @@ fill(const edm::Event& e, const edm::EventSetup& es)
cl3d_spptot_.emplace_back(cl3d_itr->sigmaPhiPhiTot());
cl3d_sppmax_.emplace_back(cl3d_itr->sigmaPhiPhiMax());
cl3d_szz_.emplace_back(cl3d_itr->sigmaZZ());
cl3d_srrtot_.emplace_back(cl3d_itr->sigmaRRTot());
cl3d_srrmax_.emplace_back(cl3d_itr->sigmaRRMax());
cl3d_emaxe_.emplace_back(cl3d_itr->eMax()/cl3d_itr->energy());

// Retrieve indices of trigger cells inside cluster
Expand Down Expand Up @@ -130,6 +136,8 @@ clear()
cl3d_spptot_.clear();
cl3d_sppmax_.clear();
cl3d_szz_.clear();
cl3d_srrtot_.clear();
cl3d_srrmax_.clear();
cl3d_emaxe_.clear();
cl3d_clusters_.clear();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ void HGCalMulticlusteringImpl::clusterizeDR( const edm::PtrVector<l1t::HGCalClus
multiclustersTmp.at(i).set_sigmaPhiPhiTot(shape_.sigmaPhiPhiTot(multiclustersTmp.at(i)));
multiclustersTmp.at(i).set_sigmaPhiPhiMax(shape_.sigmaPhiPhiMax(multiclustersTmp.at(i)));
multiclustersTmp.at(i).set_sigmaZZ(shape_.sigmaZZ(multiclustersTmp.at(i)));
multiclustersTmp.at(i).set_sigmaRRTot(shape_.sigmaRRTot(multiclustersTmp.at(i)));
multiclustersTmp.at(i).set_sigmaRRMax(shape_.sigmaRRMax(multiclustersTmp.at(i)));
multiclustersTmp.at(i).set_eMax(shape_.eMax(multiclustersTmp.at(i)));

multiclusters.push_back( 0, multiclustersTmp.at(i));
Expand Down Expand Up @@ -214,6 +216,8 @@ void HGCalMulticlusteringImpl::clusterizeDBSCAN( const edm::PtrVector<l1t::HGCal
multiclustersTmp.at(i).set_sigmaPhiPhiTot(shape_.sigmaPhiPhiTot(multiclustersTmp.at(i)));
multiclustersTmp.at(i).set_sigmaPhiPhiMax(shape_.sigmaPhiPhiMax(multiclustersTmp.at(i)));
multiclustersTmp.at(i).set_sigmaZZ(shape_.sigmaZZ(multiclustersTmp.at(i)));
multiclustersTmp.at(i).set_sigmaRRTot(shape_.sigmaRRTot(multiclustersTmp.at(i)));
multiclustersTmp.at(i).set_sigmaRRMax(shape_.sigmaRRMax(multiclustersTmp.at(i)));
multiclustersTmp.at(i).set_eMax(shape_.eMax(multiclustersTmp.at(i)));

multiclusters.push_back( 0, multiclustersTmp.at(i));
Expand Down
Loading

0 comments on commit 7d67ea3

Please sign in to comment.