From: coppedis Date: Thu, 5 Jun 2008 07:31:14 +0000 (+0000) Subject: AliZDCRecoParam class implemented X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=7bff376657fb784d02d203615fa7f557a518de2a AliZDCRecoParam class implemented --- diff --git a/ZDC/AliZDC.cxx b/ZDC/AliZDC.cxx index 5908f68ffb4..6ee09dd5ce4 100644 --- a/ZDC/AliZDC.cxx +++ b/ZDC/AliZDC.cxx @@ -51,7 +51,6 @@ #include "AliZDCRawStream.h" #include "AliZDCPedestals.h" #include "AliZDCCalib.h" -#include "AliZDCRecParam.h" #include "AliFstream.h" @@ -63,7 +62,6 @@ AliZDC::AliZDC() : fNoShower(0), fPedCalib(0), fCalibData(0), - fRecParam(0), fZDCCalibFName("") { // @@ -84,7 +82,6 @@ AliZDC::AliZDC(const char *name, const char *title) : fNoShower (0), fPedCalib(0), fCalibData(0), - fRecParam(0), fZDCCalibFName("") { // @@ -116,7 +113,6 @@ AliZDC::~AliZDC() fIshunt = 0; delete fPedCalib; delete fCalibData; - delete fRecParam; } @@ -126,7 +122,6 @@ AliDetector("ZDC","ZDC"), fNoShower(ZDC.fNoShower), fPedCalib(ZDC.fPedCalib), fCalibData(ZDC.fCalibData), -fRecParam(ZDC.fRecParam), fZDCCalibFName(ZDC.fZDCCalibFName) { // copy constructor @@ -140,7 +135,6 @@ AliZDC& AliZDC::operator=(const AliZDC& ZDC) fNoShower = ZDC.fNoShower; fPedCalib = ZDC.fPedCalib; fCalibData = ZDC.fCalibData; - fRecParam = ZDC.fRecParam; fZDCCalibFName = ZDC.fZDCCalibFName; } return *this; } diff --git a/ZDC/AliZDC.h b/ZDC/AliZDC.h index 3494becfe8f..bbd1dc218c1 100644 --- a/ZDC/AliZDC.h +++ b/ZDC/AliZDC.h @@ -16,7 +16,6 @@ class AliZDCPedestals; class AliZDCCalib; -class AliZDCRecParam; class AliZDC : public AliDetector { @@ -53,7 +52,6 @@ public: char* GetZDCCalibFName() const {return (char*)fZDCCalibFName.Data();} AliZDCPedestals* GetPedCalib() const {return fPedCalib;} AliZDCCalib* GetECalibData() const {return fCalibData;} - AliZDCRecParam* GetRecParams() const {return fRecParam;} // Trigger virtual AliTriggerDetector* CreateTriggerDetector() const @@ -70,10 +68,10 @@ protected: //Calibration data member AliZDCPedestals* fPedCalib; // Pedestal data for ZDC AliZDCCalib* fCalibData; // Energy and equalization data for ZDC - AliZDCRecParam* fRecParam; // Parameters for reconstruction for ZDC + TString fZDCCalibFName; // Name of the ZDC calibration data - ClassDef(AliZDC,6) // Zero Degree Calorimeter base class + ClassDef(AliZDC,7) // Zero Degree Calorimeter base class }; // Calibration diff --git a/ZDC/AliZDCDigitizer.cxx b/ZDC/AliZDCDigitizer.cxx index 1b945e1854f..e9bc2aa0e0e 100644 --- a/ZDC/AliZDCDigitizer.cxx +++ b/ZDC/AliZDCDigitizer.cxx @@ -46,7 +46,6 @@ class AliCDBStorage; class AliZDCPedestals; class AliZDCCalib; -class AliZDCRecParam; ClassImp(AliZDCDigitizer) @@ -55,8 +54,7 @@ ClassImp(AliZDCDigitizer) AliZDCDigitizer::AliZDCDigitizer() : fIsCalibration(0), fPedData(0), - fCalibData(0), - fRecParam(0) + fCalibData(0) { // Default constructor @@ -67,8 +65,7 @@ AliZDCDigitizer::AliZDCDigitizer(AliRunDigitizer* manager): AliDigitizer(manager), fIsCalibration(0), //By default the simulation doesn't create calib. data fPedData(GetPedData()), - fCalibData(GetCalibData()), - fRecParam(GetRecParam()) + fCalibData(GetCalibData()) { // Get calibration data if(fIsCalibration!=0) printf("\n\t AliZDCDigitizer -> Creating calibration data (pedestals)\n"); @@ -88,8 +85,7 @@ AliZDCDigitizer::AliZDCDigitizer(const AliZDCDigitizer &digitizer): AliDigitizer(), fIsCalibration(digitizer.fIsCalibration), fPedData(digitizer.fPedData), - fCalibData(digitizer.fCalibData), - fRecParam(digitizer.fRecParam) + fCalibData(digitizer.fCalibData) { // Copy constructor @@ -517,19 +513,3 @@ AliZDCCalib* AliZDCDigitizer::GetCalibData() const return calibdata; } - -//_____________________________________________________________________________ -AliZDCRecParam* AliZDCDigitizer::GetRecParam() const -{ - - // Getting calibration object for ZDC set - - AliCDBEntry *entry = AliCDBManager::Instance()->Get("ZDC/Calib/RecParam"); - if(!entry) AliFatal("No calibration data loaded!"); - - AliZDCRecParam *calibdata = dynamic_cast (entry->GetObject()); - if(!calibdata) AliFatal("Wrong calibration object in calibration file!"); - - return calibdata; -} - diff --git a/ZDC/AliZDCDigitizer.h b/ZDC/AliZDCDigitizer.h index fd6221f2ea4..2b57d5de3a4 100644 --- a/ZDC/AliZDCDigitizer.h +++ b/ZDC/AliZDCDigitizer.h @@ -14,7 +14,6 @@ #include "AliCDBStorage.h" #include "AliZDCPedestals.h" #include "AliZDCCalib.h" -#include "AliZDCRecParam.h" class AliRunDigitizer; @@ -48,7 +47,6 @@ public: AliCDBStorage *SetStorage(const char* uri); AliZDCPedestals *GetPedData() const; AliZDCCalib *GetCalibData() const; - AliZDCRecParam *GetRecParam() const; private: @@ -71,8 +69,7 @@ private: AliZDCPedestals *fPedData; //! pedestal calibration data AliZDCCalib *fCalibData; //! energy and equalization calibration data - AliZDCRecParam *fRecParam; //! parameters used in reconstruction - ClassDef(AliZDCDigitizer, 6) // digitizer for ZDC + ClassDef(AliZDCDigitizer, 7) // digitizer for ZDC }; #endif diff --git a/ZDC/AliZDCPreprocessor.cxx b/ZDC/AliZDCPreprocessor.cxx index 1c6d7324219..299a0202b6b 100644 --- a/ZDC/AliZDCPreprocessor.cxx +++ b/ZDC/AliZDCPreprocessor.cxx @@ -16,7 +16,6 @@ #include "AliZDCDataDCS.h" #include "AliZDCPedestals.h" #include "AliZDCCalib.h" -#include "AliZDCRecParam.h" ///////////////////////////////////////////////////////////////////// // // @@ -285,68 +284,6 @@ else if(runType=="STANDALONE_EMD"){ resECal = Store("Calib","Calib",eCalib, &metaData, 0, 1); } } -// ******************************************************** -// [c] PHYSICS RUNS -> Parameters needed for reconstruction -// NB -> ONLY IN Pb-Pb!!!!!!! -// ******************************************************** -else if((runType=="PHYSICS") && (strcmp(beamType,"Pb-Pb")==0)){ - TList* daqSources = GetFileSources(kDAQ, "PHYSICS"); - if(!daqSources){ - AliError(Form("No sources for PHYSICS run %d !", fRun)); - return 1; - } - Log("\t List of sources for PHYSICS"); - daqSources->Print(); - // - TIter iter2(daqSources); - TObjString* source = 0; - Int_t i=0; - while((source = dynamic_cast (iter2.Next()))){ - Log(Form("\n\t Getting file #%d\n",++i)); - TString stringPHYSFileName = GetFile(kDAQ, "PHYSICS", source->GetName()); - if(stringPHYSFileName.Length() <= 0){ - Log(Form("No PHYSICS file from source %s!", source->GetName())); - return 1; - } - // --- Initializing pedestal calibration object - AliZDCRecParam *recCalib = new AliZDCRecParam("ZDC"); - // --- Reading file with pedestal calibration data - const char* physFileName = stringPHYSFileName.Data(); - if(physFileName){ - FILE *file; - if((file = fopen(physFileName,"r")) == NULL){ - printf("Cannot open file %s \n",physFileName); - return 1; - } - Log(Form("File %s connected to process data from PHYSICS runs", physFileName)); - // - Float_t physRecParam[10]; - for(Int_t j=0; j<10; j++) fscanf(file,"%f",&physRecParam[j]); - recCalib->SetZEMEndValue(physRecParam[0]); - recCalib->SetZEMCutFraction(physRecParam[1]); - recCalib->SetDZEMSup(physRecParam[2]); - recCalib->SetDZEMInf(physRecParam[3]); - recCalib->SetEZN1MaxValue(physRecParam[4]); - recCalib->SetEZP1MaxValue(physRecParam[5]); - recCalib->SetEZDC1MaxValue(physRecParam[6]); - recCalib->SetEZN2MaxValue(physRecParam[7]); - recCalib->SetEZP2MaxValue(physRecParam[8]); - recCalib->SetEZDC2MaxValue(physRecParam[9]); - } - else{ - Log(Form("File %s not found", physFileName)); - return 1; - } - //calibdata->Print(""); - // - AliCDBMetaData metaData; - metaData.SetBeamPeriod(0); - metaData.SetResponsible("Chiara"); - metaData.SetComment("Filling AliZDCCalib object"); - // - resRecPar = Store("Calib","RecParam",recCalib, &metaData, 0, 1); - } -} else { Log(Form("Nothing to do: run type is %s", runType.Data())); return 0; diff --git a/ZDC/AliZDCRawStream.h b/ZDC/AliZDCRawStream.h index 23af45d43dc..b8982bc9bb8 100644 --- a/ZDC/AliZDCRawStream.h +++ b/ZDC/AliZDCRawStream.h @@ -22,13 +22,13 @@ class AliZDCRawStream: public TObject { virtual ~AliZDCRawStream(); virtual Bool_t Next(); - UInt_t GetADCRaw() const {return fRawADC;}; - Int_t GetSector(Int_t i) const {return fSector[i];}; - Int_t GetADCModule() const {return fADCModule;}; - Int_t GetADCChannel() const {return fADCChannel;}; - Int_t GetADCValue() const {return fADCValue;}; - Int_t GetADCGain() const {return fADCGain;}; - Bool_t IsADCDataWord() const {return fIsADCDataWord;}; + UInt_t GetADCRaw() const {return fRawADC;}; + Int_t GetSector(Int_t i) const {return fSector[i];}; + Int_t GetADCModule() const {return fADCModule;}; + Int_t GetADCChannel() const {return fADCChannel;}; + Int_t GetADCValue() const {return fADCValue;}; + Int_t GetADCGain() const {return fADCGain;}; + Bool_t IsADCDataWord() const {return fIsADCDataWord;}; enum EZDCRawStreamError { kInvalidADCModule = 1 diff --git a/ZDC/AliZDCRecoParam.cxx b/ZDC/AliZDCRecoParam.cxx new file mode 100644 index 00000000000..6bff2a6d95f --- /dev/null +++ b/ZDC/AliZDCRecoParam.cxx @@ -0,0 +1,42 @@ +/************************************************************************** + * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * 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. * + **************************************************************************/ + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class with ZDC reconstruction parameters // +// Origin: Chiara.Oppedisano@to.infn.it // +// // +/////////////////////////////////////////////////////////////////////////////// + + +//#include +#include "AliZDCRecoParam.h" + +ClassImp(AliZDCRecoParam) + +//_____________________________________________________________________________ +AliZDCRecoParam::AliZDCRecoParam() : + AliDetectorRecoParam(), + fBeamEnergy(0) +{ + // + //Default constructor +} +//_____________________________________________________________________________ +AliZDCRecoParam::~AliZDCRecoParam() +{ + // destructor + +} diff --git a/ZDC/AliZDCRecoParam.h b/ZDC/AliZDCRecoParam.h new file mode 100644 index 00000000000..f2abad83853 --- /dev/null +++ b/ZDC/AliZDCRecoParam.h @@ -0,0 +1,64 @@ +#ifndef ALIZDCRECOPARAM_H +#define ALIZDCRECOPARAM_H +/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +////////////////////////////////////////////////////////// +// // +// Class with ZDC reconstruction parameters // +// Origin: Chiara.Oppedisano@to.infn.it // +// // +////////////////////////////////////////////////////////// + +#include +#include "AliDetectorRecoParam.h" + +//class TF1; + +class AliZDCRecoParam : public AliDetectorRecoParam { + public: + AliZDCRecoParam(); + virtual ~AliZDCRecoParam(); + + Float_t GetBeamEnergy() const {return fBeamEnergy;} + virtual void SetBeamEnergy(Float_t beamE) {fBeamEnergy = beamE;} + // + virtual TF1* GetfZNCen() const =0; + virtual TF1* GetfZNPer() const =0; + virtual TF1* GetfZPCen() const =0; + virtual TF1* GetfZPPer() const =0; + virtual TF1* GetfZDCCen() const =0; + virtual TF1* GetfZDCPer() const =0; + virtual TF1* GetfbCen() const =0; + virtual TF1* GetfbPer() const =0; + virtual TF1* GetfZEMn() const =0; + virtual TF1* GetfZEMp() const =0; + virtual TF1* GetfZEMsp() const =0; + virtual TF1* GetfZEMb() const =0; + // + virtual Float_t GetZEMEndValue() const =0; + virtual Float_t GetZEMCutFraction() const =0; + virtual Float_t GetDZEMSup() const =0; + virtual Float_t GetDZEMInf() const =0; + virtual Float_t GetEZN1MaxValue() const =0; + virtual Float_t GetEZP1MaxValue() const =0; + virtual Float_t GetEZDC1MaxValue() const =0; + virtual Float_t GetEZN2MaxValue() const =0; + virtual Float_t GetEZP2MaxValue() const =0; + virtual Float_t GetEZDC2MaxValue() const =0; + + + virtual void PrintParameters() const {} + + protected: + + AliZDCRecoParam(const AliZDCRecoParam&); + AliZDCRecoParam& operator =(const AliZDCRecoParam&); + + Float_t fBeamEnergy;// beam energy + + ClassDef(AliZDCRecoParam, 1) + +}; + +#endif diff --git a/ZDC/AliZDCRecoParamPbPb.cxx b/ZDC/AliZDCRecoParamPbPb.cxx new file mode 100644 index 00000000000..e7cbb9979dc --- /dev/null +++ b/ZDC/AliZDCRecoParamPbPb.cxx @@ -0,0 +1,149 @@ +/************************************************************************** + * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * 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. * + **************************************************************************/ + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class with ZDC reconstruction parameters // +// Origin: Chiara.Oppedisano@to.infn.it // +// // +/////////////////////////////////////////////////////////////////////////////// + + +//#include +#include "AliZDCRecoParam.h" +#include "AliZDCRecoParamPbPb.h" + +ClassImp(AliZDCRecoParamPbPb) + +//_____________________________________________________________________________ +AliZDCRecoParamPbPb::AliZDCRecoParamPbPb() : + AliZDCRecoParam(), + fZNCen(0), + fZNPer(0), + fZPCen(0), + fZPPer(0), + fZDCCen(0), + fZDCPer(0), + fbCen(0), + fbPer(0), + fZEMn(0), + fZEMp(0), + fZEMsp(0), + fZEMb(0), + fZEMEndValue(0), + fZEMCutFraction(0), + fDZEMSup(0), + fDZEMInf(0), + fEZN1MaxValue(0), + fEZP1MaxValue(0), + fEZDC1MaxValue(0), + fEZN2MaxValue(0), + fEZP2MaxValue(0), + fEZDC2MaxValue(0) +{ + // + //Default constructor +} +//_____________________________________________________________________________ +AliZDCRecoParamPbPb::~AliZDCRecoParamPbPb() +{ +// destructor + + delete fZNCen; + delete fZNPer; + delete fZPCen; + delete fZPPer; + delete fZDCCen; + delete fZDCPer; + delete fbCen; + delete fbPer; + delete fZEMn; + delete fZEMp; + delete fZEMsp; + delete fZEMb; + +} + +//_____________________________________________________________________________ +AliZDCRecoParamPbPb *AliZDCRecoParamPbPb::GetPbPbRecoParam() +{ + // + // Makes default reconstruction parameters for low flux environment + // + AliZDCRecoParamPbPb *param = new AliZDCRecoParamPbPb(); + + param->SetfZNCen("(-2.287920+sqrt(2.287920*2.287920-4*(-0.007629)*(11.921710-x)))/(2*(-0.007629))",0.,164.); + param->SetfZNPer("(-37.812280-sqrt(37.812280*37.812280-4*(-0.190932)*(-1709.249672-x)))/(2*(-0.190932))",0.,164.); + param->SetfZPCen("(-1.321353+sqrt(1.321353*1.321353-4*(-0.007283)*(3.550697-x)))/(2*(-0.007283))",0.,60.); + param->SetfZPPer("(-42.643308-sqrt(42.643308*42.643308-4*(-0.310786)*(-1402.945615-x)))/(2*(-0.310786))",0.,60.); + param->SetfZDCCen("(-1.934991+sqrt(1.934991*1.934991-4*(-0.004080)*(15.111124-x)))/(2*(-0.004080))",0.,225.); + param->SetfZDCPer("(-34.380639-sqrt(34.380639*34.380639-4*(-0.104251)*(-2612.189017-x)))/(2*(-0.104251))",0.,225.); + param->SetfbCen("-0.056923+0.079703*x-0.0004301*x*x+0.000001366*x*x*x",0.,220.); + param->SetfbPer("17.943998-0.046846*x+0.000074*x*x",0.,220.); + param->SetfZEMn("121.7-0.1934*x+0.00007565*x*x",0.,1200.); + param->SetfZEMp("80.05-0.1315*x+0.00005327*x*x",0.,1200.); + param->SetfZEMsp("201.7-0.325*x+0.0001292*x*x",0.,1200.); + param->SetfZEMb("13.83-0.02851*x+5.101e-5*x*x-7.305e-8*x*x*x+5.101e-11*x*x*x*x-1.25e-14*x*x*x*x*x",0.,1200.); + + param->SetZEMEndValue(1200.); + param->SetZEMCutFraction(0.1); + param->SetDZEMSup(0.04); + param->SetDZEMInf(0.05); + param->SetEZN1MaxValue(161.); + param->SetEZP1MaxValue(59.); + param->SetEZDC1MaxValue(220.); + param->SetEZN2MaxValue(161.); + param->SetEZP2MaxValue(59.); + param->SetEZDC2MaxValue(161.); + // + param->SetBeamEnergy(2.7); + + return param; + +} + +//_____________________________________________________________________________ +void AliZDCRecoParamPbPb::PrintParameters() const +{ + // + // print reconstruction parameters + // + printf("\n\n\t AliZDCRecoParamPbPb -> parameters set for reconstruction\n"); + printf("\t Beam energy (for Pb-Pb): %1.2f TeV\n",fBeamEnergy); + printf("\t Functions for reconstruction of centrality varibles (Pb-Pb):\n"); + + fZNCen->Print(""); + fZNPer->Print(""); + fZPCen->Print(""); + fZPPer->Print(""); + fZDCCen->Print(""); + fZDCPer->Print(""); + fbCen->Print(""); + fbPer->Print(""); + fZEMn->Print(""); + fZEMp->Print(""); + fZEMsp->Print(""); + fZEMb->Print(""); + + printf("\n ####### Parameters from EZDC vs. ZEM correlation ####### \n"); + printf("\tZEMEndPoint = %1.2f, ZEMCutFraction = %1.2f \n" + " DZEMInf = %1.2f, DZEMSup = %1.2f\n", + fZEMEndValue, fZEMCutFraction, fDZEMInf, fDZEMSup); + printf("\n ####### Parameters from EZDC vs. Nspec correlation ####### \n"); + printf("\tEZN1MaxValue = %1.2f, EZP1MaxValue = %1.2f, EZDC1MaxValue = %1.2f \n" + "\tEZN2MaxValue = %1.2f, EZP2MaxValue = %1.2f, EZDC2MaxValue = %1.2f \n\n", + fEZN1MaxValue, fEZP1MaxValue, fEZDC1MaxValue, + fEZN2MaxValue, fEZP2MaxValue, fEZDC2MaxValue); +} diff --git a/ZDC/AliZDCRecoParamPbPb.h b/ZDC/AliZDCRecoParamPbPb.h new file mode 100644 index 00000000000..933bff25ffd --- /dev/null +++ b/ZDC/AliZDCRecoParamPbPb.h @@ -0,0 +1,128 @@ +#ifndef ALIZDCRECOPARAMPBPB_H +#define ALIZDCRECOPARAMPBPB_H +/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +////////////////////////////////////////////////////////// +// // +// Class with ZDC reconstruction parameters // +// Pb - Pb collisions // +// Origin: Chiara.Oppedisano@to.infn.it // +// // +////////////////////////////////////////////////////////// + +#include +#include "AliZDCRecoParam.h" +#include "AliZDCRecoParamPbPb.h" + +//class TF1; + +class AliZDCRecoParamPbPb : public AliZDCRecoParam { + public: + AliZDCRecoParamPbPb(); + virtual ~AliZDCRecoParamPbPb(); + + // make reco parameters for Pb-Pb collisions + static AliZDCRecoParamPbPb *GetPbPbRecoParam(); + + TF1* GetfZNCen() const {return fZNCen;} + TF1* GetfZNPer() const {return fZNPer;} + TF1* GetfZPCen() const {return fZPCen;} + TF1* GetfZPPer() const {return fZPPer;} + TF1* GetfZDCCen() const {return fZDCCen;} + TF1* GetfZDCPer() const {return fZDCPer;} + TF1* GetfbCen() const {return fbCen;} + TF1* GetfbPer() const {return fbPer;} + TF1* GetfZEMn() const {return fZEMn;} + TF1* GetfZEMp() const {return fZEMp;} + TF1* GetfZEMsp() const {return fZEMsp;} + TF1* GetfZEMb() const {return fZEMb;} + + void SetfZNCen(const char* formula, Double_t xmin, Double_t xmax) + {fZNCen = new TF1("fZNCen", formula, xmin, xmax);} + void SetfZNPer(const char* formula, Double_t xmin, Double_t xmax) + {fZNPer = new TF1("fZNPer", formula, xmin, xmax);} + void SetfZPCen(const char* formula, Double_t xmin, Double_t xmax) + {fZPCen = new TF1("fZPCen", formula, xmin, xmax);} + void SetfZPPer(const char* formula, Double_t xmin, Double_t xmax) + {fZPPer = new TF1("fZPPer", formula, xmin, xmax);} + void SetfZDCCen(const char* formula, Double_t xmin, Double_t xmax) + {fZDCCen = new TF1("fZDCCen", formula, xmin, xmax);} + void SetfZDCPer(const char* formula, Double_t xmin, Double_t xmax) + {fZDCPer = new TF1("fZDCPer", formula, xmin, xmax);} + void SetfbCen(const char* formula, Double_t xmin, Double_t xmax) + {fbCen = new TF1("fbCen", formula, xmin, xmax);} + void SetfbPer(const char* formula, Double_t xmin, Double_t xmax) + {fbPer = new TF1("fbPer", formula, xmin, xmax);} + void SetfZEMn(const char* formula, Double_t xmin, Double_t xmax) + {fZEMn = new TF1("fZEMn", formula, xmin, xmax);} + void SetfZEMp(const char* formula, Double_t xmin, Double_t xmax) + {fZEMp = new TF1("fZEMp", formula, xmin, xmax);} + void SetfZEMsp(const char* formula, Double_t xmin, Double_t xmax) + {fZEMsp = new TF1("fZEMsp", formula, xmin, xmax);} + void SetfZEMb(const char* formula, Double_t xmin, Double_t xmax) + {fZEMb = new TF1("fZEMb", formula, xmin, xmax);} + + Float_t GetZEMEndValue() const {return fZEMEndValue;} + Float_t GetZEMCutFraction() const {return fZEMCutFraction;} + Float_t GetDZEMSup() const {return fDZEMSup;} + Float_t GetDZEMInf() const {return fDZEMInf;} + // + Float_t GetEZN1MaxValue() const {return fEZN1MaxValue;} + Float_t GetEZP1MaxValue() const {return fEZP1MaxValue;} + Float_t GetEZDC1MaxValue() const {return fEZDC1MaxValue;} + Float_t GetEZN2MaxValue() const {return fEZN2MaxValue;} + Float_t GetEZP2MaxValue() const {return fEZP2MaxValue;} + Float_t GetEZDC2MaxValue() const {return fEZDC2MaxValue;} + + void SetZEMEndValue(Float_t ZEMEndValue) {fZEMEndValue = ZEMEndValue;} + void SetZEMCutFraction(Float_t ZEMCutFraction) {fZEMCutFraction = ZEMCutFraction;} + void SetDZEMSup(Float_t DZEMSup) {fDZEMSup = DZEMSup;} + void SetDZEMInf(Float_t DZEMInf) {fDZEMInf = DZEMInf;} + // + void SetEZN1MaxValue(Float_t value) {fEZN1MaxValue = value;} + void SetEZP1MaxValue(Float_t value) {fEZP1MaxValue = value;} + void SetEZDC1MaxValue(Float_t value) {fEZDC1MaxValue = value;} + void SetEZN2MaxValue(Float_t value) {fEZN2MaxValue = value;} + void SetEZP2MaxValue(Float_t value) {fEZP2MaxValue = value;} + void SetEZDC2MaxValue(Float_t value) {fEZDC2MaxValue = value;} + + void PrintParameters() const; + + protected: + + AliZDCRecoParamPbPb(const AliZDCRecoParamPbPb&); + AliZDCRecoParamPbPb& operator =(const AliZDCRecoParamPbPb&); + + // *** PARAMETERS FOR Pb-Pb COLLISIONS + // --- Functions to evaluate centrality variables from defined functions + TF1* fZNCen; //! Nspectator n true vs. EZN + TF1* fZNPer; //! Nspectator n true vs. EZN + TF1* fZPCen; //! Nspectator p true vs. EZP + TF1* fZPPer; //! Nspectator p true vs. EZP + TF1* fZDCCen; //! Nspectators true vs. EZDC + TF1* fZDCPer; //! Nspectators true vs. EZDC + TF1* fbCen; //! b vs. EZDC + TF1* fbPer; //! b vs. EZDC + TF1* fZEMn; //! Nspectators n from ZEM energy + TF1* fZEMp; //! Nspectators p from ZEM energy + TF1* fZEMsp; //! Nspectators from ZEM energy + TF1* fZEMb; //! b from ZEM energy + // --- Coefficients for centrality selection from ZEM signal + Float_t fZEMEndValue; // End point value of ZEM energy spectrum + Float_t fZEMCutFraction; // Fraction of ZEM energy spectrum used to cut + Float_t fDZEMSup;// Upper value of EZDCvs.ZEM correlation where ZEM signal is used + Float_t fDZEMInf;// Lower value of EZDCvs.ZEM correlation where ZEM signal is used + // --- Parameters from EZDC vs. Nspec correlation + Float_t fEZN1MaxValue; // Max value of ZN1 vs. Nspec n correlation + Float_t fEZP1MaxValue; // Max value of ZP1 vs. Nspec p correlation + Float_t fEZDC1MaxValue; // Max value of ZDC1 vs. Nspec n+p correlation + Float_t fEZN2MaxValue; // Max value of ZN2 vs. Nspec n correlation + Float_t fEZP2MaxValue; // Max value of ZP2 vs. Nspec p correlation + Float_t fEZDC2MaxValue; // Max value of ZDC2 vs. Nspec n+p correlation + + ClassDef(AliZDCRecoParamPbPb, 1) + +}; + +#endif diff --git a/ZDC/AliZDCRecoParampp.cxx b/ZDC/AliZDCRecoParampp.cxx new file mode 100644 index 00000000000..bdf005fd1d6 --- /dev/null +++ b/ZDC/AliZDCRecoParampp.cxx @@ -0,0 +1,64 @@ +/************************************************************************** + * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * 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. * + **************************************************************************/ + +/////////////////////////////////////////////////////////////////////////////// +// // +// Class with ZDC reconstruction parameters // +// Origin: Chiara.Oppedisano@to.infn.it // +// // +/////////////////////////////////////////////////////////////////////////////// + + +//#include +#include "AliZDCRecoParampp.h" + +ClassImp(AliZDCRecoParampp) + +//_____________________________________________________________________________ +AliZDCRecoParampp::AliZDCRecoParampp() : + AliZDCRecoParam() +{ + // + //Default constructor +} +//_____________________________________________________________________________ +AliZDCRecoParampp::~AliZDCRecoParampp() +{ +// destructor +} + +//_____________________________________________________________________________ +AliZDCRecoParampp *AliZDCRecoParampp::GetppRecoParam() +{ + // + // Makes default reconstruction parameters for low flux environment + // + AliZDCRecoParampp *param = new AliZDCRecoParampp(); + // + param->SetBeamEnergy(7.); + + return param; + +} + +//_____________________________________________________________________________ +void AliZDCRecoParampp::PrintParameters() const +{ + // + // print reconstruction parameters + // + printf("\n\n\t AliZDCRecoParampp -> parameters set for reconstruction\n"); + printf("\t p-p -> beam E : %1.2f TeV\n\n",fBeamEnergy); +} diff --git a/ZDC/AliZDCRecoParampp.h b/ZDC/AliZDCRecoParampp.h new file mode 100644 index 00000000000..6faf5e54521 --- /dev/null +++ b/ZDC/AliZDCRecoParampp.h @@ -0,0 +1,63 @@ +#ifndef ALIZDCRECOPARAMPP_H +#define ALIZDCRECOPARAMPP_H +/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +////////////////////////////////////////////////////////// +// // +// Class with ZDC reconstruction parameters // +// proton - ptoron collisions // +// Origin: Chiara.Oppedisano@to.infn.it // +// // +////////////////////////////////////////////////////////// + +#include +#include "AliLog.h" +#include "AliZDCRecoParam.h" + +//class TF1; + +class AliZDCRecoParampp : public AliZDCRecoParam { + public: + AliZDCRecoParampp(); + virtual ~AliZDCRecoParampp(); + + // make reco parameters for p-p collisions + static AliZDCRecoParampp *GetppRecoParam(); + + void PrintParameters() const; + + virtual TF1* GetfZNCen() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfZNPer() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfZPCen() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfZPPer() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfZDCCen() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfZDCPer() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfbCen() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfbPer() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfZEMn() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfZEMp() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfZEMsp() const {AliError("NO function can be defined in pp!"); return 0;} + virtual TF1* GetfZEMb() const {AliError("NO function can be defined in pp!"); return 0;} + // + virtual Float_t GetZEMEndValue() const {AliError("NO function can be defined in pp!"); return 0;} + virtual Float_t GetZEMCutFraction() const {AliError("NO function can be defined in pp!"); return 0;} + virtual Float_t GetDZEMSup() const {AliError("NO function can be defined in pp!"); return 0;} + virtual Float_t GetDZEMInf() const {AliError("NO function can be defined in pp!"); return 0;} + virtual Float_t GetEZN1MaxValue() const {AliError("NO function can be defined in pp!"); return 0;} + virtual Float_t GetEZP1MaxValue() const {AliError("NO function can be defined in pp!"); return 0;} + virtual Float_t GetEZDC1MaxValue() const {AliError("NO function can be defined in pp!"); return 0;} + virtual Float_t GetEZN2MaxValue() const {AliError("NO function can be defined in pp!"); return 0;} + virtual Float_t GetEZP2MaxValue() const {AliError("NO function can be defined in pp!"); return 0;} + virtual Float_t GetEZDC2MaxValue() const {AliError("NO function can be defined in pp!"); return 0;} + + protected: + + AliZDCRecoParampp(const AliZDCRecoParampp&); + AliZDCRecoParampp& operator =(const AliZDCRecoParampp&); + + ClassDef(AliZDCRecoParampp, 1) + +}; + +#endif diff --git a/ZDC/AliZDCReconstructor.cxx b/ZDC/AliZDCReconstructor.cxx index c93843440ef..33efa0b4790 100644 --- a/ZDC/AliZDCReconstructor.cxx +++ b/ZDC/AliZDCReconstructor.cxx @@ -34,39 +34,18 @@ #include "AliZDCReconstructor.h" #include "AliZDCPedestals.h" #include "AliZDCCalib.h" -#include "AliZDCRecParam.h" +#include "AliZDCRecoParam.h" +#include "AliZDCRecoParampp.h" +#include "AliZDCRecoParamPbPb.h" ClassImp(AliZDCReconstructor) - +AliZDCRecoParam *AliZDCReconstructor::fRecoParam=0; //reconstruction parameters //_____________________________________________________________________________ AliZDCReconstructor:: AliZDCReconstructor() : - - fZNCen(new TF1("fZNCen", - "(-2.287920+sqrt(2.287920*2.287920-4*(-0.007629)*(11.921710-x)))/(2*(-0.007629))",0.,164.)), - fZNPer(new TF1("fZNPer", - "(-37.812280-sqrt(37.812280*37.812280-4*(-0.190932)*(-1709.249672-x)))/(2*(-0.190932))",0.,164.)), - fZPCen(new TF1("fZPCen", - "(-1.321353+sqrt(1.321353*1.321353-4*(-0.007283)*(3.550697-x)))/(2*(-0.007283))",0.,60.)), - fZPPer(new TF1("fZPPer", - "(-42.643308-sqrt(42.643308*42.643308-4*(-0.310786)*(-1402.945615-x)))/(2*(-0.310786))",0.,60.)), - fZDCCen(new TF1("fZDCCen", - "(-1.934991+sqrt(1.934991*1.934991-4*(-0.004080)*(15.111124-x)))/(2*(-0.004080))",0.,225.)), - fZDCPer(new TF1("fZDCPer", - "(-34.380639-sqrt(34.380639*34.380639-4*(-0.104251)*(-2612.189017-x)))/(2*(-0.104251))",0.,225.)), - fbCen(new TF1("fbCen","-0.056923+0.079703*x-0.0004301*x*x+0.000001366*x*x*x",0.,220.)), - fbPer(new TF1("fbPer","17.943998-0.046846*x+0.000074*x*x",0.,220.)), - // - fZEMn(new TF1("fZEMn","121.7-0.1934*x+0.00007565*x*x",0.,1200.)), - fZEMp(new TF1("fZEMp","80.05-0.1315*x+0.00005327*x*x",0.,1200.)), - fZEMsp(new TF1("fZEMsp","201.7-0.325*x+0.0001292*x*x",0.,1200.)), - fZEMb(new TF1("fZEMb", - "13.83-0.02851*x+5.101e-5*x*x-7.305e-8*x*x*x+5.101e-11*x*x*x*x-1.25e-14*x*x*x*x*x",0.,1200.)), - // fPedData(GetPedData()), - fECalibData(GetECalibData()), - fRecParam(GetRecParams()) + fECalibData(GetECalibData()) { // **** Default constructor @@ -77,23 +56,11 @@ AliZDCReconstructor:: AliZDCReconstructor() : AliZDCReconstructor::~AliZDCReconstructor() { // destructor - - delete fZNCen; - delete fZNPer; - delete fZPCen; - delete fZPPer; - delete fZDCCen; - delete fZDCPer; - delete fbCen; - delete fbPer; - delete fZEMn; - delete fZEMp; - delete fZEMsp; - delete fZEMb; - + if(fRecoParam) delete fRecoParam; + if(fPedData) delete fPedData; + if(fECalibData) delete fECalibData; } - //_____________________________________________________________________________ void AliZDCReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const { @@ -202,7 +169,7 @@ void AliZDCReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) co } // reconstruct the event - ReconstructEvent(clustersTree, tZN1Corr, tZP1Corr, tZN2Corr, tZP2Corr, + ReconstructEventpp(clustersTree, tZN1Corr, tZP1Corr, tZN2Corr, tZP2Corr, dZEM1Corr, dZEM2Corr, PMRef1, PMRef2); } @@ -218,7 +185,7 @@ void AliZDCReconstructor::Reconstruct(AliRawReader* rawReader, TTree* clustersTr for(Int_t jj=0; jj<48; jj++) meanPed[jj] = fPedData->GetMeanPed(jj); rawReader->Reset(); - + // loop over raw data Float_t tZN1Corr[10], tZP1Corr[10], tZN2Corr[10], tZP2Corr[10]; Float_t dZEM1Corr[2], dZEM2Corr[2], PMRef1[2], PMRef2[2]; @@ -286,13 +253,13 @@ void AliZDCReconstructor::Reconstruct(AliRawReader* rawReader, TTree* clustersTr } // reconstruct the event - ReconstructEvent(clustersTree, tZN1Corr, tZP1Corr, tZN2Corr, tZP2Corr, + ReconstructEventpp(clustersTree, tZN1Corr, tZP1Corr, tZN2Corr, tZP2Corr, dZEM1Corr, dZEM2Corr, PMRef1, PMRef2); } //_____________________________________________________________________________ -void AliZDCReconstructor::ReconstructEvent(TTree *clustersTree, Float_t* ZN1ADCCorr, +void AliZDCReconstructor::ReconstructEventpp(TTree *clustersTree, Float_t* ZN1ADCCorr, Float_t* ZP1ADCCorr, Float_t* ZN2ADCCorr, Float_t* ZP2ADCCorr, Float_t* ZEM1ADCCorr, Float_t* ZEM2ADCCorr, Float_t* PMRef1, Float_t* PMRef2) const { @@ -312,26 +279,103 @@ void AliZDCReconstructor::ReconstructEvent(TTree *clustersTree, Float_t* ZN1ADCC // --- Energy calibration factors ------------------------------------ Float_t calibEne[4]; for(Int_t ij=0; ij<4; ij++) calibEne[ij] = fECalibData->GetEnCalib(ij); + + // Equalization of detector responses + Float_t equalTowZN1[10], equalTowZN2[10], equalTowZP1[10], equalTowZP2[10]; + for(Int_t gi=0; gi<5; gi++){ + equalTowZN1[gi] = ZN1ADCCorr[gi]*equalCoeffZN1[gi]; + equalTowZN1[gi+5] = ZN1ADCCorr[gi+5]*equalCoeffZN1[gi]; + equalTowZP1[gi] = ZP1ADCCorr[gi]*equalCoeffZP1[gi]; + equalTowZP1[gi+5] = ZP1ADCCorr[gi+5]*equalCoeffZP1[gi]; + equalTowZN2[gi] = ZN2ADCCorr[gi]*equalCoeffZN2[gi]; + equalTowZN2[gi+5] = ZN2ADCCorr[gi+5]*equalCoeffZN2[gi]; + equalTowZP2[gi] = ZP2ADCCorr[gi]*equalCoeffZP2[gi]; + equalTowZP2[gi+5] = ZP2ADCCorr[gi+5]*equalCoeffZP2[gi]; + } + + // Energy calibration of detector responses + Float_t calibTowZN1[10], calibTowZN2[10], calibTowZP1[10], calibTowZP2[10]; + Float_t calibSumZN1[]={0,0}, calibSumZN2[]={0,0}, calibSumZP1[]={0,0}, calibSumZP2[]={0,0}; + for(Int_t gi=0; gi<10; gi++){ + calibTowZN1[gi] = equalTowZN1[gi]*calibEne[0]; + calibTowZP1[gi] = equalTowZP1[gi]*calibEne[1]; + calibTowZN2[gi] = equalTowZN2[gi]*calibEne[2]; + calibTowZP2[gi] = equalTowZP2[gi]*calibEne[3]; + // + if(gi<5){ + calibSumZN1[0] += calibTowZN1[gi]; + calibSumZP1[0] += calibTowZP1[gi]; + calibSumZN2[0] += calibTowZN2[gi]; + calibSumZP2[0] += calibTowZP2[gi]; + } + // + else{ + calibSumZN1[1] += calibTowZN1[gi]; + calibSumZP1[1] += calibTowZP1[gi]; + calibSumZN2[1] += calibTowZN2[gi]; + calibSumZP2[1] += calibTowZP2[gi]; + } + } + // - // --- Reconstruction parameters ------------------ - Float_t endPointZEM = fRecParam->GetZEMEndValue(); - Float_t cutFractionZEM = fRecParam->GetZEMCutFraction(); - Float_t dZEMSup = fRecParam->GetDZEMSup(); - Float_t dZEMInf = fRecParam->GetDZEMInf(); - // - Float_t cutValueZEM = endPointZEM*cutFractionZEM; - Float_t supValueZEM = cutValueZEM+(endPointZEM*dZEMSup); - Float_t infValueZEM = cutValueZEM-(endPointZEM*dZEMInf); - // - Float_t maxValEZN1 = fRecParam->GetEZN1MaxValue(); - Float_t maxValEZP1 = fRecParam->GetEZP1MaxValue(); - Float_t maxValEZDC1 = fRecParam->GetEZDC1MaxValue(); - Float_t maxValEZN2 = fRecParam->GetEZN2MaxValue(); - Float_t maxValEZP2 = fRecParam->GetEZP2MaxValue(); - Float_t maxValEZDC2 = fRecParam->GetEZDC2MaxValue(); + // --- Reconstruction parameters ------------------ + if(!fRecoParam) fRecoParam = (AliZDCRecoParampp*) AliZDCRecoParampp::GetppRecoParam(); + + // --- Number of detected spectator nucleons + // *** N.B. -> It works only in Pb-Pb + Int_t nDetSpecNLeft, nDetSpecPLeft, nDetSpecNRight, nDetSpecPRight; + Float_t beamE = fRecoParam->GetBeamEnergy(); + nDetSpecNLeft = (Int_t) (calibSumZN1[0]/beamE); + nDetSpecPLeft = (Int_t) (calibSumZP1[0]/beamE); + nDetSpecNRight = (Int_t) (calibSumZN2[0]/beamE); + nDetSpecPRight = (Int_t) (calibSumZP2[0]/beamE); + /*printf("\n\t AliZDCReconstructor -> nDetSpecNLeft %d, nDetSpecPLeft %d," + " nDetSpecNRight %d, nDetSpecPRight %d\n",nDetSpecNLeft, nDetSpecPLeft, + nDetSpecNRight, nDetSpecPRight);*/ + + // --- Number of generated spectator nucleons (from HIJING parameterization) + Int_t nGenSpecNLeft=0, nGenSpecPLeft=0, nGenSpecLeft=0; + Int_t nGenSpecNRight=0, nGenSpecPRight=0, nGenSpecRight=0; + Int_t nPartTotLeft=0, nPartTotRight=0; + Double_t impPar=0.; + + // create the output tree + AliZDCReco reco(calibSumZN1, calibSumZP1, calibSumZN2, calibSumZP2, + calibTowZN1, calibTowZN2, calibTowZP1, calibTowZP2, + ZEM1ADCCorr, ZEM2ADCCorr, PMRef1, PMRef2, + nDetSpecNLeft, nDetSpecPLeft, nDetSpecNRight, nDetSpecPRight, + nGenSpecNLeft, nGenSpecPLeft, nGenSpecLeft, nGenSpecNRight, + nGenSpecPRight, nGenSpecRight, nPartTotLeft, nPartTotRight, impPar); + + AliZDCReco* preco = &reco; + const Int_t kBufferSize = 4000; + clustersTree->Branch("ZDC", "AliZDCReco", &preco, kBufferSize); + + // write the output tree + clustersTree->Fill(); +} + +//_____________________________________________________________________________ +void AliZDCReconstructor::ReconstructEventPbPb(TTree *clustersTree, Float_t* ZN1ADCCorr, + Float_t* ZP1ADCCorr, Float_t* ZN2ADCCorr, Float_t* ZP2ADCCorr, + Float_t* ZEM1ADCCorr, Float_t* ZEM2ADCCorr, Float_t* PMRef1, Float_t* PMRef2) const +{ + // ***** Reconstruct one event + + // *** RECONSTRUCTION FROM "REAL" DATA // - //printf("\n\t AliZDCReconstructor -> ZEMEndPoint %1.0f, ZEMCutValue %1.0f," - // " ZEMSupValue %1.0f, ZEMInfValue %1.0f\n",endPointZEM,cutValueZEM,supValueZEM,infValueZEM); + // Retrieving calibration data + // --- Equalization coefficients --------------------------------------------- + Float_t equalCoeffZN1[5], equalCoeffZP1[5], equalCoeffZN2[5], equalCoeffZP2[5]; + for(Int_t ji=0; ji<5; ji++){ + equalCoeffZN1[ji] = fECalibData->GetZN1EqualCoeff(ji); + equalCoeffZP1[ji] = fECalibData->GetZP1EqualCoeff(ji); + equalCoeffZN2[ji] = fECalibData->GetZN2EqualCoeff(ji); + equalCoeffZP2[ji] = fECalibData->GetZP2EqualCoeff(ji); + } + // --- Energy calibration factors ------------------------------------ + Float_t calibEne[4]; + for(Int_t ij=0; ij<4; ij++) calibEne[ij] = fECalibData->GetEnCalib(ij); // Equalization of detector responses Float_t equalTowZN1[10], equalTowZN2[10], equalTowZP1[10], equalTowZP2[10]; @@ -369,14 +413,38 @@ void AliZDCReconstructor::ReconstructEvent(TTree *clustersTree, Float_t* ZN1ADCC calibSumZP2[1] += calibTowZP2[gi]; } } + + // + // --- Reconstruction parameters ------------------ + if(!fRecoParam) fRecoParam = (AliZDCRecoParamPbPb*) AliZDCRecoParamPbPb::GetPbPbRecoParam(); + // + Float_t endPointZEM = fRecoParam->GetZEMEndValue(); + Float_t cutFractionZEM = fRecoParam->GetZEMCutFraction(); + Float_t dZEMSup = fRecoParam->GetDZEMSup(); + Float_t dZEMInf = fRecoParam->GetDZEMInf(); + // + Float_t cutValueZEM = endPointZEM*cutFractionZEM; + Float_t supValueZEM = cutValueZEM+(endPointZEM*dZEMSup); + Float_t infValueZEM = cutValueZEM-(endPointZEM*dZEMInf); + // + Float_t maxValEZN1 = fRecoParam->GetEZN1MaxValue(); + Float_t maxValEZP1 = fRecoParam->GetEZP1MaxValue(); + Float_t maxValEZDC1 = fRecoParam->GetEZDC1MaxValue(); + Float_t maxValEZN2 = fRecoParam->GetEZN2MaxValue(); + Float_t maxValEZP2 = fRecoParam->GetEZP2MaxValue(); + Float_t maxValEZDC2 = fRecoParam->GetEZDC2MaxValue(); + // + //printf("\n\t AliZDCReconstructor -> ZEMEndPoint %1.0f, ZEMCutValue %1.0f," + // " ZEMSupValue %1.0f, ZEMInfValue %1.0f\n",endPointZEM,cutValueZEM,supValueZEM,infValueZEM); // --- Number of detected spectator nucleons // *** N.B. -> It works only in Pb-Pb Int_t nDetSpecNLeft, nDetSpecPLeft, nDetSpecNRight, nDetSpecPRight; - nDetSpecNLeft = (Int_t) (calibSumZN1[0]/2.760); - nDetSpecPLeft = (Int_t) (calibSumZP1[0]/2.760); - nDetSpecNRight = (Int_t) (calibSumZN2[0]/2.760); - nDetSpecPRight = (Int_t) (calibSumZP2[0]/2.760); + Float_t beamE = fRecoParam->GetBeamEnergy(); + nDetSpecNLeft = (Int_t) (calibSumZN1[0]/beamE); + nDetSpecPLeft = (Int_t) (calibSumZP1[0]/beamE); + nDetSpecNRight = (Int_t) (calibSumZN2[0]/beamE); + nDetSpecPRight = (Int_t) (calibSumZP2[0]/beamE); /*printf("\n\t AliZDCReconstructor -> nDetSpecNLeft %d, nDetSpecPLeft %d," " nDetSpecNRight %d, nDetSpecPRight %d\n",nDetSpecNLeft, nDetSpecPLeft, nDetSpecNRight, nDetSpecPRight);*/ @@ -386,40 +454,39 @@ void AliZDCReconstructor::ReconstructEvent(TTree *clustersTree, Float_t* ZN1ADCC Int_t nGenSpecNRight=0, nGenSpecPRight=0, nGenSpecRight=0; Double_t impPar=0.; // - // Float_t corrADCZEMHG = ZEM1ADCCorr[0] + ZEM2ADCCorr[0]; // if(corrADCZEMHG > supValueZEM){ - nGenSpecNLeft = (Int_t) (fZNCen->Eval(calibSumZN1[0])); - nGenSpecPLeft = (Int_t) (fZPCen->Eval(calibSumZP1[0])); - nGenSpecLeft = (Int_t) (fZDCCen->Eval(calibSumZN1[0]+calibSumZP1[0])); - nGenSpecNRight = (Int_t) (fZNCen->Eval(calibSumZN2[0])); - nGenSpecPRight = (Int_t) (fZNCen->Eval(calibSumZP2[0])); - nGenSpecRight = (Int_t) (fZNCen->Eval(calibSumZN2[0]+calibSumZP2[0])); - impPar = fbCen->Eval(calibSumZN1[0]+calibSumZP1[0]); + nGenSpecNLeft = (Int_t) ((fRecoParam->GetfZNCen())->Eval(calibSumZN1[0])); + nGenSpecPLeft = (Int_t) ((fRecoParam->GetfZPCen())->Eval(calibSumZP1[0])); + nGenSpecLeft = (Int_t) ((fRecoParam->GetfZDCCen())->Eval(calibSumZN1[0]+calibSumZP1[0])); + nGenSpecNRight = (Int_t) ((fRecoParam->GetfZNCen())->Eval(calibSumZN2[0])); + nGenSpecPRight = (Int_t) ((fRecoParam->GetfZNCen())->Eval(calibSumZP2[0])); + nGenSpecRight = (Int_t) ((fRecoParam->GetfZNCen())->Eval(calibSumZN2[0]+calibSumZP2[0])); + impPar = (fRecoParam->GetfbCen())->Eval(calibSumZN1[0]+calibSumZP1[0]); } else if(corrADCZEMHG < infValueZEM){ - nGenSpecNLeft = (Int_t) (fZNPer->Eval(calibSumZN1[0])); - nGenSpecPLeft = (Int_t) (fZPPer->Eval(calibSumZP1[0])); - nGenSpecLeft = (Int_t) (fZDCPer->Eval(calibSumZN1[0]+calibSumZP1[0])); - impPar = fbPer->Eval(calibSumZN1[0]+calibSumZP1[0]); + nGenSpecNLeft = (Int_t) ((fRecoParam->GetfZNPer())->Eval(calibSumZN1[0])); + nGenSpecPLeft = (Int_t) ((fRecoParam->GetfZPPer())->Eval(calibSumZP1[0])); + nGenSpecLeft = (Int_t) ((fRecoParam->GetfZDCPer())->Eval(calibSumZN1[0]+calibSumZP1[0])); + impPar = (fRecoParam->GetfbPer())->Eval(calibSumZN1[0]+calibSumZP1[0]); } else if(corrADCZEMHG >= infValueZEM && corrADCZEMHG <= supValueZEM){ - nGenSpecNLeft = (Int_t) (fZEMn->Eval(corrADCZEMHG)); - nGenSpecPLeft = (Int_t) (fZEMp->Eval(corrADCZEMHG)); - nGenSpecLeft = (Int_t)(fZEMsp->Eval(corrADCZEMHG)); - impPar = fZEMb->Eval(corrADCZEMHG); + nGenSpecNLeft = (Int_t) ((fRecoParam->GetfZEMn())->Eval(corrADCZEMHG)); + nGenSpecPLeft = (Int_t) ((fRecoParam->GetfZEMp())->Eval(corrADCZEMHG)); + nGenSpecLeft = (Int_t)((fRecoParam->GetfZEMsp())->Eval(corrADCZEMHG)); + impPar = (fRecoParam->GetfZEMb())->Eval(corrADCZEMHG); } // - if(calibSumZN1[0]/maxValEZN1>1.) nGenSpecNLeft = (Int_t) (fZEMn->Eval(corrADCZEMHG)); - if(calibSumZP1[0]/maxValEZP1>1.) nGenSpecPLeft = (Int_t) (fZEMp->Eval(corrADCZEMHG)); + if(calibSumZN1[0]/maxValEZN1>1.) nGenSpecNLeft = (Int_t) ((fRecoParam->GetfZEMn())->Eval(corrADCZEMHG)); + if(calibSumZP1[0]/maxValEZP1>1.) nGenSpecPLeft = (Int_t) ((fRecoParam->GetfZEMp())->Eval(corrADCZEMHG)); if((calibSumZN1[0]+calibSumZP1[0]/maxValEZDC1)>1.){ - nGenSpecLeft = (Int_t)(fZEMsp->Eval(corrADCZEMHG)); - impPar = fZEMb->Eval(corrADCZEMHG); + nGenSpecLeft = (Int_t)((fRecoParam->GetfZEMsp())->Eval(corrADCZEMHG)); + impPar = (fRecoParam->GetfZEMb())->Eval(corrADCZEMHG); } - if(calibSumZN2[0]/maxValEZN2>1.) nGenSpecNRight = (Int_t) (fZEMn->Eval(corrADCZEMHG)); - if(calibSumZP2[0]/maxValEZP2>1.) nGenSpecPRight = (Int_t) (fZEMp->Eval(corrADCZEMHG)); - if((calibSumZN2[0]+calibSumZP2[0]/maxValEZDC2)>1.) nGenSpecRight = (Int_t)(fZEMsp->Eval(corrADCZEMHG)); + if(calibSumZN2[0]/maxValEZN2>1.) nGenSpecNRight = (Int_t) ((fRecoParam->GetfZEMn())->Eval(corrADCZEMHG)); + if(calibSumZP2[0]/maxValEZP2>1.) nGenSpecPRight = (Int_t) ((fRecoParam->GetfZEMp())->Eval(corrADCZEMHG)); + if((calibSumZN2[0]+calibSumZP2[0]/maxValEZDC2)>1.) nGenSpecRight = (Int_t)((fRecoParam->GetfZEMsp())->Eval(corrADCZEMHG)); // if(nGenSpecNLeft>125) nGenSpecNLeft=125; else if(nGenSpecNLeft<0) nGenSpecNLeft=0; @@ -561,17 +628,3 @@ AliZDCCalib* AliZDCReconstructor::GetECalibData() const return calibdata; } -//_____________________________________________________________________________ -AliZDCRecParam* AliZDCReconstructor::GetRecParams() const -{ - - // Getting energy and equalization calibration object for ZDC set - - AliCDBEntry *entry = AliCDBManager::Instance()->Get("ZDC/Calib/RecParam"); - if(!entry) AliFatal("No calibration data loaded!"); - - AliZDCRecParam *calibdata = dynamic_cast (entry->GetObject()); - if(!calibdata) AliFatal("Wrong calibration object in calibration file!"); - - return calibdata; -} diff --git a/ZDC/AliZDCReconstructor.h b/ZDC/AliZDCReconstructor.h index 56aa0ca2cef..691fb419ad7 100644 --- a/ZDC/AliZDCReconstructor.h +++ b/ZDC/AliZDCReconstructor.h @@ -16,10 +16,11 @@ #include "AliCDBStorage.h" #include "AliZDCPedestals.h" #include "AliZDCCalib.h" -#include "AliZDCRecParam.h" +#include "AliZDCRecoParam.h" +#include "AliZDCRecoParampp.h" +#include "AliZDCRecoParamPbPb.h" #include "AliLog.h" -class TF1; class AliLoader; class AliZDCReconstructor: public AliReconstructor { @@ -37,38 +38,33 @@ public: virtual void FillESD(AliRawReader* /*rawReader*/, TTree* clustersTree, AliESDEvent* esd) const {FillZDCintoESD(clustersTree,esd);} + // parameter settings for reconstruction + static void SetRecoParam(AliZDCRecoParam * param){fRecoParam = param;} + static const AliZDCRecoParam* GetRecoParam(){return fRecoParam;} + + // OCDB objects for reconstruction AliCDBStorage *SetStorage(const char* uri); AliZDCPedestals *GetPedData() const; AliZDCCalib *GetECalibData() const; - AliZDCRecParam *GetRecParams() const; private: AliZDCReconstructor(const AliZDCReconstructor&); AliZDCReconstructor& operator =(const AliZDCReconstructor&); - void ReconstructEvent(TTree *clustersTree, + void ReconstructEventpp(TTree *clustersTree, + Float_t* ZN1ADCCorr, Float_t* ZP1ADCCorr, Float_t* ZN2ADCCorr, Float_t* ZP2ADCCorr, + Float_t* ZEM1ADCCorr, Float_t* ZEM2ADCCorr, Float_t* PMRef1, Float_t* PMRef2) const; + void ReconstructEventPbPb(TTree *clustersTree, Float_t* ZN1ADCCorr, Float_t* ZP1ADCCorr, Float_t* ZN2ADCCorr, Float_t* ZP2ADCCorr, Float_t* ZEM1ADCCorr, Float_t* ZEM2ADCCorr, Float_t* PMRef1, Float_t* PMRef2) const; void FillZDCintoESD(TTree *clustersTree, AliESDEvent*esd) const; - TF1* fZNCen; //! Nspectator n true vs. EZN - TF1* fZNPer; //! Nspectator n true vs. EZN - TF1* fZPCen; //! Nspectator p true vs. EZP - TF1* fZPPer; //! Nspectator p true vs. EZP - TF1* fZDCCen; //! Nspectators true vs. EZDC - TF1* fZDCPer; //! Nspectators true vs. EZDC - TF1* fbCen; //! b vs. EZDC - TF1* fbPer; //! b vs. EZDC - TF1* fZEMn; //! Nspectators n from ZEM energy - TF1* fZEMp; //! Nspectators p from ZEM energy - TF1* fZEMsp; //! Nspectators from ZEM energy - TF1* fZEMb; //! b from ZEM energy - + static AliZDCRecoParam *fRecoParam; // reconstruction parameters + AliZDCPedestals *fPedData; //! pedestal calibration data AliZDCCalib *fECalibData; //! energy and equalization calibration data - AliZDCRecParam *fRecParam; //! reconstruction parameters - ClassDef(AliZDCReconstructor, 3) // class for the ZDC reconstruction + ClassDef(AliZDCReconstructor, 4) // class for the ZDC reconstruction }; #endif diff --git a/ZDC/MakeZDCRecoParam.C b/ZDC/MakeZDCRecoParam.C new file mode 100644 index 00000000000..b03c38f8ffc --- /dev/null +++ b/ZDC/MakeZDCRecoParam.C @@ -0,0 +1,38 @@ +void MakeZDCRecoParam(Int_t type=0){ +//======================================================================== +// +// Steering macro to create and store in OCDB +// ZDC reconstruction parameters +// +// Contact: chiara.oppedisano@to.infn.it +// +//======================================================================== + + AliCDBManager* cdb = AliCDBManager::Instance(); + if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://OCDB"); + + AliZDCRecoParam *zdcRecoParam = 0; + // + switch(type) { + case 0: + zdcRecoParam = (AliZDCRecoParampp*) AliZDCRecoParampp::GetppRecoParam(); + break; + case 1: + zdcRecoParam = (AliZDCRecoParamPbPb*) AliZDCRecoParamPbPb::GetPbPbRecoParam(); + break; + case default: + printf("Event type not implemented\n"); + return; + break; + } + // + // save in CDB storage + AliCDBMetaData *md= new AliCDBMetaData(); + md->SetResponsible("Chiara Oppedisano"); + md->SetComment("Reconstruction parameters for ZDC"); + md->SetAliRootVersion(gSystem->Getenv("ARVERSION")); + md->SetBeamPeriod(0); + AliCDBId id("ZDC/Calib/RecoParam",0,AliCDBRunRange::Infinity()); + AliCDBManager::Instance()->GetDefaultStorage()->Put(zdcRecoParam,id, md); + +} diff --git a/ZDC/ZDCbaseLinkDef.h b/ZDC/ZDCbaseLinkDef.h index 133ae4c8509..792f86298f5 100644 --- a/ZDC/ZDCbaseLinkDef.h +++ b/ZDC/ZDCbaseLinkDef.h @@ -12,7 +12,6 @@ #pragma link C++ class AliZDCRawStream+; #pragma link C++ class AliZDCPedestals+; #pragma link C++ class AliZDCCalib+; -#pragma link C++ class AliZDCRecParam+; #pragma link C++ class AliZDCDataDCS+; #pragma link C++ class AliZDCPreprocessor+; #pragma link C++ class AliZDCQAChecker+; diff --git a/ZDC/ZDCrecLinkDef.h b/ZDC/ZDCrecLinkDef.h index 234c73982c0..920e30858f8 100644 --- a/ZDC/ZDCrecLinkDef.h +++ b/ZDC/ZDCrecLinkDef.h @@ -9,6 +9,9 @@ #pragma link off all functions; #pragma link C++ class AliZDCReco+; +#pragma link C++ class AliZDCRecoParam+; +#pragma link C++ class AliZDCRecoParampp+; +#pragma link C++ class AliZDCRecoParamPbPb+; #pragma link C++ class AliZDCReconstructor+; #pragma link C++ class AliZDCQADataMakerRec+; diff --git a/ZDC/ZDCsimLinkDef.h b/ZDC/ZDCsimLinkDef.h index 3a40a9e79fb..8d57cf9c257 100644 --- a/ZDC/ZDCsimLinkDef.h +++ b/ZDC/ZDCsimLinkDef.h @@ -9,7 +9,6 @@ #pragma link off all functions; #pragma link C++ class AliZDC+; -#pragma link C++ class AliZDCv2+; #pragma link C++ class AliZDCv3+; #pragma link C++ class AliZDCHit+; diff --git a/ZDC/libZDCbase.pkg b/ZDC/libZDCbase.pkg index 7759453c789..7919bbbfaa7 100644 --- a/ZDC/libZDCbase.pkg +++ b/ZDC/libZDCbase.pkg @@ -2,7 +2,7 @@ # $Id$ SRCS= AliZDCDigit.cxx AliZDCRawStream.cxx \ - AliZDCPedestals.cxx AliZDCCalib.cxx AliZDCRecParam.cxx \ + AliZDCPedestals.cxx AliZDCCalib.cxx \ AliZDCDataDCS.cxx AliZDCPreprocessor.cxx AliZDCQAChecker.cxx HDRS= $(SRCS:.cxx=.h) diff --git a/ZDC/libZDCrec.pkg b/ZDC/libZDCrec.pkg index eb6e22e9304..a914a8fd983 100644 --- a/ZDC/libZDCrec.pkg +++ b/ZDC/libZDCrec.pkg @@ -1,7 +1,9 @@ #-*- Mode: Makefile -*- # $Id$ -SRCS= AliZDCReco.cxx AliZDCReconstructor.cxx AliZDCQADataMakerRec.cxx +SRCS= AliZDCReco.cxx AliZDCRecoParam.cxx AliZDCRecoParampp.cxx \ +AliZDCRecoParamPbPb.cxx AliZDCReconstructor.cxx \ +AliZDCQADataMakerRec.cxx HDRS= $(SRCS:.cxx=.h) diff --git a/ZDC/libZDCsim.pkg b/ZDC/libZDCsim.pkg index 1cbc25641e9..8b30079864a 100644 --- a/ZDC/libZDCsim.pkg +++ b/ZDC/libZDCsim.pkg @@ -1,7 +1,7 @@ #-*- Mode: Makefile -*- # $Id$ -SRCS= AliZDC.cxx AliZDCv2.cxx AliZDCv3.cxx \ +SRCS= AliZDC.cxx AliZDCv3.cxx \ AliZDCHit.cxx AliZDCSDigit.cxx AliZDCFragment.cxx AliZDCDigitizer.cxx \ AliGenZDC.cxx AliZDCTrigger.cxx AliZDCQADataMakerSim.cxx