BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TreeMucCalibDataCnv Class Reference

#include <TreeMucCalibDataCnv.h>

Inheritance diagram for TreeMucCalibDataCnv:

Public Member Functions

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

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 22 of file TreeMucCalibDataCnv.h.

Constructor & Destructor Documentation

◆ TreeMucCalibDataCnv()

TreeMucCalibDataCnv::TreeMucCalibDataCnv ( ISvcLocator * svc)

Definition at line 32 of file TreeMucCalibDataCnv.cxx.

34 m_ptrIdTr = new MucIdTransform();
35}
TreeCalBaseCnv(ISvcLocator *svc, const CLID &clid)

◆ ~TreeMucCalibDataCnv()

virtual TreeMucCalibDataCnv::~TreeMucCalibDataCnv ( )
inlinevirtual

Definition at line 31 of file TreeMucCalibDataCnv.h.

31{};

Member Function Documentation

◆ classID()

const CLID & TreeMucCalibDataCnv::classID ( )
static

Definition at line 39 of file TreeMucCalibDataCnv.cxx.

39{ return CLID_Calib_MucCal; }

Referenced by CalibTreeCnvSvc::createConverter().

◆ i_createObj()

StatusCode TreeMucCalibDataCnv::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 41 of file TreeMucCalibDataCnv.cxx.

41 {
42
43 MsgStream log( msgSvc(), "TreeMucCalibDataCnv" );
44 log << MSG::DEBUG << "SetProperty" << endmsg;
45 CalibData::MucCalibData* tmpObject = new CalibData::MucCalibData;
46 TreeAddress* add = dynamic_cast<TreeAddress*>( addr );
47 DatabaseRecord* records = add->pp();
48
49 TBufferFile* buf1 = new TBufferFile( TBuffer::kRead );
50 TBufferFile* buf2 = new TBufferFile( TBuffer::kRead );
51 TBufferFile* buf3 = new TBufferFile( TBuffer::kRead );
52 buf1->SetBuffer( ( *records )["LayTree"], 512000, kFALSE );
53 buf2->SetBuffer( ( *records )["BoxTree"], 512000, kFALSE );
54 buf3->SetBuffer( ( *records )["StrTree"], 512000, kFALSE );
55 std::cout << " SftVer is " << ( *records )["SftVer"];
56 std::cout << " CalVerSft is " << ( *records )["CalParVer"];
57 std::cout << " File name is " << ( *records )["FileName"] << std::endl;
58
59 TTree* laytree = new TTree();
60 laytree->Streamer( *buf1 );
61 log << MSG::DEBUG << "laytree name:\t" << laytree->GetName() << endmsg;
62 TTree* boxtree = new TTree();
63 boxtree->Streamer( *buf2 );
64 log << MSG::DEBUG << "boxtree name:\t" << boxtree->GetName() << endmsg;
65 TTree* strtree = new TTree();
66 strtree->Streamer( *buf3 );
67 log << MSG::DEBUG << "strtree name:\t" << strtree->GetName() << endmsg;
68
69 // Read in the object
70 // read layerConst-----------------------------
71 Double_t lay_eff, box_eff, str_eff;
72 Double_t lay_cnt, box_cnt, str_cnt;
73 Double_t lay_nos, box_nos, str_nos;
74 Double_t lay_nos_ratio, box_nos_ratio, str_nos_ratio;
75 lay_eff = box_eff = str_eff = 0.0;
76 lay_cnt = box_cnt = str_cnt = 0.0;
77 lay_nos = box_nos = str_nos = 0.0;
78 lay_nos_ratio = box_nos_ratio = str_nos_ratio = 0.0;
79
80 char name[60];
81 laytree->SetBranchAddress( "layer_eff", &lay_eff );
82 laytree->SetBranchAddress( "layer_cnt", &lay_cnt );
83 laytree->SetBranchAddress( "layer_noise", &lay_nos );
84 laytree->SetBranchAddress( "layer_nosratio", &lay_nos_ratio );
85
86 boxtree->SetBranchAddress( "box_eff", &box_eff );
87 boxtree->SetBranchAddress( "box_cnt", &box_cnt );
88 boxtree->SetBranchAddress( "box_noise", &box_nos );
89 boxtree->SetBranchAddress( "box_nosratio", &box_nos_ratio );
90
91 strtree->SetBranchAddress( "strip_eff", &str_eff );
92 strtree->SetBranchAddress( "strip_cnt", &str_cnt );
93 strtree->SetBranchAddress( "strip_noise", &str_nos );
94 strtree->SetBranchAddress( "strip_nosratio", &str_nos_ratio );
95
96 int part, segment, layer, strip;
97 part = segment = layer = strip = 0;
98 for ( int i = 0; i < LAYER_MAX; i++ )
99 {
100 laytree->GetEntry( i );
101 tmpObject->setLayerEff( lay_eff, i );
102 tmpObject->setLayerCnt( lay_cnt, i );
103 tmpObject->setLayerNos( lay_nos, i );
104 tmpObject->setLayerNosRatio( lay_nos_ratio, i );
105 sprintf( name, "LayClstPro" );
106 for ( int j = 0; j < CLST_MAX; j++ )
107 {
108 // if( ht_Pro[0] != NULL )
109 // tmpObject->setLayerClstPro(ht_Pro[0]->GetBinContent(j),i,j);
110 // else tmpObject->setLayerClstPro(DEFAULT_CLST_PRO[j],i,j);
111 tmpObject->setLayerClstPro( DEFAULT_CLST_PRO[j], i, j );
112 }
113 log << MSG::DEBUG << "layer: " << i << "\t" << lay_eff << endmsg;
114 }
115
116 for ( int i = 0; i < BOX_MAX; i++ )
117 {
118 m_ptrIdTr->SetBoxPos( i, &part, &segment, &layer );
119 boxtree->GetEntry( i );
120 tmpObject->setBoxEff( box_eff, part, segment, layer );
121 tmpObject->setBoxCnt( box_cnt, part, segment, layer );
122 tmpObject->setBoxNos( box_nos, part, segment, layer );
123 tmpObject->setBoxNosRatio( box_nos_ratio, part, segment, layer );
124
125 sprintf( name, "BoxClstPro_B%d", i );
126 for ( int j = 0; j < CLST_MAX; j++ )
127 {
128 // if( ht_Pro[1] != NULL )
129 // tmpObject->setBoxClstPro(ht_Pro[1]->GetBinContent(j),part,segment,layer,j); else
130 tmpObject->setBoxClstPro( DEFAULT_CLST_PRO[j], part, segment, layer, j );
131 }
132 log << MSG::DEBUG << "box: " << i << "\t" << box_eff << endmsg;
133 }
134
135 log << MSG::DEBUG << "strtree entries:\t" << strtree->GetEntries() << endmsg;
136 for ( int i = 0; i < STRIP_MAX; i++ )
137 {
138 m_ptrIdTr->SetStripPos( i, &part, &segment, &layer, &strip );
139 strtree->GetEntry( i );
140 tmpObject->setStripEff( str_eff, part, segment, layer, strip );
141 tmpObject->setStripCnt( str_cnt, part, segment, layer, strip );
142 tmpObject->setStripNos( str_nos, part, segment, layer, strip );
143 tmpObject->setStripNosRatio( str_nos_ratio, part, segment, layer, strip );
144 log << MSG::DEBUG << "strip: " << i << "\t" << str_eff << endmsg;
145 }
146
147 refpObject = tmpObject;
148 delete laytree;
149 delete boxtree;
150 delete strtree;
151 return StatusCode::SUCCESS;
152}
sprintf(cut, "kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_" "pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
const int STRIP_MAX
IMessageSvc * msgSvc()
void setLayerClstPro(const double layerpro, int i, int j)
void setBoxCnt(const double boxcnt, int i, int j, int k)
void setStripNos(const double stripnos, int i, int j, int k, int l)
void setBoxNosRatio(const double boxratio, int i, int j, int k)
void setStripEff(const double stripeff, int i, int j, int k, int l)
void setStripNosRatio(const double stripnosratio, int i, int j, int k, int l)
void setStripCnt(const double stripcnt, int i, int j, int k, int l)
void setBoxEff(const double boxeff, int i, int j, int k)
void setBoxNos(const double boxnos, int i, int j, int k)
void setBoxClstPro(const double boxpro, int i, int j, int k, int l)

◆ objType()

const CLID & TreeMucCalibDataCnv::objType ( ) const

Definition at line 37 of file TreeMucCalibDataCnv.cxx.

37{ return CLID_Calib_MucCal; }

◆ repSvcType()

virtual long TreeMucCalibDataCnv::repSvcType ( ) const
inlinevirtual

Definition at line 36 of file TreeMucCalibDataCnv.h.

◆ CnvFactory< TreeMucCalibDataCnv >

friend class CnvFactory< TreeMucCalibDataCnv >
friend

Definition at line 1 of file TreeMucCalibDataCnv.h.


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