133 {
134
135 MsgStream log(
msgSvc(),
"CgemMcHitCnv");
136 log << MSG::DEBUG << "CgemMcHitCnv::DataObjectToTObject" << endreq;
137 StatusCode sc=StatusCode::SUCCESS;
138
140 if (!cgemMcHitCnvTds) {
141 log << MSG::ERROR << "Could not downcast to CgemMcHitCol" << endreq;
142 return StatusCode::FAILURE;
143 }
144
145 DataObject *evt;
147 if (evt==NULL) {
148 log << MSG::ERROR << "Could not get McEvent in TDS " << endreq;
149 return StatusCode::FAILURE;
150 }
152 if (!devtTds) {
153 log << MSG::ERROR << "CgemMcHitCnv:Could not downcast to TDS McEvent" << endreq;
154 }
155 IOpaqueAddress *addr;
156
159
161 if (!m_cgemMcHitCol) return sc;
163 CgemMcHitCol::const_iterator cgemMcTds;
164
165 for (cgemMcTds = cgemMcHitCnvTds->begin(); cgemMcTds != cgemMcHitCnvTds->end(); cgemMcTds++)
166 {
167 unsigned int ID_track = (*cgemMcTds)->GetTrackID ();
168 unsigned int ID_layer = (*cgemMcTds)->GetLayerID ();
169
170 unsigned int pdg_code = (*cgemMcTds)->GetPDGCode ();
171 unsigned int ID_parent = (*cgemMcTds)->GetParentID ();
172
173 double E_deposit = (*cgemMcTds)->GetTotalEnergyDeposit ();
174 double XYZ_pre_x = (*cgemMcTds)->GetPositionXOfPrePoint ();
175 double XYZ_pre_y = (*cgemMcTds)->GetPositionYOfPrePoint ();
176 double XYZ_pre_z = (*cgemMcTds)->GetPositionZOfPrePoint ();
177 double XYZ_post_x = (*cgemMcTds)->GetPositionXOfPostPoint ();
178 double XYZ_post_y = (*cgemMcTds)->GetPositionYOfPostPoint ();
179 double XYZ_post_z = (*cgemMcTds)->GetPositionZOfPostPoint ();
180 double P_pre_x = (*cgemMcTds)->GetMomentumXOfPrePoint ();
181 double P_pre_y = (*cgemMcTds)->GetMomentumYOfPrePoint ();
182 double P_pre_z = (*cgemMcTds)->GetMomentumZOfPrePoint ();
183 double P_post_x = (*cgemMcTds)->GetMomentumXOfPostPoint ();
184 double P_post_y = (*cgemMcTds)->GetMomentumYOfPostPoint ();
185 double P_post_z = (*cgemMcTds)->GetMomentumZOfPostPoint ();
186
187 TArrayI ID_Identifier = (*cgemMcTds)->GetIdentifier ();
188
189 string creatorProcess = (*cgemMcTds)->GetCreatorProcess();
190 unsigned int isSecondary= (*cgemMcTds)->GetIsSecondary();
191 double trkLen_pre = (*cgemMcTds)->GetFlightLengthPrePoint();
192 double trkLen_post= (*cgemMcTds)->GetFlightLengthPostPoint();
193 const vector<int>& DigiIdxVec = (*cgemMcTds)->GetDigiIdxVec();
194 const vector<int>& XclusterIdxVec= (*cgemMcTds)->GetXclusterIdxVec();
195 const vector<int>& VclusterIdxVec= (*cgemMcTds)->GetVclusterIdxVec();
196
197
198
200
201
219
220 int tmp[2000];
221 for(int j = 0; j < ID_Identifier.GetSize(); j++){
222 tmp[j] = ID_Identifier.GetAt(j);
223 }
225
234 }
235
236 return StatusCode::SUCCESS;
237}
static TMcEvent * getWriteObject()
returns object to be written (maintained here for all DIGI-converters)
IDataProviderSvc * m_eds
pointer to eventdataservice
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)
Convert the transient object to the requested representation.
void SetIsSecondary(UInt_t isSec)
void AddIdentifier(Int_t f_ID_Identifier[2000], Int_t N_dim)
void SetMomentumZOfPrePoint(Double_t f_P_pre_z)
void SetMomentumYOfPostPoint(Double_t f_P_post_y)
void SetPositionZOfPostPoint(Double_t f_XYZ_post_z)
void SetMomentumXOfPrePoint(Double_t f_P_pre_x)
void SetCreatorProcess(std::string creatorProcess)
void SetVclusterIdxVec(const std::vector< int > &vec)
void SetParentID(UInt_t f_ID_parent)
void SetPositionXOfPrePoint(Double_t f_XYZ_pre_x)
void SetTrackID(UInt_t f_ID_track)
void SetPositionZOfPrePoint(Double_t f_XYZ_pre_z)
void SetMomentumYOfPrePoint(Double_t f_P_pre_y)
void SetLayerID(UInt_t f_ID_layer)
void SetPDGCode(UInt_t f_pdg_code)
void SetPositionYOfPrePoint(Double_t f_XYZ_pre_y)
void SetPositionYOfPostPoint(Double_t f_XYZ_post_y)
void SetPositionXOfPostPoint(Double_t f_XYZ_post_x)
void SetMomentumXOfPostPoint(Double_t f_P_post_x)
void SetXclusterIdxVec(const std::vector< int > &vec)
void SetMomentumZOfPostPoint(Double_t f_P_post_z)
void SetFlightLengthPrePoint(Double_t f_len)
void SetDigiIdxVec(const std::vector< int > &vec)
void SetFlightLengthPostPoint(Double_t f_len)
void SetTotalEnergyDeposit(Double_t f_E_deposit)
const TObjArray * getCgemMcHitCol() const
void addCgemMc(TCgemMc *mcHit)
Cgem.
_EXTERN_ std::string Event
ObjectVector< CgemMcHit > CgemMcHitCol