BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RecMdcKalHelixSegCnv Class Reference

#include <RecMdcKalHelixSegCnv.h>

+ Inheritance diagram for RecMdcKalHelixSegCnv:

Public Member Functions

virtual ~RecMdcKalHelixSegCnv ()
 
- Public Member Functions inherited from RootEventBaseCnv
 RootEventBaseCnv (const CLID &clid, ISvcLocator *svc)
 
virtual ~RootEventBaseCnv ()
 
virtual long repSvcType () const
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void declareObject (const std::string &fullPath, const CLID &clid, const std::string &treename, const std::string &branchname)
 Store TDS path to link a particular converter to an object on the TDS.
 
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&dat)
 Convert the persistent object to transient.
 
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
 Convert the transient object to the requested representation.
 
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
 
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the converted object.
 
virtual StatusCode DataObjectToTObject (DataObject *dat, RootAddress *addr)=0
 Do the concrete conversion from TDS to ROOT.
 
virtual StatusCode TObjectToDataObject (DataObject *&dat)=0
 Do the concrete conversion from ROOT to TDS.
 
TObject * getReadObject () const
 get the object to be read
 
- 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 RootEventBaseCnv
static const unsigned char storageType ()
 Storage type and class ID.
 

Protected Member Functions

 RecMdcKalHelixSegCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
- Protected Member Functions inherited from Converter< Ty1, Ty2 >
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< RecMdcKalHelixSegCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
- Protected Attributes inherited from RootEventBaseCnv
RootCnvSvcm_cnvSvc
 
std::vector< RootCnvSvc::Leafm_leaves
 
RootInterfacem_rootInterface
 pointer to the RootInterface
 
IDataProviderSvc * m_eds
 pointer to eventdataservice
 
int m_branchNr
 the branchNr of this converter for writing
 
int m_branchNrDst
 
int m_branchNrMc
 
int m_branchNrRecon
 
int m_branchNrEvtRec
 
int m_branchNrEvtHeader
 
int m_branchNrEvtNavigator
 
TObject * m_objRead
 the object that was read
 
CLID CLID_top
 the CLID of the upper converter if any
 
TArrayS * m_branchNumbers
 array with number of branches for reading
 
std::string m_rootBranchname
 root branchname (may be concatenated of severals)
 
std::string m_rootTreename
 each converter knows it's treename
 
std::string m_currentFileName
 
std::vector< void * > m_adresses
 each converter knows the corresponding adresses
 
RootEvtSelectorm_evtsel
 

Detailed Description

Definition at line 15 of file RecMdcKalHelixSegCnv.h.

Constructor & Destructor Documentation

◆ ~RecMdcKalHelixSegCnv()

virtual RecMdcKalHelixSegCnv::~RecMdcKalHelixSegCnv ( )
inlinevirtual

Definition at line 25 of file RecMdcKalHelixSegCnv.h.

25{ };

◆ RecMdcKalHelixSegCnv()

RecMdcKalHelixSegCnv::RecMdcKalHelixSegCnv ( ISvcLocator *  svc)
protected

Definition at line 28 of file RecMdcKalHelixSegCnv.cxx.

30{
31
32 // Here we associate this converter with the /Event path on the TDS.
33 MsgStream log(msgSvc(), "RecMdcKalHelixSegCnv");
34 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
35 //m_rootTreename ="Rec";
36 m_rootBranchname ="m_recMdcKalHelixSegCol";
37 //declareObject(EventModel::Recon::RecMdcKalHelixSegCol, objType(), m_rootTreename, m_rootBranchname);
38 m_adresses.push_back(&m_recMdcKalHelixSegCol);
39 m_recMdcKalHelixSegCol=0;
40}
IMessageSvc * msgSvc()
static const CLID & classID()
Base class for all Root Converters.
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

Member Function Documentation

◆ classID()

static const CLID & RecMdcKalHelixSegCnv::classID ( )
inlinestatic

Definition at line 20 of file RecMdcKalHelixSegCnv.h.

21 {
23 }
const CLID & CLID_RecMdcKalHelixSegCol
Definition: EventModel.cxx:315

◆ DataObjectToTObject()

StatusCode RecMdcKalHelixSegCnv::DataObjectToTObject ( DataObject *  obj,
RootAddress addr 
)
protectedvirtual

transformation to root

Implements RootEventBaseCnv.

Definition at line 129 of file RecMdcKalHelixSegCnv.cxx.

129 {
130
131 MsgStream log(msgSvc(), "RecMdcKalHelixSegCnv");
132 log << MSG::DEBUG << "RecMdcKalHelixSegCnv::DataObjectToTObject" << endreq;
133
134 RecMdcKalHelixSegCol * mdcHitColTds=dynamic_cast<RecMdcKalHelixSegCol *> (obj);
135 if (!mdcHitColTds) {
136 log << MSG::ERROR << "Could not downcast to RecMdcKalHelixSegCol" << endreq;
137 return StatusCode::FAILURE;
138 }
139
140 DataObject *evt;
141 m_eds->findObject(EventModel::Recon::Event,evt);
142 if (evt==NULL) {
143 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endreq;
144 return StatusCode::FAILURE;
145 }
146
147 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (evt);
148 if (!devtTds) {
149 log << MSG::ERROR << "RecMdcKalHelixSegCnv:Could not downcast to TDS ReconEvent" << endreq;
150 }
151
152 IOpaqueAddress *addr;
153
154 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
156
157 const TObjArray *m_recMdcKalHelixSegCol = recEvt->getRecMdcKalHelixSegCol();
158 if (!m_recMdcKalHelixSegCol) return StatusCode::SUCCESS;
159 recEvt->clearRecMdcKalHelixSegCol(); //necessary in case there is I/O at the same time since array is static
160
161 RecMdcKalHelixSegCol::const_iterator recMdcKalHelixSeg;
162 int nSeg=0;
163 for (recMdcKalHelixSeg = mdcHitColTds->begin(); recMdcKalHelixSeg != mdcHitColTds->end(); recMdcKalHelixSeg++) {
164 Int_t trackId =(*recMdcKalHelixSeg)->getTrackId();
165 Int_t flagLR = (*recMdcKalHelixSeg)->getFlagLR();
166 UInt_t mdcId = (*recMdcKalHelixSeg)->getMdcId().get_value();
167 Double_t tdc = (*recMdcKalHelixSeg)->getTdc();
168 Double_t adc = (*recMdcKalHelixSeg)->getAdc();
169 Double_t zhit = (*recMdcKalHelixSeg)->getZhit();
170 Double_t tof = (*recMdcKalHelixSeg)->getTof();
171 Double_t docaIncl = (*recMdcKalHelixSeg)->getDocaIncl();
172 Double_t docaExcl = (*recMdcKalHelixSeg)->getDocaExcl();
173 Double_t driftDist= (*recMdcKalHelixSeg)->getDD();
174 Double_t entra = (*recMdcKalHelixSeg)->getEntra();
175 Double_t driftT = (*recMdcKalHelixSeg)->getDT();
176 // Int_t layerId = (*recMdcKalHelixSeg)->getLayerId();
177 // Double_t drIncl = (*recMdcKalHelixSeg)->getDrIncl();
178 // Double_t phi0Incl =(*recMdcKalHelixSeg)->getFi0Incl();
179 // Double_t kappaIncl = (*recMdcKalHelixSeg)->getCpaIncl();
180 // Double_t dzIncl = (*recMdcKalHelixSeg)->getDzIncl();
181 // Double_t tanlIncl = (*recMdcKalHelixSeg)->getTanlIncl();
182 // Double_t drExcl = (*recMdcKalHelixSeg)->getDrExcl();
183 // Double_t phi0Excl = (*recMdcKalHelixSeg)->getFi0Excl();
184 // Double_t kappaExcl = (*recMdcKalHelixSeg)->getCpaExcl();
185 // Double_t dzExcl = (*recMdcKalHelixSeg)->getDzExcl();
186 // Double_t tanlExcl = (*recMdcKalHelixSeg)->getTanlExcl();
187 HepVector helixIncl_vct = (*recMdcKalHelixSeg)->getHelixIncl();
188 HepVector helixExcl_vct = (*recMdcKalHelixSeg)->getHelixExcl();
189 // HepSymMatrix errIncl_mtx = (*recMdcKalHelixSeg)->getErrorIncl();
190 // HepSymMatrix errExcl_mtx = (*recMdcKalHelixSeg)->getErrorExcl();
191
192 Double_t helixIncl[5], helixExcl[5]; //errIncl[5][5], errExcl[5][5];
193 for(Int_t i=0; i<5; i++){
194 helixIncl[i] = helixIncl_vct[i];
195 helixExcl[i] = helixExcl_vct[i];
196 }
197 // for (Int_t i=0; i<5; i++){
198 // for(Int_t j=0; j<5; j++){
199 // errIncl[i][j] = errIncl_mtx[i][j];
200 // errExcl[i][j] = errExcl_mtx[i][j];
201 // }
202 // }
203
204 TRecMdcKalHelixSeg *recMdcKalHelixSegRoot = new TRecMdcKalHelixSeg();
205 //m_common.m_recMdcKalHelixSegMap[(*recMdcKalHelixSeg)] = recMdcKalHelixSegRoot;
206
207 recMdcKalHelixSegRoot->setTrackId( trackId );
208 recMdcKalHelixSegRoot->setFlagLR( flagLR );
209 recMdcKalHelixSegRoot->setMdcId( Identifier(mdcId) );
210 recMdcKalHelixSegRoot->setTdc( tdc );
211 recMdcKalHelixSegRoot->setAdc( adc );
212 recMdcKalHelixSegRoot->setZhit( zhit );
213 recMdcKalHelixSegRoot->setTof( tof );
214 recMdcKalHelixSegRoot->setDocaIncl( docaIncl );
215 recMdcKalHelixSegRoot->setDocaExcl( docaExcl );
216 recMdcKalHelixSegRoot->setDD( driftDist );
217 recMdcKalHelixSegRoot->setEntra( entra );
218 recMdcKalHelixSegRoot->setDT( driftT );
219 // recMdcKalHelixSegRoot->setLayerId( layerId );
220 // recMdcKalHelixSegRoot->setDrIncl( drIncl );
221 // recMdcKalHelixSegRoot->setFi0Incl( phi0Incl );
222 // recMdcKalHelixSegRoot->setCpaIncl( kappaIncl );
223 // recMdcKalHelixSegRoot->setDzIncl( dzIncl );
224 // recMdcKalHelixSegRoot->setTanlIncl( tanlIncl );
225 // recMdcKalHelixSegRoot->setDrExcl( drIncl );
226 // recMdcKalHelixSegRoot->setFi0Excl( phi0Excl );
227 // recMdcKalHelixSegRoot->setCpaExcl( kappaExcl );
228 // recMdcKalHelixSegRoot->setDzExcl( dzExcl );
229 // recMdcKalHelixSegRoot->setTanlExcl( tanlExcl );
230 recMdcKalHelixSegRoot->setHelixIncl( helixIncl );
231 recMdcKalHelixSegRoot->setHelixExcl( helixExcl );
232 // recMdcKalHelixSegRoot->setErrorIncl( errIncl );
233 // recMdcKalHelixSegRoot->setErrorExcl( errExcl );
234
235 log<<MSG::INFO<<" recMdcKalHelixSegRoot.dd: "<<recMdcKalHelixSegRoot->getDD()
236 <<" recMdcKalHelixSegRoot.entra: "<<recMdcKalHelixSegRoot->getEntra()
237 <<endreq;
238
239 recEvt->addRecMdcKalHelixSeg(recMdcKalHelixSegRoot);
240 nSeg++;
241 }
242 //cout<<"writing nSeg = "<<nSeg<<endl;
243 return StatusCode::SUCCESS;
244}
ObjectVector< RecMdcKalHelixSeg > RecMdcKalHelixSegCol
#define NULL
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
Definition: RecTrackCnv.h:36
RecTrackCnv * getRecTrackCnv()
Definition: RootCnvSvc.h:173
RootCnvSvc * m_cnvSvc
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
Double_t getDD(void) const
void setEntra(Double_t entra)
void setAdc(Double_t adc)
void setTof(Double_t tof)
void setHelixIncl(const Double_t helix[5])
void setDocaExcl(Double_t docaexcl)
void setZhit(Double_t zhit)
void setDocaIncl(Double_t docaincl)
void setMdcId(UInt_t mdcid)
void setTrackId(Int_t trkid)
void setFlagLR(Int_t lr)
void setDT(Double_t driftT)
Double_t getEntra(void) const
void setHelixExcl(const Double_t helix[5])
void setDD(Double_t dd)
void setTdc(Double_t tdc)
void addRecMdcKalHelixSeg(TRecMdcKalHelixSeg *Track)
void clearRecMdcKalHelixSegCol()
const TObjArray * getRecMdcKalHelixSegCol() const
_EXTERN_ std::string Event
Definition: EventModel.h:84

◆ TObjectToDataObject()

StatusCode RecMdcKalHelixSegCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

Definition at line 42 of file RecMdcKalHelixSegCnv.cxx.

42 {
43 // creation of TDS object from root object
44 MsgStream log(msgSvc(), "RecMdcKalHelixSegCnv");
45 log << MSG::DEBUG << "RecMdcKalHelixSegCnv::TObjectToDataObject" << endreq;
46
47 // create the TDS location for the RecMdcKalHelixSeg Collection
48 RecMdcKalHelixSegCol* recMdcKalHelixSegCol = new RecMdcKalHelixSegCol;
49 refpObject = recMdcKalHelixSegCol;
50
51 // now convert
52 if (!m_recMdcKalHelixSegCol) return StatusCode::SUCCESS;
53 TIter mdcHitIter(m_recMdcKalHelixSegCol);
54 TRecMdcKalHelixSeg *recMdcKalHelixSegRoot = 0;
55 int nSeg=0;
56 while ((recMdcKalHelixSegRoot = (TRecMdcKalHelixSeg*)mdcHitIter.Next())) {
57 int trackId = recMdcKalHelixSegRoot->getTrackId();
58 int flagLR = recMdcKalHelixSegRoot->getFlagLR();
59 Identifier mdcId(recMdcKalHelixSegRoot->getMdcId());
60 double tdc = recMdcKalHelixSegRoot->getTdc();
61 double adc = recMdcKalHelixSegRoot->getAdc();
62 double zhit = recMdcKalHelixSegRoot->getZhit();
63 double tof = recMdcKalHelixSegRoot->getTof();
64 double docaIncl = recMdcKalHelixSegRoot->getDocaIncl();
65 double docaExcl = recMdcKalHelixSegRoot->getDocaExcl();
66 double driftDist= recMdcKalHelixSegRoot->getDD();
67 double entra = recMdcKalHelixSegRoot->getEntra();
68 double driftT = recMdcKalHelixSegRoot->getDT();
69 // int layerId = recMdcKalHelixSegRoot->getLayerId();
70 // double drIncl = recMdcKalHelixSegRoot->getDrIncl();
71 // double phi0Incl = recMdcKalHelixSegRoot->getFi0Incl();
72 // double kappaIncl = recMdcKalHelixSegRoot->getCpaIncl();
73 // double dzIncl = recMdcKalHelixSegRoot->getDzIncl();
74 // double tanlIncl = recMdcKalHelixSegRoot->getTanlIncl();
75 // double drExcl = recMdcKalHelixSegRoot->getDrExcl();
76 // double phi0Excl = recMdcKalHelixSegRoot->getFi0Excl();
77 // double kappaExcl = recMdcKalHelixSegRoot->getCpaExcl();
78 // double dzExcl = recMdcKalHelixSegRoot->getDzExcl();
79 // double tanlExcl = recMdcKalHelixSegRoot->getTanlExcl();
80 double helixIncl[5]; // errIncl[15];
81 double helixExcl[5]; // errExcl[15];
82 for(int i=0, k=0; i<5; i++){
83 helixIncl[i] = recMdcKalHelixSegRoot->getHelixIncl(i);
84 helixExcl[i] = recMdcKalHelixSegRoot->getHelixExcl(i);
85 // for(int j=0; j<=i; j++){
86 // errIncl[k] = recMdcKalHelixSegRoot->getErrorIncl(i,j);
87 // errExcl[k] = recMdcKalHelixSegRoot->getErrorExcl(i,j);
88 // }
89 }
90
91 RecMdcKalHelixSeg *recMdcKalHelixSeg= new RecMdcKalHelixSeg();
92 m_common.m_rootRecMdcKalHelixSegMap[recMdcKalHelixSegRoot] = recMdcKalHelixSeg;
93
94 recMdcKalHelixSeg->setTrackId( trackId );
95 recMdcKalHelixSeg->setFlagLR( flagLR );
96 recMdcKalHelixSeg->setMdcId( Identifier(mdcId) );
97 recMdcKalHelixSeg->setTdc( tdc );
98 recMdcKalHelixSeg->setAdc( adc );
99 recMdcKalHelixSeg->setZhit( zhit );
100 recMdcKalHelixSeg->setTof( tof );
101 recMdcKalHelixSeg->setDocaIncl( docaIncl );
102 recMdcKalHelixSeg->setDocaExcl( docaExcl );
103 recMdcKalHelixSeg->setDD( driftDist );
104 recMdcKalHelixSeg->setEntra( entra );
105 recMdcKalHelixSeg->setDT( driftT );
106 // recMdcKalHelixSeg->setLayerId( layerId );
107 // recMdcKalHelixSeg->setDrIncl( drIncl );
108 // recMdcKalHelixSeg->setFi0Incl( phi0Incl );
109 // recMdcKalHelixSeg->setCpaIncl( kappaIncl );
110 // recMdcKalHelixSeg->setDzIncl( dzIncl );
111 // recMdcKalHelixSeg->setTanlIncl( tanlIncl );
112 // recMdcKalHelixSeg->setDrExcl( drIncl );
113 // recMdcKalHelixSeg->setFi0Excl( phi0Excl );
114 // recMdcKalHelixSeg->setCpaExcl( kappaExcl );
115 // recMdcKalHelixSeg->setDzExcl( dzExcl );
116 // recMdcKalHelixSeg->setTanlExcl( tanlExcl );
117 recMdcKalHelixSeg->setHelixIncl( helixIncl );
118 recMdcKalHelixSeg->setHelixExcl( helixExcl );
119 // recMdcKalHelixSeg->setErrorIncl( errIncl );
120 // recMdcKalHelixSeg->setErrorExcl( errExcl );
121
122 recMdcKalHelixSegCol->push_back(recMdcKalHelixSeg);
123 nSeg++;
124 }
125 //cout<<"rec -> Tds, nSeg = "<<nSeg<<", recMdcKalHelixSegCol.size="<<recMdcKalHelixSegCol->size()<<endl;
126 return StatusCode::SUCCESS;
127}
void setTrackId(int trackid)
void setDocaExcl(double doca)
void setHelixIncl(const HepVector &helix)
void setDT(double dt)
void setAdc(double adc)
void setEntra(double entra)
void setFlagLR(int flagLR)
void setTdc(double tdc)
void setDD(double dd)
void setHelixExcl(const HepVector &helix)
void setZhit(double zhit)
void setMdcId(Identifier mdcid)
void setTof(double tof)
void setDocaIncl(double doca)
Double_t getAdc(void) const
UInt_t getMdcId() const
Double_t getZhit(void) const
Double_t getTof(void) const
Double_t getHelixExcl(Int_t i) const
Int_t getTrackId(void) const
Double_t getDT(void) const
Double_t getDocaExcl(void) const
Double_t getDocaIncl(void) const
Double_t getHelixIncl(Int_t i) const
Double_t getTdc(void) const
Int_t getFlagLR(void) const
static std::map< const TObject *, const RecMdcKalHelixSeg * > m_rootRecMdcKalHelixSegMap
Definition: commonData.h:245

Friends And Related Function Documentation

◆ CnvFactory< RecMdcKalHelixSegCnv >

friend class CnvFactory< RecMdcKalHelixSegCnv >
friend

Definition at line 9 of file RecMdcKalHelixSegCnv.h.


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