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
Rewrite and Improvements for PFRecHit and PFCluster Producers #2730
Changes from all commits
92a7f62
e44523d
df5ebb9
9cf2615
75b8cd7
d25da46
fc9de23
b2230ac
999200a
ae36912
f6e4099
911da7b
6d24111
b0b0892
8207ba7
cf271d6
5053675
5af3b83
e851a4a
5c1654d
579e081
2663420
2a36df7
2737513
cda746a
f781c35
36db2f1
2f85b20
c2f83e1
7394309
01f762b
abc7673
be97867
cb25ecf
6d82908
b6be100
f5ceff0
1708511
54d4555
5973f2c
b5ce95b
cabb6df
81f6c36
e8284ba
25b191b
e1b4a20
ea7faa4
a70aa7a
0bf0fcf
5074cbd
523a30d
9b63170
a3d73b5
f161dc6
166c993
9adf54d
a91b469
547583e
17e91d7
b5355a6
14f8a81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,12 @@ | |
#include "Rtypes.h" | ||
|
||
#include "DataFormats/ParticleFlowReco/interface/PFRecHitFraction.h" | ||
#include "DataFormats/ParticleFlowReco/interface/PFRecHit.h" | ||
#include "DataFormats/ParticleFlowReco/interface/PFLayer.h" | ||
|
||
#include <iostream> | ||
#include <vector> | ||
#include <algorithm> | ||
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__) | ||
#include <atomic> | ||
#endif | ||
|
@@ -48,30 +50,38 @@ namespace reco { | |
typedef std::vector<std::pair<CaloClusterPtr::key_type,edm::Ptr<PFCluster> > > EEtoPSAssociation; | ||
typedef ROOT::Math::PositionVector3D<ROOT::Math::CylindricalEta3D<Double32_t> > REPPoint; | ||
|
||
PFCluster() : CaloCluster(CaloCluster::particleFlow), color_(1) {} | ||
PFCluster() : CaloCluster(CaloCluster::particleFlow), layer_(PFLayer::NONE), color_(1) {} | ||
|
||
/// constructor | ||
PFCluster(PFLayer::Layer layer, double energy, | ||
double x, double y, double z ); | ||
|
||
/// resets clusters parameters | ||
void reset(); | ||
|
||
/// reset only hits and fractions | ||
void resetHitsAndFractions(); | ||
|
||
/// add a given fraction of the rechit | ||
void addRecHitFraction( const reco::PFRecHitFraction& frac); | ||
|
||
/// vector of rechit fractions | ||
const std::vector< reco::PFRecHitFraction >& recHitFractions() const | ||
{ return rechits_; } | ||
{ return rechits_; } | ||
|
||
/// set layer | ||
void setLayer( PFLayer::Layer layer); | ||
|
||
/// cluster layer, see PFLayer.h in this directory | ||
PFLayer::Layer layer() const; | ||
PFLayer::Layer layer() const; | ||
|
||
/// cluster energy | ||
double energy() const {return energy_;} | ||
|
||
/// cluster time | ||
double time() const {return time_;} | ||
|
||
void setTime(double time) {time_ = time;} | ||
|
||
/// cluster position: rho, eta, phi | ||
const REPPoint& positionREP() const {return posrep_;} | ||
|
@@ -136,13 +146,35 @@ namespace reco { | |
double vy() const { return vertex().y(); } | ||
double vz() const { return vertex().z(); } | ||
|
||
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__) | ||
template<typename pruner> | ||
void pruneUsing(pruner prune) { | ||
hitsAndFractions_.clear(); | ||
std::vector<reco::PFRecHitFraction>::iterator iter = | ||
std::stable_partition(rechits_.begin(),rechits_.end(),prune); | ||
rechits_.erase(iter,rechits_.end()); | ||
hitsAndFractions_.reserve(rechits_.size()); | ||
for( const auto& hitfrac : rechits_ ) { | ||
hitsAndFractions_.emplace_back(hitfrac.recHitRef()->detId(), | ||
hitfrac.fraction()); | ||
} | ||
} | ||
#endif | ||
|
||
private: | ||
|
||
/// vector of rechit fractions (transient) | ||
std::vector< reco::PFRecHitFraction > rechits_; | ||
|
||
/// cluster position: rho, eta, phi (transient) | ||
REPPoint posrep_; | ||
|
||
///Michalis :Add timing information | ||
double time_; | ||
|
||
/// transient layer | ||
PFLayer::Layer layer_; | ||
|
||
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__) | ||
/// \todo move to PFClusterTools | ||
static std::atomic<int> depthCorMode_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any chance this could be moved as the comment says? Would help aleviate threading concerns. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, you mean the std::atomic stuff. I am pretty sure none of those variables are used any more. |
||
|
@@ -159,7 +191,6 @@ namespace reco { | |
/// \todo move to PFClusterTools | ||
static std::atomic<double> depthCorBp_; | ||
#else | ||
|
||
/// \todo move to PFClusterTools | ||
static int depthCorMode_; | ||
|
||
|
@@ -180,8 +211,6 @@ namespace reco { | |
|
||
/// color (transient) | ||
int color_; | ||
|
||
friend class ::PFClusterAlgo; | ||
}; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time_ is not initialized. all basic types should be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will send a commit in a moment (it is a new variable in the PF Clusters).
Thanks for catching it.