Skip to content
Snippets Groups Projects
Commit cac5b872 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'master-ATLASSIM_4510-TRTProcessingOfStraw-fix' into 'master'

Set `cluster_z` to zero when outside gas volume.

Closes ATLASSIM-4510

See merge request !41309
parents 6c42b9ae 76babf24
No related branches found
No related tags found
6 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,!41309Set `cluster_z` to zero when outside gas volume.
......@@ -641,30 +641,11 @@ void TRTProcessingOfStraw::ClustersToDeposits (MagField::AtlasFieldCache& fieldC
// Get the cluster radius and energy.
const double cluster_x(currentClusterIter->xpos);
const double cluster_y(currentClusterIter->ypos);
const double cluster_z(currentClusterIter->zpos);
const double cluster_z(this->setClusterZ(currentClusterIter->zpos, isLong, isShort, isEC));
const double cluster_x2(cluster_x*cluster_x);
const double cluster_y2(cluster_y*cluster_y);
double cluster_r2(cluster_x2+cluster_y2);
// The active gas volume along the straw z-axis is: Barrel long +-349.315 mm; Barrel short +-153.375 mm; End caps +-177.150 mm.
// Here we give a warning for clusters that are outside of the straw gas volume in in z. Since T/P version 3 cluster z values
// can go several mm outside these ranges; 30 mm is plenty allowance in the checks below.
const double longBarrelStrawHalfLength(349.315*CLHEP::mm);
const double shortBarrelStrawHalfLength(153.375*CLHEP::mm);
const double EndcapStrawHalfLength(177.150*CLHEP::mm);
if ( isLong && fabs(cluster_z)>longBarrelStrawHalfLength+30 ) {
double d = cluster_z<0 ? cluster_z+longBarrelStrawHalfLength : cluster_z-longBarrelStrawHalfLength;
ATH_MSG_WARNING ("Long barrel straw cluster is outside the active gas volume z = +- 349.315 mm by " << d << " mm.");
}
if ( isShort && fabs(cluster_z)>shortBarrelStrawHalfLength+30 ) {
double d = cluster_z<0 ? cluster_z+shortBarrelStrawHalfLength : cluster_z-shortBarrelStrawHalfLength;
ATH_MSG_WARNING ("Short barrel straw cluster is outside the active gas volume z = +- 153.375 mm by " << d << " mm.");
}
if ( isEC && fabs(cluster_z)>EndcapStrawHalfLength+30 ) {
double d = cluster_z<0 ? cluster_z+EndcapStrawHalfLength : cluster_z-EndcapStrawHalfLength;
ATH_MSG_WARNING ("End cap straw cluster is outside the active gas volume z = +- 177.150 mm by " << d << " mm.");
}
// These may never occur, but could be very problematic for getAverageDriftTime(), so check and correct this now.
if (cluster_r2<wire_r2) cluster_r2=wire_r2; // Compression may (v. rarely) cause r to be smaller than the wire radius. If r=0 then NaN's later!
if (cluster_r2>straw_r2) cluster_r2=straw_r2; // Should never occur
......@@ -835,3 +816,34 @@ Amg::Vector3D TRTProcessingOfStraw::getGlobalPosition ( int hitID, const TimedH
return def;
}
double TRTProcessingOfStraw::setClusterZ(double cluster_z_in, bool isLong, bool isShort, bool isEC) const {
double cluster_z(cluster_z_in);
// The active gas volume along the straw z-axis is: Barrel long +-349.315 mm; Barrel short +-153.375 mm; End caps +-177.150 mm.
// Here we give a warning for clusters that are outside of the straw gas volume in in z. Since T/P version 3 cluster z values
// can go several mm outside these ranges; 30 mm is plenty allowance in the checks below.
const double longBarrelStrawHalfLength(349.315*CLHEP::mm);
const double shortBarrelStrawHalfLength(153.375*CLHEP::mm);
const double EndcapStrawHalfLength(177.150*CLHEP::mm);
if ( isLong && fabs(cluster_z)>longBarrelStrawHalfLength+30 ) {
double d = cluster_z<0 ? cluster_z+longBarrelStrawHalfLength : cluster_z-longBarrelStrawHalfLength;
ATH_MSG_WARNING ("Long barrel straw cluster is outside the active gas volume z = +- 349.315 mm by " << d << " mm.");
ATH_MSG_WARNING ("Setting cluster_z = 0.0");
cluster_z = 0.0;
}
if ( isShort && fabs(cluster_z)>shortBarrelStrawHalfLength+30 ) {
double d = cluster_z<0 ? cluster_z+shortBarrelStrawHalfLength : cluster_z-shortBarrelStrawHalfLength;
ATH_MSG_WARNING ("Short barrel straw cluster is outside the active gas volume z = +- 153.375 mm by " << d << " mm.");
ATH_MSG_WARNING ("Setting cluster_z = 0.0");
cluster_z = 0.0;
}
if ( isEC && fabs(cluster_z)>EndcapStrawHalfLength+30 ) {
double d = cluster_z<0 ? cluster_z+EndcapStrawHalfLength : cluster_z-EndcapStrawHalfLength;
ATH_MSG_WARNING ("End cap straw cluster is outside the active gas volume z = +- 177.150 mm by " << d << " mm.");
ATH_MSG_WARNING ("Setting cluster_z = 0.0");
cluster_z = 0.0;
}
return cluster_z;
}
......@@ -230,6 +230,8 @@ private:
int strawGasType,
CLHEP::HepRandomEngine* rndmEngine);
double setClusterZ(double cluster_z_in, bool isLong, bool isShort, bool isEC) const;
std::vector<double> m_drifttimes; // electron drift times
std::vector<double> m_expattenuation; // tabulation of exp()
unsigned int m_maxelectrons; // maximum number of them (minmum is 100 for the Gaussian approx to be ok);
......
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