CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes
TPN Class Reference

#include <TPN.h>

Public Types

enum  outVar {
  iPN, iPNoPN, iPNoPN0, iPNoPN1,
  nOutVar
}
 

Public Member Functions

void addEntry (double, double, double)
 
std::vector< double > get (int)
 
std::vector< double > getPN ()
 
std::vector< double > getPNoPN ()
 
std::vector< double > getPNoPN0 ()
 
std::vector< double > getPNoPN1 ()
 
void init ()
 
void setCut (int, double, double)
 
void setPNCut (double, double)
 
void setPNoPN0Cut (double, double)
 
void setPNoPN1Cut (double, double)
 
void setPNoPNCut (double, double)
 
 TPN (int iPN=0)
 
virtual ~TPN ()
 

Public Attributes

int _nPN
 
double cuts [2][nOutVar]
 
TMommom [nOutVar]
 

Detailed Description

Definition at line 8 of file TPN.h.

Member Enumeration Documentation

◆ outVar

Enumerator
iPN 
iPNoPN 
iPNoPN0 
iPNoPN1 
nOutVar 

Definition at line 10 of file TPN.h.

Constructor & Destructor Documentation

◆ TPN()

TPN::TPN ( int  iPN = 0)

Definition at line 17 of file TPN.cc.

17  {
18  init();
19  _nPN = iPN;
20 }

References init.

◆ ~TPN()

TPN::~TPN ( )
virtual

Definition at line 23 of file TPN.cc.

23 {}

Member Function Documentation

◆ addEntry()

void TPN::addEntry ( double  pn,
double  pn0,
double  pn1 
)

Definition at line 33 of file TPN.cc.

33  {
34  double val[nOutVar];
35 
36  if (_nPN == 0)
37  val[iPN] = pn0;
38  else
39  val[iPN] = pn1;
40 
41  if (pn != 0)
42  val[iPNoPN] = val[iPN] / pn;
43  else
44  val[iPNoPN] = 0;
45 
46  if (pn0 != 0)
47  val[iPNoPN0] = val[iPN] / pn0;
48  else
49  val[iPNoPN0] = 0;
50 
51  if (pn1 != 0)
52  val[iPNoPN1] = val[iPN] / pn1;
53  else
54  val[iPNoPN1] = 0;
55 
56  for (int ivar = 0; ivar < nOutVar; ivar++) {
57  mom[ivar]->addEntry(val[ivar]);
58  }
59 }

References heppy_batch::val.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

◆ get()

std::vector< double > TPN::get ( int  ivar)

◆ getPN()

std::vector< double > TPN::getPN ( )

Definition at line 90 of file TPN.cc.

90  {
91  vector<double> x = get(TPN::iPN);
92  return x;
93 }

References get, and iPN.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

◆ getPNoPN()

std::vector< double > TPN::getPNoPN ( )

Definition at line 94 of file TPN.cc.

94  {
95  vector<double> x = get(TPN::iPNoPN);
96  return x;
97 }

References get, and iPNoPN.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

◆ getPNoPN0()

std::vector< double > TPN::getPNoPN0 ( )

Definition at line 98 of file TPN.cc.

98  {
99  vector<double> x = get(TPN::iPNoPN0);
100  return x;
101 }

References get, and iPNoPN0.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

◆ getPNoPN1()

std::vector< double > TPN::getPNoPN1 ( )

Definition at line 102 of file TPN.cc.

102  {
103  vector<double> x = get(TPN::iPNoPN1);
104  return x;
105 }

References get, and iPNoPN1.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

◆ init()

void TPN::init ( )

Definition at line 25 of file TPN.cc.

25  {
26  for (int j = 0; j < nOutVar; j++) {
27  cuts[0][j] = 0.0;
28  cuts[1][j] = 10.0e9;
29  mom[j] = new TMom();
30  }
31 }

References cuts, and dqmiolumiharvest::j.

◆ setCut()

void TPN::setCut ( int  ivar,
double  mean,
double  sig 
)

Definition at line 61 of file TPN.cc.

61  {
62  cuts[0][ivar] = mean - 2.0 * sig;
63  cuts[1][ivar] = mean + 2.0 * sig;
64  if (cuts[0][ivar] < 0)
65  cuts[0][ivar] = 0.0;
66 
67  mom[ivar]->setCut(cuts[0][ivar], cuts[1][ivar]);
68 }

References cuts, and SiStripPI::mean.

◆ setPNCut()

void TPN::setPNCut ( double  mean,
double  sig 
)

Definition at line 70 of file TPN.cc.

70 { setCut(TPN::iPN, mean, sig); }

References iPN, and SiStripPI::mean.

Referenced by EcalLaserAnalyzer2::endJob(), and EcalLaserAnalyzer::endJob().

◆ setPNoPN0Cut()

void TPN::setPNoPN0Cut ( double  mean,
double  sig 
)

Definition at line 72 of file TPN.cc.

72 { setCut(TPN::iPNoPN0, mean, sig); }

References iPNoPN0, and SiStripPI::mean.

◆ setPNoPN1Cut()

void TPN::setPNoPN1Cut ( double  mean,
double  sig 
)

Definition at line 73 of file TPN.cc.

73 { setCut(TPN::iPNoPN1, mean, sig); }

References iPNoPN1, and SiStripPI::mean.

◆ setPNoPNCut()

void TPN::setPNoPNCut ( double  mean,
double  sig 
)

Definition at line 71 of file TPN.cc.

71 { setCut(TPN::iPNoPN, mean, sig); }

References iPNoPN, and SiStripPI::mean.

Member Data Documentation

◆ _nPN

int TPN::_nPN

Definition at line 15 of file TPN.h.

◆ cuts

double TPN::cuts[2][nOutVar]

◆ mom

TMom* TPN::mom[nOutVar]

Definition at line 13 of file TPN.h.

TPN::mom
TMom * mom[nOutVar]
Definition: TPN.h:13
TMom::addEntry
void addEntry(double val)
Definition: TMom.cc:88
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
TPN::_nPN
int _nPN
Definition: TPN.h:15
TPN::nOutVar
Definition: TPN.h:10
DDAxes::x
TPN::iPNoPN0
Definition: TPN.h:10
TMom::setCut
void setCut(double, double)
Definition: TMom.cc:72
TPN::iPNoPN
Definition: TPN.h:10
TPN::init
void init()
Definition: TPN.cc:25
TMom
Definition: TMom.h:7
TPN::setCut
void setCut(int, double, double)
Definition: TPN.cc:61
res
Definition: Electron.h:6
TPN::iPN
Definition: TPN.h:10
heppy_batch.val
val
Definition: heppy_batch.py:351
TPN::cuts
double cuts[2][nOutVar]
Definition: TPN.h:12
TPN::iPNoPN1
Definition: TPN.h:10
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TPN::get
std::vector< double > get(int)
Definition: TPN.cc:75