/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Member Functions | Private Attributes
Corrector Class Reference

#include <QsumEnergyTool.h>

List of all members.

Public Member Functions

 Corrector (const char *fname)
 ~Corrector ()
double get_corr (int site, int detid, double x, double y, double z)

Private Member Functions

int get_ad (int site, int detid)

Private Attributes

TFile * infile
TH2D * resp_r2z [8]
TF1 * resp_phi [8]

Detailed Description

Definition at line 31 of file QsumEnergyTool.h.


Constructor & Destructor Documentation

Corrector::Corrector ( const char *  fname)

Definition at line 278 of file QsumEnergyTool.cc.

                                     {
  infile = new TFile(fname);
  char hname[100];
  for (int detidx=0; detidx<8; ++detidx){
    sprintf(hname, "resp_r2z_%d", detidx+1);
    resp_r2z[detidx] = (TH2D*)infile->Get(hname);

    sprintf(hname, "resp_phi_%d", detidx+1);
    resp_phi[detidx] = (TF1*)infile->Get(hname);
  }
}
Corrector::~Corrector ( )

Definition at line 290 of file QsumEnergyTool.cc.

                     {
  if (infile != 0 && infile->IsOpen())
    infile->Close();
  if (infile != 0)
    delete infile;
}

Member Function Documentation

double Corrector::get_corr ( int  site,
int  detid,
double  x,
double  y,
double  z 
)

Definition at line 320 of file QsumEnergyTool.cc.

                                                         {
  int detidx = get_ad(site, detid) - 1;
  double r2 = x*x + y*y;
  double phi = atan2(y, x);

  if (abs(z) >= 2)
    z = z > 0 ? 1.999 : -1.999;
  if (r2 >= 4)
    r2 = 3.999;

  return 1. / resp_r2z[detidx]->Interpolate(r2, z)
    / resp_phi[detidx]->Eval(phi);
}
int Corrector::get_ad ( int  site,
int  detid 
) [private]

Definition at line 297 of file QsumEnergyTool.cc.

                                        {
  switch(site) {
  case 1:
    return detid;
    break;
  case 2:
    if (detid == 1)
      return 3;
    else if (detid == 2)
      return 8;
    break;
  case 4:
    return detid + 3;
    break;
  default:
    return 0;
  }
  return 0;
}

Member Data Documentation

TFile* Corrector::infile [private]

Definition at line 37 of file QsumEnergyTool.h.

TH2D* Corrector::resp_r2z[8] [private]

Definition at line 38 of file QsumEnergyTool.h.

TF1* Corrector::resp_phi[8] [private]

Definition at line 39 of file QsumEnergyTool.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:13:18 for QsumEnergy by doxygen 1.7.4