]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Updated to read the TOF signal cable lengths
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Apr 2008 12:39:59 +0000 (12:39 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Apr 2008 12:39:59 +0000 (12:39 +0000)
EVE/EveDet/AliEveTOFDigitsInfo.cxx
EVE/EveDet/AliEveTOFDigitsInfo.h

index 526a004d7fd313e22f8638cb0e0c4e38f906cdcd..8a91689a41725de413901f63cd326f1ec54b0a68 100644 (file)
 // AliEveTOFDigitsInfo
 //
 
+#include "fcntl.h"
+
 #include <TEveTreeTools.h>
 
 #include "AliEveTOFDigitsInfo.h"
 
 #include <AliDAQ.h>
 
+#include <AliTOFCableLengthMap.h>
 #include <AliTOFdigit.h>
 #include <AliTOFGeometry.h>
 #include <AliTOFrawData.h>
@@ -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; iRawData<clonesRawData->GetEntriesFast(); 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; iPadX<fGeom->NpadX(); 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]));
 
            }
index d3d3aacffd37bee2d3bb3454c2db4e60a0b71c10..0c16ebde05540a3b96c5eea7f8cef3333339a439 100644 (file)
 #include <AliRawReader.h>
 
 #include <AliTOF.h>
+#include <AliTOFdigit.h>
 #include <AliTOFGeometry.h>
 #include <AliTOFDigitMap.h>
 
-  
 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