ATLAS Offline Software
Loading...
Searching...
No Matches
Pull.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "TLorentzVector.h"
8
9using namespace std;
10using namespace JetSubStructureUtils;
11
12map<string, double> Pull::result(const fastjet::PseudoJet &jet) const
13{
14 vector<fastjet::PseudoJet> constit_pseudojets = jet.constituents();
15 map<string, double> Variables;
16 Variables["PullMag"] = -999.*1000.;
17 Variables["PullPhi"] = -999.*1000.;
18 Variables["Pull_C00"] = -999.*1000.;
19 Variables["Pull_C01"] = -999.*1000.;
20 Variables["Pull_C10"] = -999.*1000.;
21 Variables["Pull_C11"] = -999.*1000.;
22
23 if (constit_pseudojets.size() < 2) {
24 return Variables;
25 }
26
27 double T[6];
28 for (int i=0; i<6; i++){
29 T[i] = 0;
30 }
31
32 TVector2 r_pull;//pull (times jet pt)
33 double jeta = m_useEtaInsteadOfY ? jet.eta() : jet.rapidity();
34
35 for(vector<fastjet::PseudoJet>::iterator cit = constit_pseudojets.begin(); cit != constit_pseudojets.end(); ++cit) {
36 const fastjet::PseudoJet &constit = *cit;
37
38 double dphi = jet.delta_phi_to(constit);
39 double ceta = m_useEtaInsteadOfY ? constit.eta() : constit.rapidity();
40
41 TVector2 r_i(ceta-jeta, dphi); //position on eta-phi plane relative to weighted centroid
42 T[2] += (ceta*ceta) - (jeta*jeta);
43 T[3] += r_i.X() * r_i.Y();
44 T[4] += r_i.Y() * r_i.X();
45 T[5] += (constit.phi_std() * constit.phi_std()) - (jet.phi_std() * jet.phi_std());
46 r_i *= (constit.pt() * r_i.Mod());
47 r_pull += r_i;
48 }
49
50 if(jet.pt() != 0) {
51 T[0] = r_pull.Mod()/jet.pt();
52 }
53
54 T[1] = TVector2::Phi_mpi_pi(r_pull.Phi()); //this means something quite different than statshape package at ANL!!
55
56 Variables["PullMag"] = T[0];
57 Variables["PullPhi"] = T[1];
58 Variables["Pull_C00"] = T[2];
59 Variables["Pull_C01"] = T[3];
60 Variables["Pull_C10"] = T[4];
61 Variables["Pull_C11"] = T[5];
62
63 return Variables;
64}
virtual std::map< std::string, double > result(const fastjet::PseudoJet &jet) const
Definition Pull.cxx:12
STL namespace.