Changeset 366
- Timestamp:
- 02/18/00 17:42:39 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/camera.h
r318 r366 19 19 //= 20 20 //= $RCSfile: camera.h,v $ 21 //= $Revision: 1. 3$22 //= $Author: harald$23 //= $Date: 1999-11-11 20:29:29 $21 //= $Revision: 1.4 $ 22 //= $Author: petry $ 23 //= $Date: 2000-02-18 17:42:39 $ 24 24 //= 25 25 //=////////////////////////////////////////////////////////////////////// … … 61 61 #include "moments.h" 62 62 63 #include "lagrange.h"64 65 63 #include "MCEventHeader.hxx" 66 64 #include "MCCphoton.hxx" 65 #include "MTrigger.hxx" 67 66 68 67 // command line options available … … 96 95 //!@{ 97 96 98 #define SLICES 1 0097 #define SLICES 19 99 98 #define WIDTH_TIMESLICE 3.3 100 99 100 #define NOTIME 999999999 101 101 102 #define SIN60 0.866025403784439 102 103 #define COS60 0.500000000000000 … … 104 105 #define RandomNumber drand48() 105 106 106 #define PIX_ARRAY_SIDE 40107 #define PIX_ARRAY_HALF_SIDE 20108 #define PIXNUM 0109 #define PIXX 1110 #define PIXY 2111 112 107 #define iMAXNUMPIX 595 // total maximum possible number of pixels in the camera 113 108 114 //@ the trigger threshold up to which the maximum passable threshold is tested 115 #define iMAX_THRESHOLD_PHE 50 116 117 //@ number of the 1st. pixel of a sector s in a ring r (central pixel: ring=0) 118 #define FIRST_PIXEL(r,s) ( ((r)>0) ? (3*(r)*((r)-1) + (r)*(s) + 1) : 0 ) 119 120 //@ number of the pixels include in a camera of r pixels 121 #define NUMBER_PIXELS(r) ( ((r)>0) ? FIRST_PIXEL((r)+1,0) : 1 ) 109 #define iMAXNUMPHE 50000 // maximum total number of photoelectrons in one event 110 111 #define iNUMNSBPRODCALLS 1 // in order to average over the QE simulation, call the 112 // phe production function for the NSB iNUMNSBPRODCALLS times 113 114 #define iNUMWAVEBANDS 5 // number of wavebands for the NSB simulation 115 116 #define WAVEBANDBOUND1 290. // iNUMWAVEBANDS+1 boundaries for waveband definitions (nm) 117 #define WAVEBANDBOUND2 310. // for the NSB generation 118 #define WAVEBANDBOUND3 400. 119 #define WAVEBANDBOUND4 500. 120 #define WAVEBANDBOUND5 600. 121 #define WAVEBANDBOUND6 800. 122 123 #define EXTWAVEBAND1 3.715 // iNUMWAVEBANDS extinction values in magnitudes per airmass 124 #define EXTWAVEBAND2 0.642 // - these values were taken from D.L. King, Isaac Newton Group 125 #define EXTWAVEBAND3 0.209 // Tech Note No. 31, they are for a clear night at the ORM, 126 #define EXTWAVEBAND4 0.107 // La Palma. The values were averaged in the given wavebands 127 #define EXTWAVEBAND5 0.053 128 129 #define SIMTIMEOFFSET_NS 5 // determines how many ns before the first and after the last 130 // shower photoelectron, there should be NSB photoelectrons 122 131 123 132 //@ now we define the list CT_ITEM_LIST of possible items in the CT def. file … … 225 234 double dxpointcorr_deg; /* correction of the pixel coordinates; to be added to dxc[] to get correct value */ 226 235 double dypointcorr_deg; /* correction of the pixel coordinates; to be added to dxc[] to get correct value */ 227 double di[iMAXNUMPIX]; /* i coordinate in JCs bi-axis hexagonal coordinate system */228 double dj[iMAXNUMPIX]; /* j coordinate in JCs bi-axis hexagonal coordinate system */229 236 237 }; 238 239 class Photoelectron{ 240 public: 241 int iarrtime_ns; // arrival time taken from the corresponding photon 242 int ipixnum; // pixel in which the phe was evoked (starts at 0) 243 244 Photoelectron(); // constructor (code in camera.cxx) 245 230 246 }; 231 247 … … 268 284 float l, float m, float n, 269 285 float x, float y, float z); 270 286 int check_reflector_file(FILE *infile); 287 float lin_interpol(float x1, float y1, float x2, float y2, float x); 288 int produce_phes( FILE *sp, // the input file 289 struct camera *cam, // the camera layout 290 float minwl_nm, // the minimum accepted wavelength 291 float maxwl_nm, // the maximum accepted wavelength 292 class Photoelectron phe[iMAXNUMPHE], // the generated phes 293 int *itotnphe, // total number of produced photoelectrons 294 float *nphe, // number of photoelectrons in each pixel 295 int *incph, // total number of cph read 296 float *tmin_ns, // minimum arrival time of all phes 297 float *tmax_ns // maximum arrival time of all phes 298 ); 299 300 int produce_nsbrates( char *inname, 301 struct camera *cam, 302 class Photoelectron phe[iMAXNUMPHE], 303 float nsbrate[][iNUMWAVEBANDS] 304 ); 305 306 int produce_nsb_phes( float *atmin_ns, 307 float *atmax_ns, 308 float theta_rad, 309 struct camera *cam, 310 float nsbr_phepns[iMAXNUMPIX][iNUMWAVEBANDS], 311 float dnsb_phepns[iMAXNUMPIX], 312 float extinction[iNUMWAVEBANDS], 313 float fnpx[iMAXNUMPIX], 314 Photoelectron photo[iMAXNUMPHE], 315 int *inphe, 316 float base_mv[iMAXNUMPIX]); 317 271 318 //!@} 272 319 … … 278 325 /* 279 326 *$Log: not supported by cvs2svn $ 327 *Revision 1.3 1999/11/11 20:29:29 harald 328 *Small changes to run the new version on a linux machine. 329 * 280 330 *Revision 1.2 1999/11/10 07:42:41 harald 281 331 *Small change to read the right data files in. … … 290 340 *The "rootification" was done by Dirk Petry and Harald Kornmayer. 291 341 * 292 *In the following you can see the README file of that version:293 *294 *==================================================295 *296 *Fri Oct 22 1999 D.P.297 *298 *The MAGIC Monte Carlo System299 *300 *Camera Simulation Programme301 *---------------------------302 *303 *1) Description304 *305 *This version is the result of the fusion of H.K.'s306 *root_camera which is described below (section 2)307 *and another version by D.P. which had a few additional308 *useful features.309 *310 *The version compiles under Linux with ROOT 2.22 installed311 *(variable ROOTSYS has to be set).312 *313 *Compile as before simply using "make" in the root_camera314 *directory.315 *316 *All features of H.K.'s root_camera were retained.317 *318 *Additional features of this version are:319 *320 * a) HBOOK is no longer used and all references are removed.321 *322 * b) Instead of HBOOK, the user is given now the possibility of323 * having Diagnostic data in ROOT format as a complement324 * to the ROOT Raw data.325 *326 * This data is written to the file which is determined by327 * the new input parameter "diag_file" in the camera parameter328 * file.329 *330 * All source code file belonging to this part have filenames331 * starting with "MDiag".332 *333 * The user can read the output file using the following commands334 * in an interactive ROOT session:335 *336 * root [0] .L MDiag.so337 * root [1] new TFile("diag.root");338 * root [2] new TTreeViewer("T");339 *340 * This brings up a viewer from which all variables of the341 * TTree can be accessed and histogrammed. This example342 * assumes that you have named the file "diag.root", that343 * you are using ROOT version 2.22 or later and that you have344 * the shared object library "MDiag.so" which is produced345 * by the Makefile along with the executable "camera".346 *347 * ! The contents of the so-called diag file is not yet fixed.348 * ! At the moment it is what J.C.G. used to put into the HBOOK349 * ! ntuple. In future versions the moments calculation can be350 * ! removed and the parameter list be modified correspondingly.351 *352 * c) Now concatenated reflector files can be read. This is useful353 * if you have run the reflector with different parameters but354 * you want to continue the analysis with all reflector data355 * going into ONE ROOT outputfile.356 *357 * The previous camera version contained a bug which made reading358 * of two or more concatenated reflector files impossible.359 *360 * d) The reflector output format was changed. It is now version361 * 0.4 .362 * The change solely consists in a shortening of the flag363 * definition in the file364 *365 * include-MC/MCCphoton.hxx366 *367 * ! IF YOU WANT TO READ REFLECTOR FORMAT 0.3, you can easily368 * ! do so by recompiling camera with the previous version of369 * ! include-MC/MCCphoton.hxx.370 *371 * The change was necessary for saving space and better372 * debugging. From now on, this format can be frozen.373 *374 * ! For producing reflector output in the new format, you375 * ! of course have to recompile your reflector with the376 * ! new include-MC/MCCphoton.hxx .377 *378 * e) A first version of the pixelization with the larger379 * outer pixels is implemented. THIS IS NOT YET FULLY380 * TESTED, but first rough tests show that it works381 * at least to a good approximation.382 *383 * The present version implements the camera outline384 * with 18 "gap-pixels" and 595 pixels in total as385 * shown in386 *387 * http://sarastro.ifae.es/internal/home/hardware/camera/numbering.ps388 *389 * This change involved390 *391 * (i) The file pixels.dat is no longer needed. Instead392 * the coordinates are generated by the program itself393 * (takes maybe 1 second). In the file394 *395 * pixel-coords.txt396 *397 * in the same directory as this README, you find a list398 * of the coordinates generated by this new routine. It399 * has the format400 *401 * number i j x y size-factor402 *403 * where i and j are J.C.G.'s so called biaxis hexagonal404 * coordinates (for internal use) and x and y are the405 * coordinates of the pixel centers in the standard camera406 * coordinate system in units of centimeters. The value407 * of "size-factor" determines the linear size of the pixel408 * relative to the central pixels.409 *410 * (ii) The magic.def file has two additional parameters411 * which give the number of central pixels and the412 * number of gap pixels413 *414 * (iii) In camera.h and camera.cxx several changes were415 * necessary, among them the introduction of several416 * new functions417 *418 * The newly suggested outline with asymmetric Winston cones419 * will be implemented in a later version.420 *421 * f) phe files can no longer be read since this contradicts422 * our philosophy that the analysis should be done with other423 * programs like e.g. EVITA and not with "camera" itself.424 * This possibility was removed.425 *426 * g) ROOT is no longer invoked with an interactive interface.427 * In this way, camera can better be run as a batch program and428 * it uses less memory.429 *430 * h) small changes concerning the variable "t_chan" were necessary in431 * order to avoid segmentation faults: The variable is used as an432 * index and it went sometimes outside the limits when camera433 * was reading proton data. This is because the reflector files434 * don't contain the photons in a chronological order and also435 * the timespread can be considerably longer that the foreseen436 * digitisation timespan. Please see the source code of camera.cxx437 * round about line 1090.438 *439 * j) several unused variables were removed, a few warning messages440 * occur when you compile camera.cxx but these can be ignored at441 * the moment.442 *443 *In general the program is of course not finished. It still needs444 *debugging, proper trigger simulation, simulation of the asymmetric445 *version of the outer pixels, proper NSB simulation, adaption of446 *the diag "ntuple" contents to our need and others small improvements.447 *448 *In the directory rfl-files there is now a file in reflector format 0.4449 *containing a single event produced by the starfiled adder. It has450 *a duration of 30 ns and represents the region around the Crab Nebula.451 *Using the enclosed input parameter file, camera should process this452 *file without problems.453 *454 *2) The README for the previous version of root_camera455 *456 *README for a preliminary version of the457 *root_camera program.458 *459 *root_camera is based on the program "camera"of Jose Carlos460 *Gonzalez. It was changed in the way that only the pixelisation461 *and the distibution of the phe to the FADCs works in a462 *first version.463 *464 *Using the #undef command most possibilities of the orignal465 *program are switched of.466 *467 *The new parts are signed by468 *469 *- ROOT or __ROOT__470 * nearly all important codelines for ROOT output are enclosed471 * in structures like472 * #ifdef __ROOT__473 *474 * code475 *476 * #endif __ROOT__477 *478 * In same case the new lines are signed by a comment with the word479 * ROOT in it.480 *481 * For timing of the pulse some variable names are changed.482 * (t0, t1, t --> t_ini, t_fin, t_1st, t_chan,...)483 * Look also for this changes.484 *485 * For the new root-file is also a change in readparm-files486 *487 *488 *- __DETAIL_TRIGGER__489 *490 * This is for the implementation of the current work on trigger491 * studies. Because the class MTrigger is not well documented it492 * isn´t a part of this tar file. Only a dummy File exists.493 *494 *495 *496 *With all files in the archive, the root_camera program should run.497 *498 *A reflector file is in the directory rfl-files499 *500 *==================================================501 *502 *From now on, use CVS for development!!!!503 *504 *505 *506 342 *Revision 1.3 1999/10/22 15:32:56 petry 507 343 *tidied-up version, really sent to H.K. and N.M., 22-10-99
Note:
See TracChangeset
for help on using the changeset viewer.