From 545d50012126ef76ddb95b7e3d73888e2298d582 Mon Sep 17 00:00:00 2001 From: decaro Date: Fri, 11 Apr 2008 12:39:59 +0000 Subject: [PATCH] Updated to read the TOF signal cable lengths --- EVE/EveDet/AliEveTOFDigitsInfo.cxx | 45 +++++++++++++------ EVE/EveDet/AliEveTOFDigitsInfo.h | 72 +++++++++++++++--------------- 2 files changed, 69 insertions(+), 48 deletions(-) diff --git a/EVE/EveDet/AliEveTOFDigitsInfo.cxx b/EVE/EveDet/AliEveTOFDigitsInfo.cxx index 526a004d7fd..8a91689a417 100644 --- a/EVE/EveDet/AliEveTOFDigitsInfo.cxx +++ b/EVE/EveDet/AliEveTOFDigitsInfo.cxx @@ -10,12 +10,15 @@ // AliEveTOFDigitsInfo // +#include "fcntl.h" + #include #include "AliEveTOFDigitsInfo.h" #include +#include #include #include #include @@ -30,7 +33,7 @@ ClassImp(AliEveTOFDigitsInfo) TEveRefCnt(), fTree (0), fNewTree (0), - fGeom (0), + fGeom (new AliTOFGeometry()), fTOFdigitMap(new AliTOFDigitMap()) {} /* ******************************************************* */ @@ -66,6 +69,8 @@ void AliEveTOFDigitsInfo::ReadRaw(AliRawReader* rawReader, Int_t nEvent, Bool_t // Read raw-data. AliTOFdigit is used to // store raw-adata for all sub-detectors. + AliTOFCableLengthMap *cableLength = new AliTOFCableLengthMap(); + //ofstream ftxt; //Char_t fileName[100]; //sprintf(fileName,"TOFrawDataReadingFromEVE%d.txt",nEvent); @@ -98,7 +103,7 @@ void AliEveTOFDigitsInfo::ReadRaw(AliRawReader* rawReader, Int_t nEvent, Bool_t clonesRawData = (TClonesArray*)stream.GetRawData(); - if (clonesRawData->GetEntriesFast()) cout << " " << indexDDL << " " << clonesRawData->GetEntriesFast() << endl; + if (clonesRawData->GetEntriesFast()) AliDebug(2, Form(" Number of TOF digits in the sector number %2i: 5i", indexDDL, clonesRawData->GetEntriesFast())); for (Int_t iRawData = 0; iRawDataGetEntriesFast(); iRawData++) { @@ -106,7 +111,8 @@ void AliEveTOFDigitsInfo::ReadRaw(AliRawReader* rawReader, Int_t nEvent, Bool_t if (tofRawDatum->GetTOT()==-1 || tofRawDatum->GetTOF()==-1) continue; - digit[0] = tofRawDatum->GetTOF(); + Int_t cLenInt = Int_t(cableLength->GetCableTimeShift(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(),tofRawDatum->GetTDC())*1000./AliTOFGeometry::TdcBinWidth()); + digit[0] = tofRawDatum->GetTOF() - cLenInt; digit[1] = tofRawDatum->GetTOT(); digit[2] = tofRawDatum->GetTOT(); digit[3] = -1; @@ -123,9 +129,19 @@ void AliEveTOFDigitsInfo::ReadRaw(AliRawReader* rawReader, Int_t nEvent, Bool_t */ stream.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(), tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex); - //dummy = detectorIndex[3]; - //detectorIndex[3] = detectorIndex[4]; - //detectorIndex[4] = dummy; + + if (detectorIndex[0]==0 || detectorIndex[0]==10) + AliDebug(2, Form(" %2i %2i %1i %2i %1i --- %2i %1i %2i %1i %2i %5i - %4i = %5i (%f ns)\n", + indexDDL, + tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(), + tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), + detectorIndex[0], detectorIndex[1], + detectorIndex[2], detectorIndex[3], + detectorIndex[4], tofRawDatum->GetTOF(), + cLenInt, tofRawDatum->GetTOF()-cLenInt, + (tofRawDatum->GetTOF()-cLenInt)* + AliTOFGeometry::TdcBinWidth()/1000.)); + /* if (detectorIndex[0]<10) ftxt << " -> " << detectorIndex[0]; else ftxt << " -> " << detectorIndex[0]; @@ -175,6 +191,9 @@ void AliEveTOFDigitsInfo::ReadRaw(AliRawReader* rawReader, Int_t nEvent, Bool_t //ftxt.close(); + cableLength = 0x0; + delete cableLength; + } @@ -221,6 +240,7 @@ void AliEveTOFDigitsInfo::GetDigits(Int_t nSector, Int_t nPlate, Int_t vol[5] = {nSector,nPlate,nStrip,nPadX,nPadZ}; fTOFdigitMap->GetDigitIndex(vol, indexDigit); + //for (Int_t ii=1; ii<3; ii++) indexDigit[ii]=-1; } /* ******************************************************* */ @@ -253,7 +273,7 @@ TClonesArray* AliEveTOFDigitsInfo::GetDigits(Int_t nSector, Int_t nPlate, fTOFdigitMap->GetDigitIndex(vol, nDigitsInVolume); for (Int_t ii=0; ii<3; ii++) { - + //if (ii!=0) continue; if (nDigitsInVolume[ii]>=0 ) { AliDebug(2,Form(" nDigitsInVolume[%2i] = %3i\n ", ii, nDigitsInVolume[ii])); digs = (AliTOFdigit*)digitsTOF->UncheckedAt(nDigitsInVolume[ii]); @@ -274,8 +294,8 @@ TClonesArray* AliEveTOFDigitsInfo::GetDigits(Int_t nSector, Int_t nPlate, } if (digitsTOFnew) - AliDebug(2,Form("Sector %2i Plate %1i Strip %2i -> number of digits %3i \n", - nSector, nPlate, nStrip, digitsTOFnew->GetEntries())); + AliDebug(2, Form("Sector %2i Plate %1i Strip %2i -> number of digits %3i \n", + nSector, nPlate, nStrip, digitsTOFnew->GetEntries())); return digitsTOFnew; @@ -318,12 +338,10 @@ TClonesArray* AliEveTOFDigitsInfo::GetDigits(Int_t nSector) for(Int_t iPadX=0; iPadXNpadX(); iPadX++) { vol[3] = iPadX; - //GetDigits(vol[0], vol[1], vol[2], vol[3], vol[4], nDigitsInVolume) - fTOFdigitMap->GetDigitIndex(vol, nDigitsInVolume); for (Int_t ii=0; ii<3; ii++) { - + //if (ii!=0) continue; if (nDigitsInVolume[ii]>=0 ) { digs = (AliTOFdigit*)digitsTOF->UncheckedAt(nDigitsInVolume[ii]); @@ -334,7 +352,8 @@ TClonesArray* AliEveTOFDigitsInfo::GetDigits(Int_t nSector) new (ldigits[newCounter++]) AliTOFdigit(dummy, vol, informations); AliDebug(2,Form(" %2i -> %2i %2i %2i %2i %2i %7i %7i\n", - nDigitsInVolume[ii], vol[0], vol[1], vol[2], vol[4], vol[3], + nDigitsInVolume[ii], + vol[0], vol[1], vol[2], vol[4], vol[3], informations[1], informations[0])); } diff --git a/EVE/EveDet/AliEveTOFDigitsInfo.h b/EVE/EveDet/AliEveTOFDigitsInfo.h index d3d3aacffd3..0c16ebde055 100644 --- a/EVE/EveDet/AliEveTOFDigitsInfo.h +++ b/EVE/EveDet/AliEveTOFDigitsInfo.h @@ -18,45 +18,47 @@ #include #include +#include #include #include - class AliEveTOFDigitsInfo : public TObject, public TEveRefCnt -{ -public: - TTree* fTree; - TTree* fNewTree; - AliTOFGeometry* fGeom; - AliTOFDigitMap* fTOFdigitMap; - - AliEveTOFDigitsInfo(); - virtual ~AliEveTOFDigitsInfo(); + { + + public: + + AliEveTOFDigitsInfo(); + virtual ~AliEveTOFDigitsInfo(); - void SetTree(TTree* tree); - void ReadRaw(AliRawReader* rawReader, Int_t nEvent, Bool_t newDecoder=kTRUE); - void LoadDigits(); - - void GetDigits(Int_t nSector, Int_t nPlate, Int_t nStrip, - Int_t nPadZ, Int_t nPadX, - Int_t indexDigit[3]); - TClonesArray* GetDigits(Int_t nSector, Int_t nPlate, Int_t nStrip); - TClonesArray* GetDigits(Int_t nSector); - - Int_t IsStripFilled(Int_t iSector, Int_t iPlate, Int_t iStrip); - Int_t GetTOFInfos() const; - //void GetDigits(); - - TTree* GetTree() { return fTree; } - -protected: - void SetTOFSegmentation(); - -private: - AliEveTOFDigitsInfo(const AliEveTOFDigitsInfo&); // Not implemented - AliEveTOFDigitsInfo& operator=(const AliEveTOFDigitsInfo&); // Not implemented - - ClassDef(AliEveTOFDigitsInfo, 0); -}; // endclass AliEveTOFDigitsInfo + void SetTree(TTree* tree); + void ReadRaw(AliRawReader* rawReader, Int_t nEvent, Bool_t newDecoder=kTRUE); + void LoadDigits(); + + void GetDigits(Int_t nSector, Int_t nPlate, Int_t nStrip, + Int_t nPadZ, Int_t nPadX, + Int_t indexDigit[3]); + TClonesArray* GetDigits(Int_t nSector, Int_t nPlate, Int_t nStrip); + TClonesArray* GetDigits(Int_t nSector); + + Int_t IsStripFilled(Int_t iSector, Int_t iPlate, Int_t iStrip); + Int_t GetTOFInfos() const; + //void GetDigits(); + + TTree* GetTree() {return fTree;}; + + protected: + + AliEveTOFDigitsInfo(const AliEveTOFDigitsInfo&); // Not implemented + AliEveTOFDigitsInfo& operator=(const AliEveTOFDigitsInfo&); // Not implemented + + private: + + TTree* fTree; + TTree* fNewTree; + AliTOFGeometry* fGeom; + AliTOFDigitMap* fTOFdigitMap; + + ClassDef(AliEveTOFDigitsInfo, 1); + }; // endclass AliEveTOFDigitsInfo #endif -- 2.43.0