/[PAMELA software]/calo/flight/FUTILITIES/macros/FCaloADC2MIP.cxx
ViewVC logotype

Diff of /calo/flight/FUTILITIES/macros/FCaloADC2MIP.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mocchiut, Wed Mar 22 15:07:47 2006 UTC revision 1.3 by mocchiut, Fri Jun 30 12:08:13 2006 UTC
# Line 1  Line 1 
1  //  //
2  //- Emiliano Mocchiutti  //- Emiliano Mocchiutti
3  //  //
4  //   FCaloADC2MIP.c      version 1.01  (2006-03-20)  //   FCaloADC2MIP.c      version 1.02  (2006-03-31)
5  //  //
6  //   The only input needed is  //   The only input needed is
7  //  //
8  //   Changelog:  //   Changelog:
9  //  //
10    //   1.01 - 1.02 (2006-03-31): Added FCaloALIG2DAT and FCaloREADALIG to create and read the calorimeter alignment data file.
11    //
12  //   1.00 - 1.01 (2006-03-20): First flight version, read single yoda file.  //   1.00 - 1.01 (2006-03-20): First flight version, read single yoda file.
13  //  //
14  //   0.00 - 1.00 (2006-03-20): Clone of CaloADC2MIP v4r01.  //   0.00 - 1.00 (2006-03-20): Clone of CaloADC2MIP v4r01.
# Line 3027  void FCaloREADTXT(TString txtple){ Line 3029  void FCaloREADTXT(TString txtple){
3029    };    };
3030    fclose(f);    fclose(f);
3031  }  }
3032    
3033    void FCaloALIG2DAT(TString txtple){
3034    //   clevel1_.xalig = 121.1;
3035    //   clevel1_.yalig = 119.8;
3036    //   clevel1_.zalig = -263.1;
3037      char value[256];
3038      Int_t ixalig;
3039      Int_t iyalig;
3040      Int_t izalig;
3041      Int_t iemip;
3042      Float_t xalig;
3043      Float_t yalig;
3044      Float_t zalig;
3045      Float_t emip;
3046      //
3047      FILE *f;
3048      f = fopen(txtple.Data(),"wb");
3049      //
3050      printf("\n Insert parameters in microns \n");
3051      printf("\n Insert the x alignment parameter: \n");
3052      cin.getline(value,256);
3053      ixalig = atoi(value);
3054      xalig = (Float_t)ixalig/1000.;
3055      fwrite(&xalig,sizeof(xalig),1,f);
3056      printf(" xalig = %f mm\n",xalig);
3057      //
3058      printf("\n Insert the y alignment parameter: \n");
3059      cin.getline(value,256);
3060      iyalig = atoi(value);
3061      yalig = (Float_t)iyalig/1000.;
3062      fwrite(&yalig,sizeof(yalig),1,f);
3063      printf(" yalig = %f mm\n",yalig);
3064      //
3065      printf("\n Insert the z alignment parameter: \n");
3066      cin.getline(value,256);
3067      izalig = atoi(value);
3068      zalig = (Float_t)izalig/1000.;
3069      fwrite(&zalig,sizeof(zalig),1,f);
3070      printf(" zalig = %f mm\n",zalig);
3071      //
3072      printf("\n Insert the signal/noise threshold (times 1000): \n");
3073      cin.getline(value,256);
3074      iemip = atoi(value);
3075      emip = (Float_t)iemip/1000.;
3076      fwrite(&emip,sizeof(emip),1,f);
3077      printf(" emip = %f mip \n",emip);
3078      //
3079      fclose(f);
3080    }
3081    
3082    void FCaloREADALIG(TString txtple){
3083      FILE *f;
3084      f = fopen(txtple.Data(),"rb");
3085      Float_t mip = 0.;
3086      fread(&mip,sizeof(mip),1,f);
3087      printf(" xalig = %f \n",mip);
3088      mip = 0.;
3089      fread(&mip,sizeof(mip),1,f);
3090      printf(" yalig = %f \n",mip);
3091      mip = 0.;
3092      fread(&mip,sizeof(mip),1,f);
3093      printf(" zalig = %f \n",mip);
3094      mip = 0.;
3095      fread(&mip,sizeof(mip),1,f);
3096      printf(" signal threshold = %f \n",mip);
3097      fclose(f);
3098    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23