Skip to content

Commit

Permalink
Clarify crosstalk coefficients
Browse files Browse the repository at this point in the history
  • Loading branch information
zwu0922 authored and andresailer committed Apr 18, 2024
1 parent d7ba48d commit d18d3f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace crosstalk {
* @param[in] aFieldNames Names of the fields for which crosstalk neighbours are found.
* @param[in] aFieldExtremes Minimal and maximal values for the fields.
* @param[in] aCellId ID of cell.
* return Vector of neighbours andcross talk coefficients.
* return Vector of neighbours and their crosstalk coefficients.
*/
std::vector<std::pair<uint64_t, double>> getNeighboursModuleThetaMerged(const dd4hep::DDSegmentation::FCCSWGridModuleThetaMerged_k4geo& aSeg,
const dd4hep::DDSegmentation::BitFieldCoder& aDecoder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ std::vector<std::pair<uint64_t, double>> getNeighboursModuleThetaMerged(const dd
std::cout << "WARNING: will return empty neighbour map" << std::endl;
return xtalk_neighbours;
}

double dummy_xtalk=0;
double dummy_xtalk_radial=0.7e-2; // type 1
double dummy_xtalk_theta=0.2e-2; // type 2
double dummy_xtalk_diagonal=0.04e-2; // type 3
double dummy_xtalk_tower=0.1e-2; // type 4

// crosstalk coefficients
// also see https://indico.cern.ch/event/1368231/contributions/5904291/
double dummy_xtalk_radial = 0.7e-2; // type 1
double dummy_xtalk_theta = 0.2e-2; // type 2
double dummy_xtalk_diagonal = 0.04e-2; // type 3
double dummy_xtalk_tower = 0.1e-2; // type 4

// retrieve layer/module/theta of cell under study
int layer_id = aDecoder.get(aCellId, aFieldNames[idLayerField]);
Expand Down Expand Up @@ -107,6 +108,7 @@ std::vector<std::pair<uint64_t, double>> getNeighboursModuleThetaMerged(const dd
// instead of the extrema only for a certain layer
// this border effect is also present in the original method..
for (int i=-1; i <= aSeg.mergedThetaCells(layer_id); i++) {
double dummy_xtalk = 0.0; // will be set to the crosstalk coefficient for this neighbour, either radial or diagonal
int theta_id_neighbour = (theta_id + i) - ((theta_id + i) % (aSeg.mergedThetaCells(layer_id+deltaLayer) ? aSeg.mergedThetaCells(layer_id+deltaLayer):1) );
// Do we need to check if the index neighbour theta is valid?
if ((theta_id_neighbour >= theta_id && theta_id_neighbour < (theta_id + aSeg.mergedThetaCells(layer_id))) or (theta_id_neighbour < theta_id && theta_id_neighbour > (theta_id - aSeg.mergedThetaCells(layer_id+deltaLayer)))) { // crosstalk neighbour type 1
Expand Down Expand Up @@ -157,14 +159,12 @@ std::vector<std::pair<uint64_t, double>> getNeighboursModuleThetaMerged(const dd
int theta_id_neighbour = (theta_id + i) - ((theta_id + i) % (aSeg.mergedThetaCells(loopLayer) ? aSeg.mergedThetaCells(loopLayer):1) );
// check if the neighbour theta index is valid
if (theta_id_neighbour >= theta_id && theta_id_neighbour < (theta_id + aSeg.mergedThetaCells(layer_id)) && theta_id_neighbour>=aFieldExtremes_layer[loopLayer_indice_offset][idThetaField].first && theta_id_neighbour<=aFieldExtremes_layer[loopLayer_indice_offset][idThetaField].second) { // crosstalk neighbour type 4
dummy_xtalk = dummy_xtalk_tower;
aDecoder.set(cID, aSeg.fieldNameTheta(), theta_id_neighbour);
xtalk_neighbours.emplace_back(cID, dummy_xtalk);
xtalk_neighbours.emplace_back(cID, dummy_xtalk_tower);
}
else if (theta_id_neighbour < theta_id && theta_id_neighbour > (theta_id - aSeg.mergedThetaCells(loopLayer)) && theta_id_neighbour>=aFieldExtremes_layer[loopLayer_indice_offset][idThetaField].first && theta_id_neighbour<=aFieldExtremes_layer[loopLayer_indice_offset][idThetaField].second) { // crosstalk neighbour type 4
dummy_xtalk = dummy_xtalk_tower;
aDecoder.set(cID, aSeg.fieldNameTheta(), theta_id_neighbour);
xtalk_neighbours.emplace_back(cID, dummy_xtalk);
xtalk_neighbours.emplace_back(cID, dummy_xtalk_tower);
}
else continue;
}
Expand Down

0 comments on commit d18d3f4

Please sign in to comment.