/[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.2 by mocchiut, Fri Mar 31 10:03:45 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      Float_t xalig;
3042      Float_t yalig;
3043      Float_t zalig;
3044      //
3045      FILE *f;
3046      f = fopen(txtple.Data(),"wb");
3047      //
3048      printf("\n Insert four cifres parameters, the last one will become the decimal (1234 will be transformed into 123.4) \n");
3049      printf("\n Insert the x alignment parameter: \n");
3050      cin.getline(value,256);
3051      ixalig = atoi(value);
3052      xalig = (Float_t)ixalig/10.;
3053      fwrite(&xalig,sizeof(xalig),1,f);
3054      printf(" xalig = %f \n",xalig);
3055      //
3056      printf("\n Insert the y alignment parameter: \n");
3057      cin.getline(value,256);
3058      iyalig = atoi(value);
3059      yalig = (Float_t)iyalig/10.;
3060      fwrite(&yalig,sizeof(yalig),1,f);
3061      printf(" yalig = %f \n",yalig);
3062      //
3063      printf("\n Insert the z alignment parameter: \n");
3064      cin.getline(value,256);
3065      izalig = atoi(value);
3066      zalig = (Float_t)izalig/10.;
3067      fwrite(&zalig,sizeof(zalig),1,f);
3068      printf(" zalig = %f \n",zalig);
3069      //
3070      fclose(f);
3071    }
3072    
3073    void FCaloREADALIG(TString txtple){
3074      FILE *f;
3075      f = fopen(txtple.Data(),"rb");
3076      Float_t mip = 0.;
3077      fread(&mip,sizeof(mip),1,f);
3078      printf(" xalig = %f \n",mip);
3079      mip = 0.;
3080      fread(&mip,sizeof(mip),1,f);
3081      printf(" yalig = %f \n",mip);
3082      mip = 0.;
3083      fread(&mip,sizeof(mip),1,f);
3084      printf(" zalig = %f \n",mip);
3085      fclose(f);
3086    }

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

  ViewVC Help
Powered by ViewVC 1.1.23