]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/qaRec/macros/chargeDistr.C
more analysis macros as user applications for EveTrackList
[u/mrichter/AliRoot.git] / TRD / qaRec / macros / chargeDistr.C
CommitLineData
b2bb5db0 1#if !defined(__CINT__) || defined(__MAKECINT__)
2#include <TRD/AliTRDcluster.h>
3#include <TRD/AliTRDseedV1.h>
4#include <TRD/AliTRDtrackV1.h>
aa2bafcc 5#endif
6
7void chargeDistr(const AliTRDtrackV1* track, Double_t* &results, Int_t& nResults)
56c41dea 8{
b2bb5db0 9 if (!track) return;
56c41dea 10
aa2bafcc 11 Int_t Nt = track->GetNumberOfTracklets();
56c41dea 12 AliTRDcluster* cls = 0;
aa2bafcc 13 AliTRDseedV1 *tracklet = 0x0;
14
56c41dea 15 // Count cluster
16 nResults = 0;
17 for (Int_t trackletInd = 0; trackletInd < Nt; trackletInd++)
18 {
19 if(!(tracklet = track->GetTracklet(trackletInd))) continue;
20 if(!tracklet->IsOK()) continue;
21
b2bb5db0 22 for (Int_t clusterInd = 0; clusterInd < AliTRDseed::knTimebins; clusterInd++)
56c41dea 23 {
24 if(!(cls = tracklet->GetClusters(clusterInd))) continue;
25
26 nResults++;
27 }
28 }
29
30 // Allocate memory for the results (AliEveTRDTrackList will clean this memory automatically)
31 results = new Double_t[nResults];
32 for (Int_t i = 0; i < nResults; i++) results[i] = -100;
33 Int_t currentIndex = 0;
34
35 for (Int_t trackletInd = 0; trackletInd < Nt; trackletInd++)
36 {
37 if(!(tracklet = track->GetTracklet(trackletInd))) continue;
38 if(!tracklet->IsOK()) continue;
39
40 for (Int_t clusterInd = 0; clusterInd < 34; clusterInd++)
41 {
42 if(!(cls = tracklet->GetClusters(clusterInd))) continue;
43
44 results[currentIndex++] = cls->GetQ();
45 }
46 }
47}