Changeset 1934 for trunk/MagicSoft


Ignore:
Timestamp:
04/09/03 20:10:16 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1933 r1934  
    11                                                 -*-*- END OF LINE -*-*-
     2
     3 2003/04/09: Thomas Bretz
     4 
     5   * manalysis/MCT1SupercutsCalc.[h,cc]:
     6     - moved last changes from MFCT1Supercuts to MCT1SupercutsCalc
     7
     8   * mhist/MHMcTriggerLvl2.[h,cc]:
     9     - fixed a warning
     10     - removed global variables
     11
     12
    213
    314 2003/04/09: Abelardo Moralejo
  • trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.cc

    r1919 r1934  
    4646ClassImp(MCT1SupercutsCalc);
    4747
     48void MCT1SupercutsCalc::InitParams()
     49{
     50    //---------------------------------
     51    // cut parameters
     52    fLengthUp[0] = 0.315585;
     53    fLengthUp[1] = 0.001455;
     54    fLengthUp[2] = 0.203198;
     55    fLengthUp[3] = 0.005532;
     56    fLengthUp[4] =-0.001670;
     57    fLengthUp[5] =-0.020362;
     58    fLengthUp[6] = 0.007388;
     59    fLengthUp[7] =-0.013463;
     60
     61    fWidthUp[0] = 0.145412;
     62    fWidthUp[1] =-0.001771;
     63    fWidthUp[2] = 0.054462;
     64    fWidthUp[3] = 0.022280;
     65    fWidthUp[4] =-0.009893;
     66    fWidthUp[5] = 0.056353;
     67    fWidthUp[6] = 0.020711;
     68    fWidthUp[7] =-0.016703;
     69
     70    fDistUp[0] = 1.787943;
     71    fDistUp[1] = 0.;
     72    fDistUp[2] = 2.942310;
     73    fDistUp[3] = 0.199815;
     74    fDistUp[4] = 0.;
     75    fDistUp[5] = 0.249909;
     76    fDistUp[6] = 0.189697;
     77    fDistUp[7] = 0.;
     78
     79    fLengthLo[0] = 0.151530;
     80    fLengthLo[1] = 0.028323;
     81    fLengthLo[2] = 0.510707;
     82    fLengthLo[3] = 0.053089;
     83    fLengthLo[4] = 0.013708;
     84    fLengthLo[5] = 2.357993;
     85    fLengthLo[6] = 0.000080;
     86    fLengthLo[7] =-0.007157;
     87
     88    fWidthLo[0] = 0.089187;
     89    fWidthLo[1] =-0.006430;
     90    fWidthLo[2] = 0.074442;
     91    fWidthLo[3] = 0.003738;
     92    fWidthLo[4] =-0.004256;
     93    fWidthLo[5] =-0.014101;
     94    fWidthLo[6] = 0.006126;
     95    fWidthLo[7] =-0.002849;
     96
     97    fDistLo[0] = 0.589406;
     98    fDistLo[1] = 0.;
     99    fDistLo[2] =-0.083964;
     100    fDistLo[3] =-0.007975;
     101    fDistLo[4] = 0.;
     102    fDistLo[5] = 0.045374;
     103    fDistLo[6] =-0.001750;
     104    fDistLo[7] = 0.;
     105
     106    fAsymUp[0] = 0.061267;
     107    fAsymUp[1] = 0.014462;
     108    fAsymUp[2] = 0.014327;
     109    fAsymUp[3] = 0.014540;
     110    fAsymUp[4] = 0.013391;
     111    fAsymUp[5] = 0.012319;
     112    fAsymUp[6] = 0.010444;
     113    fAsymUp[7] = 0.008328;
     114
     115    fAsymLo[0] =-0.012055;
     116    fAsymLo[1] = 0.009157;
     117    fAsymLo[2] = 0.005441;
     118    fAsymLo[3] = 0.000399;
     119    fAsymLo[4] = 0.001433;
     120    fAsymLo[5] =-0.002050;
     121    fAsymLo[6] =-0.000104;
     122    fAsymLo[7] =-0.001188;
     123
     124    fAlphaUp[0] = 13.123440;
     125    fAlphaUp[1] = 0.;
     126    fAlphaUp[2] = 0.;
     127    fAlphaUp[3] = 0.;
     128    fAlphaUp[4] = 0.;
     129    fAlphaUp[5] = 0.;
     130    fAlphaUp[6] = 0.;
     131    fAlphaUp[7] = 0.;
     132    //---------------------------------
     133}
    48134
    49135// --------------------------------------------------------------------------
     
    57143    fHilName    = hilname;
    58144    fHilSrcName = hilsrcname;
     145
     146    InitParams();
    59147}
    60148
     
    109197    fMm2Deg = fCam->GetConvMm2Deg();
    110198
    111     //*fLog << "fMm2Deg = " << fMm2Deg << endl;
    112 
    113 
    114     //---------------------------------
    115     // cut parameters
    116        
    117     lengthup[0] = 0.315585;
    118     lengthup[1] = 0.001455;
    119     lengthup[2] = 0.203198;
    120     lengthup[3] = 0.005532;
    121     lengthup[4] =-0.001670;
    122     lengthup[5] =-0.020362;
    123     lengthup[6] = 0.007388;
    124     lengthup[7] =-0.013463;
    125 
    126     widthup[0] = 0.145412;
    127     widthup[1] =-0.001771;
    128     widthup[2] = 0.054462;
    129     widthup[3] = 0.022280;
    130     widthup[4] =-0.009893;
    131     widthup[5] = 0.056353;
    132     widthup[6] = 0.020711;
    133     widthup[7] =-0.016703;
    134 
    135     distup[0] = 1.787943;
    136     distup[1] = 0.;
    137     distup[2] = 2.942310;
    138     distup[3] = 0.199815;
    139     distup[4] = 0.;
    140     distup[5] = 0.249909;
    141     distup[6] = 0.189697;
    142     distup[7] = 0.;
    143 
    144     lengthlow[0] = 0.151530;
    145     lengthlow[1] = 0.028323;
    146     lengthlow[2] = 0.510707;
    147     lengthlow[3] = 0.053089;
    148     lengthlow[4] = 0.013708;
    149     lengthlow[5] = 2.357993;
    150     lengthlow[6] = 0.000080;
    151     lengthlow[7] =-0.007157;
    152 
    153     widthlow[0] = 0.089187;
    154     widthlow[1] =-0.006430;
    155     widthlow[2] = 0.074442;
    156     widthlow[3] = 0.003738;
    157     widthlow[4] =-0.004256;
    158     widthlow[5] =-0.014101;
    159     widthlow[6] = 0.006126;
    160     widthlow[7] =-0.002849;
    161 
    162     distlow[0] = 0.589406;
    163     distlow[1] = 0.;
    164     distlow[2] =-0.083964;
    165     distlow[3] =-0.007975;
    166     distlow[4] = 0.;
    167     distlow[5] = 0.045374;
    168     distlow[6] =-0.001750;
    169     distlow[7] = 0.;
    170 
    171     asymup[0] = 0.061267;
    172     asymup[1] = 0.014462;
    173     asymup[2] = 0.014327;
    174     asymup[3] = 0.014540;
    175     asymup[4] = 0.013391;
    176     asymup[5] = 0.012319;
    177     asymup[6] = 0.010444;
    178     asymup[7] = 0.008328;
    179 
    180     asymlow[0] =-0.012055;
    181     asymlow[1] = 0.009157;
    182     asymlow[2] = 0.005441;
    183     asymlow[3] = 0.000399;
    184     asymlow[4] = 0.001433;
    185     asymlow[5] =-0.002050;
    186     asymlow[6] =-0.000104;
    187     asymlow[7] =-0.001188;
    188 
    189     alphaup[0] = 13.123440;
    190     alphaup[1] = 0.;
    191     alphaup[2] = 0.;
    192     alphaup[3] = 0.;
    193     alphaup[4] = 0.;
    194     alphaup[5] = 0.;
    195     alphaup[6] = 0.;
    196     alphaup[7] = 0.;
    197     //---------------------------------
    198 
    199199    return kTRUE;
    200200}
     
    205205//
    206206Double_t MCT1SupercutsCalc::CtsMCut(Double_t *a,  Double_t ls, Double_t ct,
    207                                  Double_t ls2, Double_t dd2)
     207                                    Double_t ls2, Double_t dd2)
    208208{
    209209  // define cut-function
     
    218218  //    dd2: DIST^2
    219219
    220   Double_t limit = *a + *(a+1) * dd2  + *(a+2) * ct
    221                       + ls  * (*(a+3) + *(a+4) * dd2 + *(a+5) * ct)
    222                       + ls2 * (*(a+6) + *(a+7) * dd2);
     220    const Double_t limit =
     221               a[0] + a[1] * dd2 + a[2] * ct  +
     222        ls  * (a[3] + a[4] * dd2 + a[5] * ct) +
     223        ls2 * (a[6] + a[7] * dd2);
    223224
    224225  //*fLog << "MCT1SupercutsCalc::CtsMCut; *a = "
     
    274275
    275276  if (    newdist  < 1.05
    276        && newdist  < CtsMCut (distup,    dmls, dmcza, dmls2, dd2)
    277        && newdist  > CtsMCut (distlow,   dmls, dmcza, dmls2, dd2)
     277       && newdist  < CtsMCut (fDistUp,   dmls, dmcza, dmls2, dd2)
     278       && newdist  > CtsMCut (fDistLo,   dmls, dmcza, dmls2, dd2)
    278279       && dist     < 1.05
    279        && length   < CtsMCut (lengthup, dmls, dmcza, dmls2, dd2)
    280        && length   > CtsMCut (lengthlow, dmls, dmcza, dmls2, dd2)
    281        && width    < CtsMCut (widthup,   dmls, dmcza, dmls2, dd2)
    282        && width    > CtsMCut (widthlow,  dmls, dmcza, dmls2, dd2)
     280       && length   < CtsMCut (fLengthUp, dmls, dmcza, dmls2, dd2)
     281       && length   > CtsMCut (fLengthLo, dmls, dmcza, dmls2, dd2)
     282       && width    < CtsMCut (fWidthUp,  dmls, dmcza, dmls2, dd2)
     283       && width    > CtsMCut (fWidthLo,  dmls, dmcza, dmls2, dd2)
    283284       //&& asym   < CtsMCut (asymup,    dmls, dmcza, dmls2, dd2)
    284285       //&& asym   > CtsMCut (asymlow,   dmls, dmcza, dmls2, dd2)
    285        && dist     < CtsMCut (distup,    dmls, dmcza, dmls2, dd2)
    286        && dist     > CtsMCut (distlow,   dmls, dmcza, dmls2, dd2)  )
     286       && dist     < CtsMCut (fDistUp,   dmls, dmcza, dmls2, dd2)
     287       && dist     > CtsMCut (fDistLo,   dmls, dmcza, dmls2, dd2)  )
    287288    fHadronness->SetHadronness(0.25);
    288289  else
  • trunk/MagicSoft/Mars/manalysis/MCT1SupercutsCalc.h

    r1917 r1934  
    3636    Double_t    fMm2Deg;
    3737
    38 
    3938    //---------------------------------
    4039    // cut parameters
    41        
    42     double lengthup[8];
    43     double widthup[8];
    44     double distup[8];
    45     double lengthlow[8];
    46     double widthlow[8];
    47     double distlow[8];
    48     double asymup[8];
    49     double asymlow[8];
    50     double alphaup[8];
     40    Double_t fLengthUp[8];
     41    Double_t fWidthUp[8];
     42    Double_t fDistUp[8];
     43    Double_t fLengthLo[8];
     44    Double_t fWidthLo[8];
     45    Double_t fDistLo[8];
     46    Double_t fAsymUp[8];
     47    Double_t fAsymLo[8];
     48    Double_t fAlphaUp[8];
    5149    //---------------------------------
    5250
     51    void InitParams();
    5352
    5453public:
  • trunk/MagicSoft/Mars/mhist/MHMcTriggerLvl2.cc

    r1920 r1934  
    1616!
    1717!
    18 !   Author(s): Nicola Galante 2003 <mailto:nicola.galante@pi.infn.it>
    19 !!
    20 !   Copyright: MAGIC Software Development, 2000-2002
     18!   Author(s): Nicola Galante, 2003 <mailto:nicola.galante@pi.infn.it>
     19!
     20!   Copyright: MAGIC Software Development, 2000-2003
    2121!
    2222!
     
    5151#include "MBinning.h"
    5252
     53/*
     54 Please, DON'T USE IFDEFS IN SUCH A CONTEXT, Thomas.
     55 --------------------------------------------------
    5356#ifndef COLOR_LINELPS
    5457#define COLOR_LINELPS Int_t colorlps = 1
     
    6568COLOR_LINEPS;
    6669#endif
     70*/
     71
     72/* Use this insteadif you want to have some value which is the same for all
     73 your instances of MHMcTriggerLvl2, if not define the values in the constructor
     74 and remove the 'static'
     75 */
     76
     77Int_t MHMcTriggerLvl2::fColorLps = 1;
     78Int_t MHMcTriggerLvl2::fColorSbc = 1;
     79Int_t MHMcTriggerLvl2::fColorPs = 1;
    6780
    6881ClassImp(MHMcTriggerLvl2);
     
    145158// This method is called by the DrawClone method.
    146159//
    147 TObject *MHMcTriggerLvl2::DrawHist(TH1 *hist, TH1 *histNorm, const char *canvasname, Int_t *colore) const
    148 {
    149   ++(*colore);
    150 
    151   if((gROOT->FindObject(canvasname) != NULL)){
    152     hist->SetLineColor(*colore);
    153     ((TCanvas *)gROOT->FindObject(canvasname))->cd(1);
    154     hist->DrawCopy("same");
    155    
    156     ((TCanvas *)gROOT->FindObject(canvasname))->cd(2);
    157     histNorm->SetLineColor(*colore);
    158     histNorm->DrawCopy("same");
    159     ((TCanvas *)gROOT->FindObject(canvasname))->cd(2);
    160     return gROOT->FindObject(canvasname);
    161   }
    162   else{
    163     TCanvas *c3 = MakeDefCanvas(canvasname,canvasname, 800, 610);
    164     c3->Divide(2,1);
    165     c3->cd(1);
    166     hist->SetLineColor(*colore);
    167     hist->DrawCopy();
    168 
    169     c3->cd(2);
    170     histNorm->SetLineColor(*colore);
    171     histNorm->DrawCopy();
    172 
    173     return c3;
    174   }
    175 }
    176  
     160TObject *MHMcTriggerLvl2::DrawHist(TH1 &hist, TH1 &histNorm, const TString &canvasname, Int_t &col) const
     161{
     162    col++;
     163
     164    TCanvas *c = (TCanvas*)gROOT->FindObject(canvasname);
     165
     166    Bool_t same = kTRUE;
     167    if (!c)
     168    {
     169        c = MakeDefCanvas(canvasname,canvasname, 800, 610);
     170        c->Divide(2,1);
     171        same = kFALSE;
     172    }
     173
     174    c->cd(1);
     175    hist.SetLineColor(col);
     176    hist.DrawCopy(same?"same":"");
     177
     178    c->cd(2);
     179    histNorm.SetLineColor(col);
     180    histNorm.DrawCopy(same?"same":"");
     181
     182    return c;
     183}
     184
    177185
    178186// --------------------------------------------------------------------------
     
    191199TObject *MHMcTriggerLvl2::DrawClone(Option_t *opt) const
    192200{
    193   TString *def = new TString("ps");
    194   TString str(opt);
    195    
    196   if(*opt == NULL) str = *def;  // Default option
    197  
    198   if (str.Contains("lps",TString::kIgnoreCase))
    199     return this->DrawHist(hfLutPseudoSize,this->NormalizeHist(hfLutPseudoSizeNorm,hfLutPseudoSize),"CanvasLPS",&colorlps);
    200   else if (str.Contains("sbc",TString::kIgnoreCase))
    201     return this->DrawHist(hfSizeBiggerCell,this->NormalizeHist(hfSizeBiggerCellNorm,hfSizeBiggerCell),"CanvasSBC",&colorsbc);
    202   else if (str.Contains("ps",TString::kIgnoreCase))
    203     return this->DrawHist(hfPseudoSize,this->NormalizeHist(hfPseudoSizeNorm,hfPseudoSize),"CanvasPS",&colorps);
    204   else{
    205     *fLog << "ARGH!@! Possible options are \"lps\", \"sbc\", \"ps\" or NULL!" <<endl;
     201    TString str(opt);
     202
     203    if (str.IsNull())
     204        str = "ps";
     205
     206    if (!str.Contains("lps", TString::kIgnoreCase) &&
     207        !str.Contains("sbc", TString::kIgnoreCase) &&
     208        !str.Contains("ps",  TString::kIgnoreCase))
     209    {
     210        *fLog << "ARGH!@! Possible options are \"lps\", \"sbc\", \"ps\" or NULL!" <<endl;
     211        return NULL;
     212    }
     213
     214    TH1 *hist=NormalizeHist(hfLutPseudoSizeNorm, hfLutPseudoSize);
     215
     216    if (!hist)
     217        return NULL;
     218
     219    if (str.Contains("lps",TString::kIgnoreCase))
     220        return DrawHist(*hfLutPseudoSize, *hist, "CanvasLPS", fColorLps);
     221
     222    if (str.Contains("sbc",TString::kIgnoreCase))
     223        return DrawHist(*hfSizeBiggerCell, *hist, "CanvasSBC", fColorSbc);
     224
     225    if (str.Contains("ps",TString::kIgnoreCase))
     226        return DrawHist(*hfPseudoSize, *hist, "CanvasPS", fColorPs);
     227
    206228    return NULL;
    207   }
    208 
    209229}
    210230
  • trunk/MagicSoft/Mars/mhist/MHMcTriggerLvl2.h

    r1920 r1934  
    2525
    2626    TF1* f1;                      // Function used to normalize histograms
     27
     28    static Int_t fColorLps;
     29    static Int_t fColorSbc;
     30    static Int_t fColorPs;
    2731   
    2832public:
     
    5054private:
    5155
    52     TObject *DrawHist(TH1 *hist, TH1 *histNorm, const char *canvasname, Int_t *colore) const;
     56    TObject *DrawHist(TH1 &hist, TH1 &histNorm, const TString &canvasname, Int_t &colore) const;
    5357
    5458};
Note: See TracChangeset for help on using the changeset viewer.