BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
TreeDedxSimDataCnv Class Reference

#include <TreeDedxSimDataCnv.h>

+ Inheritance diagram for TreeDedxSimDataCnv:

Public Member Functions

const CLID & objType () const
 
 TreeDedxSimDataCnv (ISvcLocator *svc)
 
virtual ~TreeDedxSimDataCnv ()
 
virtual long repSvcType () const
 
const CLID & objType () const
 
 TreeDedxSimDataCnv (ISvcLocator *svc)
 
virtual ~TreeDedxSimDataCnv ()
 
virtual long repSvcType () const
 
const CLID & objType () const
 
 TreeDedxSimDataCnv (ISvcLocator *svc)
 
virtual ~TreeDedxSimDataCnv ()
 
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)
 
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)
 
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 const CLID & classID ()
 
static const CLID & classID ()
 
- Static Public Member Functions inherited from TreeCalBaseCnv
static const unsigned char storageType ()
 
static const unsigned char storageType ()
 
static const unsigned char storageType ()
 

Protected Member Functions

virtual StatusCode i_createObj (IOpaqueAddress *address, DataObject *&refpObject)
 
virtual StatusCode i_createObj (IOpaqueAddress *address, DataObject *&refpObject)
 
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.
 
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)
 
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)
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< TreeDedxSimDataCnv >
 

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 CalibTreeCnv-00-02-02-bak/src/cnv/TreeDedxSimDataCnv.h.

Constructor & Destructor Documentation

◆ TreeDedxSimDataCnv() [1/3]

TreeDedxSimDataCnv::TreeDedxSimDataCnv ( ISvcLocator *  svc)

◆ ~TreeDedxSimDataCnv() [1/3]

virtual TreeDedxSimDataCnv::~TreeDedxSimDataCnv ( )
inlinevirtual

◆ TreeDedxSimDataCnv() [2/3]

TreeDedxSimDataCnv::TreeDedxSimDataCnv ( ISvcLocator *  svc)

◆ ~TreeDedxSimDataCnv() [2/3]

virtual TreeDedxSimDataCnv::~TreeDedxSimDataCnv ( )
inlinevirtual

◆ TreeDedxSimDataCnv() [3/3]

TreeDedxSimDataCnv::TreeDedxSimDataCnv ( ISvcLocator *  svc)

◆ ~TreeDedxSimDataCnv() [3/3]

virtual TreeDedxSimDataCnv::~TreeDedxSimDataCnv ( )
inlinevirtual

Definition at line 29 of file CalibTreeCnv-00-02-04/src/cnv/TreeDedxSimDataCnv.h.

29{};

Member Function Documentation

◆ classID() [1/3]

const CLID & TreeDedxSimDataCnv::classID ( )
static

Definition at line 43 of file CalibTreeCnv-00-02-02-bak/src/cnv/TreeDedxSimDataCnv.cxx.

43 {
44 return CLID_Dedx_Sim;
45}

◆ classID() [2/3]

static const CLID & TreeDedxSimDataCnv::classID ( )
static

◆ classID() [3/3]

static const CLID & TreeDedxSimDataCnv::classID ( )
static

◆ i_createObj() [1/3]

StatusCode TreeDedxSimDataCnv::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 47 of file CalibTreeCnv-00-02-02-bak/src/cnv/TreeDedxSimDataCnv.cxx.

48 {
49
50 MsgStream log(msgSvc(), "TreeDedxSimDataCnv");
51
53 TreeAddress* add = dynamic_cast<TreeAddress*>(addr);
54 DatabaseRecord *records=add->pp();
55
56 TBufferFile *buf1 = new TBufferFile(TBuffer::kRead);
57 TBufferFile *buf2 = new TBufferFile(TBuffer::kRead);
58
59 buf1->SetBuffer((*records)["TH1F_Col"],51200000,kFALSE);
60 buf2->SetBuffer((*records)["bin"],512000,kFALSE);
61
62 std::cout<<" SftVer is "<<(*records)["SftVer"];
63 std::cout<<" CalVerSft is "<<(*records)["CalParVer"];
64 std::cout<<" File name is "<<(*records)["FileName"]<<std::endl;
65
66
67 //TClass *myclass=gROOT->GetClass("TTree");
68 //TTree *tree =(TTree*)buf1->ReadObject(myclass);
69 TTree* tree = new TTree();
70 tree->Streamer(*buf1);
71
72 TTree* bin = new TTree();
73 bin->Streamer(*buf2);
74
75 TH1F *h1=new TH1F();
76
77 std::vector<TH1F> hist;
78 std::vector<double> hRange;
79 // Read in the object
80 int cnt;
81 tree -> SetBranchAddress("TH1F_Col", &h1);
82 int entries=tree->GetEntries();
83 for(cnt=0; cnt<entries; cnt++){
84 tree -> GetEntry(cnt);
85 gROOT->cd();
86 TH1F *h2=new TH1F();
87 h2=(TH1F*)h1->Clone();
88 hist.push_back(*h2);
89 }
90 int ver;
91 double betagamma[5000];
92 int totalNum;
93 int bgNum;
94 int thetaNum;
95 if (bin->FindBranch("version")) bin->SetBranchAddress("version", &ver);
96 else ver = 0;
97 if (bin->FindBranch("thetaNum")) bin->SetBranchAddress("thetaNum", &thetaNum);
98 else thetaNum = 16;
99 bin-> SetBranchAddress("totalNum", &totalNum);
100 bin-> SetBranchAddress("betagamma", betagamma);
101 bin-> SetBranchAddress("betagammaBounds", &bgNum);
102 bin->GetEntry(0);
103 //int tot=totalNum*2;
104 for(cnt=0; cnt<bgNum; cnt++){
105 hRange.push_back(betagamma[cnt]);
106 }
107 tmpObject->setVersion(ver);
108 tmpObject->setRangeNo(bgNum);
109 tmpObject->setRange(&hRange);
110 tmpObject->setHistNo(totalNum);
111 tmpObject->setThetaNo(thetaNum);
112 tmpObject->setHist(&hist);
113 refpObject=tmpObject;
114
115 delete tree;
116 delete bin;
117
118 return StatusCode::SUCCESS;
119
120
121}
data GetEntry(0)
data SetBranchAddress("time",&time)
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
Definition: FoamA.h:85
IMessageSvc * msgSvc()
void setThetaNo(const int No)
Definition: DedxSimData.h:52
void setHistNo(const int No)
Definition: DedxSimData.h:47
void setRange(const vector< double > *hRange)
Definition: DedxSimData.cxx:43
void setHist(const vector< TH1F > *hist)
Definition: DedxSimData.cxx:38
void setRangeNo(const int No)
Definition: DedxSimData.h:51
void setVersion(const int ver)
Definition: DedxSimData.h:46
virtual DatabaseRecord * pp()
Definition: TreeAddress.h:130

◆ i_createObj() [2/3]

virtual StatusCode TreeDedxSimDataCnv::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.

◆ i_createObj() [3/3]

virtual StatusCode TreeDedxSimDataCnv::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.

◆ objType() [1/3]

const CLID & TreeDedxSimDataCnv::objType ( ) const

Definition at line 39 of file CalibTreeCnv-00-02-02-bak/src/cnv/TreeDedxSimDataCnv.cxx.

39 {
40 return CLID_Dedx_Sim;
41}

◆ objType() [2/3]

const CLID & TreeDedxSimDataCnv::objType ( ) const

◆ objType() [3/3]

const CLID & TreeDedxSimDataCnv::objType ( ) const

◆ repSvcType() [1/3]

virtual long TreeDedxSimDataCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file CalibTreeCnv-00-02-02-bak/src/cnv/TreeDedxSimDataCnv.h.

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

◆ repSvcType() [2/3]

virtual long TreeDedxSimDataCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file CalibTreeCnv-00-02-03-bak/src/cnv/TreeDedxSimDataCnv.h.

34 {
36 }

◆ repSvcType() [3/3]

virtual long TreeDedxSimDataCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file CalibTreeCnv-00-02-04/src/cnv/TreeDedxSimDataCnv.h.

34 {
36 }

Friends And Related Function Documentation

◆ CnvFactory< TreeDedxSimDataCnv >

friend class CnvFactory< TreeDedxSimDataCnv >
friend

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