Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEventSourceREST Class Reference

Implements JEventSource for REST files. More...

#include <DEventSourceREST.h>

+ Inheritance diagram for DEventSourceREST:

Public Member Functions

 DEventSourceREST (const char *source_name)
 
virtual ~DEventSourceREST ()
 
virtual const char * className (void)
 
jerror_t GetEvent (JEvent &event)
 
void FreeEvent (JEvent &event)
 
jerror_t GetObjects (JEvent &event, JFactory_base *factory)
 
jerror_t Extract_DMCReaction (hddm_r::HDDM *record, JFactory< DMCReaction > *factory, JEventLoop *locEventLoop)
 
jerror_t Extract_DRFTime (hddm_r::HDDM *record, JFactory< DRFTime > *factory, JEventLoop *locEventLoop)
 
jerror_t Extract_DBeamPhoton (hddm_r::HDDM *record, JFactory< DBeamPhoton > *factory, JEventLoop *eventLoop)
 
jerror_t Extract_DMCThrown (hddm_r::HDDM *record, JFactory< DMCThrown > *factory)
 
jerror_t Extract_DSCHit (hddm_r::HDDM *record, JFactory< DSCHit > *factory)
 
jerror_t Extract_DTOFPoint (hddm_r::HDDM *record, JFactory< DTOFPoint > *factory)
 
jerror_t Extract_DFCALShower (hddm_r::HDDM *record, JFactory< DFCALShower > *factory)
 
jerror_t Extract_DBCALShower (hddm_r::HDDM *record, JFactory< DBCALShower > *factory)
 
jerror_t Extract_DTrackTimeBased (hddm_r::HDDM *record, JFactory< DTrackTimeBased > *factory, JEventLoop *locEventLoop)
 
jerror_t Extract_DTrigger (hddm_r::HDDM *record, JFactory< DTrigger > *factory)
 
jerror_t Extract_DDetectorMatches (JEventLoop *locEventLoop, hddm_r::HDDM *record, JFactory< DDetectorMatches > *factory)
 
jerror_t Extract_DDIRCPmtHit (hddm_r::HDDM *record, JFactory< DDIRCPmtHit > *factory, JEventLoop *locEventLoop)
 
void Get7x7ErrorMatrix (double mass, const double vec[5], const TMatrixFSym *C5x5, TMatrixFSym *loc7x7ErrorMatrix)
 

Static Public Member Functions

static const char * static_className (void)
 

Private Types

enum  dirc_status_state { GOOD, BAD, NOISY }
 

Private Member Functions

uint32_t Convert_SignedIntToUnsigned (int32_t locSignedInt) const
 

Private Attributes

bool USE_CCDB_BCAL_COVARIANCE
 
bool USE_CCDB_FCAL_COVARIANCE
 
bool PRUNE_DUPLICATE_TRACKS
 
bool RECO_DIRC_CALC_LUT
 
int dDIRCMaxChannels
 
map< unsigned int, vector
< vector< int > > > 
dDIRCChannelStatusMap
 
DFCALShower_factorydFCALShowerFactory
 
DBCALShower_factory_IUdBCALShowerFactory
 
map< unsigned int, double > dTargetCenterZMap
 
map< unsigned int, double > dBeamBunchPeriodMap
 
std::ifstream * ifs
 
hddm_r::istream * fin
 

Static Private Attributes

static thread_local shared_ptr
< DResourcePool< TMatrixFSym > > 
dResourcePool_TMatrixFSym = std::make_shared<DResourcePool<TMatrixFSym>>(10, 10, 50)
 

Detailed Description

Implements JEventSource for REST files.

Definition at line 47 of file DEventSourceREST.h.

Member Enumeration Documentation

Enumerator
GOOD 
BAD 
NOISY 

Definition at line 106 of file DEventSourceREST.h.

Constructor & Destructor Documentation

DEventSourceREST::DEventSourceREST ( const char *  source_name)

Constructor for DEventSourceREST object

Definition at line 24 of file DEventSourceREST.cc.

References dDIRCMaxChannels, fin, ifs, PRUNE_DUPLICATE_TRACKS, and RECO_DIRC_CALC_LUT.

DEventSourceREST::~DEventSourceREST ( )
virtual

Definition at line 53 of file DEventSourceREST.cc.

References fin, and ifs.

Member Function Documentation

virtual const char* DEventSourceREST::className ( void  )
inlinevirtual

Definition at line 52 of file DEventSourceREST.h.

References static_className().

uint32_t DEventSourceREST::Convert_SignedIntToUnsigned ( int32_t  locSignedInt) const
private

Definition at line 1453 of file DEventSourceREST.cc.

References min.

Referenced by Extract_DTrigger().

jerror_t DEventSourceREST::Extract_DBCALShower ( hddm_r::HDDM *  record,
JFactory< DBCALShower > *  factory 
)

Copies the data from the bcalShower hddm record. This is call from JEventSourceREST::GetObjects. If factory is NULL, this returns OBJECT_NOT_AVAILABLE immediately.

Definition at line 863 of file DEventSourceREST.cc.

References DBCALShower::E, DBCALShower::E_preshower, DBCALShower::E_raw, DBCALShower::ExyztCovariance, DBCALShower::Q, DBCALShower::t, DBCALShower::x, DBCALShower::y, and DBCALShower::z.

Referenced by GetObjects().

jerror_t DEventSourceREST::Extract_DBeamPhoton ( hddm_r::HDDM *  record,
JFactory< DBeamPhoton > *  factory,
JEventLoop *  eventLoop 
)

This is called from JEventSourceREST::GetObjects. If factory is NULL, return OBJECT_NOT_AVAILABLE immediately. If factory tag="MCGEN" then copy the beam photon data from the Reaction hddm class.

Definition at line 454 of file DEventSourceREST.cc.

References DBeamPhoton::dCounter, dResourcePool_TMatrixFSym, DBeamPhoton::dSystem, dTargetCenterZMap, DTAGMGeometry::E_to_column(), DTAGHGeometry::E_to_counter(), DKinematicData::energy(), Gamma, DKinematicData::setErrorMatrix(), DKinematicData::setMomentum(), DKinematicData::setPID(), DKinematicData::setPosition(), DKinematicData::setTime(), SYS_NULL, SYS_TAGH, and SYS_TAGM.

Referenced by GetObjects().

jerror_t DEventSourceREST::Extract_DDetectorMatches ( JEventLoop *  locEventLoop,
hddm_r::HDDM *  record,
JFactory< DDetectorMatches > *  factory 
)

Copies the data from the detectorMatches hddm record. This is called from JEventSourceREST::GetObjects. If factory is NULL, this returns OBJECT_NOT_AVAILABLE immediately.

Definition at line 1199 of file DEventSourceREST.cc.

References DDetectorMatches::Add_Match(), DDIRCLut::CalcLUT(), DParticleID::Get_DIRCLut(), DDetectorMatches::Get_DIRCTrackMatchParamsMap(), RECO_DIRC_CALC_LUT, DDetectorMatches::Set_DistanceToNearestTrack(), and DDetectorMatches::Set_FlightTimePCorrelation().

Referenced by GetObjects().

jerror_t DEventSourceREST::Extract_DDIRCPmtHit ( hddm_r::HDDM *  record,
JFactory< DDIRCPmtHit > *  factory,
JEventLoop *  locEventLoop 
)

Copies the data from the fcalShower hddm record. This is call from JEventSourceREST::GetObjects. If factory is NULL, this returns OBJECT_NOT_AVAILABLE immediately.

Definition at line 1470 of file DEventSourceREST.cc.

References BAD, dDIRCChannelStatusMap, dDIRCMaxChannels, NOISY, DDIRCPmtHit::setChannel(), DDIRCPmtHit::setTime(), and DDIRCPmtHit::setTOT().

Referenced by GetObjects().

jerror_t DEventSourceREST::Extract_DFCALShower ( hddm_r::HDDM *  record,
JFactory< DFCALShower > *  factory 
)

Copies the data from the fcalShower hddm record. This is call from JEventSourceREST::GetObjects. If factory is NULL, this returns OBJECT_NOT_AVAILABLE immediately.

Definition at line 776 of file DEventSourceREST.cc.

References DFCALShower::ExyztCovariance, DFCALShower::setDocaTrack(), DFCALShower::setE1E9(), DFCALShower::setE9E25(), DFCALShower::setEnergy(), DFCALShower::setNumBlocks(), DFCALShower::setPosition(), DFCALShower::setSumU(), DFCALShower::setSumV(), DFCALShower::setTime(), and DFCALShower::setTimeTrack().

Referenced by GetObjects().

jerror_t DEventSourceREST::Extract_DMCReaction ( hddm_r::HDDM *  record,
JFactory< DMCReaction > *  factory,
JEventLoop *  locEventLoop 
)

Copies the data from the Reaction hddm class. This is called from JEventSourceREST::GetObjects. If factory is NULL, this returns OBJECT_NOT_AVAILABLE immediately.

Definition at line 312 of file DEventSourceREST.cc.

References DMCReaction::beam, dTargetCenterZMap, Gamma, DKinematicData::setMomentum(), DKinematicData::setPID(), DKinematicData::setPosition(), DKinematicData::setTime(), string, DMCReaction::target, DMCReaction::type, and DMCReaction::weight.

Referenced by GetObjects().

jerror_t DEventSourceREST::Extract_DMCThrown ( hddm_r::HDDM *  record,
JFactory< DMCThrown > *  factory 
)

Copies the data from the hddm vertex records. This is called from JEventSourceREST::GetObjects. If factory is NULL, this returns OBJECT_NOT_AVAILABLE immediately.

Definition at line 579 of file DEventSourceREST.cc.

References DMCThrown::mech, DMCThrown::myid, DMCThrown::parentid, PDGtoPType(), DMCThrown::pdgtype, py, DKinematicData::setMomentum(), DKinematicData::setPID(), DKinematicData::setPosition(), DKinematicData::setTime(), sqrt(), and DMCThrown::type.

Referenced by GetObjects().

jerror_t DEventSourceREST::Extract_DRFTime ( hddm_r::HDDM *  record,
JFactory< DRFTime > *  factory,
JEventLoop *  locEventLoop 
)

Definition at line 372 of file DEventSourceREST.cc.

References dBeamBunchPeriodMap, DRFTime::dTime, and DRFTime::dTimeVariance.

Referenced by GetObjects().

jerror_t DEventSourceREST::Extract_DSCHit ( hddm_r::HDDM *  record,
JFactory< DSCHit > *  factory 
)

Copies the data from the startHit hddm record. This is called from JEventSourceREST::GetObjects. If factory is NULL, this returns OBJECT_NOT_AVAILABLE immediately.

Definition at line 704 of file DEventSourceREST.cc.

References DSCHit::dE, DSCHit::sector, and DSCHit::t.

Referenced by GetObjects().

jerror_t DEventSourceREST::Extract_DTOFPoint ( hddm_r::HDDM *  record,
JFactory< DTOFPoint > *  factory 
)

Copies the data from the tofPoint hddm record. This is called from JEventSourceREST::GetObjects. If factory is NULL, this returns OBJECT_NOT_AVAILABLE immediately.

Definition at line 641 of file DEventSourceREST.cc.

References DTOFPoint::dE, DTOFPoint::dHorizontalBar, DTOFPoint::dHorizontalBarStatus, DTOFPoint::dVerticalBar, DTOFPoint::dVerticalBarStatus, DTOFPoint::pos, DTOFPoint::t, and DTOFPoint::tErr.

Referenced by GetObjects().

jerror_t DEventSourceREST::Extract_DTrigger ( hddm_r::HDDM *  record,
JFactory< DTrigger > *  factory 
)

Copies the data from the trigger hddm record. This is call from JEventSourceREST::GetObjects. If factory is NULL, this returns OBJECT_NOT_AVAILABLE immediately.

Definition at line 741 of file DEventSourceREST.cc.

References Convert_SignedIntToUnsigned(), DTrigger::Set_L1FrontPanelTriggerBits(), and DTrigger::Set_L1TriggerBits().

Referenced by GetObjects().

void DEventSourceREST::FreeEvent ( JEvent &  event)

Definition at line 184 of file DEventSourceREST.cc.

void DEventSourceREST::Get7x7ErrorMatrix ( double  mass,
const double  vec[5],
const TMatrixFSym *  C5x5,
TMatrixFSym *  loc7x7ErrorMatrix 
)

Definition at line 1415 of file DEventSourceREST.cc.

References sin().

Referenced by Extract_DTrackTimeBased().

jerror_t DEventSourceREST::GetEvent ( JEvent &  event)

Implementation of JEventSource virtual function

Definition at line 66 of file DEventSourceREST.cc.

References _DBG__, e, fin, ifs, kSTATUS_FROM_FILE, kSTATUS_PHYSICS_EVENT, and kSTATUS_REST.

jerror_t DEventSourceREST::GetObjects ( JEvent &  event,
JFactory_base *  factory 
)

This gets called through the virtual method of the JEventSource base class. It creates the objects of the type on which factory is based. It uses the HDDM_Element object kept in the ref field of the JEvent object passed.

Definition at line 193 of file DEventSourceREST.cc.

References dapp, dBeamBunchPeriodMap, dDIRCChannelStatusMap, dDIRCMaxChannels, dTargetCenterZMap, Extract_DBCALShower(), Extract_DBeamPhoton(), Extract_DDetectorMatches(), Extract_DDIRCPmtHit(), Extract_DFCALShower(), Extract_DMCReaction(), Extract_DMCThrown(), Extract_DRFTime(), Extract_DSCHit(), Extract_DTOFPoint(), Extract_DTrackTimeBased(), Extract_DTrigger(), DApplication::GetDGeometry(), DGeometry::GetTargetZ(), and RECO_DIRC_CALC_LUT.

static const char* DEventSourceREST::static_className ( void  )
inlinestatic

Definition at line 55 of file DEventSourceREST.h.

Referenced by className().

Member Data Documentation

DBCALShower_factory_IU* DEventSourceREST::dBCALShowerFactory
private

Definition at line 110 of file DEventSourceREST.h.

map<unsigned int, double> DEventSourceREST::dBeamBunchPeriodMap
private

Definition at line 113 of file DEventSourceREST.h.

Referenced by Extract_DRFTime(), and GetObjects().

map<unsigned int, vector<vector<int> > > DEventSourceREST::dDIRCChannelStatusMap
private

Definition at line 107 of file DEventSourceREST.h.

Referenced by Extract_DDIRCPmtHit(), and GetObjects().

int DEventSourceREST::dDIRCMaxChannels
private

Definition at line 105 of file DEventSourceREST.h.

Referenced by DEventSourceREST(), Extract_DDIRCPmtHit(), and GetObjects().

DFCALShower_factory* DEventSourceREST::dFCALShowerFactory
private

Definition at line 109 of file DEventSourceREST.h.

thread_local std::shared_ptr< DResourcePool< TMatrixFSym > > DEventSourceREST::dResourcePool_TMatrixFSym = std::make_shared<DResourcePool<TMatrixFSym>>(10, 10, 50)
staticprivate

Definition at line 114 of file DEventSourceREST.h.

Referenced by Extract_DBeamPhoton(), and Extract_DTrackTimeBased().

map<unsigned int, double> DEventSourceREST::dTargetCenterZMap
private

Definition at line 112 of file DEventSourceREST.h.

Referenced by Extract_DBeamPhoton(), Extract_DMCReaction(), and GetObjects().

hddm_r::istream* DEventSourceREST::fin
private

Definition at line 117 of file DEventSourceREST.h.

Referenced by DEventSourceREST(), GetEvent(), and ~DEventSourceREST().

std::ifstream* DEventSourceREST::ifs
private

Definition at line 116 of file DEventSourceREST.h.

Referenced by DEventSourceREST(), GetEvent(), and ~DEventSourceREST().

bool DEventSourceREST::PRUNE_DUPLICATE_TRACKS
private

Definition at line 103 of file DEventSourceREST.h.

Referenced by DEventSourceREST(), and Extract_DTrackTimeBased().

bool DEventSourceREST::RECO_DIRC_CALC_LUT
private

Definition at line 104 of file DEventSourceREST.h.

Referenced by DEventSourceREST(), Extract_DDetectorMatches(), and GetObjects().

bool DEventSourceREST::USE_CCDB_BCAL_COVARIANCE
private

Definition at line 100 of file DEventSourceREST.h.

bool DEventSourceREST::USE_CCDB_FCAL_COVARIANCE
private

Definition at line 101 of file DEventSourceREST.h.


The documentation for this class was generated from the following files: