ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PileupRemovalCondition Class Reference

#include <PileupRemovalCondition.h>

Inheritance diagram for PileupRemovalCondition:
Collaboration diagram for PileupRemovalCondition:

Public Member Functions

 PileupRemovalCondition (double mMin, double mMax)
 
bool isSatisfied (const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
 
virtual unsigned int capacity () const override
 
std::string toString () const override
 

Private Member Functions

bool isSatisfied (const pHypoJet &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const
 

Private Attributes

double m_min
 
double m_max
 

Static Private Attributes

static const unsigned int s_capacity {1}
 

Detailed Description

Definition at line 25 of file PileupRemovalCondition.h.

Constructor & Destructor Documentation

◆ PileupRemovalCondition()

PileupRemovalCondition::PileupRemovalCondition ( double  mMin,
double  mMax 
)

Definition at line 17 of file PileupRemovalCondition.cxx.

17  :
18 m_min(mMin), m_max(mMax) {
19 }

Member Function Documentation

◆ capacity()

virtual unsigned int PileupRemovalCondition::capacity ( ) const
inlineoverridevirtual

Implements ICondition.

Definition at line 32 of file PileupRemovalCondition.h.

32 {return s_capacity;}

◆ isSatisfied() [1/2]

bool PileupRemovalCondition::isSatisfied ( const HypoJetVector ips,
const std::unique_ptr< ITrigJetHypoInfoCollector > &  c 
) const
overridevirtual

Implements ICondition.

Definition at line 104 of file PileupRemovalCondition.cxx.

105  {
106  auto result = isSatisfied(ips[0], c);
107  return result;
108 }

◆ isSatisfied() [2/2]

bool PileupRemovalCondition::isSatisfied ( const pHypoJet ip,
const std::unique_ptr< ITrigJetHypoInfoCollector > &  collector 
) const
private

Definition at line 21 of file PileupRemovalCondition.cxx.

22  {
23  float jetEMF = -999;
24  double LR=-1;
25  ip->getAttribute("EMFrac",jetEMF);
26  if (CxxUtils::fpcompare::less_equal (0,double(jetEMF))){
27  if(CxxUtils::fpcompare::greater_equal(double(jetEMF),1.)) LR=-999;
28  else LR= log10(double(1./jetEMF - 1.));
29  }else{
30  LR=-999;
31  }
32  bool pass = LR > m_max;
33  // Recalculating the LR only if it's not satisfied the LR>m_max criteria
34  if (!pass){
35  auto jetPhi= ip->phi();
36  auto jetEta= ip->eta();
37  // Recaulculate LR removing pileup clusters contribution if LR passes the m_min cut
38  if( LR > m_min ) {
39  size_t nClusters = (*ip->xAODJet())->numConstituents();
40  double clusterPU_sumEEM = 0; double clusterPU_sumE = 0;
41  for (size_t clust = 0; clust < nClusters; clust++) {
42  const xAOD::CaloCluster * aCluster = dynamic_cast<const xAOD::CaloCluster*> ((*ip->xAODJet())->rawConstituent(clust));
43  if (not aCluster) continue;
44  double clusEEM = 0;
45  clusEEM+=(aCluster)->eSample(CaloSampling::EMB1);
46  clusEEM+=(aCluster)->eSample(CaloSampling::EMB2);
47  clusEEM+=(aCluster)->eSample(CaloSampling::EMB3);
48  clusEEM+=(aCluster)->eSample(CaloSampling::EME1);
49  clusEEM+=(aCluster)->eSample(CaloSampling::EME2);
50  clusEEM+=(aCluster)->eSample(CaloSampling::EME3);
51  clusEEM+=(aCluster)->eSample(CaloSampling::FCAL1);
52  double lambda = aCluster->getMomentValue(xAOD::CaloCluster::CENTER_LAMBDA);
53 
54  if (lambda > 500) continue;
55  double d_eta = aCluster->rawEta() - jetEta;
56  double d_phi = xAOD::P4Helpers::deltaPhi(aCluster->rawPhi(),jetPhi);
57  double d_R2 = d_eta*d_eta + d_phi*d_phi;
58 
59  if (d_R2 < 0.15*0.15) continue;
60  clusterPU_sumEEM+=clusEEM/1000.;
61  clusterPU_sumE+=aCluster->rawE()/1000.;
62  }
63  double jetEEM_EMscale = 0; double jetE_EMscale = 0; //Working on EM scale because calE() doesn't always return correct EEM and cluster moment EMF not accessable during testing
64  std::vector<double> samplingEnergy = (*ip->xAODJet())->getAttribute<std::vector<double> >("EnergyPerSampling");
65 
66  for(size_t s=0; s<samplingEnergy.size(); s++) {
67  double samplingE = 0.001*(samplingEnergy.at(s));
68  if ( s < 8 || (s > 20 && s < 28) ) jetEEM_EMscale+=samplingE; // EM layers 0-7 and 21-27
69  jetE_EMscale+=samplingE;
70  }
71  if (CxxUtils::fpcompare::equal (0.,double(jetE_EMscale - clusterPU_sumE))) jetEMF=999;
72  else jetEMF = (jetEEM_EMscale - clusterPU_sumEEM)/(jetE_EMscale - clusterPU_sumE);
73  if (CxxUtils::fpcompare::less_equal (0,double(jetEMF))) {
74  if(CxxUtils::fpcompare::greater_equal(double(jetEMF),1.0)) LR = -999.;
75  else {LR = log10(double(1./jetEMF - 1.));
76  }
77  }else{
78  LR = -999.;
79  }
80  pass=LR>m_max;
81  }
82  }
83  if(collector){
84  const void* address = static_cast<const void*>(this);
85 
86  std::stringstream ss0;
87  ss0 << "PileupRemovalCondition: (" << address << ") "
88  << " LR desired cut, LR necessary cut to start pileup removal algo " <<m_max<<","<<m_min
89  << " pass: " << std::boolalpha << pass << '\n';
90 
91  auto j_addr = static_cast<const void*>(ip.get());
92  std::stringstream ss1;
93  ss1 << " jet : ("<< j_addr << ")"
94  " LR desired cut, LR necessary cut to start pileup removal algo " <<m_max<<","<<m_min<< '\n';
95 
96  collector->collect(ss0.str(), ss1.str());
97 
98  }
99  return pass;
100 }

◆ toString()

std::string PileupRemovalCondition::toString ( ) const
overridevirtual

Implements ICondition.

Definition at line 111 of file PileupRemovalCondition.cxx.

111  {
112  std::stringstream ss;
113  ss << "PileupRemovalCondition (" << this << ") "
114  << " LR thresh, LRcorr thresh "
115  <<m_max<<","<<m_min
116  <<'\n';
117 
118  return ss.str();
119 }

Member Data Documentation

◆ m_max

double PileupRemovalCondition::m_max
private

Definition at line 39 of file PileupRemovalCondition.h.

◆ m_min

double PileupRemovalCondition::m_min
private

Definition at line 38 of file PileupRemovalCondition.h.

◆ s_capacity

const unsigned int PileupRemovalCondition::s_capacity {1}
staticprivate

Definition at line 43 of file PileupRemovalCondition.h.


The documentation for this class was generated from the following files:
PileupRemovalCondition::m_min
double m_min
Definition: PileupRemovalCondition.h:38
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
get_generator_info.result
result
Definition: get_generator_info.py:21
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
xAOD::CaloCluster_v1::getMomentValue
double getMomentValue(MomentType type) const
Retrieve individual moment - no check for existance! Returns -999 on error.
Definition: CaloCluster_v1.h:906
PileupRemovalCondition::m_max
double m_max
Definition: PileupRemovalCondition.h:39
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
xAOD::CaloCluster_v1::CENTER_LAMBDA
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.
Definition: CaloCluster_v1.h:136
xAOD::P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: xAODP4Helpers.h:69
ITrigJetHypoInfoCollector::collect
virtual void collect(const std::string &, const std::string &)=0
CxxUtils::fpcompare::equal
bool equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:114
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
CxxUtils::fpcompare::greater_equal
bool greater_equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:192
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
PileupRemovalCondition::isSatisfied
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition: PileupRemovalCondition.cxx:104
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
CxxUtils::fpcompare::less_equal
bool less_equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:218
PileupRemovalCondition::s_capacity
static const unsigned int s_capacity
Definition: PileupRemovalCondition.h:43
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
python.compressB64.c
def c
Definition: compressB64.py:93
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56