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

#include <MuonData.h>

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

List of all members.

Public Member Functions

 MuonData (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~MuonData ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
void recordPreviousMuon (const std::vector< const DayaBay::IHeader * > calibstat_headers)
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_calibStatsLocation
std::string m_muonAllLocation

Detailed Description

Definition at line 15 of file MuonData.h.


Constructor & Destructor Documentation

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

Definition at line 16 of file MuonData.cc.

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

  declareProperty("CalibStatsLocation", m_calibStatsLocation="/Event/Data/CalibStats",
                  "Location of the CalibStats User data");
  declareProperty("MuonAllLocation", m_muonAllLocation="/Event/Tag/Physics/MuonLoose",
                  "Location of the MuonAll tag");
}
MuonData::~MuonData ( ) [virtual]

Definition at line 26 of file MuonData.cc.

                    {
}

Member Function Documentation

StatusCode MuonData::initialize ( ) [virtual]

Definition at line 29 of file MuonData.cc.

                                {
  StatusCode sc = this->GaudiAlgorithm::initialize();
  if(sc.isFailure()) return sc;
  return StatusCode::SUCCESS;
}
StatusCode MuonData::execute ( ) [virtual]

Definition at line 39 of file MuonData.cc.

                             {
  
  StatusCode sc = StatusCode::SUCCESS;

  DayaBay::HeaderObject *muonTag = 0; 
  std::vector<const DayaBay::IHeader*> calibstat_headers; 

  if (exist<DayaBay::HeaderObject>(evtSvc(), m_muonAllLocation)) {
    muonTag = get<DayaBay::HeaderObject>(m_muonAllLocation); 
    calibstat_headers = muonTag->findHeaders(m_calibStatsLocation); 
    this->recordPreviousMuon(calibstat_headers);
  }
  
  return sc;
}
StatusCode MuonData::finalize ( ) [virtual]

Definition at line 35 of file MuonData.cc.

                              {
  return this->GaudiAlgorithm::finalize();
}
void MuonData::recordPreviousMuon ( const std::vector< const DayaBay::IHeader * >  calibstat_headers)

Definition at line 55 of file MuonData.cc.

                                                                                          {

  if (calibstat_headers.size()<1) return;

  DayaBay::UserDataHeader* muonData = MakeHeaderObject();

  DayaBay::UserDataHeader *muonCalibStatsHdr = const_cast<DayaBay::UserDataHeader*>(dynamic_cast<const DayaBay::UserDataHeader*>(calibstat_headers[0]));
  Context context = muonCalibStatsHdr->context();
  context.SetDetId(DetectorId::kAll);
  
  muonData->setContext(context);
  muonData->setEarliest(muonCalibStatsHdr->earliest());
  muonData->setLatest(muonCalibStatsHdr->latest());

  TimeStamp muonTimeStamp = muonCalibStatsHdr->timeStamp();

  muonData->set("tMu_s", static_cast<int>(muonTimeStamp.GetSec()));
  muonData->set("tMu_ns", muonTimeStamp.GetNanoSec());

  int default_int = -1;
  float default_float = -1.0;
  
  muonData->set("hitAD1", default_int);
  muonData->set("triggerNumber_AD1", default_int);
  muonData->set("calib_nPESum_AD1", default_float);
  muonData->set("calib_nHit_AD1", default_int);

  muonData->set("hitAD2", default_int);
  muonData->set("triggerNumber_AD2", default_int);
  muonData->set("calib_nPESum_AD2", default_float);
  muonData->set("calib_nHit_AD2", default_int);

  muonData->set("hitAD3", default_int);
  muonData->set("triggerNumber_AD3", default_int);
  muonData->set("calib_nPESum_AD3", default_float);
  muonData->set("calib_nHit_AD3", default_int);

  muonData->set("hitAD4", default_int);
  muonData->set("triggerNumber_AD4", default_int);
  muonData->set("calib_nPESum_AD4", default_float);
  muonData->set("calib_nHit_AD4", default_int);

  muonData->set("hitIWS", default_int);
  muonData->set("triggerNumber_IWS", default_int);
  muonData->set("calib_nPESum_IWS", default_float);
  muonData->set("calib_nHit_IWS", default_int);

  muonData->set("hitOWS", default_int);
  muonData->set("triggerNumber_OWS", default_int);
  muonData->set("calib_nPESum_OWS", default_float);
  muonData->set("calib_nHit_OWS", default_int);

  muonData->set("hitRPC", default_int);
  muonData->set("triggerNumber_RPC", default_int);
  muonData->set("calib_nPESum_RPC", default_float);
  muonData->set("calib_nHit_RPC", default_int);

  for (unsigned int ihdr = 0; ihdr<calibstat_headers.size(); ihdr++) {

    DayaBay::UserDataHeader *muonCalibStatsHdr = const_cast<DayaBay::UserDataHeader*>(dynamic_cast<const DayaBay::UserDataHeader*>(calibstat_headers[ihdr]));
    
    Context context = muonCalibStatsHdr->context();
    DetectorId::DetectorId_t detectorId = context.GetDetId();
    
    int triggerNumber = muonCalibStatsHdr->getInt("triggerNumber");
    float nPESumPrompt = muonCalibStatsHdr->getFloat("NominalCharge");
    int nHitPrompt = muonCalibStatsHdr->getInt("nHit");
    
    if (detectorId == DetectorId::kAD1) {
      muonData->set("hitAD1", 1);
      muonData->set("triggerNumber_AD1", triggerNumber);
      muonData->set("calib_nPESum_AD1", nPESumPrompt);
      muonData->set("calib_nHit_AD1", nHitPrompt);
    } else if (detectorId == DetectorId::kAD2) {
      muonData->set("hitAD2", 1);
      muonData->set("triggerNumber_AD2", triggerNumber);
      muonData->set("calib_nPESum_AD2", nPESumPrompt);
      muonData->set("calib_nHit_AD2", nHitPrompt);
    } else if (detectorId == DetectorId::kAD3) {
      muonData->set("hitAD3", 1);
      muonData->set("triggerNumber_AD3", triggerNumber);
      muonData->set("calib_nPESum_AD3", nPESumPrompt);
      muonData->set("calib_nHit_AD3", nHitPrompt);
    } else if (detectorId == DetectorId::kAD4) {
      muonData->set("hitAD4", 1);
      muonData->set("triggerNumber_AD4", triggerNumber);
      muonData->set("calib_nPESum_AD4", nPESumPrompt);
      muonData->set("calib_nHit_AD4", nHitPrompt);
    } else if (detectorId == DetectorId::kIWS) {
      muonData->set("hitIWS", 1);
      muonData->set("triggerNumber_IWS", triggerNumber);
      muonData->set("calib_nPESum_IWS", nPESumPrompt);
      muonData->set("calib_nHit_IWS", nHitPrompt);
    } else if (detectorId == DetectorId::kOWS) {
      muonData->set("hitOWS", 1);
      muonData->set("triggerNumber_OWS", triggerNumber);
      muonData->set("calib_nPESum_OWS", nPESumPrompt);
      muonData->set("calib_nHit_OWS", nHitPrompt);
    } else if (detectorId == DetectorId::kRPC) {
      muonData->set("hitRPC", 1);
      muonData->set("triggerNumber_RPC", triggerNumber);
    }
  }
}
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 28 of file MuonData.h.

std::string MuonData::m_calibStatsLocation [private]

Definition at line 30 of file MuonData.h.

std::string MuonData::m_muonAllLocation [private]

Definition at line 31 of file MuonData.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:28 for MuonTagging by doxygen 1.7.4