]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALv1.cxx
TRD1, 12 SM, 110 degree as default
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALv1.cxx
index 88d973f34b2ab9a9001e733b5e087a92f9863fa9..be1a95b19dc5fe3e98e83585d6c4bb28db0628b9 100644 (file)
@@ -57,10 +57,11 @@ AliEMCALv1::AliEMCALv1(const char *name, const char *title):
     // Standard Creator.
 
     fHits= new TClonesArray("AliEMCALHit",1000);
-    gAlice->GetMCApp()->AddHitList(fHits);
+    //    gAlice->GetMCApp()->AddHitList(fHits); // 20-dec-04 - advice of Andreas
 
     fNhits = 0;
     fIshunt     =  2; // All hits are associated with particles entering the calorimeter
+    fTimeCut = 30e-09;
 }
 
 //______________________________________________________________________
@@ -103,7 +104,7 @@ void AliEMCALv1::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t ipa
        new((*fHits)[fNhits]) AliEMCALHit(*newHit);
        fNhits++;
     } // end if
-
+    
     delete newHit;
 }
 //______________________________________________________________________
@@ -122,10 +123,11 @@ void AliEMCALv1::StepManager(void){
   
   AliEMCALGeometry * geom = GetGeometry() ; 
 
-  if(gMC->CurrentVolID(copy) == gMC->VolId("XPHI") ) { // We are in a Scintillator Layer 
+  static Int_t idXPHI = gMC->VolId("XPHI");
+  if(gMC->CurrentVolID(copy) == idXPHI ) { // We are in a Scintillator Layer 
     Float_t depositedEnergy ; 
     
-    if( (depositedEnergy = gMC->Edep()) > 0.){// Track is inside a scintillator and deposits some energy
+    if( ((depositedEnergy = gMC->Edep()) > 0.)  && (gMC->TrackTime() < fTimeCut)){// Track is inside a scintillator and deposits some energy
        if (fCurPrimary==-1) 
        fCurPrimary=gAlice->GetMCApp()->GetPrimary(tracknumber);
 
@@ -189,7 +191,7 @@ void AliEMCALv1::StepManager(void){
       if (gMC->TrackCharge()!=0) { // Check
          Float_t BirkC1_mod = 0;
        if (fBirkC0==1){ // Apply correction for higher charge states
-         if (abs(gMC->TrackCharge())>=2)
+         if (TMath::Abs(gMC->TrackCharge())>=2)
            BirkC1_mod=fBirkC1*7.2/12.6;
          else
            BirkC1_mod=fBirkC1;