]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
added inheritance from AliVerbose;
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Nov 2001 16:31:41 +0000 (16:31 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Nov 2001 16:31:41 +0000 (16:31 +0000)
removed fVerboseLevel and its getter/setter

AliGeant4/AliEventAction.cxx
AliGeant4/AliEventAction.h
AliGeant4/AliPrimaryGeneratorAction.cxx
AliGeant4/AliPrimaryGeneratorAction.h
AliGeant4/AliTrackingAction.cxx
AliGeant4/AliTrackingAction.h

index b5b0b4efa9d1e75cce45255b968c607d9c8e7c80..57c8a1c6ab8e29c081199165939934ccb5f8ed8d 100644 (file)
@@ -25,8 +25,8 @@
 
 //_____________________________________________________________________________
 AliEventAction::AliEventAction()
-  : fMessenger(this),
-    fVerboseLevel(1), 
+  : AliVerbose("eventAction"),
+    fMessenger(this),
     fDrawFlag("CHARGED")
 {
 //
@@ -35,7 +35,8 @@ AliEventAction::AliEventAction()
 
 //_____________________________________________________________________________
 AliEventAction::AliEventAction(const AliEventAction& right)
-  : fMessenger(this) {
+  : AliVerbose(""),
+    fMessenger(this) {
 //
   AliGlobals::Exception("AliEventAction is protected from copying.");
 }
@@ -77,7 +78,7 @@ void AliEventAction::DisplayEvent(const G4Event* event) const
     if (trajectoryContainer)
       nofTrajectories = trajectoryContainer->entries(); 
   
-    if (fVerboseLevel>0 && nofTrajectories>0) {
+    if (VerboseLevel() > 0 && nofTrajectories > 0) {
       G4cout << "    " << nofTrajectories; 
       G4cout << " trajectories stored." << G4endl;
     }  
@@ -113,8 +114,9 @@ void AliEventAction::BeginOfEventAction(const G4Event* event)
   if(AliTrackingAction::Instance()) 
     AliTrackingAction::Instance()->PrepareNewEvent();   
 
-  if (fVerboseLevel>0)
+  if (VerboseLevel() > 0) {
     G4cout << ">>> Event " << event->GetEventID() << G4endl;
+  }  
 
   fTimer->Start();
 }
@@ -129,13 +131,12 @@ void AliEventAction::EndOfEventAction(const G4Event* event)
   AliTrackingAction* trackingAction = AliTrackingAction::Instance();
   if (trackingAction) trackingAction->FinishPrimaryTrack();   
 
-  // verbose output 
-  if (fVerboseLevel>0) {
+  if (VerboseLevel() > 0) {
     G4cout << G4endl;
     G4cout << ">>> End of Event " << event->GetEventID() << G4endl;
   }
 
-  if (fVerboseLevel>1) {
+  if (VerboseLevel() > 1) {
     //G4int nofPrimaryTracks = trackingAction->GetNofPrimaryTracks();
     G4int nofPrimaryTracks = gAlice->GetHeader()->GetNprimary();
     G4int nofSavedTracks = gAlice->GetNtrack();
@@ -157,7 +158,7 @@ void AliEventAction::EndOfEventAction(const G4Event* event)
   // aliroot finish event
   gAlice->FinishEvent();    
 
-  if (fVerboseLevel>1) {
+  if (VerboseLevel() > 1) {
     // print time
     fTimer->Stop();
     G4cout << "Time of this event: " << *fTimer << G4endl;
index e16151ad46f07fa03e5ae27013964639a9767be3..df6caf305dd85f9310620a3c0f31d0526487e347 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef ALI_EVENT_ACTION_H
 #define ALI_EVENT_ACTION_H 
 
+#include "AliVerbose.h"
 #include "AliEventActionMessenger.h"
 
 #include <G4UserEventAction.hh>
@@ -20,7 +21,8 @@ class G4Timer;
     // times system function this declaration must be the first
 class G4Event;
 
-class AliEventAction : public G4UserEventAction
+class AliEventAction : public G4UserEventAction,
+                       public AliVerbose
 {
   public:
     AliEventAction();
@@ -33,11 +35,9 @@ class AliEventAction : public G4UserEventAction
     virtual void EndOfEventAction(const G4Event* event);
     
     // set methods
-    void SetVerboseLevel(G4int level);
     void SetDrawFlag(G4String drawFlag);
     
     // get methods
-    G4int GetVerboseLevel() const;
     G4String GetDrawFlag() const;
     
   protected:
@@ -53,21 +53,14 @@ class AliEventAction : public G4UserEventAction
     // data members
     AliEventActionMessenger   fMessenger;    //messenger
     G4Timer*                  fTimer;        //G4Timer
-    G4int                     fVerboseLevel; //verbose level
     G4String                  fDrawFlag;     //control drawing of the event
 };
 
 // inline methods
 
-inline void AliEventAction::SetVerboseLevel(G4int level)
-{ fVerboseLevel = level; }
-
 inline void AliEventAction::SetDrawFlag(G4String drawFlag)
 { fDrawFlag = drawFlag; }
 
-inline G4int AliEventAction::GetVerboseLevel() const
-{ return fVerboseLevel; }
-
 inline G4String AliEventAction::GetDrawFlag() const
 { return fDrawFlag; }
 
index b8d72342b90345500d706ffdc4b2550d23513141..ef873d91f2790ca4ad01ce97b8e45eb0f6744b7a 100644 (file)
@@ -28,9 +28,9 @@
 
 //_____________________________________________________________________________
 AliPrimaryGeneratorAction::AliPrimaryGeneratorAction()
-  : fGenerator(kAliGenerator),
+  : AliVerbose("primaryGeneratorAction"),
+    fGenerator(kAliGenerator),
     fNofGunParticles(1),
-    fVerboseLevel(0),
     fMessenger(this),
     fParticleGun() {
 //
@@ -110,7 +110,7 @@ void AliPrimaryGeneratorAction::ConstructGeantinoGenerator(G4bool isCharged)
 
     fParticleGun.AddParticle(gunParticle);     
   } 
-  if (fVerboseLevel>1) { 
+  if (VerboseLevel() > 1) { 
     G4cout << "Geantino generator has been built." << G4endl; 
   }
 } 
index 8d67bda12b66ebf9fea4834d42e39c711d7c55c8..2630021f9db49266f380f1dc572aee4b662b644a 100644 (file)
@@ -15,6 +15,7 @@
 #ifndef ALI_PRIMARY_GENERATOR_ACTION_H
 #define ALI_PRIMARY_GENERATOR_ACTION_H
 
+#include "AliVerbose.h"
 #include "AliPrimaryGenerator.h"
 #include "AliPrimaryGeneratorMessenger.h"
 #include "AliParticleGun.h"
@@ -26,7 +27,8 @@ class AliParticleGun;
 class G4ParticleGun;
 class G4Event;
 
-class AliPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
+class AliPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction,
+                                  public AliVerbose
 {
   public:
     AliPrimaryGeneratorAction();
@@ -38,12 +40,10 @@ class AliPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
     // set methods
     void SetGenerator(AliPrimaryGenerator generator);
     void SetNofGunParticles(G4int nofParticles);
-    void SetVerboseLevel(G4int level);
 
     // get methods
     AliPrimaryGenerator GetGenerator() const;
     G4int GetNofGunParticles() const;
-    G4int GetVerboseLevel() const;
     
   private:
     // methods
@@ -55,25 +55,18 @@ class AliPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
     // data members
     AliPrimaryGenerator  fGenerator;       //selected AliPrimaryGenerator
     G4int                fNofGunParticles; //number of gun particles
-    G4int                fVerboseLevel;    //verbose level
     AliParticleGun       fParticleGun;     //AliParticleGun
     AliPrimaryGeneratorMessenger  fMessenger; //messenger
 };
 
 // inline methods
 
-inline void AliPrimaryGeneratorAction::SetVerboseLevel(G4int level)
-{ fVerboseLevel = level; }
-
 inline AliPrimaryGenerator AliPrimaryGeneratorAction::GetGenerator() const
 { return fGenerator; }
 
 inline G4int AliPrimaryGeneratorAction::GetNofGunParticles() const
 { return fNofGunParticles; }
 
-inline G4int AliPrimaryGeneratorAction::GetVerboseLevel() const
-{ return fVerboseLevel; }
-
 #endif //ALI_PRIMARY_GENERATOR_ACTION_H
 
 
index 43d8e8bfcd708f7796df84b5275c7981c94f8329..b625592c8fa34ab53c10269f1e0b23b90a7dab45 100644 (file)
@@ -27,8 +27,8 @@ AliTrackingAction* AliTrackingAction::fgInstance = 0;
 
 //_____________________________________________________________________________
 AliTrackingAction::AliTrackingAction()
-  : fPrimaryTrackID(0),
-    fVerboseLevel(2),
+  : AliVerbose("trackingAction",2),
+    fPrimaryTrackID(0),
     fNewVerboseLevel(0),
     fNewVerboseTrackID(-1),
     fSavePrimaries(true),
@@ -45,7 +45,8 @@ AliTrackingAction::AliTrackingAction()
 
 //_____________________________________________________________________________
 AliTrackingAction::AliTrackingAction(const AliTrackingAction& right) 
-  : fMessenger(this) {
+  : AliVerbose("trackingAction"),
+    fMessenger(this) {
 //
   AliGlobals::Exception("AliTrackingAction is protected from copying.");
 }
@@ -225,13 +226,13 @@ void AliTrackingAction::FinishPrimaryTrack()
   if (fPrimaryTrackID>0) {
 
     // verbose
-    if (fVerboseLevel == 3) { 
+    if (VerboseLevel() == 3) { 
       G4cout << "$$$ Primary track " << fPrimaryTrackID << G4endl;
     } 
-    else if ( fVerboseLevel == 2 &&  fPrimaryTrackID % 10 == 0 ) {
+    else if (VerboseLevel() == 2 &&  fPrimaryTrackID % 10 == 0 ) {
       G4cout << "$$$ Primary track " << fPrimaryTrackID  << G4endl;
     } 
-    else if ( fVerboseLevel == 1 &&  fPrimaryTrackID % 100 == 0 ) {
+    else if (VerboseLevel() == 1 &&  fPrimaryTrackID % 100 == 0 ) {
       G4cout << "$$$ Primary track " << fPrimaryTrackID  << G4endl;
     } 
 
index 9c0aa7f726754f7a95ff59f234d10bc407a784dd..2dc76ab3c3d260ef2dfaabe018386d3157ba69a8 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef ALI_TRACKING_ACTION_H
 #define ALI_TRACKING_ACTION_H
 
+#include "AliVerbose.h"
 #include "AliTrackingActionMessenger.h"
 
 #include "TG4TrackingAction.h"
@@ -22,7 +23,8 @@ class G4Track;
 
 class TClonesArray;
 
-class AliTrackingAction : public TG4TrackingAction 
+class AliTrackingAction : public TG4TrackingAction,
+                          public AliVerbose
 {
   public:
     AliTrackingAction();
@@ -41,13 +43,11 @@ class AliTrackingAction : public TG4TrackingAction
     void SaveTrack(const G4Track* track);
 
     // set methods
-    void SetVerboseLevel(G4int level);
     void SetNewVerboseLevel(G4int level);
     void SetNewVerboseTrackID(G4int trackID);
     void SetSavePrimaries(G4bool savePrimaries);
 
     // get methods
-    G4int GetVerboseLevel() const;
     G4bool GetSavePrimaries() const;
     G4int GetNofTracks() const;
 
@@ -70,7 +70,6 @@ class AliTrackingAction : public TG4TrackingAction
     AliTrackingActionMessenger  fMessenger; //messenger
     G4int   fPrimaryTrackID;    //current primary track ID 
     G4bool  fSavePrimaries;     //control of saving primaries
-    G4int   fVerboseLevel;      //verbose level
     G4int   fNewVerboseLevel;   //new /tracking/verbose level
     G4int   fNewVerboseTrackID; //track ID for which new /tracking/verbose level
                                 // is applied
@@ -82,15 +81,9 @@ class AliTrackingAction : public TG4TrackingAction
 inline AliTrackingAction* AliTrackingAction::Instance() 
 { return fgInstance; }
 
-inline void AliTrackingAction::SetVerboseLevel(G4int level)
-{ fVerboseLevel = level; }
-
 inline void AliTrackingAction::SetSavePrimaries(G4bool savePrimaries)
 { fSavePrimaries = savePrimaries; }
 
-inline G4int AliTrackingAction::GetVerboseLevel() const
-{ return fVerboseLevel; }
-
 inline G4bool AliTrackingAction::GetSavePrimaries() const
 { return fSavePrimaries; }