From: hristov Date: Sun, 16 Apr 2006 22:29:05 +0000 (+0000) Subject: Coding conventions (Annalisa) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=7aeeaf386766e22f97e34cd5ec1d0f2e2c8b839f;p=u%2Fmrichter%2FAliRoot.git Coding conventions (Annalisa) --- diff --git a/TOF/AliTOF.cxx b/TOF/AliTOF.cxx index 1ca7cf51623..741d01693fb 100644 --- a/TOF/AliTOF.cxx +++ b/TOF/AliTOF.cxx @@ -160,6 +160,30 @@ AliTOF::AliTOF(const char *name, const char *title, Option_t *option) } +//_____________________________________________________________________________ +AliTOF::AliTOF(const AliTOF &source) + :AliDetector() +{ + // copy constructor + + this->fReconParticles=source.fReconParticles; + this->fSDigits=source.fSDigits; + this->fTOFGeometry=source.fTOFGeometry; + +} + +//_____________________________________________________________________________ +AliTOF& AliTOF::operator=(const AliTOF &source) +{ + // ass. op. + + this->fReconParticles=source.fReconParticles; + this->fSDigits=source.fSDigits; + this->fTOFGeometry=source.fTOFGeometry; + return *this; + +} + //_____________________________________________________________________________ void AliTOF::CreateTOFFolders() { @@ -411,7 +435,7 @@ void AliTOF::DrawModule() const } //_____________________________________________________________________________ -Int_t AliTOF::DistancetoPrimitive(Int_t , Int_t ) +Int_t AliTOF::DistancetoPrimitive(Int_t , Int_t ) const { // // Returns distance from mouse pointer to detector, default version diff --git a/TOF/AliTOF.h b/TOF/AliTOF.h index 844b9ea4b31..0f5594af609 100644 --- a/TOF/AliTOF.h +++ b/TOF/AliTOF.h @@ -36,6 +36,9 @@ class AliTOF : public AliDetector { public: AliTOF(); AliTOF(const char *name, const char *title, Option_t *option="noTimeZero"); + AliTOF(const AliTOF &source); // copy constructor + AliTOF& operator=(const AliTOF &source); // ass. op. + virtual ~AliTOF() ; // getters for AliTOF object status //Float_t GetTimeRes() const {return fTimeRes;}; @@ -55,15 +58,15 @@ public: virtual void Makehits(Bool_t hits=1); virtual void FinishEvent(); virtual Int_t IsVersion() const =0; - Int_t DistancetoPrimitive(Int_t px, Int_t py); + Int_t DistancetoPrimitive(Int_t px, Int_t py) const; virtual void StepManager()=0; virtual void TOFpc(Float_t /*xtof*/, Float_t /*ytof*/, Float_t /*zlenC*/, Float_t /*zlenB*/, Float_t /*zlenA*/, Float_t /*ztof0*/){}; virtual void TOFpc(Float_t /*xtof*/, Float_t /*ytof*/, Float_t /*zlenA*/, Float_t /*zlenB*/){}; virtual void DrawModule() const; - virtual void DrawDetectorModules()=0; - virtual void DrawDetectorStrips()=0; + virtual void DrawDetectorModules() const {}; + virtual void DrawDetectorStrips() const {}; //virtual void DrawDetectorModulesinFrame()=0; //virtual void DrawDetectorStripsinFrame()=0; void CreateTOFFolders(); diff --git a/TOF/AliTOFAlignment.cxx b/TOF/AliTOFAlignment.cxx index 167d95916e4..e4170dc5d4b 100644 --- a/TOF/AliTOFAlignment.cxx +++ b/TOF/AliTOFAlignment.cxx @@ -12,6 +12,9 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * $Log$ +Revision 1.4 2006/04/05 08:35:38 hristov +Coding conventions (S.Arcelli, C.Zampolli) + Revision 1.3 2006/03/31 13:49:07 arcelli Removing some junk printout @@ -58,6 +61,16 @@ AliTOFAlignment::AliTOFAlignment(const AliTOFAlignment &t):TTask("AliTOFAlignmen } +//_____________________________________________________________________________ +AliTOFAlignment& AliTOFAlignment::operator=(const AliTOFAlignment &t){ + //AliTOFAlignment assignment operator + + this->fNTOFAlignObj=t.fNTOFAlignObj; + this->fTOFAlignObjArray=t.fTOFAlignObjArray; + return *this; + +} + //_____________________________________________________________________________ void AliTOFAlignment::Smear( Float_t *tr, Float_t *rot) { diff --git a/TOF/AliTOFAlignment.h b/TOF/AliTOFAlignment.h index a4e8fb5bf50..639daa217b6 100644 --- a/TOF/AliTOFAlignment.h +++ b/TOF/AliTOFAlignment.h @@ -19,7 +19,8 @@ public: AliTOFAlignment(); AliTOFAlignment(const AliTOFAlignment &t); //Copy Ctor - virtual ~AliTOFAlignment() {delete fTOFAlignObjArray;} + AliTOFAlignment& operator=(const AliTOFAlignment &source); // Assignment Operator + virtual ~AliTOFAlignment() {delete fTOFAlignObjArray;} virtual void WriteParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun); virtual void ReadParFromCDB(Char_t *sel, Int_t nrun); virtual void WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun); @@ -32,10 +33,9 @@ public: private: - Int_t fNTOFAlignObj; // Number of Alignable Objects - TObjArray *fTOFAlignObjArray; - ClassDef(AliTOFAlignment,1) // TOF Alignment + Int_t fNTOFAlignObj; // Number of Alignable Objects + TObjArray *fTOFAlignObjArray; // Pointer to the TOF alignable objects + ClassDef(AliTOFAlignment,1) // TOF Alignment }; #endif - diff --git a/TOF/AliTOFCal.cxx b/TOF/AliTOFCal.cxx index 8e89579dd95..dd920075678 100644 --- a/TOF/AliTOFCal.cxx +++ b/TOF/AliTOFCal.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2006/04/05 08:35:38 hristov +Coding conventions (S.Arcelli, C.Zampolli) + Revision 1.3 2006/03/28 14:56:48 arcelli updates to handle new V5 geometry & some re-arrangements @@ -99,6 +102,24 @@ AliTOFCal::AliTOFCal(const AliTOFCal& cal): gROOT->GetListOfBrowsables()->Add(this); } //____________________________________________________________________________ +AliTOFCal& AliTOFCal::operator=(const AliTOFCal& cal) + { + //assignment operator + this->fNSector = cal.fNSector; + this->fNPlate = cal.fNPlate; + this->fNStripA = cal.fNStripA; + this->fNStripB = cal.fNStripB; + this->fNStripC = cal.fNStripC; + this->fNpadZ = cal.fNpadZ; + this->fNpadX = cal.fNpadX; + this->fnpad = cal.fnpad; + for (Int_t i = 0; ifPads[i]=cal.fPads[i]; + } + return *this; + + } +//____________________________________________________________________________ AliTOFCal::~AliTOFCal() { //dtor diff --git a/TOF/AliTOFCal.h b/TOF/AliTOFCal.h index 41ece81c11f..b07b92004e9 100644 --- a/TOF/AliTOFCal.h +++ b/TOF/AliTOFCal.h @@ -24,6 +24,7 @@ class AliTOFCal: public TObject AliTOFCal(); AliTOFCal(AliTOFGeometry *geom); AliTOFCal(const AliTOFCal& cal); + AliTOFCal& operator=(const AliTOFCal &source); // ass. op. virtual ~AliTOFCal(); void Browse(TBrowser *b); Bool_t IsFolder() const{return kTRUE;} diff --git a/TOF/AliTOFCalPadZ.cxx b/TOF/AliTOFCalPadZ.cxx index 64d8b4cc685..e9825b154a0 100644 --- a/TOF/AliTOFCalPadZ.cxx +++ b/TOF/AliTOFCalPadZ.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2006/04/05 08:35:38 hristov +Coding conventions (S.Arcelli, C.Zampolli) + Revision 1.3 2006/03/28 14:57:30 arcelli updates to handle new V5 geometry & some re-arrangements @@ -74,6 +77,27 @@ AliTOFCalPadZ::AliTOFCalPadZ(AliTOFGeometry *geom,AliTOFChannel *ch): fGeom = geom; fNpadX = fGeom->NpadX(); } + +//________________________________________________________________ +AliTOFCalPadZ::AliTOFCalPadZ(const AliTOFCalPadZ &source) + :TObject() +{ + // copy constructor + + this->fGeom=source.fGeom; + +} + +//_____________________________________________________________________________ +AliTOFCalPadZ& AliTOFCalPadZ::operator=(const AliTOFCalPadZ &source) +{ + // assignment operator + + this->fGeom=source.fGeom; + return *this; + +} + //________________________________________________________________ AliTOFCalPadZ::~AliTOFCalPadZ() diff --git a/TOF/AliTOFCalPadZ.h b/TOF/AliTOFCalPadZ.h index e13ff94473a..ebcb883cf45 100644 --- a/TOF/AliTOFCalPadZ.h +++ b/TOF/AliTOFCalPadZ.h @@ -25,6 +25,8 @@ class AliTOFCalPadZ: public TObject AliTOFCalPadZ(AliTOFChannel *ch); AliTOFCalPadZ(AliTOFGeometry *geom); AliTOFCalPadZ(AliTOFGeometry *geom,AliTOFChannel *ch); + AliTOFCalPadZ(const AliTOFCalPadZ &source); // copy constructor + AliTOFCalPadZ& operator=(const AliTOFCalPadZ &source); // ass. op. virtual ~AliTOFCalPadZ(); Int_t NpadX()const {return fNpadX;} void Browse(TBrowser *b); diff --git a/TOF/AliTOFCalPlateA.cxx b/TOF/AliTOFCalPlateA.cxx index 3bdfdb4ab37..7a911ab3c4e 100644 --- a/TOF/AliTOFCalPlateA.cxx +++ b/TOF/AliTOFCalPlateA.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2006/04/05 08:35:38 hristov +Coding conventions (S.Arcelli, C.Zampolli) + Revision 1.3 2006/03/28 14:57:40 arcelli updates to handle new V5 geometry & some re-arrangements @@ -108,6 +111,19 @@ AliTOFCalPlateA::AliTOFCalPlateA(const AliTOFCalPlateA& pl): } //________________________________________________________________ +AliTOFCalPlateA& AliTOFCalPlateA::operator=(const AliTOFCalPlateA& pl) + { + //assignment operator + this->fCh = pl.fCh; + this->fNStripA = pl.fNStripA; + this->fNpadZ = pl.fNpadZ; + this->fNpadX = pl.fNpadX; + this->fGeom = pl.fGeom; + return *this; + + } +//________________________________________________________________ + void AliTOFCalPlateA::Browse(TBrowser *b){ //add cal obj to list of browsables diff --git a/TOF/AliTOFCalPlateA.h b/TOF/AliTOFCalPlateA.h index 5ac46366032..7afd5ea940c 100644 --- a/TOF/AliTOFCalPlateA.h +++ b/TOF/AliTOFCalPlateA.h @@ -26,6 +26,7 @@ class AliTOFCalPlateA: public TObject AliTOFCalPlateA(AliTOFChannel *ch); AliTOFCalPlateA(AliTOFGeometry *geom,AliTOFChannel *ch); AliTOFCalPlateA(const AliTOFCalPlateA& pl); + AliTOFCalPlateA& operator=(const AliTOFCalPlateA &source); // ass. op. virtual ~AliTOFCalPlateA(); Int_t NStripA()const {return fNStripA;} Int_t NpadZ()const {return fNpadZ;} diff --git a/TOF/AliTOFCalPlateB.cxx b/TOF/AliTOFCalPlateB.cxx index 7bda20c0480..89c35729793 100644 --- a/TOF/AliTOFCalPlateB.cxx +++ b/TOF/AliTOFCalPlateB.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2006/04/05 08:35:38 hristov +Coding conventions (S.Arcelli, C.Zampolli) + Revision 1.3 2006/03/28 14:57:48 arcelli updates to handle new V5 geometry & some re-arrangements @@ -109,6 +112,19 @@ AliTOFCalPlateB::AliTOFCalPlateB(const AliTOFCalPlateB& pl): } //________________________________________________________________ +AliTOFCalPlateB& AliTOFCalPlateB::operator=(const AliTOFCalPlateB& pl) + { + //assignment operator + this->fCh = pl.fCh; + this->fNStripB = pl.fNStripB; + this->fNpadZ = pl.fNpadZ; + this->fNpadX = pl.fNpadX; + this->fGeom = pl.fGeom; + return *this; + + } +//________________________________________________________________ + void AliTOFCalPlateB::Browse(TBrowser *b){ //add cal obj to list of browsables diff --git a/TOF/AliTOFCalPlateB.h b/TOF/AliTOFCalPlateB.h index 6f72af20d01..c323af68995 100644 --- a/TOF/AliTOFCalPlateB.h +++ b/TOF/AliTOFCalPlateB.h @@ -26,6 +26,7 @@ class AliTOFCalPlateB: public TObject AliTOFCalPlateB(AliTOFChannel *ch); AliTOFCalPlateB(AliTOFGeometry *geom,AliTOFChannel *ch); AliTOFCalPlateB(const AliTOFCalPlateB& pl); + AliTOFCalPlateB& operator=(const AliTOFCalPlateB &source); // ass. op. virtual ~AliTOFCalPlateB(); Int_t NStripB()const {return fNStripB;} Int_t NpadZ()const {return fNpadZ;} diff --git a/TOF/AliTOFCalPlateC.cxx b/TOF/AliTOFCalPlateC.cxx index 7f6eaf6069c..6d32bac3582 100644 --- a/TOF/AliTOFCalPlateC.cxx +++ b/TOF/AliTOFCalPlateC.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2006/04/05 08:35:38 hristov +Coding conventions (S.Arcelli, C.Zampolli) + Revision 1.3 2006/03/28 14:57:56 arcelli updates to handle new V5 geometry & some re-arrangements @@ -88,6 +91,19 @@ AliTOFCalPlateC::AliTOFCalPlateC(AliTOFGeometry *geom, AliTOFChannel *ch): fCh(c //________________________________________________________________ +AliTOFCalPlateC& AliTOFCalPlateC::operator=(const AliTOFCalPlateC& pl) + { + //assignment operator + this->fCh = pl.fCh; + this->fNStripC = pl.fNStripC; + this->fNpadZ = pl.fNpadZ; + this->fNpadX = pl.fNpadX; + this->fGeom = pl.fGeom; + return *this; + + } +//________________________________________________________________ + AliTOFCalPlateC::~AliTOFCalPlateC() { //dtor diff --git a/TOF/AliTOFCalPlateC.h b/TOF/AliTOFCalPlateC.h index 51301bd11f3..1fb1ade8ce1 100644 --- a/TOF/AliTOFCalPlateC.h +++ b/TOF/AliTOFCalPlateC.h @@ -26,6 +26,7 @@ class AliTOFCalPlateC: public TObject AliTOFCalPlateC(AliTOFChannel *ch); AliTOFCalPlateC(AliTOFGeometry *geom,AliTOFChannel *ch); AliTOFCalPlateC(const AliTOFCalPlateC& pl); + AliTOFCalPlateC& operator=(const AliTOFCalPlateC &source); // ass. op. virtual ~AliTOFCalPlateC(); Int_t NStripC()const {return fNStripC;} Int_t NpadZ()const {return fNpadZ;} diff --git a/TOF/AliTOFCalSector.cxx b/TOF/AliTOFCalSector.cxx index 9771fea22e6..ddd5e5474f7 100644 --- a/TOF/AliTOFCalSector.cxx +++ b/TOF/AliTOFCalSector.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2006/04/05 08:35:38 hristov +Coding conventions (S.Arcelli, C.Zampolli) + Revision 1.3 2006/03/28 14:58:16 arcelli updates to handle new V5 geometry & some re-arrangements @@ -126,6 +129,22 @@ AliTOFCalSector::AliTOFCalSector(const AliTOFCalSector& sec): } //________________________________________________________________ +AliTOFCalSector& AliTOFCalSector::operator=(const AliTOFCalSector& sec) + { + //assignment operator + this->fCh = sec.fCh; + this->fNPlate = sec.fNPlate; + this->fNStripA = sec.fNStripA; + this->fNStripB = sec.fNStripB; + this->fNStripC = sec.fNStripC; + this->fNpadZ = sec.fNpadZ; + this->fNpadX = sec.fNpadX; + gROOT->GetListOfBrowsables()->Add(this); + return *this; + + } +//________________________________________________________________ + AliTOFCalSector::~AliTOFCalSector() { //dtor diff --git a/TOF/AliTOFCalSector.h b/TOF/AliTOFCalSector.h index 9b57588c3d6..4438a9b43c6 100644 --- a/TOF/AliTOFCalSector.h +++ b/TOF/AliTOFCalSector.h @@ -29,6 +29,7 @@ public: AliTOFCalSector(AliTOFGeometry *geom); AliTOFCalSector(AliTOFGeometry *geom, AliTOFChannel *ch); AliTOFCalSector(const AliTOFCalSector& sec); + AliTOFCalSector& operator=(const AliTOFCalSector &source); // ass. op. virtual ~AliTOFCalSector(); Int_t NPlate()const {return fNPlate;} Int_t NStripA()const {return fNStripA;} diff --git a/TOF/AliTOFCalStrip.cxx b/TOF/AliTOFCalStrip.cxx index 4807bd21e47..0c2d9603e94 100644 --- a/TOF/AliTOFCalStrip.cxx +++ b/TOF/AliTOFCalStrip.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2006/04/05 08:35:38 hristov +Coding conventions (S.Arcelli, C.Zampolli) + Revision 1.3 2006/03/28 14:58:08 arcelli updates to handle new V5 geometry & some re-arrangements @@ -104,6 +107,17 @@ AliTOFCalStrip::AliTOFCalStrip(const AliTOFCalStrip& strip): } //________________________________________________________________ +AliTOFCalStrip& AliTOFCalStrip::operator=(const AliTOFCalStrip& strip) + { + //assignment operator + this->fCh = strip.fCh; + this->fNpadZ = strip.fNpadZ; + this->fNpadX = strip.fNpadX; + return *this; + + } +//________________________________________________________________ + void AliTOFCalStrip::Browse(TBrowser *b){ //add obj to list of browsables if(fGeom==0x0){ diff --git a/TOF/AliTOFCalStrip.h b/TOF/AliTOFCalStrip.h index 92b630065fb..5e226a675d5 100644 --- a/TOF/AliTOFCalStrip.h +++ b/TOF/AliTOFCalStrip.h @@ -25,6 +25,7 @@ class AliTOFCalStrip: public TObject AliTOFCalStrip(); AliTOFCalStrip(AliTOFChannel *ch); AliTOFCalStrip(const AliTOFCalStrip& strip); + AliTOFCalStrip& operator=(const AliTOFCalStrip &source); // ass. op. virtual ~AliTOFCalStrip(); Int_t NpadZ()const {return fNpadZ;} Int_t NpadX()const {return fNpadX;} diff --git a/TOF/AliTOFClusterFinder.cxx b/TOF/AliTOFClusterFinder.cxx index bc792af4795..85ee8674dd4 100644 --- a/TOF/AliTOFClusterFinder.cxx +++ b/TOF/AliTOFClusterFinder.cxx @@ -110,6 +110,28 @@ AliTOFClusterFinder::AliTOFClusterFinder(AliRunLoader* runLoader): in->cd(); fTOFGeometry = (AliTOFGeometry*)in->Get("TOFgeometry"); +} + +//------------------------------------------------------------------------ +AliTOFClusterFinder::AliTOFClusterFinder(const AliTOFClusterFinder &source) + :TObject() +{ + // copy constructor + this->fDigits=source.fDigits; + this->fRecPoints=source.fRecPoints; + this->fTOFGeometry=source.fTOFGeometry; + +} + +//------------------------------------------------------------------------ + AliTOFClusterFinder& AliTOFClusterFinder::operator=(const AliTOFClusterFinder &source) +{ + // ass. op. + this->fDigits=source.fDigits; + this->fRecPoints=source.fRecPoints; + this->fTOFGeometry=source.fTOFGeometry; + return *this; + } //______________________________________________________________________________ diff --git a/TOF/AliTOFClusterFinder.h b/TOF/AliTOFClusterFinder.h index 6c2714eb47e..681b23dd765 100644 --- a/TOF/AliTOFClusterFinder.h +++ b/TOF/AliTOFClusterFinder.h @@ -26,6 +26,8 @@ class AliTOFClusterFinder : public TObject AliTOFClusterFinder(); AliTOFClusterFinder(AliRunLoader* runLoader); + AliTOFClusterFinder(const AliTOFClusterFinder &source); // copy constructor + AliTOFClusterFinder& operator=(const AliTOFClusterFinder &source); // ass. op. virtual ~AliTOFClusterFinder(); void Digits2RecPoints(Int_t ievt); diff --git a/TOF/AliTOFDDLRawData.h b/TOF/AliTOFDDLRawData.h index 52556fb070d..6d45c65173f 100644 --- a/TOF/AliTOFDDLRawData.h +++ b/TOF/AliTOFDDLRawData.h @@ -30,7 +30,7 @@ class AliTOFDDLRawData:public TObject{ Int_t fVerbose; //Verbose level (0:no msg, 1:msg, 2:digits in txt files) Int_t fIndex; //number of 32 words to be stored into the output file - AliTOFGeometry *fTOFgeometry; // + AliTOFGeometry *fTOFgeometry; //Pointer to the TOF geometry ClassDef(AliTOFDDLRawData,1) diff --git a/TOF/AliTOFDigitMap.h b/TOF/AliTOFDigitMap.h index a42ab297714..a162cd7f839 100644 --- a/TOF/AliTOFDigitMap.h +++ b/TOF/AliTOFDigitMap.h @@ -58,7 +58,7 @@ class AliTOFDigitMap : public TObject Int_t fMaxIndex; // maximum index in hit map Int_t *fDigitMap; // ! [fMaxIndex] - AliTOFGeometry *fTOFGeometry; + AliTOFGeometry *fTOFGeometry; // Pointer to the TOF geometry ClassDef(AliTOFDigitMap,0) // Implements DigitMap as a 1-dim array }; diff --git a/TOF/AliTOFDigitizer.cxx b/TOF/AliTOFDigitizer.cxx index 914c2147ddc..7fcdc1e0089 100644 --- a/TOF/AliTOFDigitizer.cxx +++ b/TOF/AliTOFDigitizer.cxx @@ -79,6 +79,30 @@ AliTOFDigitizer::AliTOFDigitizer(AliRunDigitizer* manager) fGeom=0x0; } +//------------------------------------------------------------------------ +AliTOFDigitizer::AliTOFDigitizer(const AliTOFDigitizer &source) + :AliDigitizer(source) +{ + // copy constructor + this->fDigits=source.fDigits; + this->fSDigitsArray=source.fSDigitsArray; + this->fhitMap=source.fhitMap; + this->fGeom=source.fGeom; + +} + +//------------------------------------------------------------------------ + AliTOFDigitizer& AliTOFDigitizer::operator=(const AliTOFDigitizer &source) +{ + // ass. op. + this->fDigits=source.fDigits; + this->fSDigitsArray=source.fSDigitsArray; + this->fhitMap=source.fhitMap; + this->fGeom=source.fGeom; + return *this; + +} + //------------------------------------------------------------------------ AliTOFDigitizer::~AliTOFDigitizer() { @@ -236,7 +260,7 @@ void AliTOFDigitizer::CreateDigits() // start loop on number of slots for current sdigit for (Int_t islot = 0; islot < nslot; islot++) { Float_t digit[2]; // TOF digit variables - Int_t tracknum[kMAXDIGITS]; // contributing tracks for the current slot + Int_t tracknum[AliTOFSDigit::kMAXDIGITS]; // contributing tracks for the current slot Float_t tdc=tofsdigit->GetTdc(islot); digit[0]=tdc; Float_t adc=tofsdigit->GetAdc(islot); digit[1]=adc; diff --git a/TOF/AliTOFDigitizer.h b/TOF/AliTOFDigitizer.h index 092203bb74e..ac2c6b8d444 100644 --- a/TOF/AliTOFDigitizer.h +++ b/TOF/AliTOFDigitizer.h @@ -28,6 +28,8 @@ class AliTOFDigitizer : public AliDigitizer { AliTOFDigitizer(); AliTOFDigitizer(AliRunDigitizer * manager); virtual ~AliTOFDigitizer(); + AliTOFDigitizer(const AliTOFDigitizer &source); // copy constructor + AliTOFDigitizer& operator=(const AliTOFDigitizer &source); // ass. op. // Do the main work void Exec(Option_t* option=0) ; @@ -39,12 +41,17 @@ class AliTOFDigitizer : public AliDigitizer { private: void CollectSDigit(AliTOFSDigit * sdigit) ; - Int_t PutNoise(Int_t /*charge*/)const {return 0;}; // not yet implemented - // due to the low noise expected level - AliTOFGeometry *fGeom; // AliTOFgeometry pointer - TClonesArray *fDigits; //! array with digits - TClonesArray *fSDigitsArray; //! List of summable digits; used as a container for all sdigits to be merged - AliTOFHitMap *fhitMap ; //! hit map used to perform the merging + Int_t PutNoise(Int_t /*charge*/)const {return 0;}; // not yet + // implemented + // due to the low + // noise expected + // level + AliTOFGeometry *fGeom; // Pointer to the TOF geometry + TClonesArray *fDigits; //! array with digits + TClonesArray *fSDigitsArray; //! List of summable digits; used as a + //container for all sdigits to be + //merged + AliTOFHitMap *fhitMap ; //! hit map used to perform the merging ClassDef(AliTOFDigitizer,0) // TOF/Merging/Digitization }; diff --git a/TOF/AliTOFGeometry.cxx b/TOF/AliTOFGeometry.cxx index 51fba2ff924..a4057899176 100644 --- a/TOF/AliTOFGeometry.cxx +++ b/TOF/AliTOFGeometry.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.14 2006/04/05 08:35:38 hristov +Coding conventions (S.Arcelli, C.Zampolli) + Revision 1.13 2006/03/12 14:37:54 arcelli Changes for TOF Reconstruction using TGeo @@ -107,15 +110,15 @@ AliTOFGeometry::AliTOFGeometry() // AliTOFGeometry default constructor // - kNStripC = 19; // number of strips in C type module - kZlenA = 106.0; // length (cm) of the A module - kZlenB = 141.0; // length (cm) of the B module - kZlenC = 177.5; // length (cm) of the C module - kMaxhZtof = 371.5; // Max half z-size of TOF (cm) + fNStripC = 19; // number of strips in C type module + fZlenA = 106.0; // length (cm) of the A module + fZlenB = 141.0; // length (cm) of the B module + fZlenC = 177.5; // length (cm) of the C module + fMaxhZtof = 371.5; // Max half z-size of TOF (cm) - fgkxTOF = 371.; // Inner radius of the TOF for Reconstruction (cm) - fgkRmin = 370.; // Inner radius of the TOF (cm) - fgkRmax = 399.; // Outer radius of the TOF (cm) + fxTOF = 371.; // Inner radius of the TOF for Reconstruction (cm) + fRmin = 370.; // Inner radius of the TOF (cm) + fRmax = 399.; // Outer radius of the TOF (cm) Init(); @@ -190,7 +193,7 @@ void AliTOFGeometry::Init() } //_____________________________________________________________________________ -void AliTOFGeometry::GetPosPar(Int_t *det, Float_t *pos) +void AliTOFGeometry::GetPosPar(Int_t *det, Float_t *pos) const { // // Returns space point coor (x,y,z) (cm) for Detector @@ -203,7 +206,7 @@ void AliTOFGeometry::GetPosPar(Int_t *det, Float_t *pos) } //_____________________________________________________________________________ -void AliTOFGeometry::GetDetID( Float_t *pos, Int_t *det) +void AliTOFGeometry::GetDetID( Float_t *pos, Int_t *det) const { // // Returns Detector Indices (iSect,iPlate,iStrip,iPadX,iPadZ) diff --git a/TOF/AliTOFGeometry.h b/TOF/AliTOFGeometry.h index 02f19c0bafc..fac9380b571 100644 --- a/TOF/AliTOFGeometry.h +++ b/TOF/AliTOFGeometry.h @@ -23,7 +23,7 @@ class AliTOFGeometry: public TObject{ static Int_t NStripA() { return kNStripA;}; static Int_t NStripB() { return kNStripB;}; - virtual Int_t NStripC() const { return kNStripC;}; + virtual Int_t NStripC() const { return fNStripC;}; static Int_t NMaxNstrip() { return kMaxNstrip;}; static Int_t NpadX() { return kNpadX;}; static Int_t NpadZ() { return kNpadZ;}; @@ -31,11 +31,11 @@ class AliTOFGeometry: public TObject{ static Int_t NSectors() { return kNSectors;}; static Int_t NPlates() { return kNPlates;}; virtual Int_t NPadXSector() const { return (kNStripA + 2*kNStripB + - 2*kNStripC)*kNpadX*kNpadZ;}; + 2*fNStripC)*kNpadX*kNpadZ;}; - virtual Float_t RinTOF() const { return fgkxTOF;}; - virtual Float_t Rmin() const { return fgkRmin;}; - virtual Float_t Rmax() const { return fgkRmax;}; + virtual Float_t RinTOF() const { return fxTOF;}; + virtual Float_t Rmin() const { return fRmin;}; + virtual Float_t Rmax() const { return fRmax;}; static Float_t XPad() { return fgkXPad;}; static Float_t ZPad() { return fgkZPad;}; @@ -51,10 +51,10 @@ class AliTOFGeometry: public TObject{ static Int_t NCh() { return kNCh;}; static Int_t NPadXTRM() { return kNCh*kNTdc;}; - virtual Float_t ZlenA() const { return kZlenA;}; - virtual Float_t ZlenB() const { return kZlenB;}; - virtual Float_t ZlenC() const { return kZlenC;}; - virtual Float_t MaxhZtof() const { return kMaxhZtof;}; + virtual Float_t ZlenA() const { return fZlenA;}; + virtual Float_t ZlenB() const { return fZlenB;}; + virtual Float_t ZlenC() const { return fZlenC;}; + virtual Float_t MaxhZtof() const { return fMaxhZtof;}; static Float_t SigmaForTail1() { return fgkSigmaForTail1;}; static Float_t SigmaForTail2() { return fgkSigmaForTail2;}; @@ -68,22 +68,22 @@ class AliTOFGeometry: public TObject{ virtual void ImportGeometry() {}; virtual void SetHoles(Bool_t holes) {fHoles = holes;}; virtual Bool_t GetHoles() const {return fHoles;}; - virtual Bool_t IsInsideThePadPar(Int_t */*det*/, Float_t */*pos*/) {return kFALSE;}; - virtual Float_t DistanceToPadPar(Int_t */*det*/, Float_t */*pos*/, Float_t *dist3d=0) {return dist3d[0];}; - virtual Bool_t IsInsideThePad(Int_t */*det*/,TGeoHMatrix /*mat*/, Float_t */*pos*/){return kFALSE;}; - virtual Float_t DistanceToPad(Int_t */*det*/,TGeoHMatrix /*mat*/, Float_t */*pos*/, Float_t *dist3d=0){return dist3d[0];}; + virtual Bool_t IsInsideThePadPar(Int_t */*det*/, Float_t */*pos*/) const {return kFALSE;}; + virtual Float_t DistanceToPadPar(Int_t */*det*/, Float_t */*pos*/, Float_t *dist3d=0) const {return dist3d[0];}; + virtual Bool_t IsInsideThePad(Int_t */*det*/,TGeoHMatrix /*mat*/, Float_t */*pos*/) const {return kFALSE;}; + virtual Float_t DistanceToPad(Int_t */*det*/,TGeoHMatrix /*mat*/, Float_t */*pos*/, Float_t *dist3d=0) const {return dist3d[0];}; virtual void GetVolumePath(Int_t */*ind*/, Char_t */*path*/ ){}; virtual void GetPos(Int_t */*det*/,Float_t */*pos*/){}; - virtual void GetPosPar(Int_t */*det*/,Float_t */*pos*/); - virtual void GetDetID(Float_t */*pos*/,Int_t */*det*/); - virtual Int_t GetPlate(Float_t */*pos*/) {return -1;}; - virtual Int_t GetStrip(Float_t */*pos*/) {return -1;}; - virtual Int_t GetSector(Float_t */*pos*/) {return -1;}; - virtual Int_t GetPadX(Float_t */*pos*/) {return -1;}; - virtual Int_t GetPadZ(Float_t */*pos*/) {return -1;}; - virtual Float_t GetX(Int_t */*det*/) {return -500.;}; - virtual Float_t GetY(Int_t */*det*/) {return -500.;}; - virtual Float_t GetZ(Int_t */*det*/) {return -500.;}; + virtual void GetPosPar(Int_t *det,Float_t *pos) const; + virtual void GetDetID(Float_t *pos,Int_t *det) const; + virtual Int_t GetPlate(Float_t */*pos*/) const {return -1;}; + virtual Int_t GetStrip(Float_t */*pos*/) const {return -1;}; + virtual Int_t GetSector(Float_t */*pos*/) const {return -1;}; + virtual Int_t GetPadX(Float_t */*pos*/) const {return -1;}; + virtual Int_t GetPadZ(Float_t */*pos*/) const {return -1;}; + virtual Float_t GetX(Int_t */*det*/) const {return -500.;}; + virtual Float_t GetY(Int_t */*det*/) const {return -500.;}; + virtual Float_t GetZ(Int_t */*det*/) const {return -500.;}; Float_t GetAngles(Int_t iplate, Int_t istrip) const {return fAngles[iplate][istrip];}; Float_t GetHeights(Int_t iplate, Int_t istrip) const {return fHeights[iplate][istrip];}; @@ -115,16 +115,16 @@ class AliTOFGeometry: public TObject{ static const Int_t fgkTimeDiff; // Min signal separation (ps) - mutable Int_t kNStripC; // number of strips in C type module + mutable Int_t fNStripC; // number of strips in C type module - mutable Float_t kZlenA; // length (cm) of the A module - mutable Float_t kZlenB; // length (cm) of the B module - mutable Float_t kZlenC; // length (cm) of the C module - mutable Float_t kMaxhZtof; // Max half z-size of TOF (cm) + mutable Float_t fZlenA; // length (cm) of the A module + mutable Float_t fZlenB; // length (cm) of the B module + mutable Float_t fZlenC; // length (cm) of the C module + mutable Float_t fMaxhZtof; // Max half z-size of TOF (cm) - mutable Float_t fgkRmin; // Inner radius of the TOF (cm) - mutable Float_t fgkRmax; // Outer radius of the TOF (cm) - mutable Float_t fgkxTOF; // Inner TOF Radius used in Reconstruction (cm) + mutable Float_t fRmin; // Inner radius of the TOF (cm) + mutable Float_t fRmax; // Outer radius of the TOF (cm) + mutable Float_t fxTOF; // Inner TOF Radius used in Reconstruction (cm) static const Float_t fgkStripLength; // Strip Length (rho X phi direction) (cm) @@ -144,7 +144,7 @@ class AliTOFGeometry: public TObject{ static const Float_t fgkTdcBin; // time-window for the TDC bins [ps] - ClassDef(AliTOFGeometry,3) // TOF Geometry base class + ClassDef(AliTOFGeometry,4) // TOF Geometry base class }; #endif diff --git a/TOF/AliTOFGeometryV4.cxx b/TOF/AliTOFGeometryV4.cxx index adab95563f3..434619dc5d1 100644 --- a/TOF/AliTOFGeometryV4.cxx +++ b/TOF/AliTOFGeometryV4.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.3 2006/03/12 14:38:13 arcelli + Changes for TOF Reconstruction using TGeo + Revision 1.2 2006/02/28 10:38:00 decaro AliTOFGeometry::fAngles, AliTOFGeometry::fHeights, AliTOFGeometry::fDistances arrays: dimension definition in the right location @@ -48,7 +51,6 @@ Revision 0.1 2005/07/19 A. De Caro ClassImp(AliTOFGeometryV4) -const Int_t AliTOFGeometryV4::kNStripC = 20; // number of strips in C type module const Float_t AliTOFGeometryV4::fgkZlenA = 106.0; // length (cm) of the A module const Float_t AliTOFGeometryV4::fgkZlenB = 141.0; // length (cm) of the B module @@ -75,16 +77,16 @@ AliTOFGeometryV4::AliTOFGeometryV4() // AliTOFGeometryV4 default constructor // - AliTOFGeometry::kNStripC = kNStripC; // number of strips in C type module + AliTOFGeometry::fNStripC = kNStripC; // number of strips in C type module - AliTOFGeometry::kZlenA = fgkZlenA; // length (cm) of the A module - AliTOFGeometry::kZlenB = fgkZlenB; // length (cm) of the B module - AliTOFGeometry::kZlenC = fgkZlenC; // length (cm) of the C module - AliTOFGeometry::kMaxhZtof = fgkMaxhZtof; // Max half z-size of TOF (cm) + AliTOFGeometry::fZlenA = fgkZlenA; // length (cm) of the A module + AliTOFGeometry::fZlenB = fgkZlenB; // length (cm) of the B module + AliTOFGeometry::fZlenC = fgkZlenC; // length (cm) of the C module + AliTOFGeometry::fMaxhZtof = fgkMaxhZtof; // Max half z-size of TOF (cm) - AliTOFGeometry::fgkxTOF = fgkxTOF; // Inner radius of the TOF for Reconstruction (cm) - AliTOFGeometry::fgkRmin = fgkRmin; // Inner radius of the TOF (cm) - AliTOFGeometry::fgkRmax = fgkRmax; // Outer radius of the TOF (cm) + AliTOFGeometry::fxTOF = fgkxTOF; // Inner radius of the TOF for Reconstruction (cm) + AliTOFGeometry::fRmin = fgkRmin; // Inner radius of the TOF (cm) + AliTOFGeometry::fRmax = fgkRmax; // Outer radius of the TOF (cm) Init(); @@ -110,6 +112,8 @@ void AliTOFGeometryV4::Init() // // Strips Tilt Angles + fPhiSec = 360./kNSectors; + Float_t const kangles[kNPlates][kMaxNstrip] ={ {44.494, 43.725, 42.946, 42.156, 41.357, 40.548, 39.729, 38.899, @@ -164,7 +168,7 @@ void AliTOFGeometryV4::Init() } //_____________________________________________________________________________ -Float_t AliTOFGeometryV4::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d) +Float_t AliTOFGeometryV4::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d) const { // // Returns distance of space point with coor pos (x,y,z) (cm) wrt @@ -224,7 +228,7 @@ Float_t AliTOFGeometryV4::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *di } //_____________________________________________________________________________ -Bool_t AliTOFGeometryV4::IsInsideThePadPar(Int_t *det, Float_t *pos) +Bool_t AliTOFGeometryV4::IsInsideThePadPar(Int_t *det, Float_t *pos) const { // // Returns true if space point with coor pos (x,y,z) (cm) falls @@ -283,7 +287,7 @@ Bool_t AliTOFGeometryV4::IsInsideThePadPar(Int_t *det, Float_t *pos) //_____________________________________________________________________________ -Float_t AliTOFGeometryV4::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d) +Float_t AliTOFGeometryV4::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d) const { // // Returns distance of space point with coor pos (x,y,z) (cm) wrt @@ -324,7 +328,7 @@ Float_t AliTOFGeometryV4::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *po //_____________________________________________________________________________ -Bool_t AliTOFGeometryV4::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *pos) +Bool_t AliTOFGeometryV4::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *pos) const { // // Returns true if space point with coor pos (x,y,z) (cm) falls @@ -360,7 +364,7 @@ Bool_t AliTOFGeometryV4::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *p } //_____________________________________________________________________________ -Float_t AliTOFGeometryV4::GetX(Int_t *det) +Float_t AliTOFGeometryV4::GetX(Int_t *det) const { // // Returns X coordinate (cm) @@ -391,7 +395,7 @@ Float_t AliTOFGeometryV4::GetX(Int_t *det) } //_____________________________________________________________________________ -Float_t AliTOFGeometryV4::GetY(Int_t *det) +Float_t AliTOFGeometryV4::GetY(Int_t *det) const { // // Returns Y coordinate (cm) @@ -423,7 +427,7 @@ Float_t AliTOFGeometryV4::GetY(Int_t *det) } //_____________________________________________________________________________ -Float_t AliTOFGeometryV4::GetZ(Int_t *det) +Float_t AliTOFGeometryV4::GetZ(Int_t *det) const { // // Returns Z coordinate (cm) @@ -443,7 +447,7 @@ Float_t AliTOFGeometryV4::GetZ(Int_t *det) } //_____________________________________________________________________________ -Int_t AliTOFGeometryV4::GetSector(Float_t *pos) +Int_t AliTOFGeometryV4::GetSector(Float_t *pos) const { // // Returns the Sector index @@ -463,7 +467,7 @@ Int_t AliTOFGeometryV4::GetSector(Float_t *pos) } //_____________________________________________________________________________ -Int_t AliTOFGeometryV4::GetPadX(Float_t *pos) +Int_t AliTOFGeometryV4::GetPadX(Float_t *pos) const { // // Returns the Pad index along X @@ -512,7 +516,7 @@ Int_t AliTOFGeometryV4::GetPadX(Float_t *pos) } //_____________________________________________________________________________ -Int_t AliTOFGeometryV4::GetPlate(Float_t *pos) +Int_t AliTOFGeometryV4::GetPlate(Float_t *pos) const { // // Returns the Plate index @@ -547,7 +551,7 @@ Int_t AliTOFGeometryV4::GetPlate(Float_t *pos) } //_____________________________________________________________________________ -Int_t AliTOFGeometryV4::GetStrip(Float_t *pos) +Int_t AliTOFGeometryV4::GetStrip(Float_t *pos) const { // // Returns the Strip index @@ -597,7 +601,7 @@ Int_t AliTOFGeometryV4::GetStrip(Float_t *pos) } //_____________________________________________________________________________ -Int_t AliTOFGeometryV4::GetPadZ(Float_t *pos) +Int_t AliTOFGeometryV4::GetPadZ(Float_t *pos) const { // // Returns the Pad index along Z @@ -636,7 +640,7 @@ Int_t AliTOFGeometryV4::GetPadZ(Float_t *pos) } //_____________________________________________________________________________ -Float_t AliTOFGeometryV4::GetMinPlateTheta(Int_t iPlate) +Float_t AliTOFGeometryV4::GetMinPlateTheta(Int_t iPlate) const { // // Returns the minimum theta angle of a given plate iPlate (rad) @@ -661,7 +665,7 @@ Float_t AliTOFGeometryV4::GetMinPlateTheta(Int_t iPlate) } //_____________________________________________________________________________ -Float_t AliTOFGeometryV4::GetMaxPlateTheta(Int_t iPlate) +Float_t AliTOFGeometryV4::GetMaxPlateTheta(Int_t iPlate) const { // // Returns the maximum theta angle of a given plate iPlate (rad) @@ -688,7 +692,7 @@ Float_t AliTOFGeometryV4::GetMaxPlateTheta(Int_t iPlate) } //_____________________________________________________________________________ -Float_t AliTOFGeometryV4::GetMaxStripTheta(Int_t iPlate, Int_t iStrip) +Float_t AliTOFGeometryV4::GetMaxStripTheta(Int_t iPlate, Int_t iStrip) const { // // Returns the maximum theta angle of a given strip iStrip (rad) @@ -710,7 +714,7 @@ Float_t AliTOFGeometryV4::GetMaxStripTheta(Int_t iPlate, Int_t iStrip) } //_____________________________________________________________________________ -Float_t AliTOFGeometryV4::GetMinStripTheta(Int_t iPlate, Int_t iStrip) +Float_t AliTOFGeometryV4::GetMinStripTheta(Int_t iPlate, Int_t iStrip) const { // // Returns the minimum theta angle of a given Strip iStrip (rad) @@ -734,7 +738,7 @@ Float_t AliTOFGeometryV4::GetMinStripTheta(Int_t iPlate, Int_t iStrip) } //_____________________________________________________________________________ -Float_t AliTOFGeometryV4::GetStripTheta(Int_t iPlate, Int_t iStrip) +Float_t AliTOFGeometryV4::GetStripTheta(Int_t iPlate, Int_t iStrip) const { // // returns the median theta angle of a given strip iStrip (rad) diff --git a/TOF/AliTOFGeometryV4.h b/TOF/AliTOFGeometryV4.h index 348b8721b4a..e6e9213e76e 100644 --- a/TOF/AliTOFGeometryV4.h +++ b/TOF/AliTOFGeometryV4.h @@ -21,25 +21,25 @@ class AliTOFGeometryV4: public AliTOFGeometry { void ImportGeometry(); void Init(); - Bool_t IsInsideThePad(Int_t *det, TGeoHMatrix mat, Float_t *pos); - Float_t DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d=0); - Bool_t IsInsideThePadPar(Int_t *det, Float_t *pos); - Float_t DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d=0); + Bool_t IsInsideThePad(Int_t *det, TGeoHMatrix mat, Float_t *pos) const ; + Float_t DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d=0) const ; + Bool_t IsInsideThePadPar(Int_t *det, Float_t *pos) const ; + Float_t DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d=0) const ; void GetVolumePath(Int_t *ind, Char_t *path ); - Int_t GetPlate(Float_t *pos) ; - Int_t GetStrip(Float_t *pos); - Int_t GetSector(Float_t *pos); - Int_t GetPadX(Float_t *pos); - Int_t GetPadZ(Float_t *pos); + Int_t GetPlate(Float_t *pos) const ; + Int_t GetStrip(Float_t *pos) const ; + Int_t GetSector(Float_t *pos) const ; + Int_t GetPadX(Float_t *pos) const ; + Int_t GetPadZ(Float_t *pos) const ; void GetPos(Int_t *det,Float_t *pos); - Float_t GetX(Int_t *det); - Float_t GetY(Int_t *det); - Float_t GetZ(Int_t *det); - Float_t GetMinPlateTheta(Int_t iPlate); - Float_t GetMaxPlateTheta(Int_t iPlate); - Float_t GetMinStripTheta(Int_t iPlate, Int_t iStrip); - Float_t GetMaxStripTheta(Int_t iPlate, Int_t iStrip); - Float_t GetStripTheta(Int_t iPlate, Int_t iStrip); + Float_t GetX(Int_t *det) const ; + Float_t GetY(Int_t *det) const ; + Float_t GetZ(Int_t *det) const ; + Float_t GetMinPlateTheta(Int_t iPlate) const; + Float_t GetMaxPlateTheta(Int_t iPlate) const; + Float_t GetMinStripTheta(Int_t iPlate, Int_t iStrip) const; + Float_t GetMaxStripTheta(Int_t iPlate, Int_t iStrip) const; + Float_t GetStripTheta(Int_t iPlate, Int_t iStrip) const; Int_t NStripC() const { return kNStripC;}; Int_t NPadXSector() const { return (AliTOFGeometry::kNStripA + 2*AliTOFGeometry::kNStripB + @@ -59,11 +59,12 @@ class AliTOFGeometryV4: public AliTOFGeometry { static Float_t OverSpc() { return fgkOverSpc;}; protected: + enum { + kNStripC = 20 // number of strips in C type module + }; //private: - static const Int_t kNStripC; // number of strips in C type module - static const Float_t fgkZlenA; // length (cm) of the A module static const Float_t fgkZlenB; // length (cm) of the B module static const Float_t fgkZlenC; // length (cm) of the C module diff --git a/TOF/AliTOFGeometryV5.cxx b/TOF/AliTOFGeometryV5.cxx index 7f756e77654..30711971ae1 100644 --- a/TOF/AliTOFGeometryV5.cxx +++ b/TOF/AliTOFGeometryV5.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.3 2006/03/12 14:38:05 arcelli + Changes for TOF Reconstruction using TGeo + Revision 1.2 2006/02/28 10:38:00 decaro AliTOFGeometry::fAngles, AliTOFGeometry::fHeights, AliTOFGeometry::fDistances arrays: dimension definition in the right location @@ -48,7 +51,6 @@ Revision 0.1 2005/07/19 G. Cara Romeo and A. De Caro ClassImp(AliTOFGeometryV5) -const Int_t AliTOFGeometryV5::kNStripC = 19; // number of strips in C type module const Float_t AliTOFGeometryV5::fgkZlenA = 370.6*2.; // length (cm) of the A module const Float_t AliTOFGeometryV5::fgkZlenB = 146.5; // length (cm) of the B module @@ -67,16 +69,16 @@ AliTOFGeometryV5::AliTOFGeometryV5() // AliTOFGeometryV5 default constructor // - AliTOFGeometry::kNStripC = kNStripC; // number of strips in C type module + AliTOFGeometry::fNStripC = kNStripC; // number of strips in C type module - AliTOFGeometry::kZlenA = fgkZlenA; // length of the TOF supermodule (cm) - AliTOFGeometry::kZlenB = fgkZlenB; // length of the B module (cm) - AliTOFGeometry::kZlenC = fgkZlenC; // length of the C module (cm) - AliTOFGeometry::kMaxhZtof = fgkMaxhZtof; // Max half z-size of TOF supermodule (cm) + AliTOFGeometry::fZlenA = fgkZlenA; // length of the TOF supermodule (cm) + AliTOFGeometry::fZlenB = fgkZlenB; // length of the B module (cm) + AliTOFGeometry::fZlenC = fgkZlenC; // length of the C module (cm) + AliTOFGeometry::fMaxhZtof = fgkMaxhZtof; // Max half z-size of TOF supermodule (cm) - AliTOFGeometry::fgkxTOF = fgkxTOF; // Inner radius of the TOF for Reconstruction (cm) - AliTOFGeometry::fgkRmin = fgkRmin; // Inner radius of the TOF (cm) - AliTOFGeometry::fgkRmax = fgkRmax; // Outer radius of the TOF (cm) + AliTOFGeometry::fxTOF = fgkxTOF; // Inner radius of the TOF for Reconstruction (cm) + AliTOFGeometry::fRmin = fgkRmin; // Inner radius of the TOF (cm) + AliTOFGeometry::fRmax = fgkRmax; // Outer radius of the TOF (cm) Init(); @@ -109,6 +111,8 @@ void AliTOFGeometryV5::Init() // the Z of the center with respect to the BT01/BT02/BT03 reference frame + fPhiSec = 360./kNSectors; + Float_t const kangles[kNPlates][kMaxNstrip] ={ { 43.99, 43.20, 42.40, 41.59, 40.77, 39.94, 39.11, 38.25, 37.40, 36.53, 35.65, 34.76, 33.87, 32.96, 32.05, 31.13, 30.19, 29.24, 12.33, 0.00}, @@ -173,7 +177,7 @@ void AliTOFGeometryV5::Init() } //_____________________________________________________________________________ -Float_t AliTOFGeometryV5::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d) +Float_t AliTOFGeometryV5::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d) const { // // Returns distance of space point with coor pos (x,y,z) (cm) wrt @@ -237,7 +241,7 @@ Float_t AliTOFGeometryV5::DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *di } //_____________________________________________________________________________ -Bool_t AliTOFGeometryV5::IsInsideThePadPar(Int_t *det, Float_t *pos) +Bool_t AliTOFGeometryV5::IsInsideThePadPar(Int_t *det, Float_t *pos) const { // // Returns true if space point with coor pos (x,y,z) (cm) falls @@ -310,7 +314,7 @@ Bool_t AliTOFGeometryV5::IsInsideThePadPar(Int_t *det, Float_t *pos) //_____________________________________________________________________________ -Float_t AliTOFGeometryV5::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d) +Float_t AliTOFGeometryV5::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d) const { // // Returns distance of space point with coor pos (x,y,z) (cm) wrt @@ -347,7 +351,7 @@ Float_t AliTOFGeometryV5::DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *po //_____________________________________________________________________________ -Bool_t AliTOFGeometryV5::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *pos) +Bool_t AliTOFGeometryV5::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *pos) const { // // Returns true if space point with coor pos (x,y,z) (cm) falls @@ -379,7 +383,7 @@ Bool_t AliTOFGeometryV5::IsInsideThePad( Int_t *det, TGeoHMatrix mat, Float_t *p } //_____________________________________________________________________________ //_____________________________________________________________________________ -Float_t AliTOFGeometryV5::GetX(Int_t *det) +Float_t AliTOFGeometryV5::GetX(Int_t *det) const { // // Returns X coordinate (cm) @@ -492,7 +496,7 @@ Float_t AliTOFGeometryV5::GetX(Int_t *det) } //_____________________________________________________________________________ -Float_t AliTOFGeometryV5::GetY(Int_t *det) +Float_t AliTOFGeometryV5::GetY(Int_t *det) const { // // Returns Y coordinate (cm) @@ -607,7 +611,7 @@ Float_t AliTOFGeometryV5::GetY(Int_t *det) } //_____________________________________________________________________________ -Float_t AliTOFGeometryV5::GetZ(Int_t *det) +Float_t AliTOFGeometryV5::GetZ(Int_t *det) const { // // Returns Z coordinate (cm) @@ -706,7 +710,7 @@ Float_t AliTOFGeometryV5::GetZ(Int_t *det) } //_____________________________________________________________________________ -Int_t AliTOFGeometryV5::GetSector(Float_t *pos) +Int_t AliTOFGeometryV5::GetSector(Float_t *pos) const { // // Returns the Sector index @@ -740,7 +744,7 @@ Int_t AliTOFGeometryV5::GetSector(Float_t *pos) } //_____________________________________________________________________________ -Int_t AliTOFGeometryV5::GetPlate(Float_t *pos) +Int_t AliTOFGeometryV5::GetPlate(Float_t *pos) const { // // Returns the Plate index @@ -836,7 +840,7 @@ Int_t AliTOFGeometryV5::GetPlate(Float_t *pos) } //_____________________________________________________________________________ -Int_t AliTOFGeometryV5::GetStrip(Float_t *pos) +Int_t AliTOFGeometryV5::GetStrip(Float_t *pos) const { // // Returns the Strip index @@ -962,7 +966,7 @@ Int_t AliTOFGeometryV5::GetStrip(Float_t *pos) } //_____________________________________________________________________________ -Int_t AliTOFGeometryV5::GetPadZ(Float_t *pos) +Int_t AliTOFGeometryV5::GetPadZ(Float_t *pos) const { // // Returns the Pad index along Z @@ -1061,7 +1065,7 @@ Int_t AliTOFGeometryV5::GetPadZ(Float_t *pos) } //_____________________________________________________________________________ -Int_t AliTOFGeometryV5::GetPadX(Float_t *pos) +Int_t AliTOFGeometryV5::GetPadX(Float_t *pos) const { // // Returns the Pad index along X @@ -1465,8 +1469,11 @@ Float_t AliTOFGeometryV5::GetPadDz(Float_t *pos) } //_____________________________________________________________________________ -void AliTOFGeometryV5::Translation(Float_t *xyz, Float_t translationVector[3]) +void AliTOFGeometryV5::Translation(Float_t *xyz, Float_t translationVector[3]) const { + // + // Return the vector xyz translated by translationVector vector + // Int_t ii=0; @@ -1478,8 +1485,11 @@ void AliTOFGeometryV5::Translation(Float_t *xyz, Float_t translationVector[3]) } //_____________________________________________________________________________ -void AliTOFGeometryV5::Rotation(Float_t *xyz, Double_t rotationAngles[6]) +void AliTOFGeometryV5::Rotation(Float_t *xyz, Double_t rotationAngles[6]) const { + // + // Return the vector xyz rotated according to the rotationAngles angles + // Int_t ii=0; /* @@ -1505,8 +1515,11 @@ void AliTOFGeometryV5::Rotation(Float_t *xyz, Double_t rotationAngles[6]) } //_____________________________________________________________________________ -void AliTOFGeometryV5::InverseRotation(Float_t *xyz, Double_t rotationAngles[6]) +void AliTOFGeometryV5::InverseRotation(Float_t *xyz, Double_t rotationAngles[6]) const { + // + // + // Int_t ii=0; diff --git a/TOF/AliTOFGeometryV5.h b/TOF/AliTOFGeometryV5.h index 25166d4b8d3..844b83fc758 100644 --- a/TOF/AliTOFGeometryV5.h +++ b/TOF/AliTOFGeometryV5.h @@ -21,20 +21,20 @@ class AliTOFGeometryV5: public AliTOFGeometry { void ImportGeometry(); void Init(); - Bool_t IsInsideThePad(Int_t *det, TGeoHMatrix mat, Float_t *pos); - Float_t DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d=0); - Bool_t IsInsideThePadPar(Int_t *det, Float_t *pos); - Float_t DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d=0); + Bool_t IsInsideThePad(Int_t *det, TGeoHMatrix mat, Float_t *pos) const; + Float_t DistanceToPad(Int_t *det, TGeoHMatrix mat, Float_t *pos, Float_t *dist3d=0) const; + Bool_t IsInsideThePadPar(Int_t *det, Float_t *pos) const; + Float_t DistanceToPadPar(Int_t *det, Float_t *pos, Float_t *dist3d=0) const; void GetVolumePath(Int_t *ind, Char_t *path ); - Int_t GetPlate(Float_t *pos); - Int_t GetStrip(Float_t *pos); - Int_t GetSector(Float_t *pos); - Int_t GetPadX(Float_t *pos); - Int_t GetPadZ(Float_t *pos); + Int_t GetPlate(Float_t *pos) const; + Int_t GetStrip(Float_t *pos) const; + Int_t GetSector(Float_t *pos) const; + Int_t GetPadX(Float_t *pos) const; + Int_t GetPadZ(Float_t *pos) const; void GetPos(Int_t *det,Float_t *pos); - Float_t GetX(Int_t *det); - Float_t GetY(Int_t *det); - Float_t GetZ(Int_t *det); + Float_t GetX(Int_t *det) const; + Float_t GetY(Int_t *det) const; + Float_t GetZ(Int_t *det) const; Float_t GetPadDx(Float_t *pos); Float_t GetPadDy(Float_t *pos); Float_t GetPadDz(Float_t *pos); @@ -52,15 +52,17 @@ class AliTOFGeometryV5: public AliTOFGeometry { Float_t ZlenC() const { return fgkZlenC;}; Float_t MaxhZtof() const { return fgkMaxhZtof;}; - void Translation(Float_t *xyz, Float_t translationVector[3]); - void Rotation(Float_t *xyz, Double_t rotationAngles[6]); - void InverseRotation(Float_t *xyz, Double_t rotationAngles[6]); + void Translation(Float_t *xyz, Float_t translationVector[3]) const; + void Rotation(Float_t *xyz, Double_t rotationAngles[6]) const; + void InverseRotation(Float_t *xyz, Double_t rotationAngles[6]) const; protected: - //private: + enum { + kNStripC = 19 // number of strips in C type module + }; - static const Int_t kNStripC; // number of strips in C type module + //private: static const Float_t fgkZlenA; // length (cm) of the A module static const Float_t fgkZlenB; // length (cm) of the B module diff --git a/TOF/AliTOFHitMap.h b/TOF/AliTOFHitMap.h index 75b8886dee0..3de6d63f8b7 100644 --- a/TOF/AliTOFHitMap.h +++ b/TOF/AliTOFHitMap.h @@ -58,7 +58,7 @@ class AliTOFHitMap : public TObject Int_t fMaxIndex; // maximum index in hit map Int_t *fHitMap; // ! [fMaxIndex] - AliTOFGeometry *fTOFGeometry; + AliTOFGeometry *fTOFGeometry; // Pointer to the TOF geometry ClassDef(AliTOFHitMap,0) // Implements HitMap as a 1-dim array }; diff --git a/TOF/AliTOFReconstructor.h b/TOF/AliTOFReconstructor.h index 6463d36c3fd..5ecf78e2e58 100644 --- a/TOF/AliTOFReconstructor.h +++ b/TOF/AliTOFReconstructor.h @@ -12,7 +12,7 @@ class AliTOFGeometry; class AliTOFReconstructor: public AliReconstructor { public: //AliTOFReconstructor(): AliReconstructor() {}; - //virtual ~AliTOFReconstructor() {}; + virtual ~AliTOFReconstructor() {}; virtual void Reconstruct(AliRunLoader* runLoader) const; virtual void Reconstruct(AliRunLoader* runLoader, diff --git a/TOF/AliTOFSDigit.cxx b/TOF/AliTOFSDigit.cxx index a9cc26e6be5..43bf40c16a4 100644 --- a/TOF/AliTOFSDigit.cxx +++ b/TOF/AliTOFSDigit.cxx @@ -96,6 +96,25 @@ AliTOFSDigit::AliTOFSDigit(const AliTOFSDigit & digit) fTracks = new TArrayI(*digit.fTracks); } +//////////////////////////////////////////////////////////////////////// +AliTOFSDigit& AliTOFSDigit::operator=(const AliTOFSDigit & digit) +{ + // + // copy ctor for AliTOFSDigit object + // + this->fSector = digit.fSector; + this->fPlate = digit.fPlate; + this->fStrip = digit.fStrip; + this->fPadx = digit.fPadx; + this->fPadz = digit.fPadz; + this->fNDigits = digit.fNDigits; + this->fTdc = digit.fTdc; + this->fAdc = digit.fAdc; + this->fTracks = digit.fTracks; + return *this; + +} + //////////////////////////////////////////////////////////////////////// AliTOFSDigit::AliTOFSDigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx, Int_t padz, Float_t tdc, Float_t adc) diff --git a/TOF/AliTOFSDigit.h b/TOF/AliTOFSDigit.h index 14dd2960ad2..f603e5cc4e0 100644 --- a/TOF/AliTOFSDigit.h +++ b/TOF/AliTOFSDigit.h @@ -19,9 +19,6 @@ //class TArrayF; class AliTOFGeometry; -// number 3 is a legacy from AliDigit object -const Int_t kMAXDIGITS = 3; - class AliTOFSDigit : public TObject { //overloading of the streamer << operator @@ -34,6 +31,7 @@ class AliTOFSDigit : public TObject { AliTOFSDigit(Int_t sector, Int_t plate, Int_t strip, Int_t padx, Int_t padz, Float_t tdc, Float_t adc); // copy ctor AliTOFSDigit(const AliTOFSDigit & digit) ; + AliTOFSDigit& operator=(const AliTOFSDigit & digit) ; virtual ~AliTOFSDigit(); void GetLocation(Int_t* Loc) const; Int_t GetTotPad(AliTOFGeometry *tofGeom) const; @@ -53,7 +51,12 @@ class AliTOFSDigit : public TObject { Int_t GetPadx() const {return fPadx;} Int_t GetPadz() const {return fPadz;} + enum { + kMAXDIGITS = 3 // number 3 is a legacy from AliDigit object + }; + protected: + Int_t fSector; // number of sector Int_t fPlate; // number of plate Int_t fStrip; // number of strip diff --git a/TOF/AliTOFSDigitizer.cxx b/TOF/AliTOFSDigitizer.cxx index 8042d0333ca..aeec5069e2e 100644 --- a/TOF/AliTOFSDigitizer.cxx +++ b/TOF/AliTOFSDigitizer.cxx @@ -74,6 +74,24 @@ ClassImp(AliTOFSDigitizer) } +//------------------------------------------------------------------------ +AliTOFSDigitizer::AliTOFSDigitizer(const AliTOFSDigitizer &source) + :TTask(source) +{ + // copy constructor + this->fTOFGeometry=source.fTOFGeometry; + +} + +//____________________________________________________________________________ +AliTOFSDigitizer& AliTOFSDigitizer::operator=(const AliTOFSDigitizer &source) +{ + // ass. op. + this->fTOFGeometry=source.fTOFGeometry; + return *this; + +} + //____________________________________________________________________________ AliTOFSDigitizer::AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1, Int_t nEvents):TTask("TOFSDigitizer","") { diff --git a/TOF/AliTOFSDigitizer.h b/TOF/AliTOFSDigitizer.h index 9abd22d5f30..d466be67b4f 100644 --- a/TOF/AliTOFSDigitizer.h +++ b/TOF/AliTOFSDigitizer.h @@ -25,6 +25,9 @@ public: //AliTOFSDigitizer(const char* HeaderFile) ; // par ctor AliTOFSDigitizer(const char* HeaderFile, Int_t evNumber1=-1, Int_t nEvents=0) ; // par ctor + AliTOFSDigitizer(const AliTOFSDigitizer &source); // copy constructor + AliTOFSDigitizer& operator=(const AliTOFSDigitizer &source); // ass. op. + virtual ~AliTOFSDigitizer() ; // dtor //static Float_t WidthTdcBin() {return fgkTdcBin;}; @@ -120,7 +123,7 @@ private: AliRunLoader* fRunLoader; //! Run Loader AliLoader* fTOFLoader; //! Loader - AliTOFGeometry* fTOFGeometry; // + AliTOFGeometry* fTOFGeometry; // Pointer to the TOF geometry Int_t fSelectedSector; // sector number for sdigitization Int_t fSelectedPlate ; // plate number for sdigitization diff --git a/TOF/AliTOFT0.cxx b/TOF/AliTOFT0.cxx index 083e33378fc..46d00d256f9 100644 --- a/TOF/AliTOFT0.cxx +++ b/TOF/AliTOFT0.cxx @@ -17,39 +17,51 @@ //_________________________________________________________________________ // This is a TTask that made the calculation of the Time zero using TOF. -// Description: The algorithm used to calculate the time zero of interaction -// using TOF detector is the following. -// We select in the MonteCarlo some primary particles - or tracks in the following - -// that strike the TOF detector (the larger part are pions, kaons or protons). -// We choose a set of 10 selected tracks, for each track You have the length -// of the track when the TOF is reached (a standard TOF hit does not contain this -// additional information, this is the reason why we implemented a new time zero -// dedicated TOF hit class AliTOFhitT0; in order to store this type of hit You -// have to use the AliTOFv4T0 as TOF class in Your Config.C. In AliTOFv4T0 the -// StepManager was modified in order to fill the TOF hit branch with this type -// of hits; in fact the AliTOF::AddT0Hit is called rather that the usual AliTOF::AddHit), -// the momentum at generation (from TreeK) and the time of flight -// given by the TOF detector. -// (Observe that the ctor of the AliTOF class, when the AliTOFv4T0 class is used, is called -// with the "tzero" option: it is in order create the fHits TClonesArray filled with -// AliTOFhitT0 objects, rather than with normal AliTOFhit) -// Then Momentum and time of flight for each track are smeared according to -// known experimental resolution (all sources of error have been token into account). -// Let consider now only one set of 10 tracks (the algorithm is the same for all sets). -// Assuming the (mass) hypothesis that each track can be AUT a pion, AUT a kaon, AUT a proton, -// we consider all the 3 at 10 possible cases. +// Description: The algorithm used to calculate the time zero of +// interaction using TOF detector is the following. +// We select in the MonteCarlo some primary particles - or tracks in +// the following - that strike the TOF detector (the larger part are +// pions, kaons or protons). +// We choose a set of 10 selected tracks, for each track You have the +// length of the track when the TOF is reached (a standard TOF hit +// does not contain this additional information, this is the reason +// why we implemented a new time zero dedicated TOF hit class +// AliTOFhitT0; in order to store this type of hit You have to use the +// AliTOFv4T0 as TOF class in Your Config.C. In AliTOFv4T0 the +// StepManager was modified in order to fill the TOF hit branch with +// this type of hits; in fact the AliTOF::AddT0Hit is called rather +// that the usual AliTOF::AddHit), the momentum at generation (from +// TreeK) and the time of flight given by the TOF detector. +// (Observe that the ctor of the AliTOF class, when the AliTOFv4T0 +// class is used, is called with the "tzero" option: it is in order +// create the fHits TClonesArray filled with AliTOFhitT0 objects, +// rather than with normal AliTOFhit) +// Then Momentum and time of flight for each track are smeared +// according to known experimental resolution (all sources of error +// have been token into account). +// Let consider now only one set of 10 tracks (the algorithm is the +// same for all sets). +// Assuming the (mass) hypothesis that each track can be AUT a pion, +// AUT a kaon, AUT a proton, we consider all the 3 at 10 possible +// cases. // For each track in each (mass) configuration -// (a configuration can be e.g. pion/pion/kaon/proton/pion/proton/kaon/kaon/pion/pion) -// we calculate the time zero (we know in fact the velocity of the track after -// the assumption about its mass, the time of flight given by the TOF, and the -// corresponding path travelled till the TOF detector). Then for each mass configuration we have -// 10 time zero and we can calculate the ChiSquare for the current configuration using the -// weighted mean over all 10 time zero. -// We call the best assignment the mass configuration that gives the minimum value of the ChiSquare. -// We plot the weighted mean over all 10 time zero for the best assignment, -// the ChiSquare for the best assignment and the corresponding confidence level. -// The strong assumption is the MC selection of primary particles. It will be introduced -// in the future also some more realistic simulation about this point. +// (a configuration can be +// e.g. pion/pion/kaon/proton/pion/proton/kaon/kaon/pion/pion) +// we calculate the time zero (we know in fact the velocity of the +// track after the assumption about its mass, the time of flight given +// by the TOF, and the corresponding path travelled till the TOF +// detector). Then for each mass configuration we have 10 time zero +// and we can calculate the ChiSquare for the current configuration +// using the weighted mean over all 10 time zero. +// We call the best assignment the mass configuration that gives the +// minimum value of the ChiSquare. +// We plot the weighted mean over all 10 time zero for the best +// assignment, the ChiSquare for the best assignment and the +// corresponding confidence level. +// The strong assumption is the MC selection of primary particles. It +// will be introduced in the future also some more realistic +// simulation about this point. + // Use case: // root [0] AliTOFT0 * tzero = new AliTOFT0("galice.root") // Warning in : object already instantiated @@ -57,8 +69,9 @@ // root [2] tzero->ExecuteTask("tim") // // available parameters: // tim - print benchmarking information -// all - print usefull informations about the number of misidentified tracks -// and a comparison about the true configuration (known from MC) and the best +// all - print usefull informations about the number of +// misidentified tracks and a comparison about the +// true configuration (known from MC) and the best // assignment //-- Author: F. Pierella ////////////////////////////////////////////////////////////////////////////// @@ -102,6 +115,10 @@ ClassImp(AliTOFT0) //____________________________________________________________________________ AliTOFT0::AliTOFT0(char* headerFile, Int_t nEvents):TTask("AliTOFT0","") { + // + // + // + fNevents=nEvents ; // Number of events for which calculate the T0, // default 0: it means all evens in current file fLowerMomBound=1.5; // [GeV/c] default value @@ -128,6 +145,8 @@ ClassImp(AliTOFT0) //____________________________________________________________________________ AliTOFT0::AliTOFT0(const AliTOFT0 & tzero):TTask("AliTOFT0","") { + // copy ctr + ( (AliTOFT0 &)tzero ).Copy(*this); } @@ -219,9 +238,9 @@ void AliTOFT0::Exec(Option_t *option) Float_t chisquare=999.; Float_t tracktoflen[10]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.}; - AliTOF *TOF = (AliTOF *) gAlice->GetDetector ("TOF"); + AliTOF *detTOF = (AliTOF *) gAlice->GetDetector ("TOF"); - if (!TOF) { + if (!detTOF) { Error("AliTOFT0","TOF not found"); return; } @@ -235,34 +254,34 @@ void AliTOFT0::Exec(Option_t *option) for (Int_t ievent = 0; ievent < fNevents; ievent++) { gAlice->GetEvent(ievent); - TTree *TH = TOF->TreeH (); - if (!TH) + TTree *hitTree = detTOF->TreeH (); + if (!hitTree) return; TParticle* particle; AliTOFhitT0* tofHit; - TClonesArray* TOFhits = TOF->Hits(); + TClonesArray* tofHits = detTOF->Hits(); Int_t lasttrack=-1; Int_t nset=0; - TH->SetBranchStatus("*",0); // switch off all branches - TH->SetBranchStatus("TOF*",1); // switch on only TOF + hitTree->SetBranchStatus("*",0); // switch off all branches + hitTree->SetBranchStatus("TOF*",1); // switch on only TOF // Start loop on primary tracks in the hits containers - Int_t ntracks = static_cast(TH->GetEntries()); + Int_t ntracks = static_cast(hitTree->GetEntries()); for (Int_t track = 0; track < ntracks; track++) { if(nset>=5) break; // check on the number of set analyzed gAlice->ResetHits(); - TH->GetEvent(track); + hitTree->GetEvent(track); particle = gAlice->GetMCApp()->Particle(track); - Int_t nhits = TOFhits->GetEntriesFast(); + Int_t nhits = tofHits->GetEntriesFast(); for (Int_t hit = 0; hit < nhits; hit++) { - tofHit = (AliTOFhitT0 *) TOFhits->UncheckedAt(hit); + tofHit = (AliTOFhitT0 *) tofHits->UncheckedAt(hit); ipart = tofHit->GetTrack(); // check to discard the case when the same particle is selected more than one // time @@ -474,22 +493,33 @@ void AliTOFT0::Exec(Option_t *option) } //__________________________________________________________________ -void AliTOFT0::SetTZeroFile(char * file ){ - cout << "Destination file : " << file << endl ; +void AliTOFT0::SetTZeroFile(char * file ) +{ + // + // + // + printf("Destination file : %s \n", file) ; fT0File=file; + } + //__________________________________________________________________ void AliTOFT0::Print(Option_t* /*option*/)const { - cout << "------------------- "<< GetName() << " -------------" << endl ; + // + // + // + printf("------------------- %s -------------\n", GetName()) ; if(!fT0File.IsNull()) - cout << " Writing T0 Distribution to file " << (char*) fT0File.Data() << endl ; + printf(" Writing T0 Distribution to file %s \n",(char*) fT0File.Data()); + } //__________________________________________________________________ Bool_t AliTOFT0::operator==( AliTOFT0 const &tzero )const { - // Equal operator. + // + // Equal operator // if( (fTimeResolution==tzero.fTimeResolution)&&(fLowerMomBound==tzero.fLowerMomBound)&&(fUpperMomBound==tzero.fUpperMomBound)) diff --git a/TOF/AliTOFT0.h b/TOF/AliTOFT0.h index f294b698a42..881ad731785 100644 --- a/TOF/AliTOFT0.h +++ b/TOF/AliTOFT0.h @@ -45,7 +45,9 @@ public: virtual void Print(Option_t* option) const ; Bool_t operator == (const AliTOFT0 & tzero) const ; -private: + protected: + + private: Int_t fNevents; // Number of events for which calculate the T0 Float_t fTimeResolution; // global time resolution used to calculate T0 Float_t fLowerMomBound; // momentum lower bound for selected primary tracks @@ -53,8 +55,6 @@ private: TString fT0File ; // output file; it contains for time being only 3 histos TString fHeadersFile; // input file - protected: - ClassDef(AliTOFT0,1) // Calculate the time zero using TOF detector }; diff --git a/TOF/AliTOFcalib.cxx b/TOF/AliTOFcalib.cxx index 4ed8a50a527..c7d3eb3d493 100644 --- a/TOF/AliTOFcalib.cxx +++ b/TOF/AliTOFcalib.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.7 2006/04/16 20:12:46 hristov +Removing memory leak in case of cached CDB entries + Revision 1.6 2006/04/11 15:28:32 hristov Checks on cache status before deleting calibration objects (A.Colla) @@ -137,6 +140,27 @@ AliTOFcalib::AliTOFcalib(const AliTOFcalib & calib):TTask("AliTOFcalib","") //____________________________________________________________________________ +AliTOFcalib& AliTOFcalib::operator=(const AliTOFcalib &calib) +{ + //TOF Calibration Class assignment operator + this->fNSector = calib.fNSector; + this->fNPlate = calib.fNPlate; + this->fNStripA = calib.fNStripA; + this->fNStripB = calib.fNStripB; + this->fNStripC = calib.fNStripC; + this->fNpadZ = calib.fNpadZ; + this->fNpadX = calib.fNpadX; + this->fNChannels = calib.fNChannels; + this->fArrayToT = calib.fArrayToT; + this->fArrayTime = calib.fArrayTime; + this->fTOFCal=calib.fTOFCal; + this->fTOFSimCal = calib.fTOFSimCal; + this->fTOFSimToT=calib.fTOFSimToT; + return *this; +} + +//____________________________________________________________________________ + AliTOFcalib::~AliTOFcalib() { //TOF Calibration Class dtor diff --git a/TOF/AliTOFcalib.h b/TOF/AliTOFcalib.h index 7432eedefa6..cb330111afa 100644 --- a/TOF/AliTOFcalib.h +++ b/TOF/AliTOFcalib.h @@ -21,7 +21,8 @@ class AliTOFcalib:public TTask{ public: AliTOFcalib(); // ctor AliTOFcalib(AliTOFGeometry *geom); - AliTOFcalib(const AliTOFcalib & calib); + AliTOFcalib(const AliTOFcalib & calib); // copy constructor + AliTOFcalib& operator=(const AliTOFcalib & calib); // assignment operator virtual ~AliTOFcalib() ; // dtor Int_t NSector()const {return fNSector;} Int_t NPlate()const {return fNPlate;} @@ -59,6 +60,18 @@ public: fSize(size), fArray(new TArrayF*[size]) { } + AliTOFArray(const AliTOFArray & source): + TObject(){ // copy constructor + this->fSize= source.fSize; + this->fArray= source.fArray; + }; + + AliTOFArray& operator=(const AliTOFArray & source) { // assignment operator + this->fSize= source.fSize; + this->fArray= source.fArray; + return *this; + } + Int_t GetSize() const {return fSize;} void AddArray(Int_t pos, TArrayF * parr) { if (pos>-1 && pos < fSize)fArray[pos] = parr;} diff --git a/TOF/AliTOFtrack.cxx b/TOF/AliTOFtrack.cxx index 795cfa3baec..9127570ac5f 100644 --- a/TOF/AliTOFtrack.cxx +++ b/TOF/AliTOFtrack.cxx @@ -110,6 +110,17 @@ AliTOFtrack::AliTOFtrack(const AliESDtrack& t) } + +//____________________________________________________________________________ +AliTOFtrack& AliTOFtrack::operator=(const AliTOFtrack &source) +{ + // ass. op. + + this->fTOFgeometry=source.fTOFgeometry; + return *this; + +} + //____________________________________________________________________________ void AliTOFtrack::GetExternalParameters(Double_t& xr, Double_t x[5]) const { // diff --git a/TOF/AliTOFtrack.h b/TOF/AliTOFtrack.h index d164542ed4c..e11e65adea6 100644 --- a/TOF/AliTOFtrack.h +++ b/TOF/AliTOFtrack.h @@ -15,9 +15,9 @@ class AliTOFtrack : public AliKalmanTrack { public: AliTOFtrack():AliKalmanTrack(){} - AliTOFtrack(const AliTOFtrack& t); - AliTOFtrack(const AliESDtrack& t); - + AliTOFtrack(const AliTOFtrack& t); + AliTOFtrack(const AliESDtrack& t); + AliTOFtrack& operator=(const AliTOFtrack &source); // ass. op. Double_t GetAlpha() const {return fAlpha;} Int_t GetSector() const { @@ -63,7 +63,7 @@ public: protected: void GetXYZ(Float_t r[3]) const; - + Int_t Update(const AliCluster */*c*/, Double_t /*chi2*/, UInt_t /*idx*/) { return 0; } diff --git a/TOF/AliTOFtracker.cxx b/TOF/AliTOFtracker.cxx index d545caccc8d..a2756fdec37 100644 --- a/TOF/AliTOFtracker.cxx +++ b/TOF/AliTOFtracker.cxx @@ -93,6 +93,36 @@ AliTOFtracker::AliTOFtracker(const AliTOFtracker &t):AliTracker() { fTracks=t.fTracks; fN=t.fN; } + +//_____________________________________________________________________________ +AliTOFtracker& AliTOFtracker::operator=(const AliTOFtracker &t) +{ + //AliTOFtracker assignment operator + + this->fHoles=t.fHoles; + this->fNseeds=t.fNseeds; + this->fNseedsTOF=t.fNseedsTOF; + this->fngoodmatch=t.fngoodmatch; + this->fnbadmatch=t.fnbadmatch; + this->fnunmatch=t.fnunmatch; + this->fnmatch=t.fnmatch; + this->fGeom = t.fGeom; + this->fTOFpid = t.fTOFpid; + this->fR=t.fR; + this->fTOFHeigth=t.fTOFHeigth; + this->fdCut=t.fdCut; + this->fDy=t.fDy; + this->fDz=t.fDz; + this->fDx=t.fDx; + this->fDzMax=t.fDzMax; + this->fDyMax=t.fDyMax; + this->fSeeds=t.fSeeds; + this->fTracks=t.fTracks; + this->fN=t.fN; + return *this; + +} + //_____________________________________________________________________________ Int_t AliTOFtracker::PropagateBack(AliESD* event) { // @@ -446,8 +476,8 @@ void AliTOFtracker::MatchTracks( Bool_t mLastStep){ delete trackTOFin; // Store quantities to be used in the TOF Calibration - Float_t ToT=c->GetToT(); // in ps - t->SetTOFsignalToT(ToT); + Float_t tToT=c->GetToT(); // in ps + t->SetTOFsignalToT(tToT); Int_t ind[5]; ind[0]=c->GetDetInd(0); ind[1]=c->GetDetInd(1); diff --git a/TOF/AliTOFtracker.h b/TOF/AliTOFtracker.h index a4a086bace1..95259abbcde 100644 --- a/TOF/AliTOFtracker.h +++ b/TOF/AliTOFtracker.h @@ -32,11 +32,13 @@ public: AliTOFtracker(AliTOFGeometry* geom, Double_t parPID[2]); AliTOFtracker(const AliTOFtracker &t); //Copy Ctor + AliTOFtracker& operator=(const AliTOFtracker &source); // ass. op. + virtual ~AliTOFtracker() {delete fTOFpid;} virtual Int_t Clusters2Tracks(AliESD* /*event*/) {return -1;}; virtual Int_t PropagateBack(AliESD* event); virtual Int_t RefitInward(AliESD* /*event*/) {return -1;}; - virtual Int_t LoadClusters(TTree * /*cTree*/); // Load Clusters + virtual Int_t LoadClusters(TTree * cTree); // Load Clusters virtual void UnloadClusters();// UnLoad Clusters virtual AliCluster *GetCluster(Int_t /*index*/) const {return NULL;}; Bool_t GetTrackPoint(Int_t index, AliTrackPoint& p) const; diff --git a/TOF/AliTOFtrackerMI.cxx b/TOF/AliTOFtrackerMI.cxx index d0097fe538d..0bb5fb65801 100644 --- a/TOF/AliTOFtrackerMI.cxx +++ b/TOF/AliTOFtrackerMI.cxx @@ -85,6 +85,33 @@ AliTOFtrackerMI::AliTOFtrackerMI(const AliTOFtrackerMI &t):AliTracker() { } //_________________________________________________________________________________ +AliTOFtrackerMI& AliTOFtrackerMI::operator=(const AliTOFtrackerMI &t) +{ + //AliTOFtrackerMI assignment operator + + this->fHoles=t.fHoles; + this->fNseeds=t.fNseeds; + this->fNseedsTOF=t.fNseedsTOF; + this->fngoodmatch=t.fngoodmatch; + this->fnbadmatch=t.fnbadmatch; + this->fnunmatch=t.fnunmatch; + this->fnmatch=t.fnmatch; + this->fGeom = t.fGeom; + this->fTOFpid = t.fTOFpid; + this->fR=t.fR; + this->fTOFHeigth=t.fTOFHeigth; + this->fdCut=t.fdCut; + this->fDy=t.fDy; + this->fDz=t.fDz; + this->fDx=t.fDx; + this->fSeeds=t.fSeeds; + this->fTracks=t.fTracks; + this->fN=t.fN; + return *this; + +} + +//_____________________________________________________________________________ AliTOFtrackerMI::~AliTOFtrackerMI(){ // // @@ -518,8 +545,8 @@ void AliTOFtrackerMI::MatchTracksMI(Bool_t mLastStep){ } // // Store quantities to be used for TOF Calibration - Float_t ToT=cgold->GetToT(); // in ps - t->SetTOFsignalToT(ToT); + Float_t tToT=cgold->GetToT(); // in ps + t->SetTOFsignalToT(tToT); Int_t ind[5]; ind[0]=cgold->GetDetInd(0); ind[1]=cgold->GetDetInd(1); diff --git a/TOF/AliTOFtrackerMI.h b/TOF/AliTOFtrackerMI.h index ef7ece1f1d0..4a2786407b2 100644 --- a/TOF/AliTOFtrackerMI.h +++ b/TOF/AliTOFtrackerMI.h @@ -28,15 +28,17 @@ public: AliTOFtrackerMI(AliTOFGeometry* geom, Double_t parPID[2]); AliTOFtrackerMI(const AliTOFtrackerMI &t); //Copy Ctor + AliTOFtrackerMI& operator=(const AliTOFtrackerMI &source); // ass. op. + // virtual ~AliTOFtrackerMI() {delete fTOFpid;} virtual ~AliTOFtrackerMI(); - virtual Int_t Clusters2Tracks(AliESD* /*event*/) {return -1;}; - virtual Int_t PropagateBack(AliESD* event); - virtual Int_t RefitInward(AliESD* /*event*/) {return -1;}; - virtual Int_t LoadClusters(TTree *dTree); // Loading Clusters from Digits - virtual void UnloadClusters();// UnLoad Clusters - virtual AliCluster *GetCluster(Int_t /*index*/) const {return NULL;}; - void GetLikelihood(Float_t dy, Float_t dz, const Double_t *cov, AliTOFtrack * track, Float_t & py, Float_t &pz); + virtual Int_t Clusters2Tracks(AliESD* /*event*/) {return -1;}; + virtual Int_t PropagateBack(AliESD* event); + virtual Int_t RefitInward(AliESD* /*event*/) {return -1;}; + virtual Int_t LoadClusters(TTree *dTree); // Loading Clusters from Digits + virtual void UnloadClusters();// UnLoad Clusters + virtual AliCluster *GetCluster(Int_t /*index*/) const {return NULL;}; + void GetLikelihood(Float_t dy, Float_t dz, const Double_t *cov, AliTOFtrack * track, Float_t & py, Float_t &pz); public: /* class AliTOFcluster { */ /* friend class AliTOFtrackerMI; */ diff --git a/TOF/AliTOFv4T0.cxx b/TOF/AliTOFv4T0.cxx index 52abd7f6c09..3e50f57b5c3 100644 --- a/TOF/AliTOFv4T0.cxx +++ b/TOF/AliTOFv4T0.cxx @@ -707,7 +707,7 @@ void AliTOFv4T0::DrawModule() const gMC->Gdopt("hide","off"); } //_____________________________________________________________________________ -void AliTOFv4T0::DrawDetectorModules() +void AliTOFv4T0::DrawDetectorModules() const { // // Draw a shaded view of the TOF detector version 4 @@ -779,7 +779,7 @@ void AliTOFv4T0::DrawDetectorModules() } //_____________________________________________________________________________ -void AliTOFv4T0::DrawDetectorStrips() +void AliTOFv4T0::DrawDetectorStrips() const { // // Draw a shaded view of the TOF strips for version 4 diff --git a/TOF/AliTOFv4T0.h b/TOF/AliTOFv4T0.h index fa691aa45d5..ca604fd91f7 100644 --- a/TOF/AliTOFv4T0.h +++ b/TOF/AliTOFv4T0.h @@ -30,8 +30,8 @@ public: virtual void TOFpc(Float_t, Float_t, Float_t, Float_t) {}; virtual void StepManager(); virtual void DrawModule() const; - virtual void DrawDetectorModules(); - virtual void DrawDetectorStrips(); + virtual void DrawDetectorModules() const; + virtual void DrawDetectorStrips() const; private: Int_t fIdFTOA; // FTOA volume identifier (outer plate A) diff --git a/TOF/AliTOFv5T0.cxx b/TOF/AliTOFv5T0.cxx index 74284fb49e7..b759de27de0 100644 --- a/TOF/AliTOFv5T0.cxx +++ b/TOF/AliTOFv5T0.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.6 2006/03/20 08:20:35 decaro +Al layer: positioning correction + Revision 1.5 2006/03/20 07:54:20 decaro Correction of some layer thickness @@ -237,6 +240,9 @@ void AliTOFv5T0::CreateGeometry() void AliTOFv5T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenA, Float_t zlenB) { + // + // Definition of the Time Of Fligh Resistive Plate Chambers + // const Float_t kPi = TMath::Pi(); @@ -978,7 +984,7 @@ void AliTOFv5T0::DrawModule() const gMC->Gdopt("hide","off"); } //_____________________________________________________________________________ -void AliTOFv5T0::DrawDetectorModules() +void AliTOFv5T0::DrawDetectorModules() const { // // Draw a shaded view of the TOF detector version 4 @@ -1044,7 +1050,7 @@ void AliTOFv5T0::DrawDetectorModules() } //_____________________________________________________________________________ -void AliTOFv5T0::DrawDetectorStrips() +void AliTOFv5T0::DrawDetectorStrips() const { // // Draw a shaded view of the TOF strips for version 4 @@ -1477,7 +1483,8 @@ void AliTOFv5T0::StepManager() } } //------------------------------------------------------------------- -void AliTOFv5T0::MaterialMixer(Float_t* p,Float_t* a,Float_t* m,Float_t* d,Float_t* s,Int_t n) { +void AliTOFv5T0::MaterialMixer(Float_t* p,Float_t* a,Float_t* m,Float_t* d,Float_t* s,Int_t n) const +{ // a[] atomic weights vector (in) // (atoms present in more compound appear separately) // m[] number of corresponding atoms in the mixture (in) diff --git a/TOF/AliTOFv5T0.h b/TOF/AliTOFv5T0.h index 3da9a0aaa50..319004df84c 100644 --- a/TOF/AliTOFv5T0.h +++ b/TOF/AliTOFv5T0.h @@ -30,12 +30,12 @@ public: virtual void TOFpc(Float_t, Float_t, Float_t, Float_t, Float_t, Float_t) {}; virtual void StepManager(); virtual void DrawModule() const; - virtual void DrawDetectorModules(); - virtual void DrawDetectorStrips(); + virtual void DrawDetectorModules() const; + virtual void DrawDetectorStrips() const; protected: - void MaterialMixer(Float_t* p,Float_t* a,Float_t* m,Float_t* d,Float_t* s,Int_t n); + void MaterialMixer(Float_t* p,Float_t* a,Float_t* m,Float_t* d,Float_t* s,Int_t n) const; private: Int_t fIdFTOA; // FTOA volume identifier (outer plate A)