BOSS 7.1.1
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
 
- 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_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< 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 TreeDedxSimDataCnv.h.

Constructor & Destructor Documentation

◆ TreeDedxSimDataCnv()

TreeDedxSimDataCnv::TreeDedxSimDataCnv ( ISvcLocator * svc)

Definition at line 33 of file TreeDedxSimDataCnv.cxx.

33 :
35
36 }
const CLID CLID_Dedx_Sim
Definition CalibModel.h:61
TreeCalBaseCnv(ISvcLocator *svc, const CLID &clid)

◆ ~TreeDedxSimDataCnv()

virtual TreeDedxSimDataCnv::~TreeDedxSimDataCnv ( )
inlinevirtual

Definition at line 29 of file TreeDedxSimDataCnv.h.

29{};

Member Function Documentation

◆ classID()

const CLID & TreeDedxSimDataCnv::classID ( )
static

Definition at line 43 of file TreeDedxSimDataCnv.cxx.

43 {
44 return CLID_Dedx_Sim;
45}

◆ i_createObj()

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 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)
void setHist(const vector< TH1F > *hist)
void setRangeNo(const int No)
Definition DedxSimData.h:51
void setVersion(const int ver)
Definition DedxSimData.h:46
virtual DatabaseRecord * pp()

◆ objType()

const CLID & TreeDedxSimDataCnv::objType ( ) const

Definition at line 39 of file TreeDedxSimDataCnv.cxx.

39 {
40 return CLID_Dedx_Sim;
41}

◆ repSvcType()

virtual long TreeDedxSimDataCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file TreeDedxSimDataCnv.h.

34 {
36 }
unsigned const char CALIBTREE_StorageType

Friends And Related Symbol Documentation

◆ CnvFactory< TreeDedxSimDataCnv >

friend class CnvFactory< TreeDedxSimDataCnv >
friend

Definition at line 1 of file TreeDedxSimDataCnv.h.


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