Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/digits_hits/utils/src/G4VScoreWriter.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4VScoreWriter.cc,v 1.5 2008/03/04 23:19:09 taso Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4VScoreWriter.cc,v 1.10 2010/07/27 01:44:54 akimura Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030
     
    8787    return;
    8888  }
     89
     90
    8991  std::map<G4int, G4double*> * score = msMapItr->second->GetMap();
    90   ofile << "# primitive scorer name: " << msMapItr->first << G4endl;
     92  ofile << "# primitive scorer name: " << msMapItr->first << std::endl;
     93
     94
     95  G4double unitValue = fScoringMesh->GetPSUnitValue(psName);
     96  G4String unit = fScoringMesh->GetPSUnit(psName);
     97  G4String divisionAxisNames[3];
     98  fScoringMesh->GetDivisionAxisNames(divisionAxisNames);
     99  // index order
     100  ofile << "# i" << divisionAxisNames[0]
     101        << ", i" << divisionAxisNames[1]
     102        << ", i" << divisionAxisNames[2];
     103  // unit of scored value
     104  ofile << ", value ";
     105  if(unit.size() > 0) ofile << "[" << unit << "]";
     106  ofile << G4endl;
    91107
    92108  // "sequence" option: write header info
     
    111127          ofile << 0.;
    112128        } else {
    113           ofile << *(value->second);
     129          ofile << *(value->second)/unitValue;
    114130        }
    115131
     
    160176  std::map<G4int, G4double*> * score;
    161177  for(; msMapItr != fSMap.end(); msMapItr++) {
     178
     179    G4String psname = msMapItr->first;
     180
    162181    score = msMapItr->second->GetMap();
    163     ofile << "# primitive scorer name: " << msMapItr->first << G4endl;
     182    ofile << "# primitive scorer name: " << msMapItr->first << std::endl;
     183
     184    G4double unitValue = fScoringMesh->GetPSUnitValue(psname);
     185    G4String unit = fScoringMesh->GetPSUnit(psname);
     186    G4String divisionAxisNames[3];
     187    fScoringMesh->GetDivisionAxisNames(divisionAxisNames);
     188    // index order
     189    ofile << "# i" << divisionAxisNames[0]
     190          << ", i" << divisionAxisNames[1]
     191          << ", i" << divisionAxisNames[2];
     192    // unit of scored value
     193    ofile << ", value ";
     194    if(unit.size() > 0) ofile << "[" << unit << "]";
     195    ofile << G4endl;
     196
    164197
    165198    // "sequence" option: write header info
     
    184217            ofile << 0.;
    185218          } else {
    186             ofile << *(value->second);
     219            ofile << *(value->second)/unitValue;
    187220          }
    188221
Note: See TracChangeset for help on using the changeset viewer.