]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/AliZDC.cxx
Minor changes
[u/mrichter/AliRoot.git] / ZDC / AliZDC.cxx
index a51dc5908145b78b13ae25e4c8bcc99b7430edb7..d912b03e6775302559c016fd7bf0a8db90a79889 100644 (file)
 
 /*
 $Log$
+Revision 1.20  2001/03/26 13:39:20  coppedis
+Comment prints
+
+Revision 1.19  2001/03/26 09:10:23  coppedis
+Corrected bug in constructor (fIshunt has to be =1)
+
+Revision 1.18  2001/03/20 08:21:55  coppedis
+ZDC needs PIPE, ABSO, DIPO and SHIL
+
 Revision 1.17  2001/03/16 16:18:03  coppedis
 Correction for superposition of ZDC volumes with MUON arm one
 
@@ -85,16 +94,15 @@ AliZDC::AliZDC()
   //
   // Default constructor for the Zero Degree Calorimeter base class
   //
+  
+  fIshunt = 1;
 
   fNhits = 0;
 
   fNStHits = 0;
-  fStHits = new TClonesArray("AliZDCHit",1000);
 
   fNPrimaryHits = 0;
   fNoShower   = 0;
-  
-  fIshunt = 0;
 }
  
 //_____________________________________________________________________________
@@ -105,19 +113,10 @@ AliZDC::AliZDC(const char *name, const char *title)
   // Standard constructor for the Zero Degree Calorimeter base class
   //
 
-  // Check that DIPO is there (otherwise tracking is wrong!!!)
-  
-  AliModule* PIPE=gAlice->GetModule("PIPE");
-  AliModule* ABSO=gAlice->GetModule("ABSO");
-  AliModule* DIPO=gAlice->GetModule("DIPO");
-  AliModule* SHIL=gAlice->GetModule("SHIL");
-  if((!PIPE) || (!ABSO) || (!DIPO) || (!SHIL)) {
-    Error("Constructor","ZDC needs PIPE, ABSO, DIPO and SHIL!!!\n");
-    exit(1);
-  } 
-
   //
   // Allocate the array of hits
+  
+  fIshunt =  1;
 
   fHits   = new TClonesArray("AliZDCHit",1000);
   gAlice->AddHitList(fHits);
@@ -127,8 +126,6 @@ AliZDC::AliZDC(const char *name, const char *title)
 
   fNPrimaryHits = 0;
   fNoShower   = 0;
-  
-  fIshunt =  0;
 
 }
 //____________________________________________________________________________ 
@@ -139,6 +136,7 @@ AliZDC::~AliZDC()
   //
 
   fIshunt   = 0;
+
 //  delete fHits;
 //  if(fStHits){
 //    fStHits->Delete();
@@ -160,17 +158,15 @@ void AliZDC::AddHit(Int_t track, Int_t *vol, Float_t *hits)
   
   static Float_t primKinEn, xImpact, yImpact, sFlag;
 
-  TClonesArray &lsthits = *fStHits;
-
-
   AliZDCHit *newquad, *curevquad, *curprimquad;
   newquad = new AliZDCHit(fIshunt, track, vol, hits);
 
+  TClonesArray &lsthits = *fStHits;
   TClonesArray &lhits = *fHits;
    
   Int_t i,j,kStHit = 1;
   for(i=0; i<fNStHits; i++){
-    // If the hits are equal (same track, same volume), sum them.
+    // If hits are equal (same track, same volume), sum them.
      curevquad = (AliZDCHit*) lsthits[i];
      kStHit = 1;
      if(*curevquad == *newquad){
@@ -180,7 +176,7 @@ void AliZDC::AddHit(Int_t track, Int_t *vol, Float_t *hits)
   }
 
   for(j=0; j<fNhits; j++){
-    // If the hits are equal (same track, same volume), sum them.
+    // If hits are equal (same track, same volume), sum them.
      curprimquad = (AliZDCHit*) lhits[j];
      if(*curprimquad == *newquad){
         *curprimquad = *curprimquad+*newquad;
@@ -220,12 +216,12 @@ void AliZDC::AddHit(Int_t track, Int_t *vol, Float_t *hits)
       fNStHits++;
     }
  
-    if(fDebug == 1){ 
-      printf("\n  Primary Hits --------------------------------------------------------\n");
-      fHits->Print("");
-      printf("\n  Event Hits --------------------------------------------------------\n");
-      fStHits->Print("");
-    }
+//    if(fDebug == 1){ 
+//      printf("\n  Primary Hits --------------------------------------------------------\n");
+//      fHits->Print("");
+//      printf("\n  Event Hits --------------------------------------------------------\n");
+//      fStHits->Print("");
+//    }
 
     delete newquad;
   }