Changeset 2261 for trunk/MagicSoft/Mars
- Timestamp:
- 07/03/03 15:09:11 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2260 r2261 4 4 2003/07/03: Abelardo Moralejo 5 5 6 * mhistmc/MHMcCT1CollectionArea.cc 7 - Added code to allow the calculation of CT1 collection areas 8 at 55 and 65 degrees (from the events in DK's MC library) 6 * mhistmc/MHMcCT1CollectionArea.cc 7 - Added code to allow the calculation of CT1 collection areas 8 at 55 and 65 degrees (from the events in DK's MC library) 9 10 * macros/CT1collarea.C 11 - Changed binning in theta to include high ZAs 9 12 10 13 -
trunk/MagicSoft/Mars/macros/CT1collarea.C
r2256 r2261 25 25 26 26 27 void CT1collarea(TString filename="MC 1.root", TString outname="")27 void CT1collarea(TString filename="MC_SC4.root", TString outname="") 28 28 { 29 29 // … … 46 46 47 47 MBinning binsx("BinningE"); 48 48 49 // binsx.SetEdges(30,2.,5.); 50 // Double_t xedge[10] = 51 // {2.50515, 2.69897, 2.89763, 3.09691, 3.30103, 3.49969, 3.69984, 3.89982, 4.10003, 4.29994}; 49 52 50 Double_t xedge[10] = 51 {2.50515, 2.69897, 2.89763, 3.09691, 3.30103, 3.49969, 3.69984, 3.89982, 4.10003, 4.29994}; 53 54 Double_t xedge[15] = {2.47712, 2.64345, 2.82607, 3., 3.17609, 3.35218, 3.52892, 3.70415, 3.88024, 4.05652, 4.23274, 4.40875, 4.58478, 4.76080, 4.90309}; 55 52 56 const TArrayD xed; 53 xed.Set(1 0,xedge);57 xed.Set(15,xedge); 54 58 binsx.SetEdges(xed); 55 59 56 60 MBinning binsy("BinningTheta"); 57 const Double_t yedge[ 7] = {0.0, 17.5, 23.5, 29.5, 35.5, 42., 50.};61 const Double_t yedge[9] = {0.0, 17.5, 23.5, 29.5, 35.5, 42., 50., 60., 70.}; 58 62 const TArrayD yed; 59 yed.Set( 7,yedge);63 yed.Set(9,yedge); 60 64 binsy.SetEdges(yed); 61 65 … … 66 70 tasklist.AddToList(&reader); 67 71 68 /* 69 MF filterhadrons("HadNN.fHadronness<0.25"); 72 MF filterhadrons("HadSC.fHadronness<0.3 && {abs(MHillasSrc.fAlpha)} < 13.1"); 70 73 tasklist.AddToList(&filterhadrons); 71 */ 74 72 75 73 76 MFillH filler("MHMcCT1CollectionArea","MMcEvt"); 74 //filler.SetFilter(&filterhadrons);77 filler.SetFilter(&filterhadrons); 75 78 tasklist.AddToList(&filler); 76 79 -
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.