]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALv3.cxx
-mcompilation warning
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALv3.cxx
index 8a20c552fa51749dc7c16ab12a2da5f4d8d4a085..92efeee66384f50e64fdfeafa4052c844ac3b966 100644 (file)
@@ -32,8 +32,8 @@
 #include "TParticle.h"
 #include "TVirtualMC.h"
 #include "TBrowser.h"
-#include "TH1.h"
 #include "TH2.h"
+#include <cassert>
 
 // --- Standard library ---
 
@@ -42,7 +42,7 @@
 #include "AliRun.h"
 #include "AliHeader.h"
 #include "AliMC.h"
-#include "AliPoints.h"
+#include "AliStack.h"
 // for TRD1,2 case
 
 ClassImp(AliEMCALv3)
@@ -68,30 +68,12 @@ AliEMCALv3::AliEMCALv3(const char *name, const char *title): AliEMCALv1(name,tit
     fTimeCut  = 30e-09;
 
     fGeometry = GetGeometry(); 
-    fHDe = fHNhits = 0;
-    //    if (gDebug>0){
-    if (1){
-      TH1::AddDirectory(0);
-      fHDe = new TH1F("fHDe","De in EMCAL", 1000, 0., 1.);
-      fHNhits = new TH1F("fHNhits","#hits in EMCAL", 1001, -0.5, 1000.5);
-      int nbin = 77*2;
-      fHDeDz = new TH1F("fHDeDz","Longitudinal shower profile", 6*nbin, 0.0, 0.16*nbin);
-      
-      fHistograms->Add(fHDe);
-      fHistograms->Add(fHNhits);
-      fHistograms->Add(fHDeDz);
-      TH1::AddDirectory(1);
-    }
 }
 
 //______________________________________________________________________
 AliEMCALv3::AliEMCALv3(const AliEMCALv3 & emcal):AliEMCALv1(emcal)
 {
   fGeometry = emcal.fGeometry;
-  fHDe = emcal.fHDe;
-  fHNhits = emcal.fHNhits;
-  fHDeDz = emcal.fHDeDz;
-
 }
 
 //______________________________________________________________________
@@ -111,15 +93,13 @@ void AliEMCALv3::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t ipa
     // Add a hit to the hit list.
     // An EMCAL hit is the sum of all hits in a tower section
     //   originating from the same entering particle 
-    static Int_t hitCounter;
-    static AliEMCALHitv1 *newHit, *curHit;
-    static Bool_t deja;
-
-    deja = kFALSE;
+    static Int_t hitCounter=0;
+    static AliEMCALHitv1 *newHit=0, *curHit=0;
+    static Bool_t deja = kFALSE;
 
     newHit = new AliEMCALHitv1(shunt, primary, tracknumber, iparent, ienergy, id, hits, p);
     for ( hitCounter = fNhits-1; hitCounter >= 0 && !deja; hitCounter-- ) {
-       curHit = (AliEMCALHitv1*) (*fHits)[hitCounter];
+      curHit = (AliEMCALHitv1*) (*fHits)[hitCounter];
        // We add hits with the same tracknumber, while GEANT treats
        // primaries succesively
        if(curHit->GetPrimary() != primary) 
@@ -148,8 +128,8 @@ void AliEMCALv3::StepManager(void){
   static TLorentzVector pos; // Lorentz vector of the track current position.
   static TLorentzVector mom; // Lorentz vector of the track current momentum.
   static Float_t ienergy = 0;
-  static TString curVolName;
-  static int supModuleNumber, moduleNumber, yNumber, xNumber, absid;
+  static TString curVolName="";
+  static int supModuleNumber=-1, moduleNumber=-1, yNumber=-1, xNumber=-1, absid=-1;
   static int keyGeom=0;
   static char *vn = "SX"; // 15-mar-05
   static int nSMOP[7]={1,3,5,7,9,11}; // 30-mar-05
@@ -252,7 +232,7 @@ void AliEMCALv3::StepManager(void){
          else                                    BirkC1_mod=fBirkC1;
        }
 
-       Float_t dedxcm;
+       Float_t dedxcm=0;
        if (gMC->TrackStep()>0)  dedxcm=1000.*gMC->Edep()/gMC->TrackStep();
        else                     dedxcm=0;
        lightYield=lightYield/(1.+BirkC1_mod*dedxcm+fBirkC2*dedxcm*dedxcm);
@@ -274,37 +254,7 @@ void AliEMCALv3::StepManager(void){
   }
 }
 
-void AliEMCALv3::FinishEvent()
-{ // 26-may-05
-  static double de=0.;
-  fHNhits->Fill(double(fHits->GetEntries()));
-  de = GetDepositEnergy(0);
-  if(fHDe) fHDe->Fill(de);
-}
-
-Double_t AliEMCALv3::GetDepositEnergy(int print)
-{ // 23-mar-05 - for testing
-  //  cout<<"AliEMCALv3::GetDepositEnergy() : fHits "<<fHits<<endl; 
-  if(fHits == 0) return 0.;
-  static AliEMCALHitv1  *hit=0;
-  static Double_t de=0., deHit=0., zhl=0.0, zShift = 0.16*77;
-  for(int ih=0; ih<fHits->GetEntries(); ih++) {
-    hit = (AliEMCALHitv1*)fHits->UncheckedAt(ih);
-    deHit  = (double)hit->GetEnergy();
-    zhl    = (double)hit->Z() + zShift;
-    if(zhl>2.*zShift) zhl = 2*zShift - 0.002;
-    de    += deHit;
-    if(fHDeDz) fHDeDz->Fill(zhl, deHit);
-  }
-  if(print>0) {
-    printf(" #hits %i de %f \n", fHits->GetEntries(), de);
-    if(print>1) {
-      printf(" #primary particles %i\n", gAlice->GetHeader()->GetNprimary()); 
-    }
-  }
-  return de;
-}
-
+//_____________________________________________
 void AliEMCALv3::Browse(TBrowser* b)
 {
   TObject::Browse(b);