// 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 &)
{
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;
}
Float_t maxtimeR2 = -1 ;
Float_t maxtimeRn = -1 ;
// Create a shaper pulse object
- AliPHOSPulseGenerator *pulse = new AliPHOSPulseGenerator();
- Int_t nTimeBins = pulse->GetRawFormatTimeBins() ;
+ AliPHOSPulseGenerator pulse ;
+ Int_t nTimeBins = pulse.GetRawFormatTimeBins() ;
//Set max 2x2 amplitude and select L0 trigger
if(max2[0] > f2x2MaxAmp ){
fIs2x2Isol = IsPatchIsolated(0, ampmatrix, iMod, mtru2, f2x2MaxAmp, static_cast<Int_t>(max2[1]), static_cast<Int_t>(max2[2])) ;
//Transform digit amplitude in Raw Samples
- fADCValuesLow2x2 = new Int_t[nTimeBins];
- fADCValuesHigh2x2 = new Int_t[nTimeBins];
+ if (fADCValuesLow2x2 == 0) {
+ fADCValuesLow2x2 = new Int_t[nTimeBins];
+ }
+ if(!fADCValuesHigh2x2) fADCValuesHigh2x2 = new Int_t[nTimeBins];
+
- pulse->SetAmplitude(f2x2MaxAmp);
- pulse->SetTZero(maxtimeR2);
- pulse->MakeSamples();
- pulse->GetSamples(fADCValuesHigh2x2, fADCValuesLow2x2) ;
+ pulse.SetAmplitude(f2x2MaxAmp);
+ pulse.SetTZero(maxtimeR2);
+ pulse.MakeSamples();
+ pulse.GetSamples(fADCValuesHigh2x2, fADCValuesLow2x2) ;
//Set Trigger Inputs, compare ADC time bins until threshold is attained
//Set L0
fIsnxnIsol = IsPatchIsolated(1, ampmatrix, iMod, mtrun, fnxnMaxAmp, static_cast<Int_t>(maxn[1]), static_cast<Int_t>(maxn[2])) ;
//Transform digit amplitude in Raw Samples
- fADCValuesHighnxn = new Int_t[nTimeBins];
- fADCValuesLownxn = new Int_t[nTimeBins];
+ if (fADCValuesHighnxn == 0) {
+ fADCValuesHighnxn = new Int_t[nTimeBins];
+ fADCValuesLownxn = new Int_t[nTimeBins];
+ }
- pulse->SetAmplitude(maxtimeRn);
- pulse->SetTZero(fnxnMaxAmp);
- pulse->MakeSamples();
- pulse->GetSamples(fADCValuesHighnxn, fADCValuesLownxn) ;
+ pulse.SetAmplitude(fnxnMaxAmp);
+ pulse.SetTZero(maxtimeRn);
+ pulse.MakeSamples();
+ pulse.GetSamples(fADCValuesHighnxn, fADCValuesLownxn) ;
//Set Trigger Inputs, compare ADC time bins until threshold is attained
//SetL1 Low
{
//Main Method to select triggers.
- AliRunLoader *rl = gAlice->GetRunLoader();
- //Getter
- AliPHOSGetter * gime = AliPHOSGetter::Instance( rl->GetFileName() ) ;
- //AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
+ AliRunLoader * rl = AliRunLoader::GetRunLoader();
+ TString fileName = rl->GetFileName() ;
+ DoIt(fileName.Data()) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSTrigger::Trigger(const char * fileName)
+{
+
+ //Main Method to select triggers.
+
+
+ DoIt(fileName) ;
+}
+
+//____________________________________________________________________________
+void AliPHOSTrigger::DoIt(const char * fileName)
+{
+ // does the trigger job
+
+ AliPHOSGetter * gime = AliPHOSGetter::Instance( fileName ) ;
+
//Get Geometry
const AliPHOSGeometry * geom = AliPHOSGetter::Instance()->PHOSGeometry() ;
SetTriggers(amptrus,imod,ampmax2,ampmaxn) ;
}
+ amptrus->Delete();
+ delete amptrus; amptrus=0;
+ ampmods->Delete();
+ delete ampmods; ampmods=0;
+ timeRtrus->Delete();
+ delete timeRtrus; timeRtrus=0;
//Print();
}