@@ -524,8 +524,12 @@ public boolean processDataEventUser(DataEvent event) {
524524 if (!event .hasBank ("AHDC::track" )) {return false ;}
525525 if (!event .hasBank ("AHDC::hits" )) {return false ;}
526526
527- /// tmp: misalignement with respect to the center of the AHDC (mm)
528- double clas_alignement = +75 ;
527+ /// vz shift with respect to the center of the CLAS (mm)
528+ double torus = runBank .getFloat ("torus" , 0 );
529+ // inbending --> torus -1 --> 10.6 GeV run
530+ // outbending --> torus +1 --> 2.24 GeV run
531+ double vz_shift = (torus > 0 ) ? -67 : -36 ;
532+ // atof vz shift with respect to the AHDC
529533 double atof_alignement = 0 ;
530534
531535 /// Read the electron vertex
@@ -538,17 +542,21 @@ public boolean processDataEventUser(DataEvent event) {
538542 if (recBank .getInt ("pid" , row ) == 11 ) {
539543 vz_electron = 10 *recBank .getFloat ("vz" ,row ); // conversion in mm
540544 IsVertexDefined = true ;
541-
542-
543- //double px = recBank.getFloat("px",row);
544- //double py = recBank.getFloat("py",row);
545- //double pz = recBank.getFloat("pz",row);
546- //double p = Math.sqrt(px*px+py*py+pz*pz);
547- //double theta = Math.acos(pz/p);
548-
549- // set the resolutions on r and z! to be done
550- vz_error2 [0 ] = 0.09 ; // should depend on p and theta
551- vz_error2 [2 ] = 64 ; // should depend on p and theta
545+
546+ int status = recBank .getShort ("status" , row );
547+
548+ // If the electron is not from the FT, we can assign a finite resolution
549+ if (Math .abs (status ) / 1000 != 1 ) {
550+ //double px = recBank.getFloat("px",row);
551+ //double py = recBank.getFloat("py",row);
552+ //double pz = recBank.getFloat("pz",row);
553+ //double p = Math.sqrt(px*px+py*py+pz*pz);
554+ //double theta = Math.acos(pz/p);
555+
556+ // set the resolutions on r and z! to be done
557+ vz_error2 [0 ] = 0.09 ; // should depend on p and theta
558+ vz_error2 [2 ] = 64 ; // should depend on p and theta
559+ }
552560
553561 break ; // only look at the first electron
554562 }
@@ -605,7 +613,7 @@ public boolean processDataEventUser(DataEvent event) {
605613
606614 /// Associate the electron vertex (the beamline hit) to each track
607615 boolean IsMC = event .hasBank ("MC::Particle" );
608- double vz_constraint = vz_electron + (IsMC ? 0 : clas_alignement ); // we don't have the misalignment in simulation
616+ double vz_constraint = vz_electron - (IsMC ? 0 : vz_shift ); // we don't have the misalignment in simulation, to be checked again !
609617 for (Track track : AHDC_tracks ) {
610618 RadialKFHit hit_beam = new RadialKFHit (0 , 0 , vz_constraint );
611619 RealMatrix measurementNoise = new Array2DRowRealMatrix (
@@ -630,7 +638,7 @@ public boolean processDataEventUser(DataEvent event) {
630638 double x = bank_ATOFHits .getFloat ("x" , row );
631639 double y = bank_ATOFHits .getFloat ("y" , row );
632640 double z = bank_ATOFHits .getFloat ("z" , row );
633- z += atof_alignement ; // there is a shift between AHDC and ATOF (still don't know why) !
641+ z += atof_alignement ;
634642 RadialKFHit hit = new RadialKFHit (x , y , z );
635643 // error on r
636644 double wedge_width = 20 ; //mm
@@ -696,7 +704,7 @@ public boolean processDataEventUser(DataEvent event) {
696704 double x = bank_ATOFHits .getFloat ("x" , row );
697705 double y = bank_ATOFHits .getFloat ("y" , row );
698706 double z = bank_ATOFHits .getFloat ("z" , row );
699- z += atof_alignement ; // there is a shift between AHDC and ATOF (still don't know why) !
707+ z += atof_alignement ;
700708 RadialKFHit hit = new RadialKFHit (x , y , z );
701709 // error on r
702710 double wedge_width = 20 ; //mm
0 commit comments