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

EsDarkDetectorAlg. More...

#include <EsDarkDetectorAlg.h>

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

List of all members.

Public Member Functions

 EsDarkDetectorAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~EsDarkDetectorAlg ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
DayaBay::SimHeaderGetCurrentHeaderObject () 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::SimHeaderMakeHeaderObject ()
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

std::string m_simLocation
 Property SimLocation - location in TES where the input SimHeader is to be put.
std::vector< std::string > m_detectors
double m_simWindow
double m_simDeltaT
double m_simStartTime
TimeStamp m_currentTime

Detailed Description

EsDarkDetectorAlg.

Used to simulate dark noise with no actual physics events.

dandwyer@caltech.edu 2008/11/02

Definition at line 17 of file EsDarkDetectorAlg.h.


Constructor & Destructor Documentation

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

Definition at line 7 of file EsDarkDetectorAlg.cc.

  : DybAlgorithm<DayaBay::SimHeader>(name,pSvcLocator),
    m_detectors()
{
    declareProperty("SimLocation",m_simLocation=DayaBay::SimHeaderLocation::Default,
                    "Location in the TES where the input SimHeader is to be found.");
    declareProperty("Detectors",m_detectors,
                    "List of detectors to simulate");
    declareProperty("SimWindow",m_simWindow=0,
                    "Length of the simulation time window");
    declareProperty("SimDeltaT",m_simDeltaT=1.0*CLHEP::second,
                    "Time between each simulation cycle");
    declareProperty("SimStartTime",m_simStartTime=0.0,
                    "Starting timestamp of the simulation");
}
EsDarkDetectorAlg::~EsDarkDetectorAlg ( ) [virtual]

Definition at line 23 of file EsDarkDetectorAlg.cc.

{
}

Member Function Documentation

StatusCode EsDarkDetectorAlg::initialize ( ) [virtual]

Definition at line 27 of file EsDarkDetectorAlg.cc.

{
  m_currentTime = m_simStartTime;
  return StatusCode::SUCCESS;
}
StatusCode EsDarkDetectorAlg::execute ( ) [virtual]

Definition at line 33 of file EsDarkDetectorAlg.cc.

{
    // Create output header 
    DayaBay::SimHeader* simHeader = MakeHeaderObject();
    simHeader->setTimeStamp( m_currentTime );

    // Set the simulation time range
    // Add padding to ElecHeader time window
    TimeStamp earliest = m_currentTime;
    TimeStamp latest = m_currentTime;
    latest.Add(m_simWindow);
    simHeader->setEarliest(earliest);
    simHeader->setLatest(latest);
    Context context;
    context.SetSimFlag(SimFlag::kMC);
    context.SetTimeStamp(earliest);

    // Add the sim hit header
    DayaBay::SimHitHeader* hitHeader = 
      new DayaBay::SimHitHeader(simHeader);
    simHeader->setHits(hitHeader);
    DayaBay::SimHitCollection::hit_container hits;

    bool firstDetector = true;
    // Loop over detectors and add an empty sim hit collection for each detector
    std::vector<std::string>::const_iterator detIter, end = 
      m_detectors.end();
    for(detIter = m_detectors.begin(); detIter != end; detIter++){
      DayaBay::Detector detector 
        = DayaBay::Detector::siteDetPackedFromString(*detIter);
      hitHeader->addHitCollection(
                      new DayaBay::SimHitCollection(hitHeader,detector,hits));

      // Reset context if needed
      if(firstDetector){
        // Keep track of sites/detectors in this simulation for context
        context.SetSite(detector.site());
        context.SetDetId(detector.detectorId());
        firstDetector = false;
      }
      if(context.GetSite() != detector.site()){
        // Simulation contains multiple sites, unset
        context.SetSite(Site::kUnknown);
      }
      if(context.GetDetId() != detector.detectorId()){
        // Simulation contains multiple detectors, unset
        context.SetDetId(DetectorId::kUnknown);
      }
    }
    simHeader->setContext(context);

    m_currentTime.Add(m_simDeltaT / CLHEP::second);
    return StatusCode::SUCCESS;
}
StatusCode EsDarkDetectorAlg::finalize ( ) [virtual]

Definition at line 88 of file EsDarkDetectorAlg.cc.

{
    return StatusCode::SUCCESS;
}
DayaBay::SimHeader * DybAlgorithm< DayaBay::SimHeader >::GetCurrentHeaderObject ( ) const [inherited]
virtual StatusCode DybAlgorithm< DayaBay::SimHeader >::sysInitialize ( ) [virtual, inherited]

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.


Member Data Documentation

std::string EsDarkDetectorAlg::m_simLocation [private]

Property SimLocation - location in TES where the input SimHeader is to be put.

Default is DayaBay::SimHeader::Default

Definition at line 35 of file EsDarkDetectorAlg.h.

std::vector<std::string> EsDarkDetectorAlg::m_detectors [private]

Definition at line 38 of file EsDarkDetectorAlg.h.

Definition at line 40 of file EsDarkDetectorAlg.h.

Definition at line 42 of file EsDarkDetectorAlg.h.

Definition at line 44 of file EsDarkDetectorAlg.h.

Definition at line 46 of file EsDarkDetectorAlg.h.

Reimplemented from DybBaseAlg.

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

Reimplemented from DybBaseAlg.

std::string DybAlgorithm< DayaBay::SimHeader >::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:16:37 for ElecSim by doxygen 1.7.4