CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemDedxCnv Class Reference

#include <CgemDedxCnv.h>

+ Inheritance diagram for CgemDedxCnv:

Public Member Functions

virtual ~CgemDedxCnv ()
 
virtual ~CgemDedxCnv ()
 
virtual ~CgemDedxCnv ()
 
- 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
 
 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
 
 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
 
destinationoperator (const source &) const
 

Static Public Member Functions

static const CLID & classID ()
 
static const CLID & classID ()
 
static const CLID & classID ()
 
- Static Public Member Functions inherited from RootEventBaseCnv
static const unsigned char storageType ()
 Storage type and class ID.
 
static const unsigned char storageType ()
 Storage type and class ID.
 
static const unsigned char storageType ()
 Storage type and class ID.
 

Protected Member Functions

 CgemDedxCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 CgemDedxCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 CgemDedxCnv (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
 
virtual destinationconvert (const source &) const =0
 

Friends

class CnvFactory< CgemDedxCnv >
 

Additional Inherited Members

- Public Types inherited from Converter< Ty1, Ty2 >
typedef Ty1 source
 
typedef Ty2 destination
 
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

Constructor & Destructor Documentation

◆ ~CgemDedxCnv() [1/3]

virtual CgemDedxCnv::~CgemDedxCnv ( )
inlinevirtual

◆ CgemDedxCnv() [1/3]

CgemDedxCnv::CgemDedxCnv ( ISvcLocator *  svc)
protected

Definition at line 26 of file bak_RootCnvSvc-04-01-14/src/Dst/CgemDedxCnv.cxx.

28{
29 // Here we associate this converter with the /Event path on the TDS.
30 MsgStream log(msgSvc(), "CgemDedxCnv");
31 //log << MSG::DEBUG << "Constructor called for " << objType() << endreq;
32 m_rootBranchname ="m_cgemDedxCol";
33 //declareObject(EventModel::Dst::DstDedxCol, objType(), m_rootTreename, m_rootBranchname);
34 m_adresses.push_back(&m_cgemDedxCol);
35 m_cgemDedxCol=0;
36}
std::vector< void * > m_adresses
each converter knows the corresponding adresses
std::string m_rootBranchname
root branchname (may be concatenated of severals)

◆ ~CgemDedxCnv() [2/3]

virtual CgemDedxCnv::~CgemDedxCnv ( )
inlinevirtual

◆ CgemDedxCnv() [2/3]

CgemDedxCnv::CgemDedxCnv ( ISvcLocator *  svc)
protected

◆ ~CgemDedxCnv() [3/3]

virtual CgemDedxCnv::~CgemDedxCnv ( )
inlinevirtual

◆ CgemDedxCnv() [3/3]

CgemDedxCnv::CgemDedxCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/3]

static const CLID & CgemDedxCnv::classID ( )
inlinestatic

Definition at line 20 of file Event/RootCnvSvc/bak_RootCnvSvc-04-01-14/RootCnvSvc/Dst/CgemDedxCnv.h.

21 {
22 return CLID_DstCgemDedxCol;
23 }
const CLID & CLID_DstCgemDedxCol
Definition: EventModel.cxx:318

◆ classID() [2/3]

static const CLID & CgemDedxCnv::classID ( )
inlinestatic

◆ classID() [3/3]

static const CLID & CgemDedxCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 126 of file bak_RootCnvSvc-04-01-14/src/Dst/CgemDedxCnv.cxx.

126 {
127
128 MsgStream log(msgSvc(), "CgemDedxCnv");
129 log << MSG::DEBUG << "CgemDedxCnv::DataObjectToTObject" << endreq;
130 StatusCode sc=StatusCode::SUCCESS;
131
132 DstCgemDedxCol * cgemDedxColTds=dynamic_cast<DstCgemDedxCol *> (obj);
133 if (!cgemDedxColTds) {
134 log << MSG::ERROR << "Could not downcast to CgemDedxCol" << endreq;
135 return StatusCode::FAILURE;
136 }
137
138 DataObject *evt;
139 m_eds->findObject(EventModel::Dst::Event,evt);
140 if (evt==NULL) {
141 log << MSG::ERROR << "Could not get DstEvent in TDS " << endreq;
142 return StatusCode::FAILURE;
143 }
144 DstEvent * devtTds=dynamic_cast<DstEvent *> (evt);
145 if (!devtTds) {
146 log << MSG::ERROR << "CgemDedxCnv:Could not downcast to TDS DstEvent" << endreq;
147 }
148 IOpaqueAddress *addr;
149
150 m_cnvSvc->getDstCnv()->createRep(evt,addr);
152
153 const TObjArray *m_cgemDedxCol = recEvt->getCgemDedxCol();
154 if (!m_cgemDedxCol) return sc;
155 recEvt->clearCgemDedxCol(); //necessary in case there is I/O at the same time since array is static
156 DstCgemDedxCol::const_iterator cgemDedxTds;
157
158 for (cgemDedxTds = cgemDedxColTds->begin(); cgemDedxTds != cgemDedxColTds->end(); cgemDedxTds++) {
159 Int_t trackId = (*cgemDedxTds)->trackId();
160 Int_t particleId = (*cgemDedxTds)->particleId();
161 Int_t status = (*cgemDedxTds)->status();
162 Int_t truncAlg =(*cgemDedxTds)->truncAlg();
163 /*
164 Double_t pb[5];
165 for (Int_t i = 0; i < 5; i++)
166 pb[i] = (*dedxTds)->prob(i);
167 */
168 Double_t chiE = (*cgemDedxTds)->chi(0);
169 Double_t chiMu = (*cgemDedxTds)->chi(1);
170 Double_t chiPi = (*cgemDedxTds)->chi(2);
171 Double_t chiK = (*cgemDedxTds)->chi(3);
172 Double_t chiP = (*cgemDedxTds)->chi(4);
173
174 Int_t numGoodHits = (*cgemDedxTds)->numGoodHits();
175 Int_t numTotalHits = (*cgemDedxTds)->numTotalHits();
176
177 Double_t probPH = (*cgemDedxTds)->probPH();
178 Double_t normPH = (*cgemDedxTds)->normPH();
179 Double_t errorPH = (*cgemDedxTds)->errorPH();
180 Double_t twentyPH =(*cgemDedxTds)->twentyPH();
181 //Double_t fracErrPH = (*dedxTds)-> fracErrPH();
182 //Double_t minIronPH = (*dedxTds)->minIronPH();
183 //Double_t corrPH = (*dedxTds)->corrPH();
184 log << MSG::INFO <<"check Reconstrunction root"<<" particle Id is : "<<particleId
185 <<"track id is : "<<trackId
186 <<" and status is : "<<status<<endreq;
187
188
189 TCgemDedx *cgemDedxRoot = new TCgemDedx();
190 //m_common.m_cgemDedxMap[(*cgemDedxTds)] = cgemDedxRoot;
191
192 cgemDedxRoot->setTrackId(trackId);
193 cgemDedxRoot->setParticleId(particleId);
194 cgemDedxRoot->setStatus (status);
195 cgemDedxRoot->setTruncAlg(truncAlg);
196 //dedxRoot->setProb(pb);
197 cgemDedxRoot->setChiE(chiE);
198 cgemDedxRoot->setChiMu(chiMu);
199 cgemDedxRoot->setChiPi(chiPi);
200 cgemDedxRoot->setChiK(chiK);
201 cgemDedxRoot->setChiP(chiP);
202
203 cgemDedxRoot->setNumGoodHits( numGoodHits);
204 cgemDedxRoot->setNumTotalHits( numTotalHits);
205
206 cgemDedxRoot->setProbPH(probPH);
207 cgemDedxRoot->setNormPH(normPH);
208 cgemDedxRoot->setErrorPH(errorPH);
209 cgemDedxRoot->setTwentyPH(twentyPH);
210 // dedxRoot->setFracErrPH(fracErrPH);
211 //dedxRoot->setMinIronPH(minIronPH);
212 //dedxRoot->setCorrPH(corrPH);
213 log << MSG::INFO << "check Reconstrunction root"<<" particle Id is : "<<particleId
214 <<"track id is : "<<trackId
215 <<" and status is : "<<status<<endreq;
216
217
218
219 recEvt->addCgemDedx(cgemDedxRoot);
220 }
221
222 return StatusCode::SUCCESS;
223}
ObjectVector< DstCgemDedx > DstCgemDedxCol
static TDstEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
const TObjArray * getCgemDedxCol() const
retrieve the whole TObjArray of Dedx Data
void addCgemDedx(TCgemDedx *Track)
Add a Dedx into the TOF Data collection.

◆ DataObjectToTObject() [2/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 38 of file bak_RootCnvSvc-04-01-14/src/Dst/CgemDedxCnv.cxx.

38 {
39 // creation of TDS object from root object
40
41 MsgStream log(msgSvc(), "CgemDedxCnv");
42 log << MSG::DEBUG << "CgemDedxCnv::TObjectToDataObject" << endreq;
43 StatusCode sc=StatusCode::SUCCESS;
44
45 // create the TDS location for the Dedx Collection
46 DstCgemDedxCol* cgemDedxTdsCol = new DstCgemDedxCol;
47 refpObject=cgemDedxTdsCol;
48
49
50 // now convert
51 if (!m_cgemDedxCol) return sc;
52 TIter cgemDedxIter(m_cgemDedxCol);
53 TCgemDedx *cgemDedxRoot = 0;
54 while ((cgemDedxRoot = (TCgemDedx*)cgemDedxIter.Next())) {
55
56 int trackId = cgemDedxRoot->trackId();
57 int particleId = cgemDedxRoot->particleId();
58 int status = cgemDedxRoot->status();
59 int truncAlg = cgemDedxRoot->truncAlg();
60 /*
61 double pb[5];
62 for ( int i = 0; i < 5; i++)
63 pb[i] = dedxRoot->prob(i);
64
65 double numSigmaE = dedxRoot->numSigmaE();
66 double numSigmaMu = dedxRoot->numSigmaMu();
67 double numSigmaPi = dedxRoot->numSigmaPi();
68 double numSigmaK = dedxRoot->numSigmaK();
69 double numSigmaP = dedxRoot->numSigmaP();
70 */
71 double chi[5];
72 chi[0] = cgemDedxRoot->chiE();
73 chi[1] = cgemDedxRoot->chiMu();
74 chi[2] = cgemDedxRoot->chiPi();
75 chi[3] = cgemDedxRoot->chiK();
76 chi[4] = cgemDedxRoot->chiP();
77 int numGoodHits = cgemDedxRoot->numGoodHits();
78 int numTotalHits = cgemDedxRoot->numTotalHits();
79
80 double probPH = cgemDedxRoot->probPH();
81 double normPH = cgemDedxRoot->normPH();
82 double errorPH = cgemDedxRoot->errorPH();
83 double twentyPH = cgemDedxRoot->twentyPH();
84 //double fracErrPH = dedxRoot-> fracErrPH();
85 //double minIronPH = dedxRoot->minIronPH();
86 //double corrPH = dedxRoot->corrPH();
87
88 DstCgemDedx *cgemDedxTds = new DstCgemDedx();
89 m_common.m_rootCgemDedxMap[cgemDedxRoot] = cgemDedxTds;
90
91 cgemDedxTds->setTrackId(trackId);
92 cgemDedxTds->setParticleId(particleId);
93 cgemDedxTds->setStatus (status);
94 cgemDedxTds->setTruncAlg(truncAlg);
95 /*
96 dedxTds->setProb(pb);
97 dedxTds->setNumSigmaE(numSigmaE);
98 dedxTds->setNumSigmaMu(numSigmaMu);
99 dedxTds->setNumSigmaPi(numSigmaPi);
100 dedxTds->setNumSigmaK(numSigmaK);
101 dedxTds->setNumSigmaP(numSigmaP);
102 */
103 cgemDedxTds->setChi(chi);
104
105 cgemDedxTds->setNumGoodHits( numGoodHits);
106 cgemDedxTds->setNumTotalHits( numTotalHits);
107
108 cgemDedxTds->setProbPH(probPH);
109 cgemDedxTds->setNormPH(normPH);
110 cgemDedxTds->setErrorPH(errorPH);
111 cgemDedxTds->setTwentyPH(twentyPH);
112 //dedxTds->setFracErrPH(fracErrPH);
113 //dedxTds->setMinIronPH(minIronPH);
114 //dedxTds->setCorrPH(corrPH);
115
116 cgemDedxTdsCol->push_back(cgemDedxTds);
117 //delete dedxTds;
118 // dedxTds = NULL;
119 }
120 //m_dedxCol->Delete();
121 delete m_cgemDedxCol;
122 m_cgemDedxCol = 0;
123 return StatusCode::SUCCESS;
124}
static std::map< const TObject *, const DstCgemDedx * > m_rootCgemDedxMap

◆ TObjectToDataObject() [2/3]

virtual StatusCode CgemDedxCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

virtual StatusCode CgemDedxCnv::TObjectToDataObject ( DataObject *&  obj)
protectedvirtual

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< CgemDedxCnv >


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