87{
88 MsgStream log(
msgSvc(),
"RecCgemClusterCnv");
89 log << MSG::DEBUG << "RecCgemClusterCnv::DataObjectToTObject" << endreq;
90
92 if (!cgemClusterColTds) {
93 log << MSG::ERROR << "Could not downcast to RecCgemClusterCol" << endreq;
94 return StatusCode::FAILURE;
95 }
96
97 DataObject *evt;
99 if (evt==NULL) {
100 log << MSG::ERROR << "Could not get ReconEvent in TDS " << endreq;
101 return StatusCode::FAILURE;
102 }
103
105 if (!devtTds) {
106 log << MSG::ERROR << "RecCgemHitCnv:Could not downcast to TDS ReconEvent" << endreq;
107 }
108
109 IOpaqueAddress *addr;
110
113
115 if (!m_recCgemClusterCol) return StatusCode::SUCCESS;
117
118 RecCgemClusterCol::const_iterator recCgemCluster;
119 for (recCgemCluster = cgemClusterColTds->begin(); recCgemCluster != cgemClusterColTds->end(); recCgemCluster++)
120 {
121 Int_t layerid = (*recCgemCluster)->getlayerid();
122 Int_t sheetid = (*recCgemCluster)->getsheetid();
123 Int_t clusterid = (*recCgemCluster)->getclusterid();
124 Int_t flag = (*recCgemCluster)->getflag();
125 Double_t energydeposit = (*recCgemCluster)->getenergydeposit();
126 Double_t recphi = (*recCgemCluster)->getrecphi();
127
128 Double_t recv = (*recCgemCluster)->getrecv();
129
130 Int_t trkid = (*recCgemCluster)->getTrkId();
131 Double_t recZ = (*recCgemCluster)->getRecZ();
132 Int_t clusterflag_b = (*recCgemCluster)->getclusterflagb();
133 Int_t clusterflag_e = (*recCgemCluster)->getclusterflage();
134
136
140 recCgemClusterRoot->
setflag(flag);
143
144 recCgemClusterRoot->
setrecv(recv);
145
146 recCgemClusterRoot->
setTrkId(trkid);
147 recCgemClusterRoot->
setRecZ(recZ);
149 Int_t stripid[2][2] = {-9999,-9999,-9999,-9999};
150 if(flag==0||flag==1){
151 stripid[flag][0] = clusterflag_b;
152 stripid[flag][1] = clusterflag_e;
153 }else if(flag==2||flag==3){
154 for(RecCgemClusterCol::const_iterator
iter = cgemClusterColTds->begin();
iter != cgemClusterColTds->end();
iter++){
155 if((*iter)->getclusterid() == clusterflag_b || (*iter)->getclusterid() == clusterflag_e){
156 Int_t Flag = (*iter)->getflag();
157 if(Flag==0||Flag==1){
158 stripid[Flag][0] = (*iter)->getclusterflagb();
159 stripid[Flag][1] = (*iter)->getclusterflage();
160 }
161 }
162 }
163 }
165
167 }
168 return StatusCode::SUCCESS;
169}
ObjectVector< RecCgemCluster > RecCgemClusterCol
static TRecTrackEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
RecTrackCnv * getRecTrackCnv()
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void setTrkId(Int_t trkid)
void setclusterflag(Int_t begin, Int_t end)
void setlayerid(Int_t layerid)
void setsheetid(Int_t sheetid)
void setrecphi(Double_t recphi)
void setRecZ(Double_t recZ)
void setstripid(Int_t type, Int_t i, Int_t value)
void setrecv(Double_t recv)
void setclusterid(Int_t clusterid)
void setenergydeposit(Double_t energydeposit)
void clearRecCgemClusterCol()
clear the whole array(necessary because of the consts-s)
const TObjArray * getRecCgemClusterCol() const
retrive the whole TObjArray of RecCgemCluster Data
void addRecCgemCluster(TRecCgemCluster *Cluster)
Add a Rec Cgem Cluster into the Cgem data collection.
_EXTERN_ std::string Event