CGEM BOSS 6.6.5.g
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_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< 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

◆ ~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 double betagamma[5000];
91 int totalNum;
92 int bgNum;
93 bin-> SetBranchAddress("totalNum", &totalNum);
94 bin-> SetBranchAddress("betagamma", betagamma);
95 bin-> SetBranchAddress("betagammaBounds", &bgNum);
96 bin->GetEntry(0);
97 //int tot=totalNum*2;
98 for(cnt=0; cnt<bgNum; cnt++){
99 hRange.push_back(betagamma[cnt]);
100 }
101 tmpObject->setRangeNo(bgNum);
102 tmpObject->setRange(&hRange);
103 tmpObject->setHistNo(totalNum);
104 tmpObject->setHist(&hist);
105 refpObject=tmpObject;
106
107 delete tree;
108 delete bin;
109
110 return StatusCode::SUCCESS;
111
112
113}
data SetBranchAddress("time",&time)
data GetEntry(0)
*******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 setHistNo(const int No)
Definition: DedxSimData.h:42
void setRange(const vector< double > *hRange)
Definition: DedxSimData.cxx:42
void setHist(const vector< TH1F > *hist)
Definition: DedxSimData.cxx:37
void setRangeNo(const int No)
Definition: DedxSimData.h:46
virtual DatabaseRecord * pp()
Definition: TreeAddress.h:130

◆ 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
Definition: ICalibTreeSvc.h:20

Friends And Related Function 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: