BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
TreeOffEvtFilterCnv Class Reference

#include <TreeOffEvtFilterCnv.h>

+ Inheritance diagram for TreeOffEvtFilterCnv:

Public Member Functions

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

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 TreeOffEvtFilterCnv.h.

Constructor & Destructor Documentation

◆ TreeOffEvtFilterCnv()

TreeOffEvtFilterCnv::TreeOffEvtFilterCnv ( ISvcLocator * svc)

Definition at line 27 of file TreeOffEvtFilterCnv.cxx.

27 :
29
30 }
const CLID CLID_Calib_OffEvtFilter
Definition CalibModel.h:69
TreeCalBaseCnv(ISvcLocator *svc, const CLID &clid)

◆ ~TreeOffEvtFilterCnv()

virtual TreeOffEvtFilterCnv::~TreeOffEvtFilterCnv ( )
inlinevirtual

Definition at line 29 of file TreeOffEvtFilterCnv.h.

29{};

Member Function Documentation

◆ classID()

const CLID & TreeOffEvtFilterCnv::classID ( )
static

Definition at line 37 of file TreeOffEvtFilterCnv.cxx.

37 {
39}

◆ i_createObj()

StatusCode TreeOffEvtFilterCnv::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 TreeOffEvtFilterCnv.cxx.

42 {
43
44 MsgStream log(msgSvc(), "TreeOffEvtFilterCnv");
45 log<<MSG::DEBUG<<"SetProperty"<<endreq;
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 buf1->SetBuffer((*records)["data"],512000,kFALSE);
52 buf2->SetBuffer((*records)["oef"],512000,kFALSE);
53
54 std::cout<<" SftVer is "<<(*records)["SftVer"];
55 std::cout<<" CalVerSft is "<<(*records)["CalParVer"];
56 std::cout<<" File name is "<<(*records)["FileName"]<<std::endl;
57
58 TTree* tree1= new TTree();
59 tree1->Streamer(*buf1);
60 TTree* tree2= new TTree();
61 tree2->Streamer(*buf2);
62
64 // Read in our object
65 int i,no;
66
67 // read Tree:data & oef ------------------------------------------------------------
68 int runFrom, runTo, eventFrom, eventTo;
69 tree1->SetBranchAddress("runFrom", &runFrom );
70 tree1->SetBranchAddress("runTo", &runTo );
71 tree1->SetBranchAddress("eventFrom", &eventFrom);
72 tree1->SetBranchAddress("eventTo", &eventTo );
73 tree1->GetEntry(0);
74 tmpObject ->setRunFrom(runFrom);
75 tmpObject ->setRunTo(runTo);
76 tmpObject ->setEventFrom(eventFrom);
77 tmpObject ->setEventTo(eventTo);
78 cout<<"runFrom in OffEvtFilter is:"<<runFrom<<endl;
79 cout<<"runTo in OffEvtFilter is:"<<runTo<<endl;
80 cout<<"EventFrom in OffEvtFilter is:"<<eventFrom<<endl;
81 cout<<"eventTo in OffEvtFilter is:"<<eventTo<<endl;
82
83 int flag;
84 double tBegin,tEnd;
85 tree2->SetBranchAddress("tbegin", &tBegin);
86 tree2->SetBranchAddress("tend", &tEnd);
87 tree2->SetBranchAddress("flag", &flag);
88 no = tree2->GetEntries();
89 tmpObject ->setNpar(no);
90 for(i=0; i<no; i++){
91 tree2->GetEntry(i);
92 tmpObject ->setFlag(flag);
93 tmpObject ->setTBegin(tBegin);
94 tmpObject ->setTEnd(tEnd);
95 cout<<"OffEvtFilter:i:flag:tBegin:tEnd=="<<i<<":"<<flag<<":"<<tBegin<<":"<<tEnd<<endl;
96 }
97
98 refpObject=tmpObject;
99
100 delete tree1;
101 delete tree2;
102 return StatusCode::SUCCESS;
103
104
105}
const int no
IMessageSvc * msgSvc()
void setTEnd(const double tEnd)
void setTBegin(const double tBegin)
void setRunTo(const int runTo)
void setFlag(const int flag)
void setNpar(const int npar)
void setRunFrom(const int runFrom)
void setEventTo(const int eventTo)
void setEventFrom(const int eventFrom)
virtual DatabaseRecord * pp()

◆ objType()

const CLID & TreeOffEvtFilterCnv::objType ( ) const

Definition at line 33 of file TreeOffEvtFilterCnv.cxx.

33 {
35}

◆ repSvcType()

virtual long TreeOffEvtFilterCnv::repSvcType ( ) const
inlinevirtual

Definition at line 34 of file TreeOffEvtFilterCnv.h.

34 {
36 }
unsigned const char CALIBTREE_StorageType

Friends And Related Symbol Documentation

◆ CnvFactory< TreeOffEvtFilterCnv >

friend class CnvFactory< TreeOffEvtFilterCnv >
friend

Definition at line 1 of file TreeOffEvtFilterCnv.h.


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