From d4ad0d6b58385e9a96b6eae07345cd16844f43f9 Mon Sep 17 00:00:00 2001 From: arcelli Date: Tue, 28 Mar 2006 14:58:19 +0000 Subject: [PATCH] updates to handle new V5 geometry & some re-arrangements --- TOF/AliTOFCal.cxx | 53 ++++- TOF/AliTOFCal.h | 4 +- TOF/AliTOFCalPadZ.cxx | 45 ++-- TOF/AliTOFCalPadZ.h | 17 +- TOF/AliTOFCalPlateA.cxx | 65 ++++-- TOF/AliTOFCalPlateA.h | 16 +- TOF/AliTOFCalPlateB.cxx | 66 +++--- TOF/AliTOFCalPlateB.h | 13 +- TOF/AliTOFCalPlateC.cxx | 71 +++--- TOF/AliTOFCalPlateC.h | 16 +- TOF/AliTOFCalSector.cxx | 78 +++++-- TOF/AliTOFCalSector.h | 5 +- TOF/AliTOFCalStrip.cxx | 56 +++-- TOF/AliTOFCalStrip.h | 15 +- TOF/AliTOFcalib.cxx | 472 ++++++++++++++-------------------------- TOF/AliTOFcalib.h | 46 ++-- TOF/AliTOFcalibESD.cxx | 21 +- TOF/AliTOFcalibESD.h | 22 +- 18 files changed, 510 insertions(+), 571 deletions(-) diff --git a/TOF/AliTOFCal.cxx b/TOF/AliTOFCal.cxx index a859706972c..b28aa13abf9 100644 --- a/TOF/AliTOFCal.cxx +++ b/TOF/AliTOFCal.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.2 2006/02/13 17:22:26 arcelli +just Fixing Log info + Revision 1.1 2006/02/13 16:10:48 arcelli Add classes for TOF Calibration (C.Zampolli) @@ -31,7 +34,8 @@ author: Chiara Zampolli, zampolli@bo.infn.it #include "TROOT.h" #include "TBrowser.h" #include "TClass.h" -#include "AliTOFGeometryV4.h" +#include "AliLog.h" +#include "AliTOFGeometryV5.h" #include "AliTOFCalSector.h" #include "AliTOFCal.h" #include "AliTOFChannel.h" @@ -43,18 +47,32 @@ ClassImp(AliTOFCal) //________________________________________________________________ AliTOFCal::AliTOFCal():TObject(){ - // fCalp = 0; - fNSector = AliTOFGeometryV4::NSectors(); - fNPlate = AliTOFGeometryV4::NPlates(); - fNStripA = AliTOFGeometryV4::NStripA(); - fNStripB = AliTOFGeometryV4::NStripB(); - // fNStripC = AliTOFGeometryV4::NStripC(); - fNStripC = 20; - fNpadZ = AliTOFGeometryV4::NpadZ(); - fNpadX = AliTOFGeometryV4::NpadX(); + fGeom = 0x0; + fNSector = 0; + fNPlate = 0; + fNStripA = 0; + fNStripB = 0; + fNStripC = 0; + fNpadZ = 0; + fNpadX = 0; fnpad = 0; fPads = 0x0; gROOT->GetListOfBrowsables()->Add(this); + } +//________________________________________________________________ + +AliTOFCal::AliTOFCal(AliTOFGeometry *geom):TObject(){ + fGeom = geom; + fNSector = fGeom->NSectors(); + fNPlate = fGeom->NPlates(); + fNStripA = fGeom->NStripA(); + fNStripB = fGeom->NStripB(); + fNStripC = fGeom->NStripC(); + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); + fnpad = fNSector*(2*(fNStripC+fNStripB)+fNStripA)*fNpadZ*fNpadX; + fPads = 0x0; + gROOT->GetListOfBrowsables()->Add(this); } //________________________________________________________________ @@ -77,6 +95,7 @@ AliTOFCal::AliTOFCal(const AliTOFCal& cal): //____________________________________________________________________________ AliTOFCal::~AliTOFCal() { + gROOT->GetListOfBrowsables()->Remove(this); delete [] fPads; } //________________________________________________________________ @@ -92,6 +111,18 @@ void AliTOFCal::Browse(TBrowser *b) //________________________________________________________________ void AliTOFCal::CreateArray(){ - fnpad = AliTOFGeometryV4::NSectors()*(2*(20+AliTOFGeometryV4::NStripB())+AliTOFGeometryV4::NStripA())*AliTOFGeometryV4::NpadZ()*AliTOFGeometryV4::NpadX(); + if(fGeom==0x0){ + AliInfo("V5 TOF Geometry is taken as a default"); + AliTOFGeometry *geom= new AliTOFGeometryV5(); + fNSector = geom->NSectors(); + fNPlate = geom->NPlates(); + fNStripA = geom->NStripA(); + fNStripB = geom->NStripB(); + fNStripC = geom->NStripC(); + fNpadZ = geom->NpadZ(); + fNpadX = geom->NpadX(); + fnpad = fNSector*(2*(fNStripC+fNStripB)+fNStripA)*fNpadZ*fNpadX; + delete geom; + } fPads= new AliTOFChannel[fnpad]; } diff --git a/TOF/AliTOFCal.h b/TOF/AliTOFCal.h index 061066dab9d..41ece81c11f 100644 --- a/TOF/AliTOFCal.h +++ b/TOF/AliTOFCal.h @@ -14,7 +14,7 @@ #include "TROOT.h" #include "TBrowser.h" #include "TClass.h" -#include "AliTOFGeometryV4.h" +#include "AliTOFGeometry.h" #include "AliTOFChannel.h" @@ -22,6 +22,7 @@ class AliTOFCal: public TObject { public: AliTOFCal(); + AliTOFCal(AliTOFGeometry *geom); AliTOFCal(const AliTOFCal& cal); virtual ~AliTOFCal(); void Browse(TBrowser *b); @@ -49,6 +50,7 @@ private: Int_t fNpadX; // number of TOF pads X Int_t fnpad; // number of TOF channels + AliTOFGeometry *fGeom; // AliTOFgeometry pointer AliTOFChannel* fPads; //[fnpad] // array of AliTOFChannels storing the calib parameters ClassDef(AliTOFCal,1) diff --git a/TOF/AliTOFCalPadZ.cxx b/TOF/AliTOFCalPadZ.cxx index e936edd4508..0d68040dd75 100644 --- a/TOF/AliTOFCalPadZ.cxx +++ b/TOF/AliTOFCalPadZ.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.2 2006/02/13 17:22:26 arcelli +just Fixing Log info + Revision 1.1 2006/02/13 16:10:48 arcelli Add classes for TOF Calibration (C.Zampolli) @@ -31,7 +34,8 @@ author: Chiara Zampolli, zampolli@bo.infn.it #include "TROOT.h" #include "TBrowser.h" #include "TClass.h" -#include "AliTOFGeometryV4.h" +#include "AliLog.h" +#include "AliTOFGeometryV5.h" #include "AliTOFChannel.h" #include "AliTOFCalPadZ.h" @@ -41,30 +45,29 @@ ClassImp(AliTOFCalPadZ) AliTOFCalPadZ::AliTOFCalPadZ(){ fCh = 0; - fNSector = AliTOFGeometryV4::NSectors(); - fNPlate = AliTOFGeometryV4::NPlates(); - fNStripA = AliTOFGeometryV4::NStripA(); - fNStripB = AliTOFGeometryV4::NStripB(); - fNStripC = 20; - // fNStripC = AliTOFGeometryV4::NStripC(); - fNpadZ = AliTOFGeometryV4::NpadZ(); - fNpadX = AliTOFGeometryV4::NpadX(); - + fNpadX=0; } //________________________________________________________________ AliTOFCalPadZ::AliTOFCalPadZ(AliTOFChannel *ch): fCh(ch) { - fNSector = AliTOFGeometryV4::NSectors(); - fNPlate = AliTOFGeometryV4::NPlates(); - fNStripA = AliTOFGeometryV4::NStripA(); - fNStripB = AliTOFGeometryV4::NStripB(); - // fNStripC = AliTOFGeometryV4::NStripC(); - fNStripC = 20; - fNpadZ = AliTOFGeometryV4::NpadZ(); - fNpadX = AliTOFGeometryV4::NpadX(); + fNpadX = 0; +} +//________________________________________________________________ +AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom){ + fCh = 0; + fGeom = geom; + fNpadX = fGeom->NpadX(); +} +//________________________________________________________________ + +AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom,AliTOFChannel *ch): + fCh(ch) +{ + fGeom = geom; + fNpadX = fGeom->NpadX(); } //________________________________________________________________ @@ -76,6 +79,12 @@ AliTOFCalPadZ::~AliTOFCalPadZ() void AliTOFCalPadZ::Browse(TBrowser *b) { + if(fGeom==0x0){ + AliInfo("V5 TOF Geometry is taken as the default"); + AliTOFGeometry *geom = new AliTOFGeometryV5(); + fNpadX = geom->NpadX(); + delete geom; + } char name[10]; for(Int_t i=0; iNStripA(); + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); +} +//________________________________________________________________ + +AliTOFCalPlateA::AliTOFCalPlateA(AliTOFGeometry *geom, AliTOFChannel *ch): fCh(ch) +{ + fGeom = geom; + fNStripA = fGeom->NStripA(); + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); } //________________________________________________________________ @@ -78,20 +91,24 @@ AliTOFCalPlateA::AliTOFCalPlateA(const AliTOFCalPlateA& pl): TObject(pl) { fCh = pl.fCh; - fCh = pl.fCh; - fNSector = pl.fNSector; - fNPlate = pl.fNPlate; fNStripA = pl.fNStripA; - fNStripB = pl.fNStripB; - fNStripC = pl.fNStripC; fNpadZ = pl.fNpadZ; fNpadX = pl.fNpadX; + fGeom = pl.fGeom; } //________________________________________________________________ void AliTOFCalPlateA::Browse(TBrowser *b){ + if(fGeom==0x0){ + AliTOFGeometry *geom = new AliTOFGeometryV5(); + AliInfo("V5 TOF Geometry is taken as the default"); + fNStripA = geom->NStripA(); + fNpadZ = geom->NpadZ(); + fNpadX = geom->NpadX(); + delete geom; + } char name[10]; for(Int_t i=0; iNStripB(); + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); } //________________________________________________________________ -AliTOFCalPlateB::AliTOFCalPlateB(AliTOFChannel *ch): - fCh(ch) +AliTOFCalPlateB::AliTOFCalPlateB(AliTOFGeometry *geom, AliTOFChannel *ch): fCh(ch) { - fNSector = AliTOFGeometryV4::NSectors(); - fNPlate = AliTOFGeometryV4::NPlates(); - fNStripA = AliTOFGeometryV4::NStripA(); - fNStripB = AliTOFGeometryV4::NStripB(); - fNStripC = 20; - // fNStripC = AliTOFGeometryV4::NStripC(); - fNpadZ = AliTOFGeometryV4::NpadZ(); - fNpadX = AliTOFGeometryV4::NpadX(); + fGeom = geom; + fNStripB = fGeom->NStripB(); + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); } + //________________________________________________________________ AliTOFCalPlateB::~AliTOFCalPlateB() @@ -79,21 +92,24 @@ AliTOFCalPlateB::AliTOFCalPlateB(const AliTOFCalPlateB& pl): TObject(pl) { fCh = pl.fCh; - fCh = pl.fCh; - fCh = pl.fCh; - fNSector = pl.fNSector; - fNPlate = pl.fNPlate; - fNStripA = pl.fNStripA; fNStripB = pl.fNStripB; - fNStripC = pl.fNStripC; fNpadZ = pl.fNpadZ; fNpadX = pl.fNpadX; + fGeom = pl.fGeom; } //________________________________________________________________ void AliTOFCalPlateB::Browse(TBrowser *b){ + if(fGeom==0x0){ + AliTOFGeometry *geom = new AliTOFGeometryV5(); + AliInfo("V5 TOF Geometry is taken as the default"); + fNStripB = geom->NStripB(); + fNpadZ = geom->NpadZ(); + fNpadX = geom->NpadX(); + delete geom; + } char name[10]; for(Int_t i=0; i -#include ClassImp(AliTOFCalPlateC) @@ -44,30 +46,39 @@ ClassImp(AliTOFCalPlateC) AliTOFCalPlateC::AliTOFCalPlateC(){ fCh = 0; - fNSector = AliTOFGeometryV4::NSectors(); - fNPlate = AliTOFGeometryV4::NPlates(); - fNStripA = AliTOFGeometryV4::NStripA(); - fNStripB = AliTOFGeometryV4::NStripB(); - fNStripC = 20; - // fNStripC = AliTOFGeometryV4::NStripC(); - fNpadZ = AliTOFGeometryV4::NpadZ(); - fNpadX = AliTOFGeometryV4::NpadX(); + fGeom= 0x0; + fNStripC = 0; + fNpadZ = 0; + fNpadX = 0; } //________________________________________________________________ -AliTOFCalPlateC::AliTOFCalPlateC(AliTOFChannel *ch): - fCh(ch) -{ - fNSector = AliTOFGeometryV4::NSectors(); - fNPlate = AliTOFGeometryV4::NPlates(); - fNStripA = AliTOFGeometryV4::NStripA(); - fNStripB = AliTOFGeometryV4::NStripB(); - fNStripC = 20; - // fNStripC = AliTOFGeometryV4::NStripC(); - fNpadZ = AliTOFGeometryV4::NpadZ(); - fNpadX = AliTOFGeometryV4::NpadX(); +AliTOFCalPlateC::AliTOFCalPlateC(AliTOFChannel *ch) : fCh(ch) +{ + fGeom= 0x0; + fNStripC = 0; + fNpadZ = 0; + fNpadX = 0; +} +//________________________________________________________________ + +AliTOFCalPlateC::AliTOFCalPlateC(AliTOFGeometry *geom){ + fCh = 0; + fGeom = geom; + fNStripC = fGeom->NStripC(); + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); +} +//________________________________________________________________ +AliTOFCalPlateC::AliTOFCalPlateC(AliTOFGeometry *geom, AliTOFChannel *ch): fCh(ch) +{ + fGeom = geom; + fNStripC = fGeom->NStripC(); + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); } + //________________________________________________________________ AliTOFCalPlateC::~AliTOFCalPlateC() @@ -79,24 +90,26 @@ AliTOFCalPlateC::~AliTOFCalPlateC() AliTOFCalPlateC::AliTOFCalPlateC(const AliTOFCalPlateC& pl): TObject(pl) - { fCh = pl.fCh; - fCh = pl.fCh; - fCh = pl.fCh; - fNSector = pl.fNSector; - fNPlate = pl.fNPlate; - fNStripA = pl.fNStripA; - fNStripB = pl.fNStripB; fNStripC = pl.fNStripC; fNpadZ = pl.fNpadZ; fNpadX = pl.fNpadX; + fGeom = pl.fGeom; } //________________________________________________________________ void AliTOFCalPlateC::Browse(TBrowser *b){ + if(fGeom==0x0){ + AliTOFGeometry *geom = new AliTOFGeometryV5(); + AliInfo("V5 TOF Geometry is taken as the default"); + fNStripC = geom->NStripC(); + fNpadZ = geom->NpadZ(); + fNpadX = geom->NpadX(); + delete geom; + } char name[10]; for(Int_t i=0; iGetListOfBrowsables()->Add(this); } @@ -62,14 +65,42 @@ AliTOFCalSector::AliTOFCalSector(){ AliTOFCalSector::AliTOFCalSector(AliTOFChannel *ch): fCh(ch) { - fNSector = AliTOFGeometryV4::NSectors(); - fNPlate = AliTOFGeometryV4::NPlates(); - fNStripA = AliTOFGeometryV4::NStripA(); - fNStripB = AliTOFGeometryV4::NStripB(); - fNStripC = 20; - // fNStripC = AliTOFGeometryV4::NStripC(); - fNpadZ = AliTOFGeometryV4::NpadZ(); - fNpadX = AliTOFGeometryV4::NpadX(); + fGeom=0x0; + fNPlate=0; + fNStripA=0; + fNStripB=0; + fNStripC=0; + fNpadZ=0; + fNpadX=0; + gROOT->GetListOfBrowsables()->Add(this); +} +//________________________________________________________________ + +AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom){ + fCh = 0; + fGeom= geom; + fNPlate = fGeom->NPlates(); + fNStripA = fGeom->NStripA(); + fNStripB = fGeom->NStripB(); + fNStripC = fGeom->NStripC(); + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); + gROOT->GetListOfBrowsables()->Add(this); + +} +//________________________________________________________________ + +AliTOFCalSector::AliTOFCalSector(AliTOFGeometry *geom,AliTOFChannel *ch): + fCh(ch) +{ + fGeom= geom; + fNPlate = fGeom->NPlates(); + fNStripA = fGeom->NStripA(); + fNStripB = fGeom->NStripB(); + fNStripC = fGeom->NStripC(); + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); + gROOT->GetListOfBrowsables()->Add(this); } //________________________________________________________________ @@ -77,7 +108,6 @@ AliTOFCalSector::AliTOFCalSector(const AliTOFCalSector& sec): TObject(sec) { fCh = sec.fCh; - fNSector = sec.fNSector; fNPlate = sec.fNPlate; fNStripA = sec.fNStripA; fNStripB = sec.fNStripB; @@ -90,6 +120,7 @@ AliTOFCalSector::AliTOFCalSector(const AliTOFCalSector& sec): AliTOFCalSector::~AliTOFCalSector() { + gROOT->GetListOfBrowsables()->Remove(this); delete[] fCh; } @@ -97,6 +128,17 @@ AliTOFCalSector::~AliTOFCalSector() void AliTOFCalSector::Browse(TBrowser *b){ + if(fGeom==0x0){ + AliTOFGeometry *geom= new AliTOFGeometryV5(); + AliInfo("V5 TOF Geometry is taken as the default"); + fNPlate = geom->NPlates(); + fNStripA = geom->NStripA(); + fNStripB = geom->NStripB(); + fNStripC = geom->NStripC(); + fNpadZ = geom->NpadZ(); + fNpadX = geom->NpadX(); + delete geom; + } b->Add(new AliTOFCalPlateC(fCh), "Plate0"); b->Add(new AliTOFCalPlateB(&fCh[fNStripC*96]),"Plate1"); b->Add(new AliTOFCalPlateA(&fCh[(fNStripC+fNStripB)*fNpadZ*fNpadX]),"Plate2"); diff --git a/TOF/AliTOFCalSector.h b/TOF/AliTOFCalSector.h index c835b0bcaa4..9b57588c3d6 100644 --- a/TOF/AliTOFCalSector.h +++ b/TOF/AliTOFCalSector.h @@ -26,9 +26,10 @@ class AliTOFCalSector: public TObject public: AliTOFCalSector(); AliTOFCalSector(AliTOFChannel *ch); + AliTOFCalSector(AliTOFGeometry *geom); + AliTOFCalSector(AliTOFGeometry *geom, AliTOFChannel *ch); AliTOFCalSector(const AliTOFCalSector& sec); virtual ~AliTOFCalSector(); - Int_t NSector()const {return fNSector;} Int_t NPlate()const {return fNPlate;} Int_t NStripA()const {return fNStripA;} Int_t NStripB()const {return fNStripB;} @@ -38,7 +39,6 @@ public: void Browse(TBrowser *b); Bool_t IsFolder() const{return kTRUE;} private: - Int_t fNSector; // number of TOF sectors Int_t fNPlate; // number of TOF plates Int_t fNStripA; // number of TOF strips A Int_t fNStripB; // number of TOF strips B @@ -46,6 +46,7 @@ private: Int_t fNpadZ; // number of TOF pads Z Int_t fNpadX; // number of TOF pads X + AliTOFGeometry *fGeom; // AliTOFgeometry pointer AliTOFChannel *fCh; //array of AliTOFChannel storing calib parameters ClassDef(AliTOFCalSector,1) }; diff --git a/TOF/AliTOFCalStrip.cxx b/TOF/AliTOFCalStrip.cxx index 44dd96a25a7..f7a40d62741 100644 --- a/TOF/AliTOFCalStrip.cxx +++ b/TOF/AliTOFCalStrip.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.2 2006/02/13 17:22:26 arcelli +just Fixing Log info + Revision 1.1 2006/02/13 16:10:48 arcelli Add classes for TOF Calibration (C.Zampolli) @@ -31,7 +34,8 @@ author: Chiara Zampolli, zampolli@bo.infn.it #include "TROOT.h" #include "TBrowser.h" #include "TClass.h" -#include "AliTOFGeometryV4.h" +#include "AliLog.h" +#include "AliTOFGeometryV5.h" #include "AliTOFChannel.h" #include "AliTOFCalStrip.h" #include "AliTOFCalPadZ.h" @@ -42,29 +46,35 @@ ClassImp(AliTOFCalStrip) AliTOFCalStrip::AliTOFCalStrip(){ fCh = 0; - fNSector = AliTOFGeometryV4::NSectors(); - fNPlate = AliTOFGeometryV4::NPlates(); - fNStripA = AliTOFGeometryV4::NStripA(); - fNStripB = AliTOFGeometryV4::NStripB(); - fNStripC = 20; - // fNStripC = AliTOFGeometryV4::NStripC(); - fNpadZ = AliTOFGeometryV4::NpadZ(); - fNpadX = AliTOFGeometryV4::NpadX(); + fGeom= 0x0; + fNpadZ = 0; + fNpadX = 0; } //________________________________________________________________ AliTOFCalStrip::AliTOFCalStrip(AliTOFChannel *ch): fCh(ch) { - fNSector = AliTOFGeometryV4::NSectors(); - fNPlate = AliTOFGeometryV4::NPlates(); - fNStripA = AliTOFGeometryV4::NStripA(); - fNStripB = AliTOFGeometryV4::NStripB(); - fNStripC = 20; - // fNStripC = AliTOFGeometryV4::NStripC(); - fNpadZ = AliTOFGeometryV4::NpadZ(); - fNpadX = AliTOFGeometryV4::NpadX(); + fGeom= 0x0; + fNpadZ = 0; + fNpadX = 0; +} +//________________________________________________________________ + +AliTOFCalStrip::AliTOFCalStrip(AliTOFGeometry *geom){ + fCh = 0; + fGeom = geom; + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); +} +//________________________________________________________________ +AliTOFCalStrip::AliTOFCalStrip(AliTOFGeometry *geom,AliTOFChannel *ch): + fCh(ch) +{ + fGeom = geom; + fNpadZ = fGeom->NpadZ(); + fNpadX = fGeom->NpadX(); } //________________________________________________________________ @@ -79,11 +89,6 @@ AliTOFCalStrip::AliTOFCalStrip(const AliTOFCalStrip& strip): TObject(strip) { fCh = strip.fCh; - fNSector = strip.fNSector; - fNPlate = strip.fNPlate; - fNStripA = strip.fNStripA; - fNStripB = strip.fNStripB; - fNStripC = strip.fNStripC; fNpadZ = strip.fNpadZ; fNpadX = strip.fNpadX; @@ -92,6 +97,13 @@ AliTOFCalStrip::AliTOFCalStrip(const AliTOFCalStrip& strip): void AliTOFCalStrip::Browse(TBrowser *b){ + if(fGeom==0x0){ + AliTOFGeometry *geom = new AliTOFGeometryV5(); + AliInfo("V5 TOF Geometry is taken as the default"); + fNpadZ = geom->NpadZ(); + fNpadX = geom->NpadX(); + delete geom; + } char name[10]; for(Int_t i=0; iNSectors(); + fNPlate = geom->NPlates(); + fNStripA = geom->NStripA(); + fNStripB = geom->NStripB(); + fNStripC = geom->NStripC(); + fNpadZ = geom->NpadZ(); + fNpadX = geom->NpadX(); + fNChannels = fNSector*(2*(fNStripC+fNStripB)+fNStripA)*fNpadZ*fNpadX; //generalized version + fTOFCal = new AliTOFCal(geom); + fTOFSimCal = new AliTOFCal(geom); + fTOFCal->CreateArray(); + fTOFSimCal->CreateArray(); + delete geom; } -//____________________________________________________________________________ - -AliTOFcalib::AliTOFcalib(char* headerFile, Int_t nEvents):TTask("AliTOFcalib","") -{ - AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),"read"); - rl->CdGAFile(); - TFile *in=(TFile*)gFile; - in->cd(); - fGeom = (AliTOFGeometry*)in->Get("TOFgeometry"); - fNSector = fGeom->NSectors(); - fNPlate = fGeom->NPlates(); - fNStripA = fGeom->NStripA(); - fNStripB = fGeom->NStripB(); - fNStripC = fGeom->NStripC(); - fNpadZ = fGeom->NpadZ(); - fNpadX = fGeom->NpadX(); - fsize = 2*(fNStripC+fNStripB) + fNStripA; - for (Int_t i = 0;i<6;i++){ - fhToT[i]=0x0; - } +//_______________________________________________________________________ +AliTOFcalib::AliTOFcalib(AliTOFGeometry *geom):TTask("AliTOFcalib",""){ fArrayToT = 0x0; fArrayTime = 0x0; - flistFunc = 0x0; - fNevents=nEvents; - fHeadersFile=headerFile; - fTOFCal = 0x0; fESDsel = 0x0; - TFile* file = (TFile*) gROOT->GetFile(fHeadersFile.Data()) ; - if(file == 0){ - if(fHeadersFile.Contains("rfio")) - file = TFile::Open(fHeadersFile,"update") ; - else - file = new TFile(fHeadersFile.Data(),"update") ; - gAlice = (AliRun*)file->Get("gAlice") ; - } - - TTask * roottasks = (TTask*)gROOT->GetRootFolder()->FindObject("Tasks") ; - roottasks->Add(this) ; + fNSector = geom->NSectors(); + fNPlate = geom->NPlates(); + fNStripA = geom->NStripA(); + fNStripB = geom->NStripB(); + fNStripC = geom->NStripC(); + fNpadZ = geom->NpadZ(); + fNpadX = geom->NpadX(); + fNChannels = fNSector*(2*(fNStripC+fNStripB)+fNStripA)*fNpadZ*fNpadX; //generalized version + fTOFCal = new AliTOFCal(geom); + fTOFSimCal = new AliTOFCal(geom); + fTOFCal->CreateArray(); + fTOFSimCal->CreateArray(); } //____________________________________________________________________________ @@ -133,16 +115,11 @@ AliTOFcalib::AliTOFcalib(const AliTOFcalib & calib):TTask("AliTOFcalib","") fNStripC = calib.fNStripC; fNpadZ = calib.fNpadZ; fNpadX = calib.fNpadX; - fsize = calib.fsize; + fNChannels = calib.fNChannels; fArrayToT = calib.fArrayToT; fArrayTime = calib.fArrayTime; - flistFunc = calib.flistFunc; - for (Int_t i = 0;i<6;i++){ - fhToT[i]=calib.fhToT[i]; - } fTOFCal=calib.fTOFCal; - fESDsel = calib.fESDsel; - fGeom = calib.fGeom; + fTOFSimCal = calib.fTOFSimCal; } //____________________________________________________________________________ @@ -151,85 +128,10 @@ AliTOFcalib::~AliTOFcalib() { delete fArrayToT; delete fArrayTime; - delete flistFunc; - delete[] fhToT; delete fTOFCal; + delete fTOFSimCal; delete fESDsel; } -//____________________________________________________________________________ - -void AliTOFcalib::Init(){ - SetHistos(); - SetFitFunctions(); - fTOFCal = new AliTOFCal(); - fTOFCal->CreateArray(); - fNSector = 18; - fNPlate = 5; - fNStripA = 15; - fNStripB = 19; - fNStripC = 20; - fNpadZ = 2; - fNpadX = 96; - fsize = 1; - //fsize = fNSector*(2*(fNStripC+fNStripB)+fNStripA())*fNpadZ*fNpadX; //generalized version -} -//____________________________________________________________________________ - -void AliTOFcalib::SetHistos(){ - TFile * spFile; - TH1F * hToT; - for (Int_t i =0;i<6;i++){ - //for the time being, only one spectrum is used - spFile = new TFile("$ALICE_ROOT/TOF/Spectra/spectrumtest0_1.root","read"); - //otherwise - //spFile = new TFile(ffile[i],"read"); - spFile->GetObject("ToT",hToT); - fhToT[i]=hToT; - Int_t nbins = hToT->GetNbinsX(); - Float_t Delta = hToT->GetBinWidth(1); - Float_t maxch = hToT->GetBinLowEdge(nbins)+Delta; - Float_t minch = hToT->GetBinLowEdge(1); - Float_t max=0,min=0; //maximum and minimum value of the distribution - Int_t maxbin=0,minbin=0; //maximum and minimum bin of the distribution - for (Int_t ii=nbins; ii>0; ii--){ - if (hToT->GetBinContent(ii)!= 0) { - max = maxch - (nbins-ii-1)*Delta; - maxbin = ii; - break;} - } - for (Int_t j=1; jGetBinContent(j)!= 0) { - min = minch + (j-1)*Delta; - minbin = j; - break;} - } - fMaxToT[i]=max; - fMinToT[i]=min; - fMaxToTDistr[i]=hToT->GetMaximum(); - } -} -//__________________________________________________________________________ - -void AliTOFcalib::SetFitFunctions(){ - TFile * spFile; - flistFunc = new TList(); - for (Int_t i =0;i<6;i++){ - //only one type of spectrum used for the time being - spFile = new TFile("$ALICE_ROOT/TOF/Spectra/spectrumtest0_1.root","read"); - //otherwise - //spFile = new TFile(ffile[i],"read"); - TH1F * h = (TH1F*)spFile->Get("TimeToTFit"); - TList * list = (TList*)h->GetListOfFunctions(); - TF1* f = (TF1*)list->At(0); - Double_t par[6] = {0,0,0,0,0,0}; - Int_t npar=f->GetNpar(); - for (Int_t ipar=0;iparGetParameter(ipar); - } - flistFunc->AddLast(f); - } - return; -} //__________________________________________________________________________ TF1* AliTOFcalib::SetFitFunctions(TH1F *histo){ @@ -289,100 +191,8 @@ TF1* AliTOFcalib::SetFitFunctions(TH1F *histo){ } //____________________________________________________________________________ -TClonesArray* AliTOFcalib::DecalibrateDigits(TClonesArray * digits){ - - TObjArray ChArray(fsize); - ChArray.SetOwner(); - for (Int_t kk = 0 ; kk < fsize; kk++){ - AliTOFChSim * channel = new AliTOFChSim(); - ChArray.Add(channel); - } - Int_t ndigits = digits->GetEntriesFast(); - for (Int_t i=0;iAt(i); - /* - Int_t *detId[5]; - detId[0] = element->GetSector(); - detId[1] = element->GetPlate(); - detId[2] = element->GetStrip(); - detId[3] = element->GetPadz(); - detId[4] = element->GetPadx(); - Int_t index = GetIndex(detId); - */ - //select the corresponding channel with its simulated ToT spectrum - //summing up everything, index = 0 for all channels: - Int_t index = 0; - AliTOFChSim *ch = (AliTOFChSim*)ChArray.At(index); - Int_t itype = -1; - if (!ch->IsSlewed()){ - Double_t rand = gRandom->Uniform(0,6); - itype = (Int_t)(6-rand); - ch->SetSpectrum(itype); - ch->SetSlewedStatus(kTRUE); - } - else itype = ch->GetSpectrum(); - TH1F * hToT = fhToT[itype]; - TF1 * f = (TF1*)flistFunc->At(itype); - while (SimToT <= triy){ - trix = gRandom->Rndm(i); - triy = gRandom->Rndm(i); - trix = (fMaxToT[itype]-fMinToT[itype])*trix + fMinToT[itype]; - triy = fMaxToTDistr[itype]*triy; - Int_t binx=hToT->FindBin(trix); - SimToT=hToT->GetBinContent(binx); - } - - Float_t par[6]; - for(Int_t kk=0;kk<6;kk++){ - par[kk]=0; - } - element->SetToT(trix); - Int_t nfpar = f->GetNpar(); - for (Int_t kk = 0; kk< nfpar; kk++){ - par[kk]=f->GetParameter(kk); - } - Float_t ToT = element->GetToT(); - element->SetTdcND(element->GetTdc()); - Float_t tdc = ((element->GetTdc())*AliTOFGeometry::TdcBinWidth()+32)*1.E-3; //tof signal in ns - Float_t timeoffset=par[0] + ToT*par[1] +ToT*ToT*par[2] +ToT*ToT*ToT*par[3] +ToT*ToT*ToT*ToT*par[4] +ToT*ToT*ToT*ToT*ToT*par[5]; - timeoffset=0; - Float_t timeSlewed = tdc + timeoffset; - element->SetTdc((timeSlewed*1E3-32)/AliTOFGeometry::TdcBinWidth()); - } - TFile * file = new TFile("ToT.root", "recreate"); - file->cd(); - ChArray.Write("ToT",TObject::kSingleKey); - file->Close(); - delete file; - ChArray.Clear(); - return digits; -} -//____________________________________________________________________________ - -void AliTOFcalib::SelectESD(AliESD *event, AliRunLoader *rl) +void AliTOFcalib::SelectESD(AliESD *event) { - AliLoader *tofl = rl->GetLoader("TOFLoader"); - if (tofl == 0x0) { - AliError("Can not get the TOF Loader"); - delete rl; - } - tofl->LoadRecPoints("read"); - TClonesArray *fClusters =new TClonesArray("AliTOFcluster", 1000); - TTree *rTree=tofl->TreeR(); - if (rTree == 0) { - cerr<<"Can't get the Rec Points tree !\n"; - delete rl; - } - TBranch *branch=rTree->GetBranch("TOF"); - if (!branch) { - cerr<<"Cant' get the branch !\n"; - delete rl; - } - branch->SetAddress(&fClusters); - rTree->GetEvent(0); Float_t LowerMomBound=0.8; // [GeV/c] default value Pb-Pb Float_t UpperMomBound=1.8 ; // [GeV/c] default value Pb-Pb Int_t ntrk =0; @@ -413,21 +223,8 @@ void AliTOFcalib::SelectESD(AliESD *event, AliRunLoader *rl) if(AssignedTOFcluster==0){ // not matched continue; } - AliTOFcluster * tofcl = (AliTOFcluster *)fClusters->UncheckedAt(AssignedTOFcluster); - Int_t isector = tofcl->GetDetInd(0); - Int_t iplate = tofcl->GetDetInd(1); - Int_t istrip = tofcl->GetDetInd(2); - Int_t ipadz = tofcl->GetDetInd(3); - Int_t ipadx = tofcl->GetDetInd(4); - Float_t ToT = tofcl->GetToT(); AliTOFcalibESD *unc = new AliTOFcalibESD; unc->CopyFromAliESD(t); - unc->SetSector(isector); - unc->SetPlate(iplate); - unc->SetStrip(istrip); - unc->SetPadz(ipadz); - unc->SetPadx(ipadx); - unc->SetToT(ToT); Double_t c1[15]; unc->GetExternalCovariance(c1); UCdatatemp.Add(unc); @@ -609,10 +406,10 @@ void AliTOFcalib::CombESDId(){ void AliTOFcalib::CalibrateESD(){ Int_t nelements = fESDsel->GetEntries(); - Int_t *number=new Int_t[fsize]; - fArrayToT = new AliTOFArray(fsize); - fArrayTime = new AliTOFArray(fsize); - for (Int_t i=0; iAddArray(i, new TArrayF(fgkchannel)); TArrayF * parrToT = fArrayToT->GetArray(i); @@ -638,18 +435,9 @@ void AliTOFcalib::CalibrateESD(){ else AliError("No pid from combinatorial algo for this track"); Double_t mtime = (Double_t)element->GetTOFsignal()*1E-3; //measured time Double_t mToT = (Double_t) element->GetToT(); //measured ToT, ns - /* - Int_t *detId[5]; - detId[0] = element->GetSector(); - detId[1] = element->GetPlate(); - detId[2] = element->GetStrip(); - detId[3] = element->GetPadz(); - detId[4] = element->GetPadx(); - Int_t index = GetIndex(detId); - */ //select the correspondent channel with its simulated ToT spectrum //summing up everything, index = 0 for all channels: - Int_t index = 0; + Int_t index = element->GetTOFCalChannel(); Int_t index2 = number[index]; TArrayF * parrToT = fArrayToT->GetArray(index); TArrayF & refaToT = * parrToT; @@ -776,18 +564,10 @@ void AliTOFcalib::CorrectESDTime(){ Int_t nelements = fESDsel->GetEntries(); for (Int_t i=0; i< nelements; i++) { AliTOFcalibESD *element=(AliTOFcalibESD*)fESDsel->At(i); - /* - Int_t *detId[5]; - detId[0] = element->GetSector(); - detId[1] = element->GetPlate(); - detId[2] = element->GetStrip(); - detId[3] = element->GetPadz(); - detId[4] = element->GetPadx(); - Int_t index = GetIndex(detId); - */ + Int_t index = element->GetTOFCalChannel(); + Float_t ToT = element->GetToT(); //select the correspondent channel with its simulated ToT spectrum //summing up everything, index = 0 for all channels: - Int_t index = 0; Int_t ipid = element->GetCombID(); Double_t etime = 0; //expected time Double_t expTime[10]; @@ -800,31 +580,14 @@ void AliTOFcalib::CorrectESDTime(){ for (Int_t j = 0; j<6; j++){ par[j]=CalChannel->GetSlewPar(j); } - //Float_t TimeCorr=par[0]+par[1]*ToT+par[2]*ToT*ToT+par[3]*ToT*ToT*ToT+par[4]*ToT*ToT*ToT*ToT+par[5]*ToT*ToT*ToT*ToT*ToT; + Float_t TimeCorr=0; + TimeCorr= par[0]+par[1]*ToT+par[2]*ToT*ToT+par[3]*ToT*ToT*ToT+par[4]*ToT*ToT*ToT*ToT+par[5]*ToT*ToT*ToT*ToT*ToT; } } //_____________________________________________________________________________ -void AliTOFcalib::CorrectESDTime(AliESD *event, AliRunLoader *rl ){ - AliLoader *tofl = rl->GetLoader("TOFLoader"); - if (tofl == 0x0) { - AliError("Can not get the TOF Loader"); - delete rl; - } - tofl->LoadRecPoints("read"); - TClonesArray *fClusters =new TClonesArray("AliTOFcluster", 1000); - TTree *rTree=tofl->TreeR(); - if (rTree == 0) { - cerr<<"Can't get the Rec Points tree !\n"; - delete rl; - } - TBranch *branch=rTree->GetBranch("TOF"); - if (!branch) { - cerr<<"Cant' get the branch !\n"; - delete rl; - } - branch->SetAddress(&fClusters); - rTree->GetEvent(0); +void AliTOFcalib::CorrectESDTime(AliESD *event){ + Int_t ntrk =0; ntrk=event->GetNumberOfTracks(); for (Int_t itrk=0; itrkUncheckedAt(AssignedTOFcluster); - /* - Int_t *detId[5]; - detId[0] = tofcl->GetSector(); - detId[1] = tofcl->GetPlate(); - detId[2] = tofcl->GetStrip(); - detId[3] = tofcl->GetPadz(); - detId[4] = tofcl->GetPadx(); - Int_t index = GetIndex(detId); - */ - //select the correspondent channel with its simulated ToT spectrum - //summing up everything, index = 0 for all channels: - Int_t index = 0; + Int_t index = t->GetTOFCalChannel(); AliTOFChannel * CalChannel = fTOFCal->GetChannel(index); Float_t par[6]; for (Int_t j = 0; j<6; j++){ par[j]=CalChannel->GetSlewPar(j); } - Float_t ToT = tofcl->GetToT(); + Float_t ToT = t->GetTOFsignalToT(); Float_t TimeCorr =0; TimeCorr=par[0]+par[1]*ToT+par[2]*ToT*ToT+par[3]*ToT*ToT*ToT+par[4]*ToT*ToT*ToT*ToT+par[5]*ToT*ToT*ToT*ToT*ToT; } } //_____________________________________________________________________________ -void AliTOFcalib::WriteOnCDB(){ +void AliTOFcalib::WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun){ AliCDBManager *man = AliCDBManager::Instance(); - AliCDBId id("TOF/Calib/Constants",1,100); + if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT"); + Char_t *sel1 = "CalibPar" ; + Char_t out[100]; + sprintf(out,"%s/%s",sel,sel1); + AliCDBId id(out,minrun,maxrun); AliCDBMetaData *md = new AliCDBMetaData(); - md->SetResponsible("Shimmize"); + md->SetResponsible("Chiara Zampolli"); man->Put(fTOFCal,id,md); } //_____________________________________________________________________________ -void AliTOFcalib::ReadFromCDB(Char_t *sel, Int_t nrun){ +void AliTOFcalib::WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal){ AliCDBManager *man = AliCDBManager::Instance(); - AliCDBEntry *entry = man->Get(sel,nrun); - if (!entry){ - AliError("Retrivial failed"); - AliCDBStorage *origSto =man->GetDefaultStorage(); - man->SetDefaultStorage("local://$ALICE_ROOT"); - entry = man->Get("TOF/Calib/Constants",nrun); - man->SetDefaultStorage(origSto); - } + if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT"); + Char_t *sel1 = "CalibPar" ; + Char_t out[100]; + sprintf(out,"%s/%s",sel,sel1); + AliCDBId id(out,minrun,maxrun); + AliCDBMetaData *md = new AliCDBMetaData(); + md->SetResponsible("Chiara Zampolli"); + man->Put(cal,id,md); +} +//_____________________________________________________________________________ + +void AliTOFcalib::ReadParFromCDB(Char_t *sel, Int_t nrun){ + AliCDBManager *man = AliCDBManager::Instance(); + if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT"); + Char_t *sel1 = "CalibPar" ; + Char_t out[100]; + sprintf(out,"%s/%s",sel,sel1); + AliCDBEntry *entry = man->Get(out,nrun); AliTOFCal *cal =(AliTOFCal*)entry->GetObject(); fTOFCal = cal; } //_____________________________________________________________________________ +void AliTOFcalib::WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun){ + + + //for the time being, only one spectrum is used + TFile *spFile = new TFile("$ALICE_ROOT/TOF/data/spectrum.root","read"); + TH1F * hToT; + // Retrieve ToT Spectrum + spFile->GetObject("ToT",hToT); + + fTOFSimToT=hToT; + + // Retrieve Time over TOT dependence + + TH1F * h = (TH1F*)spFile->Get("TimeToTFit"); + TList * list = (TList*)h->GetListOfFunctions(); + TF1* f = (TF1*)list->At(0); + Float_t par[6] = {0,0,0,0,0,0}; + Int_t npar=f->GetNpar(); + for (Int_t ipar=0;iparGetParameter(ipar); + } + + for(Int_t iTOFch=0; iTOFchNPads();iTOFch++){ + AliTOFChannel * CalChannel = fTOFSimCal->GetChannel(iTOFch); + CalChannel->SetSlewPar(par); + } + + // Store them in the CDB + + AliCDBManager *man = AliCDBManager::Instance(); + if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT"); + AliCDBMetaData *md = new AliCDBMetaData(); + md->SetResponsible("Chiara Zampolli"); + Char_t *sel1 = "CalibSimPar" ; + Char_t out[100]; + sprintf(out,"%s/%s",sel,sel1); + AliCDBId id1(out,minrun,maxrun); + man->Put(fTOFSimCal,id1,md); + Char_t *sel2 = "CalibSimHisto" ; + sprintf(out,"%s/%s",sel,sel2); + AliCDBId id2(out,minrun,maxrun); + man->Put(fTOFSimToT,id2,md); +} + +//_____________________________________________________________________________ +void AliTOFcalib::WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal, TH1F * histo){ + + // Retrieve ToT Spectrum + fTOFSimToT=histo; + fTOFSimCal=cal; + AliCDBManager *man = AliCDBManager::Instance(); + if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT"); + AliCDBMetaData *md = new AliCDBMetaData(); + md->SetResponsible("Chiara Zampolli"); + Char_t *sel1 = "CalibSimPar" ; + Char_t out[100]; + sprintf(out,"%s/%s",sel,sel1); + AliCDBId id1(out,minrun,maxrun); + man->Put(fTOFSimCal,id1,md); + Char_t *sel2 = "CalibSimHisto" ; + sprintf(out,"%s/%s",sel,sel2); + AliCDBId id2(out,minrun,maxrun); + man->Put(fTOFSimToT,id2,md); +} +//_____________________________________________________________________________ +void AliTOFcalib::ReadSimParFromCDB(Char_t *sel, Int_t nrun){ + AliCDBManager *man = AliCDBManager::Instance(); + if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT"); + AliCDBMetaData *md = new AliCDBMetaData(); + md->SetResponsible("Chiara Zampolli"); + Char_t *sel1 = "CalibSimPar" ; + Char_t out[100]; + sprintf(out,"%s/%s",sel,sel1); + AliCDBEntry *entry1 = man->Get(out,nrun); + AliTOFCal *cal =(AliTOFCal*)entry1->GetObject(); + fTOFSimCal=cal; + Char_t *sel2 = "CalibSimHisto" ; + sprintf(out,"%s/%s",sel,sel2); + AliCDBEntry *entry2 = man->Get(out,nrun); + TH1F *histo =(TH1F*)entry2->GetObject(); + fTOFSimToT=histo; +} +//_____________________________________________________________________________ Int_t AliTOFcalib::GetIndex(Int_t *detId){ Int_t isector = detId[0]; diff --git a/TOF/AliTOFcalib.h b/TOF/AliTOFcalib.h index 4b99162fd92..9e943115534 100644 --- a/TOF/AliTOFcalib.h +++ b/TOF/AliTOFcalib.h @@ -16,14 +16,12 @@ #include "AliTOFCal.h" #include "AliTOFGeometry.h" #include "AliESD.h" -#include "AliRunLoader.h" class AliTOFcalib:public TTask{ public: AliTOFcalib(); // ctor - AliTOFcalib(char* headerFile, Int_t nEvents=0) ; + AliTOFcalib(AliTOFGeometry *geom); AliTOFcalib(const AliTOFcalib & calib); - void Init(); virtual ~AliTOFcalib() ; // dtor Int_t NSector()const {return fNSector;} Int_t NPlate()const {return fNPlate;} @@ -32,22 +30,25 @@ public: Int_t NStripC()const {return fNStripC;} Int_t NpadZ()const {return fNpadZ;} Int_t NpadX()const {return fNpadX;} - TClonesArray * DecalibrateDigits(TClonesArray *digits); - void SelectESD(AliESD *event, AliRunLoader * rl); + AliTOFCal * GetTOFCalArray() const {return fTOFCal;} + AliTOFCal * GetTOFCalSimArray() const {return fTOFSimCal;} + TH1F * GetTOFSimToT() const {return fTOFSimToT;} + void SelectESD(AliESD *event); void CombESDId(); void CalibrateESD(); TH1F* Profile(Int_t i); - Int_t Size()const{return fsize;} - void SetFitFunctions(); + Int_t NChannels()const{return fNChannels;} TF1* SetFitFunctions(TH1F* histo); - TList* GetFitFunctions() {return flistFunc;} - TH1F** GetHistosToT() {return fhToT;} - void SetHistos(); - void CorrectESDTime(); - void CorrectESDTime(AliESD *event, AliRunLoader *rl); - void WriteOnCDB(); - void ReadFromCDB(Char_t *sel, Int_t nrun); - Int_t GetIndex(Int_t *detId); + void CorrectESDTime();// useless method, kept to make Chiara happy + void CorrectESDTime(AliESD *event); + // Methods to retrieve/write parameters from/on CDB + void WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun); + void WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal, TH1F *histo); + void ReadSimParFromCDB(Char_t *sel, Int_t nrun); + void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun, AliTOFCal *cal); + void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun); + void ReadParFromCDB(Char_t *sel, Int_t nrun); + Int_t GetIndex(Int_t *detId); // Get channel index for Calibration public: class AliTOFArray : public TObject { @@ -87,8 +88,7 @@ public: private: static const Int_t fgkchannel; // max number of entries per channel - static const Char_t * ffile[6]; // spectra - Int_t fsize; // number of channels + Int_t fNChannels; // number of TOF channels Int_t fNSector; // number of TOF sectors Int_t fNPlate; // number of TOF plates Int_t fNStripA; // number of TOF strips A @@ -96,19 +96,13 @@ private: Int_t fNStripC; // number of TOF strips C Int_t fNpadZ; // number of TOF pads Z Int_t fNpadX; // number of TOF pads X + Int_t fNevents; // number of events TObjArray * fESDsel; // selected ESD tracks for calibration - TList *flistFunc; // functions for simulated Time Slewing spectra - TH1F* fhToT[6]; // simulated ToT distributions - Float_t fMaxToT[6]; // max simulated ToT - Float_t fMinToT[6]; // min simulated ToT - Float_t fMaxToTDistr[6]; // max value in the ToT distributions AliTOFArray *fArrayToT; // array for ToT values AliTOFArray *fArrayTime; // array for Time values - Int_t fNevents; // number of events AliTOFCal *fTOFCal; // array of AliTOFChannels storing calib parameters - TString fT0File ; // output file; - TString fHeadersFile; // input file - AliTOFGeometry *fGeom; // AliTOFgeometry pointer + AliTOFCal *fTOFSimCal; // array of AliTOFChannels storing calib parameters + TH1F *fTOFSimToT; // histo with realistic ToT signal from TB Data ClassDef(AliTOFcalib,1); }; diff --git a/TOF/AliTOFcalibESD.cxx b/TOF/AliTOFcalibESD.cxx index 37a392b0735..61b57deb025 100644 --- a/TOF/AliTOFcalibESD.cxx +++ b/TOF/AliTOFcalibESD.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.2 2006/02/13 17:22:26 arcelli +just Fixing Log info + Revision 1.1 2006/02/13 16:10:48 arcelli Add classes for TOF Calibration (C.Zampolli) @@ -28,23 +31,17 @@ author: Chiara Zampolli, zampolli@bo.infn.it /////////////////////////////////////////////////////////////////////////////// #include "AliTOFcalibESD.h" -#include -#include ClassImp(AliTOFcalibESD) //________________________________________________________________ AliTOFcalibESD::AliTOFcalibESD(): + fTOFCalChannel(-1), fToT(0), fIntLen(0), fTOFtime(0), fP(0), - fSector(-1), - fPlate(-1), - fStrip(-1), - fPadz(-1), - fPadx(-1), fTOFsignalND(0) { for (Int_t i=0;iGetP(); fTOFtime = track->GetTOFsignal(); + fToT = track->GetTOFsignalToT(); + fTOFCalChannel = track->GetTOFCalChannel(); fIntLen = track->GetIntegratedLength(); Double_t exptime[10]; track->GetIntegratedTimes(exptime); diff --git a/TOF/AliTOFcalibESD.h b/TOF/AliTOFcalibESD.h index 45862c34f28..b0d758e88b3 100644 --- a/TOF/AliTOFcalibESD.h +++ b/TOF/AliTOFcalibESD.h @@ -27,39 +27,27 @@ public: void GetIntegratedTimes(Double_t exp[AliPID::kSPECIES]) const; Int_t GetCombID()const{return fCombID;} Float_t GetP()const{return fP;} - Int_t GetSector() const {return fSector;} - Int_t GetPlate() const {return fPlate;} - Int_t GetStrip() const {return fStrip;} - Int_t GetPadz() const {return fPadz;} - Int_t GetPadx() const {return fPadz;} + Int_t GetTOFCalChannel() const {return fTOFCalChannel;} void SetToT(Float_t ToT) {fToT=ToT;} void SetTOFtime(Float_t TOFtime) {fTOFtime=TOFtime;} void SetTOFsignalND(Float_t TOFtimeND) {fTOFsignalND=TOFtimeND;} void SetP(Double_t p) {fP=p;} void SetIntegratedTime(const Double_t *tracktime); void SetCombID(Int_t ID){fCombID = ID;} // 0->pi, 1->K, 2->p + void SetTOFCalChannel(Int_t index){fTOFCalChannel=index;} void CopyFromAliESD(const AliESDtrack* track); Bool_t IsSortable() const {return kTRUE;} Int_t Compare(const TObject *uncobj) const; - void SetSector(Int_t isector) {fSector=isector;} - void SetPlate(Int_t iplate) {fPlate=iplate;} - void SetStrip(Int_t istrip) {fStrip=istrip;} - void SetPadz(Int_t ipadz) {fPadz=ipadz;} - void SetPadx(Int_t ipadx) {fPadx=ipadx;} private: + Int_t fCombID; + Int_t fTOFCalChannel; Float_t fToT; Float_t fIntLen; Float_t fTOFtime; Double_t fP; + Float_t fTOFsignalND; Double_t fTrackTime[AliPID::kSPECIES]; // TOFs estimated by the tracking Double_t fExtCov[15]; - Int_t fCombID; - Int_t fSector; - Int_t fPlate; - Int_t fStrip; - Int_t fPadz; - Int_t fPadx; - Float_t fTOFsignalND; ClassDef(AliTOFcalibESD,1); }; -- 2.43.0