BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
TreeEmcCalibDataCnv Class Reference

#include <TreeEmcCalibDataCnv.h>

+ Inheritance diagram for TreeEmcCalibDataCnv:

Public Member Functions

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

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_createObj (IOpaqueAddress *address, 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)
 
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< TreeEmcCalibDataCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
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 TreeEmcCalibDataCnv.h.

Constructor & Destructor Documentation

◆ TreeEmcCalibDataCnv()

TreeEmcCalibDataCnv::TreeEmcCalibDataCnv ( ISvcLocator *  svc)

Definition at line 31 of file TreeEmcCalibDataCnv.cxx.

31 :
33
34 }
const CLID CLID_Calib_EmcCal
Definition: CalibModel.h:47

◆ ~TreeEmcCalibDataCnv()

virtual TreeEmcCalibDataCnv::~TreeEmcCalibDataCnv ( )
inlinevirtual

Definition at line 29 of file TreeEmcCalibDataCnv.h.

29{};

Member Function Documentation

◆ classID()

const CLID & TreeEmcCalibDataCnv::classID ( )
static

Definition at line 41 of file TreeEmcCalibDataCnv.cxx.

41 {
42 return CLID_Calib_EmcCal;
43}

◆ i_createObj()

StatusCode TreeEmcCalibDataCnv::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 45 of file TreeEmcCalibDataCnv.cxx.

46 {
47
48 MsgStream log(msgSvc(), "TreeEmcCalibDataCnv");
49 log<<MSG::DEBUG<<"SetProperty"<<endreq;
50 // gROOT->Reset();
51 // gDirectory = gROOT;
52 //TFile("temp.root");
53 TreeAddress* add = dynamic_cast<TreeAddress*>(addr);
54 DatabaseRecord *records=add->pp();
55 TBufferFile *buf1 = new TBufferFile(TBuffer::kRead);
56 buf1->SetBuffer((*records)["DigiCalibConst"],512000,kFALSE);
57
58 std::cout<<" SftVer is "<<(*records)["SftVer"];
59 std::cout<<" CalVerSft is "<<(*records)["CalParVer"];
60 std::cout<<" File name is "<<(*records)["FileName"]<<std::endl;
61
62 TTree* Digitree= new TTree();
63
64 Digitree->Streamer(*buf1);
65
66 Digitree->Print();
67
69 // Read in our object
70 int i;
71 int nentries;
72
73 // read DigiCalibConst ------------------------------------------------------------
74 double emcdata;
75 // Digitree -> SetBranchAddress("DigiCalibConst", &emcdata);
76 // Digitree -> SetBranchAddress("DigiCalibConst", &emcdata);
77 // nentries = Digitree-> GetEntries();
78 // std::cout<<"nentries=="<<nentries<<std::endl;
79
80
81 double EmcCalibConst[6240];
82 int EmcIxtalNumber[6240];
83 vector<double> DigiCalibConst;
84 vector<int> IxtalNumber;
85 Digitree->SetBranchAddress("DigiCalibConst", EmcCalibConst);
86 Digitree -> SetBranchAddress("IxtalNumber", EmcIxtalNumber);
87 Digitree -> GetEntry(0);
88 for(i=0; i<6240; i++){
89 DigiCalibConst.push_back(EmcCalibConst[i]);
90 IxtalNumber.push_back(EmcIxtalNumber[i]);
91 }
92 tmpObject -> setDigiCalibConst(&DigiCalibConst);
93 tmpObject -> setIxtalNumber(&IxtalNumber);
94 refpObject=tmpObject;
95 // temp->Close();
96 delete Digitree;
97 return StatusCode::SUCCESS;
98
99
100}
data SetBranchAddress("time",&time)
data GetEntry(0)
Int_t nentries
IMessageSvc * msgSvc()
virtual DatabaseRecord * pp()
Definition: TreeAddress.h:130

◆ objType()

const CLID & TreeEmcCalibDataCnv::objType ( ) const

Definition at line 37 of file TreeEmcCalibDataCnv.cxx.

37 {
38 return CLID_Calib_EmcCal;
39}

◆ repSvcType()

virtual long TreeEmcCalibDataCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file TreeEmcCalibDataCnv.h.

34 {
36 }
unsigned const char CALIBTREE_StorageType
Definition: ICalibTreeSvc.h:20

Friends And Related Function Documentation

◆ CnvFactory< TreeEmcCalibDataCnv >

friend class CnvFactory< TreeEmcCalibDataCnv >
friend

Definition at line 1 of file TreeEmcCalibDataCnv.h.


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