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 AliTRD *trd = (AliTRD *) gAlice->GetDetector("TRD");
19 cout << "<AliTRDanalyzeHits> No TRD detector found" << endl;
24 // Get the pointer to the geometry object
25 AliTRDgeometryFull *geo;
27 geo = (AliTRDgeometryFull *) trd->GetGeometry();
30 cout << "<AliTRDanalyzeHits> No TRD geometry found" << endl;
35 // Define the histograms
36 TH1F *hQdedx = new TH1F("hQdedx","Charge dedx-hits",100,0.0,1000.0);
37 TH1F *hQtr = new TH1F("hQtr" ,"Charge TR-hits" ,100,0.0,1000.0);
39 Float_t rmin = geo->Rmin();
40 Float_t rmax = geo->Rmax();
41 Float_t length = geo->GetChamberLength(0,2);
42 Float_t width = geo->GetChamberWidth(0);
43 Int_t ncol = geo->GetColMax(0);
44 Int_t nrow = geo->GetRowMax(0,2,13);
45 Int_t ntime = ((Int_t) (rmax - rmin) / geo->GetTimeBinSize());
47 TH2F *hZY = new TH2F("hZY" ,"Y vs Z (chamber 0)", nrow,-length/2.,length/2.
49 TH2F *hXZ = new TH2F("hXZ" ,"Z vs X (plane 0)" , ncol, -width/2., width/2.
50 , nrow,-length/2.,length/2.);
52 TH1F *hNprimP = new TH1F("hNprimP","Number of primary electrons per cm (MIP pion)"
54 TH1F *hNprimE = new TH1F("hNprimE","Number of primary electrons per cm (3GeV electron)"
56 TH1F *hNtotP = new TH1F("hNtotP" ,"Number of electrons per cm (MIP pion)"
58 TH1F *hNtotE = new TH1F("hNtotE" ,"Number of electrons per cm (3GeV electron)"
61 // Get the pointer hit tree
62 TTree *hitTree = gAlice->TreeH();
64 cout << "<AliTRDanalyzeHits> No hit tree found" << endl;
72 // Get the number of entries in the hit tree
73 // (Number of primary particles creating a hit somewhere)
74 Int_t nTrack = (Int_t) hitTree->GetEntries();
75 cout << "<AliTRDanalyzeHits> Found " << nTrack
76 << " primary particles with hits" << endl;
78 // Loop through all entries in the tree
79 for (Int_t iTrack = 0; iTrack < nTrack; iTrack++) {
82 nBytes += hitTree->GetEvent(iTrack);
89 // Loop through the TRD hits
91 AliTRDhit *hit = (AliTRDhit *) trd->FirstHit(-1);
100 Float_t q = hit->GetCharge();
101 Int_t track = hit->Track();
102 Int_t det = hit->GetDetector();
103 Int_t plane = geo->GetPlane(det);
113 hQtr->Fill(TMath::Abs(q));
116 TParticle *part = gAlice->Particle(track);
118 if ((plane == 0) && (q > 0)) {
121 if ((part->GetPdgCode() == 11) &&
124 nTotE += ((Int_t) q);
128 if ((part->GetPdgCode() == -211) &&
131 nTotP += ((Int_t) q);
136 hit = (AliTRDhit *) trd->NextHit();
140 if (nPrimE > 0) hNprimE->Fill(((Double_t) nPrimE)/3.7);
141 if (nPrimP > 0) hNprimP->Fill(((Double_t) nPrimP)/3.7);
142 if (nTotE > 0) hNtotE->Fill(((Double_t) nTotE)/3.7);
143 if (nTotP > 0) hNtotP->Fill(((Double_t) nTotP)/3.7);
147 cout << "<AliTRDanalyzeHits> Found " << countHits << " hits in total" << endl;
149 TCanvas *cHits = new TCanvas("cHits","AliTRDanalyzeHits",50,50,600,600);
162 TCanvas *cNel = new TCanvas("cNel","Ionization",50,50,600,600);
177 TFile *fout = new TFile("TRD_ionization.root","RECREATE");