Skip to content
Snippets Groups Projects
Commit ce9a2128 authored by Matthew Thomas Anthony's avatar Matthew Thomas Anthony :speech_balloon:
Browse files

Adding the energy fraction in the FE clusters used for matching in cell matching algorithm

parent 44a65c23
No related branches found
No related tags found
7 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!38094Fix muon link to charged flow element,!36273Connect Flow Elements to Muon container
......@@ -145,6 +145,7 @@ StatusCode PFMuonFlowElementAssoc::execute(const EventContext & ctx) const
//design the vector of ElementLinks
std::vector<MuonLink_t> FEMuonLinks;
std::vector<double> FE_efrac_clustermatch;
for (const xAOD::Muon* muon: *muonNeutralFEWriteDecorHandle ){
//Retrieve the ElementLink vector of clusters
const ElementLink<xAOD::CaloClusterContainer> ClusterLink=muon->clusterLink();
......@@ -181,23 +182,35 @@ StatusCode PFMuonFlowElementAssoc::execute(const EventContext & ctx) const
CaloClusterCellLink::const_iterator Muon_Clus_FirstCell=Muon_Clus_CellLink->begin();
CaloClusterCellLink::const_iterator Muon_Clus_LastCell=Muon_Clus_CellLink->end();
//Now we check if any match. Current algo allows for at least one match.
//Now we check if any match and sum the energy of the cells that are matched. Current algo allows for at least one match.
bool isCellMatched=false;
for(; Muon_Clus_FirstCell != Muon_Clus_LastCell; ++Muon_Clus_FirstCell){
Identifier index_muoncell=Muon_Clus_FirstCell->ID();
for (; FE_FirstCell != FE_LastCell; FE_FirstCell++){
Identifier index_FEcell=FE_FirstCell->ID();
if(index_FEcell==index_muoncell){
double FE_sum_matched_cellEnergy=0;
for(;FE_FirstCell != FE_LastCell; ++FE_FirstCell){
Identifier index_FECell=FE_FirstCell->ID();
for(; Muon_Clus_FirstCell != Muon_Clus_LastCell; ++Muon_Clus_FirstCell){
Identifier index_muoncell=Muon_Clus_FirstCell->ID();
if(index_FECell==index_muoncell){
isCellMatched=true;
double FE_cell_energy=FE_FirstCell->e();
FE_sum_matched_cellEnergy=FE_sum_matched_cellEnergy+FE_cell_energy;
}
}
} // end of double loop block for cell matching
} // end of cell matching double loop
double frac_FE_cluster_energy_matched=0;
//retrieve total cluster energy from the FE cluster
double tot_FE_cluster_energy=FE_cluster->e();
if(tot_FE_cluster_energy!=0){ // ! div 0
frac_FE_cluster_energy_matched=FE_sum_matched_cellEnergy / tot_FE_cluster_energy ;
}
if(isCellMatched){ // cell matched => Link the two objects.
// Add Muon element link to a vector
// index() is the unique index of the muon in the muon container
FEMuonLinks.push_back(MuonLink_t(*muonReadHandle,muon->index()));
// index() is the unique index of the cFlowElement in the cFlowElementcontaine
muonNeutralFEVec.at(muon->index()).push_back(FlowElementLink_t(*NeutralFEReadHandle,FE->index()));
// save the energy fraction used in the cluster matching
FE_efrac_clustermatch.push_back(frac_FE_cluster_energy_matched);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment