From 1f847d9fed12b27340066b06c6af72e454226268 Mon Sep 17 00:00:00 2001 From: phille Date: Thu, 31 Mar 2011 18:52:43 +0000 Subject: [PATCH] Refactoring: Functions related to the shaper response is removed from AliEMCALRawUTils collected in a dedicated class. Tis is done in order to avoid duplications in the RawAnalyzer classes and at the same time avoid depedencies between the rec and the raw library. --- EMCAL/AliCaloRawAnalyzer.cxx | 16 ---- EMCAL/AliCaloRawAnalyzerFastFit.h | 2 +- EMCAL/AliCaloRawAnalyzerKStandard.cxx | 12 ++- EMCAL/AliCaloRawAnalyzerKStandard.h | 3 +- EMCAL/AliCaloRawAnalyzerNN.h | 2 +- EMCAL/AliCaloRawAnalyzerPeakFinder.cxx | 24 +----- EMCAL/AliCaloRawAnalyzerPeakFinder.h | 6 +- EMCAL/AliEMCALRawResponse.cxx | 106 +++++++++++++++++++++++++ EMCAL/AliEMCALRawResponse.h | 50 ++++++++++++ EMCAL/AliEMCALRawUtils.cxx | 22 +++-- EMCAL/AliEMCALRawUtils.h | 27 ++++--- EMCAL/AliEMCALTrigger.cxx | 15 +++- EMCAL/CMakelibEMCALraw.pkg | 2 +- EMCAL/EMCALrawLinkDef.h | 1 + 14 files changed, 220 insertions(+), 68 deletions(-) create mode 100644 EMCAL/AliEMCALRawResponse.cxx create mode 100644 EMCAL/AliEMCALRawResponse.h diff --git a/EMCAL/AliCaloRawAnalyzer.cxx b/EMCAL/AliCaloRawAnalyzer.cxx index 6aacb00f5ee..5fe155c0f23 100644 --- a/EMCAL/AliCaloRawAnalyzer.cxx +++ b/EMCAL/AliCaloRawAnalyzer.cxx @@ -46,12 +46,10 @@ AliCaloRawAnalyzer::AliCaloRawAnalyzer(const char *name, const char *nameshort) fIsZerosupressed( false ), fVerbose( false ), fAlgo(Algo::kNONE), -// fFp(0), fL1Phase(0), fAmp(0), fTof(0), fTau( EMCAL::TAU ) -// fFixTau(true) { //Comment snprintf(fName, 256,"%s", name); @@ -63,9 +61,6 @@ AliCaloRawAnalyzer::AliCaloRawAnalyzer(const char *name, const char *nameshort) { fReversed[i] = 0; } - - // fFp = fopen("amp2.txt", "w"); - } AliCaloRawAnalyzer::~AliCaloRawAnalyzer() @@ -416,17 +411,6 @@ AliCaloRawAnalyzer::CalculateMeanAndRMS(const Int_t first, const Int_t last, -// AliCaloFitResults -// AliCaloRawAnalyzer::Evaluate( const vector &/*bunchvector*/, const UInt_t /*altrocfg1*/, const UInt_t /*altrocfg2*/) -// { // method to do the selection of what should possibly be fitted -// // not implemented for base class -// cout << __FILE__ << ":" << __LINE__ << " " << endl; - -// return AliCaloFitResults( 0, 0 ); -// } - - - int AliCaloRawAnalyzer::PreFitEvaluateSamples( const vector &bunchvector, const UInt_t altrocfg1, const UInt_t altrocfg2, Int_t & index, Float_t & maxf, short & maxamp, diff --git a/EMCAL/AliCaloRawAnalyzerFastFit.h b/EMCAL/AliCaloRawAnalyzerFastFit.h index 92c5e874b6d..cb296452f44 100644 --- a/EMCAL/AliCaloRawAnalyzerFastFit.h +++ b/EMCAL/AliCaloRawAnalyzerFastFit.h @@ -28,7 +28,7 @@ class AliCaloRawAnalyzerFastFit : public AliCaloRawAnalyzerFitter { - friend class AliCaloRawAnalyzerFactory; + friend class AliCaloRawAnalyzerFactory; // comment public: virtual ~AliCaloRawAnalyzerFastFit(); virtual AliCaloFitResults Evaluate( const std::vector &bunchvector, diff --git a/EMCAL/AliCaloRawAnalyzerKStandard.cxx b/EMCAL/AliCaloRawAnalyzerKStandard.cxx index c0a91ac1fd1..144b3c5a284 100644 --- a/EMCAL/AliCaloRawAnalyzerKStandard.cxx +++ b/EMCAL/AliCaloRawAnalyzerKStandard.cxx @@ -35,6 +35,9 @@ #include "TGraph.h" #include "TRandom.h" +#include "AliEMCALRawResponse.h" + + using namespace std; ClassImp( AliCaloRawAnalyzerKStandard ) @@ -132,7 +135,10 @@ void gSig->SetPoint(i, timebin, GetReversed(timebin)); } - TF1 * signalF = new TF1("signal", RawResponseFunction, 0, TIMEBINS , 5); + + // TF1 * signalF = new TF1("signal", RawResponseFunction, 0, TIMEBINS , 5); + TF1 * signalF = new TF1("signal", AliEMCALRawResponse::RawResponseFunction, 0, TIMEBINS , 5); + signalF->SetParameters(10.,5., TAU ,ORDER,0.); //set all defaults once, just to be safe signalF->SetParNames("amp","t0","tau","N","ped"); signalF->FixParameter(2,TAU); @@ -228,6 +234,8 @@ AliCaloRawAnalyzerKStandard::FitParabola(const TGraph *gSig, Float_t & amp) cons //__________________________________________________________________ + +/* Double_t AliCaloRawAnalyzerKStandard::RawResponseFunction(const Double_t *x, const Double_t *par) { @@ -245,4 +253,4 @@ AliCaloRawAnalyzerKStandard::RawResponseFunction(const Double_t *x, const Double } return signal ; } - +*/ diff --git a/EMCAL/AliCaloRawAnalyzerKStandard.h b/EMCAL/AliCaloRawAnalyzerKStandard.h index 44d8241373b..8160f63815f 100644 --- a/EMCAL/AliCaloRawAnalyzerKStandard.h +++ b/EMCAL/AliCaloRawAnalyzerKStandard.h @@ -33,7 +33,8 @@ class AliCaloRawAnalyzerKStandard : public AliCaloRawAnalyzerFitter public: virtual ~AliCaloRawAnalyzerKStandard(); virtual AliCaloFitResults Evaluate( const std::vector &bunchvector, const UInt_t altrocfg1, const UInt_t altrocfg2 ); - static Double_t RawResponseFunction(const Double_t *x, const Double_t *par); + // static Double_t RawResponseFunction(const Double_t *x, const Double_t *par); + void FitRaw(const Int_t firstTimeBin, const Int_t lastTimeBin, Float_t & amp, Float_t & time, Float_t & chi2, Bool_t & fitDone) const ; diff --git a/EMCAL/AliCaloRawAnalyzerNN.h b/EMCAL/AliCaloRawAnalyzerNN.h index a0df81de94e..87d60854dee 100644 --- a/EMCAL/AliCaloRawAnalyzerNN.h +++ b/EMCAL/AliCaloRawAnalyzerNN.h @@ -32,7 +32,7 @@ class AliCaloNeuralFit; class AliCaloRawAnalyzerNN : public AliCaloRawAnalyzer { - friend class AliCaloRawAnalyzerFactory; + friend class AliCaloRawAnalyzerFactory; // self explanatory public: // AliCaloRawAnalyzerNN(); virtual ~AliCaloRawAnalyzerNN(); diff --git a/EMCAL/AliCaloRawAnalyzerPeakFinder.cxx b/EMCAL/AliCaloRawAnalyzerPeakFinder.cxx index 40171588895..6a5a993b3d3 100644 --- a/EMCAL/AliCaloRawAnalyzerPeakFinder.cxx +++ b/EMCAL/AliCaloRawAnalyzerPeakFinder.cxx @@ -36,7 +36,6 @@ #include "TFile.h" #include "AliCaloPeakFinderVectors.h" #include -//#include "AliEMCALRawUtils.h" using namespace std; @@ -45,7 +44,6 @@ ClassImp( AliCaloRawAnalyzerPeakFinder ) AliCaloRawAnalyzerPeakFinder::AliCaloRawAnalyzerPeakFinder() :AliCaloRawAnalyzer("Peak-Finder", "PF"), -// fAmp(0), fPeakFinderVectors(0), fRunOnAlien(false), fIsInitialized(false) @@ -63,9 +61,6 @@ void AliCaloRawAnalyzerPeakFinder::InitOCDB(bool alien) const { // Setting the default OCDB pathe depending on wether we work locally or on the GRID. - - - // if( AliCDBManager::Instance()->HasStorage("alien://$ALICE_ROOT/OCDB") == false && AliCDBManager::Instance()->HasStorage("local://$ALICE_ROOT/OCDB") == false ) if( !AliCDBManager::Instance()->IsDefaultStorageSet ()) { AliCDBManager::Instance()->SetDefaultStorage( alien == true ? "alien://$ALICE_ROOT/OCDB" : "local://$ALICE_ROOT/OCDB" ); @@ -124,6 +119,7 @@ AliCaloRawAnalyzerPeakFinder::ScanCoarse(const Double_t *const array, const int AliCaloFitResults AliCaloRawAnalyzerPeakFinder::Evaluate( const vector &bunchvector, const UInt_t altrocfg1, const UInt_t altrocfg2 ) { + // Evaluation of amplitude and TOF if( fIsInitialized == false ) { cout << __FILE__ << ":" << __LINE__ << "ERROR, peakfinder vectors not loaded" << endl; @@ -199,13 +195,11 @@ AliCaloRawAnalyzerPeakFinder::Evaluate( const vector &bunchvec } if( TMath::Abs( (maxf - fAmp )/maxf ) > 0.1 ) { - // cout << __FILE__ << ":" << __LINE__ << "WARNING: amp was" << fAmp <<", but was changed to "<< maxf << endl; fAmp = maxf; } - // tof = timebinOffset - 0.01*tof/fAmp; // clock ticks tof = timebinOffset - 0.01*tof/fAmp - fL1Phase/TIMEBINWITH; // clock - + // use local-array time for chi2 estimate Float_t chi2 = CalculateChi2(fAmp, tof-timebinOffset+maxrev, first, last); Int_t ndf = last - first - 1; // nsamples - 2 @@ -236,7 +230,6 @@ AliCaloRawAnalyzerPeakFinder::CopyVectors( const AliCaloPeakFinderVectors *const { for( int j=0; j < PF::SAMPLERANGE; j++) { - // cout << __FILE__ << ":" << __LINE__ << ": TPX !!; i= "<< i << " j = "<< j << endl; pfv->GetVector( i, j, fPFAmpVectors[i][j] , fPFTofVectors[i][j], fPFAmpVectorsCoarse[i][j] , fPFTofVectorsCoarse[i][j] ); @@ -261,31 +254,20 @@ AliCaloRawAnalyzerPeakFinder::LoadVectorsOCDB() if( entry != 0 ) { - cout << __FILE__ << ":" << __LINE__ << ": Printing metadata !! " << endl; entry->PrintMetaData(); - - cout << __FILE__ << ":" << __LINE__ << ": Finnsihed Printing metadata !! " << endl; - AliCaloPeakFinderVectors *pfv = (AliCaloPeakFinderVectors *)entry->GetObject(); - cout << __FILE__ << ":" << __LINE__ << ": got pfv !! " << endl; - if( pfv == 0 ) { cout << __FILE__ << ":" << __LINE__ << "_ ERRROR " << endl; } - - cout << __FILE__ << ":" << __LINE__ << ": TP0 !! " << endl; CopyVectors( pfv ); - - cout << __FILE__ << ":" << __LINE__ << ": TP1 !! " << endl; - + if( pfv != 0 ) { fIsInitialized = true; } } - } diff --git a/EMCAL/AliCaloRawAnalyzerPeakFinder.h b/EMCAL/AliCaloRawAnalyzerPeakFinder.h index b3633efee5b..fff69856008 100644 --- a/EMCAL/AliCaloRawAnalyzerPeakFinder.h +++ b/EMCAL/AliCaloRawAnalyzerPeakFinder.h @@ -32,9 +32,8 @@ class AliCaloPeakFinderVectors; class AliCaloRawAnalyzerPeakFinder : public AliCaloRawAnalyzer { - friend class AliCaloRawAnalyzerFactory; + friend class AliCaloRawAnalyzerFactory; // shutting up the rule checker public: - // AliCaloRawAnalyzerPeakFinder( ); virtual ~AliCaloRawAnalyzerPeakFinder(); virtual AliCaloFitResults Evaluate( const std::vector &bunchvector, const UInt_t altrocfg1, const UInt_t altrocfg2 ); @@ -55,9 +54,6 @@ class AliCaloRawAnalyzerPeakFinder : public AliCaloRawAnalyzer Double_t fPFTofVectorsCoarse[PF::MAXSTART][PF::SAMPLERANGE][100]; // Vectors for TOF extraction, first iteration Double_t fPFAmpVectors[PF::MAXSTART][PF::SAMPLERANGE][100]; // Vectors for Amplitude extraction, second iteration Double_t fPFTofVectors[PF::MAXSTART][PF::SAMPLERANGE][100]; // Vectors for TOF extraction, second iteration - - //Double_t fAmp; // The amplitude in entities of ADC counts - AliCaloPeakFinderVectors *fPeakFinderVectors; // Collection of Peak-Fincer vectors bool fRunOnAlien; // Wether or not we are running on the GRID bool fIsInitialized; diff --git a/EMCAL/AliEMCALRawResponse.cxx b/EMCAL/AliEMCALRawResponse.cxx new file mode 100644 index 00000000000..3d6af76dd26 --- /dev/null +++ b/EMCAL/AliEMCALRawResponse.cxx @@ -0,0 +1,106 @@ +// -*- mode: c++ -*- + +/************************************************************************** + * This file is property of and copyright by the Experimental Nuclear * + * Physics Group, Dep. of Physics * + * University of Oslo, Norway, 2007 * + * * + * Author: Per Thomas Hille for the ALICE HLT Project.* + * Contributors are mentioned in the code where appropriate. * + * Please report bugs to perthi@fys.uio.no * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +#include "TF1.h" +#include "TMath.h" +#include + +#include "AliEMCALRawResponse.h" +#include "AliCaloConstants.h" + +using namespace CALO; +using namespace EMCAL; +using namespace ALTRO; + +Double_t AliEMCALRawResponse::fgTimeTrigger = 600E-9 ; // the time of the trigger as approximately seen in the data +Int_t AliEMCALRawResponse::fgThreshold = 1; +Int_t AliEMCALRawResponse::fgPedestalValue = 0; // pedestal value for digits2raw, default generate ZS data +Double_t AliEMCALRawResponse::fgFEENoise = 3.; // 3 ADC channels of noise (sampled) + + + +ClassImp(AliEMCALRawResponse) + + +AliEMCALRawResponse::AliEMCALRawResponse() +{ + //comment +} + +AliEMCALRawResponse::~AliEMCALRawResponse() +{ + +} + + +Double_t +AliEMCALRawResponse::RawResponseFunction(Double_t *x, Double_t *par) +{ + // step response of the emcal electronincs + Double_t signal = 0.; + Double_t tau = par[2]; + Double_t n = par[3]; + Double_t ped = par[4]; + Double_t xx = ( x[0] - par[1] + tau ) / tau ; + if (xx <= 0) + signal = ped ; + else + { + signal = ped + par[0] * TMath::Power(xx , n) * TMath::Exp(n * (1 - xx )) ; + } + return signal ; +} + + +Bool_t +AliEMCALRawResponse::RawSampledResponse(const Double_t dtime, const Double_t damp, Int_t * adcH, + Int_t * adcL, const Int_t keyErr) +{ + // step response of the emcal electronincs + Bool_t lowGain = kFALSE ; + TF1 signalF("signal", RawResponseFunction, 0, TIMEBINS, 5); + signalF.SetParameter(0, damp) ; + signalF.SetParameter(1, (dtime + fgTimeTrigger)/ TIMEBINWITH) ; + signalF.SetParameter(2, TAU) ; + signalF.SetParameter(3, ORDER); + signalF.SetParameter(4, fgPedestalValue); + + Double_t signal=0.0, noise=0.0; + for (Int_t iTime = 0; iTime < TIMEBINS; iTime++) { + signal = signalF.Eval(iTime) ; + + if(keyErr>0) { + noise = gRandom->Gaus(0.,fgFEENoise); + signal += noise; + } + + adcH[iTime] = static_cast(signal + 0.5) ; + if ( adcH[iTime] > MAXBINVALUE ){ // larger than 10 bits + adcH[iTime] = MAXBINVALUE ; + lowGain = kTRUE ; + } + signal /= HGLGFACTOR; + adcL[iTime] = static_cast(signal + 0.5) ; + if ( adcL[iTime] > MAXBINVALUE ) // larger than 10 bits + adcL[iTime] = MAXBINVALUE ; + } + return lowGain ; +} + diff --git a/EMCAL/AliEMCALRawResponse.h b/EMCAL/AliEMCALRawResponse.h new file mode 100644 index 00000000000..b2b9e3cc006 --- /dev/null +++ b/EMCAL/AliEMCALRawResponse.h @@ -0,0 +1,50 @@ +// -*- mode: c++ -*- + +#ifndef ALIEMCALRAWRESPONSE_H +#define ALIEMCALRAWRESPONSE_H + +/************************************************************************** + * This file is property of and copyright by the Experimental Nuclear * + * Physics Group, Yale University, US 2011 * + * * + * Author: Per Thomas Hille for the ALICE * + * experiment. Contributors are mentioned in the code where appropriate. * + * Please report bugs to perthomas.hille@yale.edu * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +#include "Rtypes.h" + +class AliEMCALRawResponse +{ +public: + AliEMCALRawResponse(); + virtual ~AliEMCALRawResponse(); + static Double_t RawResponseFunction(Double_t *x, Double_t *par); + static Bool_t RawSampledResponse(Double_t dtime, Double_t damp, Int_t * adcH, Int_t * adcL, + const Int_t keyErr=0); + + static Int_t GetPedestalValue() {return fgPedestalValue;} + static Double_t GetFEENoise() {return fgFEENoise;} + static void SetFEENoise(Double_t val) {fgFEENoise = val;} + static Double_t GetRawFormatTimeTrigger() { return fgTimeTrigger ; } + static Int_t GetRawFormatThreshold() { return fgThreshold ; } + static void SetPedestalValue(Int_t val) {fgPedestalValue = val;} + +private: + static Double_t fgTimeTrigger ; // time of the trigger for the RO signal + static Int_t fgThreshold; // threshold + static Int_t fgPedestalValue; // pedestal value for Digits2Raw + static Double_t fgFEENoise; // electronics noise in ADC units + + ClassDef(AliEMCALRawResponse,1) +}; + +#endif diff --git a/EMCAL/AliEMCALRawUtils.cxx b/EMCAL/AliEMCALRawUtils.cxx index c750f993bb2..f59bdbb9cad 100644 --- a/EMCAL/AliEMCALRawUtils.cxx +++ b/EMCAL/AliEMCALRawUtils.cxx @@ -54,14 +54,17 @@ #include "AliCaloConstants.h" #include "AliCaloRawAnalyzer.h" #include "AliCaloRawAnalyzerFactory.h" +#include "AliEMCALRawResponse.h" using namespace CALO; using namespace EMCAL; +/* Double_t AliEMCALRawUtils::fgTimeTrigger = 600E-9 ; // the time of the trigger as approximately seen in the data Int_t AliEMCALRawUtils::fgThreshold = 1; Int_t AliEMCALRawUtils::fgPedestalValue = 0; // pedestal value for digits2raw, default generate ZS data Double_t AliEMCALRawUtils::fgFEENoise = 3.; // 3 ADC channels of noise (sampled) +*/ ClassImp(AliEMCALRawUtils) @@ -189,7 +192,7 @@ void AliEMCALRawUtils::Digits2Raw() } else { - if (digit->GetAmplitude() < fgThreshold) + if (digit->GetAmplitude() < AliEMCALRawResponse::GetRawFormatThreshold() ) { continue; } @@ -248,11 +251,13 @@ void AliEMCALRawUtils::Digits2Raw() buffers[iDDL]->WriteTrailer(3, ieta, iphi, nSM); // trailer // calculate the time response function } else { - Bool_t lowgain = RawSampledResponse(digit->GetTimeR(), digit->GetAmplitude(), adcValuesHigh.GetArray(), adcValuesLow.GetArray()) ; - if (lowgain) - buffers[iDDL]->WriteChannel(ieta, iphi, 0, TIMEBINS, adcValuesLow.GetArray(), fgThreshold); + Bool_t lowgain = AliEMCALRawResponse::RawSampledResponse(digit->GetTimeR(), digit->GetAmplitude(), + adcValuesHigh.GetArray(), adcValuesLow.GetArray()) ; + + if (lowgain) + buffers[iDDL]->WriteChannel(ieta, iphi, 0, TIMEBINS, adcValuesLow.GetArray(), AliEMCALRawResponse::GetRawFormatThreshold() ); else - buffers[iDDL]->WriteChannel(ieta,iphi, 1, TIMEBINS, adcValuesHigh.GetArray(), fgThreshold); + buffers[iDDL]->WriteChannel(ieta,iphi, 1, TIMEBINS, adcValuesHigh.GetArray(), AliEMCALRawResponse::GetRawFormatThreshold() ); } }// iDDL under the limits }//digit exists @@ -413,6 +418,7 @@ void AliEMCALRawUtils::TrimDigits(TClonesArray *digitsArr) } +/* Double_t AliEMCALRawUtils::RawResponseFunction(Double_t *x, Double_t *par) { @@ -463,9 +469,11 @@ Bool_t AliEMCALRawUtils::RawSampledResponse(const Double_t dtime, const Double_t } return lowGain ; } - +*/ //__________________________________________________________________ + +/* Double_t AliEMCALRawUtils::RawResponseFunctionLog(Double_t *x, Double_t *par) { Double_t signal = 0. ; @@ -483,7 +491,7 @@ Double_t AliEMCALRawUtils::RawResponseFunctionLog(Double_t *x, Double_t *par) } return signal ; } - +*/ //__________________________________________________________________ diff --git a/EMCAL/AliEMCALRawUtils.h b/EMCAL/AliEMCALRawUtils.h index ab4fa716ad5..46788e8ee73 100644 --- a/EMCAL/AliEMCALRawUtils.h +++ b/EMCAL/AliEMCALRawUtils.h @@ -50,13 +50,15 @@ class AliEMCALRawUtils : public TObject { void Digits2Raw(); void Raw2Digits(AliRawReader *reader, TClonesArray *digitsArr, const AliCaloCalibPedestal* pedbadmap, TClonesArray *digitsTRG=0x0, AliEMCALTriggerData* trgData = 0x0); - static Double_t RawResponseFunctionLog(Double_t *x, Double_t *par); + //static Double_t RawResponseFunctionLog(Double_t *x, Double_t *par); void AddDigit(TClonesArray *digitsArr, Int_t id, Int_t lowGain, Float_t amp, Float_t time, Float_t chi2, Int_t ndf); void TrimDigits(TClonesArray *digitsArr); Int_t GetNoiseThreshold() const { return fNoiseThreshold; } Int_t GetNPedSamples() const { return fNPedSamples; } - Int_t GetPedestalValue() const {return fgPedestalValue;} - Double_t GetFEENoise() const {return fgFEENoise;} + + // Int_t GetPedestalValue() const {return fgPedestalValue;} + // Double_t GetFEENoise() const {return fgFEENoise;} + Bool_t GetRemoveBadChannels() const {return fRemoveBadChannels;} Int_t GetFittingAlgorithm() const {return fFittingAlgorithm; } Float_t GetTimeMax() const {return fTimeMax ;} @@ -69,25 +71,32 @@ class AliEMCALRawUtils : public TObject { void SetTimeMin(Float_t t) {fTimeMin = t ;} void SetTimeMax(Float_t t) {fTimeMax = t ;} void SetFALTROUsage(Bool_t val) {fUseFALTRO=val; } - void SetFEENoise(Double_t val) {fgFEENoise = val;} - void SetPedestalValue(Int_t val) {fgPedestalValue = val;} - Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; } - Int_t GetRawFormatThreshold() const { return fgThreshold ; } + // void SetFEENoise(Double_t val) {fgFEENoise = val;} + // void SetPedestalValue(Int_t val) {fgPedestalValue = val;} + //Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; } + // Int_t GetRawFormatThreshold() const { return fgThreshold ; } AliCaloRawAnalyzer *GetRawAnalyzer() const { return fRawAnalyzer;} virtual Option_t* GetOption() const { return fOption.Data(); } void SetOption(const Option_t* opt) { fOption = opt; } - static Double_t RawResponseFunction(Double_t *x, Double_t *par); - Bool_t RawSampledResponse(Double_t dtime, Double_t damp, Int_t * adcH, Int_t * adcL, const Int_t keyErr=0) const; + + // static Double_t RawResponseFunction(Double_t *x, Double_t *par); + // Bool_t RawSampledResponse(Double_t dtime, Double_t damp, Int_t * adcH, Int_t * adcL, const Int_t keyErr=0) const; + + private: AliEMCALRawUtils(const AliEMCALRawUtils& rawUtils); //copy ctor AliEMCALRawUtils& operator =(const AliEMCALRawUtils& rawUtils); Int_t fNoiseThreshold; // threshold to consider signal or noise Int_t fNPedSamples; // number of samples to use in pedestal calculation + + /* static Double_t fgTimeTrigger ; // time of the trigger for the RO signal static Int_t fgThreshold; // threshold static Int_t fgPedestalValue; // pedestal value for Digits2Raw static Double_t fgFEENoise; // electronics noise in ADC units + */ + AliEMCALGeometry* fGeom; // geometry AliAltroMapping* fMapping[4]; // only two for now TString fOption; // option passed from Reconstructor diff --git a/EMCAL/AliEMCALTrigger.cxx b/EMCAL/AliEMCALTrigger.cxx index f018d08a15a..a2e436bd69c 100644 --- a/EMCAL/AliEMCALTrigger.cxx +++ b/EMCAL/AliEMCALTrigger.cxx @@ -61,6 +61,7 @@ #include "AliEMCALRawUtils.h" #include "AliLog.h" #include "AliCaloConstants.h" +#include "AliEMCALRawResponse.h" using namespace CALO; @@ -671,9 +672,12 @@ void AliEMCALTrigger::SetTriggers(const TClonesArray * ampmatrix,const Int_t iSM // rawUtil.RawSampledResponse(maxtimeR2 * AliEMCALRawUtils::GetRawFormatTimeBin(), // f2x2MaxAmp, fADCValuesHigh2x2, fADCValuesLow2x2) ; - rawUtil.RawSampledResponse(maxtimeR2*TIMEBINMAX/TIMEBINS, - f2x2MaxAmp, fADCValuesHigh2x2, fADCValuesLow2x2) ; + // rawUtil.RawSampledResponse(maxtimeR2*TIMEBINMAX/TIMEBINS, + // f2x2MaxAmp, fADCValuesHigh2x2, fADCValuesLow2x2) ; + AliEMCALRawResponse::RawSampledResponse( maxtimeR2*TIMEBINMAX/TIMEBINS, + f2x2MaxAmp, fADCValuesHigh2x2, fADCValuesLow2x2) ; + // Set Trigger Inputs, compare ADC time bins until threshold is attained // Set L0 for(Int_t i = 0 ; i < nTimeBins ; i++){ @@ -715,10 +719,13 @@ void AliEMCALTrigger::SetTriggers(const TClonesArray * ampmatrix,const Int_t iSM } // rawUtil.RawSampledResponse(maxtimeRn * AliEMCALRawUtils::GetRawFormatTimeBin(), // fnxnMaxAmp, fADCValuesHighnxn, fADCValuesLownxn) ; - rawUtil.RawSampledResponse(maxtimeRn*TIMEBINMAX/TIMEBINS, - fnxnMaxAmp, fADCValuesHighnxn, fADCValuesLownxn) ; + //rawUtil.RawSampledResponse(maxtimeRn*TIMEBINMAX/TIMEBINS, + // fnxnMaxAmp, fADCValuesHighnxn, fADCValuesLownxn) ; + AliEMCALRawResponse::RawSampledResponse (maxtimeRn*TIMEBINMAX/TIMEBINS, + fnxnMaxAmp, fADCValuesHighnxn, fADCValuesLownxn) ; + //Set Trigger Inputs, compare ADC time bins until threshold is attained //SetL1 Low for(Int_t i = 0 ; i < nTimeBins ; i++){ diff --git a/EMCAL/CMakelibEMCALraw.pkg b/EMCAL/CMakelibEMCALraw.pkg index ce5ce1c76cf..436e1aea5a2 100644 --- a/EMCAL/CMakelibEMCALraw.pkg +++ b/EMCAL/CMakelibEMCALraw.pkg @@ -25,7 +25,7 @@ # SHLIBS - Shared Libraries and objects for linking (Executables only) # #--------------------------------------------------------------------------------# -set ( SRCS AliCaloRawAnalyzerFastFit.cxx AliCaloRawAnalyzerPeakFinder.cxx AliCaloRawAnalyzerFakeALTRO.cxx AliCaloRawAnalyzerKStandard.cxx AliCaloRawAnalyzerNN.cxx AliCaloRawAnalyzerFitter.cxx AliCaloRawAnalyzerCrude.cxx AliCaloRawAnalyzerFactory.cxx AliCaloNeuralFit.cxx AliCaloPeakFinderVectors.cxx AliCaloFitSubarray.cxx AliCaloRawAnalyzer.cxx AliCaloBunchInfo.cxx AliCaloFitResults.cxx AliCaloFastAltroFitv0.cxx SMcalib/AliEMCALCCUSBRawStream.cxx ) +set ( SRCS AliCaloRawAnalyzerFastFit.cxx AliCaloRawAnalyzerPeakFinder.cxx AliCaloRawAnalyzerFakeALTRO.cxx AliCaloRawAnalyzerKStandard.cxx AliCaloRawAnalyzerNN.cxx AliCaloRawAnalyzerFitter.cxx AliCaloRawAnalyzerCrude.cxx AliCaloRawAnalyzerFactory.cxx AliEMCALRawResponse.cxx AliCaloNeuralFit.cxx AliCaloPeakFinderVectors.cxx AliCaloFitSubarray.cxx AliCaloRawAnalyzer.cxx AliCaloBunchInfo.cxx AliCaloFitResults.cxx AliCaloFastAltroFitv0.cxx SMcalib/AliEMCALCCUSBRawStream.cxx ) string (REPLACE ".cxx" ".h" HDRS "${SRCS}") diff --git a/EMCAL/EMCALrawLinkDef.h b/EMCAL/EMCALrawLinkDef.h index 50c6c0dd094..a2c74389727 100644 --- a/EMCAL/EMCALrawLinkDef.h +++ b/EMCAL/EMCALrawLinkDef.h @@ -19,6 +19,7 @@ #pragma link C++ class AliCaloRawAnalyzerFakeALTRO+; #pragma link C++ class AliEMCALCCUSBRawStream+; #pragma link C++ class AliCaloFastAltroFitv0+; +#pragma link C++ class AliEMCALRawResponse+; #endif -- 2.43.0