#include "final_fitting.h" #include "speed_calib.h" #include "timew_calib.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include TChain ch("myValidateMod/tof"); //-------------------------------------------------------------------------- // main routine //-------------------------------------------------------------------------- Int_t main(Int_t argc, char *argv[]) { TAuthenticate::SetGlobalUser("palencia"); char *infile[200]; int ntp_indx = 0; if (argc != 12) { printf("Usage: cal_exe \n"); return 1; } int events = atoi(argv[1]); int method = atoi(argv[2]); int flag = atoi(argv[3]); double cut1 = atof(argv[4]); double cut2 = atof(argv[5]); double cut3 = atoi(argv[6]); double cut4 = atoi(argv[7]); int cut5 = atoi(argv[8]); char *filename = argv[9]; char *directory = argv[10]; char *filentuple = argv[11]; cout << " \n"; cout << " Number of tracks = " << setw(7) << events << endl; cout << " Method = " << setw(7) << method << endl; cout << " Flag = " << setw(7) << flag << endl; cout << " First cut = " << setw(7) << cut1 << endl; cout << " Second cut = " << setw(7) << cut2 << endl; cout << " Third cut = " << setw(7) << cut3 << endl; cout << " Tracks (t0) cut = " << setw(7) << cut4 << endl; cout << " Z binning cut = " << setw(7) << cut5 << endl; cout << " File name = " << " " << filename << endl; cout << " Directory = " << directory << endl; cout << " ntuple name = " << filentuple << endl; // Cosmetics gStyle->SetOptFit (1001110); gStyle->SetOptStat(0111111); const int maxlong = 200; char names[maxlong]; ifstream ntuples; ntuples.open(filentuple,ios::in); // Read in the B0 live integrated luminosity and set the track // prescale factor. The minimum integrated luminosity to be sampled // is 2 fb-1. The tPrescale is the track or event modulus divisor: // It provides track/event counts from 0 to tPrescale-1, and the // tracks/events selected for use are from 0 to 9. Float_t intLumi(0.0), prescale(0.0); ntuples >> intLumi; // in nb-1 prescale = 10.0*(intLumi/2000.0); Int_t tPrescale = (prescale < 10.0) ? 10 : prescale+0.5; cout << " Prescale: Take 1st 10 / " << tPrescale << endl; do { ntuples>>names; infile[ntp_indx] = new char[maxlong]; sprintf(infile[ntp_indx],names); ++ntp_indx; } while(!(ntuples.eof())); ntp_indx = ntp_indx -1; cout << " el numero de lineas es = " << ntp_indx << endl; ntuples.close(); speed_calib speed(infile,ntp_indx,tPrescale); timew_calib timew(infile,ntp_indx,tPrescale); if (method == 0) speed.EventCounter(); if (method == 10) timew.EventCounter(); if (method == 1) speed.LoopSpd (events,flag,cut1, filename,directory); if (method == 2) timew.LoopTW (events,flag,cut1, filename,directory); if (method == 3) speed.LoopT0Abs(events, cut1, filename,directory); if (method == 4) speed.LoopAtt (events, cut1, filename,directory); if (method == 8) speed.LoopAttl (events, cut1, filename,directory, flag); if (method == 5) speed.LoopRes (events,flag,cut1,cut4,cut3,cut2,filename,directory); return 0; }