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

Enumerator
iPN 
iPNoPN 
iPNoPN0 
iPNoPN1 
nOutVar 

Definition at line 10 of file TPN.h.

Constructor & Destructor Documentation

TPN::TPN ( int  iPN = 0)

Definition at line 17 of file TPN.cc.

References init.

17  {
18  init();
19  _nPN = iPN;
20 }
Definition: TPN.h:10
int _nPN
Definition: TPN.h:15
void init()
Definition: TPN.cc:25
TPN::~TPN ( )
virtual

Definition at line 23 of file TPN.cc.

23 {}

Member Function Documentation

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

Definition at line 33 of file TPN.cc.

References heppy_batch::val.

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

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 }
void addEntry(double val)
Definition: TMom.cc:88
Definition: TPN.h:10
int _nPN
Definition: TPN.h:15
TMom * mom[nOutVar]
Definition: TPN.h:13
std::vector< double > TPN::get ( int  ivar)
std::vector< double > TPN::getPN ( )

Definition at line 90 of file TPN.cc.

References iPN.

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

90  {
91  vector<double> x = get(TPN::iPN);
92  return x;
93 }
Definition: TPN.h:10
std::vector< double > TPN::getPNoPN ( )

Definition at line 94 of file TPN.cc.

References iPNoPN.

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

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

Definition at line 98 of file TPN.cc.

References iPNoPN0.

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

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

Definition at line 102 of file TPN.cc.

References iPNoPN1.

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

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

Definition at line 25 of file TPN.cc.

References L1TMuonDQMOffline_cfi::cuts, and dqmiolumiharvest::j.

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 }
Definition: TMom.h:7
double cuts[2][nOutVar]
Definition: TPN.h:12
TMom * mom[nOutVar]
Definition: TPN.h:13
void TPN::setCut ( int  ivar,
double  mean,
double  sig 
)

Definition at line 61 of file TPN.cc.

References L1TMuonDQMOffline_cfi::cuts.

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 }
void setCut(double, double)
Definition: TMom.cc:72
double cuts[2][nOutVar]
Definition: TPN.h:12
TMom * mom[nOutVar]
Definition: TPN.h:13
void TPN::setPNCut ( double  mean,
double  sig 
)

Definition at line 70 of file TPN.cc.

References iPN.

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

70 { setCut(TPN::iPN, mean, sig); }
Definition: TPN.h:10
void setCut(int, double, double)
Definition: TPN.cc:61
void TPN::setPNoPN0Cut ( double  mean,
double  sig 
)

Definition at line 72 of file TPN.cc.

References iPNoPN0.

72 { setCut(TPN::iPNoPN0, mean, sig); }
void setCut(int, double, double)
Definition: TPN.cc:61
void TPN::setPNoPN1Cut ( double  mean,
double  sig 
)

Definition at line 73 of file TPN.cc.

References iPNoPN1.

73 { setCut(TPN::iPNoPN1, mean, sig); }
void setCut(int, double, double)
Definition: TPN.cc:61
void TPN::setPNoPNCut ( double  mean,
double  sig 
)

Definition at line 71 of file TPN.cc.

References iPNoPN.

71 { setCut(TPN::iPNoPN, mean, sig); }
void setCut(int, double, double)
Definition: TPN.cc:61

Member Data Documentation

int TPN::_nPN

Definition at line 15 of file TPN.h.

double TPN::cuts[2][nOutVar]
TMom* TPN::mom[nOutVar]

Definition at line 13 of file TPN.h.