/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
CoCalib Class Reference

#include <CoCalib.h>

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

List of all members.

Public Member Functions

 CoCalib (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~CoCalib ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode process (const DayaBay::CalibReadoutHeader &calibReadout, int st, int acu, int zpo)
 Implementation of IEnergyCalibTool ////////////////////////////.
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
double m_AD1DeadTime
ofstream m_textFile
string m_textFileName

Detailed Description

Definition at line 31 of file CoCalib.h.


Constructor & Destructor Documentation

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

Definition at line 69 of file CoCalib.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/CoCalib",
                  "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("TDCCutHigh",m_tdchigh=-1450,"high tdc cut for good hits");
   declareProperty("CalibDataSvcName", m_calibDataSvcName="StaticCalibDataSvc",
                    "Name of calibration data service");
  declareProperty("PmtGeomSvcName", m_pmtGeomSvcName = "PmtGeomInfoSvc", 
      "Name of Pmt Geometry Information Service");
  declareProperty("TextFile", m_textFileName="Sum.txt", "Summary of fitting result in text file");

}
CoCalib::~CoCalib ( ) [virtual]

Definition at line 94 of file CoCalib.cc.

{}

Member Function Documentation

StatusCode CoCalib::initialize ( ) [virtual]

Definition at line 96 of file CoCalib.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;
  m_AD1DeadTime=0;
    return StatusCode::SUCCESS;
    
}
StatusCode CoCalib::finalize ( ) [virtual]

Definition at line 128 of file CoCalib.cc.

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

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

Implementation of IEnergyCalibTool ////////////////////////////.

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

Implements IEnergyCalibTool.

Definition at line 136 of file CoCalib.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) + "/CoRawSpectrumNoVeto");
   TH1F* YesSpectrum = m_statsSvc->getTH1F( this->getOutPath(det) + "/CoRawSpectrumVetoed");
   TH1F* CutSpectrum = m_statsSvc->getTH1F( this->getOutPath(det) + "/CoRawSpectrumVertexCut");

        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(112.5/180*3.1415); sourcey =  1350*sin(112.5/180*3.1415); }
        else if(acu==3) { sourcex = 1720*cos(292.5/180*3.1415); sourcey =  1720*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) {
                        if((TriTime.GetNanoSec()-m_AD1MuonTime.GetNanoSec() + (TriTime.GetSec()-m_AD1MuonTime.GetSec())*1e9 )<1000000) 
                                m_AD1DeadTime+=(TriTime.GetNanoSec()-m_AD1MuonTime.GetNanoSec() + (TriTime.GetSec()-m_AD1MuonTime.GetSec())*1e9);
                        else
                                m_AD1DeadTime+=1000000;
                        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 CoCalib::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 262 of file CoCalib.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()){
                        cout<<m_AD1DeadTime<<endl;
                        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) + "/CoRawSpectrumNoVeto");
                        TH1F* YesRawSpectrum = m_statsSvc->getTH1F( this->getOutPath(detector) + "/CoRawSpectrumVetoed");
                        TH1F* CutRawSpectrum = m_statsSvc->getTH1F( this->getOutPath(detector) + "/CoRawSpectrumVertexCut");
                        TH1F* CutSubSpectrum = m_statsSvc->getTH1F( this->getOutPath(detector) + "/CoSubSpectrumVertexCut");
                        TH1F* CutBackSpectrum = m_statsSvc->getTH1F( this->getInPath(detector) + "/BackgroundSpectrumVertexCut");
                        //RawSpectrum->Fit(func1, "R+");
                        TF1 *func0 = new TF1("func0", Cofit, 200, 500, 9);
                        func0->SetParNames("Constant1","Constant2", "Constant3","Mean1","Mean2", "Mean3","Sigma I", "Sigma II","SigmaIII");
                        func0->SetParameters(30000,2000,5000,400,250,400,20,20,20);
                        CutRawSpectrum->Fit(func0,"R+");
                        double mean1 = func0->GetParameter(3);
                        double uncer1 = func0->GetParError(3);
                        double sigma1 = func0->GetParameter(6);
                        double uncer2 = func0->GetParError(6);
                        double Chi2 = func0->GetChisquare();
            double ndf = func0->GetNDF();
            double fitquality = Chi2/ndf;
                        m_textFile<<detector.detectorId()<<' '<<runN<<' '<<"Co "<<acu<<' '<<zpo<<' '<<mean1<<' '<<uncer1<<' '<<sigma1<<' '<<uncer2<<' '<<fitquality<<endl;
                        
                        TH1F* NoSubSpectrum1 = m_statsSvc->getTH1F( this->getOutPath(detector) + "/CoSubSpectrumNoVetoM1");
                        TH1F* NoSubSpectrum2 = m_statsSvc->getTH1F( this->getOutPath(detector) + "/CoSubSpectrumNoVetoM2");
                        TH1F* YesSubSpectrum = m_statsSvc->getTH1F( this->getOutPath(detector) + "/CoSubSpectrumVetoed");
                        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", Cofit, 200, 500, 9);
                        func4->SetParNames("Constant1","Constant2", "Constant3","Mean1","Mean2", "Mean3","Sigma I", "Sigma II","SigmaIII");
                        func4->SetParameters(30000,2000,5000,400,250,400,20,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);
                                //cout<<i<<' '<<m_ratio<<' '<<YesRawSpectrum->GetBinContent(i)<<' '<<YesBackSpectrum->GetBinContent(i)<<' '<<sub<<endl;
                                if(sub<0) sub=0;
                                YesSubSpectrum->SetBinContent(i,sub);
                        }
                        TF1 *func1 = new TF1("func1", Cofit, 200, 500, 9);
                        func1->SetParNames("Constant1","Constant2", "Constant3","Mean1","Mean2", "Mean3","Sigma I", "Sigma II","SigmaIII");
                        func1->SetParameters(30000,2000,5000,400,250,400,20,20,20);
                        YesSubSpectrum->Fit(func1,"R+");
                        
                        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", Cofit, 200, 500, 9);
                        func2->SetParNames("Constant1","Constant2", "Constant3","Mean1","Mean2", "Mean3","Sigma I", "Sigma II","SigmaIII");
                        func2->SetParameters(30000,2000,5000,400,250,400,20,20,20);
                        NoSubSpectrum1->Fit(func2,"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", Cofit, 200, 500, 9);
                        func3->SetParNames("Constant1","Constant2", "Constant3","Mean1","Mean2", "Mean3","Sigma I", "Sigma II","SigmaIII");
                        func3->SetParameters(30000,2000,5000,400,250,400,20,20,20);
                        NoSubSpectrum2->Fit(func3,"R+");
                        //SubSpectrum->Fit(func1,"R+");
                }
        }
        return StatusCode::SUCCESS;
}
bool CoCalib::hasStats ( const DayaBay::Detector detector) [private]

Check if the statistics for this detector have been initialized.

Definition at line 370 of file CoCalib.cc.

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

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

position z is record//

////////////run number is also recorded.////////// NOT AVALIABLE

Definition at line 381 of file CoCalib.cc.

                                                      {
        DayaBay::Detector detector(context.GetSite(), context.GetDetId());
  {
    std::ostringstream title, path;
    std::string name = "CoRawSpectrumNoVeto";
    title << "Co 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 = "CoRawSpectrumVetoed";
    title << "Co 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 = "CoRawSpectrumVertexCut";
    title << "Co 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 = "CoSubSpectrumVertexCut";
    title << "Co 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 = "CoSubSpectrumVetoed";
    title << "Background Subtracted Co 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 = "CoSubSpectrumNoVetoM1";
    title << "Background Subtracted Co 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 = "CoSubSpectrumNoVetoM2";
    title << "Background Subtracted Co 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;
    }
        }
        // Time latence in the run
  
    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 CoCalib::getOutPath ( const DayaBay::Detector detector) [private]

Definition at line 375 of file CoCalib.cc.

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

Definition at line 378 of file CoCalib.cc.

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

Definition at line 70 of file CoCalib.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 CoCalib::m_calibDataSvcName [private]

Definition at line 64 of file CoCalib.h.

Definition at line 67 of file CoCalib.h.

std::string CoCalib::m_cableSvcName [private]

Definition at line 74 of file CoCalib.h.

std::string CoCalib::m_outfilepath [private]

Definition at line 82 of file CoCalib.h.

std::string CoCalib::m_infilepath [private]

Definition at line 83 of file CoCalib.h.

std::string CoCalib::m_pmtGeomSvcName [private]

Definition at line 85 of file CoCalib.h.

Definition at line 88 of file CoCalib.h.

Definition at line 91 of file CoCalib.h.

Definition at line 94 of file CoCalib.h.

Definition at line 97 of file CoCalib.h.

int CoCalib::m_tdclow [private]

Definition at line 103 of file CoCalib.h.

int CoCalib::m_tdchigh [private]

Definition at line 104 of file CoCalib.h.

Definition at line 105 of file CoCalib.h.

Definition at line 106 of file CoCalib.h.

Definition at line 107 of file CoCalib.h.

Definition at line 108 of file CoCalib.h.

Definition at line 109 of file CoCalib.h.

bool CoCalib::first [private]

Definition at line 110 of file CoCalib.h.

float CoCalib::m_ratio [private]

Definition at line 111 of file CoCalib.h.

double CoCalib::m_AD1DeadTime [private]

Definition at line 112 of file CoCalib.h.

ofstream CoCalib::m_textFile [private]

Definition at line 113 of file CoCalib.h.

string CoCalib::m_textFileName [private]

Definition at line 114 of file CoCalib.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