1 Int_t AliTRDanalyzeHits()
4 // Analyzes the hits and fills QA-histograms
10 cout << "<AliTRDanalyzeHits> No AliRun object found" << endl;
16 // Get the pointer to the TRD detector
17 AliDetector *TRD = gAlice->GetDetector("TRD");
19 cout << "<AliTRDanalyzeHits> No TRD detector found" << endl;
24 // Define the histograms
25 TH1F *hQdedx = new TH1F("hQdedx","Charge dedx-hits",100,0.0,1000.0);
26 TH1F *hQtr = new TH1F("hQtr" ,"Charge TR-hits" ,100,0.0,1000.0);
27 TH2F *hZY = new TH2F("hZY" ,"Y vs Z",50,-100.0,100.0,40,290.0,370.0);
28 TH2F *hXZ = new TH2F("hXZ" ,"Z vs X",50,-100.0,100.0,50,-100.0,100.0);
30 // Get the pointer hit tree
31 TTree *HitTree = gAlice->TreeH();
33 cout << "<AliTRDanalyzeHits> No hit tree found" << endl;
41 // Get the number of entries in the hit tree
42 // (Number of primary particles creating a hit somewhere)
43 Int_t nTrack = (Int_t) HitTree->GetEntries();
44 cout << "<AliTRDanalyzeHits> Found " << nTrack
45 << " primary particles with hits" << endl;
47 // Loop through all entries in the tree
48 for (Int_t iTrack = 0; iTrack < nTrack; iTrack++) {
51 nBytes += HitTree->GetEvent(iTrack);
53 // Get the number of hits in the TRD created by this particle
54 Int_t nHit = TRD->Hits()->GetEntriesFast();
55 //cout << "<AliTRDanalyzeHits> Found " << nHit
56 // << " hits for primary particle " << iTrack << endl;
58 // Loop through the TRD hits
59 for (Int_t iHit = 0; iHit < nHit; iHit++) {
63 AliTRDhit *hit = (AliTRDhit *) TRD->Hits()->UncheckedAt(iHit);
68 Float_t q = hit->GetCharge();
74 hQtr->Fill(TMath::Abs(q));
84 cout << "<AliTRDanalyzeHits> Found " << countHits << " hits in total" << endl;
86 TCanvas *cHits = new TCanvas("cHits","AliTRDanalyzeHits",50,50,600,600);