Changeset 1353 for trunk/MagicSoft


Ignore:
Timestamp:
06/10/02 09:01:08 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1351 r1353  
    11                                                                  -*-*- END -*-*-
     2 2002/06/10: Thomas Bretz
     3
     4   * manalysis/MHillas.cc:
     5     - changed atan2 to atan for fDelta
     6
     7   * mbase/MAGIC.h, mbase/BaseLinkDef.h:
     8     - changed definitions for Particle Id to enum
     9
     10   * mbase/MGList.cc:
     11     - IsA()->InheritsFrom() replaced with InheritsFrom()
     12
     13   * mbase/MWriteAsciiFile.cc:
     14     - IsA()->InheritsFrom() replaced with InheritsFrom()
     15     - removed some debug outputs
     16
     17   * mbase/MDataChain.[h,cc]:
     18     - implemented sign '-'
     19
     20   * mhist/MH.h:
     21     - changed default canvas size to 580x435
     22
     23   * mhist/MHHadroness.cc:
     24     - added some more output to Print
     25
     26   * mhist/MHMatrix.h:
     27     - changed some i,j to x,y
     28     - removed fabs from distance calculation
     29     - added sqrt to distance calculation
     30
     31   * mmc/MMcEvt.cxx:
     32     - changed output of Print
     33
     34
     35
    236 2002/06/06: Thomas Bretz
    337
    4    * manalysis/MHillas.cc:
    5      - changed atan2 to atan
     38   * manalysis/MHillasSrc.cc:
     39     - changed atan2 to atan for fAlpha
    640
    741
  • trunk/MagicSoft/Mars/manalysis/MHillas.cc

    r1218 r1353  
    281281    // -------------------------------------------------------------------
    282282    //
    283     const float d = corryy - corrxx;
    284 
    285     fDelta = atan2(d + sqrt(d*d + corrxy*corrxy*4), corrxy*2);
     283    const float d = (corryy - corrxx)/(corrxy*2);
     284
     285    fDelta = atan(d + sqrt(d*d + 1));
    286286
    287287    fCosDelta = cos(fDelta);   // need these in derived classes
  • trunk/MagicSoft/Mars/mbase/BaseLinkDef.h

    r1116 r1353  
    55#pragma link off all functions;
    66
     7#pragma link C++ enum ParticleId_t;
     8
    79#pragma link C++ global kCONTINUE;
    8 #pragma link C++ global kGAMMA;
    9 #pragma link C++ global kPROTON;
    10 #pragma link C++ global kHELIUM;
    11 #pragma link C++ global kOXIGEN;
    12 #pragma link C++ global kIRON;
    1310#pragma link C++ global kPI;
    1411#pragma link C++ global kRad2Deg;
  • trunk/MagicSoft/Mars/mbase/MAGIC.h

    r1337 r1353  
    2222//     ParticleId for Monte Carlo simulation
    2323//
    24 const Int_t kGAMMA  =    1;
    25 const Int_t kPROTON =   14;
    26 const Int_t kHELIUM =  402;
    27 const Int_t kOXIGEN = 1608;
    28 const Int_t kIRON   = 5626;
     24typedef enum
     25{
     26    kGAMMA  =    1,
     27    kPROTON =   14,
     28    kHELIUM =  402,
     29    kOXYGEN = 1608,
     30    kIRON   = 5626
     31} ParticleId_t;
    2932
    3033const Double_t kPI      = 3.1415926535897932384626433832795028841971693993751;
  • trunk/MagicSoft/Mars/mbase/MGList.cc

    r1218 r1353  
    9999    //
    100100#if ROOT_VERSION_CODE < ROOT_VERSION(3,02,07)
    101     if (!obj->IsA()->InheritsFrom(TGWidget::Class()))
     101    if (!obj->InheritsFrom(TGWidget::Class()))
    102102        return NULL;
    103103#endif
  • trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc

    r1348 r1353  
    5050#include <fstream.h>
    5151
    52 #include <TClass.h>      // IsA
    5352#include <TMethodCall.h> // TMethodCall, AsciiWrite
    5453
     
    247246        // MData is the highest class in the inheritance tree
    248247        //
    249         if (obj->IsA()->InheritsFrom(MData::Class()))
     248        if (obj->InheritsFrom(MData::Class()))
    250249        {
    251250            if (!((MData*)obj)->PreProcess(plist))
     
    257256        // MParContainer is the next class in the inheritance tree
    258257        //
    259         if (obj->IsA()->InheritsFrom(MParContainer::Class()))
     258        if (obj->InheritsFrom(MParContainer::Class()))
    260259            continue;
    261260
     
    287286    Int_t num = fList.GetEntries();
    288287
    289     *fLog << all << "CHECK&WRITE " << num << endl;
    290 
    291288    TIter Next(&fList);
    292289    while ((obj=(MParContainer*)Next()))
    293290    {
    294         *fLog << all << endl << obj->IsA()->GetName() << ": 0..." << flush;
    295 
    296291        if (!obj->IsReadyToSave())
    297292            continue;
    298293
    299         *fLog << all << "1..." << flush;
    300 
    301294        if (!obj->AsciiWrite(*fOut))
    302295            continue;
    303296
    304         *fLog << all << "2..." << flush;
    305 
    306297        written = kTRUE;
    307298
  • trunk/MagicSoft/Mars/mdata/MDataChain.cc

    r1348 r1353  
    163163    int l = txt.Length();
    164164    for (int i = 0; i<l; i++)
    165         if (!isalnum(txt[i]) && txt[i]!='.')
     165        if (!isalnum(txt[i]) && txt[i]!='.' && txt[i]!='-')
    166166            return i;
    167167
     
    208208    if (txt=="exp")   return kEExp;
    209209    if (txt=="pow10") return kEPow10;
     210    if (txt=="sgn")   return kESgn;
     211    if (txt[0]=='-')  return kENegative;
    210212
    211213    return kENoop;
     
    276278            {
    277279                //
    278                 // Check for the type of the conditional
     280                // Check for the type of the symbol
    279281                //
    280282                char is = txt[0];
     
    283285                //
    284286                // If no filter is available or the available filter
    285                 // is of a different conditional we have to create a new
    286                 // filter list with the new conditional
     287                // is of a different symbols we have to create a new
     288                // data list with the new symbol
    287289                //
    288290                if (/*!member0->InheritsFrom(MDataMember::Class()) ||*/ type!=is)
     
    301303            }
    302304
    303             *fLog << err << dbginf << "Syntax Error: First argument of condition missing." << endl;
    304             if (member0)
    305                 delete member0;
    306             return NULL;
     305            if (txt[0]!='-' && txt[0]!='+')
     306            {
     307                *fLog << err << dbginf << "Syntax Error: First argument of symbol '";
     308                *fLog << txt[0] << "' missing." << endl;
     309                if (member0)
     310                    delete member0;
     311                return NULL;
     312            }
     313
     314            // FALLTHROU
    307315
    308316        case '0':
     
    316324        case '8':
    317325        case '9':
     326            if (txt[0]!='-' || isdigit(txt[1]) || txt[1]=='.')
    318327            {
    319328                char *end;
     
    330339
    331340                newmember = new MDataValue(num);
    332             }
    333             break;
     341                break;
     342            }
     343
     344            // FALLTHROUH
    334345
    335346        default:
     
    365376
    366377            Int_t first = GetBracket(txt);
    367             TString sub = txt(1, first-1);
     378            TString sub = op==kENegative ? text.Remove(0,1) + txt : txt(1, first-1);
    368379            txt.Remove(0, first+1);
    369380
     
    407418    switch (fOperatorType)
    408419    {
    409     case kEAbs:   return fabs(val);
    410     case kELog:   return log(val);
    411     case kELog10: return log10(val);
    412     case kESin:   return sin(val);
    413     case kECos:   return cos(val);
    414     case kETan:   return tan(val);
    415     case kESinH:  return sinh(val);
    416     case kECosH:  return cosh(val);
    417     case kETanH:  return tanh(val);
    418     case kEASin:  return asin(val);
    419     case kEACos:  return acos(val);
    420     case kEATan:  return atan(val);
    421     case kESqrt:  return sqrt(val);
    422     case kEExp:   return exp(val);
    423     case kEPow10: return pow(10, val);
    424     case kENoop:  return val;
     420    case kEAbs:      return fabs(val);
     421    case kELog:      return log(val);
     422    case kELog10:    return log10(val);
     423    case kESin:      return sin(val);
     424    case kECos:      return cos(val);
     425    case kETan:      return tan(val);
     426    case kESinH:     return sinh(val);
     427    case kECosH:     return cosh(val);
     428    case kETanH:     return tanh(val);
     429    case kEASin:     return asin(val);
     430    case kEACos:     return acos(val);
     431    case kEATan:     return atan(val);
     432    case kESqrt:     return sqrt(val);
     433    case kEExp:      return exp(val);
     434    case kEPow10:    return pow(10, val);
     435    case kESgn:      return val<0 ? -1 : 1;
     436    case kENegative: return -val;
     437    case kENoop:     return val;
    425438    }
    426439
     
    436449    switch (fOperatorType)
    437450    {
    438     case kEAbs:   *fLog << "abs"   << flush; break;
    439     case kELog:   *fLog << "log"   << flush; break;
    440     case kELog10: *fLog << "log10" << flush; break;
    441     case kESin:   *fLog << "sin"   << flush; break;
    442     case kECos:   *fLog << "cos"   << flush; break;
    443     case kETan:   *fLog << "tan"   << flush; break;
    444     case kESinH:  *fLog << "sinh"  << flush; break;
    445     case kECosH:  *fLog << "cosh"  << flush; break;
    446     case kETanH:  *fLog << "tanh"  << flush; break;
    447     case kEASin:  *fLog << "asin"  << flush; break;
    448     case kEACos:  *fLog << "acos"  << flush; break;
    449     case kEATan:  *fLog << "atan"  << flush; break;
    450     case kESqrt:  *fLog << "sqrt"  << flush; break;
    451     case kEExp:   *fLog << "exp"   << flush; break;
    452     case kEPow10: *fLog << "pow10" << flush; break;
     451    case kEAbs:      *fLog << "abs"   << flush; break;
     452    case kELog:      *fLog << "log"   << flush; break;
     453    case kELog10:    *fLog << "log10" << flush; break;
     454    case kESin:      *fLog << "sin"   << flush; break;
     455    case kECos:      *fLog << "cos"   << flush; break;
     456    case kETan:      *fLog << "tan"   << flush; break;
     457    case kESinH:     *fLog << "sinh"  << flush; break;
     458    case kECosH:     *fLog << "cosh"  << flush; break;
     459    case kETanH:     *fLog << "tanh"  << flush; break;
     460    case kEASin:     *fLog << "asin"  << flush; break;
     461    case kEACos:     *fLog << "acos"  << flush; break;
     462    case kEATan:     *fLog << "atan"  << flush; break;
     463    case kESqrt:     *fLog << "sqrt"  << flush; break;
     464    case kEExp:      *fLog << "exp"   << flush; break;
     465    case kEPow10:    *fLog << "pow10" << flush; break;
     466    case kESgn:      *fLog << "sgn"   << flush; break;
     467    case kENegative: *fLog << "-" << flush; break;
    453468    case kENoop:
    454469        break;
  • trunk/MagicSoft/Mars/mdata/MDataChain.h

    r1348 r1353  
    3535        kESqrt,
    3636        kEPow10,
    37         kEExp
     37        kEExp,
     38        kESgn,
     39        kENegative
    3840    } OperatorType_t;
    3941
  • trunk/MagicSoft/Mars/mhist/MH.h

    r1334 r1353  
    2626
    2727    static TCanvas *MakeDefCanvas(TString name="", const char *title="",
    28                                   const UInt_t w=700, const UInt_t h=500);
     28                                  const UInt_t w=580, const UInt_t h=435);
    2929    static TCanvas *MakeDefCanvas(const TObject *obj,
    30                                   const UInt_t w=700, const UInt_t h=500);
     30                                  const UInt_t w=580, const UInt_t h=435);
    3131
    3232    static void SetBinning(TH1 *h, const MBinning *binsx);
  • trunk/MagicSoft/Mars/mhist/MHHadroness.cc

    r1346 r1353  
    197197Bool_t MHHadroness::Finalize()
    198198{
    199     *fLog << inf << "Finished filling hadroness histograms." << endl;
    200 
    201199    Int_t n = fGhness->GetNbinsX();
    202200
     
    268266    *fLog << "Hadroness histograms:" << endl;
    269267    *fLog << "---------------------" << endl;
     268    *fLog << "Acc Gammas at  1% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.01)*100) << "%" << endl;
     269    *fLog << "Acc Gammas at  2% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.02)*100) << "%" << endl;
     270    *fLog << "Acc Gammas at  5% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.05)*100) << "%" << endl;
    270271    *fLog << "Acc Gammas at 10% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.1)*100) << "%" << endl;
    271272    *fLog << "Acc Gammas at 20% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.2)*100) << "%" << endl;
     
    274275    *fLog << "Acc Gammas at 50% Hadron-acc: " << Form("%3.0f", GetGammaAcceptance(0.5)*100) << "%" << endl;
    275276    const Int_t h = fMinDist->GetMaximumBin();
    276     *fLog << "Minimum Distance to (0, 1): " << Form("%.2f", 1-fMinDist->GetMaximum()) << " at H=" << fMinDist->GetBinCenter(h) << endl;
    277     *fLog << " Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(h)*100) << "%, ";
     277    *fLog << "Minimum Distance to (0, 1): " << Form("%.2f", 1-fMinDist->GetMaximum()) << " @ H=" << fMinDist->GetBinCenter(h) << endl;
     278    *fLog << "  Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(h)*100) << "%, ";
    278279    *fLog << "Acc Hadrons = " << Form("%3.0f", fIntPhness->GetBinContent(h)*100) << "%" << endl;
    279     *fLog << "Maximum Q-Factor: " << GetQfac()->GetMaximum() << endl;
    280 
     280    const Int_t q = GetQfac()->GetMaximumBin();
     281    *fLog << "Maximum Q-Factor: " << GetQfac()->GetMaximum() << " @ H=";
     282    *fLog << GetQfac()->GetBinCenter(q) << endl;;
     283    *fLog << "  Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(q)*100) << "%, ";
     284    *fLog << "Acc Hadrons = " << Form("%3.0f", fIntPhness->GetBinContent(q)*100) << "%" << endl;
    281285    *fLog << endl;
    282286}
  • trunk/MagicSoft/Mars/mhist/MHMatrix.h

    r1336 r1353  
    3939    const TList *GetRules() const { return fRules; }
    4040
     41    void SetEnergy(MHMatrix *m) { fEnergy = m; }
     42
    4143    //void Draw(Option_t *opt=NULL);
    4244    //TObject *DrawClone(Option_t *opt=NULL) const;
  • trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx

    r1288 r1353  
    170170*/
    171171
    172 void MMcEvt::Print(Option_t *Option) const {
    173   //
    174   //  print out the data member on screen
    175   //
    176   cout << endl;
    177   cout << "Monte Carlo output:" << endl;
    178   cout << " Particle Id:    " << fPartId;
    179   cout << " Energy:         " << fEnergy << "GeV";
    180   cout << " Impactpar.:     " << fImpact/100 << "m";
    181   cout << " Photoelectrons: " << fPhotElfromShower;
    182   cout << endl;
    183 }
     172// --------------------------------------------------------------------------
     173//
     174// Print the contents of the container.
     175//
     176//  if you specify an option only the requested data members are printed:
     177//  allowed options are:
     178//   id, energy, impact
     179//
     180void MMcEvt::Print(Option_t *opt) const
     181{
     182    //
     183    //  print out the data member on screen
     184    //
     185    TString str(opt);
     186    if (str.IsNull())
     187    {
     188        cout << endl;
     189        cout << "Monte Carlo output:" << endl;
     190        cout << " Particle Id:    ";
     191        switch(fPartId)
     192        {
     193        case kGAMMA:
     194            cout << "Gamma" << endl;
     195            break;
     196        case kPROTON:
     197            cout << "Proton" << endl;
     198            break;
     199        case kHELIUM:
     200            cout << "Helium" << endl;
     201            break;
     202        }
     203        cout << " Energy:         " << fEnergy << "GeV" << endl;
     204        cout << " Impactpar.:     " << fImpact/100 << "m" << endl;
     205        cout << " Photoelectrons: " << fPhotElfromShower << endl;
     206        cout << endl;
     207        return;
     208    }
     209    if (str.Contains("id", TString::kIgnoreCase))
     210        switch(fPartId)
     211        {
     212        case kGAMMA:
     213            cout << "Particle: Gamma" << endl;
     214            break;
     215        case kPROTON:
     216            cout << "Particle: Proton" << endl;
     217            break;
     218        case kHELIUM:
     219            cout << "Particle: Helium" << endl;
     220            break;
     221        }
     222    if (str.Contains("energy", TString::kIgnoreCase))
     223        cout << "Energy: " << fEnergy << "GeV" << endl;
     224    if (str.Contains("impact", TString::kIgnoreCase))
     225        cout << "Impact: " << fImpact << "cm" << endl;
     226}
Note: See TracChangeset for help on using the changeset viewer.