From 389a42fdef951b7975d0009e4760e9dc99f50e56 Mon Sep 17 00:00:00 2001 From: cblume Date: Thu, 29 Oct 2009 21:58:08 +0000 Subject: [PATCH] Fix coding violations --- TRD/AliTRDSaxHandler.cxx | 42 ++++++++------------------ TRD/AliTRDSaxHandler.h | 65 ++++++++++++++++++++-------------------- 2 files changed, 46 insertions(+), 61 deletions(-) diff --git a/TRD/AliTRDSaxHandler.cxx b/TRD/AliTRDSaxHandler.cxx index 8da77435527..76d7be4e699 100644 --- a/TRD/AliTRDSaxHandler.cxx +++ b/TRD/AliTRDSaxHandler.cxx @@ -17,27 +17,27 @@ //////////////////////////////////////////////////////////////////////////// // // -// The SAX XML file handler used in the preprocessor // +// The SAX XML file handler used in the TRD preprocessor // // // -// Author: // +// Authors: // // Frederick Kramer (kramer@ikf.uni-frankfurt.de) // +// Thomas Bird (thomas@thomasbird.com) // // // //////////////////////////////////////////////////////////////////////////// + #include -#include -#include #include - #include "AliLog.h" +#include "Cal/AliTRDCalDCSGTUTgu.h" +#include "Cal/AliTRDCalDCSPTR.h" +#include +#include #include "AliTRDSaxHandler.h" #include "AliTRDgeometry.h" - #include "Cal/AliTRDCalDCS.h" -#include "Cal/AliTRDCalDCSGTUTgu.h" #include "Cal/AliTRDCalDCSFEE.h" -#include "Cal/AliTRDCalDCSPTR.h" #include "Cal/AliTRDCalDCSGTU.h" ClassImp(AliTRDSaxHandler) @@ -70,9 +70,7 @@ AliTRDSaxHandler::AliTRDSaxHandler() ,fSegment(0) ,fBoardInfo(0) { - // // AliTRDSaxHandler default constructor - // fFEEArr->SetOwner(); fPTRArr->SetOwner(); } @@ -105,19 +103,14 @@ AliTRDSaxHandler::AliTRDSaxHandler(const AliTRDSaxHandler &sh) ,fSegment(0) ,fBoardInfo(0) { - // // AliTRDSaxHandler copy constructor - // } //_____________________________________________________________________________ AliTRDSaxHandler &AliTRDSaxHandler::operator=(const AliTRDSaxHandler &sh) { - // // Assignment operator - // if (&sh == this) return *this; - new (this) AliTRDSaxHandler(sh); return *this; } @@ -125,10 +118,7 @@ AliTRDSaxHandler &AliTRDSaxHandler::operator=(const AliTRDSaxHandler &sh) //_____________________________________________________________________________ AliTRDSaxHandler::~AliTRDSaxHandler() { - // // AliTRDSaxHandler destructor - // - if (fFEEArr) { delete fFEEArr; fFEEArr = 0x0; @@ -145,7 +135,6 @@ AliTRDSaxHandler::~AliTRDSaxHandler() delete fCalDCSObj; fCalDCSObj = 0x0; } - } //_____________________________________________________________________________ @@ -159,14 +148,14 @@ AliTRDCalDCS* AliTRDSaxHandler::GetCalDCSObj() } //_____________________________________________________________________________ -void AliTRDSaxHandler::OnStartDocument() +void AliTRDSaxHandler::OnStartDocument() const { // if something should happen right at the beginning of the // XML document, this must happen here } //_____________________________________________________________________________ -void AliTRDSaxHandler::OnEndDocument() +void AliTRDSaxHandler::OnEndDocument() const { // if something should happen at the end of the XML document // this must be done here @@ -176,8 +165,8 @@ void AliTRDSaxHandler::OnEndDocument() bool AliTRDSaxHandler::CompareString(TString str, const char *str2) { // compre strings, ignoring case - return !(bool)str.CompareTo(str2,str.kIgnoreCase); // returns true if they are the same, else false + return !(bool)str.CompareTo(str2,str.kIgnoreCase); } @@ -199,7 +188,6 @@ void AliTRDSaxHandler::OnStartElement(const char *name, const TList *attributes) } if (fSystem == kInsideGTU) { -// cout << "Start: " << tagName << " " << fLevel1Tag << " " << fLevel2Tag << " " << fInsideBoardInfo << "\n"; if (CompareString(tagName, "tgu")) fLevel1Tag = kInsideTgu; if (CompareString(tagName, "board_info")) { fInsideBoardInfo = true; @@ -225,7 +213,6 @@ void AliTRDSaxHandler::OnStartElement(const char *name, const TList *attributes) } else if (fSystem == kInsideFEE) { if (CompareString(tagName, "gaintbl")) fLevel1Tag = kInsideGainTable; } - // set if we are inside rstate // (in principle not necessary - just to be more safe against stupid tags) @@ -322,7 +309,6 @@ void AliTRDSaxHandler::OnStartElement(const char *name, const TList *attributes) } if (fInsideBoardInfo) { -// cout << tagName << ": " << attribName << "=" << attribValue << "\n"; if (CompareString(tagName, "board_info") && CompareString(attribName, "board_id")) fBoardInfo->SetId(attribValue); if (CompareString(tagName, "board_info") && CompareString(attribName, "design_type")) fBoardInfo->SetType(attribValue.Atoi()); if (CompareString(tagName, "board_info") && CompareString(attribName, "pci_ga")) fBoardInfo->SetPciGa(attribValue.Atoi()); @@ -451,8 +437,6 @@ void AliTRDSaxHandler::OnEndElement(const char *name) } if (fSystem == kInsideGTU) { -// cout << "Close: " << tagName << " " << fLevel1Tag << " " << fLevel2Tag << " " << fInsideBoardInfo << "\n"; - // if (CompareString(tagName, "run")) { // fDCSGTUObj->SetSORFlag(TString(fContent(fContent.Length()-1,1)).Atoi()); // fDCSGTUObj->SetRunNumber(TString(fContent(0,fContent.Length()-2)).Atoi()); @@ -505,7 +489,7 @@ void AliTRDSaxHandler::OnCharacters(const char *characters) } //_____________________________________________________________________________ -void AliTRDSaxHandler::OnComment(const char* /*text*/) +void AliTRDSaxHandler::OnComment(const char* /*text*/) const { // comments within the XML file are ignored } @@ -532,7 +516,7 @@ void AliTRDSaxHandler::OnFatalError(const char *text) } //_____________________________________________________________________________ -void AliTRDSaxHandler::OnCdataBlock(const char* /*text*/, Int_t /*len*/) +void AliTRDSaxHandler::OnCdataBlock(const char* /*text*/, Int_t /*len*/) const { // process character data blocks here // not implemented and should not be used here diff --git a/TRD/AliTRDSaxHandler.h b/TRD/AliTRDSaxHandler.h index 8c29dd71153..a9653c29d3a 100644 --- a/TRD/AliTRDSaxHandler.h +++ b/TRD/AliTRDSaxHandler.h @@ -14,19 +14,20 @@ // // //////////////////////////////////////////////////////////////////////////// + #include "TObject.h" #include "Cal/AliTRDCalDCSGTUCtpOpc.h" #include "Cal/AliTRDCalDCSGTUBoardInfo.h" #include "Cal/AliTRDCalDCSGTUSegment.h" -#include "Cal/AliTRDCalDCSGTUTmu.h" +#include "Cal/AliTRDCalDCSGTUTmu.h" class TObjArray; - class AliTRDCalDCS; class AliTRDCalDCSFEE; class AliTRDCalDCSPTR; class AliTRDCalDCSGTU; + class AliTRDSaxHandler : public TObject { public: @@ -58,50 +59,50 @@ public: Int_t GetHandlerStatus() const { return fHandlerStatus; } // functions for all possible events - void OnStartDocument(); - void OnEndDocument(); + void OnStartDocument() const; + void OnEndDocument() const; void OnStartElement(const char *name, const TList *attributes); void OnEndElement(const char *name); void OnCharacters(const char *name); - void OnComment(const char *name); + void OnComment(const char *name) const; void OnWarning(const char *name); void OnError(const char *name); void OnFatalError(const char *name); - void OnCdataBlock(const char *name, Int_t len); + void OnCdataBlock(const char *name, Int_t len) const; private: bool CompareString(TString str, const char *str2); - Int_t fHandlerStatus; // 0: everything OK, >0: error - Int_t fNDCSPTR; // number of current PTR unit (to be abandonned soon) - Int_t fNDCSGTU; // number of current GTU unit (to be abandonned soon) - TObjArray* fFEEArr; // array of AliTRDCalDCSFEE objects - TObjArray* fPTRArr; // array of AliTRDCalDCSPTR objects + Int_t fHandlerStatus; // 0: everything OK, >0: error + Int_t fNDCSPTR; // number of current PTR unit (to be abandonned soon) + Int_t fNDCSGTU; // number of current GTU unit (to be abandonned soon) + TObjArray* fFEEArr; // array of AliTRDCalDCSFEE objects + TObjArray* fPTRArr; // array of AliTRDCalDCSPTR objects // TObjArray* fGTUArr; // array of AliTRDCalDCSGTU objects - Int_t fSystem; // current system (FEE/PTR/GTU) - Int_t fInsideRstate; // if we are inside rstate - Int_t fCurrentSM; // current supermodule - Int_t fCurrentStack; // current stack - Int_t fCurrentROB; // current ROB during processing - Int_t fCurrentMCM; // current MCM - Int_t fCurrentADC; // current ADC - TString fContent; // content of the xml element (text) - AliTRDCalDCSFEE* fDCSFEEObj; // the calib object for one FEE DCS board - AliTRDCalDCSPTR* fDCSPTRObj; // the calib object for one PTR DCS board - AliTRDCalDCSGTU* fDCSGTUObj; // the calib object for one GTU DCS board - AliTRDCalDCS* fCalDCSObj; // the complete calib obj containing all inform. - Int_t fLevel1Tag; // - Int_t fLevel2Tag; // - Bool_t fInsideBoardInfo; - - AliTRDCalDCSGTUTmu* fTmu; - AliTRDCalDCSGTUCtpOpc* fCtpOpc; - AliTRDCalDCSGTUSegment* fSegment; - AliTRDCalDCSGTUBoardInfo* fBoardInfo; + Int_t fSystem; // current system (FEE/PTR/GTU) (while parsing) + Int_t fInsideRstate; // if we are inside rstate (while parsing) + Int_t fCurrentSM; // current supermodule (while parsing) + Int_t fCurrentStack; // current stack (while parsing) + Int_t fCurrentROB; // current ROB (while parsing) + Int_t fCurrentMCM; // current MCM (while parsing) + Int_t fCurrentADC; // current ADC (while parsing) + TString fContent; // content of the xml element (text) + AliTRDCalDCSFEE* fDCSFEEObj; // the calib object for one FEE DCS board + AliTRDCalDCSPTR* fDCSPTRObj; // the calib object for one PTR DCS board + AliTRDCalDCSGTU* fDCSGTUObj; // the calib object for one GTU DCS board + AliTRDCalDCS* fCalDCSObj; // the complete calib obj containing all info + Int_t fLevel1Tag; // 1st level in XML (while parsing) + Int_t fLevel2Tag; // 2nd level in XML (while parsing) + Bool_t fInsideBoardInfo; // if we are inside BoardInfo (while parsing) + + AliTRDCalDCSGTUTmu* fTmu; // GTU calibration data: pattern generator + AliTRDCalDCSGTUCtpOpc* fCtpOpc; // GTU calibration data: OPC + AliTRDCalDCSGTUSegment* fSegment; // GTU calibration data: SMU tracklets/tracks/triggers + AliTRDCalDCSGTUBoardInfo* fBoardInfo; // GTU calibration data: hard-/software and type - ClassDef(AliTRDSaxHandler,2); // The XML file handler for the preprocessor + ClassDef(AliTRDSaxHandler,2); // The XML file handler for the preprocessor }; #endif -- 2.43.0