Skip to content

Commit c984d9c

Browse files
author
Michele Mormile
committed
code format patched
1 parent 06ada66 commit c984d9c

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

GeneratorInterface/GenFilters/plugins/PhotonGenFilter.cc

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ PhotonGenFilter::PhotonGenFilter(const edm::ParameterSet &iConfig)
1515
etaMax = iConfig.getUntrackedParameter<double>("MaxEta", 2.4);
1616
drMin = iConfig.getUntrackedParameter<double>("drMin", 0.1);
1717
ptThreshold = iConfig.getUntrackedParameter<double>("ptThreshold", 2.);
18-
1918
}
2019

2120
PhotonGenFilter::~PhotonGenFilter() {
@@ -30,34 +29,35 @@ bool PhotonGenFilter::filter(edm::StreamID, edm::Event &iEvent, const edm::Event
3029

3130
for (HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end();
3231
++p) {
33-
if ((*p)->pdg_id() == 22) {
34-
if ((*p)->momentum().perp() > ptMin && (*p)->status() == 1 && (*p)->momentum().eta() > etaMin &&
35-
(*p)->momentum().eta() < etaMax) {
36-
bool accepted_photon = true;
37-
double phi = (*p)->momentum().phi();
38-
double eta = (*p)->momentum().eta();
39-
for (HepMC::GenEvent::particle_const_iterator q = myGenEvent->particles_begin(); q != myGenEvent->particles_end(); ++q) {
40-
if (&p != &q) {
41-
if ((*q)->momentum().perp() > ptThreshold && (*q)->pdg_id() != 22 &&
42-
(*q)->status() == 1) // && abs((*q)->charge()) > 0)
43-
{
44-
double phi2 = (*p)->momentum().phi();
45-
double deltaphi = fabs(phi - phi2);
46-
if (deltaphi > M_PI)
47-
deltaphi = 2. * M_PI - deltaphi;
48-
double eta2 = (*p)->momentum().eta();
49-
double deltaeta = fabs(eta - eta2);
50-
double deltaR = sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
51-
if (deltaR < drMin)
52-
accepted_photon = false;
53-
}
54-
}
32+
if ((*p)->pdg_id() == 22) {
33+
if ((*p)->momentum().perp() > ptMin && (*p)->status() == 1 && (*p)->momentum().eta() > etaMin &&
34+
(*p)->momentum().eta() < etaMax) {
35+
bool accepted_photon = true;
36+
double phi = (*p)->momentum().phi();
37+
double eta = (*p)->momentum().eta();
38+
for (HepMC::GenEvent::particle_const_iterator q = myGenEvent->particles_begin();
39+
q != myGenEvent->particles_end();
40+
++q) {
41+
if (&p != &q) {
42+
if ((*q)->momentum().perp() > ptThreshold && (*q)->pdg_id() != 22 &&
43+
(*q)->status() == 1) // && abs((*q)->charge()) > 0)
44+
{
45+
double phi2 = (*p)->momentum().phi();
46+
double deltaphi = fabs(phi - phi2);
47+
if (deltaphi > M_PI)
48+
deltaphi = 2. * M_PI - deltaphi;
49+
double eta2 = (*p)->momentum().eta();
50+
double deltaeta = fabs(eta - eta2);
51+
double deltaR = sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
52+
if (deltaR < drMin)
53+
accepted_photon = false;
5554
}
56-
if (accepted_photon)
57-
return true;
55+
}
5856
}
57+
if (accepted_photon)
58+
return true;
5959
}
60-
60+
}
6161
}
6262

6363
// Implementation for event filtering

GeneratorInterface/GenFilters/plugins/PhotonGenFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ class PhotonGenFilter : public edm::global::EDFilter<> {
3333
double etaMax;
3434
double drMin;
3535
double ptThreshold;
36-
};
36+
};
3737

3838
#endif

0 commit comments

Comments
 (0)