CMS 3D CMS Logo

Public Types | Public Member Functions | Public Attributes

TAPD Class Reference

#include <TAPD.h>

List of all members.

Public Types

enum  outVar {
  iAPD, iAPDoPN, iAPDoPN0, iAPDoPN1,
  iTime, iAPDoAPD0, iAPDoAPD1, nOutVar
}

Public Member Functions

void addEntry (double, double, double, double, double, double, double)
void addEntry (double, double, double, double, double)
std::vector< double > get (int)
std::vector< double > getAPD ()
std::vector< double > getAPDoAPD0 ()
std::vector< double > getAPDoAPD1 ()
std::vector< double > getAPDoPN ()
std::vector< double > getAPDoPN0 ()
std::vector< double > getAPDoPN1 ()
std::vector< double > getTime ()
void init ()
void set2DAPDCut (std::vector< double >, std::vector< double >)
void set2DAPDoAPD0Cut (std::vector< double >, std::vector< double >)
void set2DAPDoAPD1Cut (std::vector< double >, std::vector< double >)
void set2DAPDoPN0Cut (std::vector< double >, std::vector< double >)
void set2DAPDoPN1Cut (std::vector< double >, std::vector< double >)
void set2DAPDoPNCut (std::vector< double >, std::vector< double >)
void set2DCut (int, std::vector< double >, std::vector< double >)
void set2DTimeCut (std::vector< double >, std::vector< double >)
void setAPDCut (double, double)
void setAPDoPN0Cut (double, double)
void setAPDoPN1Cut (double, double)
void setAPDoPNCut (double, double)
void setCut (int, double, double)
void setCut (int, std::vector< int >, std::vector< double >, std::vector< double >)
void setTimeCut (double, double)
 TAPD ()
virtual ~TAPD ()

Public Attributes

std::vector< double > _apdcuts [2][nOutVar]
std::vector< int > _cutvars [nOutVar]
TMommom [nOutVar]

Detailed Description

Definition at line 8 of file TAPD.h.


Member Enumeration Documentation

Enumerator:
iAPD 
iAPDoPN 
iAPDoPN0 
iAPDoPN1 
iTime 
iAPDoAPD0 
iAPDoAPD1 
nOutVar 

Definition at line 14 of file TAPD.h.


Constructor & Destructor Documentation

TAPD::TAPD ( )

Definition at line 21 of file TAPD.cc.

References init.

{
  init();
}
TAPD::~TAPD ( ) [virtual]

Definition at line 28 of file TAPD.cc.

{
}

Member Function Documentation

void TAPD::addEntry ( double  apd,
double  pn,
double  pn0,
double  pn1,
double  time,
double  apd0,
double  apd1 
)

Definition at line 54 of file TAPD.cc.

References asciidump::at, and cond::rpcobgas::time.

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

{

  double val[nOutVar];
  std::vector <double> valcuts[nOutVar];

  val[iAPD]=apd;
  if(pn!=0) val[iAPDoPN]=apd/pn;
  else val[iAPDoPN]=0.0;
  if(pn0!=0) val[iAPDoPN0]=apd/pn0;
  else val[iAPDoPN0]=0.0;
  if(pn1!=0) val[iAPDoPN1]=apd/pn1;
  else val[iAPDoPN1]=0.0;
  val[iTime]=time;
  if(apd0!=0.)val[iAPDoAPD0]=apd/apd0;
  else val[iAPDoAPD0]=0.0;
  if(apd1!=0.)val[iAPDoAPD1]=apd/apd1;
  else val[iAPDoAPD1]=0.0;

  
  
  for(int ivar=0;ivar<nOutVar;ivar++){
    int dimcut=_cutvars[ivar].size();
    for(int ic=0;ic<dimcut;ic++){
      assert(_cutvars[ivar].at(ic)<nOutVar);
      valcuts[ivar].push_back(val[_cutvars[ivar].at(ic)]);
    }
  }

  for(int ivar=0;ivar<nOutVar;ivar++){
    mom[ivar]->addEntry(val[ivar],valcuts[ivar]); 
    //    std::cout << "addEntry: val[ivar=" << ivar <<"] = "<<val[ivar]<< std::endl;
    
    for(size_t ic=0;ic<_cutvars[ivar].size();ic++){
      //      std::cout << "addEntry: valcuts[ivar="<< ivar <<"][ic="<<ic<<"] = "<<valcuts[ivar].at(ic)<< std::endl;
      for(size_t iv=0;iv<_cutvars[ivar].size();iv++){
        //      std::cout <<"low cut:"<<_apdcuts[0][ivar].at(iv)<<", high cut:"<<_apdcuts[1][ivar].at(iv)<<", cutvar: "<<_cutvars[ivar].at(iv)<< std::endl;
      }
    }
  }
  
}
void TAPD::addEntry ( double  apd,
double  pn,
double  pn0,
double  pn1,
double  time 
)

Definition at line 49 of file TAPD.cc.

References revisionDML::addEntry().

{
  addEntry(apd, pn, pn0, pn1, time, 0.0, 0.0);
}
std::vector< double > TAPD::get ( int  ivar)

Definition at line 215 of file TAPD.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());

  }

  //  std::cout << "In get: ivar="<< ivar << ", mean="<< mom[ivar]->getMean()<<" res size="<< res.size()<< std::endl;

  return res;

}
std::vector< double > TAPD::getAPD ( )

Definition at line 236 of file TAPD.cc.

References iAPD, and x.

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

{std::vector<double> x=get(TAPD::iAPD); return x;}
std::vector< double > TAPD::getAPDoAPD0 ( )

Definition at line 241 of file TAPD.cc.

References iAPDoAPD0, and x.

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

                                     {
std::vector<double> x=get(TAPD::iAPDoAPD0); 
// std::cout<< "In GetAPDoAPD0: x[0]="<< x.at(0) << std::endl;
 return x;
}
std::vector< double > TAPD::getAPDoAPD1 ( )

Definition at line 246 of file TAPD.cc.

References iAPDoAPD1, and x.

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

{std::vector<double> x=get(TAPD::iAPDoAPD1); return x;}
std::vector< double > TAPD::getAPDoPN ( )

Definition at line 237 of file TAPD.cc.

References iAPDoPN, and x.

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

{std::vector<double> x=get(TAPD::iAPDoPN); return x;}
std::vector< double > TAPD::getAPDoPN0 ( )

Definition at line 238 of file TAPD.cc.

References iAPDoPN0, and x.

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

{std::vector<double> x=get(TAPD::iAPDoPN0); return x;}
std::vector< double > TAPD::getAPDoPN1 ( )

Definition at line 239 of file TAPD.cc.

References iAPDoPN1, and x.

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

{std::vector<double> x=get(TAPD::iAPDoPN1); return x;}
std::vector< double > TAPD::getTime ( )

Definition at line 240 of file TAPD.cc.

References iTime, and x.

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

{std::vector<double> x=get(TAPD::iTime); return x;}
void TAPD::init ( )

Definition at line 32 of file TAPD.cc.

References j.

{

  for(int j=0;j<nOutVar;j++){

    _apdcuts[0][j].clear();
    _apdcuts[1][j].clear();
    _cutvars[j].clear();

    _apdcuts[0][j].push_back(0.0);
    _apdcuts[1][j].push_back(10.0e6);
    _cutvars[j].push_back(j);
    
    mom[j]=new TMom();
  }
}
void TAPD::set2DAPDCut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 170 of file TAPD.cc.

References iAPD.

                                                                         {
  set2DCut(TAPD::iAPD, lowCut, highCut);
}
void TAPD::set2DAPDoAPD0Cut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 184 of file TAPD.cc.

References iAPD, iAPDoAPD0, and iTime.

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

                                                                              {

  assert (lowCut.size()==2);
  assert (highCut.size()==2);
  std::vector<int> cutVars;
  cutVars.push_back(TAPD::iAPD);
  cutVars.push_back(TAPD::iTime); 
  setCut(TAPD::iAPDoAPD0, cutVars, lowCut, highCut);
}
void TAPD::set2DAPDoAPD1Cut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 193 of file TAPD.cc.

References iAPD, iAPDoAPD1, and iTime.

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

                                                                              {

  assert (lowCut.size()==2);
  assert (highCut.size()==2);
  std::vector<int> cutVars;
  cutVars.push_back(TAPD::iAPD);
  cutVars.push_back(TAPD::iTime); 
  setCut(TAPD::iAPDoAPD1, cutVars, lowCut, highCut);
}
void TAPD::set2DAPDoPN0Cut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 176 of file TAPD.cc.

References iAPDoPN0.

                                                                             {
  set2DCut(TAPD::iAPDoPN0, lowCut, highCut);
}
void TAPD::set2DAPDoPN1Cut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 179 of file TAPD.cc.

References iAPDoPN1.

                                                                             {
  set2DCut(TAPD::iAPDoPN1, lowCut, highCut);
}
void TAPD::set2DAPDoPNCut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 173 of file TAPD.cc.

References iAPDoPN.

                                                                            {
  set2DCut(TAPD::iAPDoPN, lowCut, highCut);
}
void TAPD::set2DCut ( int  ivar,
std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 158 of file TAPD.cc.

References iTime.

                                                                                {
  
  assert (lowCut.size()==2);
  assert (highCut.size()==2);
  std::vector<int> cutVars;
  cutVars.push_back(ivar);
  cutVars.push_back(TAPD::iTime); 
  setCut(ivar, cutVars, lowCut, highCut);
  
}
void TAPD::set2DTimeCut ( std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 203 of file TAPD.cc.

References iAPD, and iTime.

                                                                          {

  assert (lowCut.size()==2);
  assert (highCut.size()==2);
  std::vector<int> cutVars;
  cutVars.push_back(TAPD::iAPD);
  cutVars.push_back(TAPD::iTime); 
  setCut(TAPD::iTime, cutVars, lowCut, highCut);
}
void TAPD::setAPDCut ( double  mean,
double  sig 
)

Definition at line 148 of file TAPD.cc.

References iAPD.

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

void TAPD::setAPDoPN0Cut ( double  mean,
double  sig 
)

Definition at line 150 of file TAPD.cc.

References iAPDoPN0.

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

void TAPD::setAPDoPN1Cut ( double  mean,
double  sig 
)

Definition at line 151 of file TAPD.cc.

References iAPDoPN1.

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

void TAPD::setAPDoPNCut ( double  mean,
double  sig 
)

Definition at line 149 of file TAPD.cc.

References iAPDoPN.

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

void TAPD::setCut ( int  ivar,
std::vector< int >  cutVars,
std::vector< double >  lowCut,
std::vector< double >  highCut 
)

Definition at line 118 of file TAPD.cc.

                                                                                                      {
  
  assert(ivar<nOutVar);
  int cutdim=cutVars.size();
  assert(cutdim<nOutVar);
  assert(cutdim==(int)lowCut.size());
  assert(cutdim==(int)highCut.size());
  
  _apdcuts[0][ivar].clear();
  _apdcuts[1][ivar].clear();
  _cutvars[ivar].clear();
  
  for (int ic=0;ic<cutdim;ic++){
    
    // FINISH THIS
    if(lowCut.at(ic)>0){
      _apdcuts[0][ivar].push_back(lowCut.at(ic));
    }else _apdcuts[0][ivar].push_back(0.0);
    
    _apdcuts[1][ivar].push_back(highCut.at(ic));
    _cutvars[ivar].push_back(cutVars.at(ic));

  }
 
  mom[ivar]->setCut(_apdcuts[0][ivar],_apdcuts[1][ivar]);
}
void TAPD::setCut ( int  ivar,
double  mean,
double  sig 
)

Definition at line 97 of file TAPD.cc.

                                                  {
  
  assert(ivar<nOutVar);
  
  std::vector <int>cutvar;
  cutvar.push_back(ivar);
  
  std::vector <double>lowcut;
  std::vector <double>highcut;

  double low=mean-2.0*sig;
  if (low<0) low=0.0;
  double high=mean+2.0*sig;

  lowcut.push_back(low);
  highcut.push_back(high);

  setCut(ivar,cutvar,lowcut,highcut);  

}
void TAPD::setTimeCut ( double  mean,
double  sig 
)

Definition at line 152 of file TAPD.cc.

References iTime.

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


Member Data Documentation

std::vector<double> TAPD::_apdcuts[2][nOutVar]

Definition at line 16 of file TAPD.h.

std::vector<int> TAPD::_cutvars[nOutVar]

Definition at line 17 of file TAPD.h.

TMom* TAPD::mom[nOutVar]

Definition at line 19 of file TAPD.h.