]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSvImpacts.cxx
remove accidental cout
[u/mrichter/AliRoot.git] / PHOS / AliPHOSvImpacts.cxx
index ffa1d92a7f74c72ef0b3566e13a65dcb6df9b274..a9451d62d0bcbcbd7323cada2e9d835c7c53233e 100644 (file)
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.24  2006/11/14 17:11:15  hristov
+ * Removing inheritances from TAttLine, TAttMarker and AliRndm in AliModule. The copy constructor and assignment operators are moved to the private part of the class and not implemented. The corresponding changes are propagated to the detectors
+ *
+ * Revision 1.23  2006/09/13 07:31:01  kharlov
+ * Effective C++ corrections (T.Pocheptsov)
+ *
+ * Revision 1.22  2005/06/17 07:39:07  hristov
+ * Removing GetDebug and SetDebug from AliRun and AliModule. Using AliLog for the messages
+ *
  * Revision 1.21  2005/05/28 14:19:05  schutz
  * Compilation warnings fixed by T.P.
  *
@@ -38,7 +47,9 @@
 // --- ROOT system ---
 
 //#include <TTree.h>
+#include <TClonesArray.h>
 #include <TVirtualMC.h>
+#include <TTree.h>
 
 // --- Standard library ---
 
 #include "AliPHOSImpact.h"
 #include "AliPHOSvImpacts.h"
 #include "AliRun.h"
+#include "AliLoader.h"
 #include "AliMC.h"
 #include "AliLog.h"
 
 ClassImp(AliPHOSvImpacts)
 
 //____________________________________________________________________________
-AliPHOSvImpacts::AliPHOSvImpacts():AliPHOSv1()
+AliPHOSvImpacts::AliPHOSvImpacts():
+  fEMCImpacts(new TList),
+  fCPVImpacts(new TList),
+  fPPSDImpacts(new TList),
+  fNEMCImpacts(),
+  fNCPVImpacts(),
+  fNPPSDImpacts()
 {
   // ctor
-  fEMCImpacts  = 0 ;
-  fPPSDImpacts = 0 ;
-  fCPVImpacts  = 0 ; 
 }
 
 //____________________________________________________________________________
 AliPHOSvImpacts::AliPHOSvImpacts(const char *name, const char *title):
-AliPHOSv1(name,title) 
+  AliPHOSv1(name,title),
+  fEMCImpacts(new TList),
+  fCPVImpacts(new TList),
+  fPPSDImpacts(0),
+  fNEMCImpacts(),
+  fNCPVImpacts(),
+  fNPPSDImpacts()
 {
   // ctor : title is used to identify the layout
   //
@@ -78,9 +99,6 @@ AliPHOSv1(name,title)
   //  - fEMCImpacts, fCPVImpacts which are
   //    TList of EMC and CPV modules respectively, each
   //    modules contains TClonesArray of AliPHOSImpacts
-  
-  fEMCImpacts  = new TList();
-  fCPVImpacts  = new TList();
 
   Int_t nPHOSModules = GetGeometry()->GetNModules();
   Int_t nCPVModules  = GetGeometry()->GetNModules();
@@ -125,14 +143,6 @@ AliPHOSvImpacts::~AliPHOSvImpacts()
   }
 }
 
-//____________________________________________________________________________
-void AliPHOSvImpacts::Copy(TObject & phos) const
-{
-  TObject::Copy(phos) ; 
-  AliPHOS::Copy(phos) ; 
-}
-
-
 //____________________________________________________________________________
 void AliPHOSvImpacts::AddImpact(const char* det, Int_t shunt, Int_t primary, Int_t track, Int_t module,
                           Int_t pid, TLorentzVector p, Float_t *xyz)
@@ -152,12 +162,14 @@ void AliPHOSvImpacts::AddImpact(const char* det, Int_t shunt, Int_t primary, Int
     nImpacts= fNCPVImpacts[module];
     fNCPVImpacts[module]++ ;
   }
+  else
+    AliFatal(Form("Wrong PHOS configuration: det=%s",det));
 
   new((*impacts)[nImpacts]) AliPHOSImpact(shunt,primary,track,pid,p,xyz) ;
 
   AliDebugClass(1,Form("Module %d %s: ",module,det));
   if (AliLog::GetGlobalDebugLevel()>0)
-    (dynamic_cast<AliPHOSImpact*>((impacts->At(nImpacts))))->Print();
+    (static_cast<AliPHOSImpact*>((impacts->At(nImpacts))))->Print();
 }
 
 //____________________________________________________________________________
@@ -170,8 +182,8 @@ void AliPHOSvImpacts::MakeBranch(Option_t *opt)
   
   Int_t bufferSize = 32000 ;
   Int_t splitlevel = 0 ;
-  TreeH()->Branch("PHOSEmcImpacts" , "TList", &fEMCImpacts , bufferSize, splitlevel);
-  TreeH()->Branch("PHOSCpvImpacts" , "TList", &fCPVImpacts , bufferSize, splitlevel);
+  fLoader->TreeH()->Branch("PHOSEmcImpacts" , "TList", &fEMCImpacts , bufferSize, splitlevel);
+  fLoader->TreeH()->Branch("PHOSCpvImpacts" , "TList", &fCPVImpacts , bufferSize, splitlevel);
   
 }
 
@@ -184,12 +196,12 @@ void AliPHOSvImpacts::ResetHits()
 
   Int_t i;
   for (i=0; i<GetGeometry()->GetNModules(); i++) {
-    (dynamic_cast<TClonesArray*>(fEMCImpacts->At(i))) -> Clear();
+    (static_cast<TClonesArray*>(fEMCImpacts->At(i))) -> Clear();
     fNEMCImpacts[i] = 0 ;
   }
 
   for (i=0; i<GetGeometry()->GetNModules(); i++) {
-    (dynamic_cast<TClonesArray*>(fCPVImpacts->At(i))) -> Clear();
+    (static_cast<TClonesArray*>(fCPVImpacts->At(i))) -> Clear();
     fNCPVImpacts[i] = 0 ;
   }
   
@@ -214,11 +226,11 @@ void AliPHOSvImpacts::StepManager(void)
 
   // Add impact to EMC
 
-  static Int_t idPXTL = gMC->VolId("PXTL");
-  if( gMC->CurrentVolID(copy) == idPXTL &&
-      gMC->IsTrackEntering() ) {
-    gMC->TrackMomentum(pmom);
-    gMC->TrackPosition(pos) ;
+  static Int_t idPXTL = TVirtualMC::GetMC()->VolId("PXTL");
+  if( TVirtualMC::GetMC()->CurrentVolID(copy) == idPXTL &&
+      TVirtualMC::GetMC()->IsTrackEntering() ) {
+    TVirtualMC::GetMC()->TrackMomentum(pmom);
+    TVirtualMC::GetMC()->TrackPosition(pos) ;
 
     Int_t i;
     for (i=0; i<3; i++) xyzm[i] = pos[i];
@@ -227,16 +239,16 @@ void AliPHOSvImpacts::StepManager(void)
       xyzm[i] = pos[i] ;
       pm[i]   = pmom[i];
     }
-    gMC -> Gmtod (xyzm, xyzd, 1);    // transform coordinate from master to daughter system
-    gMC -> Gmtod (pm,   pd,   2);    // transform 3-momentum from master to daughter system
+    TVirtualMC::GetMC() -> Gmtod (xyzm, xyzd, 1);    // transform coordinate from master to daughter system
+    TVirtualMC::GetMC() -> Gmtod (pm,   pd,   2);    // transform 3-momentum from master to daughter system
 
     // Select tracks coming to the crystal from up or down sides
-    if (pd[1]<0 && xyzd[1] >  GetGeometry()->GetCrystalSize(1)/2-0.1 ||
-       pd[1]>0 && xyzd[1] < -GetGeometry()->GetCrystalSize(1)/2+0.1) {
+    if ((pd[1]<0 && xyzd[1] >  GetGeometry()->GetCrystalSize(1)/2-0.1) ||
+       (pd[1]>0 && xyzd[1] < -GetGeometry()->GetCrystalSize(1)/2+0.1)) {
     // Select tracks coming to the crystal from up or down sides
-      Int_t pid = gMC->TrackPid();
+      Int_t pid = TVirtualMC::GetMC()->TrackPid();
       Int_t module;
-      gMC->CurrentVolOffID(10,module);
+      TVirtualMC::GetMC()->CurrentVolOffID(10,module);
       module--;
       AddImpact("EMC ",fIshunt, primary,tracknumber, module, pid, pmom, xyzm);
     }
@@ -244,11 +256,11 @@ void AliPHOSvImpacts::StepManager(void)
 
   // Add impact to CPV
 
-  static Int_t idPCPQ = gMC->VolId("PCPQ");
-  if( gMC->CurrentVolID(copy) == idPCPQ &&
-      gMC->IsTrackEntering() ) {
-    gMC->TrackMomentum(pmom);
-    gMC->TrackPosition(pos) ;
+  static Int_t idPCPQ = TVirtualMC::GetMC()->VolId("PCPQ");
+  if( TVirtualMC::GetMC()->CurrentVolID(copy) == idPCPQ &&
+      TVirtualMC::GetMC()->IsTrackEntering() ) {
+    TVirtualMC::GetMC()->TrackMomentum(pmom);
+    TVirtualMC::GetMC()->TrackPosition(pos) ;
 
     Int_t i;
     for (i=0; i<3; i++) xyzm[i] = pos[i];
@@ -257,9 +269,9 @@ void AliPHOSvImpacts::StepManager(void)
       xyzm[i] = pos[i] ;
       pm[i]   = pmom[i];
     }
-    Int_t pid = gMC->TrackPid();
+    Int_t pid = TVirtualMC::GetMC()->TrackPid();
     Int_t module;
-    gMC->CurrentVolOffID(3,module);
+    TVirtualMC::GetMC()->CurrentVolOffID(3,module);
     module--;
     AddImpact("CPV ",fIshunt, primary,tracknumber, module, pid, pmom, xyzm);
   }