BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TreeInjSigTimeCnv Class Reference

#include <TreeInjSigTimeCnv.h>

Inheritance diagram for TreeInjSigTimeCnv:

Public Member Functions

const CLID & objType () const
 TreeInjSigTimeCnv (ISvcLocator *svc)
virtual ~TreeInjSigTimeCnv ()
virtual long repSvcType () const
Public Member Functions inherited from TreeCalBaseCnv
virtual ~TreeCalBaseCnv ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&refpObject)
ICalibTreeSvcgetCalibTreeSvc ()
 TreeCalBaseCnv (ISvcLocator *svc, const CLID &clid)
virtual StatusCode createRoot (const std::string &fname, CalibData::CalibBase1 *pTDSObj)
Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
destinationoperator (const source &) const
destinationoperator (const source &) const

Static Public Member Functions

static const CLID & classID ()
Static Public Member Functions inherited from TreeCalBaseCnv
static const unsigned char storageType ()

Protected Member Functions

virtual StatusCode i_createObj (IOpaqueAddress *address, DataObject *&refpObject)
Protected Member Functions inherited from TreeCalBaseCnv
virtual StatusCode internalCreateObj (DataObject *&refpObject, IOpaqueAddress *address)
virtual StatusCode i_processObj (DataObject *pObject, IOpaqueAddress *address)
 In case there is additional work to do on the created object.
virtual StatusCode fillRoot (CalibData::CalibBase *pTDSObj, TObject *pRootObj)
void setBaseInfo (CalibData::CalibBase1 *pObj)
 Another utility for derived classes to use.
Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0
virtual destinationconvert (const source &) const =0

Friends

class CnvFactory< TreeInjSigTimeCnv >

Additional Inherited Members

Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
typedef Ty2 destination
typedef Ty1 source
typedef Ty2 destination
typedef Ty1 source
typedef Ty2 destination
Protected Attributes inherited from TreeCalBaseCnv
ICalibTreeSvcm_treeSvc
ICalibMetaCnvSvcm_metaSvc
IInstrumentNamem_instrSvc
int m_serNo
int m_runfrm
int m_runto
TFile * m_outFile
TTree * m_ttree
TFile * m_inFile
TDirectory * m_saveDir

Detailed Description

Base class for CAL calibration converters from Ttrees to TCDS. All such converters need to do certain things, which are handled here. Methods common to all calibrations are in the base class TreeCalBaseCnv

Author
huang bin

Definition at line 20 of file TreeInjSigTimeCnv.h.

Constructor & Destructor Documentation

◆ TreeInjSigTimeCnv()

TreeInjSigTimeCnv::TreeInjSigTimeCnv ( ISvcLocator * svc)

Definition at line 26 of file TreeInjSigTimeCnv.cxx.

TreeCalBaseCnv(ISvcLocator *svc, const CLID &clid)

◆ ~TreeInjSigTimeCnv()

virtual TreeInjSigTimeCnv::~TreeInjSigTimeCnv ( )
inlinevirtual

Definition at line 29 of file TreeInjSigTimeCnv.h.

29{};

Member Function Documentation

◆ classID()

const CLID & TreeInjSigTimeCnv::classID ( )
static

Definition at line 31 of file TreeInjSigTimeCnv.cxx.

31{ return CLID_Calib_InjSigTime; }

Referenced by CalibTreeCnvSvc::createConverter().

◆ i_createObj()

StatusCode TreeInjSigTimeCnv::i_createObj ( IOpaqueAddress * address,
DataObject *& refpObject )
protectedvirtual

This creates the transient representation of an object from the corresponding ROOT object. This actually does the "new" operation and deals with the attributes of the node. This base class implementation does nothing; it should not normally be called because it doesn't correspond to any TCDS class. Instead, i_createObj of some derived class will be called.

Parameters
fnameThe ROOT file to be read in to be used to builds the object
refpObjectthe object to be built
Returns
status depending on the completion of the call

Reimplemented from TreeCalBaseCnv.

Definition at line 33 of file TreeInjSigTimeCnv.cxx.

33 {
34
35 MsgStream log( msgSvc(), "TreeInjSigTimeCnv" );
36 log << MSG::DEBUG << "SetProperty" << endmsg;
37 TreeAddress* add = dynamic_cast<TreeAddress*>( addr );
38 DatabaseRecord* records = add->pp();
39
40 TBufferFile* buf1 = new TBufferFile( TBuffer::kRead );
41 buf1->SetBuffer( ( *records )["ist"], 51200000, kFALSE );
42
43 std::cout << " SftVer is " << ( *records )["SftVer"];
44 std::cout << " CalVerSft is " << ( *records )["CalParVer"];
45 std::cout << " File name is " << ( *records )["FileName"] << std::endl;
46
47 TTree* tree = new TTree();
48 tree->Streamer( *buf1 );
49
50 CalibData::InjSigTimeCal* tmpObject = new CalibData::InjSigTimeCal;
51 // Read in our object
52 int i, no;
53
54 // read TestCalibConst ------------------------------------------------------------
55
56 ULong64_t IST;
57 int flag;
58 tree->SetBranchAddress( "flag", &flag );
59 tree->SetBranchAddress( "IST", &IST );
60
61 no = tree->GetEntries();
62 tmpObject->setNpar( no );
63 for ( i = 0; i < no; i++ )
64 {
65 tree->GetEntry( i );
66 tmpObject->setFlag( flag );
67 tmpObject->setIST( IST );
68 }
69
70 refpObject = tmpObject;
71
72 delete tree;
73 return StatusCode::SUCCESS;
74}
IMessageSvc * msgSvc()
void setIST(const ULong64_t Ist)
void setFlag(const int flag)

◆ objType()

const CLID & TreeInjSigTimeCnv::objType ( ) const

Definition at line 29 of file TreeInjSigTimeCnv.cxx.

29{ return CLID_Calib_InjSigTime; }

◆ repSvcType()

virtual long TreeInjSigTimeCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file TreeInjSigTimeCnv.h.

◆ CnvFactory< TreeInjSigTimeCnv >

friend class CnvFactory< TreeInjSigTimeCnv >
friend

Definition at line 1 of file TreeInjSigTimeCnv.h.


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