832 {
833 int i;
834 EmcRecCrystal cry;
838
839 unsigned int phiMax, phiMax16;
840 unsigned int phiQuotient, phiRemainder;
841
843 phiMax16 = ( phiMax + 1 ) / 16;
844 phiQuotient = (unsigned int)( phi / phiMax16 );
845 phiRemainder = phi % phiMax16;
846
847
848
850 {
851 if ( phiQuotient != 3 && phiQuotient != 4 && phiQuotient != 11 && phiQuotient != 12 )
852 {
853 cry = fCrystal[0][theta][phiRemainder];
854 for ( i = 0; i < 10; ++i )
855 { cry.
Set( i, cry.
Get( i ).rotateZ( phiQuotient * fphi5[6] ) ); }
856 }
857 else
858 {
859 if ( phiQuotient == 4 ) { cry = fCrystal[1][theta][phiRemainder]; }
860 if ( phiQuotient == 3 )
861 {
862 cry = fCrystal[1][theta][phiMax16 - 1 - phiRemainder];
863 for ( i = 0; i < 10; ++i ) { cry.
SetX( i, -cry.
Get( i ).x() ); }
864 }
865 if ( phiQuotient == 11 )
866 {
867 cry = fCrystal[1][theta][phiMax16 - 1 - phiRemainder];
868 for ( i = 0; i < 10; ++i ) { cry.
SetY( i, -cry.
Get( i ).y() ); }
869 }
870 if ( phiQuotient == 12 )
871 {
872 cry = fCrystal[1][theta][phiRemainder];
873 for ( i = 0; i < 10; ++i )
874 {
875 cry.
SetX( i, -cry.
Get( i ).x() );
876 cry.
SetY( i, -cry.
Get( i ).y() );
877 }
878 }
879 }
880 }
881
883 {
884 unsigned int phipp;
885 unsigned int phiMax2 = ( phiMax + 1 ) / 2;
886 if ( phi < phiMax2 ) { phipp = phiMax2 - 1 - phi; }
887 else { phipp = phiMax + phiMax2 - phi; }
890 for ( i = 0; i < 10; ++i )
891 {
892 cry.
SetX( i, -cry.
Get( i ).x() );
893 cry.
SetZ( i, -cry.
Get( i ).z() );
894 }
895 }
896
897 return cry;
898}
static Identifier crystal_id(const unsigned int barrel_ec, const unsigned int theta_module, const unsigned int phi_module)
For a single crystal.
static unsigned int getENDCAP_WEST()
static unsigned int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0).
void SetY(int index, double value)
HepPoint3D Get(int index) const
void SetX(int index, double value)
void SetZ(int index, double value)
void Set(int index, const HepPoint3D &aPoint)
EmcRecCrystal GetCrystal(const Identifier &id) const