CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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.

Definition: TPN.h:10

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 hgcalPerformanceValidation::val.

Referenced by EcalLaserAnalyzer::endJob(), and EcalLaserAnalyzer2::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)

Definition at line 75 of file TPN.cc.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), data_sources.json_list::as_dicts(), data_sources.json_list::as_table(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), util.rrapi.RRApi::data(), rrapi.RRApi::data(), data_sources.json_list::first(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), data_sources.json_list::indices(), data_sources.json_list::last(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), util.rrapi.RRApi::reports(), rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

75  {
76  std::vector<double> res;
77 
78  if (ivar < nOutVar) {
79  res.push_back(mom[ivar]->getMean());
80  res.push_back(mom[ivar]->getRMS());
81  res.push_back(mom[ivar]->getM3());
82  res.push_back(mom[ivar]->getNevt());
83  res.push_back(mom[ivar]->getMin());
84  res.push_back(mom[ivar]->getMax());
85  }
86 
87  return res;
88 }
TMom * mom[nOutVar]
Definition: TPN.h:13
std::vector< double > TPN::getPN ( )

Definition at line 90 of file TPN.cc.

References iPN.

Referenced by EcalLaserAnalyzer::endJob(), and EcalLaserAnalyzer2::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 EcalLaserAnalyzer::endJob(), and EcalLaserAnalyzer2::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 EcalLaserAnalyzer::endJob(), and EcalLaserAnalyzer2::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 EcalLaserAnalyzer::endJob(), and EcalLaserAnalyzer2::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 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 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 EcalLaserAnalyzer::endJob(), and EcalLaserAnalyzer2::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.