20 , m_thistSvc(
"THistSvc",
name)
21 , m_validationStream(
"ISFSimHit")
22 , m_t_simHits(nullptr)
35 , m_bcmHits(
"BCMHits")
36 , m_blmHits(
"BLMHits")
37 , m_pixHits(
"PixelHits")
38 , m_sctHits(
"SCT_Hits")
39 , m_trtHits(
"TRTUncompressedHits")
40 , m_pixPileupHits(
"PileupPixelHits")
41 , m_sctPileupHits(
"PileupSCT_Hits")
42 , m_trtPileupHits(
"PileupTRTUncompressedHits")
43 , m_mdtHits(
"MDT_Hits")
44 , m_rpcHits(
"RPC_Hits")
45 , m_tgcHits(
"TGC_Hits")
46 , m_cscHits(
"CSC_Hits")
50 "Name of the output stream" );
87 ATH_CHECK( m_pixPileupHits.initialize() );
88 ATH_CHECK( m_sctPileupHits.initialize() );
89 ATH_CHECK( m_trtPileupHits.initialize() );
94 return StatusCode::SUCCESS;
99 return StatusCode::SUCCESS;
107 const std::string
prefix =
"/" + m_validationStream +
"/"+
treeName;
109 m_t_simHits->Branch(
"pileup" , &m_pileup ,
"pileup/I" );
110 m_t_simHits->Branch(
"type" , &
m_type ,
"type/I" );
111 m_t_simHits->Branch(
"id" , &m_id ,
"id/I" );
112 m_t_simHits->Branch(
"mother" , &m_mother ,
"mother/I" );
113 m_t_simHits->Branch(
"barcode" , &m_barcode ,
"barcode/I" );
114 m_t_simHits->Branch(
"momentum" , &m_momentum ,
"momentum/F" );
115 m_t_simHits->Branch(
"time" , &m_time ,
"time/F" );
116 m_t_simHits->Branch(
"drift" , &m_drift ,
"dist/F" );
117 m_t_simHits->Branch(
"edeposit" , &m_edeposit ,
"edeposit/F" );
118 m_t_simHits->Branch(
"theta" , &m_theta ,
"theta/F" );
119 m_t_simHits->Branch(
"phi" , &m_phi ,
"phi/F" );
120 m_t_simHits->Branch(
"eta" , &m_eta ,
"eta/F" );
125 return StatusCode::SUCCESS;
136 while ( ih!=mdtHits->
end()) {
138 m_id = (*ih).MDTid();
139 m_mother = (*ih).particleEncoding();
140 m_time = (*ih).globalTime();
141 m_drift = (*ih).driftRadius();
142 m_edeposit = (*ih).energyDeposit();
143 m_barcode = (*ih).truthBarcode();
145 this->addHepMcParticleLinkInfoToTree(HMPL);
148 while (ih!=mdtHits->
end() && m_id==(*ih).MDTid() && m_barcode==(*ih).truthBarcode() ) {
150 m_edeposit += (*ih).energyDeposit();
160 while (ih!=rpcHits->
end()) {
162 m_id = (*ih).RPCid();
163 m_mother = (*ih).particleEncoding();
164 m_time = (*ih).globalTime();
166 m_edeposit = (*ih).energyDeposit();
167 m_barcode = (*ih).truthBarcode();
169 this->addHepMcParticleLinkInfoToTree(HMPL);
172 while (ih!=rpcHits->
end() && m_id==(*ih).RPCid() && m_barcode==(*ih).truthBarcode() ) {
174 m_edeposit += (*ih).energyDeposit();
184 while ( ih!=tgcHits->
end()) {
186 m_id = (*ih).TGCid();
187 m_mother = (*ih).particleEncoding();
188 m_time = (*ih).globalTime();
190 m_edeposit = (*ih).energyDeposit();
191 m_barcode = (*ih).truthBarcode();
193 this->addHepMcParticleLinkInfoToTree(HMPL);
196 while (ih!=tgcHits->
end() && m_id==(*ih).TGCid() && m_barcode==(*ih).truthBarcode() ) {
198 m_edeposit += (*ih).energyDeposit();
208 while ( ih!=cscHits->
end()) {
210 m_id = (*ih).CSCid();
211 m_mother = (*ih).particleID();
212 m_time = (*ih).globalTime();
214 m_edeposit = (*ih).energyDeposit();
215 m_barcode = (*ih).truthBarcode();
217 this->addHepMcParticleLinkInfoToTree(HMPL);
220 while (ih!=cscHits->
end() && m_id==(*ih).CSCid() && m_barcode==(*ih).truthBarcode() ) {
222 m_edeposit += (*ih).energyDeposit();
229 for (
int ipileup=0;ipileup<2;ipileup++) {
235 while (ih!=pixHits->
end()) {
237 m_id = (*ih).identify();
239 if (HMPL.
isValid()) m_mother = (HMPL.
cptr())->pdg_id();
241 m_time = (*ih).meanTime();
243 m_edeposit = (*ih).energyLoss();
244 m_barcode = (*ih).truthBarcode();
245 this->addHepMcParticleLinkInfoToTree(HMPL);
248 while (ih!=pixHits->
end() && ((
unsigned int)m_id)==(*ih).identify() && m_barcode==(*ih).truthBarcode() ) {
250 m_edeposit += (*ih).energyLoss();
260 while (ih!=sctHits->
end()) {
262 m_id = (*ih).identify();
264 if (HMPL.
isValid()) m_mother = (HMPL.
cptr())->pdg_id();
266 m_time = (*ih).meanTime();
268 m_edeposit = (*ih).energyLoss();
269 m_barcode = (*ih).truthBarcode();
270 this->addHepMcParticleLinkInfoToTree(HMPL);
273 while (ih!=sctHits->
end() && ((
unsigned int)m_id)==(*ih).identify() && m_barcode==(*ih).truthBarcode() ) {
275 m_edeposit += (*ih).energyLoss();
285 while ( ih!=trtHits->
end()) {
287 m_id = (*ih).GetHitID();
288 m_mother = (*ih).GetParticleEncoding();
290 m_time = (*ih).GetGlobalTime();
292 m_edeposit = (*ih).GetEnergyDeposit();
293 m_barcode = (*ih).truthBarcode();
294 this->addHepMcParticleLinkInfoToTree(HMPL);
297 while (ih!=trtHits->
end() && m_id==(*ih).GetHitID() && m_barcode==(*ih).truthBarcode() ) {
299 m_edeposit += (*ih).GetEnergyDeposit();
306 return StatusCode::SUCCESS;
313 m_momentum = std::sqrt( t_mom.x()*t_mom.x()+t_mom.y()*t_mom.y()+t_mom.z()*t_mom.z());