| 1 | //=//////////////////////////////////////////////////////////////////////
|
|---|
| 2 | //=
|
|---|
| 3 | //= creadparam
|
|---|
| 4 | //=
|
|---|
| 5 | //= @file creadparam.cxx
|
|---|
| 6 | //= @desc Reading of parameters file
|
|---|
| 7 | //= @author J C Gonzalez
|
|---|
| 8 | //= @email gonzalez@mppmu.mpg.de
|
|---|
| 9 | //= @date Thu May 7 16:24:22 1998
|
|---|
| 10 | //=
|
|---|
| 11 | //=----------------------------------------------------------------------
|
|---|
| 12 | //=
|
|---|
| 13 | //= Created: Thu May 7 16:24:22 1998
|
|---|
| 14 | //= Author: Jose Carlos Gonzalez
|
|---|
| 15 | //= Purpose: Program for reflector simulation
|
|---|
| 16 | //= Notes: See files README for details
|
|---|
| 17 | //=
|
|---|
| 18 | //=----------------------------------------------------------------------
|
|---|
| 19 | //=
|
|---|
| 20 | //= $RCSfile: creadparam.cxx,v $
|
|---|
| 21 | //= $Revision: 1.30 $
|
|---|
| 22 | //= $Author: moralejo $
|
|---|
| 23 | //= $Date: 2004-10-12 13:32:02 $
|
|---|
| 24 | //=
|
|---|
| 25 | //=//////////////////////////////////////////////////////////////////////
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 | #include "creadparam.h"
|
|---|
| 29 | #include "camera.h" // Needed for MAX_NUMBER_OF_CTS
|
|---|
| 30 |
|
|---|
| 31 | // Here we define the global variables where the values from the
|
|---|
| 32 | // parameters file are stored.
|
|---|
| 33 |
|
|---|
| 34 | static char **Input_filename; //@< input filename
|
|---|
| 35 | static char Starfield_filename[PATH_MAX_LENGTH]; //@< starfield input filename
|
|---|
| 36 | static int Starfield_center[6]={0,0,0,0,0,0}; //@< center of the starfield FOV
|
|---|
| 37 | //@< RA(H,M,S) & DEC (D,M,S)
|
|---|
| 38 | static char Data_filename[PATH_MAX_LENGTH]; //@< data filename
|
|---|
| 39 | static char ROOT_filename[PATH_MAX_LENGTH]; //@< data filename
|
|---|
| 40 | static char Loop_filename[PATH_MAX_LENGTH]; //@< special data filename
|
|---|
| 41 | static char CT_geom_string[256]; //@< Contains geometry ids of CTs
|
|---|
| 42 | static int CT_number = 1; //@< Number of CT
|
|---|
| 43 | static char **QE_filename; //@< name of the qe file
|
|---|
| 44 | static char NSB_directory[PATH_MAX_LENGTH]; //@< database for NSB
|
|---|
| 45 | static char NSB_outer_directory[PATH_MAX_LENGTH]; //@< database for NSB
|
|---|
| 46 | static int Starfield_rotate = FALSE; //@< switch on starfield rotation
|
|---|
| 47 | static int ElecNoise = TRUE; //@< Will we add ElecNoise?
|
|---|
| 48 | static float FADC_pedestal = 10.0; //@< Value for FADC Pedestal
|
|---|
| 49 | static float FADC_Noise_inner = 2.0; //@< Value for FADC ElecNoise
|
|---|
| 50 | static float FADC_Noise_outer = 2.0; //@< Value for FADC ElecNoise
|
|---|
| 51 | static float Digital_Noise = 0.0; //@< Value for FADC digital Noise
|
|---|
| 52 | static float Trig_Noise = 0.3; //@< Factor for Trigger ElecNoise
|
|---|
| 53 | static int simulateNSB = TRUE; //@< Will we simulate NSB?
|
|---|
| 54 | static float meanNSB; //@< NSB mean value (per pixel)
|
|---|
| 55 | static int nphe2NSB=0; //@< Number of phe from shower to do NSB simulation
|
|---|
| 56 | static float **qThreshold; //@< Threshold values
|
|---|
| 57 | static int Individual_Thres = FALSE;
|
|---|
| 58 | static float RiseDisc = -1.0;
|
|---|
| 59 | static float SecureDisc = 7.0;
|
|---|
| 60 | static long int Seeds[2]={69184,10406};
|
|---|
| 61 | static int *Skip;
|
|---|
| 62 | static int nSkip=0;
|
|---|
| 63 | static int Data_From_STDIN = FALSE;
|
|---|
| 64 | static int Write_All_Images = FALSE;
|
|---|
| 65 | static int Write_McEvt = TRUE;
|
|---|
| 66 | static int Write_McTrig = FALSE;
|
|---|
| 67 | static int Write_McFadc = FALSE;
|
|---|
| 68 | static int Write_RawEvt = TRUE;
|
|---|
| 69 | static int Select_Energy = TRUE;
|
|---|
| 70 | static float Select_Energy_le = 0.0; //@< GeV
|
|---|
| 71 | static float Select_Energy_ue = 100000.0; //@< GeV
|
|---|
| 72 | static int Trigger_Scan = FALSE;
|
|---|
| 73 | static int FADC_Scan = FALSE;
|
|---|
| 74 | static int Trigger_Loop = FALSE;
|
|---|
| 75 | static float Trigger_gate_length = 3.0;
|
|---|
| 76 | static float Trigger_over_time = 0.25;
|
|---|
| 77 | static float Trigger_response_ampl = 1.0;
|
|---|
| 78 | static float Trigger_response_fwhm = 2.0;
|
|---|
| 79 | static float Trigger_threshold[MAX_NUMBER_OF_CTS];
|
|---|
| 80 | static int Trigger_multiplicity[MAX_NUMBER_OF_CTS];
|
|---|
| 81 | static int Trigger_topology[MAX_NUMBER_OF_CTS];
|
|---|
| 82 | static float Trigger_loop_lthres = 3.0;
|
|---|
| 83 | static float Trigger_loop_uthres = 10.0;
|
|---|
| 84 | static float Trigger_loop_sthres = 1.0;
|
|---|
| 85 | static int Trigger_loop_lmult = 2;
|
|---|
| 86 | static int Trigger_loop_umult = 10;
|
|---|
| 87 | static int Trigger_loop_ltop = 0;
|
|---|
| 88 | static int Trigger_loop_utop = 2;
|
|---|
| 89 | static int FADC_shape = 0;
|
|---|
| 90 | static float FADC_response_ampl = MFADC_RESPONSE_INTEGRAL;
|
|---|
| 91 | static float FADC_response_fwhm = MFADC_RESPONSE_FWHM;
|
|---|
| 92 | static int FADC_shape_out = 0;
|
|---|
| 93 | static float FADC_resp_ampl_out = MFADC_RESPONSE_INTEGRAL;
|
|---|
| 94 | static float FADC_resp_fwhm_out = MFADC_RESPONSE_FWHM;
|
|---|
| 95 | static float FADC_slices_per_ns = FADC_SLICES_PER_NSEC;
|
|---|
| 96 | static int FADC_slices_written = FADC_SLICES;
|
|---|
| 97 | static float High_to_Low = 10.0; //@< Low gain channel respct to High
|
|---|
| 98 |
|
|---|
| 99 | static float sigma_x_spot = 0.; // Sigma in x and y (cm) for additional
|
|---|
| 100 | static float sigma_y_spot = 0.; // gaussian spread of the mirror spot.
|
|---|
| 101 |
|
|---|
| 102 | static float misp_x = 0.; // Mispointing in x
|
|---|
| 103 | static float misp_y = 0.; // Mispointing in y
|
|---|
| 104 |
|
|---|
| 105 | static float trig_delay = 25.; // Delay in ns between beginning of FADC
|
|---|
| 106 | // time window and the trigger instant.
|
|---|
| 107 |
|
|---|
| 108 | static float CTcoor[MAX_NUMBER_OF_CTS][3];
|
|---|
| 109 |
|
|---|
| 110 | static float m_fraction[MAX_NUMBER_OF_CTS];
|
|---|
| 111 |
|
|---|
| 112 | // Coordinates of CT locations, in centimeters, in the Corsika system.
|
|---|
| 113 |
|
|---|
| 114 | void
|
|---|
| 115 | readparam(char * filename)
|
|---|
| 116 | {
|
|---|
| 117 | char sign[] = GLUE_postp( PROGRAM, VERSION ); //@< initialize sign
|
|---|
| 118 | char line[LINE_MAX_LENGTH]; //@< line to get from the stdin
|
|---|
| 119 | char token[ITEM_MAX_LENGTH]; //@< a single token
|
|---|
| 120 | int i, j, k; //@< dummy counters
|
|---|
| 121 | float aux, aux1, aux2; //@< auxiliar variable
|
|---|
| 122 | int aux3, aux4; //@< auxiliar variable
|
|---|
| 123 | ifstream ifile;
|
|---|
| 124 | char filename_tmp[PATH_MAX_LENGTH];
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 | memset((char*)CT_geom_string, 0, sizeof(CT_geom_string));
|
|---|
| 128 |
|
|---|
| 129 | Input_filename = new char *[MAX_NUMBER_OF_CTS];
|
|---|
| 130 | QE_filename = new char *[MAX_NUMBER_OF_CTS];
|
|---|
| 131 | qThreshold = new float *[MAX_NUMBER_OF_CTS];
|
|---|
| 132 |
|
|---|
| 133 | for (int i = 0; i < MAX_NUMBER_OF_CTS; i++)
|
|---|
| 134 | {
|
|---|
| 135 | Input_filename[i] = new char[PATH_MAX_LENGTH];
|
|---|
| 136 | QE_filename[i] = new char[PATH_MAX_LENGTH];
|
|---|
| 137 | qThreshold[i] = new float[CAMERA_PIXELS];
|
|---|
| 138 | CTcoor[i][0] = 0.; CTcoor[i][1] = 0.; CTcoor[i][2] = 0.;
|
|---|
| 139 | m_fraction[i] = 1.;
|
|---|
| 140 | }
|
|---|
| 141 |
|
|---|
| 142 | // use cin or ifile (reading from STDIN or from parameters file?
|
|---|
| 143 | if ( filename != NULL )
|
|---|
| 144 | ifile.open( filename );
|
|---|
| 145 |
|
|---|
| 146 | // get signature
|
|---|
| 147 | if ( filename != NULL )
|
|---|
| 148 | ifile.getline(line, LINE_MAX_LENGTH);
|
|---|
| 149 | else
|
|---|
| 150 | cin.getline(line, LINE_MAX_LENGTH);
|
|---|
| 151 | line[strlen(SIGNATURE)] = '\0';
|
|---|
| 152 | strcpy(sign, line);
|
|---|
| 153 | cout<< '"' << sign << '"' << '\n';
|
|---|
| 154 | if (strcmp(sign, SIGNATURE) != 0) {
|
|---|
| 155 | cerr << "ERROR: Signature of parameters file is not correct\n";
|
|---|
| 156 | cerr << '"' << sign << '"' << '\n';
|
|---|
| 157 | cerr << "should be: " << SIGNATURE << '\n';
|
|---|
| 158 | exit(1);
|
|---|
| 159 | }
|
|---|
| 160 |
|
|---|
| 161 | // loop till the "end" directive is reached
|
|---|
| 162 | int is_end = FALSE;
|
|---|
| 163 | while (! is_end) {
|
|---|
| 164 |
|
|---|
| 165 | // get line from file or stdin
|
|---|
| 166 | if ( filename != NULL )
|
|---|
| 167 | ifile.getline(line, LINE_MAX_LENGTH);
|
|---|
| 168 | else
|
|---|
| 169 | cin.getline(line, LINE_MAX_LENGTH);
|
|---|
| 170 |
|
|---|
| 171 | // skip comments (start with '#')
|
|---|
| 172 | if (line[0] == '#')
|
|---|
| 173 | continue;
|
|---|
| 174 |
|
|---|
| 175 | // show user comments (start with '>')
|
|---|
| 176 | if (line[0] == '>') {
|
|---|
| 177 | cout << line << endl << flush;
|
|---|
| 178 | continue;
|
|---|
| 179 | }
|
|---|
| 180 |
|
|---|
| 181 | // look for each item at the beginning of the line
|
|---|
| 182 | for (i=0; i<=end_file; i++)
|
|---|
| 183 | if (strstr(line, ITEM_NAMES[i]) == line)
|
|---|
| 184 | break;
|
|---|
| 185 |
|
|---|
| 186 | // if it is not a valid line, just ignore it
|
|---|
| 187 | if (i == end_file+1) {
|
|---|
| 188 | cerr << "ERROR: Unknown token in [" << line << "]\n";
|
|---|
| 189 | exit(-1);
|
|---|
| 190 | }
|
|---|
| 191 |
|
|---|
| 192 | // case block for each directive
|
|---|
| 193 | switch ( i ) {
|
|---|
| 194 |
|
|---|
| 195 | case input_file: //@< name of the input file
|
|---|
| 196 |
|
|---|
| 197 | // get the name of the input_file from the line
|
|---|
| 198 | sscanf(line, "%s %i %s", token,&k, filename_tmp);
|
|---|
| 199 | if(k>99 || k<0){
|
|---|
| 200 | printf("ERROR : The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
|
|---|
| 201 | exit(1);
|
|---|
| 202 | }
|
|---|
| 203 | strcpy(&Input_filename[k][0],&filename_tmp[0]);
|
|---|
| 204 | break;
|
|---|
| 205 |
|
|---|
| 206 | case starfield_file: //@< name of the output file
|
|---|
| 207 |
|
|---|
| 208 | // get the name of the output_file from the line
|
|---|
| 209 | sscanf(line, "%s %s", token, Starfield_filename);
|
|---|
| 210 |
|
|---|
| 211 | break;
|
|---|
| 212 |
|
|---|
| 213 | case starfield_center: //@< name of the output file
|
|---|
| 214 |
|
|---|
| 215 | // get the name of the output_file from the line
|
|---|
| 216 | sscanf(line, "%s %i %i %i %i %i %i", token, &Starfield_center[0], &Starfield_center[1], &Starfield_center[2], &Starfield_center[3], &Starfield_center[4], &Starfield_center[5]);
|
|---|
| 217 |
|
|---|
| 218 | break;
|
|---|
| 219 |
|
|---|
| 220 | case data_file: //@< name of the data file
|
|---|
| 221 |
|
|---|
| 222 | // get the name of the data_file from the line
|
|---|
| 223 | sscanf(line, "%s %s", token, Data_filename);
|
|---|
| 224 |
|
|---|
| 225 | break;
|
|---|
| 226 |
|
|---|
| 227 | case root_file: //@< name of the ROOT file
|
|---|
| 228 |
|
|---|
| 229 | // get the name of the data_file from the line
|
|---|
| 230 | sscanf(line, "%s %s", token, ROOT_filename);
|
|---|
| 231 | cout << '[' << ROOT_filename << ']' << endl << flush;
|
|---|
| 232 |
|
|---|
| 233 | break;
|
|---|
| 234 |
|
|---|
| 235 | case ct_num: //@< number of telescopes
|
|---|
| 236 |
|
|---|
| 237 | // get the name of the ct_file from the line
|
|---|
| 238 | sscanf(line, "%s %i", token, &CT_number);
|
|---|
| 239 |
|
|---|
| 240 | break;
|
|---|
| 241 |
|
|---|
| 242 | case ct_geom: //@< name of the telescope file
|
|---|
| 243 |
|
|---|
| 244 | // get the name of the ct_file from the line
|
|---|
| 245 | sscanf(line, "%s %s", token, CT_geom_string);
|
|---|
| 246 | if ( strlen(CT_geom_string) > MAX_NUMBER_OF_CTS )
|
|---|
| 247 | {
|
|---|
| 248 | printf("\nError: ct_geom option read from input card wrong:\n");
|
|---|
| 249 | printf("Number of digits (%d) is larger than maximum number\n",strlen(CT_geom_string) );
|
|---|
| 250 | printf("of allowed telescopes (%d). Exiting.\n\n", MAX_NUMBER_OF_CTS);
|
|---|
| 251 | exit(1);
|
|---|
| 252 | }
|
|---|
| 253 |
|
|---|
| 254 | break;
|
|---|
| 255 |
|
|---|
| 256 | case qe_file: //@< name of the telescope file
|
|---|
| 257 |
|
|---|
| 258 | // get the name of the ct_file from the line
|
|---|
| 259 | sscanf(line, "%s %i %s", token, &k, filename_tmp);
|
|---|
| 260 | strcpy(&QE_filename[k][0],&filename_tmp[0]);
|
|---|
| 261 |
|
|---|
| 262 | break;
|
|---|
| 263 |
|
|---|
| 264 | case elec_noise_off: //@< add ElecNoise?
|
|---|
| 265 |
|
|---|
| 266 | // we will not add electronic noise for FADC and Trigger channels.
|
|---|
| 267 | ElecNoise = FALSE;
|
|---|
| 268 | FADC_Noise_inner = 0.0;
|
|---|
| 269 | FADC_Noise_outer = 0.0;
|
|---|
| 270 | Trig_Noise =0.0;
|
|---|
| 271 |
|
|---|
| 272 | break;
|
|---|
| 273 |
|
|---|
| 274 | case fadc_pedestal: //@< FADC pedestal
|
|---|
| 275 |
|
|---|
| 276 | // value for FADC Pedestal
|
|---|
| 277 | sscanf(line, "%s %f", token, &FADC_pedestal);
|
|---|
| 278 |
|
|---|
| 279 | //
|
|---|
| 280 | // A. Moralejo:
|
|---|
| 281 | // Require integer mean pedestal. Although it seems a silly
|
|---|
| 282 | // restriction, this saves lots of trouble (due to rounding
|
|---|
| 283 | // happening in the FADC), particularly when running the
|
|---|
| 284 | // simulation with no noise (NSB or electronic):
|
|---|
| 285 | //
|
|---|
| 286 |
|
|---|
| 287 | if (fmod((double)FADC_pedestal, (double)1.) > 1.e-4)
|
|---|
| 288 | {
|
|---|
| 289 | printf("ERROR : requested average FADC pedestal (%f) is not integer. Please use an integer value.\n", FADC_pedestal);
|
|---|
| 290 | exit(1);
|
|---|
| 291 | }
|
|---|
| 292 |
|
|---|
| 293 | break;
|
|---|
| 294 |
|
|---|
| 295 | case high_to_low: //@< High to Low gain ratio
|
|---|
| 296 |
|
|---|
| 297 | // Value for the Low Gain channel respect to the High gain
|
|---|
| 298 | sscanf(line, "%s %f", token, &High_to_Low);
|
|---|
| 299 |
|
|---|
| 300 | break;
|
|---|
| 301 |
|
|---|
| 302 | case fadc_noise: //@< FADC ElecNoise
|
|---|
| 303 |
|
|---|
| 304 | // value for FADC Elec Noise
|
|---|
| 305 | sscanf(line, "%s %f %f %f", token,
|
|---|
| 306 | &FADC_Noise_inner, &FADC_Noise_outer,
|
|---|
| 307 | &Digital_Noise);
|
|---|
| 308 |
|
|---|
| 309 | ElecNoise = TRUE;
|
|---|
| 310 |
|
|---|
| 311 | break;
|
|---|
| 312 |
|
|---|
| 313 | case trig_noise: //@< add ElecNoise?
|
|---|
| 314 |
|
|---|
| 315 | // factor for Trigger Elec Noise
|
|---|
| 316 | sscanf(line, "%s %f", token, &Trig_Noise);
|
|---|
| 317 | ElecNoise = TRUE;
|
|---|
| 318 |
|
|---|
| 319 | break;
|
|---|
| 320 |
|
|---|
| 321 | case sfr_on: //@< simulate starfield rotation?
|
|---|
| 322 |
|
|---|
| 323 | // we will simulate Starfield rotation
|
|---|
| 324 | Starfield_rotate = TRUE;
|
|---|
| 325 |
|
|---|
| 326 | break;
|
|---|
| 327 |
|
|---|
| 328 |
|
|---|
| 329 | case nsb_on: //@< simulate NSB?
|
|---|
| 330 |
|
|---|
| 331 | // we will simulate NSB
|
|---|
| 332 | simulateNSB = TRUE;
|
|---|
| 333 |
|
|---|
| 334 | break;
|
|---|
| 335 |
|
|---|
| 336 | case nsb_off: //@< simulate NSB?
|
|---|
| 337 |
|
|---|
| 338 | // we will NOT simulate NSB
|
|---|
| 339 | simulateNSB = FALSE;
|
|---|
| 340 |
|
|---|
| 341 | break;
|
|---|
| 342 |
|
|---|
| 343 | case nsb_mean: //@< value of <NSB> per pixel
|
|---|
| 344 |
|
|---|
| 345 | // get value of <NSB> (in photons)
|
|---|
| 346 | sscanf(line, "%s %f %d", token, &meanNSB, &nphe2NSB);
|
|---|
| 347 |
|
|---|
| 348 | break;
|
|---|
| 349 |
|
|---|
| 350 | case nsb_directory: //@< name of the output file
|
|---|
| 351 |
|
|---|
| 352 | // get the name of the NSB diretory for inner pixels
|
|---|
| 353 | sscanf(line, "%s %s", token, NSB_directory);
|
|---|
| 354 |
|
|---|
| 355 | break;
|
|---|
| 356 |
|
|---|
| 357 | case nsb_dir_outer: //@< name of the output file
|
|---|
| 358 |
|
|---|
| 359 | // get the name of the NSB diretory for outer pixels
|
|---|
| 360 | sscanf(line, "%s %s", token, NSB_outer_directory);
|
|---|
| 361 |
|
|---|
| 362 | break;
|
|---|
| 363 |
|
|---|
| 364 | case pixel_thres: //@< value of threshold for trigger (q0)
|
|---|
| 365 |
|
|---|
| 366 | // get value of threshold (in ph.e.)
|
|---|
| 367 | sscanf(line, "%s %i %f", token,&k, &aux);
|
|---|
| 368 | if(k>99 || k<0){
|
|---|
| 369 | printf("ERROR : The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
|
|---|
| 370 | exit(1);
|
|---|
| 371 | }
|
|---|
| 372 | qThreshold[0][k]=aux;
|
|---|
| 373 | Individual_Thres = TRUE;
|
|---|
| 374 |
|
|---|
| 375 | break;
|
|---|
| 376 |
|
|---|
| 377 | case secure_disc: //@< value of secure threshold
|
|---|
| 378 |
|
|---|
| 379 | // get value of secure threshold (in ph.e.)
|
|---|
| 380 | sscanf(line, "%s %f %f", token,&aux, &aux2);
|
|---|
| 381 | RiseDisc=aux;
|
|---|
| 382 | SecureDisc=aux2;
|
|---|
| 383 |
|
|---|
| 384 | break;
|
|---|
| 385 |
|
|---|
| 386 | case seeds: //@< values of seeds for random numbers
|
|---|
| 387 |
|
|---|
| 388 | // get seeds
|
|---|
| 389 | sscanf(line, "%s %ld %ld", token, &Seeds[0], &Seeds[1]);
|
|---|
| 390 |
|
|---|
| 391 | break;
|
|---|
| 392 |
|
|---|
| 393 | case skip: //@< skip pathological showers
|
|---|
| 394 |
|
|---|
| 395 | // get showers to skip
|
|---|
| 396 | cin >> nSkip;
|
|---|
| 397 | Skip = new int[nSkip];
|
|---|
| 398 | for (j=0; j<nSkip; ++j) {
|
|---|
| 399 | cin >> Skip[j];
|
|---|
| 400 | cout << Skip[j] << endl << flush;
|
|---|
| 401 | }
|
|---|
| 402 |
|
|---|
| 403 | break;
|
|---|
| 404 |
|
|---|
| 405 | case data_from_stdin: //@< to read data from stdin
|
|---|
| 406 |
|
|---|
| 407 | // change boolean value
|
|---|
| 408 | Data_From_STDIN = TRUE;
|
|---|
| 409 |
|
|---|
| 410 | break;
|
|---|
| 411 |
|
|---|
| 412 | case write_all_events: //@< to write ALL the images
|
|---|
| 413 |
|
|---|
| 414 | // change boolean value
|
|---|
| 415 | Write_All_Images = TRUE;
|
|---|
| 416 |
|
|---|
| 417 | break;
|
|---|
| 418 |
|
|---|
| 419 | case nowrite_McEvt: //@< do not write the McEvt info
|
|---|
| 420 |
|
|---|
| 421 | // change boolean value
|
|---|
| 422 | Write_McEvt = FALSE;
|
|---|
| 423 |
|
|---|
| 424 | break;
|
|---|
| 425 |
|
|---|
| 426 | case write_McTrig: //@< to write the McTrig info
|
|---|
| 427 |
|
|---|
| 428 | // change boolean value
|
|---|
| 429 | Write_McTrig = TRUE;
|
|---|
| 430 |
|
|---|
| 431 | break;
|
|---|
| 432 |
|
|---|
| 433 | case write_McFadc: //@< to write the McFadc info
|
|---|
| 434 |
|
|---|
| 435 | // change boolean value
|
|---|
| 436 | Write_McFadc = TRUE;
|
|---|
| 437 |
|
|---|
| 438 | break;
|
|---|
| 439 |
|
|---|
| 440 | case nowrite_RawEvt: //@< to write the McFadc info
|
|---|
| 441 |
|
|---|
| 442 | // change boolean value
|
|---|
| 443 | Write_RawEvt = FALSE;
|
|---|
| 444 |
|
|---|
| 445 | break;
|
|---|
| 446 |
|
|---|
| 447 | case select_energy: //@< value of islands_cut (i0)
|
|---|
| 448 |
|
|---|
| 449 | // get energy range
|
|---|
| 450 | sscanf(line, "%s %f %f", token, &Select_Energy_le, &Select_Energy_ue);
|
|---|
| 451 | Select_Energy = TRUE;
|
|---|
| 452 |
|
|---|
| 453 | break;
|
|---|
| 454 |
|
|---|
| 455 | case fadc_scan:
|
|---|
| 456 |
|
|---|
| 457 | // change boolean value
|
|---|
| 458 | FADC_Scan = TRUE;
|
|---|
| 459 |
|
|---|
| 460 | break;
|
|---|
| 461 |
|
|---|
| 462 | case fadc_prop:
|
|---|
| 463 |
|
|---|
| 464 | // Get parameters for the fadc response for one phe
|
|---|
| 465 | sscanf(line, "%s %i %f %f", token, &FADC_shape, &FADC_response_ampl,&FADC_response_fwhm);
|
|---|
| 466 |
|
|---|
| 467 | break;
|
|---|
| 468 |
|
|---|
| 469 | case fadc_outer:
|
|---|
| 470 |
|
|---|
| 471 | // Get parameters for the fadc response for one phe
|
|---|
| 472 | sscanf(line, "%s %i %f %f", token, &FADC_shape_out, &FADC_resp_ampl_out,&FADC_resp_fwhm_out);
|
|---|
| 473 |
|
|---|
| 474 | break;
|
|---|
| 475 |
|
|---|
| 476 | case fadc_GHz:
|
|---|
| 477 |
|
|---|
| 478 | // Get FADC sampling frequency in GHz (default 0.3)
|
|---|
| 479 | sscanf(line, "%s %f %i", token, &FADC_slices_per_ns, &FADC_slices_written);
|
|---|
| 480 |
|
|---|
| 481 | break;
|
|---|
| 482 |
|
|---|
| 483 | case trigger_scan:
|
|---|
| 484 |
|
|---|
| 485 | // change boolean value
|
|---|
| 486 | Trigger_Scan = TRUE;
|
|---|
| 487 |
|
|---|
| 488 | break;
|
|---|
| 489 | case trigger_prop:
|
|---|
| 490 |
|
|---|
| 491 | // Get parameters for the diskriminator and the electronic
|
|---|
| 492 | // response for one phe
|
|---|
| 493 | sscanf(line, "%s %f %f %f %f", token, &Trigger_gate_length,&Trigger_over_time, &Trigger_response_ampl,&Trigger_response_fwhm);
|
|---|
| 494 |
|
|---|
| 495 | break;
|
|---|
| 496 |
|
|---|
| 497 | case trigger_loop:
|
|---|
| 498 |
|
|---|
| 499 | // Get loop's limits
|
|---|
| 500 | sscanf(line, "%s %f %f %f %d %d %d %d", token, &Trigger_loop_lthres, &Trigger_loop_uthres, &Trigger_loop_sthres, &Trigger_loop_lmult, &Trigger_loop_umult, &Trigger_loop_ltop, &Trigger_loop_utop );
|
|---|
| 501 |
|
|---|
| 502 | // Set qThreshold to a global value
|
|---|
| 503 | for(k=0;k<CAMERA_PIXELS;k++){
|
|---|
| 504 | qThreshold[0][k]=Trigger_loop_lthres;
|
|---|
| 505 | }
|
|---|
| 506 |
|
|---|
| 507 | // change boolean value
|
|---|
| 508 | Trigger_Loop = TRUE;
|
|---|
| 509 | Write_RawEvt = FALSE;
|
|---|
| 510 | Individual_Thres = FALSE;
|
|---|
| 511 |
|
|---|
| 512 | break;
|
|---|
| 513 |
|
|---|
| 514 | case trigger_single:
|
|---|
| 515 |
|
|---|
| 516 | // Get trigger conditions
|
|---|
| 517 | sscanf(line, "%s %d %f %d %d", token, &j, &aux, &aux3, &aux4);
|
|---|
| 518 | if(j>99 || j<0){
|
|---|
| 519 | printf("ERROR : The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
|
|---|
| 520 | exit(1);
|
|---|
| 521 | }
|
|---|
| 522 | Trigger_threshold[j]=aux;
|
|---|
| 523 | Trigger_multiplicity[j]=aux3;
|
|---|
| 524 | Trigger_topology[j]=aux4;
|
|---|
| 525 |
|
|---|
| 526 | // Set qThreshold to a global value
|
|---|
| 527 | for(k=0;k<CAMERA_PIXELS;k++){
|
|---|
| 528 | qThreshold[j][k]=Trigger_threshold[j];
|
|---|
| 529 | }
|
|---|
| 530 |
|
|---|
| 531 | // change boolean value
|
|---|
| 532 | Trigger_Loop = FALSE;
|
|---|
| 533 | Write_RawEvt = TRUE;
|
|---|
| 534 | Individual_Thres = FALSE;
|
|---|
| 535 |
|
|---|
| 536 | break;
|
|---|
| 537 |
|
|---|
| 538 | case Trigger_Loop_Output_Only_Specialists:
|
|---|
| 539 |
|
|---|
| 540 | // get the name of the data_file from the line
|
|---|
| 541 | sscanf(line, "%s %s", token, Loop_filename);
|
|---|
| 542 | cout << '[' << Loop_filename << ']' << endl << flush;
|
|---|
| 543 |
|
|---|
| 544 | // change boolean value
|
|---|
| 545 | Write_RawEvt = TRUE;
|
|---|
| 546 |
|
|---|
| 547 | break;
|
|---|
| 548 |
|
|---|
| 549 | case trigger_delay:
|
|---|
| 550 |
|
|---|
| 551 | sscanf(line, "%s %f", token, &trig_delay);
|
|---|
| 552 | break;
|
|---|
| 553 |
|
|---|
| 554 |
|
|---|
| 555 | case sigma_xy_cm_spot:
|
|---|
| 556 |
|
|---|
| 557 | sscanf(line, "%s %f", token, &sigma_x_spot);
|
|---|
| 558 | sigma_y_spot=sigma_x_spot;
|
|---|
| 559 | break;
|
|---|
| 560 |
|
|---|
| 561 | case sigma_x_cm_spot:
|
|---|
| 562 |
|
|---|
| 563 | sscanf(line, "%s %f", token, &sigma_x_spot);
|
|---|
| 564 | break;
|
|---|
| 565 |
|
|---|
| 566 | case sigma_y_cm_spot:
|
|---|
| 567 |
|
|---|
| 568 | sscanf(line, "%s %f", token, &sigma_y_spot);
|
|---|
| 569 | break;
|
|---|
| 570 |
|
|---|
| 571 | case misspoint_deg:
|
|---|
| 572 |
|
|---|
| 573 | sscanf(line, "%s %f %f", token, &misp_x, &misp_y);
|
|---|
| 574 | break;
|
|---|
| 575 |
|
|---|
| 576 | case telescope_location_cm:
|
|---|
| 577 |
|
|---|
| 578 | if ( 5 != sscanf(line, "%s %d %f %f %f", token, &j, &aux, &aux1, &aux2) )
|
|---|
| 579 | {
|
|---|
| 580 | printf("\nError: wrong number of arguments for command telescope_location_cm.\n");
|
|---|
| 581 | printf("Usage: telescope_location_cm ct_id x y z\n");
|
|---|
| 582 | printf("Coordinates must be written in centimeters.");
|
|---|
| 583 | printf("Exiting.\n\n");
|
|---|
| 584 | exit(1);
|
|---|
| 585 | }
|
|---|
| 586 |
|
|---|
| 587 | if (j >= MAX_NUMBER_OF_CTS)
|
|---|
| 588 | {
|
|---|
| 589 | printf("\nError: coordinates were supplied for a telescope index (%d)\n", j);
|
|---|
| 590 | printf("larger than allowed. Valid telescope ids range from 0 to %d. Exiting.\n\n", MAX_NUMBER_OF_CTS-1);
|
|---|
| 591 | exit(1);
|
|---|
| 592 | }
|
|---|
| 593 | CTcoor[j][0] = aux;
|
|---|
| 594 | CTcoor[j][1] = aux1;
|
|---|
| 595 | CTcoor[j][2] = aux2;
|
|---|
| 596 |
|
|---|
| 597 | break;
|
|---|
| 598 |
|
|---|
| 599 | case mirror_fraction:
|
|---|
| 600 |
|
|---|
| 601 | sscanf(line, "%s %d %f", token, &j, &aux);
|
|---|
| 602 | m_fraction[j] = aux;
|
|---|
| 603 |
|
|---|
| 604 | break;
|
|---|
| 605 |
|
|---|
| 606 | case end_file: //@< end of the parameters file
|
|---|
| 607 |
|
|---|
| 608 | // show a short message
|
|---|
| 609 | is_end = TRUE;
|
|---|
| 610 |
|
|---|
| 611 | break;
|
|---|
| 612 |
|
|---|
| 613 |
|
|---|
| 614 | } // switch ( i )
|
|---|
| 615 |
|
|---|
| 616 | } // while (! is_end)
|
|---|
| 617 |
|
|---|
| 618 | // after the loop is finished, return to the main function
|
|---|
| 619 | return;
|
|---|
| 620 | }
|
|---|
| 621 | //!@}
|
|---|
| 622 |
|
|---|
| 623 |
|
|---|
| 624 | //!-----------------------------------------------------------
|
|---|
| 625 | // @name get_input_filename
|
|---|
| 626 | //
|
|---|
| 627 | // @desc get name of the input file
|
|---|
| 628 | //
|
|---|
| 629 | // @return Name of the Input file
|
|---|
| 630 | //
|
|---|
| 631 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 632 | //------------------------------------------------------------
|
|---|
| 633 | // @function
|
|---|
| 634 |
|
|---|
| 635 | //!@{
|
|---|
| 636 | char *
|
|---|
| 637 | get_input_filename(int i)
|
|---|
| 638 | {
|
|---|
| 639 | return (Input_filename[i]);
|
|---|
| 640 | }
|
|---|
| 641 | //!@}
|
|---|
| 642 |
|
|---|
| 643 |
|
|---|
| 644 | //!-----------------------------------------------------------
|
|---|
| 645 | // @name get_starfield_filename
|
|---|
| 646 | //
|
|---|
| 647 | // @desc get name of the starfield input file
|
|---|
| 648 | //
|
|---|
| 649 | // @return Name of the starfield file
|
|---|
| 650 | //
|
|---|
| 651 | // @date Tue Feb 15 16:02:18 CET 2000
|
|---|
| 652 | //------------------------------------------------------------
|
|---|
| 653 | // @function
|
|---|
| 654 |
|
|---|
| 655 | //!@{
|
|---|
| 656 | char *
|
|---|
| 657 | get_starfield_filename(void)
|
|---|
| 658 | {
|
|---|
| 659 | return (Starfield_filename);
|
|---|
| 660 | }
|
|---|
| 661 | //!@}
|
|---|
| 662 |
|
|---|
| 663 |
|
|---|
| 664 | //!-----------------------------------------------------------
|
|---|
| 665 | // @name get_starfield_center
|
|---|
| 666 | //
|
|---|
| 667 | // @desc get center of the starfield FOV
|
|---|
| 668 | //
|
|---|
| 669 | // @return Central co-ordinates in RA and DEC for the centre of FOV
|
|---|
| 670 | //
|
|---|
| 671 | // @date Tue Feb 15 16:02:18 CET 2000
|
|---|
| 672 | //------------------------------------------------------------
|
|---|
| 673 | // @function
|
|---|
| 674 |
|
|---|
| 675 | //!@{
|
|---|
| 676 | void get_starfield_center(int *rh,int *rm,int *rs,int *dd,int *dm,int *ds)
|
|---|
| 677 | {
|
|---|
| 678 | *rh=Starfield_center[0];
|
|---|
| 679 | *rm=Starfield_center[1];
|
|---|
| 680 | *rs=Starfield_center[2];
|
|---|
| 681 | *dd=Starfield_center[3];
|
|---|
| 682 | *dm=Starfield_center[4];
|
|---|
| 683 | *ds=Starfield_center[5];
|
|---|
| 684 | }
|
|---|
| 685 | //!-----------------------------------------------------------
|
|---|
| 686 | // @name get_starfield_rotate
|
|---|
| 687 | //
|
|---|
| 688 | // @Starfield_rotate
|
|---|
| 689 | //
|
|---|
| 690 | // @return
|
|---|
| 691 | //
|
|---|
| 692 | //------------------------------------------------------------
|
|---|
| 693 | // @function
|
|---|
| 694 |
|
|---|
| 695 | //!@{
|
|---|
| 696 | int
|
|---|
| 697 | get_starfield_rotate(void)
|
|---|
| 698 | {
|
|---|
| 699 | return(Starfield_rotate);
|
|---|
| 700 | }
|
|---|
| 701 |
|
|---|
| 702 |
|
|---|
| 703 | //!@}
|
|---|
| 704 | //!-----------------------------------------------------------
|
|---|
| 705 | // @name get_data_filename
|
|---|
| 706 | //
|
|---|
| 707 | // @desc get name of the data file
|
|---|
| 708 | //
|
|---|
| 709 | // @return Name of the Data file
|
|---|
| 710 | //
|
|---|
| 711 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 712 | //------------------------------------------------------------
|
|---|
| 713 | // @function
|
|---|
| 714 |
|
|---|
| 715 | //!@{
|
|---|
| 716 | char *
|
|---|
| 717 | get_data_filename(void)
|
|---|
| 718 | {
|
|---|
| 719 | return (Data_filename);
|
|---|
| 720 | }
|
|---|
| 721 | //!@}
|
|---|
| 722 |
|
|---|
| 723 |
|
|---|
| 724 | //!-----------------------------------------------------------
|
|---|
| 725 | // @name get_root_filename
|
|---|
| 726 | //
|
|---|
| 727 | // @desc get name of the ROOT file
|
|---|
| 728 | //
|
|---|
| 729 | // @return Name of the ROOT file
|
|---|
| 730 | //
|
|---|
| 731 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 732 | //------------------------------------------------------------
|
|---|
| 733 | // @function
|
|---|
| 734 |
|
|---|
| 735 | //!@{
|
|---|
| 736 | char *
|
|---|
| 737 | get_root_filename(void)
|
|---|
| 738 | {
|
|---|
| 739 | return (ROOT_filename);
|
|---|
| 740 | }
|
|---|
| 741 | //!@}
|
|---|
| 742 | //!-----------------------------------------------------------
|
|---|
| 743 | // @name get_loop_filename
|
|---|
| 744 | //
|
|---|
| 745 | // @desc get name of the special ROOT file
|
|---|
| 746 | //
|
|---|
| 747 | // @return Name of the special ROOT file
|
|---|
| 748 | //
|
|---|
| 749 | // @date Fri Jun 23 17:34:19 CEST 2000
|
|---|
| 750 | //------------------------------------------------------------
|
|---|
| 751 | // @function
|
|---|
| 752 |
|
|---|
| 753 | //!@{
|
|---|
| 754 |
|
|---|
| 755 | char *
|
|---|
| 756 | get_loop_filename(void)
|
|---|
| 757 | {
|
|---|
| 758 | return (Loop_filename);
|
|---|
| 759 | }
|
|---|
| 760 | //!@}
|
|---|
| 761 |
|
|---|
| 762 | //!-----------------------------------------------------------
|
|---|
| 763 | // @name get_ct_number
|
|---|
| 764 | //
|
|---|
| 765 | // @desc get number of CT
|
|---|
| 766 | //
|
|---|
| 767 | // @return number of CT
|
|---|
| 768 | //
|
|---|
| 769 | // @date Tue Jul 29 01:48:26 CEST 2003
|
|---|
| 770 | //------------------------------------------------------------
|
|---|
| 771 | // @function
|
|---|
| 772 |
|
|---|
| 773 | //!@{
|
|---|
| 774 | int
|
|---|
| 775 | get_ct_number(void)
|
|---|
| 776 | {
|
|---|
| 777 | return (CT_number);
|
|---|
| 778 | }
|
|---|
| 779 | //!@}
|
|---|
| 780 |
|
|---|
| 781 | //!-----------------------------------------------------------
|
|---|
| 782 | // @name get_ct_geometry
|
|---|
| 783 | //
|
|---|
| 784 | // @desc get geometry of CT
|
|---|
| 785 | //
|
|---|
| 786 | // @return geometry of CT
|
|---|
| 787 | //
|
|---|
| 788 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 789 | //------------------------------------------------------------
|
|---|
| 790 | // @function
|
|---|
| 791 |
|
|---|
| 792 | //!@{
|
|---|
| 793 | int
|
|---|
| 794 | get_ct_geometry(int ict)
|
|---|
| 795 | {
|
|---|
| 796 | char dummy[2];
|
|---|
| 797 | strncpy(dummy, &(CT_geom_string[ict]), 1);
|
|---|
| 798 | dummy[1] = '\0';
|
|---|
| 799 |
|
|---|
| 800 | return ((int)atoi(dummy));
|
|---|
| 801 | }
|
|---|
| 802 | //!@}
|
|---|
| 803 |
|
|---|
| 804 | //!-----------------------------------------------------------
|
|---|
| 805 | // @name get_qe_filename
|
|---|
| 806 | //
|
|---|
| 807 | // @desc get name of QE definition file
|
|---|
| 808 | //
|
|---|
| 809 | // @return Name of the QE definition file
|
|---|
| 810 | //
|
|---|
| 811 | // @date Thu Jul 10 14:10:13 CEST 2003
|
|---|
| 812 | //------------------------------------------------------------
|
|---|
| 813 | // @function
|
|---|
| 814 |
|
|---|
| 815 | //!@{
|
|---|
| 816 | char *
|
|---|
| 817 | get_qe_filename(int ict)
|
|---|
| 818 | {
|
|---|
| 819 | return (QE_filename[ict]);
|
|---|
| 820 | }
|
|---|
| 821 | //!@}
|
|---|
| 822 |
|
|---|
| 823 | //!-----------------------------------------------------------
|
|---|
| 824 | // @name get_nsb_directory
|
|---|
| 825 | //
|
|---|
| 826 | // @desc get name of the directory where the database for NSB is
|
|---|
| 827 | //
|
|---|
| 828 | // @return Name of the NSB directory
|
|---|
| 829 | //
|
|---|
| 830 | // @date Tue Jan 30 12:07:56 MET 2001
|
|---|
| 831 | //------------------------------------------------------------
|
|---|
| 832 | // @function
|
|---|
| 833 |
|
|---|
| 834 | //!@{
|
|---|
| 835 | char *
|
|---|
| 836 | get_nsb_directory(void)
|
|---|
| 837 | {
|
|---|
| 838 | return (NSB_directory);
|
|---|
| 839 | }
|
|---|
| 840 | //!@}
|
|---|
| 841 |
|
|---|
| 842 |
|
|---|
| 843 |
|
|---|
| 844 | //!-----------------------------------------------------------
|
|---|
| 845 | // @name get_nsb_directory_outer
|
|---|
| 846 | //
|
|---|
| 847 | // @desc get name of the directory where the database for NSB is
|
|---|
| 848 | //
|
|---|
| 849 | // @return Name of the NSB directory for outer pixels
|
|---|
| 850 | //
|
|---|
| 851 | // @date Thu Jul 10 14:10:13 CEST 2003
|
|---|
| 852 | //------------------------------------------------------------
|
|---|
| 853 | // @function
|
|---|
| 854 |
|
|---|
| 855 | //!@{
|
|---|
| 856 | char *
|
|---|
| 857 | get_nsb_directory_outer(void)
|
|---|
| 858 | {
|
|---|
| 859 | return (NSB_outer_directory);
|
|---|
| 860 | }
|
|---|
| 861 | //!@}
|
|---|
| 862 |
|
|---|
| 863 |
|
|---|
| 864 |
|
|---|
| 865 | //!-----------------------------------------------------------
|
|---|
| 866 | // @name add_elec_noise
|
|---|
| 867 | //
|
|---|
| 868 | // @desc are we going to add the ElecNoise?
|
|---|
| 869 | //
|
|---|
| 870 | // @date Mon Jan 14 19:27:56 MET DST 2002
|
|---|
| 871 | //------------------------------------------------------------
|
|---|
| 872 | // @function
|
|---|
| 873 |
|
|---|
| 874 | //!@{
|
|---|
| 875 | int
|
|---|
| 876 | add_elec_noise(float *fadcinner, float*fadcouter, float *digi, float *trig)
|
|---|
| 877 | {
|
|---|
| 878 | *fadcinner = FADC_Noise_inner;
|
|---|
| 879 | *fadcouter = FADC_Noise_outer;
|
|---|
| 880 |
|
|---|
| 881 | *digi = Digital_Noise;
|
|---|
| 882 | *trig = Trig_Noise;
|
|---|
| 883 |
|
|---|
| 884 | return ( ElecNoise);
|
|---|
| 885 | }
|
|---|
| 886 | //!@}
|
|---|
| 887 |
|
|---|
| 888 | //!-----------------------------------------------------------
|
|---|
| 889 | // @name get_nsb
|
|---|
| 890 | //
|
|---|
| 891 | // @desc are we going to simulate NSB ?
|
|---|
| 892 | //
|
|---|
| 893 | // @var *n Mean value for the NSB (ph.e./pixel)
|
|---|
| 894 | // @return TRUE: we'll simulate NSB; FALSE: we won't
|
|---|
| 895 | //
|
|---|
| 896 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 897 | //------------------------------------------------------------
|
|---|
| 898 | // @function
|
|---|
| 899 |
|
|---|
| 900 | //!@{
|
|---|
| 901 | int
|
|---|
| 902 | get_nsb(float *n, int *m)
|
|---|
| 903 | {
|
|---|
| 904 | *n = meanNSB;
|
|---|
| 905 | *m = nphe2NSB;
|
|---|
| 906 | return ( simulateNSB );
|
|---|
| 907 | }
|
|---|
| 908 | //!@}
|
|---|
| 909 |
|
|---|
| 910 |
|
|---|
| 911 | //!-----------------------------------------------------------
|
|---|
| 912 | // @name get_threshold
|
|---|
| 913 | //
|
|---|
| 914 | // @desc get threshold value
|
|---|
| 915 | //
|
|---|
| 916 | // @return Value of the threshold q$_0$
|
|---|
| 917 | //
|
|---|
| 918 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 919 | //------------------------------------------------------------
|
|---|
| 920 | // @function
|
|---|
| 921 |
|
|---|
| 922 | //!@{
|
|---|
| 923 | void
|
|---|
| 924 | get_threshold(float *t)
|
|---|
| 925 | {
|
|---|
| 926 | for(int i=0;i<CAMERA_PIXELS;i++)
|
|---|
| 927 | t[i]=qThreshold[0][i];
|
|---|
| 928 | }
|
|---|
| 929 | //!@}
|
|---|
| 930 |
|
|---|
| 931 | //!-----------------------------------------------------------
|
|---|
| 932 | // @name get_secure_threhold
|
|---|
| 933 | //
|
|---|
| 934 | // @desc get values for secure threshold.
|
|---|
| 935 | //
|
|---|
| 936 | // @return AC (ac)value above which discriminator threshold rised to disc
|
|---|
| 937 | //
|
|---|
| 938 | // @date Wed Jul 18 16:29:43 CEST 2001
|
|---|
| 939 | //------------------------------------------------------------
|
|---|
| 940 | // @function
|
|---|
| 941 |
|
|---|
| 942 | //!@{
|
|---|
| 943 | void
|
|---|
| 944 | get_secure_threhold(float *ac, float *disc)
|
|---|
| 945 | {
|
|---|
| 946 | *ac=RiseDisc;
|
|---|
| 947 | *disc=SecureDisc;
|
|---|
| 948 | }
|
|---|
| 949 | //!@}
|
|---|
| 950 |
|
|---|
| 951 | //!-----------------------------------------------------------
|
|---|
| 952 | // @name get_indi_thres_pixel
|
|---|
| 953 | //
|
|---|
| 954 | // @desc get boolean information about global (FALSE) or
|
|---|
| 955 | // @desc individual (TRUE) pixel trigger threshold
|
|---|
| 956 | //
|
|---|
| 957 | // @return Value for the Individual_Thres
|
|---|
| 958 | //
|
|---|
| 959 | // @date Wed Jul 18 16:29:43 CEST 2001
|
|---|
| 960 | //------------------------------------------------------------
|
|---|
| 961 | // @function
|
|---|
| 962 |
|
|---|
| 963 | //!@{
|
|---|
| 964 | int get_indi_thres_pixel(void){
|
|---|
| 965 | return Individual_Thres;
|
|---|
| 966 | }
|
|---|
| 967 | //!@}
|
|---|
| 968 |
|
|---|
| 969 |
|
|---|
| 970 | //!-----------------------------------------------------------
|
|---|
| 971 | // @name get_seeds
|
|---|
| 972 | //
|
|---|
| 973 | // @desc are we going to count the islands ?
|
|---|
| 974 | //
|
|---|
| 975 | // @var *n Number of the seed
|
|---|
| 976 | // @return N-th random-number Seed
|
|---|
| 977 | //
|
|---|
| 978 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 979 | //------------------------------------------------------------
|
|---|
| 980 | // @function
|
|---|
| 981 |
|
|---|
| 982 | //!@{
|
|---|
| 983 | long int
|
|---|
| 984 | get_seeds(int n)
|
|---|
| 985 | {
|
|---|
| 986 | return ( Seeds[n] );
|
|---|
| 987 | }
|
|---|
| 988 | //!@}
|
|---|
| 989 |
|
|---|
| 990 |
|
|---|
| 991 | //!-----------------------------------------------------------
|
|---|
| 992 | // @name get_skip_showers
|
|---|
| 993 | //
|
|---|
| 994 | // @desc get list of showers to skip
|
|---|
| 995 | //
|
|---|
| 996 | // @var *s1 Pointer to a vector of number of showers
|
|---|
| 997 | //
|
|---|
| 998 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 999 | //------------------------------------------------------------
|
|---|
| 1000 | // @function
|
|---|
| 1001 |
|
|---|
| 1002 | //!@{
|
|---|
| 1003 | void
|
|---|
| 1004 | get_skip_showers( int *s )
|
|---|
| 1005 | {
|
|---|
| 1006 | int i;
|
|---|
| 1007 | for (i=0; i<nSkip; ++i)
|
|---|
| 1008 | s[i] = Skip[i];
|
|---|
| 1009 | }
|
|---|
| 1010 | //!@}
|
|---|
| 1011 |
|
|---|
| 1012 |
|
|---|
| 1013 | //!-----------------------------------------------------------
|
|---|
| 1014 | // @name get_nskip_showers
|
|---|
| 1015 | //
|
|---|
| 1016 | // @desc get number of showers to skip
|
|---|
| 1017 | //
|
|---|
| 1018 | // @return Number of showers to be skipped
|
|---|
| 1019 | //
|
|---|
| 1020 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
|---|
| 1021 | //------------------------------------------------------------
|
|---|
| 1022 | // @function
|
|---|
| 1023 |
|
|---|
| 1024 | //!@{
|
|---|
| 1025 | int
|
|---|
| 1026 | get_nskip_showers( void )
|
|---|
| 1027 | {
|
|---|
| 1028 | return( nSkip );
|
|---|
| 1029 | }
|
|---|
| 1030 | //!@}
|
|---|
| 1031 |
|
|---|
| 1032 |
|
|---|
| 1033 | //!-----------------------------------------------------------
|
|---|
| 1034 | // @name get_data_from_stdin
|
|---|
| 1035 | //
|
|---|
| 1036 | // @desc get whether we will read the data from the STDIN
|
|---|
| 1037 | //
|
|---|
| 1038 | // @return TRUE: we'll read data from STDIN; FALSE: we won't
|
|---|
| 1039 | //
|
|---|
| 1040 | // @date Wed Nov 25 13:21:00 MET 1998
|
|---|
| 1041 | //------------------------------------------------------------
|
|---|
| 1042 | // @function
|
|---|
| 1043 |
|
|---|
| 1044 | //!@{
|
|---|
| 1045 | int
|
|---|
| 1046 | get_data_from_stdin(void)
|
|---|
| 1047 | {
|
|---|
| 1048 | return ( Data_From_STDIN );
|
|---|
| 1049 | }
|
|---|
| 1050 | //!@}
|
|---|
| 1051 |
|
|---|
| 1052 |
|
|---|
| 1053 | //!-----------------------------------------------------------
|
|---|
| 1054 | // @name write_all_events
|
|---|
| 1055 | //
|
|---|
| 1056 | // @desc write all images to .phe, even those without trigger
|
|---|
| 1057 | //
|
|---|
| 1058 | // @return TRUE: we'll write everything; FALSE: we won't
|
|---|
| 1059 | //
|
|---|
| 1060 | // @date Wed Nov 25 13:21:00 MET 1998
|
|---|
| 1061 | //------------------------------------------------------------
|
|---|
| 1062 | // @function
|
|---|
| 1063 |
|
|---|
| 1064 | //!@{
|
|---|
| 1065 | int
|
|---|
| 1066 | get_write_all_events(void)
|
|---|
| 1067 | {
|
|---|
| 1068 | return ( Write_All_Images );
|
|---|
| 1069 | }
|
|---|
| 1070 | //!@}
|
|---|
| 1071 |
|
|---|
| 1072 | //!-----------------------------------------------------------
|
|---|
| 1073 | // @name write_McEvt
|
|---|
| 1074 | //
|
|---|
| 1075 | // @desc write the McEvt class for each event to the .root file
|
|---|
| 1076 | //
|
|---|
| 1077 | // @return TRUE: we'll write it; FALSE: we won't
|
|---|
| 1078 | //
|
|---|
| 1079 | //------------------------------------------------------------
|
|---|
| 1080 | // @function
|
|---|
| 1081 |
|
|---|
| 1082 | //!@{
|
|---|
| 1083 | int
|
|---|
| 1084 | get_write_McEvt(void)
|
|---|
| 1085 | {
|
|---|
| 1086 | return ( Write_McEvt );
|
|---|
| 1087 | }
|
|---|
| 1088 | //!@}
|
|---|
| 1089 |
|
|---|
| 1090 | //!-----------------------------------------------------------
|
|---|
| 1091 | // @name write_McTrig
|
|---|
| 1092 | //
|
|---|
| 1093 | // @desc write the McTrig class for each event to the .root file
|
|---|
| 1094 | //
|
|---|
| 1095 | // @return TRUE: we'll write it; FALSE: we won't
|
|---|
| 1096 | //
|
|---|
| 1097 | //------------------------------------------------------------
|
|---|
| 1098 | // @function
|
|---|
| 1099 |
|
|---|
| 1100 | //!@{
|
|---|
| 1101 | int
|
|---|
| 1102 | get_write_McTrig(void)
|
|---|
| 1103 | {
|
|---|
| 1104 | return ( Write_McTrig );
|
|---|
| 1105 | }
|
|---|
| 1106 | //!@}
|
|---|
| 1107 |
|
|---|
| 1108 | //!-----------------------------------------------------------
|
|---|
| 1109 | // @name write_McFadc
|
|---|
| 1110 | //
|
|---|
| 1111 | // @desc write the McFadc class for each event to the .root file
|
|---|
| 1112 | //
|
|---|
| 1113 | // @return TRUE: we'll write it; FALSE: we won't
|
|---|
| 1114 | //
|
|---|
| 1115 | //------------------------------------------------------------
|
|---|
| 1116 | // @function
|
|---|
| 1117 |
|
|---|
| 1118 | //!@{
|
|---|
| 1119 | int
|
|---|
| 1120 | get_write_McFadc(void)
|
|---|
| 1121 | {
|
|---|
| 1122 | return ( Write_McFadc );
|
|---|
| 1123 | }
|
|---|
| 1124 | //!@}
|
|---|
| 1125 |
|
|---|
| 1126 | //!-----------------------------------------------------------
|
|---|
| 1127 | // @name write_RawEvt
|
|---|
| 1128 | //
|
|---|
| 1129 | // @desc write the RawEvt class for each event to the .root file
|
|---|
| 1130 | //
|
|---|
| 1131 | // @return TRUE: we'll write it; FALSE: we won't
|
|---|
| 1132 | //
|
|---|
| 1133 | //------------------------------------------------------------
|
|---|
| 1134 | // @function
|
|---|
| 1135 |
|
|---|
| 1136 | //!@{
|
|---|
| 1137 | int
|
|---|
| 1138 | get_write_RawEvt(void)
|
|---|
| 1139 | {
|
|---|
| 1140 | return ( Write_RawEvt );
|
|---|
| 1141 | }
|
|---|
| 1142 | //!@}
|
|---|
| 1143 |
|
|---|
| 1144 | //!-----------------------------------------------------------
|
|---|
| 1145 | // @name get_select_energy
|
|---|
| 1146 | //
|
|---|
| 1147 | // @desc return energy range allowed for showers from .phe file
|
|---|
| 1148 | //
|
|---|
| 1149 | // @var *le Lower limit in the allowed energy range
|
|---|
| 1150 | // @var *ue Lower limit in the allowed energy range
|
|---|
| 1151 | // @return TRUE: we make selection on the energy; FALSE: we don't
|
|---|
| 1152 | //
|
|---|
| 1153 | // @date Wed Nov 25 13:21:00 MET 1998
|
|---|
| 1154 | //------------------------------------------------------------
|
|---|
| 1155 | // @function
|
|---|
| 1156 |
|
|---|
| 1157 | //!@{
|
|---|
| 1158 | int
|
|---|
| 1159 | get_select_energy(float *le, float *ue)
|
|---|
| 1160 | {
|
|---|
| 1161 | *le = Select_Energy_le;
|
|---|
| 1162 | *ue = Select_Energy_ue;
|
|---|
| 1163 | return ( Select_Energy );
|
|---|
| 1164 | }
|
|---|
| 1165 | //!@}
|
|---|
| 1166 |
|
|---|
| 1167 | //!-----------------------------------------------------------
|
|---|
| 1168 | // @name FADC_Scan
|
|---|
| 1169 | //
|
|---|
| 1170 | // @desc show the FADC signal for each event in the screen
|
|---|
| 1171 | //
|
|---|
| 1172 | // @return TRUE: we'll show it; FALSE: we won't
|
|---|
| 1173 | //
|
|---|
| 1174 | //------------------------------------------------------------
|
|---|
| 1175 | // @function
|
|---|
| 1176 |
|
|---|
| 1177 | //!@{
|
|---|
| 1178 | int
|
|---|
| 1179 | get_FADC_Scan(void)
|
|---|
| 1180 | {
|
|---|
| 1181 | return ( FADC_Scan );
|
|---|
| 1182 | }
|
|---|
| 1183 | //!@}
|
|---|
| 1184 |
|
|---|
| 1185 | //!-----------------------------------------------------------
|
|---|
| 1186 | // @name Trigger_Scan
|
|---|
| 1187 | //
|
|---|
| 1188 | // @desc show the Trigger signal for each event in the screen
|
|---|
| 1189 | //
|
|---|
| 1190 | // @return TRUE: we'll show it; FALSE: we won't
|
|---|
| 1191 | //
|
|---|
| 1192 | //------------------------------------------------------------
|
|---|
| 1193 | // @function
|
|---|
| 1194 |
|
|---|
| 1195 | //!@{
|
|---|
| 1196 | int
|
|---|
| 1197 | get_Trigger_Scan(void)
|
|---|
| 1198 | {
|
|---|
| 1199 | return ( Trigger_Scan );
|
|---|
| 1200 | }
|
|---|
| 1201 | //!@}
|
|---|
| 1202 |
|
|---|
| 1203 | //!-----------------------------------------------------------
|
|---|
| 1204 | // @name Fadc_Propeties
|
|---|
| 1205 | //
|
|---|
| 1206 | // @desc fix properties of the FADC response
|
|---|
| 1207 | //
|
|---|
| 1208 | //------------------------------------------------------------
|
|---|
| 1209 | // @function
|
|---|
| 1210 |
|
|---|
| 1211 | //!@{
|
|---|
| 1212 | void
|
|---|
| 1213 | get_FADC_properties(int *shape,float *ra, float *rf,
|
|---|
| 1214 | int *shapeo, float *rao, float *rfo,
|
|---|
| 1215 | float *fadc_spns, int *fadc_slices)
|
|---|
| 1216 | {
|
|---|
| 1217 | *shape = FADC_shape;
|
|---|
| 1218 | *ra = FADC_response_ampl;
|
|---|
| 1219 | *rf = FADC_response_fwhm;
|
|---|
| 1220 | *shapeo = FADC_shape_out;
|
|---|
| 1221 | *rao = FADC_resp_ampl_out;
|
|---|
| 1222 | *rfo = FADC_resp_fwhm_out;
|
|---|
| 1223 | *fadc_spns = FADC_slices_per_ns;
|
|---|
| 1224 | *fadc_slices = FADC_slices_written;
|
|---|
| 1225 | }
|
|---|
| 1226 | //!@}
|
|---|
| 1227 |
|
|---|
| 1228 | //!-----------------------------------------------------------
|
|---|
| 1229 | // @name Trigger_Propeties
|
|---|
| 1230 | //
|
|---|
| 1231 | // @desc fix properties of the diskriminator and amplifier for Trigger
|
|---|
| 1232 | //
|
|---|
| 1233 | //------------------------------------------------------------
|
|---|
| 1234 | // @function
|
|---|
| 1235 |
|
|---|
| 1236 | //!@{
|
|---|
| 1237 | void
|
|---|
| 1238 | get_Trigger_properties(float *gl, float *ot, float *ra, float *rf)
|
|---|
| 1239 | {
|
|---|
| 1240 | *gl=Trigger_gate_length;
|
|---|
| 1241 | *ot=Trigger_over_time;
|
|---|
| 1242 | *ra=Trigger_response_ampl;
|
|---|
| 1243 | *rf=Trigger_response_fwhm;
|
|---|
| 1244 |
|
|---|
| 1245 | }
|
|---|
| 1246 | //!@}
|
|---|
| 1247 |
|
|---|
| 1248 | //!-----------------------------------------------------------
|
|---|
| 1249 | // @name Trigger_Loop
|
|---|
| 1250 | //
|
|---|
| 1251 | // @desc make a loop over Trigger conditions
|
|---|
| 1252 | //
|
|---|
| 1253 | // @return TRUE: we'll make it; FALSE: we won't
|
|---|
| 1254 | //
|
|---|
| 1255 | //------------------------------------------------------------
|
|---|
| 1256 | // @function
|
|---|
| 1257 |
|
|---|
| 1258 | //!@{
|
|---|
| 1259 | int
|
|---|
| 1260 | get_Trigger_Loop(float *lt, float *ut, float *st, int *lm, int *um, int *lg, int *ug)
|
|---|
| 1261 | {
|
|---|
| 1262 | *lt=Trigger_loop_lthres;
|
|---|
| 1263 | *ut=Trigger_loop_uthres;
|
|---|
| 1264 | *st=Trigger_loop_sthres;
|
|---|
| 1265 | *lm=Trigger_loop_lmult;
|
|---|
| 1266 | *um=Trigger_loop_umult;
|
|---|
| 1267 | *lg=Trigger_loop_ltop;
|
|---|
| 1268 | *ug=Trigger_loop_utop;
|
|---|
| 1269 | return ( Trigger_Loop );
|
|---|
| 1270 | }
|
|---|
| 1271 | //!@}
|
|---|
| 1272 |
|
|---|
| 1273 | //!-----------------------------------------------------------
|
|---|
| 1274 | // @name Trigger_Single
|
|---|
| 1275 | //
|
|---|
| 1276 | // @desc fix Trigger conditions
|
|---|
| 1277 | //
|
|---|
| 1278 | //------------------------------------------------------------
|
|---|
| 1279 | // @function
|
|---|
| 1280 |
|
|---|
| 1281 | //!@{
|
|---|
| 1282 | void
|
|---|
| 1283 | get_Trigger_Single(float **t, int *m, int *g)
|
|---|
| 1284 | {
|
|---|
| 1285 | for(int j=0;j<MAX_NUMBER_OF_CTS;j++){
|
|---|
| 1286 | for(int i=0;i<CAMERA_PIXELS;i++)
|
|---|
| 1287 | t[j][i]=qThreshold[j][i];
|
|---|
| 1288 | m[j]=Trigger_multiplicity[j];
|
|---|
| 1289 | g[j]=Trigger_topology[j];
|
|---|
| 1290 | }
|
|---|
| 1291 | }
|
|---|
| 1292 | //!@}
|
|---|
| 1293 |
|
|---|
| 1294 | //!-----------------------------------------------------------
|
|---|
| 1295 | // @name get_FADC_pedestal
|
|---|
| 1296 | //
|
|---|
| 1297 | // @desc get the value for the FADC pedestals
|
|---|
| 1298 | //
|
|---|
| 1299 | //------------------------------------------------------------
|
|---|
| 1300 | // @function
|
|---|
| 1301 |
|
|---|
| 1302 | //!@{
|
|---|
| 1303 |
|
|---|
| 1304 |
|
|---|
| 1305 | float get_FADC_pedestal(void){
|
|---|
| 1306 |
|
|---|
| 1307 | return FADC_pedestal;
|
|---|
| 1308 |
|
|---|
| 1309 | }
|
|---|
| 1310 |
|
|---|
| 1311 | //!@}
|
|---|
| 1312 | //!-----------------------------------------------------------
|
|---|
| 1313 | // @name get_High_to_Low
|
|---|
| 1314 | //
|
|---|
| 1315 | // @desc get the conversion factor between high and low gain
|
|---|
| 1316 | //
|
|---|
| 1317 | //------------------------------------------------------------
|
|---|
| 1318 | // @function
|
|---|
| 1319 |
|
|---|
| 1320 | //!@{
|
|---|
| 1321 |
|
|---|
| 1322 |
|
|---|
| 1323 | float get_High_to_Low(void){
|
|---|
| 1324 |
|
|---|
| 1325 | return High_to_Low;
|
|---|
| 1326 |
|
|---|
| 1327 | }
|
|---|
| 1328 |
|
|---|
| 1329 | int get_misspointing(float *x, float *y){
|
|---|
| 1330 |
|
|---|
| 1331 | *x=misp_x;
|
|---|
| 1332 | *y=misp_y;
|
|---|
| 1333 |
|
|---|
| 1334 | if (misp_x == 0.0 && misp_y==0.0)
|
|---|
| 1335 | return 0;
|
|---|
| 1336 | else
|
|---|
| 1337 | return 1;
|
|---|
| 1338 |
|
|---|
| 1339 | }
|
|---|
| 1340 |
|
|---|
| 1341 | float get_sigma_xy_cm_spot(float *x, float *y){
|
|---|
| 1342 |
|
|---|
| 1343 | *x=sigma_x_spot;
|
|---|
| 1344 | *y=sigma_y_spot;
|
|---|
| 1345 |
|
|---|
| 1346 | if (sigma_x_spot > 0.0 || sigma_y_spot >0.0)
|
|---|
| 1347 | return 1.0;
|
|---|
| 1348 | else
|
|---|
| 1349 | return -1.0;
|
|---|
| 1350 |
|
|---|
| 1351 | }
|
|---|
| 1352 |
|
|---|
| 1353 | float get_trig_delay(void){
|
|---|
| 1354 |
|
|---|
| 1355 | return trig_delay;
|
|---|
| 1356 |
|
|---|
| 1357 | }
|
|---|
| 1358 |
|
|---|
| 1359 | float get_telescope_location_cm(int j, int icoor){
|
|---|
| 1360 |
|
|---|
| 1361 | return CTcoor[j][icoor];
|
|---|
| 1362 |
|
|---|
| 1363 | }
|
|---|
| 1364 |
|
|---|
| 1365 | float get_mirror_fraction(int j){
|
|---|
| 1366 | return m_fraction[j];
|
|---|
| 1367 | }
|
|---|
| 1368 |
|
|---|
| 1369 | //=------------------------------------------------------------
|
|---|
| 1370 | //!@subsection Log of this file.
|
|---|
| 1371 |
|
|---|
| 1372 | //!@{
|
|---|
| 1373 | //
|
|---|
| 1374 | // $Log: not supported by cvs2svn $
|
|---|
| 1375 | // Revision 1.29 2004/09/17 14:48:21 moralejo
|
|---|
| 1376 | //
|
|---|
| 1377 | // Changes to adapt headers to c++ style.
|
|---|
| 1378 | //
|
|---|
| 1379 | // Revision 1.28 2004/09/16 15:27:08 moralejo
|
|---|
| 1380 | // Updated in CVS after some time (see changes below)
|
|---|
| 1381 | //
|
|---|
| 1382 | //
|
|---|
| 1383 | // Revision 1.27 2004/05/12 A. Moralejo
|
|---|
| 1384 | //
|
|---|
| 1385 | // Changed fadc_noise command: now the two first numbers are respectively
|
|---|
| 1386 | // the analogic electronic noise for inner (small) and outer (big) pixels
|
|---|
| 1387 | // respectively. Last number is still the FADC digital noise which affects
|
|---|
| 1388 | // equallly inner and outer pixels (as well as high and low gain).
|
|---|
| 1389 | //
|
|---|
| 1390 | // Revision 1.26 2004/01/30 09:58:39 blanch
|
|---|
| 1391 | // [Changes done mainly by A. Moralejo]
|
|---|
| 1392 | //
|
|---|
| 1393 | // Two new commands of the input card have been added:
|
|---|
| 1394 | //
|
|---|
| 1395 | // sigma_xy_cm_spot: to enlarge the point spread function.
|
|---|
| 1396 | // trigger_delay: to center the FADC signal
|
|---|
| 1397 | //
|
|---|
| 1398 | // There is also a check that the Pedestal is an integer, otherwise it
|
|---|
| 1399 | // becames complex to get a reasonable rms for events without electronic noise.
|
|---|
| 1400 | //
|
|---|
| 1401 | // Revision 1.25 2003/10/26 19:45:38 blanch
|
|---|
| 1402 | // The write_all_data input card command has been removed.
|
|---|
| 1403 | //
|
|---|
| 1404 | // Revision 1.24 2003/10/17 19:40:24 blanch
|
|---|
| 1405 | // The gain ratio between the high and low FADC gain is controlled from the
|
|---|
| 1406 | // input card.
|
|---|
| 1407 | //
|
|---|
| 1408 | // Revision 1.23 2003/09/23 17:38:48 blanch
|
|---|
| 1409 | // ana_pixels command has been removed.
|
|---|
| 1410 | //
|
|---|
| 1411 | // Revision 1.22 2003/09/23 16:52:07 blanch
|
|---|
| 1412 | // We do not read ct_file anymore.
|
|---|
| 1413 | //
|
|---|
| 1414 | // Revision 1.21 2003/09/15 10:17:09 blanch
|
|---|
| 1415 | // Some modifications in the input card has been done for the multitelescope
|
|---|
| 1416 | // configuration.
|
|---|
| 1417 | //
|
|---|
| 1418 | // Revision 1.20 2003/07/17 18:04:53 blanch
|
|---|
| 1419 | // Some new parameters to be read have been introduced
|
|---|
| 1420 | //
|
|---|
| 1421 | // - FADC pedestals
|
|---|
| 1422 | // - Response outer FADC
|
|---|
| 1423 | // - Qe file
|
|---|
| 1424 | //
|
|---|
| 1425 | // The obsolete ones have been removed.
|
|---|
| 1426 | //
|
|---|
| 1427 | // Revision 1.19 2003/02/12 13:47:32 blanch
|
|---|
| 1428 | // *** empty log message ***
|
|---|
| 1429 | //
|
|---|
| 1430 | // Revision 1.18 2003/01/14 13:37:47 blanch
|
|---|
| 1431 | // Option to set a dc value to rise the discriminator threshold has been added.
|
|---|
| 1432 | //
|
|---|
| 1433 | // Revision 1.17 2002/07/16 16:20:41 blanch
|
|---|
| 1434 | // Modifications done for the camera.cxx version, where a first implementation
|
|---|
| 1435 | // of the Star Field Rotation has been introduced.
|
|---|
| 1436 | //
|
|---|
| 1437 | // Revision 1.16 2002/03/15 15:17:18 blanch
|
|---|
| 1438 | // Several modification needed to simulate the actual trigger zone.
|
|---|
| 1439 | //
|
|---|
| 1440 | // Revision 1.15 2002/03/04 17:15:51 blanch
|
|---|
| 1441 | // An item, which allows to switch off the storage of the RawEvt, has been
|
|---|
| 1442 | // introduced. It is called nowrite_RawEvt. To avoid confusion the item
|
|---|
| 1443 | // write_all_images has been moved to write_all_events.
|
|---|
| 1444 | //
|
|---|
| 1445 | // Revision 1.14 2002/02/28 15:07:23 blanch
|
|---|
| 1446 | // Small changes have been done to introduce thes step variable for the
|
|---|
| 1447 | // discriminator threshold in the trigger loop mode.
|
|---|
| 1448 | //
|
|---|
| 1449 | // Revision 1.13 2002/01/18 17:43:08 blanch
|
|---|
| 1450 | // Three new commands have been added: fadc_noise, trig_noise and
|
|---|
| 1451 | // elec_noise_off.
|
|---|
| 1452 | // A small bug in the SIGNATURE check has been solved.
|
|---|
| 1453 | //
|
|---|
| 1454 | // Revision 1.12 2001/11/13 17:05:14 blanch
|
|---|
| 1455 | // New input items int the input card parameter list have been included to fill
|
|---|
| 1456 | // the MMcRunHeader.
|
|---|
| 1457 | // There has been also some change to remove warnings in the compilation.
|
|---|
| 1458 | //
|
|---|
| 1459 | // Revision 1.11 2001/07/25 11:38:00 magicsol
|
|---|
| 1460 | // Minnor changes
|
|---|
| 1461 | //
|
|---|
| 1462 | // Revision 1.10 2001/07/19 09:28:30 blanch
|
|---|
| 1463 | // A new command, which allows to set individual trigger threshod for each pixel,
|
|---|
| 1464 | // has been added.
|
|---|
| 1465 | //
|
|---|
| 1466 | // Revision 1.9 2001/03/05 10:43:18 blanch
|
|---|
| 1467 | // New input commands have been added:
|
|---|
| 1468 | //
|
|---|
| 1469 | // - write_McFadc: to write the FADC simulation information.
|
|---|
| 1470 | // - fadc_prop: gives the shape of the single phe response of the FADC
|
|---|
| 1471 | //
|
|---|
| 1472 | // And new value has been added in the mean_NSB command that tells how many phes
|
|---|
| 1473 | // have to come from the shower to do the NSB simulation in that shower (it speeds
|
|---|
| 1474 | // up the simulation).
|
|---|
| 1475 | //
|
|---|
| 1476 | // Revision 1.8 2001/02/23 10:55:43 magicsol
|
|---|
| 1477 | // An input commmand that talls the path for the NSB database has been added.
|
|---|
| 1478 | //
|
|---|
| 1479 | // Revision 1.7 2001/01/15 12:37:48 magicsol
|
|---|
| 1480 | // It has been introduced the option to read from the input card the overlaping
|
|---|
| 1481 | // time.
|
|---|
| 1482 | //
|
|---|
| 1483 | // Revision 1.6 2000/09/21 11:47:33 harald
|
|---|
| 1484 | // Oscar found some smaller errors in the calculation of the pixel shape and
|
|---|
| 1485 | // corrected it.
|
|---|
| 1486 | //
|
|---|
| 1487 | // Revision 1.5 2000/07/04 14:13:02 MagicSol
|
|---|
| 1488 | // It reads from the general input card the parameters for the
|
|---|
| 1489 | // trigger analysi.
|
|---|
| 1490 | //
|
|---|
| 1491 | // Revision 1.4 2000/05/11 14:22:33 blanch
|
|---|
| 1492 | // New input card option has been introduced:
|
|---|
| 1493 | // trigger_loop lt ut lm um lg ug
|
|---|
| 1494 | // It forces the camera program to study several condition trigger implementations. Integers after key word fix limits of loop over thershold, multiplicity and topology.
|
|---|
| 1495 | //
|
|---|
| 1496 | // Revision 1.3 2000/03/24 18:14:05 blanch
|
|---|
| 1497 | // Parameters that tell as if we are going to see the diskriminator and/or FADC signal have been included.
|
|---|
| 1498 | //
|
|---|
| 1499 | // Revision 1.2 2000/02/18 17:45:43 petry
|
|---|
| 1500 | // This version belongs to camera.cxx 1.5.
|
|---|
| 1501 | // It has been put in the repository in order to be
|
|---|
| 1502 | // able to share the further development with others.
|
|---|
| 1503 | //
|
|---|
| 1504 | // If you need something working, wait or take an earlier one.
|
|---|
| 1505 | // See file README
|
|---|
| 1506 | //
|
|---|
| 1507 | // Revision 1.1.1.1 1999/11/05 11:59:34 harald
|
|---|
| 1508 | // This the starting point for CVS controlled further developments of the
|
|---|
| 1509 | // camera program. The program was originally written by Jose Carlos.
|
|---|
| 1510 | // But here you can find a "rootified" version to the program. This means
|
|---|
| 1511 | // that there is no hbook stuff in it now. Also the output of the
|
|---|
| 1512 | // program changed to the MagicRawDataFormat.
|
|---|
| 1513 | //
|
|---|
| 1514 | // The "rootification" was done by Dirk Petry and Harald Kornmayer.
|
|---|
| 1515 | //
|
|---|
| 1516 | // In the following you can see the README file of that version:
|
|---|
| 1517 | //
|
|---|
| 1518 | // ==================================================
|
|---|
| 1519 | //
|
|---|
| 1520 | // Fri Oct 22 1999 D.P.
|
|---|
| 1521 | //
|
|---|
| 1522 | // The MAGIC Monte Carlo System
|
|---|
| 1523 | //
|
|---|
| 1524 | // Camera Simulation Programme
|
|---|
| 1525 | // ---------------------------
|
|---|
| 1526 | //
|
|---|
| 1527 | // 1) Description
|
|---|
| 1528 | //
|
|---|
| 1529 | // This version is the result of the fusion of H.K.'s
|
|---|
| 1530 | // root_camera which is described below (section 2)
|
|---|
| 1531 | // and another version by D.P. which had a few additional
|
|---|
| 1532 | // useful features.
|
|---|
| 1533 | //
|
|---|
| 1534 | // The version compiles under Linux with ROOT 2.22 installed
|
|---|
| 1535 | // (variable ROOTSYS has to be set).
|
|---|
| 1536 | //
|
|---|
| 1537 | // Compile as before simply using "make" in the root_camera
|
|---|
| 1538 | // directory.
|
|---|
| 1539 | //
|
|---|
| 1540 | // All features of H.K.'s root_camera were retained.
|
|---|
| 1541 | //
|
|---|
| 1542 | // Additional features of this version are:
|
|---|
| 1543 | //
|
|---|
| 1544 | // a) HBOOK is no longer used and all references are removed.
|
|---|
| 1545 | //
|
|---|
| 1546 | // b) Instead of HBOOK, the user is given now the possibility of
|
|---|
| 1547 | // having Diagnostic data in ROOT format as a complement
|
|---|
| 1548 | // to the ROOT Raw data.
|
|---|
| 1549 | //
|
|---|
| 1550 | // This data is written to the file which is determined by
|
|---|
| 1551 | // the new input parameter "diag_file" in the camera parameter
|
|---|
| 1552 | // file.
|
|---|
| 1553 | //
|
|---|
| 1554 | // All source code file belonging to this part have filenames
|
|---|
| 1555 | // starting with "MDiag".
|
|---|
| 1556 | //
|
|---|
| 1557 | // The user can read the output file using the following commands
|
|---|
| 1558 | // in an interactive ROOT session:
|
|---|
| 1559 | //
|
|---|
| 1560 | // root [0] .L MDiag.so
|
|---|
| 1561 | // root [1] new TFile("diag.root");
|
|---|
| 1562 | // root [2] new TTreeViewer("T");
|
|---|
| 1563 | //
|
|---|
| 1564 | // This brings up a viewer from which all variables of the
|
|---|
| 1565 | // TTree can be accessed and histogrammed. This example
|
|---|
| 1566 | // assumes that you have named the file "diag.root", that
|
|---|
| 1567 | // you are using ROOT version 2.22 or later and that you have
|
|---|
| 1568 | // the shared object library "MDiag.so" which is produced
|
|---|
| 1569 | // by the Makefile along with the executable "camera".
|
|---|
| 1570 | //
|
|---|
| 1571 | // ! The contents of the so-called diag file is not yet fixed.
|
|---|
| 1572 | // ! At the moment it is what J.C.G. used to put into the HBOOK
|
|---|
| 1573 | // ! ntuple. In future versions the moments calculation can be
|
|---|
| 1574 | // ! removed and the parameter list be modified correspondingly.
|
|---|
| 1575 | //
|
|---|
| 1576 | // c) Now concatenated reflector files can be read. This is useful
|
|---|
| 1577 | // if you have run the reflector with different parameters but
|
|---|
| 1578 | // you want to continue the analysis with all reflector data
|
|---|
| 1579 | // going into ONE ROOT outputfile.
|
|---|
| 1580 | //
|
|---|
| 1581 | // The previous camera version contained a bug which made reading
|
|---|
| 1582 | // of two or more concatenated reflector files impossible.
|
|---|
| 1583 | //
|
|---|
| 1584 | // d) The reflector output format was changed. It is now version
|
|---|
| 1585 | // 0.4 .
|
|---|
| 1586 | // The change solely consists in a shortening of the flag
|
|---|
| 1587 | // definition in the file
|
|---|
| 1588 | //
|
|---|
| 1589 | // include-MC/MCCphoton.hxx
|
|---|
| 1590 | //
|
|---|
| 1591 | // ! IF YOU WANT TO READ REFLECTOR FORMAT 0.3, you can easily
|
|---|
| 1592 | // ! do so by recompiling camera with the previous version of
|
|---|
| 1593 | // ! include-MC/MCCphoton.hxx.
|
|---|
| 1594 | //
|
|---|
| 1595 | // The change was necessary for saving space and better
|
|---|
| 1596 | // debugging. From now on, this format can be frozen.
|
|---|
| 1597 | //
|
|---|
| 1598 | // ! For producing reflector output in the new format, you
|
|---|
| 1599 | // ! of course have to recompile your reflector with the
|
|---|
| 1600 | // ! new include-MC/MCCphoton.hxx .
|
|---|
| 1601 | //
|
|---|
| 1602 | // e) A first version of the pixelization with the larger
|
|---|
| 1603 | // outer pixels is implemented. THIS IS NOT YET FULLY
|
|---|
| 1604 | // TESTED, but first rough tests show that it works
|
|---|
| 1605 | // at least to a good approximation.
|
|---|
| 1606 | //
|
|---|
| 1607 | // The present version implements the camera outline
|
|---|
| 1608 | // with 18 "gap-pixels" and 595 pixels in total as
|
|---|
| 1609 | // shown in
|
|---|
| 1610 | //
|
|---|
| 1611 | // http://sarastro.ifae.es/internal/home/hardware/camera/numbering.ps
|
|---|
| 1612 | //
|
|---|
| 1613 | // This change involved
|
|---|
| 1614 | //
|
|---|
| 1615 | // (i) The file pixels.dat is no longer needed. Instead
|
|---|
| 1616 | // the coordinates are generated by the program itself
|
|---|
| 1617 | // (takes maybe 1 second). In the file
|
|---|
| 1618 | //
|
|---|
| 1619 | // pixel-coords.txt
|
|---|
| 1620 | //
|
|---|
| 1621 | // in the same directory as this README, you find a list
|
|---|
| 1622 | // of the coordinates generated by this new routine. It
|
|---|
| 1623 | // has the format
|
|---|
| 1624 | //
|
|---|
| 1625 | // number i j x y size-factor
|
|---|
| 1626 | //
|
|---|
| 1627 | // where i and j are J.C.G.'s so called biaxis hexagonal
|
|---|
| 1628 | // coordinates (for internal use) and x and y are the
|
|---|
| 1629 | // coordinates of the pixel centers in the standard camera
|
|---|
| 1630 | // coordinate system in units of centimeters. The value
|
|---|
| 1631 | // of "size-factor" determines the linear size of the pixel
|
|---|
| 1632 | // relative to the central pixels.
|
|---|
| 1633 | //
|
|---|
| 1634 | // (ii) The magic.def file has two additional parameters
|
|---|
| 1635 | // which give the number of central pixels and the
|
|---|
| 1636 | // number of gap pixels
|
|---|
| 1637 | //
|
|---|
| 1638 | // (iii) In camera.h and camera.cxx several changes were
|
|---|
| 1639 | // necessary, among them the introduction of several
|
|---|
| 1640 | // new functions
|
|---|
| 1641 | //
|
|---|
| 1642 | // The newly suggested outline with asymmetric Winston cones
|
|---|
| 1643 | // will be implemented in a later version.
|
|---|
| 1644 | //
|
|---|
| 1645 | // f) phe files can no longer be read since this contradicts
|
|---|
| 1646 | // our philosophy that the analysis should be done with other
|
|---|
| 1647 | // programs like e.g. EVITA and not with "camera" itself.
|
|---|
| 1648 | // This possibility was removed.
|
|---|
| 1649 | //
|
|---|
| 1650 | // g) ROOT is no longer invoked with an interactive interface.
|
|---|
| 1651 | // In this way, camera can better be run as a batch program and
|
|---|
| 1652 | // it uses less memory.
|
|---|
| 1653 | //
|
|---|
| 1654 | // h) small changes concerning the variable "t_chan" were necessary in
|
|---|
| 1655 | // order to avoid segmentation faults: The variable is used as an
|
|---|
| 1656 | // index and it went sometimes outside the limits when camera
|
|---|
| 1657 | // was reading proton data. This is because the reflector files
|
|---|
| 1658 | // don't contain the photons in a chronological order and also
|
|---|
| 1659 | // the timespread can be considerably longer that the foreseen
|
|---|
| 1660 | // digitisation timespan. Please see the source code of camera.cxx
|
|---|
| 1661 | // round about line 1090.
|
|---|
| 1662 | //
|
|---|
| 1663 | // j) several unused variables were removed, a few warning messages
|
|---|
| 1664 | // occur when you compile camera.cxx but these can be ignored at
|
|---|
| 1665 | // the moment.
|
|---|
| 1666 | //
|
|---|
| 1667 | // In general the program is of course not finished. It still needs
|
|---|
| 1668 | // debugging, proper trigger simulation, simulation of the asymmetric
|
|---|
| 1669 | // version of the outer pixels, proper NSB simulation, adaption of
|
|---|
| 1670 | // the diag "ntuple" contents to our need and others small improvements.
|
|---|
| 1671 | //
|
|---|
| 1672 | // In the directory rfl-files there is now a file in reflector format 0.4
|
|---|
| 1673 | // containing a single event produced by the starfiled adder. It has
|
|---|
| 1674 | // a duration of 30 ns and represents the region around the Crab Nebula.
|
|---|
| 1675 | // Using the enclosed input parameter file, camera should process this
|
|---|
| 1676 | // file without problems.
|
|---|
| 1677 | //
|
|---|
| 1678 | // 2) The README for the previous version of root_camera
|
|---|
| 1679 | //
|
|---|
| 1680 | // README for a preliminary version of the
|
|---|
| 1681 | // root_camera program.
|
|---|
| 1682 | //
|
|---|
| 1683 | // root_camera is based on the program "camera"of Jose Carlos
|
|---|
| 1684 | // Gonzalez. It was changed in the way that only the pixelisation
|
|---|
| 1685 | // and the distibution of the phe to the FADCs works in a
|
|---|
| 1686 | // first version.
|
|---|
| 1687 | //
|
|---|
| 1688 | // Using the #undef command most possibilities of the orignal
|
|---|
| 1689 | // program are switched of.
|
|---|
| 1690 | //
|
|---|
| 1691 | // The new parts are signed by
|
|---|
| 1692 | //
|
|---|
| 1693 | // - ROOT or __ROOT__
|
|---|
| 1694 | // nearly all important codelines for ROOT output are enclosed
|
|---|
| 1695 | // in structures like
|
|---|
| 1696 | // #ifdef __ROOT__
|
|---|
| 1697 | //
|
|---|
| 1698 | // code
|
|---|
| 1699 | //
|
|---|
| 1700 | // #endif __ROOT__
|
|---|
| 1701 | //
|
|---|
| 1702 | // In same case the new lines are signed by a comment with the word
|
|---|
| 1703 | // ROOT in it.
|
|---|
| 1704 | //
|
|---|
| 1705 | // For timing of the pulse some variable names are changed.
|
|---|
| 1706 | // (t0, t1, t --> t_ini, t_fin, t_1st, t_chan,...)
|
|---|
| 1707 | // Look also for this changes.
|
|---|
| 1708 | //
|
|---|
| 1709 | // For the new root-file is also a change in readparm-files
|
|---|
| 1710 | //
|
|---|
| 1711 | //
|
|---|
| 1712 | // - __DETAIL_TRIGGER__
|
|---|
| 1713 | //
|
|---|
| 1714 | // This is for the implementation of the current work on trigger
|
|---|
| 1715 | // studies. Because the class MTrigger is not well documented it
|
|---|
| 1716 | // isn´t a part of this tar file. Only a dummy File exists.
|
|---|
| 1717 | //
|
|---|
| 1718 | //
|
|---|
| 1719 | //
|
|---|
| 1720 | // With all files in the archive, the root_camera program should run.
|
|---|
| 1721 | //
|
|---|
| 1722 | // A reflector file is in the directory rfl-files
|
|---|
| 1723 | //
|
|---|
| 1724 | // ==================================================
|
|---|
| 1725 | //
|
|---|
| 1726 | // From now on, use CVS for development!!!!
|
|---|
| 1727 | //
|
|---|
| 1728 | //
|
|---|
| 1729 | //
|
|---|
| 1730 | // Revision 1.2 1999/10/22 15:01:28 petry
|
|---|
| 1731 | // version sent to H.K. and N.M. on Fri Oct 22 1999
|
|---|
| 1732 | //
|
|---|
| 1733 | // Revision 1.1.1.1 1999/10/21 16:35:11 petry
|
|---|
| 1734 | // first synthesised version
|
|---|
| 1735 | //
|
|---|
| 1736 | // Revision 1.6 1999/03/15 14:59:08 gonzalez
|
|---|
| 1737 | // camera-1_1
|
|---|
| 1738 | //
|
|---|
| 1739 | // Revision 1.5 1999/03/02 09:56:12 gonzalez
|
|---|
| 1740 | // *** empty log message ***
|
|---|
| 1741 | //
|
|---|
| 1742 | // Revision 1.4 1999/01/14 17:32:41 gonzalez
|
|---|
| 1743 | // Added to camera the STDIN input option (data_from_input)
|
|---|
| 1744 | //
|
|---|
| 1745 | //!@}
|
|---|
| 1746 |
|
|---|
| 1747 | //=EOF
|
|---|