Changeset 1417 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
07/16/02 16:02:48 (22 years ago)
Author:
wittek
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/flux.C

    r1294 r1417  
    4949//    - a dummy energy estimator is provided                                //
    5050//    - migration matrices are generated                                    //
    51 //    - a kind of effective collection areas are calculated                 //
     51//    - dummy effective collection areas are used                           //
    5252//                                                                          //
    5353//////////////////////////////////////////////////////////////////////////////
     
    7474
    7575    //--------------------------------------------------------------
    76     // Setup binning for the histograms
    77     //
     76    // Setup the binning for the histograms
     77    //
     78
     79    //...............................................................
     80    // These are NOT the binnings for the flux determination
     81
    7882    MBinning binswidth("BinningWidth");
    79     binswidth.SetEdges(100, 0, 1);   // 100 bins from 0 to 1 deg
     83    binswidth.SetEdges(100, 0, 0.5);   // 100 bins from 0 to 0.5 deg
    8084
    8185    MBinning binslength("BinningLength");
    8286    binslength.SetEdges(100, 0, 1);  // 100 bins from 0 to 1 deg
    8387
     88    MBinning binscamera("BinningCamera");
     89    binscamera.SetEdges(90, -2.25, 2.25);  // 90 bins from -2.25 to 2.25 deg
     90
    8491    MBinning binsdist("BinningDist");
    85     binsdist.SetEdges(100, 0, 2);    // 100 bins from 0 to 2 deg
     92    binsdist.SetEdges(90, 0, 2.25);    // 90 bins from 0 to 2.25 deg
    8693
    8794    MBinning binsalpha("BinningAlpha");
    88     binsalpha.SetEdges(45, -90, 90);
     95    binsalpha.SetEdges(100, -100, 100);
     96
     97    MBinning binsasym("BinningAsym");
     98    binsasym.SetEdges(100, -0.5, 0.5);   // 100 bins from -0.5 to 0.5 deg
     99
     100    MBinning binsasymn("BinningAsymn");
     101    binsasymn.SetEdges(100, -0.005, 0.005);   // 100 bins from -0.005 to 0.005 deg
     102
     103    MBinning binsm3long("BinningM3Long");
     104    binsm3long.SetEdges(100, -0.5, 0.5);   // 100 bins from -0.5 to 0.5 deg
     105
     106    MBinning binsm3trans("BinningM3Trans");
     107    binsm3trans.SetEdges(100, -0.5, 0.5);   // 100 bins from -0.5 to 0.5 deg
     108
     109    //...............................................................
     110    // These ARE the binnings for the flux determination
     111
     112    MBinning binsalphaflux("BinningAlphaFlux");
     113    binsalphaflux.SetEdges(100, 0, 100);
    89114
    90115    MBinning binse("BinningE");
     
    113138    parlist.AddToList(&binswidth);
    114139    parlist.AddToList(&binslength);
     140    parlist.AddToList(&binscamera);
     141
    115142    parlist.AddToList(&binsdist);
    116143
    117144    parlist.AddToList(&binsalpha);
     145
     146    parlist.AddToList(&binsasym);
     147    parlist.AddToList(&binsasymn);
     148    parlist.AddToList(&binsm3long);
     149    parlist.AddToList(&binsm3trans);
     150
     151    parlist.AddToList(&binsalphaflux);
    118152    parlist.AddToList(&binse);
    119153    parlist.AddToList(&binstheta);
     
    131165    //    MReadMarsFile reader("Events", "~/data/Gamma*.root");
    132166
    133   //MReadMarsFile reader("Events", "/hd31/rkb/Camera/mpi/Gamma*.root");
    134   //reader.AddFile("/hd31/rkb/Camera/mpi/prot_N_*.root");
    135 
    136     // next 2 statements added
    137167    MReadMarsFile reader("Events");
     168
     169    //reader.AddFile("/hd31/rkb/Camera/mpi/Gamma*.root");
     170    //reader.AddFile("/hd31/rkb/Camera/mpi/prot_N_*.root");
     171    //reader.AddFile("/hd31/rkb/Camera/mpi/prot_NS_*.root");
     172    //reader.AddFile("protondata/gamma_10_n*.root");
    138173    reader.AddFile("protondata/gamma_10_cn*.root");
    139174
    140175    reader.EnableBranch("MMcEvt.fTheta");
     176
     177    //.....................................
     178    // filters
     179    MFTriggerLvl1 lvl1;
    141180
    142181    //.....................................
     
    145184
    146185    //.....................................
    147     // collection area
    148     MMcCollectionAreaCalc acalc;
    149 
    150186    MMcPedestalCopy   pcopy;
    151187    MMcPedestalNSBAdd pnsb;
     
    157193    // source independent image parameters
    158194    MHillasCalc       hcalc;
     195    MHillasExt        hext;
     196    parlist.AddToList(&hext);
    159197
    160198    //.....................................
     
    170208    // migration matrix (MC)
    171209    MFillH eestetrue("MHMcEnergyMigration",  "HillasSrc");
    172 
    173 
    174     //.....................................
    175     // plots of width and length
     210    eestetrue.SetTitle("Task to determine the migration matrix for the energy");
     211
     212    //.....................................
     213    // plots of source independent parameters (length, width, delta, size, center)
    176214    MFillH hfill1h("MHHillas",  "MHillas");
     215    hfill1h.SetTitle("Task to plot the source independent image parameters");
     216    hfill1h.SetFilter(&lvl1);
     217
     218    MFillH hfill1x("MHHillasExt", "MHillas");
     219    hfill1x.SetTitle("Task to plot the extended image parameters");
     220    hfill1x.SetFilter(&lvl1);
     221
     222    //.....................................
     223    // plots of source dependent parameters (alpha, dist)
     224    MFillH hfill2s("HSource     [MHHillasSrc]", "HillasSrc");
     225    hfill2s.SetTitle("Task to plot the source dependent image parameters (Source)");
     226    hfill2s.SetFilter(&lvl1);
     227    MFillH hfill2a("HAntiSource [MHHillasSrc]", "HillasAntiSrc");
     228    hfill2a.SetTitle("Task to plot the source dependent image parameters (AntiSource)");
     229    hfill2a.SetFilter(&lvl1);
    177230
    178231    //.....................................
    179232    // star map
    180233    MFillH hfill1m("MHStarMap", "MHillas");
    181 
    182     //.....................................
    183     // plots of alpha and dist
    184     MFillH hfill2s("HSource     [MHHillasSrc]", "HillasSrc");
    185     MFillH hfill2a("HAntiSource [MHHillasSrc]", "HillasAntiSrc");
    186  
    187     //.....................................
    188     // filters
    189     MFTriggerLvl1 lvl1;
    190 
     234    hfill1m.SetTitle("Task to plot the Star map");
     235
     236    //.....................................
    191237    const Float_t alpha0 = 15; // [deg]
    192238    MFAlpha fsrc ("HillasSrc",     '>', alpha0);
     239    fsrc.SetTitle("Task to check alphaSrc > alpha0");
     240
    193241    MFAlpha fasrc("HillasAntiSrc", '>', alpha0);
     242    fasrc.SetTitle("Task to check alphaAntiSrc > alpha0");
    194243
    195244    //.....................................
     
    197246    //                       (<Theta>, Theta)
    198247    MFillH fillthetabartime ("ThetabarTime  [MHThetabarTime]",  "MMcEvt");
     248    fillthetabartime.SetTitle("Task to plot <Theta> vs time");
    199249    // fillthetabartime.SetFilter(&lvl1);
     250
    200251    MFillH fillthetabartheta("ThetabarTheta [MHThetabarTheta]", "MMcEvt");
     252    fillthetabartheta.SetTitle("Task to plot <Theta> vs theta");
    201253    // fillthetabartheta.SetFilter(&lvl1);
    202254
     
    205257    //               (Delta(time), Theta)
    206258    MFillH filldtimetime ("EffOnTime  [MHTimeDiffTime]",  "MMcEvt");
     259    filldtimetime.SetTitle("Task to plot Delta(time) vs time");
    207260    // filldtime.SetFilter(&lvl1);
     261
    208262    MFillH filldtimetheta("EffOnTheta [MHTimeDiffTheta]", "MMcEvt");
     263    filldtimetheta.SetTitle("Task to plot Delta(time) vs theta");
    209264    // fillontheta.SetFilter(&lvl1);
    210265
    211266    //.....................................
    212267    // 3-D plots     (alpha, E_est, time)
    213     MFillH fillsptime  ("FluxSrcTime   [MHAlphaEnergyTime]",  "HillasSrc");
     268    MFillH fillsptime  ("SrcTime   [MHAlphaEnergyTime]",  "HillasSrc");
     269    fillsptime.SetTitle("Task for 3D plots (alpha, E_est, time) (Source)");
    214270    fillsptime.SetFilter(&fasrc);
    215     MFillH fillasptime ("FluxASrcTime  [MHAlphaEnergyTime]",  "HillasAntiSrc");
     271
     272    MFillH fillasptime ("ASrcTime  [MHAlphaEnergyTime]",  "HillasAntiSrc");
     273    fillasptime.SetTitle("Task for 3D plots (alpha, E_est, time) (AntiSource)");
    216274    fillasptime.SetFilter(&fsrc);
    217275
    218276    //.....................................
    219277    // 3-D plots     (alpha, E_est, Theta)
    220     MFillH fillsptheta ("FluxSrcTheta  [MHAlphaEnergyTheta]", "HillasSrc");
     278    MFillH fillsptheta ("SrcTheta  [MHAlphaEnergyTheta]", "HillasSrc");
     279    fillsptheta.SetTitle("Task for 3D plots (alpha, E_est, Theta) (Source)");
    221280    fillsptheta.SetFilter(&fasrc);
    222     MFillH fillasptheta("FluxASrcTheta [MHAlphaEnergyTheta]", "HillasAntiSrc");
     281
     282    MFillH fillasptheta("ASrcTheta [MHAlphaEnergyTheta]", "HillasAntiSrc");
     283    fillasptheta.SetTitle("Task for 3D plots (alpha, E_est, Theta) (AntiSource)");
    223284    fillasptheta.SetFilter(&fsrc);
    224285
     
    237298    //
    238299    tasklist.AddToList(&reader);
     300
     301    tasklist.AddToList(&lvl1);
    239302    tasklist.AddToList(&rand);
    240 
    241     tasklist.AddToList(&acalc);
    242303
    243304    tasklist.AddToList(&pcopy);
     
    246307    tasklist.AddToList(&clean);
    247308    tasklist.AddToList(&blind);
     309
    248310    tasklist.AddToList(&hcalc);
     311   
    249312    tasklist.AddToList(&hsrc1);
    250313    tasklist.AddToList(&hsrc2);
     
    253316
    254317    tasklist.AddToList(&hfill1h);
     318    tasklist.AddToList(&hfill1x);
     319
    255320    tasklist.AddToList(&hfill1m);
    256321    tasklist.AddToList(&hfill2s);
     
    263328    tasklist.AddToList(&filldtimetheta);
    264329
    265     // tasklist.AddToList(&lvl1);
     330
    266331
    267332    // tasklist.AddToList(&fethetaall);
     
    296361    tasklist.PrintStatistics(10);
    297362
    298     /*
    299      parlist.FindObject("HSource")->DrawClone();;
    300      parlist.FindObject("MHHillas")->DrawClone();
    301     */
    302     /*
    303      parlist.FindObject("MHStarMap")->DrawClone();
    304     */
    305     /*
    306      parlist.FindObject("HAntiSource")->DrawClone();
    307     */
    308     /*
    309      parlist.FindObject("MHMcCollectionArea")->DrawClone();
     363   
     364    MHHillas *mhhillas = (MHHillas*)parlist.FindObject("MHHillas");
     365    mhhillas->SetTitle("Source indep. image parameters");
     366    mhhillas->DrawClone();
     367   
     368
     369   
     370    MHHillasExt *mhhillasext = (MHHillasExt*)parlist.FindObject("MHHillasExt");
     371    mhhillasext->SetTitle("Extended image parameters");
     372    mhhillasext->DrawClone();
     373   
     374   
     375    MHHillasSrc *hsource = (MHHillasSrc*)parlist.FindObject("HSource");
     376    hsource->SetTitle("Source dependent image parameters (Source)");
     377    hsource->DrawClone();
     378
     379    MHHillasSrc *hantisource = (MHHillasSrc*)parlist.FindObject("HAntiSource");
     380    hantisource->SetTitle("Source dependent image parameters (AntiSource)");
     381    hantisource->DrawClone();
     382   
     383
     384    /*   
     385    parlist.FindObject("MHStarMap")->DrawClone();
    310386    */
    311387
     
    313389    // average Theta versus time
    314390    //           and versus Theta
     391    // This is needed for selecting later the right collection area
     392    // (at the right Theta) for each bin in time or Theta
    315393    //
    316394    MHThetabarTime  *bartime  = (MHThetabarTime*)parlist.FindObject("ThetabarTime");
    317395    MHThetabarTheta *bartheta = (MHThetabarTheta*)parlist.FindObject("ThetabarTheta");
    318396   
    319     /*
     397    /*   
    320398    bartime->DrawClone();
    321399    bartheta->DrawClone();
    322400    */
    323401
    324 
    325     //----------------------------------------------------------------------
    326     // this is something like the collection area
    327     //         as a function of time
    328     //     and as a function of Theta
    329      /*
    330      MHEnergyTime  &alltime  = *(MHEnergyTime*)parlist.FindObject("AllTime");
    331      MHEnergyTime  &seltime  = *(MHEnergyTime*)parlist.FindObject("SelTime");
    332      MHEnergyTime collareatime;
    333      collareatime.Divide(&seltime, &alltime);
    334 
    335      MHEnergyTheta &alltheta = *(MHEnergyTheta*)parlist.FindObject("AllTheta");
    336      MHEnergyTheta &seltheta = *(MHEnergyTheta*)parlist.FindObject("SelTheta");
    337      MHEnergyTheta collareatheta;
    338      collareatheta.Divide(&seltheta, &alltheta);
    339      */
    340 
    341402     //----------------------------------------------------------------------
    342403     // Effective on time
     
    348409     MHTimeDiffTime  *dtimetime  = (MHTimeDiffTime*)parlist.FindObject("EffOnTime");
    349410     MHTimeDiffTheta *dtimetheta = (MHTimeDiffTheta*)parlist.FindObject("EffOnTheta");
     411
    350412     /*
    351413     dtimetime->DrawClone();
     
    355417
    356418     //....................................
    357      // calculate effective on time for different intervals in time
     419     // calculate effective on time for different intervals in Time
    358420     //                         and for different intervals in Theta     
    359      MHEffOnTimeTime  effontime;
    360      MHEffOnTimeTheta effontheta;
     421
     422     char *varnametime;
     423     varnametime = "Time";
     424     char *unittime;
     425     unittime    =  "[ s]";
     426     MHEffOnTime effontime(varnametime, unittime);
     427
     428     char *varnametheta;
     429     varnametheta = "Theta";
     430     char *unittheta;
     431     unittheta    =  "[  \\circ]";
     432     MHEffOnTime effontheta(varnametheta, unittheta);
     433
    361434     effontime.SetupFill(&parlist);
    362435     effontheta.SetupFill(&parlist);
    363436
    364      effontime.Calc(dtimetime->GetHist());
    365      effontheta.Calc(dtimetheta->GetHist());
    366 
    367      // plot effective on time versus time
     437
     438     // Draw == 0  don't draw the individual distributions of time differences
     439     //      != 0  draw them
     440     Bool_t Draw=kFALSE;
     441     effontime.Calc (dtimetime->GetHist(), Draw);
     442     effontheta.Calc(dtimetheta->GetHist(),Draw);
     443
     444
     445     // plot effective on time versus Time
    368446     //                    and versus Theta
    369      
     447     /*     
    370448     effontime.DrawClone();
    371449     effontheta.DrawClone();
    372      
    373 
    374 
     450     */
     451
     452
     453     //======================================================================
     454     //
     455     // A : fully differential plots (Alpha, E-est, Var)
     456     //
    375457     //----------------------------------------------------------------------
    376458     // 3D-plots of alpha, E_est and time
     
    379461     //                   and relative to the anti-source position
    380462
    381      MHAlphaEnergyTime  *evtsptime   = (MHAlphaEnergyTime*)parlist.FindObject("FluxSrcTime");
    382      MHAlphaEnergyTime  *evtasptime  = (MHAlphaEnergyTime*)parlist.FindObject("FluxASrcTime");
    383      MHAlphaEnergyTheta *evtsptheta  = (MHAlphaEnergyTheta*)parlist.FindObject("FluxSrcTheta");
    384      MHAlphaEnergyTheta *evtasptheta = (MHAlphaEnergyTheta*)parlist.FindObject("FluxASrcTheta");
    385 
    386      /* this test shows that the addresses
    387              'evtsptime' and  '&evtspobj' are identical
    388      MHAlphaEnergyTime  &evtspobj     = *(MHAlphaEnergyTime*)parlist.FindObject("FluxSrcTime");
    389      cout << "evtsptime = " << evtsptime << endl;
    390      cout << "&evtspobj = " << &evtspobj << endl;
     463     MHAlphaEnergyTime  *evtsptime   = (MHAlphaEnergyTime*)parlist.FindObject("SrcTime");
     464     MHAlphaEnergyTime  *evtasptime  = (MHAlphaEnergyTime*)parlist.FindObject("ASrcTime");
     465     MHAlphaEnergyTheta *evtsptheta  = (MHAlphaEnergyTheta*)parlist.FindObject("SrcTheta");
     466     MHAlphaEnergyTheta *evtasptheta = (MHAlphaEnergyTheta*)parlist.FindObject("ASrcTheta");
     467
     468
     469     /*     
     470      evtsptime->SetTitle("Source : 3D-plot Al-En-time, alpha\_{asp} .gt. alpha\_0");
     471      evtsptime->DrawClone();
     472      evtasptime->SetTitle("AntiSource : 3D-plot Al-En-time, alpha\_{sp} .gt. alpha\_0");
     473      evtasptime->DrawClone();
     474
     475      evtsptheta->SetTitle("Source : 3D-plot Al-En-Theta, alpha\_{asp} .gt. alpha\_0");
     476      evtsptheta->DrawClone();
     477      evtasptheta->SetTitle("AntiSource : 3D-plot Al-En-Theta, alpha\_{sp} .gt. alpha\_0");
     478      evtasptheta->DrawClone();
    391479     */
    392 
    393      /*
    394       evtsptime->SetTitle("3D-plot Al-En-time, alpha\_{asp} .gt. alpha\_0");
    395       evtsptime->DrawClone();
    396       evtasptime->SetTitle("3D-plot Al-En-time, alpha\_{sp} .gt. alpha\_0");
    397       evtasptime->DrawClone();
    398 
    399       evtsptheta->SetTitle("3D-plot Al-En-Theta, alpha\_{asp} .gt. alpha\_0");
    400       evtsptheta->DrawClone();
    401       evtasptheta->SetTitle("3D-plot Al-En-Theta, alpha\_{sp} .gt. alpha\_0");
    402       evtasptheta->DrawClone();
    403      */               
    404 
    405 
     480               
    406481     //----------------------------------------------------------------------
    407482     // Difference between source and antisource (= 'gamma' sample)
    408483     // for             3D-plots of alpha, E_est and time
    409484     //                      and of alpha, E_est and Theta
    410      
    411      MHAlphaEnergyTime  gammatime("Al-En-time","3D-plot Al-En-time");
    412      MHAlphaEnergyTheta gammatheta("Al-En-Theta","3D-plot Al-En-Theta");
    413 
    414      gammatime.SetupFill(&parlist);
    415      gammatime.Subtract(evtsptime, evtasptime);
    416      gammatheta.SetupFill(&parlist);
    417      gammatheta.Subtract(evtsptheta, evtasptheta);
    418 
    419 
    420      /*
    421       gammatime.SetTitle("3D-plot Al-En-time for \'gamma\' sample");
    422       gammatime.DrawClone();
    423 
    424       gammatheta.SetTitle("3D-plot Al-En-Theta for \'gamma\' sample");
    425       gammatheta.DrawClone();
    426      */               
     485     // 3rd and 4th argument are name and title of the resulting histogram
     486
     487     MHGamma gamma;
     488
     489     Bool_t Draw = kFALSE;
     490     TH3D *hsubtime  = gamma.Subtract( evtsptime->GetHist(),
     491                                       evtasptime->GetHist(),
     492                        "Al-En-time", "3D-plot of Alpha,E-est,time", Draw);   
     493
     494     TH3D *hsubtheta = gamma.Subtract( evtsptheta->GetHist(),
     495                                       evtasptheta->GetHist(),
     496                        "Al-En-time", "3D-plot of Alpha,E-est,Theta", Draw);
     497   
    427498
    428499     //----------------------------------------------------------------------
     
    431502     //        or       E_est and Theta
    432503
    433      Axis_t lo = -10;
    434      Axis_t up =  10;
    435 
    436      //     TH2D &evttime  = *gammatime.GetAlphaProjection (lo, up);
    437      //     TH2D &evttheta = *gammatheta.GetAlphaProjection(lo, up);
    438 
    439      TH2D *evttime  = gammatime.DrawAlphaProjection (lo, up);
    440      TH2D *evttheta = gammatheta.DrawAlphaProjection(lo, up);
    441 
     504     Axis_t lo =   0;    // [deg]
     505     Axis_t up =  10;    // [deg]
     506     Bool_t Draw = kFALSE;
     507     const TH2D &evttime  = *(gamma.GetAlphaProjection(hsubtime,
     508                              lo, up, Draw));
     509
     510     const TH2D &evttheta = *(gamma.GetAlphaProjection(hsubtheta,
     511                              lo, up, Draw));
     512     
    442513
    443514     //----------------------------------------------------------------------
    444515     // plot migration matrix:  E-true E-est Theta
    445516
    446      parlist.FindObject("MHMcEnergyMigration")->DrawClone();
     517
     518     /*
     519     MHMcEnergyMigration *migrationmatrix =
     520         (MHMcEnergyMigration*)parlist.FindObject("MHMcEnergyMigration");
     521     migrationmatrix->SetTitle("Migration matrix");;
     522     migrationmatrix->DrawClone();
     523     */
     524
     525
     526     //----------------------------------------------------------------------
     527     // determine gamma flux from distributions of E-est :
     528     //   -  do unfolding to get the distributions in E-unfold
     529     //   -  divide by bin width in energy
     530     //                effective ontime and
     531     //                effective collection area
     532     //      to get the absolute gamma flux
     533   
     534     //.............................................
     535     // get flux spectrum for different bins in Time
     536     //
     537     // use dummy histogram *aeff which eventually will contain
     538     //     the effective collection area as a function of Etrue and Theta
     539     TH2D aeff;
     540
     541     // arguments of MHFlux constructor are :
     542     //   - 2D histogram containing the no.of gammas as a function of
     543     //     E-est and Var
     544     //   - name  of variable Var ("Time" or "Theta")
     545     //   - units of variable Var ( "[s]" or "[\\circ]")
     546
     547     // Draw == kTRUE  draw the no.of photons vs. E-est
     548     //                for the individual bins of the variable Var
     549     Bool_t Draw=kTRUE;
     550     MHFlux fluxtime(evttime, Draw, "Time", "  [  s]");
     551     fluxtime.Unfold(Draw);
     552     fluxtime.CalcFlux(effontime.GetHist(), bartime.GetHist(),
     553                       &aeff, Draw);
     554     
     555     fluxtime.DrawClone();
     556     
     557
     558
     559     //..............................................
     560     // get flux spectrum for different bins in Theta
     561     Bool_t Draw=kTRUE;
     562     MHFlux fluxtheta(evttheta, Draw, "Theta", "  [  \\circ]");
     563     fluxtheta.Unfold(Draw);
     564     fluxtheta.CalcFlux(effontheta.GetHist(), bartheta.GetHist(),
     565                       &aeff, Draw);
     566     
     567     fluxtheta.DrawClone();
     568     
     569
     570return;
     571     //----------------------------------------------------------------------
     572
     573
     574     //======================================================================
     575     //
     576     // B : plots integrated over E-est
     577     //
     578     //----------------------------------------------------------------------
     579     // integrate 3D-plot of (alpha, E_est and Time) over E-est
     580     //    to get 2D-plot of (alpha, Time)
     581                                   
     582     Draw = kFALSE;                       
     583     TH2D *evttimesp  = evtsptime.IntegrateEest ("AlphaSP vs. Time", Draw);
     584     TH2D *evttimeasp = evtasptime.IntegrateEest("AlphaASP vs. Time",Draw);
     585
     586
     587     //======================================================================
     588     //
     589     // C : plots integrated over Time
     590     //
     591     //----------------------------------------------------------------------
     592     // integrate 3D-plot of (alpha, E_est and Time) over the Time
     593     //    to get 2D-plot of (alpha, E_est)
     594                                   
     595     Draw = kFALSE;                       
     596     TH2D *evteestsp  = evtsptime.IntegrateTime ("AlphaSP vs. E-est", Draw);
     597     TH2D *evteestasp = evtasptime.IntegrateTime("AlphaASP vs. E-est",Draw);
     598
     599
     600
     601     //======================================================================
     602     //
     603     // D : plots integrated over E-est and Time
     604     //
     605
     606     //----------------------------------------------------------------------
     607     // integrate 3D-plot of (alpha, E_est and Time) over E-est and Time
     608     //    to get 1D-plot of (alpha)
     609                                   
     610     Draw = kFALSE;                       
     611     TH1D *evtalphasp  = evtsptime.IntegrateEestTime ("AlphaSP", Draw);
     612     TH1D *evtalphaasp = evtasptime.IntegrateEestTime("AlphaASP",Draw);
     613
     614     //----------------------------------------------------------------------
     615     // list of tasks for processing
     616
     617     cout << " " << endl;
     618     cout << "List of tasks for processing :" << endl;
     619     cout << "==============================" << endl;
     620     cout << " " << endl;
     621
     622     // was folgt geht nicht :
     623
     624     // Error: Function Next() is not defined in current scope  FILE:macros/flux.C LINE:636
     625
     626     //while ( (task=(MTask*)Next()) )
     627     //{
     628     //  cout << tasklist.GetName() << " :   " << tasklist.GetTitle() << endl;
     629     //}
    447630
    448631     return;
    449632
    450      //----------------------------------------------------------------------
    451      for (int i=1; i<=binstime.GetNumBins(); i++)
    452      {
    453          if (effontime.GetHist()->GetBinContent(i)==0)
    454              continue;
    455 
    456          TH1D &hist = *evttime.ProjectionX("Number of Gammas vs. EnergyEst for a fixed time", i, i);
    457 
    458          /* UNFOLDING */
    459 
    460          //hist->Divide(collareatime);
    461          hist.Scale(1./effontime.GetHist()->GetBinContent(i));
    462 
    463          for (int j=1; j<=binse.GetNumBins(); j++)
    464              hist.SetBinContent(j, hist.GetBinContent(j)/hist.GetBinWidth(j));
    465 
    466          hist.SetName("Flux");
    467          hist.SetTitle("Flux[Gammas/s/m^2/GeV] vs. EnergyTrue for a fixed Time");
    468 
    469          char n[100];
    470          sprintf(n, "Canv%d", j);
    471          c= new TCanvas(n, "Title");
    472          /*
    473          hist.DrawCopy();
    474          */
    475      }
    476 
    477      delete &evttime;
    478      delete &evttheta;
    479 
    480      return;
    481 
    482      // ------------------------------------------
    483 
    484      MHMcCollectionArea carea;
    485      TH1D *collareatime  = carea.GetHist();  // FIXME!
    486      TH1D *collareatheta = carea.GetHist();  // FIXME!
     633     //======================================================================               
    487634}
    488635//===========================================================================
Note: See TracChangeset for help on using the changeset viewer.