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

#include <AdRecHistoCheck.h>

List of all members.

Public Member Functions

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

Private Attributes

IStatisticsSvc * p_svc

Detailed Description

Definition at line 10 of file AdRecHistoCheck.h.


Constructor & Destructor Documentation

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

Definition at line 16 of file AdRecHistoCheck.cc.

                                                           : 
  GaudiAlgorithm(name,pSvcLocator)
{
}

Member Function Documentation

StatusCode AdRecHistoCheck::initialize ( )

Definition at line 22 of file AdRecHistoCheck.cc.

{
  if ( service("StatisticsSvc", p_svc).isFailure() ) {
    error()<<" No StatisticsSvc available ! "<<endreq;
    return StatusCode::FAILURE;
  } 
  
  TH1F*  h1 = new TH1F("recX","recX", 50, -1000., 1000. );
  h1->GetXaxis()->SetTitle("mm");
  if ( p_svc->put("/File1/AdRec/recX", h1).isFailure() ) {
    error()<<"Could't register recX "<<endreq; 
  }
  
  TH1F*  h2 = new TH1F("recY","recY", 50, -1000., 1000. );
  h2->GetXaxis()->SetTitle("mm");
  if ( p_svc->put("/File1/AdRec/recY", h2).isFailure() ) {
    error()<<"Could't register recY "<<endreq; 
  }

  TH1F*  h3 = new TH1F("recZ","recZ", 50, -1000., 1000. );
  h3->GetXaxis()->SetTitle("mm");
  if ( p_svc->put("/File1/AdRec/recZ", h3).isFailure() ) {
    error()<<"Could't register recZ "<<endreq; 
  }

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

Definition at line 51 of file AdRecHistoCheck.cc.

{
  
  TH1* h1 = p_svc->getTH1F("/File1/AdRec/recX");
  TH1* h2 = p_svc->getTH1F("/File1/AdRec/recX");
  TH1* h3 = p_svc->getTH1F("/File1/AdRec/recX");
  if (h1 && h2 && h3 ) {
    
    DayaBay::RecHeader* recHeader 
      = get<DayaBay::RecHeader>(DayaBay::RecHeaderLocation::Default);
    
    if(!recHeader) {
      error()<< "Could not find recHeader" << endreq;
      return StatusCode::FAILURE; 
    }else {

      const DayaBay::RecTrigger* recTrigger = &(recHeader->recTrigger());
      if(!recTrigger) {
        info() << "No recTrigger in recHeader this cycle." << endreq;
        return StatusCode::SUCCESS;
      }
      
        // Get reconstructed pos 
      CLHEP::HepLorentzVector pos = recTrigger->position();

      h1->Fill(pos.x());
      h2->Fill(pos.y());
      h3->Fill(pos.z());

    }
  } else {
    error() <<" Could not retrieve Histograms "<<endreq;
    return StatusCode::FAILURE;
  } 
  
  return StatusCode::SUCCESS;
}
StatusCode AdRecHistoCheck::finalize ( )

Definition at line 89 of file AdRecHistoCheck.cc.

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

Member Data Documentation

IStatisticsSvc* AdRecHistoCheck::p_svc [private]

Definition at line 20 of file AdRecHistoCheck.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:26 for AdRec by doxygen 1.7.4