From: abercuci Date: Tue, 16 Sep 2008 10:13:16 +0000 (+0000) Subject: more analysis macros as user applications for EveTrackList X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=b2bb5db0dda8c3ec0753c56cc1d4ca3fd47f4b63;p=u%2Fmrichter%2FAliRoot.git more analysis macros as user applications for EveTrackList --- diff --git a/TRD/qaRec/macros/chargeDistr.C b/TRD/qaRec/macros/chargeDistr.C index 059616b318f..14c4562269e 100644 --- a/TRD/qaRec/macros/chargeDistr.C +++ b/TRD/qaRec/macros/chargeDistr.C @@ -1,15 +1,13 @@ -#ifndef __CINT__ -#include -#include -#include +#if !defined(__CINT__) || defined(__MAKECINT__) +#include +#include +#include #endif void chargeDistr(const AliTRDtrackV1* track, Double_t* &results, Int_t& nResults) { - if (track == 0) return; + if (!track) return; - - Int_t Nt = track->GetNumberOfTracklets(); AliTRDcluster* cls = 0; AliTRDseedV1 *tracklet = 0x0; @@ -21,7 +19,7 @@ void chargeDistr(const AliTRDtrackV1* track, Double_t* &results, Int_t& nResults if(!(tracklet = track->GetTracklet(trackletInd))) continue; if(!tracklet->IsOK()) continue; - for (Int_t clusterInd = 0; clusterInd < 34; clusterInd++) + for (Int_t clusterInd = 0; clusterInd < AliTRDseed::knTimebins; clusterInd++) { if(!(cls = tracklet->GetClusters(clusterInd))) continue; @@ -47,70 +45,3 @@ void chargeDistr(const AliTRDtrackV1* track, Double_t* &results, Int_t& nResults } } } - -/* -Double_t chargeDistr(AliTRDtrackV1* track) -{ - Double_t returnValue = 0; - AliTRDseedV1 *tracklet = 0x0; - Int_t Nt = track->AliKalmanTrack::GetNumberOfTracklets(); - - for (Int_t trackletInd = 0; trackletInd < Nt; trackletInd++) - { - if(!(tracklet = track->GetTracklet(trackletInd))) continue; - if(!tracklet->IsOK()) continue; - - for (Int_t clusterInd = 0; clusterInd < 34; clusterInd++) - { - if(!(cls = tracklet->GetClusters(clusterInd))) continue; - - returnValue += cls->GetQ(); - } - } - - return returnValue; -} - -void chargeDistr(AliEveTRDTrackList* trackList) -{ - if (trackList == 0) return; - - // hist - TH1D *mQ = new TH1D("Q", ";Charge", 200, 0, 200); - - Int_t Nt = 0; - - AliTRDcluster* cls = 0; - AliEveTRDTrack* track = 0; - - for (TEveElement::List_i iterator = trackList->BeginChildren(); iterator != trackList->EndChildren(); ++iterator) - { - track = dynamic_cast(*iterator); - - if (!track) continue; - if (!track->GetRnrState()) continue; - - AliTRDtrackV1 *trackv1 = 0x0; - AliTRDseedV1 *tracklet = 0x0; - trackv1 = (AliTRDtrackV1*)track->GetUserData(); - - Nt = trackv1->AliKalmanTrack::GetNumberOfTracklets(); - - for (Int_t trackletInd = 0; trackletInd < Nt; trackletInd++) - { - if(!(tracklet = trackv1->GetTracklet(trackletInd))) continue; - if(!tracklet->IsOK()) continue; - - for (Int_t clusterInd = 0; clusterInd < 34; clusterInd++) - { - if(!(cls = tracklet->GetClusters(clusterInd))) continue; - - mQ->Fill(cls->GetQ()); - } - } - } - - gEve->AddCanvasTab("Charge distribution"); - mQ->Draw(); -} -*/ diff --git a/TRD/qaRec/macros/clusterResiduals.C b/TRD/qaRec/macros/clusterResiduals.C new file mode 100644 index 00000000000..095f96a18ca --- /dev/null +++ b/TRD/qaRec/macros/clusterResiduals.C @@ -0,0 +1,31 @@ +#if !defined(__CINT__) || defined(__MAKECINT__) +#include +#include +#include +#include +#endif + +void clusterResiduals(const AliTRDtrackV1* track, Double_t* &res, Int_t& n) +{ + if (!track) return; + + Int_t in = 0; + n = track->GetNumberOfClusters(); + res = new Double_t[n]; + memset(res, 0, n*sizeof(Double_t)); + + AliTRDseedV1 *fTracklet = 0x0; + for(Int_t ily=0; ilyGetTracklet(ily))) continue; + if(!fTracklet->IsOK()) continue; + if(!fTracklet->Fit(kFALSE)) continue; + + AliTRDcluster *c = 0x0; + for(Int_t ic=AliTRDseed::knTimebins-1; ic>=0; ic--){ + if(!(c = fTracklet->GetClusters(ic))) continue; + + res[in++] = fTracklet->GetYat(c->GetX()) - c->GetY(); + } + } + return; +} diff --git a/TRD/qaRec/macros/clusterSelection.C b/TRD/qaRec/macros/clusterSelection.C index 8d2707ade71..30017b24805 100644 --- a/TRD/qaRec/macros/clusterSelection.C +++ b/TRD/qaRec/macros/clusterSelection.C @@ -7,11 +7,11 @@ // A.Bercuci // -#ifndef __CINT__ -#include +#if !defined(__CINT__) || defined(__MAKECINT__) +#include #endif -Bool_t clusterSelection(const AliTRDtrackV1* track=0x0) +Bool_t clusterSelection(const AliTRDtrackV1 *track) { if(!track) return kFALSE; if (track->GetNumberOfClusters() > 60) return kFALSE; diff --git a/TRD/qaRec/macros/nclusters.C b/TRD/qaRec/macros/nclusters.C new file mode 100644 index 00000000000..eb7344a4c3e --- /dev/null +++ b/TRD/qaRec/macros/nclusters.C @@ -0,0 +1,16 @@ +#if !defined(__CINT__) || defined(__MAKECINT__) +#include +#include +#include +#endif + +void nclusters(const AliTRDtrackV1* track, Double_t* &res, Int_t& n) +{ + if (!track) return; + + n = 1; + res = new Double_t[n]; + res[0] = track->GetNumberOfClusters(); + return; +} +