DAS  3.0
Das Analysis System
RocRes

#include <RoccoR.h>

+ Collaboration diagram for RocRes:

Classes

struct  ResParams
 

Public Types

enum  TYPE { MC, Data, Extra }
 

Public Member Functions

 RocRes ()
 
int etaBin (double x) const
 
int trkBin (double x, int h, TYPE T=MC) const
 
void reset ()
 
double rndm (int H, int F, double v) const
 
double Sigma (double pt, int H, int F) const
 
double kSpread (double gpt, double rpt, double eta, int nlayers, double w) const
 
double kSpread (double gpt, double rpt, double eta) const
 
double kSmear (double pt, double eta, TYPE type, double v, double u) const
 
double kSmear (double pt, double eta, TYPE type, double v, double u, int n) const
 
double kExtra (double pt, double eta, int nlayers, double u, double w) const
 
double kExtra (double pt, double eta, int nlayers, double u) const
 

Public Attributes

int NETA
 
int NTRK
 
int NMIN
 
std::vector< ResParamsresol
 

Member Enumeration Documentation

◆ TYPE

enum TYPE
Enumerator
MC 
Data 
Extra 
89 {MC, Data, Extra};

Constructor & Destructor Documentation

◆ RocRes()

RocRes ( )
15  {
16  reset();
17 }

Member Function Documentation

◆ etaBin()

int etaBin ( double  x) const
26  {
27  double abseta=fabs(eta);
28  for(int i=0; i<NETA-1; ++i) if(abseta<resol[i+1].eta) return i;
29  return NETA-1;
30 }

◆ kExtra() [1/2]

double kExtra ( double  pt,
double  eta,
int  nlayers,
double  u 
) const
100  {
101  int H = etaBin(fabs(eta));
102  int F = n>NMIN ? n-NMIN : 0;
103  const ResParams &rp = resol[H];
104  double d = rp.kRes[Data];
105  double m = rp.kRes[MC];
106  double x = d>m ? sqrt(d*d-m*m) * Sigma(pt, H, F) * rp.cb[F].invcdf(u) : 0;
107  if(x<=-1) return 1.0;
108  return 1.0/(1.0 + x);
109 }

◆ kExtra() [2/2]

double kExtra ( double  pt,
double  eta,
int  nlayers,
double  u,
double  w 
) const
87  {
88  int H = etaBin(fabs(eta));
89  int F = n>NMIN ? n-NMIN : 0;
90  const ResParams &rp = resol[H];
91  double v = rp.nTrk[MC][F]+(rp.nTrk[MC][F+1]-rp.nTrk[MC][F])*w;
92  int D = trkBin(v, H, Data);
93  double RD = rp.kRes[Data]*Sigma(pt, H, D);
94  double RM = rp.kRes[MC]*Sigma(pt, H, F);
95  double x = RD>RM ? sqrt(RD*RD-RM*RM)*rp.cb[F].invcdf(u) : 0;
96  if(x<=-1) return 1.0;
97  return 1.0/(1.0 + x);
98 }

◆ kSmear() [1/2]

double kSmear ( double  pt,
double  eta,
TYPE  type,
double  v,
double  u 
) const
70  {
71  int H = etaBin(fabs(eta));
72  int F = trkBin(v, H);
73  const ResParams &rp = resol[H];
74  double x = rp.kRes[type] * Sigma(pt, H, F) * rp.cb[F].invcdf(u);
75  return 1.0/(1.0+x);
76 }

◆ kSmear() [2/2]

double kSmear ( double  pt,
double  eta,
TYPE  type,
double  v,
double  u,
int  n 
) const
78  {
79  int H = etaBin(fabs(eta));
80  int F = n-NMIN;
81  if(type==Data) F = trkBin(rndm(H, F, w), H, Data);
82  const ResParams &rp = resol[H];
83  double x = rp.kRes[type] * Sigma(pt, H, F) * rp.cb[F].invcdf(u);
84  return 1.0/(1.0+x);
85 }

◆ kSpread() [1/2]

double kSpread ( double  gpt,
double  rpt,
double  eta 
) const
63  {
64  int H = etaBin(fabs(eta));
65  const auto &k = resol[H].kRes;
66  double x = gpt/rpt;
67  return x / (1.0 + (x-1.0)*k[Data]/k[MC]);
68 }

◆ kSpread() [2/2]

double kSpread ( double  gpt,
double  rpt,
double  eta,
int  nlayers,
double  w 
) const
48  {
49  int H = etaBin(fabs(eta));
50  int F = n>NMIN ? n-NMIN : 0;
51  double v = rndm(H, F, w);
52  int D = trkBin(v, H, Data);
53  double kold = gpt / rpt;
54  const ResParams &rp = resol[H];
55  double u = rp.cb[F].cdf( (kold-1.0)/rp.kRes[MC]/Sigma(gpt,H,F) );
56  double knew = 1.0 + rp.kRes[Data]*Sigma(gpt,H,D)*rp.cb[D].invcdf(u);
57 
58  if(knew<0) return 1.0;
59  return kold/knew;
60 }

◆ reset()

void reset ( )
19  {
20  NETA=0;
21  NTRK=0;
22  NMIN=0;
23  std::vector<ResParams>().swap(resol);
24 }

◆ rndm()

double rndm ( int  H,
int  F,
double  v 
) const
43  {
44  const ResParams &rp = resol[H];
45  return rp.nTrk[MC][F]+(rp.nTrk[MC][F+1]-rp.nTrk[MC][F])*w;
46 }

◆ Sigma()

double Sigma ( double  pt,
int  H,
int  F 
) const
37  {
38  double dpt=pt-45;
39  const ResParams &rp = resol[H];
40  return rp.rsPar[0][F] + rp.rsPar[1][F]*dpt + rp.rsPar[2][F]*dpt*dpt;
41 }

◆ trkBin()

int trkBin ( double  x,
int  h,
TYPE  T = MC 
) const
32  {
33  for(int i=0; i<NTRK-1; ++i) if(x<resol[h].nTrk[T][i+1]) return i;
34  return NTRK-1;
35 }

Member Data Documentation

◆ NETA

int NETA

◆ NMIN

int NMIN

◆ NTRK

int NTRK

◆ resol

std::vector<ResParams> resol

The documentation for this struct was generated from the following files:
jmarExample.pt
pt
Definition: jmarExample.py:19
RocRes::Data
@ Data
Definition: RoccoR.h:89
DAS::JetEnergy::w
static const float w
Definition: common.h:51
RocRes::resol
std::vector< ResParams > resol
Definition: RoccoR.h:104
RocRes::Extra
@ Extra
Definition: RoccoR.h:89
RocRes::trkBin
int trkBin(double x, int h, TYPE T=MC) const
Definition: RoccoR.cc:32
RocRes::NMIN
int NMIN
Definition: RoccoR.h:102
RocRes::NTRK
int NTRK
Definition: RoccoR.h:101
RocRes::Sigma
double Sigma(double pt, int H, int F) const
Definition: RoccoR.cc:37
RocRes::MC
@ MC
Definition: RoccoR.h:89
RocRes::etaBin
int etaBin(double x) const
Definition: RoccoR.cc:26
jmarExample.eta
eta
DeepAK8/ParticleNet tagging.
Definition: jmarExample.py:19
RocRes::reset
void reset()
Definition: RoccoR.cc:19
RocRes::NETA
int NETA
Definition: RoccoR.h:100
RocRes::rndm
double rndm(int H, int F, double v) const
Definition: RoccoR.cc:43