BOSS 8.0.0
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
destinationoperator (const source &) const
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
virtual destinationconvert (const source &) const =0
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
typedef Ty1 source
typedef Ty2 destination
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 30 of file TreeDedxSimDataCnv.cxx.

31 : TreeCalBaseCnv( svc, CLID_Dedx_Sim ) {}
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 35 of file TreeDedxSimDataCnv.cxx.

35{ return CLID_Dedx_Sim; }

Referenced by CalibTreeCnvSvc::createConverter().

◆ 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 37 of file TreeDedxSimDataCnv.cxx.

37 {
38
39 MsgStream log( msgSvc(), "TreeDedxSimDataCnv" );
40
41 CalibData::DedxSimData* tmpObject = new CalibData::DedxSimData;
42 TreeAddress* add = dynamic_cast<TreeAddress*>( addr );
43 DatabaseRecord* records = add->pp();
44
45 TBufferFile* buf1 = new TBufferFile( TBuffer::kRead );
46 TBufferFile* buf2 = new TBufferFile( TBuffer::kRead );
47
48 buf1->SetBuffer( ( *records )["TH1F_Col"], 51200000, kFALSE );
49 buf2->SetBuffer( ( *records )["bin"], 512000, kFALSE );
50
51 std::cout << " SftVer is " << ( *records )["SftVer"];
52 std::cout << " CalVerSft is " << ( *records )["CalParVer"];
53 std::cout << " File name is " << ( *records )["FileName"] << std::endl;
54
55 // TClass *myclass=gROOT->GetClass("TTree");
56 // TTree *tree =(TTree*)buf1->ReadObject(myclass);
57 TTree* tree = new TTree();
58 tree->Streamer( *buf1 );
59
60 TTree* bin = new TTree();
61 bin->Streamer( *buf2 );
62
63 TH1F* h1 = new TH1F();
64
65 std::vector<TH1F> hist;
66 std::vector<double> hRange;
67 // Read in the object
68 int cnt;
69 tree->SetBranchAddress( "TH1F_Col", &h1 );
70 int entries = tree->GetEntries();
71 for ( cnt = 0; cnt < entries; cnt++ )
72 {
73 tree->GetEntry( cnt );
74 gROOT->cd();
75 TH1F* h2 = new TH1F();
76 h2 = (TH1F*)h1->Clone();
77 hist.push_back( *h2 );
78 }
79 int ver;
80 double betagamma[5000];
81 int totalNum;
82 int bgNum;
83 int thetaNum;
84 if ( bin->FindBranch( "version" ) ) bin->SetBranchAddress( "version", &ver );
85 else ver = 0;
86 if ( bin->FindBranch( "thetaNum" ) ) bin->SetBranchAddress( "thetaNum", &thetaNum );
87 else thetaNum = 16;
88 bin->SetBranchAddress( "totalNum", &totalNum );
89 bin->SetBranchAddress( "betagamma", betagamma );
90 bin->SetBranchAddress( "betagammaBounds", &bgNum );
91 bin->GetEntry( 0 );
92 // int tot=totalNum*2;
93 for ( cnt = 0; cnt < bgNum; cnt++ ) { hRange.push_back( betagamma[cnt] ); }
94 tmpObject->setVersion( ver );
95 tmpObject->setRangeNo( bgNum );
96 tmpObject->setRange( &hRange );
97 tmpObject->setHistNo( totalNum );
98 tmpObject->setThetaNo( thetaNum );
99 tmpObject->setHist( &hist );
100 refpObject = tmpObject;
101
102 delete tree;
103 delete bin;
104
105 return StatusCode::SUCCESS;
106}
*******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 setHist(const vector< TH1F > *hist)
void setRange(const vector< double > *hRange)

◆ objType()

const CLID & TreeDedxSimDataCnv::objType ( ) const

Definition at line 33 of file TreeDedxSimDataCnv.cxx.

33{ return CLID_Dedx_Sim; }

◆ repSvcType()

virtual long TreeDedxSimDataCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file TreeDedxSimDataCnv.h.

◆ 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: