X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDtrackerDebug.cxx;h=4c7c2b44dd33152f1d38d7706ff6d2d589829457;hb=f08245c2650187ad69257b2b58d0816be0870b1e;hp=f91ee07e3cfc71420deae74ac851b3cfda73e671;hpb=f29f13a6aaa9ffb9ccdbc76aefe2727d09d7ce97;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDtrackerDebug.cxx b/TRD/AliTRDtrackerDebug.cxx index f91ee07e3cf..4c7c2b44dd3 100644 --- a/TRD/AliTRDtrackerDebug.cxx +++ b/TRD/AliTRDtrackerDebug.cxx @@ -25,8 +25,6 @@ // // /////////////////////////////////////////////////////////////////////////////// -#include "AliTRDtrackerDebug.h" - #include "TFile.h" #include "TTree.h" #include "TTreeStream.h" @@ -36,13 +34,16 @@ #include "TMath.h" #include "AliLog.h" +#include "AliRieman.h" + #include "AliTRDgeometry.h" #include "AliTRDtrackV1.h" #include "AliTRDseedV1.h" -#include "AliTRDseed.h" #include "AliTRDcluster.h" #include "AliTRDgeometry.h" +#include "AliTRDtrackerDebug.h" + ClassImp(AliTRDtrackerDebug) Int_t AliTRDtrackerDebug::fgEventNumber = 0; @@ -51,10 +52,10 @@ Int_t AliTRDtrackerDebug::fgCandidateNumber = 0; //____________________________________________________ AliTRDtrackerDebug::AliTRDtrackerDebug() : AliTRDtrackerV1() - ,fOutputStreamer(0x0) - ,fTree(0x0) - ,fTracklet(0x0) - ,fTrack(0x0) + ,fOutputStreamer(NULL) + ,fTree(NULL) + ,fTracklet(NULL) + ,fTrack(NULL) ,fNClusters(0) ,fAlpha(0.) { @@ -73,13 +74,6 @@ AliTRDtrackerDebug::~AliTRDtrackerDebug() } -//____________________________________________________ -void AliTRDtrackerDebug::Draw(Option_t *) -{ -// steer draw function -} - - //____________________________________________________ Bool_t AliTRDtrackerDebug::Init() { @@ -119,7 +113,7 @@ Int_t AliTRDtrackerDebug::Process() //printf("Processing track %d [%d] ...\n", it, fNClusters); ResidualsTrackletsTrack(); - const AliTRDseedV1 *tracklet = 0x0; + const AliTRDseedV1 *tracklet = NULL; for(int ip = 5; ip>=0; ip--){ if(!(tracklet = fTrack->GetTracklet(ip))) continue; if(!tracklet->GetN()) continue; @@ -139,13 +133,13 @@ void AliTRDtrackerDebug::ResidualsClustersTrack(const AliTRDseedV1 *tracklet) // Calculate averange distances from clusters to the TRD track Double_t x[3]; - AliTRDcluster *c = 0x0; + AliTRDcluster *c = NULL; for(int ic=0; ic<35/*AliTRDseed:knTimebins*/; ic++){ if(!(c = tracklet->GetClusters(ic))) continue; Double_t xc = c->GetX(), yc = c->GetY(), zc = c->GetZ(); // propagate track to cluster - PropagateToX(*fTrack, xc, 2.); + if(!PropagateToX(*fTrack, xc, 2.)) continue; fTrack->GetXYZ(x); // transform to local tracking coordinates @@ -176,7 +170,7 @@ void AliTRDtrackerDebug::ResidualsClustersTracklet(const AliTRDseedV1 *tracklet) //z0 = tracklet->GetZfit(0), //zs = tracklet->GetZfit(1); - AliTRDcluster *c = 0x0; + AliTRDcluster *c = NULL; for(int ic=0; ic<35/*AliTRDseed:knTimebins*/; ic++){ if(!(c = tracklet->GetClusters(ic))) continue; Double_t xc = c->GetX(), yc = c->GetY()/*, zc = c->GetZ()*/; @@ -200,7 +194,7 @@ void AliTRDtrackerDebug::ResidualsClustersParametrisation(const AliTRDseedV1 *tr // store cluster positions Double_t x0 = tracklet->GetX0(); - AliTRDcluster *c = 0x0; + AliTRDcluster *c = NULL; Double_t x[2]; Int_t ncl, mcl, jc; TLinearFitter fitter(3, "hyp2"); @@ -242,8 +236,9 @@ void AliTRDtrackerDebug::ResidualsTrackletsTrack() const // build a working copy of the tracklets attached to the track // and initialize working variables fX, fY and fZ - AliTRDseedV1 tracklet[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; - const AliTRDseedV1 *ctracklet = 0x0; + //AliTRDseedV1 tracklet[6] = {NULL, NULL, NULL, NULL, NULL, NULL}; + AliTRDseedV1 tracklet[6]; + const AliTRDseedV1 *ctracklet = NULL; for(int ip = 0; ip<6; ip++){ if(!(ctracklet = fTrack->GetTracklet(ip))) continue; tracklet[ip] = (*ctracklet); @@ -267,7 +262,7 @@ void AliTRDtrackerDebug::ResidualsTrackletsTrack() const tracklet[ip].SetX0(x0); // fit Rieman with tilt correction - AliTRDtrackerV1::FitRiemanTilt(0x0, &tracklet[0], kTRUE); + AliTRDtrackerV1::FitRiemanTilt(NULL, &tracklet[0], kTRUE); // make a copy of the fit result Double_t @@ -277,7 +272,9 @@ void AliTRDtrackerDebug::ResidualsTrackletsTrack() const dzdx = tracklet[ip].GetZref(1); // restore tracklet - tracklet[ip] = (*fTrack->GetTracklet(ip)); + AliTRDseedV1 *ptr(NULL); + if(!(ptr = fTrack->GetTracklet(ip))) continue; + tracklet[ip] = (*ptr); // for(int ic=0; icGetX(), yc = c->GetY(), zc = c->GetZ(); @@ -340,7 +337,7 @@ void AliTRDtrackerDebug::AnalyseFindable(Char_t *treename){ AliTRDseedV1 *tracklets[kNPlanes]; for(Int_t iPlane = 0; iPlane < AliTRDtrackerV1::kNPlanes; iPlane++) - tracklets[iPlane] = 0x0; + tracklets[iPlane] = NULL; for(Int_t iPlane = 0; iPlane < kNPlanes; iPlane++) fTree->SetBranchAddress(Form("S%d.", iPlane), &tracklets[iPlane]); fTree->SetBranchAddress("EventNumber", &fgEventNumber); @@ -385,7 +382,7 @@ void AliTRDtrackerDebug::AnalyseTiltedRiemanFit(){ fTree = (TTree *)(debfile->Get("MakeSeeds2")); if(!fTree) return; Int_t nEntries = fTree->GetEntries(); - TLinearFitter *tiltedRiemanFitter = 0x0; + TLinearFitter *tiltedRiemanFitter = NULL; fTree->SetBranchAddress("FitterT.", &tiltedRiemanFitter); fTree->SetBranchAddress("EventNumber", &fgEventNumber); fTree->SetBranchAddress("CandidateNumber", &fgCandidateNumber); @@ -459,7 +456,7 @@ Float_t AliTRDtrackerDebug::GetDCA(Float_t a, Float_t b, Float_t c) const { //____________________________________________________ void AliTRDtrackerDebug::AnalyseMinMax() { -// + // Development function related to the old tracking code TFile *debfile = TFile::Open("TRD.TrackerDebug.root"); if(!debfile){ AliError("File TRD.TrackerDebug.root not found!"); @@ -470,8 +467,8 @@ void AliTRDtrackerDebug::AnalyseMinMax() AliError("Tree MakeSeeds0 not found in File TRD.TrackerDebug.root."); return; } - AliTRDseedV1 *cseed[4] = {0x0, 0x0, 0x0, 0x0}; - AliTRDcluster *c[4] = {0x0, 0x0, 0x0, 0x0}; + AliTRDseedV1 *cseed[4] = {NULL, NULL, NULL, NULL}; + AliTRDcluster *c[4] = {NULL, NULL, NULL, NULL}; for(Int_t il = 0; il < 4; il++){ fTree->SetBranchAddress(Form("Seed%d.", il), &cseed[il]); fTree->SetBranchAddress(Form("c%d.",il), &c[il]); @@ -514,18 +511,18 @@ TCanvas* AliTRDtrackerDebug::PlotSeedingConfiguration(const Char_t *direction, I if((strcmp(direction, "y") != 0) && (strcmp(direction, "z") != 0)){ AliError(Form("Direction %s does not exist. Abborting!", direction)); - return 0x0; + return NULL; } TFile *debfile = TFile::Open("TRD.TrackerDebug.root"); if(!debfile){ AliError("File TRD.TrackerDebug.root not found!"); - return 0x0; + return NULL; } fTree = (TTree *)(debfile->Get("MakeSeeds0")); if(!fTree){ AliError("Tree MakeSeeds0 not found in File TRD.TrackerDebug.root."); - return 0x0; + return NULL; } TGraph *seedcl = new TGraph(4); @@ -535,8 +532,8 @@ TCanvas* AliTRDtrackerDebug::PlotSeedingConfiguration(const Char_t *direction, I seedcl->SetMarkerColor(kRed); seedRef->SetMarkerStyle(2); - AliTRDcluster *c[4] = {0x0, 0x0, 0x0, 0x0}; - AliRieman *rim = 0x0; + AliTRDcluster *c[4] = {NULL, NULL, NULL, NULL}; + AliRieman *rim = NULL; Bool_t found = kFALSE; for(Int_t il = 0; il < 4; il++) fTree->SetBranchAddress(Form("c%d.",il), &c[il]); fTree->SetBranchAddress("EventNumber", &fgEventNumber); @@ -595,7 +592,7 @@ TCanvas* AliTRDtrackerDebug::PlotSeedingConfiguration(const Char_t *direction, I delete seedcl; delete seedRef; delete riemanFit; - return 0x0; + return NULL; } } @@ -617,15 +614,15 @@ TCanvas* AliTRDtrackerDebug::PlotFullTrackFit(Int_t event, Int_t candidate, Int_ if(strcmp(direction, "y") && strcmp(direction, "z")){ AliError(Form("Direction %s does not exist. Abborting!", direction)); - return 0x0; + return NULL; } TFile *debfile = TFile::Open("TRD.TrackerDebug.root"); if(!debfile){ AliError("File TRD.TrackerDebug.root not found."); - return 0x0; + return NULL; } - TString *treename = 0x0; + TString *treename = NULL; if(iteration > -1) treename = new TString("ImproveSeedQuality"); else @@ -634,7 +631,7 @@ TCanvas* AliTRDtrackerDebug::PlotFullTrackFit(Int_t event, Int_t candidate, Int_ if(!fTree){ AliError(Form("Tree %s not found in File TRD.TrackerDebug.root.", treename->Data())); delete treename; - return 0x0; + return NULL; } delete treename; @@ -646,8 +643,8 @@ TCanvas* AliTRDtrackerDebug::PlotFullTrackFit(Int_t event, Int_t candidate, Int_ clp[AliTRDtrackerV1::kNPlanes * AliTRDtrackerV1::kNTimeBins]; Int_t nLayers = 0, ncls = 0; - TLinearFitter *fitter = 0x0; - AliTRDseedV1 *tracklet[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + TLinearFitter *fitter = NULL; + AliTRDseedV1 *tracklet[6] = {NULL, NULL, NULL, NULL, NULL, NULL}; for(Int_t iLayer = 0; iLayer < 6; iLayer++) fTree->SetBranchAddress(Form("S%d.", iLayer), &tracklet[iLayer]); fTree->SetBranchAddress("FitterT.", &fitter); @@ -673,9 +670,11 @@ TCanvas* AliTRDtrackerDebug::PlotFullTrackFit(Int_t event, Int_t candidate, Int_ else refP[nLayers] = tracklet[iLayer]->GetZref(0); nLayers++; + AliTRDcluster *cl(NULL); for(Int_t itb = 0; itb < 30; itb++){ if(!tracklet[iLayer]->IsUsable(itb)) continue; - AliTRDcluster *cl = tracklet[iLayer]->GetClusters(itb); + if(!(cl = tracklet[iLayer]->GetClusters(itb))) continue; + if(!strcmp(direction, "y")) clp[ncls] = cl->GetY(); else @@ -774,7 +773,7 @@ TCanvas* AliTRDtrackerDebug::PlotFullTrackFit(Int_t event, Int_t candidate, Int_ else{ AliError(Form("Combination consisting of event %d and candidate %d not found", event, candidate)); delete fitfun; - return 0x0; + return NULL; } }