/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 | Static Public Member Functions | Private Member Functions | Private Attributes
GeCalib Class Reference

#include <GeCalib.h>

Inheritance diagram for GeCalib:
Inheritance graph
[legend]
Collaboration diagram for GeCalib:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GeCalib (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~GeCalib ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode process (const DayaBay::CalibReadoutHeader &calibReadout, int st, int acu, int zpo)
 Implementation of IEnergyCalibParamTool ////////////////////////////.
virtual StatusCode calibrate (float TimeInterval, int, int, int, int)
 calibrate() is called after processing many readouts.

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Retrieve interface ID.

Private Member Functions

bool hasStats (const DayaBay::Detector &detector)
 Check if the statistics for this detector have been initialized.
StatusCode prepareStats (const Context &context)
 Get the current statistics for a detector, or create if needed.
std::string getOutPath (const DayaBay::Detector &detector)
std::string getInPath (const DayaBay::Detector &detector)
bool GoodTdc (int Tdc)

Private Attributes

std::string m_calibDataSvcName
ICalibDataSvcm_calibDataSvc
std::string m_cableSvcName
std::string m_outfilepath
std::string m_infilepath
std::string m_pmtGeomSvcName
IPmtGeomInfoSvcm_pmtGeomSvc
ICableSvcm_cableSvc
IStatisticsSvcm_statsSvc
std::vector< DayaBay::Detectorm_processedDetectors
int m_tdclow
int m_tdchigh
TimeStamp m_vetoMuonTime
TimeStamp m_AD1MuonTime
TimeStamp m_AD2MuonTime
TimeStamp m_AD3MuonTime
TimeStamp m_AD4MuonTime
bool first
float m_ratio
ofstream m_textFile
string m_textFileName

Detailed Description

Definition at line 31 of file GeCalib.h.


Constructor & Destructor Documentation

GeCalib::GeCalib ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 53 of file GeCalib.cc.

  : GaudiTool(type,name,parent)
  , m_cableSvc(0)
  , m_statsSvc(0)
{
  
  declareInterface< IEnergyCalibTool >(this) ;   
  declareProperty("CableSvcName",m_cableSvcName="CableSvc",
                  "Name of service to map between detector, hardware, and electronic IDs");
  declareProperty("OutFilePath",m_outfilepath="/file1/GeCalib",
                  "File path of registered histograms.");
  declareProperty("InFilePath",m_infilepath="/file0/Background",
                  "File path of background histograms.");                 
  declareProperty("TDCCutLow",m_tdclow=-1650,"low tdc cut for good hits");
   declareProperty("CalibDataSvcName", m_calibDataSvcName="StaticCalibDataSvc",
                    "Name of calibration data service");
  declareProperty("TDCCutHigh",m_tdchigh=-1450,"high tdc cut for good hits");
  declareProperty("TextFile", m_textFileName="Sum.txt", "Summary of fitting result in text file");
  declareProperty("PmtGeomSvcName", m_pmtGeomSvcName = "PmtGeomInfoSvc", 
      "Name of Pmt Geometry Information Service");

}
GeCalib::~GeCalib ( ) [virtual]

Definition at line 78 of file GeCalib.cc.

{}

Member Function Documentation

StatusCode GeCalib::initialize ( ) [virtual]

Definition at line 80 of file GeCalib.cc.

                              {
         info() << "initialize()" << endreq;
  StatusCode sc = this->GaudiTool::initialize();
  if( sc != StatusCode::SUCCESS ) return sc;
  
  //Get PMT geometry service
  m_pmtGeomSvc = svc<IPmtGeomInfoSvc>(m_pmtGeomSvcName, true);
   if(!m_pmtGeomSvc ){
    error() << "Failed to access PMT geometry svc: " << m_pmtGeomSvcName << endreq;
    return StatusCode::FAILURE;
  }
  // Get Cable Service
  m_cableSvc = svc<ICableSvc>(m_cableSvcName,true);
  if(!m_cableSvc){
    error() << "Failed to access cable svc: " << m_cableSvcName << endreq;
    return StatusCode::FAILURE;
  }
  // Get the histogram service
  m_statsSvc = svc<IStatisticsSvc>("StatisticsSvc",true);
  if(!m_statsSvc) {
    error() << " No StatisticsSvc available." << endreq;
    return StatusCode::FAILURE;
  }
     m_calibDataSvc = svc<ICalibDataSvc>(m_calibDataSvcName,true);
  first = true;
  m_textFile.open( m_textFileName.c_str(), ios_base::out | ios_base::app);
  m_textFile<<"Det:/RunN:/SourceName:/ACU:/Z_position:/FitMean:/FitUncer:/Sigma:/SigmaUncer:/FitQuality:/"<<endl;
    return StatusCode::SUCCESS;
}
StatusCode GeCalib::finalize ( ) [virtual]

Definition at line 110 of file GeCalib.cc.

{
  StatusCode sc = this->GaudiTool::finalize();
  if( sc != StatusCode::SUCCESS ) return sc;

  return StatusCode::SUCCESS;
}
StatusCode GeCalib::process ( const DayaBay::CalibReadoutHeader calibReadout,
int  st,
int  acu,
int  zpo 
) [virtual]

Implementation of IEnergyCalibParamTool ////////////////////////////.

process(const DayaBay::CalibReadoutPmtCrate&) process a single readout, extracting the information needed for calibration

Implements IEnergyCalibTool.

Definition at line 118 of file GeCalib.cc.

                                                                                                       {
        
        CalibReadout* calibReadout = const_cast<CalibReadout*>(calibReadoutHeader.calibReadout());
        const DayaBay::Detector& det = calibReadout->detector();
        const TimeStamp TriTime = calibReadout->triggerTime();
        Context context = calibReadoutHeader.context();
        if( !hasStats(det) ){
    // New detector; initialize all the detector statistics
                StatusCode sc = prepareStats(context);
        if( sc != StatusCode::SUCCESS ) return sc;
    }
    int task=0;
   ServiceMode svcMode(context, task);
   TH1F* NoSpectrum = m_statsSvc->getTH1F( this->getOutPath(det) + "/GeRawSpectrumNoVeto");
   TH1F* YesSpectrum = m_statsSvc->getTH1F( this->getOutPath(det) + "/GeRawSpectrumVetoed");
   TH1F* CutSpectrum = m_statsSvc->getTH1F( this->getOutPath(det) + "/GeRawSpectrumVertexCut");
  
        if(first){
                m_vetoMuonTime = TriTime;
                m_AD1MuonTime = TriTime;
                m_AD2MuonTime = TriTime;
                m_AD3MuonTime = TriTime;
                m_AD4MuonTime = TriTime;
                first = false;
                return StatusCode::SUCCESS;
        }
        if(det.isWaterShield() || det.detectorId() == DetectorId::kRPC){
                m_vetoMuonTime = TriTime;
                return StatusCode::SUCCESS;
        }
        CalibReadoutPmtCrate* calibCrate = dynamic_cast<CalibReadoutPmtCrate*>(calibReadout);
        CalibReadoutPmtCrate::PmtChannelReadouts calibChannels = calibCrate->channelReadout();
        double qsum = 0, qsumx=0, qsumy=0, qsumz=0;
        CalibReadoutPmtCrate::PmtChannelReadouts::iterator it;
        for (it=calibChannels.begin(); it != calibChannels.end(); it++) {
                const CalibReadoutPmtChannel& channel = *it;
        AdPmtSensor pmtId(channel.pmtSensorId().fullPackedData());
        const PmtCalibData* pmtCalib = m_calibDataSvc->pmtCalibData(pmtId, svcMode);
        if( !pmtCalib ){ 
          error() << "No calibration data for pmt ID: " << pmtId << endreq;
         
         return StatusCode::FAILURE;
       }
       if( pmtCalib->m_status != PmtCalibData::kGood ) { continue; }
        if( pmtId.ring()<1 ){ continue; }  // Ignore calibration pmts
            //double largecharge = it->properCharge(m_tdclow,m_tdchigh);
            
                std::vector<double> charge = it->charge();
                std::vector<double> time = it->time();
                double largecharge=0,earlytime=0;
                for(int i = 0; i<time.size();i++){
                        if(time[i]<m_tdchigh&&time[i]>m_tdclow&&charge[i]>largecharge){
                                largecharge = charge[i];
                                earlytime = time[i];
                                //break;
                        }
                }
                
                //double largecharge = it->maxCharge();
                qsum+=largecharge;
                int ring = pmtId.ring();
                int column = pmtId.column();
                double PMTx=2340*cos(((column-1)*15+7.5)/180*3.1415);
        double PMTy=2340*sin(((column-1)*15+7.5)/180*3.1415);
        double PMTz=500*(ring-4.5);
                qsumx += largecharge*PMTx;
                qsumy += largecharge*PMTy;
                qsumz += largecharge*PMTz;
        }
        NoSpectrum->Fill(qsum);
        
        qsumx /= qsum;
        qsumy /= qsum;
        qsumz /= qsum;
        qsumx /= 0.67;
        qsumy /= 0.67;
        qsumz /= 0.4;
        double rr = sqrt(qsumx*qsumx+qsumy*qsumy);
    qsumz*=(1.3-rr*0.00023);
        double sourcex=0,sourcey=0, sourcez = zpo+0.0;
        if(acu==2) { sourcex = 1350*cos(292.5/180*3.1415); sourcey =  1350*sin(292.5/180*3.1415); }
        else if(acu==3) { sourcex = 1770*cos(292.5/180*3.1415); sourcey =  1770*sin(292.5/180*3.1415);}
        else {sourcex =0.0; sourcey=0.0;}
        double distance = sqrt( (qsumx-sourcex)*(qsumx-sourcex)+(qsumy-sourcey)*(qsumy-sourcey)+(qsumz-sourcez)*(qsumz-sourcez) );
        
        
        if(qsum > 5000) {
                if(det.detectorId() == 1) m_AD1MuonTime = TriTime;
                else if(det.detectorId() == 2)  m_AD2MuonTime = TriTime;
                else if(det.detectorId() == 3)  m_AD3MuonTime = TriTime;
                else if(det.detectorId() == 4)  m_AD4MuonTime = TriTime;
                else ;
                return StatusCode::SUCCESS;
        }
        if(det.detectorId() == 1&&( TriTime.GetNanoSec()-m_AD1MuonTime.GetNanoSec() + (TriTime.GetSec()-m_AD1MuonTime.GetSec())*1e9 )>1000000 ){
                YesSpectrum->Fill(qsum);
                if(distance<400) CutSpectrum->Fill(qsum);
        }
        if(det.detectorId() == 2&&( TriTime.GetNanoSec()-m_AD2MuonTime.GetNanoSec() + (TriTime.GetSec()-m_AD2MuonTime.GetSec())*1e9)>1000000 ){
                YesSpectrum->Fill(qsum);
                if(distance<400) CutSpectrum->Fill(qsum);
        }
        if(det.detectorId() == 3&&( TriTime.GetNanoSec()-m_AD3MuonTime.GetNanoSec()+ (TriTime.GetSec()-m_AD3MuonTime.GetSec())*1e9 )>1000000 ){
                YesSpectrum->Fill(qsum);
                if(distance<400) CutSpectrum->Fill(qsum);
        }
        if(det.detectorId() == 4&&( TriTime.GetNanoSec()-m_AD4MuonTime.GetNanoSec()+ (TriTime.GetSec()-m_AD4MuonTime.GetSec())*1e9 )>1000000 ){
                YesSpectrum->Fill(qsum);
                if(distance<400) CutSpectrum->Fill(qsum);
        }
        return StatusCode::SUCCESS; 
}
StatusCode GeCalib::calibrate ( float  TimeInterval,
int  st,
int  acu,
int  zpo,
int  runN 
) [virtual]

calibrate() is called after processing many readouts.

This method is responsible for calculating the calibration parameters.

vertex cut subtraction

Implements IEnergyCalibTool.

Definition at line 239 of file GeCalib.cc.

                                                                                 {
        std::vector<DayaBay::Detector>::iterator detIter, 
   detEnd = m_processedDetectors.end();
        for(detIter = m_processedDetectors.begin(); detIter != detEnd; detIter++){
                DayaBay::Detector detector = *detIter;
                if(detector.isAD()){
                        TObject* nTime = m_statsSvc->get(this->getOutPath(detector) + "/Time");
                        TParameter<float>* nTimePar= dynamic_cast<TParameter<float>*>(nTime);
                        nTimePar->SetVal(TimeInterval);
                        TObject* ACU = m_statsSvc->get(this->getOutPath(detector) + "/ACU");
                        TParameter<int>* nACUPar= dynamic_cast<TParameter<int>*>(ACU);
                        nACUPar->SetVal(acu);
                        TObject* nZposi = m_statsSvc->get(this->getOutPath(detector) + "/Zposi");
                        TParameter<int>* nZPar= dynamic_cast<TParameter<int>*>(nZposi);
                        nZPar->SetVal(zpo);
                        TObject* nRun = m_statsSvc->get(this->getOutPath(detector) + "/RunNum");
                        TParameter<int>* nRunPar= dynamic_cast<TParameter<int>*>(nRun);
                        nRunPar->SetVal(runN);

                        TH1F* NoRawSpectrum = m_statsSvc->getTH1F( this->getOutPath(detector) + "/GeRawSpectrumNoVeto");
                        TH1F* YesRawSpectrum = m_statsSvc->getTH1F( this->getOutPath(detector) + "/GeRawSpectrumVetoed");
                        TH1F* CutRawSpectrum = m_statsSvc->getTH1F( this->getOutPath(detector) + "/GeRawSpectrumVertexCut");
                        TH1F* CutSubSpectrum = m_statsSvc->getTH1F( this->getOutPath(detector) + "/GeSubSpectrumVertexCut");
                        TH1F* CutBackSpectrum = m_statsSvc->getTH1F( this->getInPath(detector) + "/BackgroundSpectrumVertexCut");
                        //RawSpectrum->Fit(func1, "R+");
                        TF1 *func0 = new TF1("func0", Gefit, 60, 190, 6);
                        func0->SetParNames("Constant1","Constant2", "Mean1","Mean2", "Sigma I", "Sigma II");
                        func0->SetParameters(30000,5000,150,110,20,20);
                        CutRawSpectrum->Fit(func0,"R+");
                        double mean1 = func0->GetParameter(2);
                        double uncer1 = func0->GetParError(2);
                        double sigma1 = func0->GetParameter(4);
                        double uncer2 = func0->GetParError(4);
                        double Chi2 = func0->GetChisquare();
            double ndf = func0->GetNDF();
            double fitquality = Chi2/ndf;
                        m_textFile<<detector.detectorId()<<' '<<runN<<' '<<"Ge "<<acu<<' '<<zpo<<' '<<mean1<<' '<<uncer1<<' '<<sigma1<<' '<<uncer2<<' '<<fitquality<<endl;
                        /*double mean1 = func0->GetParameter(2);
                        double sigma1 = func0->GetParError(2);
                        m_textFile<<"Ge "<<acu<<' '<<zpo<<' '<<mean1<<' '<<sigma1<<endl;*/
                        TH1F* NoSubSpectrum1 = m_statsSvc->getTH1F( this->getOutPath(detector) + "/GeSubSpectrumNoVetoM1");
                        TH1F* NoSubSpectrum2 = m_statsSvc->getTH1F( this->getOutPath(detector) + "/GeSubSpectrumNoVetoM2");
                        TH1F* YesSubSpectrum = m_statsSvc->getTH1F( this->getOutPath(detector) + "/GeSubSpectrumVetoed");
                        TH1F* NoBackSpectrum = m_statsSvc->getTH1F( this->getInPath(detector) + "/BackgroundSpectrumNoVeto");
                        TH1F* YesBackSpectrum = m_statsSvc->getTH1F( this->getInPath(detector) + "/BackgroundSpectrumVetoed");
                        
                        TObject* bTime = m_statsSvc->get(this->getInPath(detector) + "/Time");
                        TParameter<float>* bTimePar= dynamic_cast<TParameter<float>*>(bTime);
                        float backgroundTime = bTimePar->GetVal();
                        for(int i=0; i<2000;i++){
                                m_ratio = TimeInterval/backgroundTime;
                                int sub = CutRawSpectrum->GetBinContent(i)-m_ratio * CutBackSpectrum->GetBinContent(i);
                                if(sub<0) sub=0;
                                CutSubSpectrum->SetBinContent(i,sub);
                        }
                        TF1 *func4 = new TF1("func4", Gefit, 60, 190, 6);
                        func4->SetParNames("Constant1","Constant2","Mean1","Mean2","Sigma I", "Sigma II");
                        func4->SetParameters(30000,5000,150,110,20,20);
                        CutSubSpectrum->Fit(func4,"R+");
                        
                        for(int i=0; i<2000;i++){
                                m_ratio = TimeInterval/backgroundTime; 
                                int sub = YesRawSpectrum->GetBinContent(i) - m_ratio * YesBackSpectrum->GetBinContent(i);
                                if(sub<0) sub=0;
                                YesSubSpectrum->SetBinContent(i,sub);
                        }
                        TF1 *func1 = new TF1("func1", Gefit, 60, 190, 6);
                        func1->SetParNames("Constant1","Constant2", "Mean1","Mean2", "Sigma I", "Sigma II");
                        func1->SetParameters(30000,5000,150,110,20,20);
                        YesSubSpectrum->Fit(func1,"R+");
                        /*double mean1 = func1->GetParameter(2);
                        double sigma1 = func1->GetParError(2);
                        m_textFile<<"Ge "<<acu<<' '<<zpo<<' '<<mean1<<' '<<sigma1<<endl;*/
                        for(int i=0; i<100000;i++){
                                m_ratio = TimeInterval/backgroundTime; 
                                int sub = NoRawSpectrum->GetBinContent(i) - m_ratio * NoBackSpectrum->GetBinContent(i);
                                if(sub<0) sub=0;
                                NoSubSpectrum1->SetBinContent(i,sub);
                        }
                        TF1 *func2 = new TF1("func2", Gefit, 60, 190, 6);
                        func2->SetParNames("Constant1","Constant2", "Mean1","Mean2", "Sigma I", "Sigma II");
                        func2->SetParameters(30000,5000,150,110,20,20);
                        NoSubSpectrum1->Fit(func1,"R+");
                        double count1=0, count2=0;
                        for(int i=1000; i<100000;i++){
                                count1 += NoRawSpectrum->GetBinContent(i);
                                count2 += NoBackSpectrum->GetBinContent(i);
                        }
                        for(int i=0; i<100000;i++){
                                m_ratio = (count1+0.0)/(count2+0.0);
                                int sub = NoRawSpectrum->GetBinContent(i) - m_ratio * NoBackSpectrum->GetBinContent(i);
                                if(sub<0) sub=0;
                                NoSubSpectrum2->SetBinContent(i,sub);
                        }
                        TF1 *func3 = new TF1("func3", Gefit, 60, 190, 6);
                        func3->SetParNames("Constant1","Constant2", "Mean1","Mean2", "Sigma I", "Sigma II");
                        func3->SetParameters(30000,5000,150,110,20,20);
                        NoSubSpectrum2->Fit(func1,"R+");
                        //SubSpectrum->Fit(func1,"R+");
                }
        }
        return StatusCode::SUCCESS;
}
bool GeCalib::hasStats ( const DayaBay::Detector detector) [private]

Check if the statistics for this detector have been initialized.

Definition at line 347 of file GeCalib.cc.

                                                     {
  // Check if statistics have been initialized for this detector
        return (std::find(m_processedDetectors.begin(), m_processedDetectors.end(), detector) != m_processedDetectors.end());
}
StatusCode GeCalib::prepareStats ( const Context context) [private]

Get the current statistics for a detector, or create if needed.

position z is record//

Definition at line 360 of file GeCalib.cc.

                                                      {
        DayaBay::Detector detector(context.GetSite(), context.GetDetId());
  
  {
    std::ostringstream title, path;
    std::string name = "GeRawSpectrumNoVeto";
    title << "Ge Raw Spectrum in " << detector.detName()<<" . No muon veto.";
    path << this->getOutPath(detector) << "/" << name;
    TH1F* RawSpectrum = new TH1F(name.c_str(),title.str().c_str(),100000,0,1000000); // to hold water PMT fee board 
    RawSpectrum->GetXaxis()->SetTitle("P.E number after calibration");
    RawSpectrum->GetYaxis()->SetTitle("Entries");
    if( m_statsSvc->put(path.str(),RawSpectrum).isFailure() ) {
      error() << "prepareStats(): Could not register " << path << endreq;
       delete RawSpectrum;
       return StatusCode::FAILURE;
    }
    }
  {
    std::ostringstream title, path;
    std::string name = "GeRawSpectrumVetoed";
    title << "Ge Raw Spectrum in " << detector.detName()<<" . Muon veto applied.";
    path << this->getOutPath(detector) << "/" << name;
    TH1F* RawSpectrum = new TH1F(name.c_str(),title.str().c_str(),2000,0,10000); // to hold water PMT fee board 
    RawSpectrum->GetXaxis()->SetTitle("P.E number after calibration");
    RawSpectrum->GetYaxis()->SetTitle("Entries");
    if( m_statsSvc->put(path.str(),RawSpectrum).isFailure() ) {
      error() << "prepareStats(): Could not register " << path << endreq;
       delete RawSpectrum;
       return StatusCode::FAILURE;
    }
    }
  {
    std::ostringstream title, path;
    std::string name = "GeRawSpectrumVertexCut";
    title << "Ge Raw Spectrum in " << detector.detName()<<" . Vertex cut.";
    path << this->getOutPath(detector) << "/" << name;
    TH1F* RawSpectrum = new TH1F(name.c_str(),title.str().c_str(),2000,0,10000); // to hold water PMT fee board 
    RawSpectrum->GetXaxis()->SetTitle("P.E number after calibration");
    RawSpectrum->GetYaxis()->SetTitle("Entries");
    if( m_statsSvc->put(path.str(),RawSpectrum).isFailure() ) {
      error() << "prepareStats(): Could not register " << path << endreq;
       delete RawSpectrum;
       return StatusCode::FAILURE;
    }
    }
  {
    std::ostringstream title, path;
    std::string name = "GeSubSpectrumVertexCut";
    title << "Ge Sub Spectrum in " << detector.detName()<<" . Vertex cut.";
    path << this->getOutPath(detector) << "/" << name;
    TH1F* RawSpectrum = new TH1F(name.c_str(),title.str().c_str(),2000,0,10000); // to hold water PMT fee board 
    RawSpectrum->GetXaxis()->SetTitle("P.E number after calibration");
    RawSpectrum->GetYaxis()->SetTitle("Entries");
    if( m_statsSvc->put(path.str(),RawSpectrum).isFailure() ) {
      error() << "prepareStats(): Could not register " << path << endreq;
       delete RawSpectrum;
       return StatusCode::FAILURE;
    }
    }
        {
        std::ostringstream title, path;
    std::string name = "GeSubSpectrumVetoed";
    title << "Background Subtracted Ge Spectrum in " << detector.detName()<<" . Muon vetoed.";;
    path << this->getOutPath(detector) << "/" << name;
    TH1F* SubSpectrum = new TH1F(name.c_str(),title.str().c_str(),2000,0,10000); // to hold water PMT fee board 
    SubSpectrum->GetXaxis()->SetTitle("P.E number after calibration");
    SubSpectrum->GetYaxis()->SetTitle("Entries");
    if( m_statsSvc->put(path.str(),SubSpectrum).isFailure() ) {
      error() << "prepareStats(): Could not register " << path << endreq;
      delete SubSpectrum;
      return StatusCode::FAILURE;
    }
        }
        
        {
        std::ostringstream title, path;
    std::string name = "GeSubSpectrumNoVetoM1";
    title << "Background Subtracted Ge Spectrum in " << detector.detName()<<" . No Muon veto, method 1.";
    path << this->getOutPath(detector) << "/" << name;
    TH1F* SubSpectrum = new TH1F(name.c_str(),title.str().c_str(),100000,0,1000000); // to hold water PMT fee board 
    SubSpectrum->GetXaxis()->SetTitle("P.E number after calibration");
    SubSpectrum->GetYaxis()->SetTitle("Entries");
    if( m_statsSvc->put(path.str(),SubSpectrum).isFailure() ) {
      error() << "prepareStats(): Could not register " << path << endreq;
      delete SubSpectrum;
      return StatusCode::FAILURE;
    }
        }
        {
        std::ostringstream title, path;
    std::string name = "GeSubSpectrumNoVetoM2";
    title << "Background Subtracted Ge Spectrum in " << detector.detName()<<" . No Muon veto, method 2.";
    path << this->getOutPath(detector) << "/" << name;
    TH1F* SubSpectrum = new TH1F(name.c_str(),title.str().c_str(),100000,0,1000000); // to hold water PMT fee board 
    SubSpectrum->GetXaxis()->SetTitle("P.E number after calibration");
    SubSpectrum->GetYaxis()->SetTitle("Entries");
    if( m_statsSvc->put(path.str(),SubSpectrum).isFailure() ) {
      error() << "prepareStats(): Could not register " << path << endreq;
      delete SubSpectrum;
      return StatusCode::FAILURE;
    }
        }
        std::string name = "Time";
    std::ostringstream path;
    path << this->getOutPath(detector) << "/" << name;
    TParameter<float>* par = new TParameter<float>(name.c_str(), 
                                               0);
    if( m_statsSvc->put(path.str(),par).isFailure() ) {
      error() << "prepareStats(): Could not register " << name 
              << " at " << path << endreq;
      delete par;
      par = 0;
      return StatusCode::FAILURE;
    }
   {
        std::string name = "ACU";
    std::ostringstream path;
    path << this->getOutPath(detector) << "/" << name;
    TParameter<int>* par = new TParameter<int>(name.c_str(), 
                                               0);
    if( m_statsSvc->put(path.str(),par).isFailure() ) {
      error() << "prepareStats(): Could not register " << name 
              << " at " << path << endreq;
      delete par;
      par = 0;
      return StatusCode::FAILURE;
    }
  } 
  {
        std::string name = "Zposi";
    std::ostringstream path;
    path << this->getOutPath(detector) << "/" << name;
    TParameter<int>* par = new TParameter<int>(name.c_str(), 
                                               0);
    if( m_statsSvc->put(path.str(),par).isFailure() ) {
      error() << "prepareStats(): Could not register " << name 
              << " at " << path << endreq;
      delete par;
      par = 0;
      return StatusCode::FAILURE;
    }
  }
  {
        std::string name = "RunNum";
    std::ostringstream path;
    path << this->getOutPath(detector) << "/" << name;
    TParameter<int>* par = new TParameter<int>(name.c_str(),
                                               0);
    if( m_statsSvc->put(path.str(),par).isFailure() ) {
      error() << "prepareStats(): Could not register " << name
              << " at " << path << endreq;
      delete par;
      par = 0;
      return StatusCode::FAILURE;
    }
  } 
  m_processedDetectors.push_back(detector);

  return StatusCode::SUCCESS;
}
std::string GeCalib::getOutPath ( const DayaBay::Detector detector) [private]

Definition at line 352 of file GeCalib.cc.

                                                              {
        return m_outfilepath + "/" + detector.detName();
}
std::string GeCalib::getInPath ( const DayaBay::Detector detector) [private]

Definition at line 356 of file GeCalib.cc.

                                                             {
        return m_infilepath + "/" + detector.detName();
}
bool GeCalib::GoodTdc ( int  Tdc) [inline, private]

Definition at line 70 of file GeCalib.h.

    {
      if(Tdc>m_tdclow&&Tdc<m_tdchigh) return true;
      else return false;
    };
const InterfaceID & IEnergyCalibTool::interfaceID ( ) [static, inherited]

Retrieve interface ID.

Definition at line 8 of file IEnergyCalibTool.cc.

{ 
    return IID_IEnergyCalibTool; 
}

Member Data Documentation

std::string GeCalib::m_calibDataSvcName [private]

Definition at line 63 of file GeCalib.h.

Definition at line 66 of file GeCalib.h.

std::string GeCalib::m_cableSvcName [private]

Definition at line 74 of file GeCalib.h.

std::string GeCalib::m_outfilepath [private]

Definition at line 82 of file GeCalib.h.

std::string GeCalib::m_infilepath [private]

Definition at line 85 of file GeCalib.h.

std::string GeCalib::m_pmtGeomSvcName [private]

Definition at line 87 of file GeCalib.h.

Definition at line 90 of file GeCalib.h.

Definition at line 93 of file GeCalib.h.

Definition at line 96 of file GeCalib.h.

Definition at line 99 of file GeCalib.h.

int GeCalib::m_tdclow [private]

Definition at line 105 of file GeCalib.h.

int GeCalib::m_tdchigh [private]

Definition at line 106 of file GeCalib.h.

Definition at line 107 of file GeCalib.h.

Definition at line 108 of file GeCalib.h.

Definition at line 109 of file GeCalib.h.

Definition at line 110 of file GeCalib.h.

Definition at line 111 of file GeCalib.h.

bool GeCalib::first [private]

Definition at line 112 of file GeCalib.h.

float GeCalib::m_ratio [private]

Definition at line 113 of file GeCalib.h.

ofstream GeCalib::m_textFile [private]

Definition at line 115 of file GeCalib.h.

string GeCalib::m_textFileName [private]

Definition at line 116 of file GeCalib.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:03:20 for CalibEnergy by doxygen 1.7.4