prepare PID LQ ref maker for production
[u/mrichter/AliRoot.git] / PWG1 / TRD / info / AliTRDpidInfo.cxx
CommitLineData
b91fdd71 1#include "AliTRDpidInfo.h"
2#include "AliTRDgeometry.h"
3
4#include "string.h"
5
6ClassImp(AliTRDpidInfo)
7ClassImp(AliTRDpidInfo::AliTRDpidData)
8
9//________________________________________________________________________
10AliTRDpidInfo::AliTRDpidData::AliTRDpidData() : fPLbin(0xff)
11{
12 memset(fdEdx, 0, 8*sizeof(Float_t));
13}
14
15//________________________________________________________________________
16AliTRDpidInfo::AliTRDpidInfo() :
17 TObject()
18 , fNtracklets(0)
19 ,fData(0x0)
20{
21 // Constructor of data array
22 fData = new AliTRDpidData[AliTRDgeometry::kNlayer];
23}
24
25//________________________________________________________________________
26AliTRDpidInfo::~AliTRDpidInfo()
27{
28 // Destructor
29 delete [] fData;
30}
31
32//________________________________________________________________________
33void AliTRDpidInfo::PushBack(Int_t ly, Int_t p, Float_t *dedx)
34{
35// Add PID data to the end of the array
36 fData[fNtracklets].fPLbin= (ly<<4) | (p&0xf);
37 memcpy(fData[fNtracklets].fdEdx, dedx, 8*sizeof(Float_t));
38 fNtracklets++;
39}
40
41//________________________________________________________________________
42void AliTRDpidInfo::Reset()
43{
44// Reset content
45
46 if(!fNtracklets) return;
47 while(fNtracklets--){
48 fData[fNtracklets].fPLbin = 0xff;
49 memset(fData[fNtracklets].fdEdx, 0, 8*sizeof(Float_t));
50 }
51 fNtracklets=0;
52}
53