Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport updated gen ntuple, dRNN cluster fix and 2D cluster calibration #178

Merged
merged 18 commits into from
Jan 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions L1Trigger/L1THGCal/interface/HGCalTriggerTools.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#ifndef __L1Trigger_L1THGCal_HGCalTriggerTools_h__
#define __L1Trigger_L1THGCal_HGCalTriggerTools_h__

/** \class HGCalTriggerTools
* Tools for handling HGCal trigger det-ID: in the current version
* of trhe HGCAL simulation only HGCalDetId for the TriggerCells (TC)
* are used and not HcalDetId as in the offline!
* As a consequence the class assumes that only DetIds of the first kind are used in the getTC* methods
* NOTE: this uses the trigger geometry hence would give wrong results
* when used for offline reco!!!!
*
* \author G. Cerminara (CERN), heavily "inspired" by HGCalRechHitTools ;)
*/


#include <array>
#include <cmath>
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h"

class HGCalTriggerGeometryBase;
class DetId;





namespace edm {
class Event;
class EventSetup;
}

class HGCalTriggerTools {
public:
HGCalTriggerTools() : geom_(nullptr),
fhOffset_(0),
bhOffset_(0) {}
~HGCalTriggerTools() {}

void setEventSetup(const edm::EventSetup&);
GlobalPoint getTCPosition(const DetId& id) const;
unsigned int getLayerWithOffset(const DetId&) const;
// unsigned int getLayer(ForwardSubdetector type) const;
unsigned int getLayer(const DetId&) const;

// 4-vector helper functions using GlobalPoint
float getEta(const GlobalPoint& position, const float& vertex_z = 0.) const;
float getPhi(const GlobalPoint& position) const;
float getPt(const GlobalPoint& position, const float& hitEnergy, const float& vertex_z = 0.) const;

// 4-vector helper functions using DetId
float getTCEta(const DetId& id, const float& vertex_z = 0.) const;
float getTCPhi(const DetId& id) const;
float getTCPt(const DetId& id, const float& hitEnergy, const float& vertex_z = 0.) const;

inline const HGCalTriggerGeometryBase * getTriggerGeometry() const {return geom_;};
unsigned int lastLayerEE() const {return fhOffset_;}
unsigned int lastLayerFH() const {return bhOffset_;}

float getLayerZ(const unsigned& layerWithOffset) const;
float getLayerZ(const int& subdet, const unsigned& layer) const;



private:
const HGCalTriggerGeometryBase* geom_;
unsigned int fhOffset_, bhOffset_;
};


#endif
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class HGCalClusteringImpl{
double scintillatorTriggerCellThreshold_;
double dr_;
std::string clusteringAlgorithmType_;
double calibSF_;
std::vector<double> layerWeights_;
bool applyLayerWeights_;

void triggerCellReshuffling( const std::vector<edm::Ptr<l1t::HGCalTriggerCell>> & triggerCellsPtrs,
std::array<std::array<std::vector<edm::Ptr<l1t::HGCalTriggerCell>>, kLayers_>, kNSides_> & reshuffledTriggerCells );

Expand All @@ -77,6 +81,8 @@ class HGCalClusteringImpl{
void removeUnconnectedTCinCluster( l1t::HGCalCluster & cluster,
const HGCalTriggerGeometryBase & triggerGeometry
);

void calibratePt( l1t::HGCalCluster & cluster );

};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ class HGCalMulticlusteringImpl{

double dr_;
double ptC3dThreshold_;
double calibSF_;
string multiclusterAlgoType_;
double distDbscan_ = 0.005;
unsigned minNDbscan_ = 3;
std::vector<double> layerWeights_;
bool applyLayerWeights_;

HGCalShowerShape shape_;

Expand Down
11 changes: 9 additions & 2 deletions L1Trigger/L1THGCal/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<use name="Geometry/HGCalGeometry"/>
<use name="Geometry/CaloTopology"/>
<use name="Geometry/HcalTowerAlgo"/>
<use name="L1Trigger/L1THGCal"/>
<use name="L1Trigger/L1THGCal"/>
<flags EDM_PLUGIN="1"/>
</library>

Expand All @@ -27,11 +27,18 @@
</library>

<library name="L1TriggerL1THGCalPlugins_ntuples" file="ntuples/*.cc">
<use name="L1Trigger/L1THGCal"/>
<use name="L1Trigger/L1THGCal"/>
<use name="CommonTools/UtilAlgos"/>
<use name="SimDataFormats/CaloTest"/>
<use name="DataFormats/JetReco"/>
<use name="Geometry/HcalTowerAlgo"/>
<use name="SimDataFormats/PileupSummaryInfo"/>
<use name="SimDataFormats/GeneratorProducts"/>
<use name="TrackPropagation/RungeKutta"/>
<use name="FastSimulation/Event"/>
<use name="FastSimulation/CaloGeometryTools"/>
<use name="MagneticField/Engine"/>
<use name="MagneticField/Records"/>
<use name="heppdt"/>
<flags EDM_PLUGIN="1"/>
</library>
Loading