CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 13 of file TPN.h.

Definition: TPN.h:13

Constructor & Destructor Documentation

TPN::TPN ( int  iPN = 0)

Definition at line 18 of file TPN.cc.

References init.

19 {
20  init();
21  _nPN=iPN;
22 }
Definition: TPN.h:13
int _nPN
Definition: TPN.h:18
void init()
Definition: TPN.cc:30
TPN::~TPN ( )
virtual

Definition at line 26 of file TPN.cc.

27 {
28 }

Member Function Documentation

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

Definition at line 40 of file TPN.cc.

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

41 {
42 
43  double val[nOutVar];
44 
45  if(_nPN==0) val[iPN]=pn0;
46  else val[iPN]=pn1;
47 
48  if(pn!=0) val[iPNoPN]=val[iPN]/pn;
49  else val[iPNoPN]=0;
50 
51  if(pn0!=0) val[iPNoPN0]=val[iPN]/pn0;
52  else val[iPNoPN0]=0;
53 
54  if(pn1!=0) val[iPNoPN1]=val[iPN]/pn1;
55  else val[iPNoPN1]=0;
56 
57  for(int ivar=0;ivar<nOutVar;ivar++){
58  mom[ivar]->addEntry(val[ivar]);
59  }
60 
61 }
void addEntry(double val)
Definition: TMom.cc:110
Definition: TPN.h:13
int _nPN
Definition: TPN.h:18
TMom * mom[nOutVar]
Definition: TPN.h:16
std::vector< double > TPN::get ( int  ivar)

Definition at line 78 of file TPN.cc.

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

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

Definition at line 96 of file TPN.cc.

References iPN, and x().

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

96 {vector <double> x= get(TPN::iPN); return x;}
Definition: TPN.h:13
std::vector< double > TPN::getPNoPN ( )

Definition at line 97 of file TPN.cc.

References iPNoPN, and x().

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

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

Definition at line 98 of file TPN.cc.

References iPNoPN0, and x().

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

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

Definition at line 99 of file TPN.cc.

References iPNoPN1, and x().

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

99 {vector <double> x= get(TPN::iPNoPN1); return x;}
void TPN::init ( )

Definition at line 30 of file TPN.cc.

References hpstanc_transforms::cuts, and j.

31 {
32 
33  for(int j=0;j<nOutVar;j++){
34  cuts[0][j]=0.0;
35  cuts[1][j]=10.0e9;
36  mom[j]=new TMom();
37  }
38 }
Definition: TMom.h:7
double cuts[2][nOutVar]
Definition: TPN.h:15
TMom * mom[nOutVar]
Definition: TPN.h:16
int j
Definition: DBlmapReader.cc:9
void TPN::setCut ( int  ivar,
double  mean,
double  sig 
)

Definition at line 63 of file TPN.cc.

References hpstanc_transforms::cuts.

63  {
64 
65  cuts[0][ivar]=mean-2.0*sig;
66  cuts[1][ivar]=mean+2.0*sig;
67  if(cuts[0][ivar]<0)cuts[0][ivar]=0.0 ;
68 
69  mom[ivar]->setCut(cuts[0][ivar],cuts[1][ivar]);
70 }
void setCut(double, double)
Definition: TMom.cc:90
double cuts[2][nOutVar]
Definition: TPN.h:15
TMom * mom[nOutVar]
Definition: TPN.h:16
void TPN::setPNCut ( double  mean,
double  sig 
)

Definition at line 72 of file TPN.cc.

References iPN.

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

72 {setCut(TPN::iPN,mean,sig);}
Definition: TPN.h:13
void setCut(int, double, double)
Definition: TPN.cc:63
void TPN::setPNoPN0Cut ( double  mean,
double  sig 
)

Definition at line 74 of file TPN.cc.

References iPNoPN0.

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

Definition at line 75 of file TPN.cc.

References iPNoPN1.

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

Definition at line 73 of file TPN.cc.

References iPNoPN.

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

Member Data Documentation

int TPN::_nPN

Definition at line 18 of file TPN.h.

double TPN::cuts[2][nOutVar]

Definition at line 15 of file TPN.h.

TMom* TPN::mom[nOutVar]

Definition at line 16 of file TPN.h.