Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 /// \file electromagnetic/TestEm3/src/EmAccept << 23 // $Id: EmAcceptance.cc,v 1.5 2004/12/02 16:13:47 vnivanch Exp $ 27 /// \brief Implementation of the Emeptance cla << 24 // GEANT4 tag $Name: geant4-07-00-patch-01 $ 28 // << 29 // 25 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 26 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oo 27 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 28 33 #include "EmAcceptance.hh" 29 #include "EmAcceptance.hh" 34 30 35 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 36 32 >> 33 EmAcceptance::EmAcceptance() >> 34 {} >> 35 >> 36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 37 >> 38 EmAcceptance::~EmAcceptance() >> 39 {} >> 40 >> 41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 42 37 void EmAcceptance::BeginOfAcceptance(const G4S 43 void EmAcceptance::BeginOfAcceptance(const G4String& title, G4int stat) 38 { 44 { 39 G4cout << "\n<<<<<ACCEPTANCE>>>>> " << stat << 45 G4cout << "\n<<<<<ACCEPTANCE>>>>> " << stat << " events for " << title 40 fIsAccepted = true; << 46 << G4endl; >> 47 isAccepted = true; 41 } 48 } 42 49 43 //....oooOO0OOooo........oooOO0OOooo........oo 50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 44 51 45 void EmAcceptance::EndOfAcceptance() 52 void EmAcceptance::EndOfAcceptance() 46 { 53 { 47 G4String resume = "IS ACCEPTED"; 54 G4String resume = "IS ACCEPTED"; 48 if (!fIsAccepted) resume = "IS NOT ACCEPTED" << 55 if (!isAccepted) resume = "IS NOT ACCEPTED"; 49 G4cout << "<<<<<END>>>>> " << resume << G4 56 G4cout << "<<<<<END>>>>> " << resume << G4endl; 50 G4cout << G4endl; 57 G4cout << G4endl; 51 } 58 } 52 59 53 //....oooOO0OOooo........oooOO0OOooo........oo 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 54 61 55 void EmAcceptance::EmAcceptanceGauss(const G4S << 62 void EmAcceptance::EmAcceptanceGauss(const G4String& title, G4int stat, 56 G4double << 63 G4double avr, G4double avr0, >> 64 G4double rms, G4double limit) 57 { 65 { 58 G4double x = std::sqrt((G4double)stat); 66 G4double x = std::sqrt((G4double)stat); 59 G4double dde = avr - avr0; 67 G4double dde = avr - avr0; 60 G4double de = dde * x / rms; << 68 G4double de = dde*x/rms; 61 69 62 G4cout << title << ": " << avr << " del" << << 70 G4cout << title << ": " << avr << " del"<< title << "= " << dde >> 71 << " nrms= " << de << G4endl; 63 72 64 if (std::fabs(de) > limit) fIsAccepted = fal << 73 if (std::fabs(de) > limit) isAccepted = false; 65 } 74 } 66 75 67 //....oooOO0OOooo........oooOO0OOooo........oo 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 68 77