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

#include <DetTag.h>

Collaboration diagram for DetTag:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DetTag (const std::string &name, ISvcLocator *svcloc)
 Constructor has to be in this form.
virtual ~DetTag ()
StatusCode initialize ()
 Three mandatory member functions of any algorithm.
StatusCode execute ()
StatusCode finalize ()

Private Attributes

IJobInfoSvcm_jobInfoSvc

Detailed Description

Definition at line 12 of file DetTag.h.


Constructor & Destructor Documentation

DetTag::DetTag ( const std::string &  name,
ISvcLocator *  svcloc 
)

Constructor has to be in this form.

Definition at line 11 of file DetTag.cc.

: GaudiAlgorithm(name, svcloc)
{
}
DetTag::~DetTag ( ) [virtual]

Definition at line 16 of file DetTag.cc.

{
}

Member Function Documentation

StatusCode DetTag::initialize ( )

Three mandatory member functions of any algorithm.

Definition at line 20 of file DetTag.cc.

{
  debug() << "initialize()" << endreq;


  m_jobInfoSvc = svc<IJobInfoSvc>("JobInfoSvc",true);
  if(!m_jobInfoSvc) {
    error() << "Failed to initialize JobInfoSvc" << endreq;
    return StatusCode::FAILURE;
  }

  return StatusCode::SUCCESS;
}
StatusCode DetTag::execute ( )

Definition at line 34 of file DetTag.cc.

{
  debug() << "execute() ______________________________ start" << endreq;

  // Get ReadoutHeader from TES
  ReadoutHeader* roh = get<ReadoutHeader>("/Event/Readout/ReadoutHeader");


  // Make a new Header as a tag
  HeaderObject *header = new HeaderObject();
  // Use inputHeaders to record the ReadoutHeader which is connect to this tag
  vector<const IHeader*> inputHeaders;
  inputHeaders.push_back(roh);
  header->setInputHeaders(inputHeaders);
  // Copy from the ReadoutHeader
  header->setExecNumber(roh->execNumber());
  header->setContext(roh->context());
  header->setEarliest(roh->earliest());
  header->setLatest(roh->latest());
  // Get job id
  const DayaBay::JobId &m_currentJobId = m_jobInfoSvc->currentJobInfo()->jobId();
  header->setJobId(m_currentJobId);

  // Make different tag according to the detector's id
  DetectorId::DetectorId_t detectorId = roh->context().GetDetId();
  if(detectorId == DetectorId::kAD1 || detectorId == DetectorId::kAD2
      || detectorId == DetectorId::kAD3 || detectorId == DetectorId::kAD4) {
    // Register to TES, this is how a tag works
    put(header,"/Event/UserTag/Detector/AD");
  } else if(detectorId == DetectorId::kIWS || detectorId == DetectorId::kOWS) {
    put(header,"/Event/UserTag/Detector/WP");
  } else if(detectorId == DetectorId::kRPC) {
    put(header,"/Event/UserTag/Detector/RPC");
  } else {
    debug() << "Unknown detector of this Readout:" << detectorId << endreq;
    delete header;
  }

  debug() << "execute() ______________________________ end" << endreq;
  return StatusCode::SUCCESS;
}
StatusCode DetTag::finalize ( )

Definition at line 76 of file DetTag.cc.

{
  debug() << "finalize()" << endreq;

  return StatusCode::SUCCESS;
}

Member Data Documentation

Definition at line 25 of file DetTag.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:02:01 for UserTagging by doxygen 1.7.4