AIDA GELINA BRIKEN nToF CRIB ISOLDE CIRCE nTOFCapture DESPEC DTAS EDI_PSA 179Ta CARME StellarModelling DCF K40
  AIDA  ELOG logo
Message ID: 112     Entry time: Tue Jul 14 18:06:54 2015
Author: AE, CG 
Subject: [Data Analysis] Correlation Scaler timestamp in PID data (go4_30**.root) 
The attached plots show the time-stamp data in the EURICA files with PID information (EventInfo.timestamp). The
timestamp value should correspond to the correlation scaler included as info_code==8 in AIDA. 

The plots show time-stamp vs entry number in the TTree of the Root file, with the events in groups of about 10
*.root files counted consecutively. To map entry-number to data file use informatino of number of entries per
file in the lines bellow (output of analysis script). NOTE: label for plots in right colume is wrong, trigger
type=3 (pulser) in stead of 2.

The final three plots (pulser_dts_go4_3022*.png) show the time difference between two sequential data points of a
given trigger type (fBit==2 or 3). The value that would correspond to the external scaler (fBit==3) has a peak at
about delta(ts)= 1.7 sec, but also a lot of events with a distribution centered around a smaller value of
delta(ts)~ 10 msec! One can also see the deadtime at about 300 usec at a smaller scale. The units for the
time-stamp are 1-ns.

A plot of a similar distribution for the data in AIDA shows that the peak of the correlation scaler has, in this
case, a very narrow distribution, with a frequency of ~43.5e6 x 40 ns (would agree with Go4 data from EURICA).

When scanning the files the analysis script (attached) skips a given number of entries (~100) to speed up the
analysis.


Number of entries in PID tree= 2592193 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3002.root
(accumulated= 2592193)
Number of entries in PID tree= 2570084 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3003.root
(accumulated= 5162277)
Number of entries in PID tree= 676355 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3004.root
(accumulated= 5838632)
Number of entries in PID tree= 2582203 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3005.root
(accumulated= 8420835)
Number of entries in PID tree= 2602541 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3006.root
(accumulated= 11023376)
Number of entries in PID tree= 2602681 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3007.root
(accumulated= 13626057)
Number of entries in PID tree= 2605726 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3008.root
(accumulated= 16231783)
Number of entries in PID tree= 2606264 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3009.root
(accumulated= 18838047)
Number of entries in PID tree= 2603841 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3010.root
(accumulated= 21441888)
Number of entries in PID tree= 2599770 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3011.root
(accumulated= 24041658)

Number of entries in PID tree= 2601002 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3012.root
(accumulated= 2601002)
Number of entries in PID tree= 2598946 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3013.root
(accumulated= 5199948)
Number of entries in PID tree= 2596582 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3014.root
(accumulated= 7796530)
Number of entries in PID tree= 2596506 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3015.root
(accumulated= 10393036)
Number of entries in PID tree= 2588772 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3016.root
(accumulated= 12981808)
Number of entries in PID tree= 2583160 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3017.root
(accumulated= 15564968)
Number of entries in PID tree= 2589905 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3018.root
(accumulated= 18154873)
Number of entries in PID tree= 2581979 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3019.root
(accumulated= 20736852)
Number of entries in PID tree= 2582410 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3020.root
(accumulated= 23319262)
Number of entries in PID tree= 2582181 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3021.root
(accumulated= 25901443)

Number of entries in PID tree= 2580798 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3022.root
(accumulated= 2580798)
Number of entries in PID tree= 2580669 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3023.root
(accumulated= 5161467)
Number of entries in PID tree= 2583346 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3024.root
(accumulated= 7744813)
Number of entries in PID tree= 2645673 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3025.root
(accumulated= 10390486)
Number of entries in PID tree= 1984963 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3026.root
(accumulated= 12375449)
Number of entries in PID tree= 2629453 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3027.root
(accumulated= 15004902)
Number of entries in PID tree= 2636095 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3028.root
(accumulated= 17640997)
Number of entries in PID tree= 2639067 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3029.root
(accumulated= 20280064)
Number of entries in PID tree= 2643485 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3030.root
(accumulated= 22923549)
Number of entries in PID tree= 2644457 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3031.root
(accumulated= 25568006)

Number of entries in PID tree= 2643522 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3032.root
(accumulated= 2643522)
Number of entries in PID tree= 2641053 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3033.root
(accumulated= 5284575)
Number of entries in PID tree= 2637280 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3034.root
(accumulated= 7921855)
Number of entries in PID tree= 2627822 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3035.root
(accumulated= 10549677)
Number of entries in PID tree= 2637326 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3036.root
(accumulated= 13187003)
Number of entries in PID tree= 2635601 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3037.root
(accumulated= 15822604)
Number of entries in PID tree= 2606912 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3038.root
(accumulated= 18429516)
Number of entries in PID tree= 2635101 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3039.root
(accumulated= 21064617)
Number of entries in PID tree= 2634932 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3040.root
(accumulated= 23699549)
Number of entries in PID tree= 2633415 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3041.root
(accumulated= 26332964)

Number of entries in PID tree= 2633892 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3042.root
(accumulated= 2633892)
Number of entries in PID tree= 2640264 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3043.root
(accumulated= 5274156)
Number of entries in PID tree= 2612700 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3044.root
(accumulated= 7886856)
Number of entries in PID tree= 2632762 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3045.root
(accumulated= 10519618)
Number of entries in PID tree= 1962430 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3046.root
(accumulated= 12482048)
Number of entries in PID tree= 2611491 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3047.root
(accumulated= 15093539)
Number of entries in PID tree= 2649244 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3048.root
(accumulated= 17742783)
Number of entries in PID tree= 2679210 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3049.root
(accumulated= 20421993)
Number of entries in PID tree= 518667 for file /Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_3050.root
(accumulated= 20940660)
Attachment 1: scaler_r3002_3011.png  35 kB  | Hide | Hide all
scaler_r3002_3011.png
Attachment 2: scaler_r3012_3021.png  30 kB  | Hide | Hide all
scaler_r3012_3021.png
Attachment 3: scaler_r3022_3031.png  26 kB  | Hide | Hide all
scaler_r3022_3031.png
Attachment 4: scaler_r3032_3041.png  31 kB  | Hide | Hide all
scaler_r3032_3041.png
Attachment 5: scaler_r3042_3050.png  31 kB  | Hide | Hide all
scaler_r3042_3050.png
Attachment 6: PlotRIBF.C  8 kB  | Hide | Hide all
#include <bitset>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>

#include <TFile.h>
#include <TTree.h>
#include <TH1.h>
#include <TH2.h>
#include <TCanvas.h>
#include <TGraph.h>
#include <TRandom3.h>

//#include "Common.h"


//using namespace std;




//variables sorted in decreasing oredr of size: from TTree.html

/*
 * struct struct_entry_midas{
  unsigned long tm_stp_lsb;
  unsigned long info_field;
  
  //  unsigned short sample_data[4];
  unsigned short adc_data;
  unsigned short sample_lenght;
  
  unsigned char type;
  unsigned char mod_id;
  unsigned char ch_id;
  unsigned char adc_range;
  unsigned char info_code;
  
};
*/



//void Plot(string runNum, int Nskip=1, long long Nmax=-1, double ts_0= 0, double ts_1= 20e12, double t_ext_0= 0, double t_ext_1= 10e10, double offset_z=20e12, double t_ext_0_z=0, double t_ext_1_z=10e10){
void Plot(int run0, int Nrun, int Nskip=1, long long Nmax=-1, double kentry_max=1000, double ts_0=0, double ts_1= 500000, int Nskip2= 100){

  /***********
  struct dssd_hits{
    Long64_t t;
    Long64_t t_ext;
    int x;
    int y;
    int z;
    int ex;
    int ey;
    int flag;
  };
  
  struct calib_data_struct{

    double time_aida;
    double time_disc;
    double time_external;
    double adc_energy;
    int adc_data;
    int dssd;
    int strip;
    unsigned char adc_range;
    unsigned char side;
    unsigned char module;
    unsigned char channel;
    unsigned char data_type;
    unsigned char info_code;
    bool corr_flag; //if we have a good calculation of offset EXT->AIDA
    bool disc_flag; //if we have good DISC value for ADC hit
  };



  struct unpack_data_struct{
    unsigned long tm_stp;
    unsigned long corr_scaler;
    unsigned long tm_stp_lsb;  //least significant bits timestamp
    unsigned long info_field;
    unsigned int adc_data;
    unsigned int sample_length;
    unsigned char data_type;
    unsigned char fee64_id;
    unsigned char ch_id;
    unsigned char adc_range;
    unsigned char info_code;
    bool sync_flag;
  };
  ******************/

  TFile* input_file1; 
  TFile* input_file2; 
  TFile* input_file3; 

  TTree * tree1;
  TTree * tree2;
  TTree * tree3;

  //  unpack_data_struct unpack_data;
  //  calib_data_struct calib_data;
  //  dssd_hits event_data;


  Long64_t delta_long64;
  double delta_double;

  Long64_t offset_long64;
  //offset_long64= offset_z;



  //  TFile* input_file;
  //  TTree * input_tree;
 

  //TH1I * hTs;
  //TH2I * hFeeAdc;
  //TH2I * hFeeCh;
  //TH1I * hAdc[24];
  //TH2I * hTsAdc[24];
  //  TH1I * Hdt_ext;
 


  //  TCanvas * c0;
  //  c0= new TCanvas("c0","c0"); c0->Divide(4,4); //deltaunp


  //  for(int i=0;i<16;i++){
  //
  //    char my_title[256];
  //    char my_name[256];
  //    sprintf(my_name,"hDeltaUnp%d",i);
  //    sprintf(my_title,"#Delta time-stamp !FEE%d;t_{CORR. SCALER} - t_{AIDA}",i+1);

    //  hDeltaUnp[i]= new TH1I(my_name, my_title, 2048, t_ext_0, t_ext_1);
  //  }






  ULong64_t my_tm_stp;
  UInt_t my_bit;
  Float_t my_Z;

  ULong64_t a_tm_stp[1];
  UInt_t a_bit[1];
  Float_t a_Z[10];

  string runName;
  string path="/Disk/ds-sopa-personal/aestrade/rootfiles/AIDA/May2015/";


  char pid_file[1024];

  //number of data points in TTree
  long long n_entries;
  long long n_max;
  long long n_entries_sum=0;
  long long delta_ts;


  double t3[10001];
  double x3[10001];
  double t2[10001];
  double x2[10001];
  int n3=0;
  int n2=0;

  //  int Nskip2=100; //take 1/100 points for any trigger type

  TH2I * hT3= new TH2I("hT3","time-stamp for trigger=2;entry num. [1/1e3];time-stamp [1/1e6]",1000,0,kentry_max,1000,ts_0,ts_1);
  TH2I * hT2= new TH2I("hT2","time-stamp for any trigger;entry num. [1/1e3];time-stamp [1/1e6]",1000,0,kentry_max,1000,ts_0,ts_1);

  /********/
   const Int_t kMaxEventInfo = 1;
   const Int_t kMaxBigRIPSRaw = 10;


   Int_t           EventInfo_;
   Int_t           BigRIPSRaw_;

   ULong64_t       EventInfo_timestamp[kMaxEventInfo];   //[EventInfo_]
   UInt_t          EventInfo_fBit[kMaxEventInfo];   //[EventInfo_]
   Float_t         BigRIPSRaw_Zed_F11[kMaxBigRIPSRaw];   //[BigRIPSRaw_]

   TBranch        *b_EventInfo_;   //!
   TBranch        *b_BigRIPSRaw_;   //!

   TBranch        *b_EventInfo_timestamp;   //!
   TBranch        *b_EventInfo_fBit;   //!
   TBranch        *b_BigRIPSRaw_Zed_F11;   //!

   cout << endl << endl;

  for(int k=0;k<Nrun;k++){
    
    sprintf(pid_file,"/Disk/ds-sopa-group/np/RIKEN/May2015/PID_data/go4_%d.root",run0+k);
    input_file1 = new TFile(pid_file,"read");
    
    tree1= (TTree*) input_file1->Get("tree");
    if(!tree1){
      cout <<"\n\nNOOOOOOOOOOOO TREEEEEEEEEEEEEEEEEEEEEEEEE"<<endl;
      return;
    }

    //   tree1->Print();
    tree1->SetMakeClass(1);  // important!
    
    tree1->SetBranchAddress("EventInfo", &EventInfo_, &b_EventInfo_);
    tree1->SetBranchAddress("BigRIPSRaw", &BigRIPSRaw_, &b_BigRIPSRaw_);
    
    //    tree1->SetBranchAddress("EventInfo.timestamp",&my_tm_stp,0);
    //    tree1->SetBranchAddress("BigRIPSRaw.Zed_F11",&my_Z,0);
    //    tree1->SetBranchAddress("EventInfo.fBit",&my_bit,0);
    
    //    tree1->SetBranchAddress("EventInfo.timestamp",a_tm_stp,0);
    //tree1->SetBranchAddress("BigRIPSRaw.Zed_F11",a_Z,0);
    //    tree1->SetBranchAddress("EventInfo.fBit",a_bit,0);
    
    tree1->SetBranchAddress("EventInfo.timestamp", EventInfo_timestamp, &b_EventInfo_timestamp);
    tree1->SetBranchAddress("EventInfo.fBit", EventInfo_fBit, &b_EventInfo_fBit);
    tree1->SetBranchAddress("BigRIPSRaw.Zed_F11", BigRIPSRaw_Zed_F11, &b_BigRIPSRaw_Zed_F11);
    
    //  tree1->SetBranchAddress("EventInfo.timestamp", EventInfo_timestamp, 0);
    //    tree1->SetBranchAddress("EventInfo.fBit", EventInfo_fBit, 0);
    //tree1->SetBranchAddress("BigRIPSRaw.Zed_F11", BigRIPSRaw_Zed_F11, 0);
    
    //    tree1->SetBranchAddress("EventInfo.timestamp", EventInfo_timestamp, 0);
    //    tree1->SetBranchAddress("EventInfo.fBit", EventInfo_fBit, 0);
    //    tree1->SetBranchAddress("BigRIPSRaw.Zed_F11", BigRIPSRaw_Zed_F11, 0);

    //tree1->SetBranchStatus("EventInfo.timestamp",1);
    // tree1->SetBranchStatus("BigRIPSRaw.Zed_F11",1);
    //    tree1->SetBranchStatus("EventInfo.fBit",1);


    n_entries = tree1->GetEntries();
    //  n_entries_sum+= n_entries;
    
    cout << "Number of entries in PID tree= " << n_entries << " for file "<< pid_file<< " (accumulated= "<<n_entries_sum+n_entries<<")"<<endl;
    
    //  int module;

    if(Nmax>0 && Nmax<n_entries) n_max= Nmax;
    else n_max= n_entries;

    int i2=0;

    //  cout << "\nBIT  : TS  : Z"<<endl;
    for(long long i=0; i< n_max; i=i+Nskip){
      //tree1->LoadTree(i);

      //      cout << "loaded..."<<endl;
      tree1->GetEntry(i);

      hT2->Fill((i+n_entries_sum)/1e3,  EventInfo_timestamp[0]/1e6);
      if(n2<10000 && (i2%Nskip2) ==0){
	x2[n2]=(i+n_entries_sum)/1e3;
	t2[n2]=  EventInfo_timestamp[0]/1e6;
	n2++;
      }
      i2++;


      if(EventInfo_fBit[0]==3){
	hT3->Fill((i+n_entries_sum)/1e3,  EventInfo_timestamp[0]/1e6);
	if(n3<10000){
	  x3[n3]=(i+n_entries_sum)/1e3;
	  t3[n3]=  EventInfo_timestamp[0]/1e6;
	  n3++;
	}
      }
      else if(EventInfo_fBit[0]!=2){
	cout<< "i: "<<i<<" \t"<<     EventInfo_timestamp[0]<<" \t";   //[EventInfo_]
	cout<<     EventInfo_fBit[0]<<" \t";   //[EventInfo_]
	cout<<     BigRIPSRaw_Zed_F11[0]<<endl;   //[BigRIPSRaw_]
      }

      /***************
      if(i < 33){
	cout<< "i: "<<i<<" \t"<<     EventInfo_timestamp[0]<<" \t";   //[EventInfo_]
	cout<<     EventInfo_fBit[0]<<" \t";   //[EventInfo_]
	cout<<     BigRIPSRaw_Zed_F11[0]<<endl;   //[BigRIPSRaw_]
      }

      if(EventInfo_fBit[0] != 2){
	cout<< "i: "<<i<<" \t"<<     EventInfo_timestamp[0]<<" \t";   //[EventInfo_]
	cout<<     EventInfo_fBit[0]<<" \t";   //[EventInfo_]
	cout<<     BigRIPSRaw_Zed_F11[0]<<endl;   //[BigRIPSRaw_]
      }
... 32 more lines ...
Attachment 7: pulser_dts_go4_3022.png  25 kB  Uploaded Tue Jul 14 21:46:26 2015  | Hide | Hide all
pulser_dts_go4_3022.png
Attachment 8: pulser_dts_go4_3022_Z0.png  17 kB  Uploaded Tue Jul 14 21:46:49 2015  | Hide | Hide all
pulser_dts_go4_3022_Z0.png
Attachment 9: pulser_dts_go4_3022_Z1.png  20 kB  Uploaded Tue Jul 14 21:49:20 2015  | Hide | Hide all
pulser_dts_go4_3022_Z1.png
Attachment 10: pulser_dts_aida_r51_3_Z1.png  25 kB  Uploaded Tue Jul 14 21:51:12 2015  | Hide | Hide all
pulser_dts_aida_r51_3_Z1.png
ELOG V3.1.4-unknown