11 #include "CaloDetDescr/CaloDetDescrElement.h"
36 #include "GaudiKernel/MsgStream.h"
59 #include "GaudiKernel/IPartPropSvc.h"
60 #include "HepPDT/ParticleData.hh"
61 #include "HepPDT/ParticleDataTable.hh"
90 bool run_update =
false;
95 std::list< std::string >::const_iterator itr =
keys.begin();
96 std::list< std::string >::const_iterator
end =
keys.end();
97 for( ; itr !=
end; ++itr )
104 if( ! run_update )
return StatusCode::SUCCESS;
113 AthenaAttributeList::const_iterator attr_itr = simParam->begin();
114 AthenaAttributeList::const_iterator attr_end = simParam->end();
115 for( ; attr_itr != attr_end; ++attr_itr )
117 std::stringstream outstr;
118 attr_itr->toOutputStream(outstr);
123 return StatusCode::SUCCESS;
139 m_larEmID=caloIdManager->getEM_ID();
140 if(m_larEmID==
nullptr)
141 throw std::runtime_error(
"ISF_HitAnalysis: Invalid LAr EM ID helper");
142 m_larFcalID=caloIdManager->getFCAL_ID();
143 if(m_larFcalID==
nullptr)
144 throw std::runtime_error(
"ISF_HitAnalysis: Invalid FCAL ID helper");
145 m_larHecID=caloIdManager->getHEC_ID();
146 if(m_larHecID==
nullptr)
147 throw std::runtime_error(
"ISF_HitAnalysis: Invalid HEC ID helper");
148 m_tileID=caloIdManager->getTileID();
149 if(m_tileID==
nullptr)
150 throw std::runtime_error(
"ISF_HitAnalysis: Invalid Tile ID helper");
155 ATH_CHECK( m_tileSamplingFractionKey.initialize() );
157 ATH_CHECK( m_tileCablingSvc.retrieve() );
158 m_tileCabling = m_tileCablingSvc->cablingService();
163 if (!m_extrapolator.empty() && m_extrapolator.retrieve().isFailure()) {
164 return StatusCode::FAILURE;
171 if(
detStore()->contains< AthenaAttributeList >( m_MC_DIGI_PARAM ) )
176 ATH_MSG_ERROR(
"Could not register callback for "<< m_MC_DIGI_PARAM );
177 return StatusCode::FAILURE;
185 if(
detStore()->contains< AthenaAttributeList >( m_MC_SIM_PARAM ) )
190 ATH_MSG_ERROR(
"Could not register callback for "<< m_MC_SIM_PARAM );
191 return StatusCode::FAILURE;
199 ATH_CHECK (m_FastCaloSimCaloExtrapolation.retrieve());
205 IPartPropSvc* p_PartPropSvc =
nullptr;
206 ATH_CHECK(service(
"PartPropSvc",p_PartPropSvc));
208 m_particleDataTable = (HepPDT::ParticleDataTable*) p_PartPropSvc->PDT();
209 if(m_particleDataTable ==
nullptr)
212 return StatusCode::FAILURE;
215 std::unique_ptr<TFile> dummyFile = std::unique_ptr<TFile>(TFile::Open(
"dummyFile.root",
"RECREATE"));
216 m_tree =
new TTree(
"FCS_ParametrizationInput",
"FCS_ParametrizationInput");
217 std::string fullNtupleName =
"/"+m_ntupleFileName+
"/"+m_ntupleTreeName;
218 StatusCode sc = m_thistSvc->regTree(fullNtupleName, m_tree);
219 if (
sc.isFailure() || !m_tree )
221 ATH_MSG_ERROR(
"Unable to register TTree: " << fullNtupleName);
222 return StatusCode::FAILURE;
228 ATH_MSG_INFO(
"Successfull registered TTree: " << fullNtupleName);
230 m_hit_x =
new std::vector<float>;
231 m_hit_y =
new std::vector<float>;
232 m_hit_z =
new std::vector<float>;
233 m_hit_energy =
new std::vector<float>;
234 m_hit_time =
new std::vector<float>;
235 m_hit_identifier =
new std::vector<Long64_t>;
236 m_hit_cellidentifier =
new std::vector<Long64_t>;
237 m_islarbarrel =
new std::vector<bool>;
238 m_islarendcap =
new std::vector<bool>;
239 m_islarhec =
new std::vector<bool>;
240 m_islarfcal =
new std::vector<bool>;
241 m_istile =
new std::vector<bool>;
242 m_hit_sampling =
new std::vector<int>;
243 m_hit_samplingfraction =
new std::vector<float>;
245 m_truth_energy =
new std::vector<float>;
246 m_truth_px =
new std::vector<float>;
247 m_truth_py =
new std::vector<float>;
248 m_truth_pz =
new std::vector<float>;
249 m_truth_pdg =
new std::vector<int>;
250 m_truth_barcode =
new std::vector<int>;
251 m_truth_vtxbarcode =
new std::vector<int>;
253 m_cluster_energy =
new std::vector<float>;
254 m_cluster_eta =
new std::vector<float>;
255 m_cluster_phi =
new std::vector<float>;
256 m_cluster_size =
new std::vector<unsigned>;
257 m_cluster_cellID =
new std::vector<std::vector<Long64_t > >;
259 m_cell_identifier =
new std::vector<Long64_t>;
260 m_cell_energy =
new std::vector<float>;
261 m_cell_sampling =
new std::vector<int>;
263 m_g4hit_energy =
new std::vector<float>;
264 m_g4hit_time =
new std::vector<float>;
265 m_g4hit_identifier =
new std::vector<Long64_t>;
266 m_g4hit_cellidentifier =
new std::vector<Long64_t>;
267 m_g4hit_samplingfraction =
new std::vector<float>;
268 m_g4hit_sampling =
new std::vector<int>;
274 m_final_cell_energy =
new std::vector<Float_t>;
275 m_final_hit_energy =
new std::vector<Float_t>;
276 m_final_g4hit_energy =
new std::vector<Float_t>;
278 m_newTTC_entrance_eta =
new std::vector<std::vector<float> >;
279 m_newTTC_entrance_phi =
new std::vector<std::vector<float> >;
280 m_newTTC_entrance_r =
new std::vector<std::vector<float> >;
281 m_newTTC_entrance_z =
new std::vector<std::vector<float> >;
282 m_newTTC_entrance_detaBorder =
new std::vector<std::vector<float> >;
283 m_newTTC_entrance_OK =
new std::vector<std::vector<bool> >;
284 m_newTTC_back_eta =
new std::vector<std::vector<float> >;
285 m_newTTC_back_phi =
new std::vector<std::vector<float> >;
286 m_newTTC_back_r =
new std::vector<std::vector<float> >;
287 m_newTTC_back_z =
new std::vector<std::vector<float> >;
288 m_newTTC_back_detaBorder =
new std::vector<std::vector<float> >;
289 m_newTTC_back_OK =
new std::vector<std::vector<bool> >;
290 m_newTTC_mid_eta =
new std::vector<std::vector<float> >;
291 m_newTTC_mid_phi =
new std::vector<std::vector<float> >;
292 m_newTTC_mid_r =
new std::vector<std::vector<float> >;
293 m_newTTC_mid_z =
new std::vector<std::vector<float> >;
294 m_newTTC_mid_detaBorder =
new std::vector<std::vector<float> >;
295 m_newTTC_mid_OK =
new std::vector<std::vector<bool> >;
296 m_newTTC_IDCaloBoundary_eta =
new std::vector<float>;
297 m_newTTC_IDCaloBoundary_phi =
new std::vector<float>;
298 m_newTTC_IDCaloBoundary_r =
new std::vector<float>;
299 m_newTTC_IDCaloBoundary_z =
new std::vector<float>;
300 m_newTTC_Angle3D =
new std::vector<float>;
301 m_newTTC_AngleEta =
new std::vector<float>;
303 m_MuonEntryLayer_E =
new std::vector<float>;
304 m_MuonEntryLayer_px =
new std::vector<float>;
305 m_MuonEntryLayer_py =
new std::vector<float>;
306 m_MuonEntryLayer_pz =
new std::vector<float>;
307 m_MuonEntryLayer_x =
new std::vector<float>;
308 m_MuonEntryLayer_y =
new std::vector<float>;
309 m_MuonEntryLayer_z =
new std::vector<float>;
310 m_MuonEntryLayer_pdg =
new std::vector<int>;
313 if(m_saveAllBranches){
314 m_tree->Branch(
"HitX", &m_hit_x);
315 m_tree->Branch(
"HitY", &m_hit_y);
316 m_tree->Branch(
"HitZ", &m_hit_z);
317 m_tree->Branch(
"HitE", &m_hit_energy);
318 m_tree->Branch(
"HitT", &m_hit_time);
319 m_tree->Branch(
"HitIdentifier", &m_hit_identifier);
320 m_tree->Branch(
"HitCellIdentifier", &m_hit_cellidentifier);
321 m_tree->Branch(
"HitIsLArBarrel", &m_islarbarrel);
322 m_tree->Branch(
"HitIsLArEndCap", &m_islarendcap);
323 m_tree->Branch(
"HitIsHEC", &m_islarhec);
324 m_tree->Branch(
"HitIsFCAL", &m_islarfcal);
325 m_tree->Branch(
"HitIsTile", &m_istile);
326 m_tree->Branch(
"HitSampling", &m_hit_sampling);
327 m_tree->Branch(
"HitSamplingFraction", &m_hit_samplingfraction);
329 m_tree->Branch(
"CellIdentifier", &m_cell_identifier);
330 m_tree->Branch(
"CellE", &m_cell_energy);
331 m_tree->Branch(
"CellSampling", &m_cell_sampling);
333 m_tree->Branch(
"G4HitE", &m_g4hit_energy);
334 m_tree->Branch(
"G4HitT", &m_g4hit_time);
335 m_tree->Branch(
"G4HitIdentifier", &m_g4hit_identifier);
336 m_tree->Branch(
"G4HitCellIdentifier", &m_g4hit_cellidentifier);
337 m_tree->Branch(
"G4HitSamplingFraction",&m_g4hit_samplingfraction);
338 m_tree->Branch(
"G4HitSampling", &m_g4hit_sampling);
342 m_tree->Branch(
"TruthE", &m_truth_energy);
343 m_tree->Branch(
"TruthPx", &m_truth_px);
344 m_tree->Branch(
"TruthPy", &m_truth_py);
345 m_tree->Branch(
"TruthPz", &m_truth_pz);
346 m_tree->Branch(
"TruthPDG", &m_truth_pdg);
347 m_tree->Branch(
"TruthBarcode", &m_truth_barcode);
348 m_tree->Branch(
"TruthVtxBarcode", &m_truth_vtxbarcode);
351 m_tree->Branch(
"ClusterE", &m_cluster_energy);
352 m_tree->Branch(
"ClusterEta", &m_cluster_eta);
353 m_tree->Branch(
"ClusterPhi", &m_cluster_phi);
354 m_tree->Branch(
"ClusterSize", &m_cluster_size);
355 m_tree->Branch(
"ClusterCellID", &m_cluster_cellID);
360 m_tree->Branch(
"AllCells", &m_oneeventcells);
365 for (Int_t
i = 0;
i < MAX_LAYER;
i++)
376 m_tree->Branch(
"cell_energy", &m_final_cell_energy);
377 m_tree->Branch(
"hit_energy", &m_final_hit_energy);
378 m_tree->Branch(
"g4hit_energy", &m_final_g4hit_energy);
381 m_tree->Branch(
"total_cell_energy", &m_total_cell_e);
382 m_tree->Branch(
"total_hit_energy", &m_total_hit_e);
383 m_tree->Branch(
"total_g4hit_energy", &m_total_g4hit_e);
386 m_tree->Branch(
"newTTC_back_eta",&m_newTTC_back_eta);
387 m_tree->Branch(
"newTTC_back_phi",&m_newTTC_back_phi);
388 m_tree->Branch(
"newTTC_back_r",&m_newTTC_back_r);
389 m_tree->Branch(
"newTTC_back_z",&m_newTTC_back_z);
390 m_tree->Branch(
"newTTC_back_detaBorder",&m_newTTC_back_detaBorder);
391 m_tree->Branch(
"newTTC_back_OK",&m_newTTC_back_OK);
392 m_tree->Branch(
"newTTC_entrance_eta",&m_newTTC_entrance_eta);
393 m_tree->Branch(
"newTTC_entrance_phi",&m_newTTC_entrance_phi);
394 m_tree->Branch(
"newTTC_entrance_r",&m_newTTC_entrance_r);
395 m_tree->Branch(
"newTTC_entrance_z",&m_newTTC_entrance_z);
396 m_tree->Branch(
"newTTC_entrance_detaBorder",&m_newTTC_entrance_detaBorder);
397 m_tree->Branch(
"newTTC_entrance_OK",&m_newTTC_entrance_OK);
398 m_tree->Branch(
"newTTC_mid_eta",&m_newTTC_mid_eta);
399 m_tree->Branch(
"newTTC_mid_phi",&m_newTTC_mid_phi);
400 m_tree->Branch(
"newTTC_mid_r",&m_newTTC_mid_r);
401 m_tree->Branch(
"newTTC_mid_z",&m_newTTC_mid_z);
402 m_tree->Branch(
"newTTC_mid_detaBorder",&m_newTTC_mid_detaBorder);
403 m_tree->Branch(
"newTTC_mid_OK",&m_newTTC_mid_OK);
404 m_tree->Branch(
"newTTC_IDCaloBoundary_eta",&m_newTTC_IDCaloBoundary_eta);
405 m_tree->Branch(
"newTTC_IDCaloBoundary_phi",&m_newTTC_IDCaloBoundary_phi);
406 m_tree->Branch(
"newTTC_IDCaloBoundary_r",&m_newTTC_IDCaloBoundary_r);
407 m_tree->Branch(
"newTTC_IDCaloBoundary_z",&m_newTTC_IDCaloBoundary_z);
408 m_tree->Branch(
"newTTC_Angle3D",&m_newTTC_Angle3D);
409 m_tree->Branch(
"newTTC_AngleEta",&m_newTTC_AngleEta);
411 m_tree->Branch(
"MuonEntryLayer_E",&m_MuonEntryLayer_E);
412 m_tree->Branch(
"MuonEntryLayer_px",&m_MuonEntryLayer_px);
413 m_tree->Branch(
"MuonEntryLayer_py",&m_MuonEntryLayer_py);
414 m_tree->Branch(
"MuonEntryLayer_pz",&m_MuonEntryLayer_pz);
415 m_tree->Branch(
"MuonEntryLayer_x",&m_MuonEntryLayer_x);
416 m_tree->Branch(
"MuonEntryLayer_y",&m_MuonEntryLayer_y);
417 m_tree->Branch(
"MuonEntryLayer_z",&m_MuonEntryLayer_z);
418 m_tree->Branch(
"MuonEntryLayer_pdg",&m_MuonEntryLayer_pdg);
421 return StatusCode::SUCCESS;
428 std::unique_ptr<TFile> dummyGeoFile = std::unique_ptr<TFile>(TFile::Open(
"dummyGeoFile.root",
"RECREATE"));
429 TTree*
geo =
new TTree( m_geoModel->atlasVersion().c_str() , m_geoModel->atlasVersion().c_str() );
430 std::string fullNtupleName =
"/"+m_geoFileName+
"/"+m_geoModel->atlasVersion();
432 if(
sc.isFailure() || !
geo )
434 ATH_MSG_ERROR(
"Unable to register TTree: " << fullNtupleName);
435 return StatusCode::FAILURE;
440 using GEOCELL =
struct
444 float eta,
phi,
r,eta_raw,phi_raw,r_raw,
x,
y,
z,x_raw,y_raw,z_raw;
445 float deta,dphi,
dr,
dx,
dy,dz;
448 static GEOCELL geocell;
452 ATH_MSG_INFO(
"Successfull registered TTree: " << fullNtupleName);
455 geo->Branch(
"identifier", &geocell.identifier,
"identifier/L");
456 geo->Branch(
"calosample", &geocell.calosample,
"calosample/I");
458 geo->Branch(
"eta", &geocell.eta,
"eta/F");
459 geo->Branch(
"phi", &geocell.phi,
"phi/F");
460 geo->Branch(
"r", &geocell.r,
"r/F");
461 geo->Branch(
"eta_raw", &geocell.eta_raw,
"eta_raw/F");
462 geo->Branch(
"phi_raw", &geocell.phi_raw,
"phi_raw/F");
463 geo->Branch(
"r_raw", &geocell.r_raw,
"r_raw/F");
465 geo->Branch(
"x", &geocell.x,
"x/F");
466 geo->Branch(
"y", &geocell.y,
"y/F");
467 geo->Branch(
"z", &geocell.z,
"z/F");
468 geo->Branch(
"x_raw", &geocell.x_raw,
"x_raw/F");
469 geo->Branch(
"y_raw", &geocell.y_raw,
"y_raw/F");
470 geo->Branch(
"z_raw", &geocell.z_raw,
"z_raw/F");
472 geo->Branch(
"deta", &geocell.deta,
"deta/F");
473 geo->Branch(
"dphi", &geocell.dphi,
"dphi/F");
474 geo->Branch(
"dr", &geocell.dr,
"dr/F");
475 geo->Branch(
"dx", &geocell.dx,
"dx/F");
476 geo->Branch(
"dy", &geocell.dy,
"dy/F");
477 geo->Branch(
"dz", &geocell.dz,
"dz/F");
494 geocell.identifier=theDDE->identify().get_compact();
495 geocell.calosample=
sample;
496 geocell.eta=theDDE->eta();
497 geocell.phi=theDDE->phi();
498 geocell.r=theDDE->r();
499 geocell.eta_raw=theDDE->eta_raw();
500 geocell.phi_raw=theDDE->phi_raw();
501 geocell.r_raw=theDDE->r_raw();
502 geocell.x=theDDE->x();
503 geocell.y=theDDE->y();
504 geocell.z=theDDE->z();
505 geocell.x_raw=theDDE->x_raw();
506 geocell.y_raw=theDDE->y_raw();
507 geocell.z_raw=theDDE->z_raw();
508 geocell.deta=theDDE->deta();
509 geocell.dphi=theDDE->dphi();
510 geocell.dr=theDDE->dr();
511 geocell.dx=theDDE->dx();
512 geocell.dy=theDDE->dy();
513 geocell.dz=theDDE->dz();
522 dummyGeoFile->Close();
523 return StatusCode::SUCCESS;
535 return StatusCode::FAILURE;
547 vectest.SetPtEtaPhi(1.,1.,1.);
585 std::map<Long64_t, FCS_cell>
cells;
586 std::map<Long64_t, std::vector<FCS_g4hit> > g4hits;
587 std::map<Long64_t, std::vector<FCS_hit> >
hits;
647 if (
sc.isFailure()) {
653 m_hit_x->push_back( (*it)->x() );
654 m_hit_y->push_back( (*it)->y() );
655 m_hit_z->push_back( (*it)->z() );
660 bool larbarrel=
false;
661 bool larendcap=
false;
704 Int_t tile_sampling = -1;
708 if(tile_sampling!= -1) sampling = tile_sampling;
730 sc =
evtStore()->retrieve(mcEvent,
"TruthEvent");
736 if(!mcEvent->
empty()) {
739 int particles_size=(*mcEvent->
begin())->particles_size();
741 loopEnd = particles_size;
744 for (
const auto&
part: *(*mcEvent->
begin()))
746 for (
const auto part: *(*mcEvent->
begin()))
750 ATH_MSG_DEBUG(
"Number truth particles="<<particles_size<<
" loopEnd="<<loopEnd);
753 if (particleIndex>loopEnd)
break;
761 moment.SetXYZ(
part->momentum().px(),
part->momentum().py(),
part->momentum().pz());
762 TVector3 direction=moment.Unit();
774 if((
part)->production_vertex()) {
775 truth.
set_vertex((
part)->production_vertex()->position().
x(), (
part)->production_vertex()->position().
y(), (
part)->production_vertex()->position().
z());
777 truth.
set_vertex(direction.X(),direction.Y(),direction.Z());
778 ATH_MSG_WARNING(
"No particle production vetext, use VERTEX from direction: x "<<direction.X()<<
" y "<<direction.Y()<<
" z "<<direction.Z());
781 if( std::abs(direction.X()-truth.
vertex().X())>0.1 || std::abs(direction.Y()-truth.
vertex().Y())>0.1 || std::abs(direction.Z()-truth.
vertex().Z())>0.1 ) {
782 ATH_MSG_WARNING(
"VERTEX from direction: x "<<direction.X()<<
" y "<<direction.Y()<<
" z "<<direction.Z());
805 std::vector<float> eta_vec_ENT;
806 std::vector<float> phi_vec_ENT;
807 std::vector<float> r_vec_ENT;
808 std::vector<float> z_vec_ENT;
809 std::vector<float> detaBorder_vec_ENT;
810 std::vector<bool> OK_vec_ENT;
812 std::vector<float> eta_vec_EXT;
813 std::vector<float> phi_vec_EXT;
814 std::vector<float> r_vec_EXT;
815 std::vector<float> z_vec_EXT;
816 std::vector<float> detaBorder_vec_EXT;
817 std::vector<bool> OK_vec_EXT;
819 std::vector<float> eta_vec_MID;
820 std::vector<float> phi_vec_MID;
821 std::vector<float> r_vec_MID;
822 std::vector<float> z_vec_MID;
823 std::vector<float> detaBorder_vec_MID;
824 std::vector<bool> OK_vec_MID;
887 sc =
evtStore()->retrieve(MuonEntry,
"MuonEntryLayer");
909 std::string clusterContainerName =
"CaloCalTopoClusters";
910 sc =
evtStore()->retrieve(theClusters, clusterContainerName);
911 if (
sc.isFailure()) {
912 ATH_MSG_WARNING(
" Couldn't get cluster container '" << clusterContainerName <<
"'");
913 return StatusCode::SUCCESS;
917 for ( ; itrClus!=itrLastClus; ++itrClus){
935 unsigned cellcount = 0;
936 std::vector<Long64_t> cellIDs_in_cluster;
939 for ( ;cellIter !=cellIterEnd;cellIter++) {
942 cellIDs_in_cluster.push_back(
cell->ID().get_compact());
943 float EnergyCell=
cell->energy();
952 sc =
evtStore()->retrieve(cellColl,
"AllCalo");
963 for ( ; itrCell!=itrLastCell; ++itrCell)
971 else if (calo_dd_man->
get_element((*itrCell)->ID()))
983 std::string lArKey [4] = {
"LArHitEMB",
"LArHitEMEC",
"LArHitFCAL",
"LArHitHEC"};
984 for (
unsigned int i=0;
i<4;
i++)
992 for (hi=(*iter).begin();hi!=(*iter).end();++hi) {
994 const LArHit* larHit = *hi;
1002 float larsampfrac=fSampl->
FSAMPL(larhitid);
1011 ATH_MSG_INFO(
"Read "<<hitnumber<<
" G4Hits from "<<lArKey[
i]);
1039 for (
int tilesubhit_i = 0; tilesubhit_i<(*i_hit).size(); tilesubhit_i++)
1042 m_g4hit_time->push_back( (*i_hit).time(tilesubhit_i) );
1050 ATH_MSG_INFO(
"Read "<<hitnumber<<
" G4Hits from TileHitVec");
1060 one_cell.cell_identifier = (*m_cell_identifier)[cell_i];
1061 one_cell.sampling = (*m_cell_sampling)[cell_i];
1062 one_cell.energy = (*m_cell_energy)[cell_i];
1063 one_cell.center_x = 0.0;
1064 one_cell.center_y = 0.0;
1065 one_cell.center_z = 0.0;
1066 cells.insert(std::pair<Long64_t, FCS_cell>(one_cell.cell_identifier, one_cell));
1088 one_g4hit.identifier = (*m_g4hit_identifier)[g4hit_i];
1089 one_g4hit.cell_identifier = (*m_g4hit_cellidentifier)[g4hit_i];
1090 one_g4hit.sampling = (*m_g4hit_sampling)[g4hit_i];
1091 one_g4hit.hit_time = (*m_g4hit_time)[g4hit_i];
1093 if (one_g4hit.sampling >= 12 && one_g4hit.sampling <= 20)
1097 one_g4hit.hit_energy = (*m_g4hit_energy)[g4hit_i] * (*m_g4hit_samplingfraction)[g4hit_i];
1099 else one_g4hit.hit_energy = 0.;
1103 one_g4hit.hit_energy = (*m_g4hit_energy)[g4hit_i] / (*m_g4hit_samplingfraction)[g4hit_i];
1105 g4hits.insert(std::pair<Long64_t, std::vector<FCS_g4hit> >(one_g4hit.cell_identifier, std::vector<FCS_g4hit>(1, one_g4hit)));
1110 one_g4hit.identifier = (*m_g4hit_identifier)[g4hit_i];
1111 one_g4hit.cell_identifier = (*m_g4hit_cellidentifier)[g4hit_i];
1112 one_g4hit.sampling = (*m_g4hit_sampling)[g4hit_i];
1113 one_g4hit.hit_time = (*m_g4hit_time)[g4hit_i];
1114 if (one_g4hit.sampling >= 12 && one_g4hit.sampling <= 20)
1118 one_g4hit.hit_energy = (*m_g4hit_energy)[g4hit_i] * (*m_g4hit_samplingfraction)[g4hit_i];
1120 else one_g4hit.hit_energy = 0.;
1124 one_g4hit.hit_energy = (*m_g4hit_energy)[g4hit_i] / (*m_g4hit_samplingfraction)[g4hit_i];
1126 g4hits[(*m_g4hit_cellidentifier)[g4hit_i]].push_back(one_g4hit);
1142 one_hit.identifier = (*m_hit_identifier)[hit_i];
1143 one_hit.cell_identifier = (*m_hit_cellidentifier)[hit_i];
1144 one_hit.sampling = (*m_hit_sampling)[hit_i];
1146 if (one_hit.sampling >= 12 && one_hit.sampling <= 20)
1150 one_hit.hit_energy = (*m_hit_energy)[hit_i] * (*m_hit_samplingfraction)[hit_i];
1152 else one_hit.hit_energy = 0.;
1156 one_hit.hit_energy = (*m_hit_energy)[hit_i] / (*m_hit_samplingfraction)[hit_i];
1159 one_hit.hit_time = (*m_hit_time)[hit_i];
1160 one_hit.hit_x = (*m_hit_x)[hit_i];
1161 one_hit.hit_y = (*m_hit_y)[hit_i];
1162 one_hit.hit_z = (*m_hit_z)[hit_i];
1163 hits.insert(std::pair<Long64_t, std::vector<FCS_hit> >(one_hit.cell_identifier, std::vector<FCS_hit>(1, one_hit)));
1168 one_hit.identifier = (*m_hit_identifier)[hit_i];
1169 one_hit.cell_identifier = (*m_hit_cellidentifier)[hit_i];
1170 one_hit.sampling = (*m_hit_sampling)[hit_i];
1172 if (one_hit.sampling >= 12 && one_hit.sampling <= 20)
1176 one_hit.hit_energy = (*m_hit_energy)[hit_i] * (*m_hit_samplingfraction)[hit_i];
1178 else one_hit.hit_energy = 0.;
1182 one_hit.hit_energy = (*m_hit_energy)[hit_i] / (*m_hit_samplingfraction)[hit_i];
1185 one_hit.hit_time = (*m_hit_time)[hit_i];
1186 one_hit.hit_x = (*m_hit_x)[hit_i];
1187 one_hit.hit_y = (*m_hit_y)[hit_i];
1188 one_hit.hit_z = (*m_hit_z)[hit_i];
1189 hits[(*m_hit_cellidentifier)[hit_i]].push_back(one_hit);
1196 one_matchedcell.
clear();
1198 one_matchedcell.
cell =
it->second;
1200 std::map<Long64_t, std::vector<FCS_hit> >
::iterator it2 =
hits.find(
it->first);
1201 if (it2 !=
hits.end())
1204 one_matchedcell.
hit = it2->second;
1210 one_matchedcell.
hit.clear();
1213 std::map<Long64_t, std::vector<FCS_g4hit> >
::iterator it3 = g4hits.find(
it->first);
1214 if (it3 != g4hits.end())
1216 one_matchedcell.
g4hit = it3->second;
1222 one_matchedcell.
g4hit.clear();
1231 ATH_MSG_DEBUG(
"ISF_HitAnalysis Check after cells: " <<
cells.size() <<
" " << g4hits.size() <<
" " <<
hits.size());
1235 one_matchedcell.
clear();
1238 if (!
it->second.empty())
1252 one_matchedcell.
hit =
it->second;
1253 std::map<Long64_t, std::vector<FCS_g4hit> >
::iterator it3 = g4hits.find(
it->first);
1254 if (it3 != g4hits.end())
1256 one_matchedcell.
g4hit = it3->second;
1262 one_matchedcell.
g4hit.clear();
1270 ATH_MSG_DEBUG(
"ISF_HitAnalysis Check after hits: " <<
cells.size() <<
" " << g4hits.size() <<
" " <<
hits.size());
1271 for (std::map<Long64_t, std::vector<FCS_g4hit> >::
iterator it = g4hits.begin();
it != g4hits.end();)
1273 one_matchedcell.
clear();
1275 if (!
it->second.empty())
1289 one_matchedcell.
g4hit =
it->second;
1290 one_matchedcell.
hit.clear();
1313 for (
unsigned int cellindex = 0; cellindex <
m_layercells[
i]->
size(); cellindex++)
1370 return StatusCode::SUCCESS;
1377 ATH_MSG_DEBUG (
"[ fastCaloSim transport ] processing particle "<<
part.pdg_id() );
1379 std::vector<Trk::HitInfo>*
hitVector =
new std::vector<Trk::HitInfo>;
1392 auto vtx =
part.production_vertex();
1397 pos =
Amg::Vector3D( vtx->position().x(),vtx->position().y(), vtx->position().z());
1401 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] starting transport from position eta="<<
pos.eta()<<
" phi="<<
pos.phi()<<
" d="<<
pos.mag()<<
" pT="<<
mom.perp() );
1408 double freepath = -1.;
1411 double tDec = freepath > 0. ? freepath : -1.;
1445 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] before calo entrance ");
1457 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo entrance ");
1459 std::unique_ptr<const Trk::TrackParameters> caloEntry =
nullptr;
1463 std::vector<Trk::HitInfo>* dummyHitVector =
nullptr;
1488 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] after calo caloEntry ");
1492 std::unique_ptr<const Trk::TrackParameters> eParameters =
nullptr;
1497 ATH_MSG_DEBUG(
"[ fastCaloSim transport ] starting Calo transport from position eta="<<caloEntry->
position().eta()<<
" phi="<<caloEntry->
position().phi()<<
" d="<<caloEntry->
position().mag() );
1509 eParameters =
m_extrapolator->extrapolateWithPathLimit(*caloEntry,
1525 while (it < hitVector->
end() )
1529 ATH_MSG_DEBUG(
" HIT: layer="<<
sample<<
" sample="<<
sample-3000<<
" eta="<<hitPos.eta()<<
" phi="<<hitPos.phi()<<
" d="<<hitPos.mag());