X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TOF%2FAliTOFClusterFinderV1.cxx;h=607bfdc04f3d1fd14b981527a028214897cd4d0d;hb=52284ebd6794b13619ef2b316ef86e85ff3fd0f2;hp=227aa2a8595012533c4741cced3bad17d9303c77;hpb=e3bd5504b51dc00636549553dbd3587a42ac2fb1;p=u%2Fmrichter%2FAliRoot.git diff --git a/TOF/AliTOFClusterFinderV1.cxx b/TOF/AliTOFClusterFinderV1.cxx index 227aa2a8595..607bfdc04f3 100644 --- a/TOF/AliTOFClusterFinderV1.cxx +++ b/TOF/AliTOFClusterFinderV1.cxx @@ -15,6 +15,12 @@ /* $Log: AliTOFClusterFinderV1.cxx,v $ +Revision 2009/04/20 A. De Caro + - added two new global variables, called fTOFGeometry and fTOFdigits; + - added a new method, called FindClustersWithoutTOT, + to transform TOF digits with fTOT=0 in one pad clusters; + - update of the covariance matrix elements for the TOF clusters + Revision 0.01 2008/05/10 A. De Caro */ @@ -38,6 +44,7 @@ Revision 0.01 2008/05/10 A. De Caro #include "AliDAQ.h" #include "AliLog.h" #include "AliRawReader.h" +#include "AliLoader.h" #include "AliRunLoader.h" #include "AliGeomManager.h" @@ -48,73 +55,131 @@ Revision 0.01 2008/05/10 A. De Caro #include "AliTOFClusterFinderV1.h" #include "AliTOFcluster.h" #include "AliTOFdigit.h" -//#include "AliTOFselectedDigit.h" #include "AliTOFDigitMap.h" -#include "AliTOFGeometry.h" #include "AliTOFrawData.h" -#include "AliTOFRawStream.h" +#include "AliTOFReconstructor.h" +#include "AliTOFRecoParam.h" +using std::endl; +using std::cout; +using std::ofstream; +using std::ios; ClassImp(AliTOFClusterFinderV1) +//_____________________________________________________________________________ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliTOFcalib *calib): + TTask("AliTOFClusterFinderV1",""), fRunLoader(0), fDigits(new TClonesArray("AliTOFdigit", 4000)), fRecPoints(new TClonesArray("AliTOFcluster", 4000)), fNumberOfTofClusters(0), fNumberOfTofDigits(0), - fMaxDeltaTime(10), + fNumberOfTofTrgPads(0), + fkRecoParam(0),//AliTOFReconstructor::GetRecoParam()), + fMaxDeltaTime(0),//fkRecoParam->GetMaxDeltaTime()), fVerbose(0), fDecoderVersion(0), fTOFcalib(calib), - fTOFdigitMap(new AliTOFDigitMap()) - + fTOFdigitMap(new AliTOFDigitMap()), + fTOFGeometry(new AliTOFGeometry()), + fTOFdigits(new TTree()), + fTOFRawStream(AliTOFRawStream()), + fCalibrateTOFtimes(1) { // // Constructor // + for (Int_t ii=0; iiGetMaxDeltaTime(); + } + else + fMaxDeltaTime = 2; + + TString validity = (TString)fTOFcalib->GetOfflineValidity(); + if (validity.CompareTo("valid")==0) { + AliInfo(Form(" validity = %s - Using offline calibration parameters", validity.Data())); + } else { + AliInfo(Form(" validity = %s - Using online calibration parameters", validity.Data())); + } + } -//_____________________________________________________________________________ +//_____________________________________________________________________________ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliRunLoader* runLoader, AliTOFcalib *calib): + TTask("AliTOFClusterFinderV1",""), fRunLoader(runLoader), fDigits(new TClonesArray("AliTOFdigit", 4000)), fRecPoints(new TClonesArray("AliTOFcluster", 4000)), fNumberOfTofClusters(0), fNumberOfTofDigits(0), - fMaxDeltaTime(10), + fNumberOfTofTrgPads(0), + fkRecoParam(0),//AliTOFReconstructor::GetRecoParam()), + fMaxDeltaTime(0),//fkRecoParam->GetMaxDeltaTime()), fVerbose(0), fDecoderVersion(0), fTOFcalib(calib), - fTOFdigitMap(new AliTOFDigitMap()) - + fTOFdigitMap(new AliTOFDigitMap()), + fTOFGeometry(new AliTOFGeometry()), + fTOFdigits(new TTree()), + fTOFRawStream(AliTOFRawStream()), + fCalibrateTOFtimes(1) { // // Constructor // + for (Int_t ii=0; iiGetMaxDeltaTime(); + } + else + fMaxDeltaTime = 2; + + TString validity = (TString)fTOFcalib->GetOfflineValidity(); + if (validity.CompareTo("valid")==0) { + AliInfo(Form(" validity = %s - Using offline calibration parameters", validity.Data())); + } else { + AliInfo(Form(" validity = %s - Using online calibration parameters", validity.Data())); + } + } //_____________________________________________________________________________ AliTOFClusterFinderV1::AliTOFClusterFinderV1(const AliTOFClusterFinderV1 &source) - :TObject(), - fRunLoader(0), - fDigits(new TClonesArray("AliTOFdigit", 4000)), - fRecPoints(new TClonesArray("AliTOFcluster", 4000)), - fNumberOfTofClusters(0), - fNumberOfTofDigits(0), - fMaxDeltaTime(10), - fVerbose(0), - fDecoderVersion(0), - fTOFcalib(0), - fTOFdigitMap(new AliTOFDigitMap()) - + :TTask(source), + fRunLoader(0), + fDigits(source.fDigits), + fRecPoints(source.fRecPoints), + fNumberOfTofClusters(0), + fNumberOfTofDigits(0), + fNumberOfTofTrgPads(0), + fkRecoParam(0),//AliTOFReconstructor::GetRecoParam()), + fMaxDeltaTime(0),//fkRecoParam->GetMaxDeltaTime()), + fVerbose(0), + fDecoderVersion(source.fDecoderVersion), + fTOFcalib(source.fTOFcalib), + fTOFdigitMap(new AliTOFDigitMap()), + fTOFGeometry(new AliTOFGeometry()), + fTOFdigits(source.fTOFdigits), + fTOFRawStream(source.fTOFRawStream), + fCalibrateTOFtimes(1) { // copy constructor - this->fDigits=source.fDigits; - this->fRecPoints=source.fRecPoints; - this->fDecoderVersion=source.fDecoderVersion; - this->fTOFcalib=source.fTOFcalib; + + for (Int_t ii=0; iiGetMaxDeltaTime(); + } + else + fMaxDeltaTime = 2; } //_____________________________________________________________________________ @@ -122,12 +187,25 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(const AliTOFClusterFinderV1 &source AliTOFClusterFinderV1& AliTOFClusterFinderV1::operator=(const AliTOFClusterFinderV1 &source) { // ass. op. - this->fDigits=source.fDigits; - this->fRecPoints=source.fRecPoints; - this->fVerbose=source.fVerbose; - this->fDecoderVersion=source.fDecoderVersion; - this->fTOFcalib=source.fTOFcalib; - this->fTOFdigitMap=source.fTOFdigitMap; + + if (this == &source) + return *this; + + TObject::operator=(source); + for (Int_t ii=0; iiDelete(); + fNumberOfTofClusters = 0; + } + } //_____________________________________________________________________________ @@ -169,10 +258,15 @@ void AliTOFClusterFinderV1::Digits2RecPoints(TTree* digitsTree, TTree* clusterTr Int_t inholes = 0; + ResetRecpoint(); + + fDigits->Clear(); TClonesArray &aDigits = *fDigits; - if (digitsTree == 0x0) + if (digitsTree == 0x0) { AliFatal("Can not get TreeD for TOF"); + return; + } TBranch *branch = digitsTree->GetBranch("TOF"); if (!branch) { @@ -185,7 +279,7 @@ void AliTOFClusterFinderV1::Digits2RecPoints(TTree* digitsTree, TTree* clusterTr TClonesArray *digits = &staticDigits; branch->SetAddress(&digits); digitsTree->GetEvent(0); - AliInfo(Form("Number of TOF digits: %d", digits->GetEntriesFast())); + AliDebug(1,Form("Number of TOF digits: %d", digits->GetEntriesFast())); AliTOFdigit *tofDigit; @@ -201,15 +295,14 @@ void AliTOFClusterFinderV1::Digits2RecPoints(TTree* digitsTree, TTree* clusterTr Bool_t status = kTRUE; - AliInfo(" Calibrating TOF Digits: "); + AliDebug(1," Calibrating TOF Digits"); + /* TString validity = (TString)fTOFcalib->GetOfflineValidity(); - AliInfo(Form(" validity = %s", validity.Data())); if (validity.CompareTo("valid")==0) { - AliInfo(" ...using offline calibration parameters"); - } - else { - AliInfo(" ...using online calibration parameters"); - } + AliInfo(Form(" validity = %s - Using offline calibration parameters", validity.Data())); + } else + AliInfo(Form(" validity = %s - Using online calibration parameters", validity.Data())); + */ Int_t ii = 0; for (ii=0; iiGetEntriesFast(); ii++) { @@ -227,13 +320,14 @@ void AliTOFClusterFinderV1::Digits2RecPoints(TTree* digitsTree, TTree* clusterTr } } + tdcCorr = tofDigit->GetTdc(); status = MakeSlewingCorrection(detectorIndex, tofDigit->GetToT(), tofDigit->GetTdc(), tdcCorr); for (jj=0; jj<4; jj++) info[jj] = -1; info[0] = tdcCorr;//tofDigit->GetTdc(); info[1] = tofDigit->GetAdc(); info[2] = tofDigit->GetToT(); - info[3] = tofDigit->GetTdc();//tofDigit->GetTdcND(); + info[3] = tofDigit->GetTdcND();//tofDigit->GetTdc();// tracks = tofDigit->GetTracks(); dummy = detectorIndex[3]; @@ -243,7 +337,7 @@ void AliTOFClusterFinderV1::Digits2RecPoints(TTree* digitsTree, TTree* clusterTr new (aDigits[last]) AliTOFdigit(tracks, detectorIndex, info); if (status) fTOFdigitMap->AddDigit(detectorIndex, last); - AliDebug(2, Form(" Digits reading %2i -> %2i %1i %2i %1i %2i (%d, %d, %d)", + AliDebug(2, Form(" Digits reading %2d -> %2d %1d %2d %1d %2d (%d, %d, %d)", last, detectorIndex[0], detectorIndex[1], detectorIndex[2], detectorIndex[3], detectorIndex[4], info[0], info[1], info[3])); @@ -260,16 +354,16 @@ void AliTOFClusterFinderV1::Digits2RecPoints(TTree* digitsTree, TTree* clusterTr FillRecPoint(); clusterTree->Fill(); - AliInfo(Form("Number of found TOF clusters: %d", fNumberOfTofClusters)); + AliDebug(1,Form("Number of found clusters: %d", fNumberOfTofClusters)); - ResetRecpoint(); +// ResetRecpoint(); fTOFdigitMap->Clear(); ResetDigits(); - AliInfo(Form("Execution time to read TOF digits and to write TOF clusters : R:%.4fs C:%.4fs", - stopwatch.RealTime(),stopwatch.CpuTime())); + AliDebug(1,Form("Execution time to read TOF digits and to write TOF clusters : R:%.4fs C:%.4fs", + stopwatch.RealTime(),stopwatch.CpuTime())); if (inholes) AliWarning(Form("Clusters in the TOF holes: %d",inholes)); @@ -285,13 +379,15 @@ void AliTOFClusterFinderV1::Digits2RecPoints(AliRawReader *rawReader, TTree *clu TStopwatch stopwatch; stopwatch.Start(); + ResetRecpoint(); AliDebug(2, "TreeD re-creation"); - TTree *digitsTree = new TTree(); + //TTree *digitsTree = new TTree(); + //Raw2Digits(rawReader, digitsTree); - Raw2Digits(rawReader, digitsTree); + Raw2Digits(rawReader, fTOFdigits); - AliDebug(2,Form("Number of TOF digits: %d", fNumberOfTofDigits)); + AliDebug(1,Form("Number of TOF digits: %d", fNumberOfTofDigits)); ResetRecpoint(); Int_t bufsize = 32000; @@ -300,16 +396,16 @@ void AliTOFClusterFinderV1::Digits2RecPoints(AliRawReader *rawReader, TTree *clu clustersTree->Fill(); - AliInfo(Form("Number of found clusters: %i", fNumberOfTofClusters)); + AliDebug(1,Form("Number of found clusters: %d", fNumberOfTofClusters)); - ResetRecpoint(); +// ResetRecpoint(); fTOFdigitMap->Clear(); ResetDigits(); - AliInfo(Form("Execution time to read TOF raw data and to write TOF clusters : R:%.4fs C:%.4fs", - stopwatch.RealTime(),stopwatch.CpuTime())); + AliDebug(1,Form("Execution time to read TOF raw data and to write TOF clusters : R:%.4fs C:%.4fs", + stopwatch.RealTime(),stopwatch.CpuTime())); } @@ -332,7 +428,8 @@ void AliTOFClusterFinderV1::Raw2Digits(AliRawReader *rawReader, TTree* digitsTre digitsTree->Branch("TOF", &fDigits); TClonesArray &aDigits = *fDigits; - AliTOFRawStream tofInput(rawReader); + fTOFRawStream.Clear(); + fTOFRawStream.SetRawReader(rawReader); ofstream ftxt; if (fVerbose==2) ftxt.open("TOFdigitsRead.txt",ios::app); @@ -352,29 +449,28 @@ void AliTOFClusterFinderV1::Raw2Digits(AliRawReader *rawReader, TTree* digitsTre Bool_t status = kTRUE; - AliInfo(" Calibrating TOF Digits: "); + /* TString validity = (TString)fTOFcalib->GetOfflineValidity(); - AliInfo(Form(" validity = %s", validity.Data())); if (validity.CompareTo("valid")==0) { - AliInfo(" ...using offline calibration parameters"); - } - else { - AliInfo(" ...using online calibration parameters"); - } + AliInfo(Form(" validity = %s - Using offline calibration parameters", validity.Data())); + } else + AliInfo(Form(" validity = %s - Using online calibration parameters", validity.Data())); + */ + + if (fDecoderVersion) + AliInfo("Using New Decoder"); Int_t indexDDL = 0; Int_t iRawData = 0; for (indexDDL=0; indexDDLReset(); - if (fDecoderVersion) { - AliInfo("Using New Decoder \n"); - tofInput.LoadRawDataBuffers(indexDDL,fVerbose); - } - else tofInput.LoadRawData(indexDDL); + if (fDecoderVersion) + fTOFRawStream.LoadRawDataBuffers(indexDDL,fVerbose); + else fTOFRawStream.LoadRawData(indexDDL); - clonesRawData = (TClonesArray*)tofInput.GetRawData(); - if (clonesRawData->GetEntriesFast()!=0) AliInfo(Form(" TOF raw data number = %3i", clonesRawData->GetEntriesFast())); + clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData(); + if (clonesRawData->GetEntriesFast()!=0) AliDebug(2,Form(" TOF raw data number = %3d", clonesRawData->GetEntriesFast())); for (iRawData = 0; iRawDataGetEntriesFast(); iRawData++) { AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData); @@ -382,24 +478,41 @@ void AliTOFClusterFinderV1::Raw2Digits(AliRawReader *rawReader, TTree* digitsTre //if (tofRawDatum->GetTOT()==-1 || tofRawDatum->GetTOF()==-1) continue; if (tofRawDatum->GetTOF()==-1) continue; - tofInput.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(), - tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex); + fTOFRawStream.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(), + tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex); tdcCorr = 0; dummy = detectorIndex[3]; detectorIndex[3] = detectorIndex[4];//padz detectorIndex[4] = dummy;//padx + + tdcCorr = tofRawDatum->GetTOF(); status = MakeSlewingCorrection(detectorIndex, tofRawDatum->GetTOT(), tofRawDatum->GetTOF(), tdcCorr); digit[0] = tdcCorr; digit[1] = tofRawDatum->GetTOT(); digit[2] = tofRawDatum->GetTOT(); - digit[3] = tofRawDatum->GetTOF(); + digit[3] = -1;//tofRawDatum->GetTOF(); //tofND + + // noferini + Float_t pos[3]; + AliTOFGeometry::GetPosPar(detectorIndex, pos); + Float_t length = 0.; + for (Int_t ic = 0; ic < 3; ic++) length += pos[ic] * pos[ic]; + length = TMath::Sqrt(length); + Float_t timealligned = tdcCorr*24.4 - length * 0.0333564095198152043; // subtract the minimal time in + + if(status && timealligned > -1000 && timealligned < 24000){ + fNumberOfTofTrgPads++; + } dummy = detectorIndex[3]; detectorIndex[3] = detectorIndex[4];//padx detectorIndex[4] = dummy;//padz + /* check valid index */ + if (detectorIndex[0]==-1||detectorIndex[1]==-1||detectorIndex[2]==-1||detectorIndex[3]==-1||detectorIndex[4]==-1) continue; + // Do not reconstruct anything in the holes if (detectorIndex[0]==13 || detectorIndex[0]==14 || detectorIndex[0]==15 ) { // sectors with holes if (detectorIndex[1]==2) { // plate with holes @@ -411,6 +524,7 @@ void AliTOFClusterFinderV1::Raw2Digits(AliRawReader *rawReader, TTree* digitsTre last = fDigits->GetEntriesFast(); new (aDigits[last]) AliTOFdigit(tracks, detectorIndex, digit); if (status) fTOFdigitMap->AddDigit(detectorIndex, last); + if (fVerbose==2) { if (indexDDL<10) ftxt << " " << indexDDL; @@ -440,7 +554,7 @@ void AliTOFClusterFinderV1::Raw2Digits(AliRawReader *rawReader, TTree* digitsTre else ftxt << " " << digit[3] << endl; } - AliDebug(2, Form(" Raw data reading %2i -> %2i %1i %2i %1i %2i (%d, %d, %d)", + AliDebug(2, Form(" Raw data reading %2d -> %2d %1d %2d %1d %2d (%d, %d, %d)", last, detectorIndex[0], detectorIndex[1], detectorIndex[2], detectorIndex[4], detectorIndex[3], digit[0], digit[1], digit[3])); @@ -473,73 +587,103 @@ void AliTOFClusterFinderV1::FillRecPoint() // i.e. fRecPoints // - //Int_t dummy4_1 = -1; - //Int_t dummy3_1 = -1; - //Int_t dummy2_1 = -1; - Int_t dummy = -1; + Int_t dummy4 = -1; + Int_t dummy3 = -1; + Int_t dummy2 = -1; + Int_t dummy = -1; - for(Int_t iPlate=0; iPlate=0; iPlate--) { + for(Int_t iStrip=AliTOFGeometry::NStrip(iPlate)-1; iStrip>=0; iStrip--) { + //for (Int_t iSector=AliTOFGeometry::NSectors()-1; iSector>=0; iSector--) { for (Int_t iSector=0; iSectorStripDigitCheck(iSector,iPlate,iStrip))) continue; - FindClustersPerStrip(iSector, iPlate, iStrip, 4); // 4 pads clusters - dummy4_1 = fNumberOfTofClusters; - if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; - FindClustersPerStrip(iSector, iPlate, iStrip, 4); // 4 pads clusters - if (fNumberOfTofClusters!=dummy4_1) - AliDebug(2, Form(" (4): n1= %5i, n2 = %5", dummy4_1, fNumberOfTofClusters)); - */ - /* - if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; - FindClustersPerStrip(iSector, iPlate, iStrip, 3); // 3 pads clusters - dummy3_1 = fNumberOfTofClusters; - if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; - FindClustersPerStrip(iSector, iPlate, iStrip, 3); // 3 pads clusters - if (fNumberOfTofClusters!=dummy3_1) - AliDebug(2, Form(" (3): n1= %5i, n2 = %5", dummy3_1, fNumberOfTofClusters)); - */ - /* - if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; - FindClustersPerStrip(iSector, iPlate, iStrip, 2); // 2 pads clusters - dummy2_1 = fNumberOfTofClusters; - if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; - FindClustersPerStrip(iSector, iPlate, iStrip, 2); // 2 pads clusters - if (fNumberOfTofClusters!=dummy2_1) - AliDebug(2, Form(" (2): n1= %5i, n2 =%5", dummy2_1, fNumberOfTofClusters)); - */ - /* - if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; - dummy = fNumberOfTofClusters; - FindClusters34(iSector, iPlate, iStrip); // 3 pads clusters between 4 hit pads - if (fNumberOfTofClusters!=dummy) - AliDebug(2, Form(" (3 between 4): n1 = %5i, n2 = %5i", fNumberOfTofClusters, dummy)); - */ - /* - if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; - dummy = fNumberOfTofClusters; - FindClusters23(iSector, iPlate, iStrip); // 2 pads clusters between 3 hit pads - if (fNumberOfTofClusters!=dummy) - AliDebug(2, Form(" (2 between 3): n1 = %5i, n2 = %5i", fNumberOfTofClusters, dummy)); - if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; - dummy = fNumberOfTofClusters; - FindClusters24(iSector, iPlate, iStrip); // 2 pads clusters between 4 hit pads - if (fNumberOfTofClusters!=dummy) - AliDebug(2, Form(" (2 between 4): n1 = %5i, n2 = %5i", fNumberOfTofClusters, dummy)); - */ + if (fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip)) + AliDebug(1,Form(" Number of TOF digits in (%2d,%1d,%2d) -> %d", + iSector,iPlate,iStrip,fTOFdigitMap->FilledCellsInStrip(iSector,iPlate,iStrip))); if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; - dummy = fNumberOfTofClusters; - FindOnePadClusterPerStrip(iSector, iPlate, iStrip); // 1 pad clusters - if (fNumberOfTofClusters!=dummy) - AliDebug(2,Form(" (1): n1 = %5i, n2 = %5i", fNumberOfTofClusters, dummy)); + FindClustersWithoutTOT(iSector, iPlate, iStrip); // clusters coming from digits without TOT measurement + + if (fMaxDeltaTime>0) { + + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + //if (fTOFdigitMap->FilledCellsInStrip(iSector,iPlate,iStrip)>=4) + FindClustersPerStrip(iSector, iPlate, iStrip, 4); // 4 pads clusters + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + + dummy4 = fNumberOfTofClusters; + FindClustersPerStrip(iSector, iPlate, iStrip, 4); // 4 pads clusters + if (fNumberOfTofClusters!=dummy4) + AliDebug(2, Form(" (4): n1= %5d, n2 = %5d", dummy4, fNumberOfTofClusters)); + + + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + FindClustersPerStrip(iSector, iPlate, iStrip, 3); // 3 pads clusters + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + + dummy3 = fNumberOfTofClusters; + FindClustersPerStrip(iSector, iPlate, iStrip, 3); // 3 pads clusters + if (fNumberOfTofClusters!=dummy3) + AliDebug(2, Form(" (3): n1= %5d, n2 = %5d", dummy3, fNumberOfTofClusters)); + + + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + FindClustersPerStrip(iSector, iPlate, iStrip, 2); // 2 pads clusters + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + + dummy2 = fNumberOfTofClusters; + FindClustersPerStrip(iSector, iPlate, iStrip, 2); // 2 pads clusters + if (fNumberOfTofClusters!=dummy2) + AliDebug(2, Form(" (2): n1= %5d, n2 =%5d", dummy2, fNumberOfTofClusters)); + + + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + dummy = fNumberOfTofClusters; + FindClusters34(iSector, iPlate, iStrip); // 3 pads clusters between 4 hit pads + if (fNumberOfTofClusters!=dummy) + AliDebug(2, Form(" (3 between 4): n1 = %5d, n2 = %5d", fNumberOfTofClusters, dummy)); + + + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + dummy = fNumberOfTofClusters; + FindClusters23(iSector, iPlate, iStrip); // 2 pads clusters between 3 hit pads + if (fNumberOfTofClusters!=dummy) + AliDebug(2, Form(" (2 between 3): n1 = %5d, n2 = %5d", fNumberOfTofClusters, dummy)); + + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + dummy = fNumberOfTofClusters; + FindClusters24(iSector, iPlate, iStrip); // 2 pads clusters between 4 hit pads + if (fNumberOfTofClusters!=dummy) + AliDebug(2, Form(" (2 between 4): n1 = %5d, n2 = %5d", fNumberOfTofClusters, dummy)); + + + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + dummy = fNumberOfTofClusters; + FindOnePadClusterPerStrip(iSector, iPlate, iStrip); // 1 pad clusters + if (fNumberOfTofClusters!=dummy) + AliDebug(2,Form(" (1): n1 = %5d, n2 = %5d", fNumberOfTofClusters, dummy)); + + if (fTOFdigitMap->DigitInStrip(iSector,iPlate,iStrip)>0) + AliDebug(2, Form(" (1): number of clusters = %5d (remaining digit %2d), -%2d %1d %2d-", + fNumberOfTofClusters, fTOFdigitMap->DigitInStrip(iSector,iPlate,iStrip), + iSector, iPlate, iStrip)); + + } + else { + if (!(fTOFdigitMap->StripDigitCheck(iSector,iPlate,iStrip))) continue; + dummy = fNumberOfTofClusters; + FindOnePadClusterPerStrip(iSector, iPlate, iStrip); // 1 pad clusters + if (fNumberOfTofClusters!=dummy) + AliDebug(2,Form(" (1): n1 = %5d, n2 = %5d", fNumberOfTofClusters, dummy)); + + if (fTOFdigitMap->DigitInStrip(iSector,iPlate,iStrip)>0) + AliDebug(2, Form(" (1): number of clusters = %5d (remaining digit %2d), -%2d %1d %2d-", + fNumberOfTofClusters, fTOFdigitMap->DigitInStrip(iSector,iPlate,iStrip), + iSector, iPlate, iStrip)); + + } - if (fTOFdigitMap->DigitInStrip(iSector,iPlate,iStrip)>0) - AliDebug(2, Form(" (1): numero di clusters = %5i (remaining digit %2i), -%2i %1i %2i-", - fNumberOfTofClusters, fTOFdigitMap->DigitInStrip(iSector,iPlate,iStrip), - iSector, iPlate, iStrip)); } } @@ -551,8 +695,11 @@ void AliTOFClusterFinderV1::FillRecPoint() Int_t ii, jj; Int_t detectorIndex[5]; - Int_t parTOF[5]; + for (jj=0; jj<5; jj++) detectorIndex[jj] = -1; + Int_t parTOF[7]; + for (jj=0; jj<7; jj++) parTOF[jj] = -1; Int_t trackLabels[3]; + for (jj=0; jj<3; jj++) trackLabels[jj] = -1; Int_t digitIndex = -1; Bool_t status = kTRUE; Float_t posClus[3]; @@ -562,57 +709,61 @@ void AliTOFClusterFinderV1::FillRecPoint() UShort_t volIdClus; for (ii=0; iiGetIndex(); - for(jj=0; jj<5; jj++) detectorIndex[jj] = fTofClusters[ii]->GetDetInd(jj); - volIdClus = GetClusterVolIndex(detectorIndex); - for(jj=0; jj<3; jj++) trackLabels[jj] = fTofClusters[ii]->GetLabel(jj); - parTOF[0] = fTofClusters[ii]->GetTDC(); // TDC - parTOF[1] = fTofClusters[ii]->GetToT(); // TOT - parTOF[2] = fTofClusters[ii]->GetADC(); // ADC=TOT - parTOF[3] = fTofClusters[ii]->GetTDCND(); // TDCND - parTOF[4] = fTofClusters[ii]->GetTDCRAW();//RAW - status = fTofClusters[ii]->GetStatus(); - - posClus[0] = fTofClusters[ii]->GetX(); - posClus[1] = fTofClusters[ii]->GetY(); - posClus[2] = fTofClusters[ii]->GetZ(); + AliTOFcluster* clOr = fTofClusters[ii]; + fTofClusters[ii] = 0; + digitIndex = clOr->GetIndex(); + for(jj=0; jj<5; jj++) detectorIndex[jj] = clOr->GetDetInd(jj); + volIdClus = fTOFGeometry->GetAliSensVolIndex(detectorIndex[0],detectorIndex[1],detectorIndex[2]); + //volIdClus = GetClusterVolIndex(detectorIndex); + for(jj=0; jj<3; jj++) trackLabels[jj] = clOr->GetLabel(jj); + parTOF[0] = clOr->GetTDC(); // TDC + parTOF[1] = clOr->GetToT(); // TOT + parTOF[2] = clOr->GetADC(); // ADC=TOT + parTOF[3] = clOr->GetTDCND(); // TDCND + parTOF[4] = clOr->GetTDCRAW();//RAW + parTOF[5] = 0; + parTOF[6] = 0; + status = clOr->GetStatus(); + + posClus[0] = clOr->GetX(); + posClus[1] = clOr->GetY(); + posClus[2] = clOr->GetZ(); //for (jj=0; jj<6; jj++) covClus[jj] = 0.; - //((AliCluster*)fTofClusters[ii])->GetGlobalCov(covClus); + //((AliCluster*)clOr)->GetGlobalCov(covClus); new(lRecPoints[ii]) AliTOFcluster(volIdClus, (Double_t)posClus[0], (Double_t)posClus[1], (Double_t)posClus[2], - (Double_t)(fTofClusters[ii]->GetSigmaX2()), - (Double_t)(fTofClusters[ii]->GetSigmaXY()), - (Double_t)(fTofClusters[ii]->GetSigmaXZ()), - (Double_t)(fTofClusters[ii]->GetSigmaY2()), - (Double_t)(fTofClusters[ii]->GetSigmaYZ()), - (Double_t)(fTofClusters[ii]->GetSigmaZ2()), + (Double_t)(clOr->GetSigmaX2()), + (Double_t)(clOr->GetSigmaXY()), + (Double_t)(clOr->GetSigmaXZ()), + (Double_t)(clOr->GetSigmaY2()), + (Double_t)(clOr->GetSigmaYZ()), + (Double_t)(clOr->GetSigmaZ2()), //(Double_t)covClus[0], (Double_t)covClus[1], (Double_t)covClus[2], //(Double_t)covClus[3], (Double_t)covClus[4], (Double_t)covClus[5], trackLabels, detectorIndex, parTOF, status, digitIndex); - AliDebug(2, Form(" %4i %4i %f %f %f %f %f %f %f %f %f %3i %3i %3i %2i %1i %2i %1i %2i %4i %3i %3i %4i %4i %1i %4i", + AliDebug(2, Form(" %4d %4d %f %f %f %f %f %f %f %f %f %3d %3d %3d %2d %1d %2d %1d %2d %4d %3d %3d %4d %4d %1d %4d", ii, volIdClus, posClus[0], posClus[1], posClus[2], - fTofClusters[ii]->GetSigmaX2(), - fTofClusters[ii]->GetSigmaXY(), - fTofClusters[ii]->GetSigmaXZ(), - fTofClusters[ii]->GetSigmaY2(), - fTofClusters[ii]->GetSigmaYZ(), - fTofClusters[ii]->GetSigmaZ2(), + clOr->GetSigmaX2(), + clOr->GetSigmaXY(), + clOr->GetSigmaXZ(), + clOr->GetSigmaY2(), + clOr->GetSigmaYZ(), + clOr->GetSigmaZ2(), trackLabels[0], trackLabels[1], trackLabels[2], detectorIndex[0], detectorIndex[1], detectorIndex[2], detectorIndex[3], detectorIndex[4], parTOF[0], parTOF[1], parTOF[2], parTOF[3], parTOF[4], status, digitIndex)); - + delete clOr; } for (Int_t iSector=0; iSectorStripDigitCheck(iSector,iPlate,iStrip))) continue; - AliDebug(2, Form(" END %2i %1i %2i %5i", + AliDebug(2, Form(" END %2d %1d %2d %5d", iSector, iPlate, iStrip, fTOFdigitMap->DigitInStrip(iSector,iPlate,iStrip))); } } @@ -632,12 +783,10 @@ void AliTOFClusterFinderV1::FindOnePadClusterPerStrip(Int_t nSector, // const Int_t kMaxNumberOfTracksPerDigit = 3; - const Int_t kMaxNumberOfDigitsPerVolume = 3; + const Int_t kMaxNumberOfDigitsPerVolume = 10; Int_t jj = 0; - AliTOFGeometry *tofGeometry = new AliTOFGeometry(); - Int_t det[5] = {nSector,nPlate,nStrip,-1,-1};//sector,plate,strip,padZ,padX Int_t vol[5] = {nSector,nPlate,nStrip,-1,-1};//sector,plate,strip,padX,padZ UShort_t volIdClus = 0; @@ -650,16 +799,15 @@ void AliTOFClusterFinderV1::FindOnePadClusterPerStrip(Int_t nSector, Double_t covClus[6]; for (jj=0; jj<6; jj++) covClus[jj] = 0.; - Int_t parTOF[5]; - for (jj=0; jj<5; jj++) parTOF[jj] = 0; + Int_t parTOF[7]; + for (jj=0; jj<7; jj++) parTOF[jj] = 0; Bool_t status = kTRUE; //assume all sim channels ok in the beginning... Int_t tracks[kMaxNumberOfTracksPerDigit]; - for (jj=0; jj<3; jj++) tracks[jj] = -1; + for (jj=0; jjGetNumberOfDigits(vol)==0) continue; @@ -677,31 +825,32 @@ void AliTOFClusterFinderV1::FindOnePadClusterPerStrip(Int_t nSector, if (fTOFdigitMap->GetDigitIndex(vol,digIndex)<0) continue; digitInteresting = (AliTOFdigit*)fDigits->UncheckedAt(fTOFdigitMap->GetDigitIndex(vol,digIndex)); - AliDebug(2, Form(" %2i %1i %2i %1i %2i %f %f %f %5i %5i %5i %5i", + AliDebug(2, Form(" %3d %5d %2d %1d %2d %1d %2d %d %d %d %5d %5d %5d %5d", + fTOFdigitMap->GetNumberOfDigits(vol), digIndex, vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), fTOFdigitMap->GetDigitIndex(vol,digIndex), digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - //dummyPad = vol[3]; - //vol[3] = vol[4]; - //vol[4] = dummyPad; - det[3] = vol[4]; - det[4] = vol[3]; - tofGeometry->GetPosPar(det,pos); + det[3] = vol[4]; // padz + det[4] = vol[3]; // padx + fTOFGeometry->GetPosPar(det,pos); AliDebug(1,Form(" %f %f %f", pos[0], pos[1], pos[2])); //insert cluster for (jj=0; jj<3; jj++) posClus[jj] = pos[jj]; parTOF[0] = Int_t(digitInteresting->GetTdc()); - parTOF[1] = Int_t(digitInteresting->GetAdc()); - parTOF[2] = Int_t(digitInteresting->GetToT()); - parTOF[3] = Int_t(digitInteresting->GetTdc()); + parTOF[1] = Int_t(digitInteresting->GetToT()); + parTOF[2] = Int_t(digitInteresting->GetAdc()); + parTOF[3] = Int_t(digitInteresting->GetTdcND()); parTOF[4] = Int_t(digitInteresting->GetTdc()); + parTOF[5] = 0; + parTOF[6] = 0; - volIdClus = GetClusterVolIndex(det); + volIdClus = fTOFGeometry->GetAliSensVolIndex(det[0],det[1],det[2]); + //volIdClus = GetClusterVolIndex(det); for (jj=0; jj<6; jj++) covClus[jj] = 0.; GetClusterPars(det, posClus, covClus); @@ -723,7 +872,7 @@ void AliTOFClusterFinderV1::FindOnePadClusterPerStrip(Int_t nSector, tracks, det, parTOF, status, fTOFdigitMap->GetDigitIndex(vol,digIndex)); InsertCluster(tofCluster); - AliDebug(2, Form(" %4i %f %f %f %f %f %f %f %f %f %3i %3i %3i %2i %1i %2i %1i %2i %4i %3i %3i %4i %4i %1i %4i", + AliDebug(2, Form(" %4d %f %f %f %f %f %f %f %f %f %3d %3d %3d %2d %1d %2d %1d %2d %4d %3d %3d %4d %4d %1d %4d", volIdClus, posClus[0], posClus[1], posClus[2], covClus[0], covClus[1], covClus[2], covClus[3], covClus[4], covClus[5], tracks[0], tracks[1], tracks[2], @@ -732,11 +881,131 @@ void AliTOFClusterFinderV1::FindOnePadClusterPerStrip(Int_t nSector, status, fTOFdigitMap->GetDigitIndex(vol,digIndex))); AliDebug(2, Form(" %f %f %f", pos[0], pos[1], pos[2])); - AliDebug(2, Form(" %f %f", parTOF[0], parTOF[2])); + AliDebug(2, Form(" %d %d", parTOF[0], parTOF[2])); + + fTOFdigitMap->ResetDigit(vol, digIndex); + + } + + } + } + +} +//_____________________________________________________________________________ + +void AliTOFClusterFinderV1::FindClustersWithoutTOT(Int_t nSector, + Int_t nPlate, + Int_t nStrip) +{ + // + // This function searches the isolated digits without TOT + // measurement (stored in the fDigits object), to perform clusters + // (stored in the fTofClusters array). This research has been made + // by checking the fTOFdigitMap object, filled at digits/raw-data + // reading time. + // + + const Int_t kMaxNumberOfTracksPerDigit = 3; + const Int_t kMaxNumberOfDigitsPerVolume = 10; + + Int_t jj = 0; + + Int_t det[5] = {nSector,nPlate,nStrip,-1,-1};//sector,plate,strip,padZ,padX + Int_t vol[5] = {nSector,nPlate,nStrip,-1,-1};//sector,plate,strip,padX,padZ + UShort_t volIdClus = 0; + + Float_t pos[3]; + for (jj=0; jj<3; jj++) pos[jj] = 0.; + Double_t posClus[3]; + for (jj=0; jj<3; jj++) posClus[jj] = 0.; + + Double_t covClus[6]; + for (jj=0; jj<6; jj++) covClus[jj] = 0.; + + Int_t parTOF[7]; + for (jj=0; jj<7; jj++) parTOF[jj] = 0; + + Bool_t status = kTRUE; //assume all sim channels ok in the beginning... + Int_t tracks[kMaxNumberOfTracksPerDigit]; + for (jj=0; jjGetNumberOfDigits(vol)==0) continue; + + for(Int_t digIndex=0; digIndexGetDigitIndex(vol,digIndex)<0) continue; + digitInteresting = (AliTOFdigit*)fDigits->UncheckedAt(fTOFdigitMap->GetDigitIndex(vol,digIndex)); + if (digitInteresting->GetToT()>0) continue; // AdC + + AliDebug(2, Form(" %3d %5d %2d %1d %2d %1d %2d %d %d %d %5d %5d %5d %5d", + fTOFdigitMap->GetNumberOfDigits(vol), digIndex, + vol[0], vol[1], vol[2] ,vol[4], vol[3], + digitInteresting->GetTdc(), digitInteresting->GetAdc(), + digitInteresting->GetToT(), + fTOFdigitMap->GetDigitIndex(vol,digIndex), + digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); + + det[3] = vol[4]; // padz + det[4] = vol[3]; // padx + fTOFGeometry->GetPosPar(det,pos); + AliDebug(1,Form(" %f %f %f", pos[0], pos[1], pos[2])); + + //insert cluster + for (jj=0; jj<3; jj++) posClus[jj] = pos[jj]; + + parTOF[0] = Int_t(digitInteresting->GetTdc()); + parTOF[1] = Int_t(digitInteresting->GetToT()); + parTOF[2] = Int_t(digitInteresting->GetAdc()); + parTOF[3] = Int_t(digitInteresting->GetTdcND()); + parTOF[4] = Int_t(digitInteresting->GetTdc()); + parTOF[5] = 0; + parTOF[6] = 0; + + volIdClus = fTOFGeometry->GetAliSensVolIndex(det[0],det[1],det[2]); + //volIdClus = GetClusterVolIndex(det); + + for (jj=0; jj<6; jj++) covClus[jj] = 0.; + GetClusterPars(det, posClus, covClus); + + // To fill the track index array + dummyCounter=-1; + for (jj=0; jjGetTrack(jj)==-1) continue; + else { + dummyCounter++; + tracks[dummyCounter] = digitInteresting->GetTrack(jj); + } + } + + AliTOFcluster *tofCluster = + new AliTOFcluster(volIdClus, posClus[0], posClus[1], posClus[2], + covClus[0], covClus[1], covClus[2], covClus[3], covClus[4], covClus[5], + tracks, det, parTOF, status, fTOFdigitMap->GetDigitIndex(vol,digIndex)); + InsertCluster(tofCluster); + + AliDebug(2, Form(" %4d %f %f %f %f %f %f %f %f %f %3d %3d %3d %2d %1d %2d %1d %2d %4d %3d %3d %4d %4d %1d %4d", + volIdClus, posClus[0], posClus[1], posClus[2], + covClus[0], covClus[1], covClus[2], covClus[3], covClus[4], covClus[5], + tracks[0], tracks[1], tracks[2], + det[0], det[1], det[2], det[3], det[4], + parTOF[0], parTOF[1], parTOF[2], parTOF[3], parTOF[4], + status, fTOFdigitMap->GetDigitIndex(vol,digIndex))); + + AliDebug(2, Form(" %f %f %f", pos[0], pos[1], pos[2])); + AliDebug(2, Form(" %d %d", parTOF[0], parTOF[2])); - //dummyPad = vol[3]; - //vol[3] = vol[4]; - //vol[4] = dummyPad; fTOFdigitMap->ResetDigit(vol, digIndex); } @@ -761,7 +1030,7 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, const Int_t kMaxNumberOfInterestingPads = 4; const Int_t kMaxNumberOfTracksPerDigit = 3; - const Int_t kMaxNumberOfDigitsPerVolume = 3; + const Int_t kMaxNumberOfDigitsPerVolume = 10; Int_t ii = 0; @@ -769,7 +1038,6 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), @@ -894,13 +1166,14 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -911,11 +1184,14 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), @@ -923,13 +1199,14 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -940,11 +1217,14 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), @@ -952,13 +1232,14 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -969,28 +1250,31 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } - AliDebug(1,Form(" e adesso %1i", interestingCounter+1)); + AliDebug(1,Form(" e adesso %1d", interestingCounter+1)); for (Int_t adesso1=0; adesso1GetADC(); interestingWeight[0] = selectedDigit[adesso1][firstIndex]->GetWeight(); Int_t vol1[5]; for(jj=0; jj<5; jj++) vol1[jj] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); Int_t volDum = vol1[3]; vol1[3] = vol1[4]; vol1[4] = volDum; - tofGeometry->GetPosPar(vol1,pos); + fTOFGeometry->GetPosPar(vol1,pos); interestingX[0] = pos[0]; interestingY[0] = pos[1]; interestingZ[0] = pos[2]; @@ -1030,11 +1314,11 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, interestingADC[1] = selectedDigit[adesso2][secondIndex]->GetADC(); interestingWeight[1] = selectedDigit[adesso2][secondIndex]->GetWeight(); Int_t vol2[5]; for(jj=0; jj<5; jj++) vol2[jj] = selectedDigit[adesso2][secondIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); volDum = vol2[3]; vol2[3] = vol2[4]; vol2[4] = volDum; - tofGeometry->GetPosPar(vol2,pos); + fTOFGeometry->GetPosPar(vol2,pos); interestingX[1] = pos[0]; interestingY[1] = pos[1]; interestingZ[1] = pos[2]; @@ -1044,11 +1328,11 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, interestingADC[2] = selectedDigit[adesso3][thirdIndex]->GetADC(); interestingWeight[2] = selectedDigit[adesso3][thirdIndex]->GetWeight(); Int_t vol3[5]; for(jj=0; jj<5; jj++) vol3[jj] = selectedDigit[adesso3][thirdIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol3[0], vol3[1], vol3[2], vol3[4], vol3[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol3[0], vol3[1], vol3[2], vol3[4], vol3[3])); volDum = vol3[3]; vol3[3] = vol3[4]; vol3[4] = volDum; - tofGeometry->GetPosPar(vol3,pos); + fTOFGeometry->GetPosPar(vol3,pos); interestingX[2] = pos[0]; interestingY[2] = pos[1]; interestingZ[2] = pos[2]; @@ -1062,9 +1346,10 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, for (jj=0; jj<5; jj++) det[jj] = -1; for (jj=0; jj<3; jj++) posF[jj] = posClus[jj]; - tofGeometry->GetDetID(posF, det); + fTOFGeometry->GetDetID(posF, det); - volIdClus = GetClusterVolIndex(det); + volIdClus = fTOFGeometry->GetAliSensVolIndex(det[0],det[1],det[2]); + //volIdClus = GetClusterVolIndex(det); for (jj=3; jj<11; jj++) padsCluster[jj] = -1; padsCluster[3] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(4); @@ -1082,8 +1367,9 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, for (jj=0; jj<3; jj++) indDet[jj][2] = nStrip; for (jj=0; jj<3; jj++) indDet[jj][3] = padsCluster[2*jj+3]; for (jj=0; jj<3; jj++) indDet[jj][4] = padsCluster[2*jj+1+3]; - GetClusterPars(check, 3, indDet, interestingWeight, posClus, covClus); + GetClusterPars(/*check,*/ 3, indDet, interestingWeight, posClus, covClus); for (jj=0; jj<3; jj++) delete [] indDet[jj]; + delete [] indDet; // To fill the track index array dummyCounter=-1; @@ -1143,7 +1429,7 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, tracks, det, parTOF, status, selectedDigit[adesso1][firstIndex]->GetIndex()); // to be updated InsertCluster(tofCluster); - AliDebug(2, Form(" %4i %f %f %f %f %f %f %f %f %f %3i %3i %3i %2i %1i %2i %1i %2i %4i %3i %3i %4i %4i %1i %4i", + AliDebug(2, Form(" %4d %f %f %f %f %f %f %f %f %f %3d %3d %3d %2d %1d %2d %1d %2d %4d %3d %3d %4d %4d %1d %4d", volIdClus, posClus[0], posClus[1], posClus[2], covClus[0], covClus[1], covClus[2], covClus[3], covClus[4], covClus[5], tracks[0], tracks[1], tracks[2], @@ -1181,12 +1467,16 @@ void AliTOFClusterFinderV1::FindClusters34(Int_t nSector, } // loop on iPad - for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -1355,25 +1648,28 @@ void AliTOFClusterFinderV1::FindClusters23(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -1384,25 +1680,28 @@ void AliTOFClusterFinderV1::FindClusters23(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -1413,28 +1712,31 @@ void AliTOFClusterFinderV1::FindClusters23(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } - AliDebug(1,Form(" e adesso %1i", interestingCounter+1)); + AliDebug(1,Form(" e adesso %1d", interestingCounter+1)); for (Int_t adesso1=0; adesso1GetADC(); interestingWeight[0] = selectedDigit[adesso1][firstIndex]->GetWeight(); Int_t vol1[5]; for(jj=0; jj<5; jj++) vol1[jj] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); Int_t volDum = vol1[3]; vol1[3] = vol1[4]; vol1[4] = volDum; - tofGeometry->GetPosPar(vol1,pos); + fTOFGeometry->GetPosPar(vol1,pos); interestingX[0] = pos[0]; interestingY[0] = pos[1]; interestingZ[0] = pos[2]; @@ -1465,11 +1767,11 @@ void AliTOFClusterFinderV1::FindClusters23(Int_t nSector, interestingADC[1] = selectedDigit[adesso2][secondIndex]->GetADC(); interestingWeight[1] = selectedDigit[adesso2][secondIndex]->GetWeight(); Int_t vol2[5]; for(jj=0; jj<5; jj++) vol2[jj] = selectedDigit[adesso2][secondIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); volDum = vol2[3]; vol2[3] = vol2[4]; vol2[4] = volDum; - tofGeometry->GetPosPar(vol2,pos); + fTOFGeometry->GetPosPar(vol2,pos); interestingX[1] = pos[0]; interestingY[1] = pos[1]; interestingZ[1] = pos[2]; @@ -1481,9 +1783,10 @@ void AliTOFClusterFinderV1::FindClusters23(Int_t nSector, for (jj=0; jj<5; jj++) det[jj] = -1; for (jj=0; jj<3; jj++) posF[jj] = posClus[jj]; - tofGeometry->GetDetID(posF, det); + fTOFGeometry->GetDetID(posF, det); - volIdClus = GetClusterVolIndex(det); + volIdClus = fTOFGeometry->GetAliSensVolIndex(det[0],det[1],det[2]); + //volIdClus = GetClusterVolIndex(det); for (jj=3; jj<11; jj++) padsCluster[jj] = -1; padsCluster[3] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(4); @@ -1499,8 +1802,9 @@ void AliTOFClusterFinderV1::FindClusters23(Int_t nSector, for (jj=0; jj<2; jj++) indDet[jj][2] = nStrip; for (jj=0; jj<2; jj++) indDet[jj][3] = padsCluster[2*jj+3]; for (jj=0; jj<2; jj++) indDet[jj][4] = padsCluster[2*jj+1+3]; - GetClusterPars(check, 2, indDet, interestingWeight, posClus, covClus); + GetClusterPars(/*check,*/ 2, indDet, interestingWeight, posClus, covClus); for (jj=0; jj<2; jj++) delete [] indDet[jj]; + delete [] indDet; // To fill the track index array dummyCounter=-1; @@ -1540,7 +1844,7 @@ void AliTOFClusterFinderV1::FindClusters23(Int_t nSector, tracks, det, parTOF, status, selectedDigit[adesso1][firstIndex]->GetIndex()); // to be updated InsertCluster(tofCluster); - AliDebug(2, Form(" %4i %f %f %f %f %f %f %f %f %f %3i %3i %3i %2i %1i %2i %1i %2i %4i %3i %3i %4i %4i %1i %4i", + AliDebug(2, Form(" %4d %f %f %f %f %f %f %f %f %f %3d %3d %3d %2d %1d %2d %1d %2d %4d %3d %3d %4d %4d %1d %4d", volIdClus, posClus[0], posClus[1], posClus[2], covClus[0], covClus[1], covClus[2], covClus[3], covClus[4], covClus[5], tracks[0], tracks[1], tracks[2], @@ -1570,12 +1874,16 @@ void AliTOFClusterFinderV1::FindClusters23(Int_t nSector, } // loop on iPad - for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -1744,25 +2055,28 @@ void AliTOFClusterFinderV1::FindClusters24(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -1773,25 +2087,28 @@ void AliTOFClusterFinderV1::FindClusters24(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -1802,28 +2119,31 @@ void AliTOFClusterFinderV1::FindClusters24(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } - AliDebug(1,Form(" e adesso %1i", interestingCounter+1)); + AliDebug(1,Form(" e adesso %1d", interestingCounter+1)); for (Int_t adesso1=0; adesso1GetADC(); interestingWeight[0] = selectedDigit[adesso1][firstIndex]->GetWeight(); Int_t vol1[5]; for(jj=0; jj<5; jj++) vol1[jj] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); Int_t volDum = vol1[3]; vol1[3] = vol1[4]; vol1[4] = volDum; - tofGeometry->GetPosPar(vol1,pos); + fTOFGeometry->GetPosPar(vol1,pos); interestingX[0] = pos[0]; interestingY[0] = pos[1]; interestingZ[0] = pos[2]; @@ -1854,11 +2174,11 @@ void AliTOFClusterFinderV1::FindClusters24(Int_t nSector, interestingADC[1] = selectedDigit[adesso2][secondIndex]->GetADC(); interestingWeight[1] = selectedDigit[adesso2][secondIndex]->GetWeight(); Int_t vol2[5]; for(jj=0; jj<5; jj++) vol2[jj] = selectedDigit[adesso2][secondIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); volDum = vol2[3]; vol2[3] = vol2[4]; vol2[4] = volDum; - tofGeometry->GetPosPar(vol2,pos); + fTOFGeometry->GetPosPar(vol2,pos); interestingX[1] = pos[0]; interestingY[1] = pos[1]; interestingZ[1] = pos[2]; @@ -1871,9 +2191,10 @@ void AliTOFClusterFinderV1::FindClusters24(Int_t nSector, for (jj=0; jj<5; jj++) det[jj] = -1; for (jj=0; jj<3; jj++) posF[jj] = posClus[jj]; - tofGeometry->GetDetID(posF, det); + fTOFGeometry->GetDetID(posF, det); - volIdClus = GetClusterVolIndex(det); + volIdClus = fTOFGeometry->GetAliSensVolIndex(det[0],det[1],det[2]); + //volIdClus = GetClusterVolIndex(det); for (jj=3; jj<11; jj++) padsCluster[jj] = -1; padsCluster[3] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(4); @@ -1889,8 +2210,9 @@ void AliTOFClusterFinderV1::FindClusters24(Int_t nSector, for (jj=0; jj<2; jj++) indDet[jj][2] = nStrip; for (jj=0; jj<2; jj++) indDet[jj][3] = padsCluster[2*jj+3]; for (jj=0; jj<2; jj++) indDet[jj][4] = padsCluster[2*jj+1+3]; - GetClusterPars(check, 2, indDet, interestingWeight, posClus, covClus); + GetClusterPars(/*check,*/ 2, indDet, interestingWeight, posClus, covClus); for (jj=0; jj<2; jj++) delete [] indDet[jj]; + delete [] indDet; // To fill the track index array dummyCounter=-1; @@ -1930,7 +2252,7 @@ void AliTOFClusterFinderV1::FindClusters24(Int_t nSector, tracks, det, parTOF, status, selectedDigit[adesso1][firstIndex]->GetIndex()); // to be updated InsertCluster(tofCluster); - AliDebug(2, Form(" %4i %f %f %f %f %f %f %f %f %f %3i %3i %3i %2i %1i %2i %1i %2i %4i %3i %3i %4i %4i %1i %4i", + AliDebug(2, Form(" %4d %f %f %f %f %f %f %f %f %f %3d %3d %3d %2d %1d %2d %1d %2d %4d %3d %3d %4d %4d %1d %4d", volIdClus, posClus[0], posClus[1], posClus[2], covClus[0], covClus[1], covClus[2], covClus[3], covClus[4], covClus[5], tracks[0], tracks[1], tracks[2], @@ -1960,12 +2282,16 @@ void AliTOFClusterFinderV1::FindClusters24(Int_t nSector, } // loop on iPad - for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); + AliDebug(1,Form(" to try %d %d ",digIndex, interestingCounter)); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -2147,25 +2476,29 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); + AliDebug(1,Form(" to try %d %d ",digIndex, interestingCounter)); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -2176,25 +2509,29 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); + AliDebug(1,Form(" to try %d %d ",digIndex, interestingCounter)); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } @@ -2205,44 +2542,61 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, for (ii=0; iiGetDigitIndex(vol, digitsInVolumeIndices); + digitIndexLocal=-1; // AdC for(Int_t digIndex=0; digIndexUncheckedAt(digitsInVolumeIndices[digIndex]); + if (digitInteresting->GetToT()<=0) continue; // AdC + digitIndexLocal++; // AdC - AliDebug(1,Form(" %2i %1i %2i %1i %2i %f %f %f %f %5i %5i %5i %5i", + AliDebug(1,Form(" %2d %1d %2d %1d %2d %d %d %d %d %5d %5d %5d %5d", vol[0], vol[1], vol[2] ,vol[4], vol[3], digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTrack(0), digitInteresting->GetTrack(1), digitInteresting->GetTrack(2))); + AliDebug(1,Form(" to try %d %d ",digIndex, interestingCounter)); - - selectedDigit[interestingCounter][digIndex] = new + selectedDigit[interestingCounter][digitIndexLocal] = new // AdC AliTOFselectedDigit(vol, digitInteresting->GetTdc(), digitInteresting->GetAdc(), digitInteresting->GetToT(), digitInteresting->GetToT()*digitInteresting->GetToT(), digitsInVolumeIndices[digIndex], digitInteresting->GetTracks()); } + if (digitIndexLocal==-1) interestingCounter--; // AdC } - AliDebug(1,Form(" e adesso %1i", interestingCounter+1)); + AliDebug(1,Form(" e adesso %1d", interestingCounter+1)); + + Int_t adesso1 = -1; + Int_t adesso2 = -1; + Int_t adesso3 = -1; + Int_t adesso4 = -1; switch(interestingCounter+1) { case 2: - for (Int_t adesso1=0; adesso1GetTDC()-selectedDigit[adesso2][secondIndex]->GetTDC())>fMaxDeltaTime) continue; + if (TMath::Abs(selectedDigit[adesso1][firstIndex]->GetTDC()-selectedDigit[adesso2][secondIndex]->GetTDC())>fMaxDeltaTime) { + AliDebug(1,Form(" selD1[%d][%d]->GetTDC()=%d selD2[%d][%d]->GetTDC()=%d -- %d ", + adesso1,firstIndex,(Int_t)selectedDigit[adesso1][firstIndex]->GetTDC(), + adesso2,secondIndex,(Int_t)selectedDigit[adesso2][secondIndex]->GetTDC(), + fMaxDeltaTime)); + continue; + } - AliDebug(1, Form(" %1i %1i (0x%x) %1i %1i (0x%x)", adesso1, firstIndex,selectedDigit[adesso1][firstIndex], + AliDebug(1, Form(" %1d %1d (0x%p) %1d %1d (0x%p)", adesso1, firstIndex,selectedDigit[adesso1][firstIndex], adesso2, secondIndex,selectedDigit[adesso2][secondIndex])); interestingTOF[0] = selectedDigit[adesso1][firstIndex]->GetTDC(); @@ -2250,11 +2604,11 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, interestingADC[0] = selectedDigit[adesso1][firstIndex]->GetADC(); interestingWeight[0] = selectedDigit[adesso1][firstIndex]->GetWeight(); Int_t vol1[5]; for(jj=0; jj<5; jj++) vol1[jj] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); Int_t volDum = vol1[3]; vol1[3] = vol1[4]; vol1[4] = volDum; - tofGeometry->GetPosPar(vol1,pos); + fTOFGeometry->GetPosPar(vol1,pos); AliDebug(1,Form(" %f %f %f", pos[0], pos[1], pos[2])); interestingX[0] = pos[0]; interestingY[0] = pos[1]; @@ -2265,11 +2619,11 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, interestingADC[1] = selectedDigit[adesso2][secondIndex]->GetADC(); interestingWeight[1] = selectedDigit[adesso2][secondIndex]->GetWeight(); Int_t vol2[5]; for(jj=0; jj<5; jj++) vol2[jj] = selectedDigit[adesso2][secondIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); volDum = vol2[3]; vol2[3] = vol2[4]; vol2[4] = volDum; - tofGeometry->GetPosPar(vol2,pos); + fTOFGeometry->GetPosPar(vol2,pos); AliDebug(1,Form(" %f %f %f", pos[0], pos[1], pos[2])); interestingX[1] = pos[0]; interestingY[1] = pos[1]; @@ -2286,10 +2640,11 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, for (jj=0; jj<3; jj++) posF[jj] = posClus[jj]; AliDebug(1,Form(" %f %f %f", posF[0], posF[1], posF[2])); - tofGeometry->GetDetID(posF, det); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", det[0], det[1], det[2], det[3], det[4])); + fTOFGeometry->GetDetID(posF, det); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", det[0], det[1], det[2], det[3], det[4])); - volIdClus = GetClusterVolIndex(det); + volIdClus = fTOFGeometry->GetAliSensVolIndex(det[0],det[1],det[2]); + //volIdClus = GetClusterVolIndex(det); for (jj=3; jj<11; jj++) padsCluster[jj] = -1; padsCluster[3] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(4); @@ -2305,8 +2660,9 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, for (jj=0; jjGetIndex()); //to updated InsertCluster(tofCluster); - AliDebug(2, Form(" %4i %f %f %f %f %f %f %f %f %f %3i %3i %3i %2i %1i %2i %1i %2i %4i %3i %3i %4i %4i %1i %4i", + AliDebug(2, Form(" %4d %f %f %f %f %f %f %f %f %f %3d %3d %3d %2d %1d %2d %1d %2d %4d %3d %3d %4d %4d %1d %4d", volIdClus, posClus[0], posClus[1], posClus[2], covClus[0], covClus[1], covClus[2], covClus[3], covClus[4], covClus[5], tracks[0], tracks[1], tracks[2], @@ -2365,25 +2721,28 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, } // close loop on second digit - } // close loop on adesso2 + //} // close loop on adesso2 } // close loop on first digit - } // close loop on adesso1 + //} // close loop on adesso1 break; case 3: - for (Int_t adesso1=0; adesso1GetADC(); interestingWeight[0] = selectedDigit[adesso1][firstIndex]->GetWeight(); Int_t vol1[5]; for(jj=0; jj<5; jj++) vol1[jj] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); Int_t volDum = vol1[3]; vol1[3] = vol1[4]; vol1[4] = volDum; - tofGeometry->GetPosPar(vol1,pos); + fTOFGeometry->GetPosPar(vol1,pos); interestingX[0] = pos[0]; interestingY[0] = pos[1]; interestingZ[0] = pos[2]; @@ -2413,11 +2772,11 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, interestingADC[1] = selectedDigit[adesso2][secondIndex]->GetADC(); interestingWeight[1] = selectedDigit[adesso2][secondIndex]->GetWeight(); Int_t vol2[5]; for(jj=0; jj<5; jj++) vol2[jj] = selectedDigit[adesso2][secondIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); volDum = vol2[3]; vol2[3] = vol2[4]; vol2[4] = volDum; - tofGeometry->GetPosPar(vol2,pos); + fTOFGeometry->GetPosPar(vol2,pos); interestingX[1] = pos[0]; interestingY[1] = pos[1]; interestingZ[1] = pos[2]; @@ -2427,11 +2786,11 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, interestingADC[2] = selectedDigit[adesso3][thirdIndex]->GetADC(); interestingWeight[2] = selectedDigit[adesso3][thirdIndex]->GetWeight(); Int_t vol3[5]; for(jj=0; jj<5; jj++) vol3[jj] = selectedDigit[adesso3][thirdIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol3[0], vol3[1], vol3[2], vol3[4], vol3[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol3[0], vol3[1], vol3[2], vol3[4], vol3[3])); volDum = vol3[3]; vol3[3] = vol3[4]; vol3[4] = volDum; - tofGeometry->GetPosPar(vol3,pos); + fTOFGeometry->GetPosPar(vol3,pos); interestingX[2] = pos[0]; interestingY[2] = pos[1]; interestingZ[2] = pos[2]; @@ -2445,9 +2804,10 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, for (jj=0; jj<5; jj++) det[jj] = -1; for (jj=0; jj<3; jj++) posF[jj] = posClus[jj]; - tofGeometry->GetDetID(posF, det); + fTOFGeometry->GetDetID(posF, det); - volIdClus = GetClusterVolIndex(det); + volIdClus = fTOFGeometry->GetAliSensVolIndex(det[0],det[1],det[2]); + //volIdClus = GetClusterVolIndex(det); for (jj=3; jj<11; jj++) padsCluster[jj] = -1; padsCluster[3] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(4); @@ -2465,8 +2825,10 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, for (jj=0; jjGetIndex()); // to be updated InsertCluster(tofCluster); - AliDebug(2, Form(" %4i %f %f %f %f %f %f %f %f %f %3i %3i %3i %2i %1i %2i %1i %2i %4i %3i %3i %4i %4i %1i %4i", + AliDebug(2, Form(" %4d %f %f %f %f %f %f %f %f %f %3d %3d %3d %2d %1d %2d %1d %2d %4d %3d %3d %4d %4d %1d %4d", volIdClus, posClus[0], posClus[1], posClus[2], covClus[0], covClus[1], covClus[2], covClus[3], covClus[4], covClus[5], tracks[0], tracks[1], tracks[2], @@ -2549,32 +2911,32 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, } // close loop on third digit - } // close loop on adesso3 + //} // close loop on adesso3 } // close loop on second digit - } // close loop on adesso2 + //} // close loop on adesso2 } // close loop on first digit - } // close loop on adesso1 + //} // close loop on adesso1 break; case 4: - Int_t adesso1 = 0; + adesso1 = 0; for (Int_t firstIndex=0; firstIndexGetADC(); interestingWeight[0] = selectedDigit[adesso1][firstIndex]->GetWeight(); Int_t vol1[5]; for(jj=0; jj<5; jj++) vol1[jj] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol1[0], vol1[1], vol1[2], vol1[4], vol1[3])); Int_t volDum = vol1[3]; vol1[3] = vol1[4]; vol1[4] = volDum; - tofGeometry->GetPosPar(vol1,pos); + fTOFGeometry->GetPosPar(vol1,pos); interestingX[0] = pos[0]; interestingY[0] = pos[1]; interestingZ[0] = pos[2]; @@ -2610,11 +2972,11 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, interestingADC[1] = selectedDigit[adesso2][secondIndex]->GetADC(); interestingWeight[1] = selectedDigit[adesso2][secondIndex]->GetWeight(); Int_t vol2[5]; for(jj=0; jj<5; jj++) vol2[jj] = selectedDigit[adesso2][secondIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol2[0], vol2[1], vol2[2], vol2[4], vol2[3])); volDum = vol2[3]; vol2[3] = vol2[4]; vol2[4] = volDum; - tofGeometry->GetPosPar(vol2,pos); + fTOFGeometry->GetPosPar(vol2,pos); interestingX[1] = pos[0]; interestingY[1] = pos[1]; interestingZ[1] = pos[2]; @@ -2624,11 +2986,11 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, interestingADC[2] = selectedDigit[adesso3][thirdIndex]->GetADC(); interestingWeight[2] = selectedDigit[adesso3][thirdIndex]->GetWeight(); Int_t vol3[5]; for(jj=0; jj<5; jj++) vol3[jj] = selectedDigit[adesso3][thirdIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol3[0], vol3[1], vol3[2], vol3[4], vol3[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol3[0], vol3[1], vol3[2], vol3[4], vol3[3])); volDum = vol3[3]; vol3[3] = vol3[4]; vol3[4] = volDum; - tofGeometry->GetPosPar(vol3,pos); + fTOFGeometry->GetPosPar(vol3,pos); interestingX[2] = pos[0]; interestingY[2] = pos[1]; interestingZ[2] = pos[2]; @@ -2638,11 +3000,11 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, interestingADC[3] = selectedDigit[adesso4][fourthIndex]->GetADC(); interestingWeight[3] = selectedDigit[adesso4][fourthIndex]->GetWeight(); Int_t vol4[5]; for(jj=0; jj<5; jj++) vol4[jj] = selectedDigit[adesso4][fourthIndex]->GetDetectorIndex(jj); - AliDebug(1,Form(" %2i %1i %2i %1i %2i", vol4[0], vol4[1], vol4[2], vol4[4], vol4[3])); + AliDebug(1,Form(" %2d %1d %2d %1d %2d", vol4[0], vol4[1], vol4[2], vol4[4], vol4[3])); volDum = vol4[3]; vol4[3] = vol4[4]; vol4[4] = volDum; - tofGeometry->GetPosPar(vol4,pos); + fTOFGeometry->GetPosPar(vol4,pos); interestingX[3] = pos[0]; interestingY[3] = pos[1]; interestingZ[3] = pos[2]; @@ -2656,9 +3018,10 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, for (jj=0; jj<5; jj++) det[jj] = -1; for (jj=0; jj<3; jj++) posF[jj] = posClus[jj]; - tofGeometry->GetDetID(posF, det); + fTOFGeometry->GetDetID(posF, det); - volIdClus = GetClusterVolIndex(det); + volIdClus = fTOFGeometry->GetAliSensVolIndex(det[0],det[1],det[2]); + //volIdClus = GetClusterVolIndex(det); for (jj=3; jj<11; jj++) padsCluster[jj] = -1; padsCluster[3] = selectedDigit[adesso1][firstIndex]->GetDetectorIndex(4); @@ -2678,8 +3041,9 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, for (jj=0; jjGetIndex()); // to be updated InsertCluster(tofCluster); - AliDebug(2, Form(" %4i %f %f %f %f %f %f %f %f %f %3i %3i %3i %2i %1i %2i %1i %2i %4i %3i %3i %4i %4i %1i %4i", + AliDebug(2, Form(" %4d %f %f %f %f %f %f %f %f %f %3d %3d %3d %2d %1d %2d %1d %2d %4d %3d %3d %4d %4d %1d %4d", volIdClus, posClus[0], posClus[1], posClus[2], covClus[0], covClus[1], covClus[2], covClus[3], covClus[4], covClus[5], tracks[0], tracks[1], tracks[2], @@ -2803,11 +3167,16 @@ void AliTOFClusterFinderV1::FindClustersPerStrip(Int_t nSector, } // loop on iPad - for (ii=0; iiClear(); } @@ -2878,18 +3248,19 @@ void AliTOFClusterFinderV1::ResetDigits() // fNumberOfTofDigits = 0; + fNumberOfTofTrgPads = 0; if (fDigits) fDigits->Clear(); } //_____________________________________________________________________________ - -UShort_t AliTOFClusterFinderV1::GetClusterVolIndex(Int_t *ind) const -{ +//UShort_t AliTOFClusterFinderV1::GetClusterVolIndex(Int_t *ind) const +//{ // // Get the volume ID to retrieve the l2t transformation // // Detector numbering scheme +/* Int_t nSector = AliTOFGeometry::NSectors(); Int_t nPlate = AliTOFGeometry::NPlates(); Int_t nStripA = AliTOFGeometry::NStripA(); @@ -2934,6 +3305,7 @@ UShort_t AliTOFClusterFinderV1::GetClusterVolIndex(Int_t *ind) const return volIndex; } +*/ //_____________________________________________________________________________ void AliTOFClusterFinderV1::GetClusterPars(Int_t *ind, Double_t* pos, Double_t* cov) const @@ -2964,7 +3336,8 @@ void AliTOFClusterFinderV1::GetClusterPars(Int_t *ind, Double_t* pos, Double_t* AliDebug(1, Form(" %f %f %f", lpos[0], lpos[1], lpos[2])); // Volume ID - UShort_t volIndex = GetClusterVolIndex(ind); + UShort_t volIndex = fTOFGeometry->GetAliSensVolIndex(ind[0],ind[1],ind[2]); + //UShort_t volIndex = GetClusterVolIndex(ind); const TGeoHMatrix *l2t = AliGeomManager::GetTracking2LocalMatrix(volIndex); // Get the position in the track ref system @@ -2989,6 +3362,7 @@ void AliTOFClusterFinderV1::GetClusterPars(Int_t *ind, Double_t* pos, Double_t* // + 0.5*0.160 (internl PCB) // + 1*0.055 (external red glass)) */ + lcov[0] = 0.499678;//AliTOFGeometry::XPad()*AliTOFGeometry::XPad()/12.; lcov[8] = 0.992429;//AliTOFGeometry::ZPad()*AliTOFGeometry::ZPad()/12.; @@ -3006,7 +3380,7 @@ void AliTOFClusterFinderV1::GetClusterPars(Int_t *ind, Double_t* pos, Double_t* } //_____________________________________________________________________________ -void AliTOFClusterFinderV1::GetClusterPars(Bool_t check, Int_t counter, +void AliTOFClusterFinderV1::GetClusterPars(/*Bool_t check,*/ Int_t counter, Int_t **ind, Double_t *weight, Double_t *pos, Double_t *cov) const { @@ -3035,18 +3409,19 @@ void AliTOFClusterFinderV1::GetClusterPars(Bool_t check, Int_t counter, // x <----------------------------------------------------- for (Int_t ii=0; iiGetDetID(posF, detClus); // Volume ID - UShort_t volIndex = GetClusterVolIndex(detClus); - AliDebug(1, Form(" %2i %1i %2i %1i %2i %7i", + UShort_t volIndex = fTOFGeometry->GetAliSensVolIndex(detClus[0],detClus[1],detClus[2]); + //UShort_t volIndex = GetClusterVolIndex(detClus); + AliDebug(1, Form(" %2d %1d %2d %1d %2d %7i", detClus[0], detClus[1], detClus[2], detClus[3], detClus[4], volIndex)); // Get the position in the TOF strip ref system @@ -3073,7 +3448,7 @@ void AliTOFClusterFinderV1::GetClusterPars(Bool_t check, Int_t counter, // 0 0 sz2 // Evaluation of the ovariance matrix elements - TOFclusterError(check, counter, ind, weight, ppos, lcov); + TOFclusterError(/*check,*/ counter, ind, weight, ppos, lcov); AliDebug(1, Form("lcov[0] = %f, lcov[8] = %f", lcov[0], lcov[8])); @@ -3091,7 +3466,7 @@ void AliTOFClusterFinderV1::GetClusterPars(Bool_t check, Int_t counter, } //_____________________________________________________________________________ -void AliTOFClusterFinderV1::TOFclusterError(Bool_t check, Int_t counter, +void AliTOFClusterFinderV1::TOFclusterError(/*Bool_t check,*/ Int_t counter, Int_t **ind, Double_t *weight, Double_t ppos[], Double_t lcov[]) const { @@ -3099,7 +3474,7 @@ void AliTOFClusterFinderV1::TOFclusterError(Bool_t check, Int_t counter, // // - //lcov[4] = 0.42*0.42/3.; + //lcov[4] = 0.42*0.42/3.; // cm2 // = ( 5*0.025 (gas gaps thikness) // + 4*0.040 (internal glasses thickness) // + 0.5*0.160 (internl PCB) @@ -3117,7 +3492,7 @@ void AliTOFClusterFinderV1::TOFclusterError(Bool_t check, Int_t counter, ((ind[ii][3]- 0.5)*AliTOFGeometry::ZPad() - ppos[2])*((ind[ii][3]- 0.5)*AliTOFGeometry::ZPad() - ppos[2]); for (Int_t ii=0; iiGetTOFOnlineDelay(); - AliTOFChannelOnlineStatusArray *calStatus = fTOFcalib->GetTOFOnlineStatus(); + AliTOFChannelOnlineArray *calDelay = fTOFcalib->GetTOFOnlineDelay(); + AliTOFChannelOnlineStatusArray *calStatus = fTOFcalib->GetTOFOnlineStatus(); TObjArray *calTOFArrayOffline = fTOFcalib->GetTOFCalArrayOffline(); @@ -3248,14 +3636,17 @@ Bool_t AliTOFClusterFinderV1::MakeSlewingCorrection(Int_t *detectorIndex, //check the status, also unknown is fine!!!!!!! - AliDebug(2, Form(" Status for channel %i = %i",index, (Int_t)status)); + AliDebug(2, Form(" Status for channel %d = %d",index, (Int_t)status)); if((statusPulser & AliTOFChannelOnlineStatusArray::kTOFPulserBad)==(AliTOFChannelOnlineStatusArray::kTOFPulserBad)||(statusNoise & AliTOFChannelOnlineStatusArray::kTOFNoiseBad)==(AliTOFChannelOnlineStatusArray::kTOFNoiseBad)||(statusHW & AliTOFChannelOnlineStatusArray::kTOFHWBad)==(AliTOFChannelOnlineStatusArray::kTOFHWBad)){ - AliDebug(2, Form(" Bad Status for channel %i",index)); + AliDebug(2, Form(" Bad Status for channel %d",index)); //fTofClusters[ii]->SetStatus(kFALSE); //odd convention, to avoid conflict with calibration objects currently in the db (temporary solution). output = kFALSE; } else - AliDebug(2, Form(" Good Status for channel %i",index)); + AliDebug(2, Form(" Good Status for channel %d",index)); + + + if (fCalibrateTOFtimes) { // AdC // Get Rough channel online equalization Double_t roughDelay = (Double_t)calDelay->GetDelay(index); // in ns @@ -3269,7 +3660,7 @@ Bool_t AliTOFClusterFinderV1::MakeSlewingCorrection(Int_t *detectorIndex, par[jj] = (Double_t)calChannelOffline->GetSlewPar(jj); AliDebug(2,Form(" Calib Pars = %f, %f, %f, %f, %f, %f ",par[0],par[1],par[2],par[3],par[4],par[5])); - AliDebug(2,Form(" The ToT and Time, uncorr (counts) = %i , %i", tofDigitToT, tofDigitTdc)); + AliDebug(2,Form(" The ToT and Time, uncorr (counts) = %d , %d", tofDigitToT, tofDigitTdc)); Double_t tToT = (Double_t)(tofDigitToT*AliTOFGeometry::ToTBinWidth()); tToT*=1.E-3; //ToT in ns AliDebug(2,Form(" The ToT and Time, uncorr (ns)= %e, %e",tofDigitTdc*AliTOFGeometry::TdcBinWidth()*1.E-3,tToT)); @@ -3283,8 +3674,11 @@ Bool_t AliTOFClusterFinderV1::MakeSlewingCorrection(Int_t *detectorIndex, timeCorr = (Double_t)(tofDigitTdc)*AliTOFGeometry::TdcBinWidth()*1.E-3-timeCorr;//redefine the time timeCorr *= 1.E3; AliDebug(2,Form(" The channel time, corr (ps)= %e",timeCorr )); - tdcCorr = (Int_t)(timeCorr/AliTOFGeometry::TdcBinWidth()); //the corrected time (tdc counts) + //tdcCorr = (Int_t)(timeCorr/AliTOFGeometry::TdcBinWidth()); //the corrected time (tdc counts) + tdcCorr = TMath::Nint(timeCorr/AliTOFGeometry::TdcBinWidth()); //the corrected time (tdc counts) + } // AdC + return output; } @@ -3304,8 +3698,10 @@ void AliTOFClusterFinderV1::Digits2RecPoints(Int_t iEvent) AliLoader *localTOFLoader = (AliLoader*)fRunLoader->GetLoader("TOFLoader"); TTree * localTreeD = (TTree*)localTOFLoader->TreeD(); - if (localTreeD == 0x0) + if (localTreeD == 0x0) { AliFatal("Can not get TreeD"); + return; + } TBranch *branch = localTreeD->GetBranch("TOF"); if (!branch) { @@ -3325,7 +3721,7 @@ void AliTOFClusterFinderV1::Digits2RecPoints(Int_t iEvent) //localTOFLoader = fRunLoader->GetLoader("TOFLoader"); localTOFLoader->WriteRecPoints("OVERWRITE"); - AliDebug(1, Form("Execution time to read TOF digits and to write TOF clusters for the event number %i: R:%.4fs C:%.4fs", + AliDebug(1, Form("Execution time to read TOF digits and to write TOF clusters for the event number %d: R:%.4fs C:%.4fs", iEvent, stopwatch.RealTime(),stopwatch.CpuTime())); } @@ -3342,7 +3738,7 @@ void AliTOFClusterFinderV1::Digits2RecPoints(Int_t iEvent, AliRawReader *rawRead fRunLoader->GetEvent(iEvent); - AliDebug(2,Form(" Event number %2i ", iEvent)); + AliDebug(2,Form(" Event number %2d ", iEvent)); AliLoader *localTOFLoader = (AliLoader*)fRunLoader->GetLoader("TOFLoader"); @@ -3355,7 +3751,7 @@ void AliTOFClusterFinderV1::Digits2RecPoints(Int_t iEvent, AliRawReader *rawRead Digits2RecPoints(rawReader, localTreeR); - AliDebug(1, Form("Execution time to read TOF raw data and to write TOF clusters for the event number %i: R:%.4fs C:%.4fs", + AliDebug(1, Form("Execution time to read TOF raw data and to write TOF clusters for the event number %d: R:%.4fs C:%.4fs", iEvent, stopwatch.RealTime(),stopwatch.CpuTime())); } @@ -3373,7 +3769,7 @@ void AliTOFClusterFinderV1::Raw2Digits(Int_t iEvent, AliRawReader *rawReader) fRunLoader->GetEvent(iEvent); - AliDebug(2,Form(" Event number %2i ", iEvent)); + AliDebug(2,Form(" Event number %2d ", iEvent)); AliLoader *localTOFLoader = (AliLoader*)fRunLoader->GetLoader("TOFLoader"); @@ -3386,7 +3782,7 @@ void AliTOFClusterFinderV1::Raw2Digits(Int_t iEvent, AliRawReader *rawReader) Raw2Digits(rawReader, localTreeD); - AliDebug(1, Form("Execution time to read TOF raw data and to write TOF clusters for the event number %i: R:%.4fs C:%.4fs", + AliDebug(1, Form("Execution time to read TOF raw data and to write TOF clusters for the event number %d: R:%.4fs C:%.4fs", iEvent, stopwatch.RealTime(),stopwatch.CpuTime())); } @@ -3399,20 +3795,17 @@ void AliTOFClusterFinderV1::AverageCalculations(Int_t number, Float_t *interesti Int_t *parTOF, Double_t *posClus, Bool_t &check) { // - // + // Calculates the mean values for cluster position (x,y,z), + // TOF charge and time // - Double_t posX = 0.; - Double_t posY = 0.; - Double_t posZ = 0.; - Double_t tofAverage = 0.; Double_t totAverage = 0.; Double_t adcAverage = 0.; check = kFALSE; Int_t ii=-1; - for (ii=number-1; ii>=0; ii--) check=check||(interestingWeight[ii]==0 ||interestingWeight[ii]==-1); + for (ii=number-1; ii>=0; ii--) check=check||(interestingWeight[ii]==0 || interestingWeight[ii]==-1); if (check) { @@ -3436,14 +3829,11 @@ void AliTOFClusterFinderV1::AverageCalculations(Int_t number, Float_t *interesti } parTOF[0] = Int_t(tofAverage); - parTOF[1] = Int_t(adcAverage); - parTOF[2] = Int_t(totAverage); - parTOF[3] = Int_t(tofAverage); - parTOF[4] = Int_t(tofAverage); - - //insert cluster - posClus[0] = posX; - posClus[1] = posY; - posClus[2] = posZ; + parTOF[1] = Int_t(totAverage); + parTOF[2] = Int_t(adcAverage); + parTOF[3] = Int_t(tofAverage);//tofND + parTOF[4] = Int_t(tofAverage);//tofRAW + parTOF[5] = 0; + parTOF[6] = 0; }