From 92df0132522a4ed970ab44255644aca9102b82f2 Mon Sep 17 00:00:00 2001 From: cblume Date: Wed, 1 Feb 2012 15:12:41 +0000 Subject: [PATCH] Fix coding rule violations (Raphaelle) --- TRD/AliTRDCalibChamberStatus.cxx | 12 ++++++------ TRD/AliTRDCalibChamberStatus.h | 10 +++++----- TRD/AliTRDCalibPadStatus.cxx | 2 +- TRD/AliTRDCalibTask.cxx | 7 +++---- TRD/AliTRDCalibTask.h | 2 -- TRD/AliTRDCalibraExbAltFit.cxx | 5 +++++ TRD/AliTRDCalibraExbAltFit.h | 4 ++-- TRD/AliTRDCalibraVdriftLinearFit.cxx | 4 ++++ TRD/AliTRDPreprocessor.cxx | 16 +++++----------- TRD/AliTRDPreprocessor.h | 6 +++--- TRD/AliTRDPreprocessorOffline.cxx | 24 ++++++++++++------------ 11 files changed, 46 insertions(+), 46 deletions(-) diff --git a/TRD/AliTRDCalibChamberStatus.cxx b/TRD/AliTRDCalibChamberStatus.cxx index 8f90aca69ea..3dde09eec72 100644 --- a/TRD/AliTRDCalibChamberStatus.cxx +++ b/TRD/AliTRDCalibChamberStatus.cxx @@ -266,7 +266,7 @@ void AliTRDCalibChamberStatus::Init() } //_____________________________________________________________________ -void AliTRDCalibChamberStatus::ProcessTrack(AliTRDtrackV1 * trdTrack) +void AliTRDCalibChamberStatus::ProcessTrack(const AliTRDtrackV1 * trdTrack) { // // Track Processing to get half chamber status @@ -482,7 +482,7 @@ void AliTRDCalibChamberStatus::AnalyseHisto(Int_t limit, Double_t chamberlimit) } //_____________________________________________________________________ -void AliTRDCalibChamberStatus::CheckEORStatus(AliTRDCalDCSv2 *calDCS) /*FOLD00*/ +void AliTRDCalibChamberStatus::CheckEORStatus(const AliTRDCalDCSv2 *calDCS) /*FOLD00*/ { // // Correct the AliTRDCalChamberStatus according to the AliTRDCalDCSv2 @@ -557,8 +557,8 @@ void AliTRDCalibChamberStatus::CheckEORStatus(AliTRDCalDCSv2 *calDCS) /*FOLD00*/ //--------------------------------------- // Change the status according to DCS //--------------------------------------- - Int_t StatusData = fCalChamberStatus->GetStatus(det); - switch(StatusData) + Int_t statusData = fCalChamberStatus->GetStatus(det); + switch(statusData) { case 1: if(stateA==0 && stateB==0) fCalChamberStatus->SetStatus(det,2); // completely masked from DCS @@ -588,7 +588,7 @@ void AliTRDCalibChamberStatus::CheckEORStatus(AliTRDCalDCSv2 *calDCS) /*FOLD00*/ } //_____________________________________________________________________________________ -void AliTRDCalibChamberStatus::Add(AliTRDCalibChamberStatus *calibChamberStatus) /*FOLD00*/ +void AliTRDCalibChamberStatus::Add(const AliTRDCalibChamberStatus *calibChamberStatus) /*FOLD00*/ { // // Add the THnSparseI of this calibChamberStatus @@ -654,7 +654,7 @@ TH2D* AliTRDCalibChamberStatus::PlotSparseI(Int_t sm,Int_t side) } //_____________________________________________________________________ -TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(AliTRDCalDCSv2 *calDCS, Int_t sm, Int_t pl) /*FOLD00*/ +TH2F *AliTRDCalibChamberStatus::MakeHisto2DSmPlEORStatus(const AliTRDCalDCSv2 *calDCS, Int_t sm, Int_t pl) /*FOLD00*/ { // // Plot globale state of the HalfChamberMerger (HCM) diff --git a/TRD/AliTRDCalibChamberStatus.h b/TRD/AliTRDCalibChamberStatus.h index 1f215d4f643..dc5fe91e10c 100644 --- a/TRD/AliTRDCalibChamberStatus.h +++ b/TRD/AliTRDCalibChamberStatus.h @@ -38,14 +38,14 @@ public: AliTRDCalibChamberStatus& operator = (const AliTRDCalibChamberStatus &source); - void ProcessTrack(AliTRDtrackV1 * trdTrack); + void ProcessTrack(const AliTRDtrackV1 * trdTrack); void ProcessEvent(AliRawReader *rawReader, Int_t nevents_physics); void Init(); void AnalyseHisto(Int_t limit=200, Double_t chamberlimit=0.05); - void CheckEORStatus(AliTRDCalDCSv2 *calDCS); + void CheckEORStatus(const AliTRDCalDCSv2 *calDCS); - void Add(AliTRDCalibChamberStatus *calibChamberStatus); + void Add(const AliTRDCalibChamberStatus *calibChamberStatus); Int_t GetNumberEventNotEmpty() const { return fCounterEventNotEmpty; }; @@ -66,7 +66,7 @@ public: // Plot TH2D *PlotSparseI(Int_t sm, Int_t side); // Plot fStatus for sm - TH2F *MakeHisto2DSmPlEORStatus(AliTRDCalDCSv2 *calDCS, Int_t sm, Int_t pl); + TH2F *MakeHisto2DSmPlEORStatus(const AliTRDCalDCSv2 *calDCS, Int_t sm, Int_t pl); TCanvas *PlotHistos2DSmEORStatus(AliTRDCalDCSv2 *calDCS,Int_t sm, const Char_t *name); // Debug @@ -88,7 +88,7 @@ public: THnSparseI *fHnSparseDebug; // THnSparse for half chambers satuts THnSparseI *fHnSparseMCM; // THnSparse for DCS MCM status - TCanvas *fC1; + TCanvas *fC1; // Canvas to plot Short_t fDebugLevel; // Flag for debugging diff --git a/TRD/AliTRDCalibPadStatus.cxx b/TRD/AliTRDCalibPadStatus.cxx index 832e64009c8..1ca1365cf83 100644 --- a/TRD/AliTRDCalibPadStatus.cxx +++ b/TRD/AliTRDCalibPadStatus.cxx @@ -655,7 +655,7 @@ AliTRDCalPadStatus* AliTRDCalibPadStatus::CreateCalPadStatus() // bridge if previous pad found something if(!pb) { - if((meanprevious == mean) && (rmsprevious == rms) && (mean > 0.0001)) { + if((TMath::Abs(meanprevious-mean)<0.000001) && (TMath::Abs(rmsprevious-rms)<0.000001) && (mean > 0.0001)) { //printf("mean previous %f, mean %f, rms %f, rmsprevious %f, col %d\n",meanprevious,mean,rms,rmsprevious,icol); calROC->SetStatus(icol -1 ,irow, AliTRDCalPadStatus::kPadBridgedRight); calROC->SetStatus(icol ,irow, AliTRDCalPadStatus::kPadBridgedLeft); diff --git a/TRD/AliTRDCalibTask.cxx b/TRD/AliTRDCalibTask.cxx index dc0b5de0585..52aa79fb398 100644 --- a/TRD/AliTRDCalibTask.cxx +++ b/TRD/AliTRDCalibTask.cxx @@ -87,7 +87,6 @@ ClassImp(AliTRDCalibTask) //________________________________________________________________________ AliTRDCalibTask::AliTRDCalibTask(const char *name) : AliAnalysisTaskSE(name), fESD(0), - fESDfriend(0), fkEsdTrack(0), fFriendTrack(0), fCalibObject(0), @@ -165,8 +164,7 @@ ClassImp(AliTRDCalibTask) fSubVersionExBUsed(-1), fCalDetGain(0x0), fMaxEvent(0), - fCounter(0), - fDebug(0) + fCounter(0) { // // Default constructor @@ -180,6 +178,7 @@ ClassImp(AliTRDCalibTask) fNrphi[1] = 0; fNrphi[2] = 0; + // Define input and output slots here // Input slot #0 works with a TChain DefineInput(0, TChain::Class()); @@ -1326,7 +1325,7 @@ Bool_t AliTRDCalibTask::SetVersionSubversion(){ // Load Chamber Gain factors into the Tender supply // - printf("SetVersionSubversion\n"); + //printf("SetVersionSubversion\n"); //find previous entry from the UserInfo TTree *tree=((TChain*)GetInputData(0))->GetTree(); diff --git a/TRD/AliTRDCalibTask.h b/TRD/AliTRDCalibTask.h index 7bc07dc7063..c7f615e3f82 100644 --- a/TRD/AliTRDCalibTask.h +++ b/TRD/AliTRDCalibTask.h @@ -105,7 +105,6 @@ class AliTRDCalibTask : public AliAnalysisTaskSE { Bool_t ParticleGood(int i) const; AliESDEvent *fESD; //! ESD object - AliESDfriend *fESDfriend; //! ESD friend const AliESDtrack *fkEsdTrack; //! ESD track AliESDfriendTrack *fFriendTrack; //! ESD friend track TObject *fCalibObject; //! calibration objects attached to the ESD friend @@ -201,7 +200,6 @@ class AliTRDCalibTask : public AliAnalysisTaskSE { Int_t fMaxEvent; // max events Int_t fCounter; // max events - Int_t fDebug; // fDebug AliTRDCalibTask(const AliTRDCalibTask&); AliTRDCalibTask& operator=(const AliTRDCalibTask&); diff --git a/TRD/AliTRDCalibraExbAltFit.cxx b/TRD/AliTRDCalibraExbAltFit.cxx index 051dcdcc5f2..430f43b8196 100644 --- a/TRD/AliTRDCalibraExbAltFit.cxx +++ b/TRD/AliTRDCalibraExbAltFit.cxx @@ -472,6 +472,11 @@ void AliTRDCalibraExbAltFit::FillPEArray2() //_________Helper function__________________________________________________ TGraphErrors* AliTRDCalibraExbAltFit::DrawMS(const TH2 *const h2, Int_t &nEntries) { + // + // Debug function + // + + TF1 fg("fg", "gaus", -10., 30.); TGraphErrors *gp = new TGraphErrors(); diff --git a/TRD/AliTRDCalibraExbAltFit.h b/TRD/AliTRDCalibraExbAltFit.h index 545a1cda927..a96022ed872 100644 --- a/TRD/AliTRDCalibraExbAltFit.h +++ b/TRD/AliTRDCalibraExbAltFit.h @@ -61,8 +61,8 @@ private: TObjArray fFitterEArray; // Array of result errors from fitters for the detectors Bool_t fRobustFit; // Robust fit - TTreeSRedirector *fDebugStreamer; - Short_t fDebugLevel; + TTreeSRedirector *fDebugStreamer; // debug stream + Short_t fDebugLevel; // debug level ClassDef(AliTRDCalibraExbAltFit,2) // Online ExB Calibration diff --git a/TRD/AliTRDCalibraVdriftLinearFit.cxx b/TRD/AliTRDCalibraVdriftLinearFit.cxx index 2ca4dcf4c61..c3d5c5dd02e 100644 --- a/TRD/AliTRDCalibraVdriftLinearFit.cxx +++ b/TRD/AliTRDCalibraVdriftLinearFit.cxx @@ -472,6 +472,10 @@ void AliTRDCalibraVdriftLinearFit::FillPEArray2() //_________Helper function__________________________________________________ TGraphErrors* AliTRDCalibraVdriftLinearFit::DrawMS(const TH2 *const h2, Int_t &nEntries) { + // + // Debug function + // + TF1 fg("fg", "gaus", -10., 30.); TGraphErrors *gp = new TGraphErrors(); diff --git a/TRD/AliTRDPreprocessor.cxx b/TRD/AliTRDPreprocessor.cxx index 7707000ad33..d8e81736d53 100644 --- a/TRD/AliTRDPreprocessor.cxx +++ b/TRD/AliTRDPreprocessor.cxx @@ -99,14 +99,8 @@ AliTRDPreprocessor::~AliTRDPreprocessor() // Destructor // - if (fCalDCSObjSOR != NULL) { - delete fCalDCSObjSOR; - fCalDCSObjSOR =0; - } - if (fCalDCSObjEOR != NULL) { - delete fCalDCSObjEOR; - fCalDCSObjEOR =0; - } + if (fCalDCSObjSOR ) delete fCalDCSObjSOR; + if (fCalDCSObjEOR ) delete fCalDCSObjEOR; } //______________________________________________________________________________________________ @@ -137,8 +131,8 @@ UInt_t AliTRDPreprocessor::Process(TMap* dcsAliasMap) Log(Form("runtype %s\n",runType.Data())); // always process the configuration data - Int_t DCSConfigReturn = ProcessDCSConfigData(); - if(DCSConfigReturn) return DCSConfigReturn; + Int_t dCSConfigReturn = ProcessDCSConfigData(); + if(dCSConfigReturn) return dCSConfigReturn; if (runType=="PEDESTAL"){ if(ExtractPedestals()) return 1; @@ -612,7 +606,7 @@ Bool_t AliTRDPreprocessor::ExtractPedestals() } //__________________________________________________________________ -Bool_t AliTRDPreprocessor::AreThereDataPedestal(AliTRDCalSingleChamberStatus * const calROCStatus +Bool_t AliTRDPreprocessor::AreThereDataPedestal(const AliTRDCalSingleChamberStatus * const calROCStatus , Bool_t second) { diff --git a/TRD/AliTRDPreprocessor.h b/TRD/AliTRDPreprocessor.h index b4174a03700..837c95e8a94 100644 --- a/TRD/AliTRDPreprocessor.h +++ b/TRD/AliTRDPreprocessor.h @@ -44,13 +44,13 @@ class AliTRDPreprocessor : public AliPreprocessor private: - AliTRDCalDCSv2* fCalDCSObjSOR; // - AliTRDCalDCSv2* fCalDCSObjEOR; // + AliTRDCalDCSv2* fCalDCSObjSOR; // calDCS object Start of Run + AliTRDCalDCSv2* fCalDCSObjEOR; // calDCS object End of Run Bool_t fVdriftHLT; // HLT Vdrift UInt_t ProcessDCSConfigData(); // process DCS configuration - Bool_t AreThereDataPedestal(AliTRDCalSingleChamberStatus * const calROCStatus, Bool_t second); + Bool_t AreThereDataPedestal(const AliTRDCalSingleChamberStatus * const calROCStatus, Bool_t second); void SetDefaultStatus(AliTRDCalSingleChamberStatus &calROCStatus, Bool_t second); void SetStatus(AliTRDCalSingleChamberStatus &calROCStatus, AliTRDCalSingleChamberStatus *calROCStatusPrevious,Bool_t second); void SetDefaultNoise(AliTRDCalROC &calROCNoise, Bool_t second); diff --git a/TRD/AliTRDPreprocessorOffline.cxx b/TRD/AliTRDPreprocessorOffline.cxx index a21db178c4d..c6ff2d393f8 100644 --- a/TRD/AliTRDPreprocessorOffline.cxx +++ b/TRD/AliTRDPreprocessorOffline.cxx @@ -901,11 +901,11 @@ Bool_t AliTRDPreprocessorOffline::AnalyzeChamberStatus() // // set up AliTRDCalibChamberStatus - AliTRDCalibChamberStatus *ChamberStatus = new AliTRDCalibChamberStatus(); - ChamberStatus->SetSparseI(fSparse); - ChamberStatus->AnalyseHisto(fMinStatsChamberStatus, fMinSingleStatsChamberStatus); + AliTRDCalibChamberStatus *chamberStatus = new AliTRDCalibChamberStatus(); + chamberStatus->SetSparseI(fSparse); + chamberStatus->AnalyseHisto(fMinStatsChamberStatus, fMinSingleStatsChamberStatus); // get AliTRDCalChamberStatus - AliTRDCalChamberStatus *CalChamberStatus = ChamberStatus->GetCalChamberStatus(); + AliTRDCalChamberStatus *calChamberStatus = chamberStatus->GetCalChamberStatus(); // get calibration objects AliTRDCalDet *calDetGain = (AliTRDCalDet *) fCalibObjects->At(kGain); @@ -913,7 +913,7 @@ Bool_t AliTRDPreprocessorOffline::AnalyzeChamberStatus() AliTRDCalDet *calDetExB = (AliTRDCalDet *) fCalibObjects->At(kLorentzLinear); // Check - if((!calDetGain) || (!calDetVDrift) || (!fCH2d) || (!calDetExB) || (!CalChamberStatus)) return kFALSE; + if((!calDetGain) || (!calDetVDrift) || (!fCH2d) || (!calDetExB) || (!calChamberStatus)) return kFALSE; // Gain Double_t gainmean = calDetGain->GetMean(); @@ -950,7 +950,7 @@ Bool_t AliTRDPreprocessorOffline::AnalyzeChamberStatus() Double_t exb = calDetExB->GetValue(idet); - if( (entries<50 && !CalChamberStatus->IsNoData(idet)) || + if( (entries<50 && !calChamberStatus->IsNoData(idet)) || TMath::Abs(gainmean-gain) > (fRMSBadCalibratedGain*gainrms) || TMath::Abs(vdriftmean-vdrift) > (fRMSBadCalibratedVdrift*vdriftrms) || TMath::Abs(exbmean-exb) > (fRMSBadCalibratedExB*exbrms) ) { @@ -960,7 +960,7 @@ Bool_t AliTRDPreprocessorOffline::AnalyzeChamberStatus() //printf(" vdriftmean %f and vdrift %f, vdriftrms %f \n",vdriftmean,vdrift,vdriftrms); //printf(" exbmean %f and exb %f, exbrms %f \n",exbmean,exb,exbrms); - CalChamberStatus->SetStatus(idet,AliTRDCalChamberStatus::kBadCalibrated); + calChamberStatus->SetStatus(idet,AliTRDCalChamberStatus::kBadCalibrated); //counter++; } @@ -974,9 +974,9 @@ Bool_t AliTRDPreprocessorOffline::AnalyzeChamberStatus() Int_t smbadcalib = 0; for(Int_t det = 0; det < 30; det++){ Int_t detector = sm*30+det; - if(CalChamberStatus->IsNoData(detector)) smnodata++; + if(calChamberStatus->IsNoData(detector)) smnodata++; else { - if(CalChamberStatus->IsBadCalibrated(detector)) smbadcalib++; + if(calChamberStatus->IsBadCalibrated(detector)) smbadcalib++; } } fNoData[sm] = smnodata; @@ -989,17 +989,17 @@ Bool_t AliTRDPreprocessorOffline::AnalyzeChamberStatus() // Int_t counter = 0; // for(Int_t det = 0; det < 30; det++){ // Int_t detector = sm*30+det; - // if(CalChamberStatus->IsBadCalibrated(detector)) counter++; + // if(calChamberStatus->IsBadCalibrated(detector)) counter++; // } // if(counter >= 20) { // for(Int_t det = 0; det < 30; det++){ // Int_t detector = sm*30+det; - // CalChamberStatus->SetStatus(detector,AliTRDCalChamberStatus::kGood); + // calChamberStatus->SetStatus(detector,AliTRDCalChamberStatus::kGood); // } // } // } - fCalibObjects->AddAt(CalChamberStatus,kChamberStatus); + fCalibObjects->AddAt(calChamberStatus,kChamberStatus); return kTRUE; } -- 2.39.3