-// $Id$
-// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
-
/**************************************************************************
* Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
* See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
* full copyright notice. *
**************************************************************************/
+
+// $Id$
+// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
+
//
-// AliEveTOFDigitsInfo
+// Class to map TOF digit/raw data information
+//
+// Author: A. De Caro (email: decaro@sa.infn.it)
//
-#include "fcntl.h"
-
-#include <TEveTreeTools.h>
+#include <TClonesArray.h>
+#include <TTree.h>
-#include "AliEveTOFDigitsInfo.h"
+//#include <TEveTreeTools.h>
#include <AliDAQ.h>
+#include <AliLog.h>
+#include <AliRawReader.h>
#include <AliTOFCableLengthMap.h>
#include <AliTOFdigit.h>
#include <AliTOFGeometry.h>
#include <AliTOFrawData.h>
#include <AliTOFRawStream.h>
+#include <AliTOFDigitMap.h>
+
+#include "AliEveTOFDigitsInfo.h"
//_________________________________________________________
AliEveTOFDigitsInfo:: ~AliEveTOFDigitsInfo()
{
+ //dtr
delete fGeom;
delete fTree;
}
/* ******************************************************* */
-void AliEveTOFDigitsInfo::SetTree(TTree* tree)
+void AliEveTOFDigitsInfo::SetTree(TTree * const tree)
{
+ //
+ // Set fTree global variable
+ //
+
static const TEveException kEH("AliEveTOFDigitsInfo::SetTree ");
if(fGeom == 0) {
*/
}
/* ******************************************************* */
-void AliEveTOFDigitsInfo::ReadRaw(AliRawReader* rawReader, Bool_t newDecoder)
+void AliEveTOFDigitsInfo::ReadRaw(AliRawReader* rawReader, Int_t newDecoder)
{
+ //
// Read raw-data. AliTOFdigit is used to
// store raw-adata for all sub-detectors.
+ //
- AliTOFCableLengthMap *cableLength = new AliTOFCableLengthMap();
+ //AliTOFCableLengthMap *cableLength = new AliTOFCableLengthMap();
//ofstream ftxt;
//Char_t fileName[100];
for (Int_t indexDDL = 0; indexDDL < kDDL; indexDDL++) {
rawReader->Reset();
- if (!newDecoder) stream.LoadRawData(indexDDL);
- else stream.LoadRawDataBuffers(indexDDL);
+ if (newDecoder==0) stream.LoadRawData(indexDDL);
+ else if (newDecoder==1) stream.LoadRawDataBuffers(indexDDL);
+ else if (newDecoder==2) stream.LoadRawDataBuffersV2(indexDDL);
clonesRawData = (TClonesArray*)stream.GetRawData();
- if (clonesRawData->GetEntriesFast()) AliDebug(2, Form(" Number of TOF digits in the sector number %2i: 5i", indexDDL, clonesRawData->GetEntriesFast()));
+ 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++) {
if (tofRawDatum->GetTOF()==-1) continue;
- Int_t cLenInt = Int_t(cableLength->GetCableTimeShift(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(),tofRawDatum->GetTDC())*1000./AliTOFGeometry::TdcBinWidth());
- digit[0] = tofRawDatum->GetTOF() - cLenInt;
+ //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;
stream.EquipmentId2VolumeId(indexDDL, tofRawDatum->GetTRM(), tofRawDatum->GetTRMchain(),
tofRawDatum->GetTDC(), tofRawDatum->GetTDCchannel(), detectorIndex);
- 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.));
+ /* 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
+ continue;
+ }
+ }
/*
if (detectorIndex[0]<10) ftxt << " -> " << detectorIndex[0];
//ftxt.close();
- cableLength = 0x0;
- delete cableLength;
+ //delete cableLength;
}
/* ******************************************************* */
void AliEveTOFDigitsInfo::LoadDigits()
{
+ //
+ // Load TOF digits
+ //
TClonesArray *digitsTOF = 0x0;
AliTOFdigit *digs;
Int_t nStrip, Int_t nPadZ, Int_t nPadX,
Int_t indexDigit[3])
{
+ //
+ // Get TOF digit indices in the TOF volume
+ // (nSector, nPlate,nStrip,nPadZ,nPadX)
+ //
Int_t vol[5] = {nSector,nPlate,nStrip,nPadX,nPadZ};
TClonesArray* AliEveTOFDigitsInfo::GetDigits(Int_t nSector, Int_t nPlate,
Int_t nStrip)
{
+ //
+ // Get TOF digits in the TOF volume
+ // (nSector, nPlate,nStrip)
+ //
Int_t newCounter = 0;
Int_t nDigitsInVolume[3] = {-1, -1, -1};
TClonesArray* AliEveTOFDigitsInfo::GetDigits(Int_t nSector)
{
+ //
+ // Get TOF digits in the TOF SM nSector
+ //
+
+ const Int_t kND = AliTOFDigitMap::kMaxDigitsPerPad;
Int_t newCounter = 0;
- Int_t nDigitsInVolume[3] = {-1, -1, -1};
- Int_t dummy[3] = {-1, -1, -1};
- Int_t informations[4] = {-1, -1, -1, -1};
+ Int_t nDigitsInVolume[kND];
+ Int_t dummy[3];
+ Int_t informations[4];
Int_t nStrips=19;
vol[4] = iPadZ;
for(Int_t iPadX=0; iPadX<fGeom->NpadX(); iPadX++) {
+
+ for (Int_t ii=0; ii<4; ii++) informations[ii]=-1;
+ for (Int_t ii=0; ii<3; ii++) dummy[ii]=-1;
+ for (Int_t ii=0; ii<kND; ii++) nDigitsInVolume[ii]=-1;
+
vol[3] = iPadX;
fTOFdigitMap->GetDigitIndex(vol, nDigitsInVolume);
- for (Int_t ii=0; ii<3; ii++) {
+ for (Int_t ii=0; ii<kND; ii++) {
//if (ii!=0) continue;
if (nDigitsInVolume[ii]>=0 ) {
}
- for (Int_t ii=0; ii<4; ii++) informations[ii]=-1;
- for (Int_t ii=0; ii<3; ii++) dummy[ii]=-1;
- for (Int_t ii=0; ii<3; ii++) nDigitsInVolume[ii]=-1;
-
}
}
}
Int_t AliEveTOFDigitsInfo::GetTOFInfos() const
{
+ //
+ // Return number of TOF digits
+ //
return fTOFdigitMap->GetFilledCellNumber();
/* ******************************************************* */
Int_t AliEveTOFDigitsInfo::IsStripFilled(Int_t iSector, Int_t iPlate, Int_t iStrip)
{
+ //
+ // Return number of TOF digits
+ // in volume (iSector,iPlate,iStrip)
+ //
Int_t vol[5] = {iSector, iPlate, iStrip, -1, -1};