Skip to content

Commit

Permalink
Merge pull request #317 from SBNSoftware/mrmooney_SCEfix_5Jan2022
Browse files Browse the repository at this point in the history
Updating cathode location in SpaceCharge module
  • Loading branch information
rennney authored Jan 6, 2022
2 parents 632bedd + c6cd323 commit 4a7cae8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions icaruscode/TPC/Simulation/SpaceCharge/SpaceChargeICARUS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ geo::Vector_t spacecharge::SpaceChargeICARUS::GetPosOffsets(geo::Point_t const&
//in larsim, this is how the offsets are used in DriftElectronstoPlane_module
// DriftDistance += -1.0 * thePosOffsets[0]
// thus need to apply correction to TPCs "left" of cryostat (tpc_corr)
// cathode spans x=220.14 and x=220.29 in pos cryostat
// cathode spans x=210.14 and x=210.29 in pos cryostat
if(xx>0){
cryo_corr=1.0;
if(xx<220.14){
if(xx<210.14){
tpc_corr=-1.0;
}
}else{
cryo_corr=-1.0;
if(xx<-220.29){
if(xx<-210.29){
tpc_corr=-1.0;
}
}
Expand Down Expand Up @@ -186,11 +186,11 @@ geo::Vector_t spacecharge::SpaceChargeICARUS::GetPosOffsets(geo::Point_t const&
//hard code in the cathode faces (got from dump_icarus_geometry.fcl)
//
//Gray Putnam: update this check to the split-wire Geometry
if (x_is_pos && (tpcid == 0 || tpcid == 1) && xx > 220.14 ) { xx = 220.14; }
if (x_is_pos && (tpcid == 2 || tpcid == 3) && xx < 220.29 ) { xx = 220.29; }
if (x_is_pos && (tpcid == 0 || tpcid == 1) && xx > 210.14 ) { xx = 210.14; }
if (x_is_pos && (tpcid == 2 || tpcid == 3) && xx < 210.29 ) { xx = 210.29; }

if (!x_is_pos && (tpcid == 2 || tpcid == 3) && xx > 220.14 ) { xx = 220.14; }
if (!x_is_pos && (tpcid == 0 || tpcid == 1) && xx < 220.29 ) { xx = 220.29; }
if (!x_is_pos && (tpcid == 2 || tpcid == 3) && xx > 210.14 ) { xx = 210.14; }
if (!x_is_pos && (tpcid == 0 || tpcid == 1) && xx < 210.29 ) { xx = 210.29; }

double offset_x=0., offset_y=0., offset_z=0.;
offset_x = corr*SCEhistograms.at(3)->Interpolate(xx,yy,zz);
Expand Down Expand Up @@ -234,8 +234,8 @@ geo::Vector_t spacecharge::SpaceChargeICARUS::GetEfieldOffsets(geo::Point_t cons
void spacecharge::SpaceChargeICARUS::fixCoords(double* xx, double* yy, double* zz) const{
//handle the edge cases by projecting SCE corrections onto boundaries
*xx = abs(*xx);
if(*xx<71.94){*xx=71.94;}
if(*xx>368.489){*xx=368.489;}
if(*xx<61.94){*xx=61.94;}
if(*xx>358.489){*xx=358.489;}
if(*yy<-181.86){*yy=-181.86;}
if(*yy>134.96){*yy=134.96;}
if(*zz<-894.951){*zz=-894.951;}
Expand Down

0 comments on commit 4a7cae8

Please sign in to comment.