/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 Attributes
CalibHistoCheck Class Reference

#include <CalibHistoCheck.h>

List of all members.

Public Member Functions

 CalibHistoCheck (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Private Attributes

IStatisticsSvc * p_statsSvc

Detailed Description

Definition at line 10 of file CalibHistoCheck.h.


Constructor & Destructor Documentation

CalibHistoCheck::CalibHistoCheck ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 18 of file CalibHistoCheck.cc.

                                                           : 
  GaudiAlgorithm(name,pSvcLocator)
{
}

Member Function Documentation

StatusCode CalibHistoCheck::initialize ( )

Definition at line 24 of file CalibHistoCheck.cc.

{
  if ( service("StatisticsSvc", p_statsSvc).isFailure() ) {
    error()<<" No StatisticsSvc available ! "<<endreq;
    return StatusCode::FAILURE;
  } 
  
  TH1F*  h1 = new TH1F("Tdc","Tdc", 500, -500., 0. );
  h1->GetXaxis()->SetTitle("ns");
  if ( p_statsSvc->put("/File1/Calib/CalibPmt/Tdc", h1).isFailure() ) {
    error()<<"Could't register Tdc "<<endreq; 
  }
  
  TH1F*  h2 = new TH1F("Adc","Adc", 400, 0., 40. );
  h2->GetXaxis()->SetTitle("p.e");
  if ( p_statsSvc->put("/File1/Calib/CalibPmt/Adc", h2).isFailure() ) {
    error()<<"Could't register Adc "<<endreq; 
  }

  info() << "Finished booking Histograms" << endreq;
  return StatusCode::SUCCESS;
}
StatusCode CalibHistoCheck::execute ( )

Definition at line 47 of file CalibHistoCheck.cc.

{
  
  TH1* tdcH = p_statsSvc->getTH1F("/File1/Calib/CalibPmt/Tdc");
  TH1* adcH = p_statsSvc->getTH1F("/File1/Calib/CalibPmt/Adc");
  if (tdcH && adcH) {
    
    const  DayaBay::CalibReadoutHeader* calibHeader 
      = get<DayaBay::CalibReadoutHeader>(
                                 DayaBay::CalibReadoutHeaderLocation::Default);
    
    if(!calibHeader) {
      error()<< "Could not find calibHeader" << endreq;
      return StatusCode::FAILURE; 
    }else {
      if(!calibHeader->calibReadout()) {
        info() << "No CalibReadout in calibHeader. No tdc/adc will be filled." << endreq;
        return StatusCode::SUCCESS;
      }
      
      const DayaBay::CalibReadoutPmtCrate* calibCrate 
        = dynamic_cast<const DayaBay::CalibReadoutPmtCrate*>(
                                                  calibHeader->calibReadout());
      const DayaBay::CalibReadoutPmtCrate::PmtChannelReadouts calib_chVec 
        = calibCrate->channelReadout();

      DayaBay::CalibReadoutPmtCrate::PmtChannelReadouts::const_iterator cpcrIter
        = calib_chVec.begin();

      for(; cpcrIter!=calib_chVec.end(); ++cpcrIter) {
        
        // Get charge on this PMT
        double charge = cpcrIter->maxCharge();
        adcH->Fill(charge);

        // Get time on this PMT
        vector<double> time = cpcrIter->time();
        for(size_t len=0; len<time.size(); len++) tdcH->Fill(time[len]);
      }
        
    }
  } else {
    error() <<" Could not retrieve Histograms "<<endreq;
    return StatusCode::FAILURE;
  } 
  
  return StatusCode::SUCCESS;
}
StatusCode CalibHistoCheck::finalize ( )

Definition at line 96 of file CalibHistoCheck.cc.

{
  debug() << "Finalizing..." << endreq;
  
  return StatusCode::SUCCESS;
}

Member Data Documentation

IStatisticsSvc* CalibHistoCheck::p_statsSvc [private]

Definition at line 20 of file CalibHistoCheck.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:14:11 for CalibAlg by doxygen 1.7.4