/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 | Protected Member Functions | Protected Attributes | Private Attributes
Ge68Data Class Reference

#include <Ge68Data.h>

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

List of all members.

Public Member Functions

 Ge68Data (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~Ge68Data ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
DayaBay::UserDataHeaderGetCurrentHeaderObject () const
virtual StatusCode sysInitialize ()
virtual StatusCode sysExecute ()
virtual StatusCode preExecute ()
virtual StatusCode postExecute ()
virtual StatusCode sysFinalize ()
IDataProviderSvc * arcSvc () const
void putTES (DataObject *obj, std::string location) const
TYPE * getTES (std::string location) const
TYPE * getAES (std::string location, int index) const
std::vector< DataObject * > getAEScollection (std::string location) const
int getExecNum ()
std::string Location () const

Protected Member Functions

DayaBay::UserDataHeaderMakeHeaderObject ()
void InitializeHeader (DayaBay::HeaderObject *header)
TYPE * MakeHeader ()
TYPE * MakeHeader (std::vector< const DayaBay::IHeader * > &inputHeaders)
TYPE * MakeHeader (const DayaBay::IHeader *referenceHeader)
void AppendInputHeader (const DayaBay::HeaderObject *header) const

Protected Attributes

DayaBay::HeaderObjectm_headerObject
bool m_pullMode
std::string m_location

Private Attributes

IJobInfoSvcm_jobInfoSvc
std::string m_readoutHeaderLocation
std::string m_calibStatsLocation
std::string m_Ge68Location

Detailed Description

Definition at line 20 of file Ge68Data.h.


Constructor & Destructor Documentation

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

Definition at line 16 of file Ge68Data.cc.

  : DybAlgorithm<DayaBay::UserDataHeader>(name,pSvcLocator) {
  m_location = "/Event/Data/Calib/Ge68";

  declareProperty("ReadoutHeaderLocation", m_readoutHeaderLocation="/Event/Readout/ReadoutHeader",
                  "Location of the ReadoutHeader");
  declareProperty("CalibStatsLocation", m_calibStatsLocation="/Event/Data/CalibStats",
                  "Location of the CalibStats User data");
  declareProperty("Ge68Location", m_Ge68Location="/Event/Tag/Calib/Ge68",
                  "Location of the Ge68 Tag");
}
Ge68Data::~Ge68Data ( ) [virtual]

Definition at line 28 of file Ge68Data.cc.

                    {
}

Member Function Documentation

StatusCode Ge68Data::initialize ( ) [virtual]

Definition at line 31 of file Ge68Data.cc.

                                {
  return this->GaudiAlgorithm::initialize();
}
StatusCode Ge68Data::execute ( ) [virtual]

Definition at line 39 of file Ge68Data.cc.

                             {
  
  StatusCode sc = StatusCode::SUCCESS;

  const DayaBay::ReadoutHeader *readoutHdr = 0; 
  const DayaBay::RecHeader *recHdr = 0; 
  DayaBay::UserDataHeader *calibStatsHdr = 0; 

  // Check if it is tagged as Ge68, if not, skip.
  bool isGe68 = exist<DayaBay::HeaderObject>(evtSvc(), m_Ge68Location);
  if (!isGe68){
    return StatusCode::SUCCESS;
  }

  // Get Calibstats
  if ( !exist<DayaBay::UserDataHeader>(evtSvc(), m_calibStatsLocation) ) {
    warning() << "Cannot find header at " << m_calibStatsLocation << endreq;
    return StatusCode::FAILURE;
  } else {
    calibStatsHdr = get<DayaBay::UserDataHeader>(m_calibStatsLocation);
  }
  
  // Get readout
  if (!exist<DayaBay::ReadoutHeader>(evtSvc(), "/Event/Readout/ReadoutHeader")) {
    warning() << "Failed to get readout" << endreq;
  } else {
    readoutHdr = get<DayaBay::ReadoutHeader>("/Event/Readout/ReadoutHeader");
  }

  // Get recon header
  if (!exist<DayaBay::RecHeader>(evtSvc(), "/Event/Rec/AdSimple")) {
    warning() << "Failed to get recheader" << endreq;
    return StatusCode::FAILURE;
  } else {
    recHdr = get<DayaBay::RecHeader>("/Event/Rec/AdSimple");
  }
  const DayaBay::RecTrigger& rectrigger = recHdr->recTrigger();
  
  // Skip SAB Data 
  Site::Site_t siteId = readoutHdr->context().GetSite();
  if (siteId == Site::kSAB) {
    return StatusCode::SUCCESS;
  }

  // Skip if recon has failed
  float recES = rectrigger.energyStatus();
  float recPS = rectrigger.positionStatus();
  if (recES != 1  || recPS != 1){
    debug() << "Recon failed. skipping" << endreq;
    return StatusCode::SUCCESS;
  }

  // Record data
  // -- 1a.  Get data from recheader
  float e_ge68 = rectrigger.energy()/Gaudi::Units::MeV;
  float x_ge68 = rectrigger.position().x() / Gaudi::Units::mm;
  float y_ge68 = rectrigger.position().y() / Gaudi::Units::mm;
  float z_ge68 = rectrigger.position().z() / Gaudi::Units::mm;
  // -- 1b.  Get data from calib stats
  float nPESUM = calibStatsHdr->getFloat("nPESUM");
  float nPERMS = calibStatsHdr->getFloat("nPERMS");

  // -- 2. Create and prepare user data header
  DayaBay::UserDataHeader* ge68Data = MakeHeaderObject();
  Context context = readoutHdr->context();
  context.SetDetId(DetectorId::kAll);
  ge68Data->setContext(context);
  ge68Data->setEarliest(readoutHdr->earliest());
  ge68Data->setLatest(readoutHdr->latest());

  // -- 3. Finally, put data into the user data header
  ge68Data->set("e_ge68",e_ge68); 
  ge68Data->set("x_ge68",x_ge68); 
  ge68Data->set("y_ge68",y_ge68); 
  ge68Data->set("z_ge68",z_ge68); 
  ge68Data->set("nPESUM_ge68",nPESUM); 
  ge68Data->set("nPERMS_ge68",nPERMS); 

//==============================
  return StatusCode::SUCCESS;
}
StatusCode Ge68Data::finalize ( ) [virtual]

Definition at line 35 of file Ge68Data.cc.

                              {
  return this->GaudiAlgorithm::finalize();
}
DayaBay::UserDataHeader * DybAlgorithm< DayaBay::UserDataHeader >::GetCurrentHeaderObject ( ) const [inherited]
virtual StatusCode DybAlgorithm< DayaBay::UserDataHeader >::sysInitialize ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::UserDataHeader >::sysExecute ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::UserDataHeader >::preExecute ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::UserDataHeader >::postExecute ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

virtual StatusCode DybAlgorithm< DayaBay::UserDataHeader >::sysFinalize ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

IDataProviderSvc * DybAlgorithm< DayaBay::UserDataHeader >::arcSvc ( ) const [inherited]

Reimplemented from DybBaseAlg.

void DybAlgorithm< DayaBay::UserDataHeader >::putTES ( DataObject *  obj,
std::string  location 
) const [inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::UserDataHeader >::getTES ( std::string  location) const [inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::UserDataHeader >::getAES ( std::string  location,
int  index 
) const [inherited]

Reimplemented from DybBaseAlg.

std::vector< DataObject * > DybAlgorithm< DayaBay::UserDataHeader >::getAEScollection ( std::string  location) const [inherited]

Reimplemented from DybBaseAlg.

int DybAlgorithm< DayaBay::UserDataHeader >::getExecNum ( ) [inherited]

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::UserDataHeader >::Location ( ) const [inherited]

Reimplemented from DybBaseAlg.

DayaBay::UserDataHeader * DybAlgorithm< DayaBay::UserDataHeader >::MakeHeaderObject ( ) [protected, inherited]
void DybAlgorithm< DayaBay::UserDataHeader >::InitializeHeader ( DayaBay::HeaderObject header) [protected, inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::UserDataHeader >::MakeHeader ( ) [protected, inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::UserDataHeader >::MakeHeader ( std::vector< const DayaBay::IHeader * > &  inputHeaders) [protected, inherited]

Reimplemented from DybBaseAlg.

TYPE * DybAlgorithm< DayaBay::UserDataHeader >::MakeHeader ( const DayaBay::IHeader referenceHeader) [protected, inherited]

Reimplemented from DybBaseAlg.

void DybAlgorithm< DayaBay::UserDataHeader >::AppendInputHeader ( const DayaBay::HeaderObject header) const [protected, inherited]

Reimplemented from DybBaseAlg.


Member Data Documentation

Reimplemented from DybBaseAlg.

Definition at line 32 of file Ge68Data.h.

std::string Ge68Data::m_readoutHeaderLocation [private]

Definition at line 34 of file Ge68Data.h.

std::string Ge68Data::m_calibStatsLocation [private]

Definition at line 35 of file Ge68Data.h.

std::string Ge68Data::m_Ge68Location [private]

Definition at line 36 of file Ge68Data.h.

Reimplemented from DybBaseAlg.

bool DybAlgorithm< DayaBay::UserDataHeader >::m_pullMode [protected, inherited]

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::UserDataHeader >::m_location [protected, inherited]

Reimplemented from DybBaseAlg.


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:10:08 for CalibrationTagging by doxygen 1.7.4