#ifndef ALITOFCLUSTERFINDERV1_H
#define ALITOFCLUSTERFINDERV1_H
#include "TObject.h"
#include "TTask.h"
#include "AliTOFGeometry.h"
#include "AliTOFRawStream.h"
class TClonesArray;
class TTree;
class AliRunLoader;
class AliRawReader;
class AliTOFcluster;
class AliTOFcalib;
class AliTOFDigitMap;
class AliTOFRecoParam;
class AliTOFselectedDigit : public TObject {
public:
AliTOFselectedDigit() :
fTDC(0.),fADC(0.),fTOT(0.),fWeight(0.),fIndex(-1) {
for (Int_t ii=0; ii<5; ii++) fDetectorIndex[ii]=-1;
for (Int_t ii=0; ii<3; ii++) fTrackLabel[ii]=-1;
};
AliTOFselectedDigit(Int_t * const ind, Double_t h1, Double_t h2, Double_t h3, Double_t h4, Int_t idx, Int_t * const l):
TObject(),
fTDC(h1),fADC(h2),fTOT(h3),fWeight(h4),fIndex(idx) {
for (Int_t ii=0; ii<5; ii++) fDetectorIndex[ii]=ind[ii];
for (Int_t ii=0; ii<3; ii++) fTrackLabel[ii]=l[ii];
};
AliTOFselectedDigit(const AliTOFselectedDigit & source) :
TObject(source),
fTDC(source.fTDC),fADC(source.fADC),fTOT(source.fTOT),fWeight(source.fWeight),fIndex(source.fIndex)
{
for (Int_t ii=0; ii<5; ii++) fDetectorIndex[ii]=source.fDetectorIndex[ii];
for (Int_t ii=0; ii<3; ii++) fTrackLabel[ii]=source.fTrackLabel[ii];
};
AliTOFselectedDigit & operator=(const AliTOFselectedDigit & source)
{ if (this == &source) return *this;
TObject::operator=(source);
for (Int_t ii=0; ii<5; ii++) fDetectorIndex[ii]=source.fDetectorIndex[ii];
fTDC=source.fTDC;fADC=source.fADC;fTOT=source.fTOT;fWeight=source.fWeight;fIndex=source.fIndex;
for (Int_t ii=0; ii<3; ii++) fTrackLabel[ii]=source.fTrackLabel[ii];
return *this; };
Double_t GetTDC() const {return fTDC;}
Double_t GetADC() const {return fADC;}
Double_t GetTOT() const {return fTOT;}
Double_t GetWeight() const {return fWeight;}
Int_t GetTrackLabel(Int_t n) const {return fTrackLabel[n];}
Int_t GetDetectorIndex(Int_t n) const {return fDetectorIndex[n];}
Int_t GetIndex() const {return fIndex;}
private:
Int_t fDetectorIndex[5];
Double_t fTDC;
Double_t fADC;
Double_t fTOT;
Double_t fWeight;
Int_t fIndex;
Int_t fTrackLabel[3];
};
class AliTOFClusterFinderV1 : public TTask
{
enum {kTofMaxCluster=77777};
public:
AliTOFClusterFinderV1(AliTOFcalib *calib);
AliTOFClusterFinderV1(const AliTOFClusterFinderV1 &source);
AliTOFClusterFinderV1& operator=(const AliTOFClusterFinderV1 &source);
virtual ~AliTOFClusterFinderV1();
void Digits2RecPoints(TTree* digitsTree, TTree* clusterTree);
void Digits2RecPoints(AliRawReader *rawReader, TTree *clustersTree);
void Raw2Digits(AliRawReader *rawReader, TTree* digitsTree);
AliTOFClusterFinderV1(AliRunLoader* runLoader, AliTOFcalib *calib);
void Digits2RecPoints(Int_t iEvent);
void Digits2RecPoints(Int_t ievt, AliRawReader *rawReader);
void Raw2Digits(Int_t ievt, AliRawReader *rawReader);
void FillRecPoint();
void ResetRecpoint();
void ResetDigits();
void SetVerbose(Int_t Verbose){fVerbose=Verbose;}
void SetDecoderVersion(Int_t version){fDecoderVersion=version;}
Bool_t GetDecoderVersion() const {return fDecoderVersion;}
void GetClusterPars(Int_t *ind, Double_t *pos, Double_t *cov) const;
void GetClusterPars( Int_t counter, Int_t **ind, Double_t *weight,
Double_t *pos, Double_t *cov) const;
void FindOnePadClusterPerStrip(Int_t nSector, Int_t nPlate, Int_t nStrip);
void FindClustersWithoutTOT(Int_t nSector, Int_t nPlate, Int_t nStrip);
void FindClustersPerStrip(Int_t nSector, Int_t nPlate, Int_t nStrip, Int_t group);
void FindClusters34(Int_t nSector, Int_t nPlate, Int_t nStrip);
void FindClusters23(Int_t nSector, Int_t nPlate, Int_t nStrip);
void FindClusters24(Int_t nSector, Int_t nPlate, Int_t nStrip);
void SetMaxDeltaTime(Int_t a) {fMaxDeltaTime = a;};
void SetMaxDeltaTime(Float_t a) {fMaxDeltaTime = (Int_t)(a/AliTOFGeometry::TdcBinWidth());};
Int_t GetMaxDeltaTime() const {return fMaxDeltaTime;};
Int_t GetNumberOfTOFclusters() const {return fNumberOfTofClusters;}
Int_t GetNumberOfTOFtrgPads() const {return fNumberOfTofTrgPads;}
void SetCalibrateFlag(Bool_t dummy) {fCalibrateTOFtimes = dummy;};
Bool_t GetCalibrateFlag() const {return fCalibrateTOFtimes;};
protected:
AliRunLoader *fRunLoader;
AliTOFcluster *fTofClusters[kTofMaxCluster];
TClonesArray *fDigits;
TClonesArray *fRecPoints;
Int_t fNumberOfTofClusters;
Int_t fNumberOfTofDigits;
Int_t fNumberOfTofTrgPads;
private:
const AliTOFRecoParam* fkRecoParam;
Int_t fMaxDeltaTime;
Int_t InsertCluster(AliTOFcluster *tofCluster);
Int_t FindClusterIndex(Double_t z) const;
Bool_t MakeSlewingCorrection(Int_t *detectorIndex, Int_t tofDigitToT, Int_t tofDigitTdc,
Int_t &tdcCorr);
void TOFclusterError( Int_t counter, Int_t **ind, Double_t *weight,
Double_t ppos[], Double_t cov[]) const;
void AverageCalculations(Int_t number, Float_t *interestingX,
Float_t *interestingY, Float_t *interestingZ,
Double_t *interestingTOF, Double_t *interestingTOT,
Double_t *interestingADC, Double_t *interestingWeight,
Int_t *parTOF, Double_t *posClus, Bool_t &check);
Int_t fVerbose;
Bool_t fDecoderVersion;
AliTOFcalib *fTOFcalib;
AliTOFDigitMap* fTOFdigitMap;
AliTOFGeometry *fTOFGeometry;
TTree *fTOFdigits;
AliTOFRawStream fTOFRawStream;
Bool_t fCalibrateTOFtimes;
ClassDef(AliTOFClusterFinderV1,6)
};
#endif
AliTOFClusterFinderV1.h:1 AliTOFClusterFinderV1.h:2 AliTOFClusterFinderV1.h:3 AliTOFClusterFinderV1.h:4 AliTOFClusterFinderV1.h:5 AliTOFClusterFinderV1.h:6 AliTOFClusterFinderV1.h:7 AliTOFClusterFinderV1.h:8 AliTOFClusterFinderV1.h:9 AliTOFClusterFinderV1.h:10 AliTOFClusterFinderV1.h:11 AliTOFClusterFinderV1.h:12 AliTOFClusterFinderV1.h:13 AliTOFClusterFinderV1.h:14 AliTOFClusterFinderV1.h:15 AliTOFClusterFinderV1.h:16 AliTOFClusterFinderV1.h:17 AliTOFClusterFinderV1.h:18 AliTOFClusterFinderV1.h:19 AliTOFClusterFinderV1.h:20 AliTOFClusterFinderV1.h:21 AliTOFClusterFinderV1.h:22 AliTOFClusterFinderV1.h:23 AliTOFClusterFinderV1.h:24 AliTOFClusterFinderV1.h:25 AliTOFClusterFinderV1.h:26 AliTOFClusterFinderV1.h:27 AliTOFClusterFinderV1.h:28 AliTOFClusterFinderV1.h:29 AliTOFClusterFinderV1.h:30 AliTOFClusterFinderV1.h:31 AliTOFClusterFinderV1.h:32 AliTOFClusterFinderV1.h:33 AliTOFClusterFinderV1.h:34 AliTOFClusterFinderV1.h:35 AliTOFClusterFinderV1.h:36 AliTOFClusterFinderV1.h:37 AliTOFClusterFinderV1.h:38 AliTOFClusterFinderV1.h:39 AliTOFClusterFinderV1.h:40 AliTOFClusterFinderV1.h:41 AliTOFClusterFinderV1.h:42 AliTOFClusterFinderV1.h:43 AliTOFClusterFinderV1.h:44 AliTOFClusterFinderV1.h:45 AliTOFClusterFinderV1.h:46 AliTOFClusterFinderV1.h:47 AliTOFClusterFinderV1.h:48 AliTOFClusterFinderV1.h:49 AliTOFClusterFinderV1.h:50 AliTOFClusterFinderV1.h:51 AliTOFClusterFinderV1.h:52 AliTOFClusterFinderV1.h:53 AliTOFClusterFinderV1.h:54 AliTOFClusterFinderV1.h:55 AliTOFClusterFinderV1.h:56 AliTOFClusterFinderV1.h:57 AliTOFClusterFinderV1.h:58 AliTOFClusterFinderV1.h:59 AliTOFClusterFinderV1.h:60 AliTOFClusterFinderV1.h:61 AliTOFClusterFinderV1.h:62 AliTOFClusterFinderV1.h:63 AliTOFClusterFinderV1.h:64 AliTOFClusterFinderV1.h:65 AliTOFClusterFinderV1.h:66 AliTOFClusterFinderV1.h:67 AliTOFClusterFinderV1.h:68 AliTOFClusterFinderV1.h:69 AliTOFClusterFinderV1.h:70 AliTOFClusterFinderV1.h:71 AliTOFClusterFinderV1.h:72 AliTOFClusterFinderV1.h:73 AliTOFClusterFinderV1.h:74 AliTOFClusterFinderV1.h:75 AliTOFClusterFinderV1.h:76 AliTOFClusterFinderV1.h:77 AliTOFClusterFinderV1.h:78 AliTOFClusterFinderV1.h:79 AliTOFClusterFinderV1.h:80 AliTOFClusterFinderV1.h:81 AliTOFClusterFinderV1.h:82 AliTOFClusterFinderV1.h:83 AliTOFClusterFinderV1.h:84 AliTOFClusterFinderV1.h:85 AliTOFClusterFinderV1.h:86 AliTOFClusterFinderV1.h:87 AliTOFClusterFinderV1.h:88 AliTOFClusterFinderV1.h:89 AliTOFClusterFinderV1.h:90 AliTOFClusterFinderV1.h:91 AliTOFClusterFinderV1.h:92 AliTOFClusterFinderV1.h:93 AliTOFClusterFinderV1.h:94 AliTOFClusterFinderV1.h:95 AliTOFClusterFinderV1.h:96 AliTOFClusterFinderV1.h:97 AliTOFClusterFinderV1.h:98 AliTOFClusterFinderV1.h:99 AliTOFClusterFinderV1.h:100 AliTOFClusterFinderV1.h:101 AliTOFClusterFinderV1.h:102 AliTOFClusterFinderV1.h:103 AliTOFClusterFinderV1.h:104 AliTOFClusterFinderV1.h:105 AliTOFClusterFinderV1.h:106 AliTOFClusterFinderV1.h:107 AliTOFClusterFinderV1.h:108 AliTOFClusterFinderV1.h:109 AliTOFClusterFinderV1.h:110 AliTOFClusterFinderV1.h:111 AliTOFClusterFinderV1.h:112 AliTOFClusterFinderV1.h:113 AliTOFClusterFinderV1.h:114 AliTOFClusterFinderV1.h:115 AliTOFClusterFinderV1.h:116 AliTOFClusterFinderV1.h:117 AliTOFClusterFinderV1.h:118 AliTOFClusterFinderV1.h:119 AliTOFClusterFinderV1.h:120 AliTOFClusterFinderV1.h:121 AliTOFClusterFinderV1.h:122 AliTOFClusterFinderV1.h:123 AliTOFClusterFinderV1.h:124 AliTOFClusterFinderV1.h:125 AliTOFClusterFinderV1.h:126 AliTOFClusterFinderV1.h:127 AliTOFClusterFinderV1.h:128 AliTOFClusterFinderV1.h:129 AliTOFClusterFinderV1.h:130 AliTOFClusterFinderV1.h:131 AliTOFClusterFinderV1.h:132 AliTOFClusterFinderV1.h:133 AliTOFClusterFinderV1.h:134 AliTOFClusterFinderV1.h:135 AliTOFClusterFinderV1.h:136 AliTOFClusterFinderV1.h:137 AliTOFClusterFinderV1.h:138 AliTOFClusterFinderV1.h:139 AliTOFClusterFinderV1.h:140 AliTOFClusterFinderV1.h:141 AliTOFClusterFinderV1.h:142 AliTOFClusterFinderV1.h:143 AliTOFClusterFinderV1.h:144 AliTOFClusterFinderV1.h:145 AliTOFClusterFinderV1.h:146 AliTOFClusterFinderV1.h:147 AliTOFClusterFinderV1.h:148 AliTOFClusterFinderV1.h:149 AliTOFClusterFinderV1.h:150 AliTOFClusterFinderV1.h:151 AliTOFClusterFinderV1.h:152 AliTOFClusterFinderV1.h:153 AliTOFClusterFinderV1.h:154 AliTOFClusterFinderV1.h:155 AliTOFClusterFinderV1.h:156 AliTOFClusterFinderV1.h:157 AliTOFClusterFinderV1.h:158 AliTOFClusterFinderV1.h:159 AliTOFClusterFinderV1.h:160 AliTOFClusterFinderV1.h:161 AliTOFClusterFinderV1.h:162 AliTOFClusterFinderV1.h:163 AliTOFClusterFinderV1.h:164 AliTOFClusterFinderV1.h:165 AliTOFClusterFinderV1.h:166 AliTOFClusterFinderV1.h:167 AliTOFClusterFinderV1.h:168 AliTOFClusterFinderV1.h:169 AliTOFClusterFinderV1.h:170 AliTOFClusterFinderV1.h:171