5 std::pair<double,double> dCrack(
double phi,
double eta) {
6 constexpr double oneOverCrystalSize=1.0/0.0175;
11 constexpr double cPhi[18] = {2.97025, 2.621184149601134, 2.272118299202268,
12 1.9230524488034024, 1.5739865984045365,
13 1.2249207480056705, 0.8758548976068048,
14 0.5267890472079388, 0.1777231968090729,
15 -0.17134265358979306, -0.520408503988659,
16 -0.8694743543875245, -1.2185402047863905,
17 -1.5676060551852569, -1.9166719055841224,
18 -2.265737755982988, -2.6148036063818543,
21 4.44747e-01, -4.44747e-01,
22 7.92824e-01, -7.92824e-01,
23 1.14090e+00, -1.14090e+00,
24 1.47464e+00, -1.47464e+00};
29 if( eta < 0 ) phi+=delta_cPhi;
30 if( phi >= -pi && phi <= pi ) {
32 if( phi < cPhi[17] || phi >= cPhi[0] ) {
33 if( phi < 0 ) phi += 2*
pi;
52 for(
const double etaGap : cEta ) {
55 defi *= oneOverCrystalSize;
56 deta *= oneOverCrystalSize;
57 return std::make_pair(defi,deta);
76 const std::vector<edm::ParameterSet>& thresholds =
78 for(
const auto&
pset : thresholds ) {
81 info._minS4S1_a =
pset.getParameter<
double>(
"minS4S1_a");
82 info._minS4S1_b =
pset.getParameter<
double>(
"minS4S1_b");
83 info._doubleSpikeS6S2 =
pset.getParameter<
double>(
"doubleSpikeS6S2");
84 info._eneThreshMod =
pset.getParameter<
double>(
"energyThresholdModifier");
86 pset.getParameter<
double>(
"fractionThresholdModifier");
87 info._doubleSpikeThresh =
pset.getParameter<
double>(
"doubleSpikeThresh");
88 info._singleSpikeThresh =
pset.getParameter<
double>(
"singleSpikeThresh");
92 <<
"Detector layer : " << det <<
" is not in the list of recognized"
93 <<
" detector layers!";
102 std::vector<bool>& mask ) {
104 auto const & hits = *
input;
105 std::vector<unsigned > ordered_hits(hits.size());
106 for(
unsigned i = 0; i < hits.size(); ++
i ) ordered_hits[i]=i;
107 std::sort(ordered_hits.begin(),ordered_hits.end(),[&](
unsigned i,
unsigned j) {
return hits[
i].energy()>hits[
j].energy();});
110 for(
const auto&
idx : ordered_hits ) {
111 const unsigned i =
idx;
112 if( !mask[i] )
continue;
114 int hitlayer = (int)rechit.
layer();
121 const double rhenergy = rechit.
energy();
124 double surroundingEnergy = rechit.
energy();
125 double neighbourEnergy = 0.0;
126 double layerEnergy = 0.0;
128 if( !mask[neighbour.key()] )
continue;
129 const double sum = neighbour->energy();
130 surroundingEnergy += sum;
131 neighbourEnergy += sum;
132 layerEnergy += neighbour->energy();
137 const double fraction1 = surroundingEnergy/rhenergy;
142 if( fraction1 < f1Cut ) {
146 std::pair<double,double> dcr = dCrack(phi,eta);
151 ( (aeta < 2.85 && dcrmin > 1.0) ||
160 double surroundingEnergyi = 0.0;
161 double enmax = -999.0;
165 if( !mask[neighbour.key()] )
continue;
166 const double nenergy = neighbour->energy();
167 surroundingEnergyi += nenergy;
168 if( nenergy > enmax ) {
170 mostEnergeticNeighbour = neighbour;
175 double surroundingEnergyj = 0.0;
177 mostEnergeticNeighbour->neighbours4();
180 surroundingEnergyj += neighbour->energy();
183 const double surroundingEnergyFraction =
184 (surroundingEnergyi+surroundingEnergyj) /
185 (rechit.
energy()+mostEnergeticNeighbour->energy()) - 1.;
190 std::pair<double,double> dcr = dCrack(phi,eta);
195 ( (aeta < 2.85 && dcrmin > 1.0) ||
200 mask[mostEnergeticNeighbour.
key()] =
false;
VParameterSet const & getParameterSetVector(std::string const &name) const
SpikeAndDoubleSpikeCleaner(const edm::ParameterSet &conf)
void clean(const edm::Handle< reco::PFRecHitCollection > &input, std::vector< bool > &mask)
const PFRecHitRefVector & neighbours4() const
double _doubleSpikeThresh
key_type key() const
Accessor for product key.
static std::string const input
PFLayer::Layer layer() const
rechit layer
double _singleSpikeThresh
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Abs< T >::type abs(const T &t)
std::pair< int, edm::FunctionWithDict > OK
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
std::unordered_map< int, spike_cleaning > _thresholds
Geom::Phi< T > phi() const
double energy() const
rechit energy
const REPPoint & positionREP() const
const std::unordered_map< std::string, int > _layerMap