Ignore:
Timestamp:
06/10/02 09:01:08 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.