/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/src/analyse/TB2010/Testbeam_june_10/Gassiplex/Beam_profile/gplexMapping/X.C

Go to the documentation of this file.
00001 Short_t X(Int_t chanNum)
00002 {//valid for chanNum from 0 to 672 compatible with TB2008 setup (3 beta2 , 1 beta2.4)
00003   if (chanNum>=672||chanNum<0){cout<<"error in X.C : unrecognized channel number :"<<chanNum<<"\n";return -1;}
00004 
00005   Short_t x;
00006   Short_t i = chanNum%96+1;
00007   Short_t mapp;
00008   
00009 if((i>0&&i<17)||(i>32&&i<49)||(i>64&&i<81)){mapp=2*i-((i/32)*32)-1;}
00010   
00011 if((i>16&&i<33)||(i>48&&i<65)||(i>80&&i<97)){mapp=66+(((3*i-1)/96)*96)-2*i;}
00012 
00013 if(chanNum/96<3)
00014   {//gassiplex 0, 1, 2
00015       x=(mapp-1)%6;
00016   }
00017 else
00018   {//gassiplex 3,4,5,6 on beta 2.4
00019       if((chanNum/96)-3==0)x=(mapp-1)%6+6;
00020       if((chanNum/96)-3==1)x=(mapp-1)%6+6;
00021       if((chanNum/96)-3==2)x=5-(mapp-1)%6;
00022       if((chanNum/96)-3==3)x=5-(mapp-1)%6;
00023               //    ------------|
00024               //  __|     |     |__
00025               // [__|  2  |  0  |__] gassiplex 
00026               //    |     |     |
00027               //    |------------
00028               //  __|     |     |__
00029               // [__|  3  |  1  |__] gassiplex 
00030               //    |     |     |
00031               //    |------------
00032     }
00033   if(x<0||x>12){cout<<"error calculating x coordinate for channel "<<chanNum<<endl; return -1;}
00034   return x;
00035 }
00036 
00037 

Generated on Mon Jan 7 13:15:22 2013 for MicromegasFramework by  doxygen 1.4.7