From: gconesab Date: Mon, 12 May 2014 13:21:53 +0000 (+0200) Subject: avoid warnings with modern compilers due to unused variables or wrong comparison... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=852a34a038252c6710d0e9a7f3e1ef783c9698b6;p=u%2Fmrichter%2FAliRoot.git avoid warnings with modern compilers due to unused variables or wrong comparison of pointers --- diff --git a/EMCAL/AliCaloRawAnalyzerFakeALTRO.cxx b/EMCAL/AliCaloRawAnalyzerFakeALTRO.cxx index 92663bd2822..11ea430dd47 100644 --- a/EMCAL/AliCaloRawAnalyzerFakeALTRO.cxx +++ b/EMCAL/AliCaloRawAnalyzerFakeALTRO.cxx @@ -55,81 +55,81 @@ AliCaloRawAnalyzerFakeALTRO::Evaluate( const vector &bunchvec int index = SelectBunch( bunchvector, &maxampindex, &maxamp ); if( index >= 0) + { + Float_t ped = ReverseAndSubtractPed( &(bunchvector.at(index)) , altrocfg1, altrocfg2, fReversed ); + Float_t maxf = TMath::MaxElement( bunchvector.at(index).GetLength(), fReversed ); + short maxrev = maxampindex - bunchvector.at(index).GetStartBin(); + // timebinOffset is timebin value at maximum (maxrev) + short timebinOffset = maxampindex - (bunchvector.at(index).GetLength()-1); + if( maxf < fAmpCut || ( maxamp - ped) > fOverflowCut ) // (maxamp - ped) > fOverflowCut = Close to saturation (use low gain then) { - Float_t ped = ReverseAndSubtractPed( &(bunchvector.at(index)) , altrocfg1, altrocfg2, fReversed ); - Float_t maxf = TMath::MaxElement( bunchvector.at(index).GetLength(), fReversed ); - short maxrev = maxampindex - bunchvector.at(index).GetStartBin(); - // timebinOffset is timebin value at maximum (maxrev) - short timebinOffset = maxampindex - (bunchvector.at(index).GetLength()-1); - if( maxf < fAmpCut || ( maxamp - ped) > fOverflowCut ) // (maxamp - ped) > fOverflowCut = Close to saturation (use low gain then) - { - return AliCaloFitResults( maxamp, ped, Ret::kCrude, maxf, timebinOffset); - } - else if ( maxf >= fAmpCut ) - { - int first = 0; - int last = 0; - SelectSubarray( fReversed, bunchvector.at(index).GetLength(), maxrev, &first, &last, fFitArrayCut ); - int nsamples = last - first + 1; - - if( ( nsamples ) >= fNsampleCut ) + return AliCaloFitResults( maxamp, ped, Ret::kCrude, maxf, timebinOffset); + } + else if ( maxf >= fAmpCut ) + { + int first = 0; + int last = 0; + SelectSubarray( fReversed, bunchvector.at(index).GetLength(), maxrev, &first, &last, fFitArrayCut ); + int nsamples = last - first + 1; + + if( ( nsamples ) >= fNsampleCut ) { Float_t tmax = (maxrev - first); // local tmax estimate TGraph *graph = new TGraph( nsamples, fXaxis, &fReversed[first] ); fTf1->SetParameter(0, maxf*fkEulerSquared ); - fTf1->SetParameter(1, tmax - fTau); + fTf1->SetParameter(1, tmax - fTau); // set rather loose parameter limits fTf1->SetParLimits(0, 0.5*maxf*fkEulerSquared, 2*maxf*fkEulerSquared ); - fTf1->SetParLimits(1, tmax - fTau - 4, tmax - fTau + 4); - + fTf1->SetParLimits(1, tmax - fTau - 4, tmax - fTau + 4); + if (fFixTau) { - fTf1->FixParameter(2, fTau); + fTf1->FixParameter(2, fTau); } else { - fTf1->ReleaseParameter(2); // allow par. to vary - fTf1->SetParameter(2, fTau); + fTf1->ReleaseParameter(2); // allow par. to vary + fTf1->SetParameter(2, fTau); } - + Short_t tmpStatus = 0; try { - tmpStatus = graph->Fit(fTf1, "Q0RW"); + tmpStatus = graph->Fit(fTf1, "Q0RW"); } catch (const std::exception & e) { - AliError( Form("TGraph Fit exception %s", e.what()) ); - return AliCaloFitResults( maxamp, ped, Ret::kNoFit, maxf, timebinOffset, - timebinOffset, Ret::kDummy, Ret::kDummy, Ret::kDummy, AliCaloFitSubarray(index, maxrev, first, last) ); + AliError( Form("TGraph Fit exception %s, fit status %d", e.what(),tmpStatus) ); + return AliCaloFitResults( maxamp, ped, Ret::kNoFit, maxf, timebinOffset, + timebinOffset, Ret::kDummy, Ret::kDummy, Ret::kDummy, AliCaloFitSubarray(index, maxrev, first, last) ); } - + if( fVerbose == true ) - { - AliCaloRawAnalyzer::PrintBunch( bunchvector.at(index) ); - PrintFitResult( fTf1 ) ; - } + { + AliCaloRawAnalyzer::PrintBunch( bunchvector.at(index) ); + PrintFitResult( fTf1 ) ; + } // global tmax tmax = fTf1->GetParameter(1) + timebinOffset - (maxrev - first) // abs. t0 - + fTf1->GetParameter(2); // +tau, makes sum tmax + + fTf1->GetParameter(2); // +tau, makes sum tmax - delete graph; - return AliCaloFitResults( maxamp, ped , Ret::kFitPar, - fTf1->GetParameter(0)/fkEulerSquared, - tmax, - timebinOffset, - fTf1->GetChisquare(), - fTf1->GetNDF(), - Ret::kDummy, AliCaloFitSubarray(index, maxrev, first, last) ); + delete graph; + return AliCaloFitResults( maxamp, ped , Ret::kFitPar, + fTf1->GetParameter(0)/fkEulerSquared, + tmax, + timebinOffset, + fTf1->GetChisquare(), + fTf1->GetNDF(), + Ret::kDummy, AliCaloFitSubarray(index, maxrev, first, last) ); - // delete graph; - + // delete graph; + } - else + else { Float_t chi2 = CalculateChi2(maxf, maxrev, first, last); Int_t ndf = last - first - 1; // nsamples - 2 return AliCaloFitResults( maxamp, ped, Ret::kCrude, maxf, timebinOffset, - timebinOffset, chi2, ndf, Ret::kDummy, AliCaloFitSubarray(index, maxrev, first, last) ); + timebinOffset, chi2, ndf, Ret::kDummy, AliCaloFitSubarray(index, maxrev, first, last) ); } - } // ampcut - } + } // ampcut + } return AliCaloFitResults( Ret::kInvalid, Ret::kInvalid ); } diff --git a/EMCAL/AliEMCALHistoUtilities.cxx b/EMCAL/AliEMCALHistoUtilities.cxx index 5a5cf029dd1..b48fb6f8ed9 100644 --- a/EMCAL/AliEMCALHistoUtilities.cxx +++ b/EMCAL/AliEMCALHistoUtilities.cxx @@ -133,7 +133,7 @@ void AliEMCALHistoUtilities::FillHProf(TList *l, Int_t ind, Double_t x, Double_t if(l == 0) return; if(ind>=0 && ind < l->GetSize()){ h = dynamic_cast(l->At(ind)); - if(h>0) h->Fill(x,y,w); + if(h) h->Fill(x,y,w); } } diff --git a/EMCAL/AliEMCALTracker.cxx b/EMCAL/AliEMCALTracker.cxx index 482478168ab..88d620b443f 100644 --- a/EMCAL/AliEMCALTracker.cxx +++ b/EMCAL/AliEMCALTracker.cxx @@ -329,16 +329,18 @@ Int_t AliEMCALTracker::PropagateBack(AliESDEvent* esd) // Note: should always return 0=OK, because otherwise all tracking // is aborted for this event - if (!esd) { + if (!esd) + { AliError("NULL ESD passed"); return 1; } // step 1: collect clusters Int_t okLoadClusters, nClusters; - if (!fClusters || (fClusters && fClusters->IsEmpty())) { + + if (!fClusters || (fClusters && fClusters->IsEmpty())) okLoadClusters = LoadClusters(esd); - } + nClusters = fClusters->GetEntries(); // step 2: collect ESD tracks @@ -346,12 +348,17 @@ Int_t AliEMCALTracker::PropagateBack(AliESDEvent* esd) okLoadTracks = LoadTracks(esd); nTracks = fTracks->GetEntries(); + AliDebug(5,Form("Propagate back %d tracks ok %d, for %d clusters ok %d", + nTracks,okLoadTracks,nClusters,okLoadClusters)); + // step 3: for each track, find the closest cluster as matched within residual cuts Int_t index=-1; - for (Int_t it = 0; it < nTracks; it++) { + for (Int_t it = 0; it < nTracks; it++) + { AliESDtrack *track = (AliESDtrack*)fTracks->At(it); index = FindMatchedCluster(track); - if (index>-1) { + if (index>-1) + { AliEMCALMatchCluster *cluster = (AliEMCALMatchCluster*)fClusters->At(index); track->SetEMCALcluster(cluster->Index()); track->SetStatus(AliESDtrack::kEMCALmatch); @@ -379,8 +386,10 @@ Int_t AliEMCALTracker::FindMatchedCluster(AliESDtrack *track) // Otherwise use the TPCInner point AliExternalTrackParam *trkParam = 0; - if (!fITSTrackSA) { + if (!fITSTrackSA) + { const AliESDfriendTrack* friendTrack = track->GetFriendTrack(); + if (friendTrack && friendTrack->GetTPCOut()) trkParam = const_cast(friendTrack->GetTPCOut()); else if (track->GetInnerParam()) @@ -393,12 +402,16 @@ Int_t AliEMCALTracker::FindMatchedCluster(AliESDtrack *track) AliExternalTrackParam trkParamTmp(*trkParam); Float_t eta, phi, pt; - if (!AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&trkParamTmp, fEMCalSurfaceDistance, track->GetMass(kTRUE), fStep, eta, phi, pt)) { + if (!AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&trkParamTmp, fEMCalSurfaceDistance, track->GetMass(kTRUE), fStep, eta, phi, pt)) + { if (fITSTrackSA) delete trkParam; return index; } + track->SetTrackPhiEtaPtOnEMCal(phi,eta,pt); - if (TMath::Abs(eta)>0.75 || (phi) < 70*TMath::DegToRad() || (phi) > 190*TMath::DegToRad()) { + + if (TMath::Abs(eta)>0.75 || (phi) < 70*TMath::DegToRad() || (phi) > 190*TMath::DegToRad()) + { if (fITSTrackSA) delete trkParam; return index; } @@ -407,18 +420,26 @@ Int_t AliEMCALTracker::FindMatchedCluster(AliESDtrack *track) Double_t trkPos[3]; trkParamTmp.GetXYZ(trkPos); Int_t nclusters = fClusters->GetEntries(); - for (Int_t ic=0; icAt(ic); - Float_t clsPos[3] = {static_cast(cluster->X()),static_cast(cluster->Y()),static_cast(cluster->Z())}; + + Float_t clsPos[3] = {static_cast(cluster->X()), + static_cast(cluster->Y()), + static_cast(cluster->Z())}; + Double_t dR = TMath::Sqrt(TMath::Power(trkPos[0]-clsPos[0],2)+TMath::Power(trkPos[1]-clsPos[1],2)+TMath::Power(trkPos[2]-clsPos[2],2)); //printf("\n dR=%f,wind=%f\n",dR,fClusterWindow); //MARCEL + if (dR > fClusterWindow) continue; AliExternalTrackParam trkParTmp(trkParamTmp); Float_t tmpEta, tmpPhi; if (!AliEMCALRecoUtils::ExtrapolateTrackToPosition(&trkParTmp, clsPos,track->GetMass(kTRUE), 5, tmpEta, tmpPhi)) continue; - if (TMath::Abs(tmpPhi)0 ?fAmpJetMatrix->Sum() :0.0; + return fAmpJetMatrix ?fAmpJetMatrix->Sum() :0.0; } //____________________________________________________________________________ diff --git a/EMCAL/AliEMCALWsuCosmicRaySetUp.cxx b/EMCAL/AliEMCALWsuCosmicRaySetUp.cxx index 9908592ad65..5734279897b 100644 --- a/EMCAL/AliEMCALWsuCosmicRaySetUp.cxx +++ b/EMCAL/AliEMCALWsuCosmicRaySetUp.cxx @@ -259,12 +259,12 @@ TList* AliEMCALWsuCosmicRaySetUp::BookKineHists(const Double_t p , const Char_t gROOT->cd(); TH1::AddDirectory(1); - TH1 *h = 0, *hgid=0; + TH1 * hgid=0; Int_t nphi=180, nmax=1100; Double_t phimin=0.0, phimax=360.; Double_t pmax=110.; if(p>0.1) pmax = 1.1*p; - h = new TH1F("00_hNPrim"," number of primary particles ", 10, 0.5, 10.5); + new TH1F("00_hNPrim"," number of primary particles ", 10, 0.5, 10.5); hgid = new TH1F("01_hGidprim","Geant Id of primary particles", 16, 0.5, 16.5); new TH1F("02_hPmomPrim","p of primary particles", nmax, 0.0, pmax); new TH1F("03_hEtaPrim","#eta primary particles", 80, 0.0, 8.0); diff --git a/EMCAL/AliEMCALv0.cxx b/EMCAL/AliEMCALv0.cxx index 816a5041879..cda75491328 100644 --- a/EMCAL/AliEMCALv0.cxx +++ b/EMCAL/AliEMCALv0.cxx @@ -510,8 +510,8 @@ void AliEMCALv0::CreateEmod(const char* mother, const char* child) if(!gn.Contains("WSUC")) { // ALICE AliMatrix(fIdRotm, 90.-angle,180., 90.0,90.0, angle, 0.); phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi(); - // printf(" %2i | angle | %6.3f - %6.3f = %6.3f(eta %5.3f)\n", - //iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule()); + AliDebug(4,Form(" %2i | angle | %6.3f - %6.3f = %6.3f(eta %5.3f)\n", + iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule())); xpos = mod->GetPosXfromR() + g->GetSteelFrontThickness() - fSmodPar0; zpos = mod->GetPosZ() - fSmodPar2; @@ -539,8 +539,8 @@ void AliEMCALv0::CreateEmod(const char* mother, const char* child) if(iz == 0) AliMatrix(fIdRotm, 0.,0., 90.,0., 90.,90.); // (x')z; y'(x); z'(y) else AliMatrix(fIdRotm, 90-angle,270., 90.0,0.0, angle,90.); phiOK = mod->GetCenterOfModule().Phi()*180./TMath::Pi(); - //printf(" %2i | angle -phiOK | %6.3f - %6.3f = %6.3f(eta %5.3f)\n", - //iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule()); + AliDebug(4,Form(" %2i | angle -phiOK | %6.3f - %6.3f = %6.3f(eta %5.3f)\n", + iz+1, angle, phiOK, angle-phiOK, mod->GetEtaOfCenterOfModule())); zpos = mod->GetPosZ() - fSmodPar2; ypos = mod->GetPosXfromR() - fSmodPar1; //printf(" zpos %7.2f ypos %7.2f fIdRotm %i\n xpos ", zpos, xpos, fIdRotm); @@ -548,9 +548,9 @@ void AliEMCALv0::CreateEmod(const char* mother, const char* child) { // flat in phi xpos = g->GetPhiModuleSize()*(2*ix+1 - g->GetNPhi())/2.; TVirtualMC::GetMC()->Gspos(child, ++nr, mother, xpos, ypos, zpos, fIdRotm, "ONLY") ; - printf(" %7.2f ", xpos); + //printf(" %7.2f ", xpos); } - printf("\n"); + //printf("\n"); } } AliDebug(2,Form(" Number of modules in Super Module(%s) %i \n", mother, nr)); @@ -850,7 +850,7 @@ void AliEMCALv0::PbInTrapForTrd2(const double *parTRAP, TString name) name.Data(), pbShape.Data(), pbtiChonly.Data(), nr); AliEMCALGeometry * g = GetGeometry(); - double par[5], parPB[5], parSC[5]; + double par[5], parPB[5];//, parSC[5]; double xpos = 0.0, ypos = 0.0; double zpos = -fSampleWidth*g->GetNECLayers()/2. + g->GetECPbRadThick()/2.; if(name == "SCMX") { // common trapezoid - 11 parameters @@ -879,7 +879,7 @@ void AliEMCALv0::PbInTrapForTrd2(const double *parTRAP, TString name) double tanx = (parTRAP[1] - parTRAP[0]) / (2.*parTRAP[4]); // tanx = tany now double tany = (parTRAP[3] - parTRAP[2]) / (2.*parTRAP[4]), ztmp=0.; parPB[4] = g->GetECPbRadThick()/2.; - parSC[2] = g->GetECScintThick()/2.; + //parSC[2] = g->GetECScintThick()/2.; for(int iz=0; izGetNECLayers(); iz++){ ztmp = fSampleWidth*double(iz); parPB[0] = parTRAP[0] + tanx*ztmp;