]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
-- possibility to dump information in step manager
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Jul 2010 14:13:20 +0000 (14:13 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Jul 2010 14:13:20 +0000 (14:13 +0000)
  -- important to compare Geant3/Fluka and Geant4 on hit level
  == more information will come later

// You can dump here what you need
      // function  CreateDebugStremer() to be called in the Config.C  macro
      // if you want to enable it
      // By default debug streaemer is OFF

TPC/AliTPC.cxx
TPC/AliTPC.h
TPC/AliTPCv2.cxx

index ca78d6a7b4f72972313bd8168e34eef633d3ff57..c14bf6dc6b9c41c79347997c5b9f1f7b79537a6d 100644 (file)
@@ -187,7 +187,12 @@ AliTPC::AliTPC(const char *name, const char *title)
   }
 
 }
-
+void AliTPC::CreateDebugStremer(){
+  //
+  // Create Debug streamer to check simulation
+  // 
+  fDebugStreamer = new TTreeSRedirector("TPCSimdebug.root");
+}
 //_____________________________________________________________________________
 AliTPC::~AliTPC()
 {
@@ -1441,7 +1446,6 @@ void AliTPC::Hits2SDigits()
   //-----------------------------------------------------------
   //   summable digits - 16 bit "ADC", no noise, no saturation
   //-----------------------------------------------------------
-  if (0) fDebugStreamer = new TTreeSRedirector("TPCSimdebug.root");
 
   if (!fTPCParam->IsGeoRead()){
     //
index 3e18a0b67599ac222ea3e9d10b32169b8c340a00..49d4666e510d4a10869d0ea2eb44e4395322b2b3 100644 (file)
@@ -34,7 +34,7 @@ public:
   AliTPC(const char *name, const char *title);
   
   virtual AliLoader* MakeLoader(const char* topfoldername);
-  
+  void          CreateDebugStremer();
   virtual      ~AliTPC();
   virtual void  AddHit(Int_t a1, Int_t *a2, Float_t *a3);
   virtual void  CreateGeometry() {}
@@ -116,7 +116,7 @@ protected:
 
   Float_t        fSide;  // selects left(-1), right(+1), or both(0) sides of the TPC
   Bool_t     fPrimaryIonisation; //switch between Fluka(true) and geant3(false)
- private:
+ protected:
   AliTPC(const AliTPC& t);
   AliTPC &operator = (const AliTPC & param);
   //
index 9550c4f0bc4f6e4e698888df4e600e93b2a206b5..abe5a5789a20748544c13701aa91dd7c5c40a219 100644 (file)
@@ -50,6 +50,7 @@
 #include "TGeoPara.h"
 #include "TGeoPhysicalNode.h"
 #include "TGeoHalfSpace.h"
+#include "TTreeStream.h"
 
 ClassImp(AliTPCv2)
  
@@ -1798,7 +1799,27 @@ void AliTPCv2::StepManager()
     hits[4]=gMC->TrackTime();
  
     AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
-
+    if (fDebugStreamer){   
+      // You can dump here what you need
+      // function  CreateDebugStremer() to be called in the Config.C  macro
+      // if you want to enable it
+      // By default debug streaemer is OFF
+      Float_t edep = gMC->Edep();
+      Float_t tstep = gMC->TrackStep();
+      Int_t pid=gMC->TrackPid();
+      (*fDebugStreamer)<<"hit"<<      
+       "x="<<hits[0]<<  // hit position
+       "y="<<hits[1]<<
+       "z="<<hits[2]<<
+       "nel="<<hits[3]<<  // number of electorns
+       "tof="<<hits[4]<<  // hit TOF
+       "edep="<<edep<<    // energy deposit
+       "pid="<<pid<<      // pid
+       "step="<<tstep<<
+       "p.="<<&p<<
+       "\n";
+    }
+    
   } // step>0 
   } //within sector's limits
   // Stemax calculation for the next step