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

#include <TreeEsTimeCalibDataCnv.h>

Inheritance diagram for TreeEsTimeCalibDataCnv:

Public Member Functions

const CLID & objType () const
 TreeEsTimeCalibDataCnv (ISvcLocator *svc)
virtual ~TreeEsTimeCalibDataCnv ()
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< TreeEsTimeCalibDataCnv >

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 TreeEsTimeCalibDataCnv.h.

Constructor & Destructor Documentation

◆ TreeEsTimeCalibDataCnv()

TreeEsTimeCalibDataCnv::TreeEsTimeCalibDataCnv ( ISvcLocator * svc)

Definition at line 28 of file TreeEsTimeCalibDataCnv.cxx.

TreeCalBaseCnv(ISvcLocator *svc, const CLID &clid)

◆ ~TreeEsTimeCalibDataCnv()

virtual TreeEsTimeCalibDataCnv::~TreeEsTimeCalibDataCnv ( )
inlinevirtual

Definition at line 29 of file TreeEsTimeCalibDataCnv.h.

29{};

Member Function Documentation

◆ classID()

const CLID & TreeEsTimeCalibDataCnv::classID ( )
static

Definition at line 33 of file TreeEsTimeCalibDataCnv.cxx.

33{ return CLID_Calib_EsTimeCal; }

Referenced by CalibTreeCnvSvc::createConverter().

◆ i_createObj()

StatusCode TreeEsTimeCalibDataCnv::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 35 of file TreeEsTimeCalibDataCnv.cxx.

36 {
37
38 MsgStream log( msgSvc(), "TreeEsTimeCalibDataCnv" );
39 log << MSG::DEBUG << "SetProperty" << endmsg;
40 TreeAddress* add = dynamic_cast<TreeAddress*>( addr );
41 DatabaseRecord* records = add->pp();
42
43 TBufferFile* buf1 = new TBufferFile( TBuffer::kRead );
44 TBufferFile* buf2 = new TBufferFile( TBuffer::kRead );
45 buf1->SetBuffer( ( *records )["EsTimeH2"], 512000, kFALSE );
46 buf2->SetBuffer( ( *records )["EsTimeH9"], 512000, kFALSE );
47
48 std::cout << " SftVer is " << ( *records )["SftVer"];
49 std::cout << " CalVerSft is " << ( *records )["CalParVer"];
50 std::cout << " File name is " << ( *records )["FileName"] << std::endl;
51
52 TTree* Testtree = new TTree();
53
54 Testtree->Streamer( *buf1 );
55 TTree* tree2 = new TTree();
56 tree2->Streamer( *buf2 );
57
58 CalibData::EsTimeCalibData* tmpObject = new CalibData::EsTimeCalibData;
59 // Read in our object
60 int i;
61
62 // read TestCalibConst ------------------------------------------------------------
63 double EsTimeCalibConst;
64 vector<double> TestCalibConst;
65 Testtree->SetBranchAddress( "meant0", &EsTimeCalibConst );
66 int no = Testtree->GetEntries();
67 for ( i = 0; i < no; i++ )
68 {
69 Testtree->GetEntry( i );
70 TestCalibConst.push_back( EsTimeCalibConst );
71 }
72 tmpObject->setTestCalibConst( &TestCalibConst );
73
74 double t0offsete, t0offsetb;
75 int bunchtime, runFrom, runTo, eventFrom, eventTo;
76 tree2->SetBranchAddress( "t0offsete", &t0offsete );
77 tree2->SetBranchAddress( "t0offsetb", &t0offsetb );
78 tree2->SetBranchAddress( "bunchtime", &bunchtime );
79 if ( tree2->GetBranchStatus( "runFrom" ) )
80 {
81 tree2->SetBranchAddress( "runFrom", &runFrom );
82 tree2->SetBranchAddress( "runTo", &runTo );
83 tree2->SetBranchAddress( "eventFrom", &eventFrom );
84 tree2->SetBranchAddress( "eventTo", &eventTo );
85 }
86 else
87 {
88 runFrom = -1;
89 runTo = -1;
90 eventFrom = -1;
91 eventTo = -1;
92 }
93 no = tree2->GetEntries();
94 for ( i = 0; i < no; i++ )
95 {
96 tree2->GetEntry( i );
97 tmpObject->setToffsetb( t0offsetb );
98 tmpObject->setToffsete( t0offsete );
99 tmpObject->setBunchTime( bunchtime );
100 tmpObject->setRunFrom( runFrom );
101 tmpObject->setRunTo( runTo );
102 tmpObject->setEventFrom( eventFrom );
103 tmpObject->setEventTo( eventTo );
104 }
105
106 refpObject = tmpObject;
107
108 delete Testtree;
109 delete tree2;
110 return StatusCode::SUCCESS;
111}
IMessageSvc * msgSvc()
void setTestCalibConst(const vector< double > *TestCalibConst)
void setRunFrom(const int runFrom)
void setEventTo(const int eventTo)
void setToffsetb(const double toffsetb)
void setEventFrom(const int eventFrom)
void setBunchTime(const int bunchtime)
void setRunTo(const int runTo)
void setToffsete(const double toffsete)

◆ objType()

const CLID & TreeEsTimeCalibDataCnv::objType ( ) const

Definition at line 31 of file TreeEsTimeCalibDataCnv.cxx.

31{ return CLID_Calib_EsTimeCal; }

◆ repSvcType()

virtual long TreeEsTimeCalibDataCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file TreeEsTimeCalibDataCnv.h.

◆ CnvFactory< TreeEsTimeCalibDataCnv >

friend class CnvFactory< TreeEsTimeCalibDataCnv >
friend

Definition at line 1 of file TreeEsTimeCalibDataCnv.h.


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