Changeset 2261 for trunk/MagicSoft/Mars/mhistmc
- Timestamp:
- 07/03/03 15:09:11 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.cc
r2258 r2261 250 250 // 251 251 // 252 // 253 // Only for the binning taken from D. Kranich : 254 // 252 255 253 256 for (Int_t thetabin = 1; thetabin <= fHistAll->GetNbinsY(); thetabin++) … … 258 261 Float_t theta = fHistAll->GetYaxis()->GetBinCenter(thetabin); 259 262 260 Float_t emin[4]; 261 Float_t emax[4]; 262 Float_t index[4]; 263 Float_t numevts[4]; 264 Float_t rmin[4]; 265 Float_t rmax[4]; // Impact parameter range (on ground). 263 Float_t emin[4]; // Minimum energy in MC sample 264 Float_t emax[4]; // Maximum energy in MC sample 265 Float_t index[4]; // Spectral index 266 Float_t numevts[4]; // Number of events 267 Float_t multfactor[4]; // Factor by which the original number of events in an MC 268 // sample has been multiplied to account for the differences 269 // in the generation areas of the various samples. 270 Float_t rmax; // Maximum impact parameter range (on ground up to 45 degrees, 271 // on a plane perpendicular to Shower axis for 55 and 65 deg). 266 272 267 273 memset(emin, 0, 4*sizeof(Float_t)); … … 269 275 memset(index, 0, 4*sizeof(Float_t)); 270 276 memset(numevts, 0, 4*sizeof(Float_t)); 271 memset(rmin, 0, 4*sizeof(Float_t)); 272 memset(rmax, 0, 4*sizeof(Float_t)); 277 rmax = 0.; 278 279 multfactor[0] = 1.; 280 multfactor[1] = 1.; 281 multfactor[2] = 1.; 282 multfactor[3] = 1.; 273 283 274 284 // … … 281 291 if (theta > 8 && theta < 9) // 8.75 deg 282 292 { 283 rmin[0] = 0.;284 rmax[0] = 250.; //meters285 293 emin[0] = 300.; 286 294 emax[0] = 400.; // Energies in GeV. … … 288 296 numevts[0] = 4000.; 289 297 290 rmin[1] = 0.;291 rmax[1] = 250.; //meters292 298 emin[1] = 400.; 293 299 emax[1] = 30000.; … … 295 301 numevts[1] = 25740.; 296 302 303 rmax = 250.; //meters 297 304 num_MC_samples = 2; 298 305 } 299 306 else if (theta > 20 && theta < 21) // 20.5 deg 300 307 { 301 rmin[0] = 0.;302 rmax[0] = 263.; //meters303 308 emin[0] = 300.; 304 309 emax[0] = 400.; // Energies in GeV. … … 306 311 numevts[0] = 6611.; 307 312 308 rmin[1] = 0.;309 rmax[1] = 263.; //meters310 313 emin[1] = 400.; 311 314 emax[1] = 30000.; … … 313 316 numevts[1] = 24448.; 314 317 318 rmax = 263.; 315 319 num_MC_samples = 2; 316 320 } 317 321 else if (theta > 26 && theta < 27) // 26.5 degrees 318 322 { 319 rmin[0] = 0.;320 rmax[0] = 290.; //meters321 323 emin[0] = 300.; 322 324 emax[0] = 400.; // Energies in GeV. … … 324 326 numevts[0] = 4000.; 325 327 326 rmin[1] = 0.;327 rmax[1] = 290.; //meters328 328 emin[1] = 400.; 329 329 emax[1] = 30000.; … … 331 331 numevts[1] = 26316.; 332 332 333 rmax = 290.; //meters 333 334 num_MC_samples = 2; 334 335 } 335 336 else if (theta > 32 && theta < 33) // 32.5 degrees 336 337 { 337 rmin[0] = 0.;338 rmax[0] = 350.; //meters339 338 emin[0] = 300.; 340 339 emax[0] = 30000.; // Energies in GeV. … … 342 341 numevts[0] = 33646.; 343 342 343 rmax = 350.; //meters 344 344 num_MC_samples = 1; 345 345 } 346 346 else if (theta > 38 && theta < 39) // 38.75 degrees 347 347 { 348 rmin[0] = 0.;349 rmax[0] = 380.; //meters350 348 emin[0] = 300.; 351 349 emax[0] = 30000.; // Energies in GeV. … … 353 351 numevts[0] = 38415.; 354 352 353 rmax = 380.; //meters 355 354 num_MC_samples = 1; 356 355 } 357 356 else if (theta > 45 && theta < 47) // 46 degrees 358 357 { 359 rmin[0] = 0.;360 rmax[0] = 565.; //meters361 358 emin[0] = 300.; 362 359 emax[0] = 50000.; // Energies in GeV. … … 364 361 numevts[0] = 30197.; 365 362 363 rmax = 565.; //meters 366 364 num_MC_samples = 1; 367 365 } 368 369 // 370 // TO BE FIXED: Add the cases for 55 and 65 degrees zenith angle. 371 // 366 else if (theta > 54 && theta < 56) // 55 degrees 367 { 368 // 369 // The value of numevts in the first sample (below) has been 370 // changed to simplify calculations. We have multiplied it 371 // times 1.2808997 to convert it to the number it would be if 372 // the generation area was equal to that of the other samples 373 // at 55 degrees (pi*600**2 m2). This has to be taken into account 374 // in the error in the number of events. 375 // 376 377 emin[0] = 500.; 378 emax[0] = 50000.; // Energies in GeV. 379 index[0] = 1.5; 380 numevts[0] = 3298.; 381 multfactor[0] = 1.2808997; 382 383 emin[1] = 1500.; 384 emax[1] = 50000.; // Energies in GeV. 385 index[1] = 1.5; 386 numevts[1] = 22229.; 387 388 emin[2] = 1500.; 389 emax[2] = 50000.; // Energies in GeV. 390 index[2] = 1.7; 391 numevts[2] = 7553.; 392 393 rmax = 600; //meters 394 num_MC_samples = 3; 395 } 396 397 else if (theta > 64 && theta < 66) // 65 degrees 398 { 399 emin[0] = 2000.; 400 emax[0] = 50000.; // Energies in GeV. 401 index[0] = 1.5; 402 numevts[0] = 16310.; 403 404 emin[1] = 2000.; 405 emax[1] = 50000.; // Energies in GeV. 406 index[1] = 1.7; 407 numevts[1] = 3000.; 408 409 // 410 // The value of numevts in the next two samples (below) has been 411 // changed to simplify calculations. We have converted them to the 412 // number it would be if the generation area was equal to that of 413 // the first two samples at 65 degrees (pi*800**2 m2) (four times 414 // as many, since the original maximum impact parameter was 400 415 // instead of 800. This is taken into account in the error too. 416 // 417 418 emin[2] = 5000.; 419 emax[2] = 50000.; // Energies in GeV. 420 index[2] = 1.5; 421 numevts[2] = 56584.; 422 multfactor[2] = 4; 423 424 emin[3] = 5000.; 425 emax[3] = 50000.; // Energies in GeV. 426 index[3] = 1.7; 427 numevts[3] = 11464; 428 multfactor[3] = 4; 429 430 rmax = 800; // meters 431 num_MC_samples = 4; 432 } 433 372 434 373 435 for (Int_t i=1; i <= fHistAll->GetNbinsX(); i++) … … 377 439 378 440 Float_t events = 0.; 441 Float_t errevents = 0.; 379 442 380 443 for (Int_t sample = 0; sample < num_MC_samples; sample++) … … 393 456 394 457 events += k * (pow(e2, expo) - pow(e1, expo)); 458 errevents += multfactor[sample] * events; 395 459 } 396 460 461 errevents= sqrt(errevents); 462 397 463 fHistAll->SetBinContent(i, thetabin, events); 398 fHistAll->SetBinError(i, thetabin, sqrt(events));464 fHistAll->SetBinError(i, thetabin, errevents); 399 465 } 400 466 401 467 // ----------------------------------------------------------- 402 468 403 const Float_t dr = TMath::Pi() * (rmax[0]*rmax[0] - rmin[0]*rmin[0]);469 const Float_t dr = TMath::Pi() * rmax * rmax; 404 470 405 471 for (Int_t ix = 1; ix <= fHistAll->GetNbinsX(); ix++) … … 415 481 // below 1E4, it means that no events triggered -> eff area = 0 416 482 // 417 483 // NOW DISABLED: because collection area after analysis does not 484 // saturate at high E! 485 // 486 487 /* 418 488 if (fHistSel->GetXaxis()->GetBinLowEdge(ix) > 4.) 419 489 { … … 421 491 fHistCol->SetBinError(ix, thetabin, fHistCol->GetBinError(ix-1, thetabin)); 422 492 } 493 */ 423 494 continue; 424 495 } … … 437 508 438 509 // 439 // Total area, perpendicular to the observation direction510 // Now we get the total area, perpendicular to the observation direction 440 511 // in which the events were generated (correct for cos theta): 441 512 // 442 const Float_t area = dr * cos(theta*TMath::Pi()/180.); 513 514 Float_t area; 515 516 if (theta < 50) 517 area = dr * cos(theta*TMath::Pi()/180.); 518 else 519 area = dr; 520 521 // Above 50 degrees MC was generated with Corsika 6.xx, and the cores 522 // were distributed on a circle perpendicular to the observation direction, 523 // and not on ground, hence the correction for cos(theta) is not necessary. 524 // 525 443 526 444 527 fHistCol->SetBinContent(ix, thetabin, eff*area);
Note:
See TracChangeset
for help on using the changeset viewer.