CMS 3D CMS Logo

Public Types | Public Member Functions | Public Attributes

TPN Class Reference

#include <TPN.h>

List of all members.

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.


Constructor & Destructor Documentation

TPN::TPN ( int  iPN = 0)

Definition at line 19 of file TPN.cc.

References init.

{
  init();
  _nPN=iPN;
}
TPN::~TPN ( ) [virtual]

Definition at line 27 of file TPN.cc.

{
}

Member Function Documentation

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

Definition at line 41 of file TPN.cc.

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

{

  double val[nOutVar];
 
  if(_nPN==0) val[iPN]=pn0;
  else val[iPN]=pn1;

  if(pn!=0) val[iPNoPN]=val[iPN]/pn;
  else val[iPNoPN]=0;

  if(pn0!=0) val[iPNoPN0]=val[iPN]/pn0;
  else val[iPNoPN0]=0;

  if(pn1!=0) val[iPNoPN1]=val[iPN]/pn1;
  else val[iPNoPN1]=0;
  
  for(int ivar=0;ivar<nOutVar;ivar++){
    mom[ivar]->addEntry(val[ivar]);
  }
  
}
std::vector< double > TPN::get ( int  ivar)

Definition at line 79 of file TPN.cc.

                                  { 
  
  std::vector<double> res;
  
  if(ivar<nOutVar){
    
    res.push_back(mom[ivar]->getMean());
    res.push_back(mom[ivar]->getRMS());
    res.push_back(mom[ivar]->getM3());
    res.push_back(mom[ivar]->getNevt());
    res.push_back(mom[ivar]->getMin());
    res.push_back(mom[ivar]->getMax());
  }
  
  return res;
  
}
std::vector< double > TPN::getPN ( )

Definition at line 97 of file TPN.cc.

References iPN, and x.

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

{vector <double> x= get(TPN::iPN); return x;}
std::vector< double > TPN::getPNoPN ( )

Definition at line 98 of file TPN.cc.

References iPNoPN, and x.

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

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

Definition at line 99 of file TPN.cc.

References iPNoPN0, and x.

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

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

Definition at line 100 of file TPN.cc.

References iPNoPN1, and x.

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

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

Definition at line 31 of file TPN.cc.

References j.

{

  for(int j=0;j<nOutVar;j++){
    cuts[0][j]=0.0;
    cuts[1][j]=10.0e9;
    mom[j]=new TMom();
  }
}
void TPN::setCut ( int  ivar,
double  mean,
double  sig 
)

Definition at line 64 of file TPN.cc.

                                                  {

  cuts[0][ivar]=mean-2.0*sig;
  cuts[1][ivar]=mean+2.0*sig;
  if(cuts[0][ivar]<0)cuts[0][ivar]=0.0 ;

  mom[ivar]->setCut(cuts[0][ivar],cuts[1][ivar]);
}
void TPN::setPNCut ( double  mean,
double  sig 
)

Definition at line 73 of file TPN.cc.

References iPN.

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

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

Definition at line 75 of file TPN.cc.

References iPNoPN0.

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

Definition at line 76 of file TPN.cc.

References iPNoPN1.

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

Definition at line 74 of file TPN.cc.

References iPNoPN.


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.