]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSTrigger.cxx
replace hardcoded calls to geometry transformation matrices with calls to the TGeoMan...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTrigger.cxx
index a9fbcb4433dc3e705bbe1412164c5d43244e9082..5e5d5395d32fea9a600352583ef069d449db7da0 100644 (file)
@@ -121,6 +121,17 @@ AliPHOSTrigger::AliPHOSTrigger(const AliPHOSTrigger & trig) :
   // cpy ctor
 }
 
+AliPHOSTrigger::~AliPHOSTrigger() 
+{
+  // dtor
+  
+  if(fADCValuesHighnxn)delete [] fADCValuesHighnxn;
+  if(fADCValuesLownxn)delete [] fADCValuesLownxn;
+  if(fADCValuesHigh2x2)delete []  fADCValuesHigh2x2;
+  if(fADCValuesLow2x2)delete [] fADCValuesLow2x2;
+  // fDigitsList is now ours...
+}
+
 //_________________________________________________________________________
 AliPHOSTrigger & AliPHOSTrigger::operator = (const AliPHOSTrigger &)
 {
@@ -316,7 +327,7 @@ Bool_t AliPHOSTrigger::IsPatchIsolated(Int_t iPatchType, const TClonesArray * am
 
   AliDebug(2,Form("Type %d, Maximum amplitude %f, patch+isol square %f",iPatchType, maxamp, amp));
 
-  if(amp < maxamp){
+  if(TMath::Nint(amp*1E5) < TMath::Nint(maxamp*1E5)){
     AliError(Form("Bad sum: Type %d, Maximum amplitude %f, patch+isol square %f",iPatchType, maxamp, amp));
     return kFALSE;
   }
@@ -555,8 +566,9 @@ void AliPHOSTrigger::SetTriggers(const TClonesArray * ampmatrix, const Int_t iMo
     //Transform digit amplitude in Raw Samples
     if (fADCValuesLow2x2 == 0) {
       fADCValuesLow2x2  = new Int_t[nTimeBins];
-      fADCValuesHigh2x2 = new Int_t[nTimeBins];
     }
+    if(!fADCValuesHigh2x2) fADCValuesHigh2x2 = new Int_t[nTimeBins];
+
     
     pulse.SetAmplitude(f2x2MaxAmp);
     pulse.SetTZero(maxtimeR2);
@@ -595,8 +607,8 @@ void AliPHOSTrigger::SetTriggers(const TClonesArray * ampmatrix, const Int_t iMo
       fADCValuesLownxn  = new Int_t[nTimeBins];
     }
 
-    pulse.SetAmplitude(maxtimeRn);
-    pulse.SetTZero(fnxnMaxAmp);
+    pulse.SetAmplitude(fnxnMaxAmp);
+    pulse.SetTZero(maxtimeRn);
     pulse.MakeSamples();
     pulse.GetSamples(fADCValuesHighnxn, fADCValuesLownxn) ;
     
@@ -631,7 +643,7 @@ void AliPHOSTrigger::Trigger()
 
   //Main Method to select triggers.
 
-  AliRunLoader * rl = gAlice->GetRunLoader() 
+  AliRunLoader * rl = AliRunLoader::GetRunLoader()
   TString fileName = rl->GetFileName() ; 
   DoIt(fileName.Data()) ; 
 }