BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
RootCorrectedETSCnv Class Reference

#include <RootCorrectedETSCnv.h>

+ Inheritance diagram for RootCorrectedETSCnv:

Public Member Functions

const CLID & objType () const
 
 RootCorrectedETSCnv (ISvcLocator *svc)
 
virtual ~RootCorrectedETSCnv ()
 
virtual StatusCode createRoot (const std::string &fname, CalibData::CalibBase1 *pTDSObj)
 
virtual long repSvcType () const
 
- Public Member Functions inherited from RootCalBaseCnv
virtual ~RootCalBaseCnv ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&refpObject)
 
ICalibRootSvcgetCalibRootSvc ()
 
 RootCalBaseCnv (ISvcLocator *svc, const CLID &clid)
 
virtual StatusCode createRoot (const std::string &fname, CalibData::CalibBase1 *pTDSObj)
 
virtual StatusCode readRootObj (const std::string &treename, const std::string &branch, TObject *&pCalib, unsigned index=0)
 
virtual StatusCode readRootObj (TTree *tree, const std::string &branch, TObject *&pCalib, unsigned index=0)
 
- Public Member Functions inherited from Converter< Ty1, Ty2 >
destinationoperator (const source &) const
 

Static Public Member Functions

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

Protected Member Functions

virtual StatusCode i_createObj (const std::string &fname, DataObject *&refpObject)
 
- Protected Member Functions inherited from RootCalBaseCnv
virtual StatusCode internalCreateObj (const std::string &fname, DataObject *&refpObject, IOpaqueAddress *address)
 
virtual StatusCode i_createObj (const std::string &fname, DataObject *&refpObject)
 
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)
 
virtual StatusCode openWrite (const std::string &fname)
 
StatusCode closeWrite ()
 
StatusCode openRead (const std::string &fname)
 
StatusCode closeRead ()
 
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
 

Friends

class CnvFactory< RootCorrectedETSCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from RootCalBaseCnv
ICalibRootSvcm_rootSvc
 
ICalibMetaCnvSvcm_metaSvc
 
IInstrumentNamem_instrSvc
 
int m_serNo
 
ITime * m_vstart
 
ITime * m_vend
 
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 ROOT files to TCDS. All such converters need to do certain things, which are handled here. Methods common to all calibrations are in the base class RootCalBaseCnv

Author
J. Bogart

Definition at line 21 of file RootCorrectedETSCnv.h.

Constructor & Destructor Documentation

◆ RootCorrectedETSCnv()

RootCorrectedETSCnv::RootCorrectedETSCnv ( ISvcLocator *  svc)

Definition at line 27 of file RootCorrectedETSCnv.cxx.

27 :
29
30}
const CLID CLID_Calib_CorrectedETS
Definition: CalibModel.h:71

◆ ~RootCorrectedETSCnv()

virtual RootCorrectedETSCnv::~RootCorrectedETSCnv ( )
inlinevirtual

Definition at line 30 of file RootCorrectedETSCnv.h.

30{};

Member Function Documentation

◆ classID()

const CLID & RootCorrectedETSCnv::classID ( )
static

Definition at line 37 of file RootCorrectedETSCnv.cxx.

37 {
39}

◆ createRoot()

StatusCode RootCorrectedETSCnv::createRoot ( const std::string &  fname,
CalibData::CalibBase1 pTDSObj 
)
virtual

Create ROOT file corresponding to TDS object input.
Default implementation is to return an error. Must be separately implemented for each calibration type.

Parameters
fnameFilename for output file
pTDSObjPointer to tds object to be converted

Reimplemented from RootCalBaseCnv.

Definition at line 89 of file RootCorrectedETSCnv.cxx.

90 {
91
92 MsgStream log(msgSvc(), "RootCorrectedETSCnv");
93
94 // Open the file, create the branch
95 StatusCode sc = openWrite(fname);
96 if(!sc)
97 { log<<MSG::ERROR<<"unable to open files"<<endreq;
98 }
99
100 log<<MSG::INFO<<"successfully create RootFile"<<endreq;
101 return sc;
102
103}
IMessageSvc * msgSvc()
virtual StatusCode openWrite(const std::string &fname)

◆ i_createObj()

StatusCode RootCorrectedETSCnv::i_createObj ( const std::string &  fname,
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 RootCalBaseCnv.

Definition at line 41 of file RootCorrectedETSCnv.cxx.

42 {
43
44 MsgStream log(msgSvc(), "RootCorrectedETSCnv");
45 log<<MSG::DEBUG<<"SetProperty"<<endreq;
46
47 StatusCode sc = openRead(fname);
48 if(!sc)
49 { log<<MSG::ERROR<<"unable to open files"<<endreq;
50 }
51
53 // Read in our object
54 int i;
55 int nentries;
56
57 // read TestCalibConst ------------------------------------------------------------
58
59 int no;
60 // unsigned long IST;
61 ULong64_t ets1,ets2_pre,flag_pre;
62 int trigChannel_9,evt;
63
64 if( m_inFile->Read("event") ) {
65 TTree *tree = (TTree*)m_inFile -> Get("event");
66 tree->SetBranchAddress("ets1", &ets1);
67 tree->SetBranchAddress("ets2_pre", &ets2_pre);
68 tree->SetBranchAddress("flag_pre", &flag_pre);
69 tree->SetBranchAddress("trigChannel_9", &trigChannel_9);
70 tree->SetBranchAddress("evt", &evt);
71 }
72 TTree *tree = (TTree*)m_inFile -> Get("event");
73 no = tree->GetEntries();
74 tmpObject ->setNpar(no);
75 for(i=0; i<no; i++){
76 tree->GetEntry(i);
77 tmpObject ->setEts1(ets1);
78 tmpObject ->setEts2_pre(ets2_pre);
79 tmpObject ->setFlag_pre(flag_pre);
80 tmpObject ->setTrigChannel_9(trigChannel_9);
81 tmpObject ->setEvt(evt);
82 }
83
84 refpObject=tmpObject;
85
86 return StatusCode::SUCCESS;
87}
const int no
void setFlag_pre(unsigned long flag_pre)
void setTrigChannel_9(int trigChannel_9)
void setEts1(unsigned long ets1)
void setNpar(const int npar)
void setEts2_pre(unsigned long ets2_pre)
StatusCode openRead(const std::string &fname)

◆ objType()

const CLID & RootCorrectedETSCnv::objType ( ) const

Definition at line 33 of file RootCorrectedETSCnv.cxx.

33 {
35}

◆ repSvcType()

virtual long RootCorrectedETSCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file RootCorrectedETSCnv.h.

34 {
36 }
unsigned const char CALIBROOT_StorageType
Definition: ICalibRootSvc.h:20

Friends And Related Function Documentation

◆ CnvFactory< RootCorrectedETSCnv >

friend class CnvFactory< RootCorrectedETSCnv >
friend

Definition at line 1 of file RootCorrectedETSCnv.h.


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