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

#include <RecCgemDedxCnv.h>

+ Inheritance diagram for RecCgemDedxCnv:

Public Member Functions

virtual ~RecCgemDedxCnv ()
 
virtual ~RecCgemDedxCnv ()
 
virtual ~RecCgemDedxCnv ()
 
- 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

 RecCgemDedxCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 RecCgemDedxCnv (ISvcLocator *svc)
 
virtual StatusCode DataObjectToTObject (DataObject *obj, RootAddress *addr)
 transformation to root
 
virtual StatusCode TObjectToDataObject (DataObject *&obj)
 transformation from root
 
 RecCgemDedxCnv (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< RecCgemDedxCnv >
 

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

◆ ~RecCgemDedxCnv() [1/3]

virtual RecCgemDedxCnv::~RecCgemDedxCnv ( )
inlinevirtual

◆ RecCgemDedxCnv() [1/3]

RecCgemDedxCnv::RecCgemDedxCnv ( ISvcLocator *  svc)
protected

Definition at line 27 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemDedxCnv.cxx.

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

◆ ~RecCgemDedxCnv() [2/3]

virtual RecCgemDedxCnv::~RecCgemDedxCnv ( )
inlinevirtual

◆ RecCgemDedxCnv() [2/3]

RecCgemDedxCnv::RecCgemDedxCnv ( ISvcLocator *  svc)
protected

◆ ~RecCgemDedxCnv() [3/3]

virtual RecCgemDedxCnv::~RecCgemDedxCnv ( )
inlinevirtual

◆ RecCgemDedxCnv() [3/3]

RecCgemDedxCnv::RecCgemDedxCnv ( ISvcLocator *  svc)
protected

Member Function Documentation

◆ classID() [1/3]

static const CLID & RecCgemDedxCnv::classID ( )
inlinestatic

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

21 {
22 return CLID_RecCgemDedxCol;
23 }
const CLID & CLID_RecCgemDedxCol
Definition: EventModel.cxx:412

◆ classID() [2/3]

static const CLID & RecCgemDedxCnv::classID ( )
inlinestatic

◆ classID() [3/3]

static const CLID & RecCgemDedxCnv::classID ( )
inlinestatic

◆ DataObjectToTObject() [1/3]

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

transformation to root

Implements RootEventBaseCnv.

Definition at line 141 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemDedxCnv.cxx.

141 {
142 MsgStream log(msgSvc(), "RecCgemDedxCnv");
143 log << MSG::DEBUG << "RecCgemDedxCnv::DataObjectToTObject" << endreq;
144 StatusCode sc=StatusCode::SUCCESS;
145
146 RecCgemDedxCol * recCgemDedxCol=dynamic_cast<RecCgemDedxCol *> (obj);
147 if (!recCgemDedxCol) {
148 log << MSG::ERROR << "Could not downcast to RecCgemDedxCol" << endreq;
149 return StatusCode::FAILURE;
150 }
151
152 DataObject *evt;
153 m_eds->findObject(EventModel::Recon::Event,evt);
154 if (evt==NULL) {
155 log << MSG::ERROR << "Could not get RecEvent in TDS " << endreq;
156 return StatusCode::FAILURE;
157 }
158 ReconEvent * devtTds=dynamic_cast<ReconEvent *> (evt);
159 if (!devtTds) {
160 log << MSG::ERROR << "RecCgemDedxCnv:Could not downcast to TDS RecEvent" << endreq;
161 }
162 IOpaqueAddress *addr;
163
164 m_cnvSvc->getRecTrackCnv()->createRep(evt,addr);
166
167 const TObjArray *m_recCgemDedxCol = recEvt->getRecCgemDedxCol();
168 if (!m_recCgemDedxCol) return sc;
169 recEvt->clearRecCgemDedxCol(); //necessary in case there is I/O at the same time since array is static
170 RecCgemDedxCol::const_iterator recCgemDedx;
171
172 for (recCgemDedx = recCgemDedxCol->begin(); recCgemDedx != recCgemDedxCol->end(); recCgemDedx++) {
173 Int_t trackId = (*recCgemDedx)->trackId();
174 Int_t particleId = (*recCgemDedx)->particleId();
175 Int_t status = (*recCgemDedx)->status();
176 Int_t truncAlg = (*recCgemDedx)->truncAlg();
177 // Double_t pb[5];
178 // for (Int_t i = 0; i < 5; i++)
179 // pb[i] = (*dedxTds)->prob(i);
180 Double_t dedxHit = (*recCgemDedx)->getDedxHit();
181 Double_t dedxEsat = (*recCgemDedx)->getDedxEsat();
182 Double_t dedxNoRun = (*recCgemDedx)->getDedxNoRun();
183 Double_t dedxMoment = (*recCgemDedx)->getDedxMoment();
184
185
186 Double_t chiE = (*recCgemDedx)->chi(0);
187 Double_t chiMu = (*recCgemDedx)->chi(1);
188 Double_t chiPi = (*recCgemDedx)->chi(2);
189 Double_t chiK = (*recCgemDedx)->chi(3);
190 Double_t chiP = (*recCgemDedx)->chi(4);
191
192 Int_t numGoodHits = (*recCgemDedx)->numGoodHits();
193 Int_t numTotalHits = (*recCgemDedx)->numTotalHits();
194
195 Double_t probPH = (*recCgemDedx)->probPH();
196 Double_t normPH = (*recCgemDedx)->normPH();
197 Double_t errorPH = (*recCgemDedx)->errorPH();
198 Double_t twentyPH = (*recCgemDedx)->twentyPH();
199 //Double_t fracErrPH = (*dedxTds)-> fracErrPH();
200 //Double_t minIronPH = (*dedxTds)->minIronPH();
201 //Double_t corrPH = (*dedxTds)->corrPH();
202 double dedxExpect[5],sigmaDedx[5],pidProb[5],chi[5];
203 for (int i=0; i<5; i++){
204 chi[i] = (*recCgemDedx)->chi(i);
205 dedxExpect[i] = (*recCgemDedx)->getDedxExpect(i);
206 sigmaDedx[i] = (*recCgemDedx)->getSigmaDedx(i);
207 pidProb[i] = (*recCgemDedx)->getPidProb(i);
208 }
209
210
211 TRecCgemDedx *recCgemDedxRoot = new TRecCgemDedx();
212 //m_common.m_recCgemDedxMap[(*recCgemDedx)] = recCgemDedxRoot;
213 //std::cout<<"check write to Reconstrunction root particle Id is "<<dedxRoot->particleId()<<endl;
214 recCgemDedxRoot->setTrackId(trackId);
215 recCgemDedxRoot->setParticleId(particleId);
216 recCgemDedxRoot->setStatus (status);
217 recCgemDedxRoot->setTruncAlg(truncAlg);
218 log << MSG::INFO<<"check Reconstrunction root"<<" particle Id is : "<<particleId
219 <<"track id is : "<<trackId
220 <<" and status is : "<<status<<endreq;
221 //dedxRoot->setProb(pb);
222 recCgemDedxRoot->setChiE(chiE);
223 recCgemDedxRoot->setChiMu(chiMu);
224 recCgemDedxRoot->setChiPi(chiPi);
225 recCgemDedxRoot->setChiK(chiK);
226 recCgemDedxRoot->setChiP(chiP);
227
228 recCgemDedxRoot->setNumGoodHits( numGoodHits);
229 recCgemDedxRoot->setNumTotalHits( numTotalHits);
230
231 recCgemDedxRoot->setProbPH(probPH);
232 recCgemDedxRoot->setNormPH(normPH);
233 recCgemDedxRoot->setErrorPH(errorPH);
234 recCgemDedxRoot->setTwentyPH(twentyPH);
235 // for (int i=0; i<5; i++){
236 recCgemDedxRoot->setChi(chi);
237 recCgemDedxRoot->setDedxExpect(dedxExpect);
238 recCgemDedxRoot->setSigmaDedx(sigmaDedx);
239 recCgemDedxRoot->setPidProb(pidProb);
240
241 recCgemDedxRoot->setDedxHit(dedxHit);
242 recCgemDedxRoot->setDedxEsat(dedxEsat);
243 recCgemDedxRoot->setDedxNoRun(dedxNoRun);
244 recCgemDedxRoot->setDedxMoment(dedxMoment);
245
246 //}
247 log << MSG::INFO<<"check Reconstrunction root"<<" particle Id is : "<<particleId
248 <<"track id is : "<<trackId
249 <<" and status is : "<<status<<endreq;
250
251 // dedxRoot->setFracErrPH(fracErrPH);
252 //dedxRoot->setMinIronPH(minIronPH);
253 //dedxRoot->setCorrPH(corrPH);
254 recEvt->addRecCgemDedx(recCgemDedxRoot);
255 }
256
257 return StatusCode::SUCCESS;
258}
static TRecTrackEvent * 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.
void addRecCgemDedx(TRecCgemDedx *Track)
Add a Dedx into the TOF Data collection.
const TObjArray * getRecCgemDedxCol() const
retrieve the whole TObjArray of Dedx Data

◆ DataObjectToTObject() [2/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ DataObjectToTObject() [3/3]

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

transformation to root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [1/3]

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

transformation from root

Implements RootEventBaseCnv.

Definition at line 41 of file bak_RootCnvSvc-04-01-14/src/Rec/RecCgemDedxCnv.cxx.

41 {
42 // creation of TDS object from root object
43 MsgStream log(msgSvc(), "RecCgemDedxCnv");
44 log << MSG::DEBUG << "RecCgemDedxCnv::TObjectToDataObject" << endreq;
45 StatusCode sc=StatusCode::SUCCESS;
46
47 // create the TDS location for the Dedx Collection
48 RecCgemDedxCol* recCgemDedxCol = new RecCgemDedxCol;
49 refpObject=recCgemDedxCol;
50
51
52 // now convert
53 if (!m_recCgemDedxCol) return sc;
54 TIter dedxIter(m_recCgemDedxCol);
55 TRecCgemDedx *recCgemDedxRoot = 0;
56 while ((recCgemDedxRoot = (TRecCgemDedx*)dedxIter.Next())) {
57 double dedxHit = recCgemDedxRoot->dedxHit();
58 double dedxEsat = recCgemDedxRoot->dedxEsat();
59 double dedxNoRun = recCgemDedxRoot->dedxNoRun();
60 double dedxMoment = recCgemDedxRoot->dedxMoment();
61
62 int trackId = recCgemDedxRoot->trackId();
63 int particleId = recCgemDedxRoot->particleId();
64 int status = recCgemDedxRoot->status();
65 int truncAlg = recCgemDedxRoot->truncAlg();
66 // double pb[5];
67 // for ( int i = 0; i < 5; i++)
68 // pb[i] = dedxRoot->prob(i);
69
70 // double numSigmaE = dedxRoot->numSigmaE();
71 // double numSigmaMu = dedxRoot->numSigmaMu();
72 // double numSigmaPi = dedxRoot->numSigmaPi();
73 // double numSigmaK = dedxRoot->numSigmaK();
74 // double numSigmaP = dedxRoot->numSigmaP();
75 double chi[5];
76 chi[0] = recCgemDedxRoot->chiE();
77 chi[1] = recCgemDedxRoot->chiMu();
78 chi[2] = recCgemDedxRoot->chiPi();
79 chi[3] = recCgemDedxRoot->chiK();
80 chi[4] = recCgemDedxRoot->chiP();
81 int numGoodHits = recCgemDedxRoot->numGoodHits();
82 int numTotalHits = recCgemDedxRoot->numTotalHits();
83
84 double probPH = recCgemDedxRoot->probPH();
85 double normPH = recCgemDedxRoot->normPH();
86 double errorPH = recCgemDedxRoot->errorPH();
87 double twentyPH = recCgemDedxRoot->twentyPH();
88 double dedxExpect[5],sigmaDedx[5],pidProb[5];
89 for (int i=0; i<5; i++){
90 dedxExpect[i] = recCgemDedxRoot->dedxExpect(i);
91 sigmaDedx[i] = recCgemDedxRoot->sigmaDedx(i);
92 pidProb[i] = recCgemDedxRoot->pidProb(i);}
93
94 RecCgemDedx *recCgemDedx = new RecCgemDedx();
95 m_common.m_rootRecCgemDedxMap[recCgemDedxRoot] = recCgemDedx;
96
97 recCgemDedx->setTrackId(trackId);
98 recCgemDedx->setParticleId(particleId);
99 recCgemDedx->setStatus (status);
100 recCgemDedx->setTruncAlg(truncAlg);
101 // dedxTds->setProb(pb);
102 // dedxTds->setNumSigmaE(numSigmaE);
103 // dedxTds->setNumSigmaMu(numSigmaMu);
104 // dedxTds->setNumSigmaPi(numSigmaPi);
105 // dedxTds->setNumSigmaK(numSigmaK);
106 // dedxTds->setNumSigmaP(numSigmaP);
107 recCgemDedx->setChi(chi);
108 recCgemDedx->setNumGoodHits( numGoodHits);
109 recCgemDedx->setNumTotalHits( numTotalHits);
110
111 recCgemDedx->setProbPH(probPH);
112 recCgemDedx->setNormPH(normPH);
113 recCgemDedx->setErrorPH(errorPH);
114 recCgemDedx->setTwentyPH(twentyPH);
115 //for (int i=0; i<5; i++){
116 recCgemDedx->setDedxExpect(dedxExpect);
117 recCgemDedx->setSigmaDedx(sigmaDedx);
118 recCgemDedx->setPidProb(pidProb);
119
120 recCgemDedx->setDedxHit(dedxHit);
121 recCgemDedx->setDedxEsat(dedxEsat);
122 recCgemDedx->setDedxNoRun(dedxNoRun);
123 recCgemDedx->setDedxMoment(dedxMoment);
124
125 //}
126
127
128
129 recCgemDedxCol->push_back(recCgemDedx);
130 //delete dedxTds;
131 // dedxTds = NULL;
132 }
133 //m_dedxCol->Delete();
134 delete m_recCgemDedxCol;
135 m_recCgemDedxCol = 0;
136
137 return StatusCode::SUCCESS;
138}
static std::map< const TObject *, const RecCgemDedx * > m_rootRecCgemDedxMap

◆ TObjectToDataObject() [2/3]

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

transformation from root

Implements RootEventBaseCnv.

◆ TObjectToDataObject() [3/3]

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

transformation from root

Implements RootEventBaseCnv.

Friends And Related Function Documentation

◆ CnvFactory< RecCgemDedxCnv >


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