]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFNoiseConfigHandler.cxx
some coverity fixes
[u/mrichter/AliRoot.git] / TOF / AliTOFNoiseConfigHandler.cxx
index caac1aa8a0feaefd730dbeb6b5f357aa59c6f1c1..f0e05ae648fb555fc4cf866598384ecb13aba5cf 100644 (file)
-/*************************************************************************\r
- * * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *\r
- * *                                                                        *\r
- * * Author: The ALICE Off-line Project.                                    *\r
- * * Contributors are mentioned in the code where appropriate.              *\r
- * *                                                                        *\r
- * * Permission to use, copy, modify and distribute this software and its   *\r
- * * documentation strictly for non-commercial purposes is hereby granted   *\r
- * * without fee, provided that the above copyright notice appears in all   *\r
- * * copies and that both the copyright notice and this permission notice   *\r
- * * appear in the supporting documentation. The authors make no claims     *\r
- * * about the suitability of this software for any purpose. It is          *\r
- * * provided "as is" without express or implied warranty.                  *\r
- * **************************************************************************/\r
-\r
-////////////////////////////////////////////////////////////////////////////\r
-//                                                                        //\r
-//  The SAX XML file handler used in the TOFnoiseda                       //\r
-//                                                                        //\r
-//  Author:                                                               //\r
-//    Chiara Zampolli (Chiara.Zampolli@cern.ch)                           //\r
-//                                                                        //\r
-////////////////////////////////////////////////////////////////////////////\r
-\r
-#include <cstdlib>\r
-#include <Riostream.h>\r
-\r
-#include <TList.h>\r
-#include <TObject.h>\r
-#include <TXMLAttr.h>\r
-#include <TSAXParser.h>\r
-\r
-#include "AliLog.h"\r
-#include "AliTOFNoiseConfigHandler.h"\r
-\r
-ClassImp(AliTOFNoiseConfigHandler)\r
-\r
-  \r
-//_____________________________________________________________________________\r
-AliTOFNoiseConfigHandler::AliTOFNoiseConfigHandler()\r
-       :TObject(),\r
-        fDebugFlag(0)\r
-{\r
-       //\r
-       // AliTOFNoiseConfigHandler default constructor\r
-       //\r
-}\r
-\r
-//_____________________________________________________________________________\r
-AliTOFNoiseConfigHandler::AliTOFNoiseConfigHandler(const AliTOFNoiseConfigHandler &sh)\r
-       :TObject(sh),\r
-        fDebugFlag(sh.fDebugFlag)\r
-{\r
-       //\r
-       // AliTOFNoiseConfigHandler copy constructor\r
-       //\r
-}\r
-\r
-//_____________________________________________________________________________\r
-AliTOFNoiseConfigHandler &AliTOFNoiseConfigHandler::operator=(const AliTOFNoiseConfigHandler &sh)\r
-{\r
-       //\r
-       // Assignment operator\r
-       //\r
-       if (&sh == this) return *this;\r
-       \r
-       new (this) AliTOFNoiseConfigHandler(sh);\r
-       return *this;\r
-}\r
-\r
-//_____________________________________________________________________________\r
-AliTOFNoiseConfigHandler::~AliTOFNoiseConfigHandler()\r
-{\r
-       //\r
-       // AliTOFNoiseConfigHandler destructor\r
-       //      \r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliTOFNoiseConfigHandler::OnStartDocument()\r
-{\r
-       // if something should happen right at the beginning of the\r
-       // XML document, this must happen here\r
-       AliInfo("Reading XML file for TOFnoiseda Config");\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliTOFNoiseConfigHandler::OnEndDocument()\r
-{\r
-       // if something should happen at the end of the XML document\r
-       // this must be done here\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliTOFNoiseConfigHandler::OnStartElement(const char *name, const TList *attributes)\r
-{\r
-       // when a new XML element is found, it is processed here\r
-\r
-       // set the current system if necessary\r
-       TString strName(name);\r
-       AliDebug(2,Form("name = %s",strName.Data()));\r
-       TXMLAttr* attr;\r
-       TIter next(attributes);\r
-       while ((attr = (TXMLAttr*) next())) {\r
-               TString attrName = attr->GetName();\r
-               AliDebug(2,Form("Name = %s",attrName.Data())); \r
-               if (attrName == "DebugFlag"){\r
-                       TString debugFlag = (TString)(attr->GetValue());\r
-                       if (debugFlag == "ON" || debugFlag == "On" || debugFlag == "on"){       \r
-                               fDebugFlag = 1;\r
-                       }\r
-                       else if (debugFlag == "OFF" || debugFlag == "Off"|| debugFlag == "off"){\r
-                               fDebugFlag = 0;\r
-                       }\r
-                       else {\r
-                               AliWarning("Invalid Debug Flag. Keeping debug off");\r
-                               fDebugFlag = 0;\r
-                       }\r
-               }\r
-       }       \r
-       AliDebug(2,Form("Debug Flag = %i",fDebugFlag)); \r
-       return;\r
-}\r
-//_____________________________________________________________________________\r
-void AliTOFNoiseConfigHandler::OnEndElement(const char *name)\r
-{\r
-       // do everything that needs to be done when an end tag of an element is found\r
-       TString strName(name);\r
-       AliDebug(2,Form("name = %s",strName.Data()));\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliTOFNoiseConfigHandler::OnCharacters(const char *characters)\r
-{\r
-       // copy the text content of an XML element\r
-       //fContent = characters;\r
-       TString strCharacters(characters);\r
-       AliDebug(2,Form("characters = %s",strCharacters.Data()));\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliTOFNoiseConfigHandler::OnComment(const char* /*text*/)\r
-{\r
-       // comments within the XML file are ignored\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliTOFNoiseConfigHandler::OnWarning(const char *text)\r
-{\r
-       // process warnings here\r
-       AliInfo(Form("Warning: %s",text));\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliTOFNoiseConfigHandler::OnError(const char *text)\r
-{\r
-       // process errors here\r
-       AliError(Form("Error: %s",text));\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliTOFNoiseConfigHandler::OnFatalError(const char *text)\r
-{\r
-       // process fatal errors here\r
-       AliFatal(Form("Fatal error: %s",text));\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliTOFNoiseConfigHandler::OnCdataBlock(const char* /*text*/, Int_t /*len*/)\r
-{\r
-       // process character data blocks here\r
-       // not implemented and should not be used here\r
-}\r
-\r
+/*************************************************************************
+ * * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
+ * *                                                                        *
+ * * Author: The ALICE Off-line Project.                                    *
+ * * Contributors are mentioned in the code where appropriate.              *
+ * *                                                                        *
+ * * Permission to use, copy, modify and distribute this software and its   *
+ * * documentation strictly for non-commercial purposes is hereby granted   *
+ * * without fee, provided that the above copyright notice appears in all   *
+ * * copies and that both the copyright notice and this permission notice   *
+ * * appear in the supporting documentation. The authors make no claims     *
+ * * about the suitability of this software for any purpose. It is          *
+ * * provided "as is" without express or implied warranty.                  *
+ * **************************************************************************/
+
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  The SAX XML file handler used in the TOFnoiseda                       //
+//                                                                        //
+//  Author:                                                               //
+//    Chiara Zampolli (Chiara.Zampolli@cern.ch)                           //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
+
+#include <cstdlib>
+#include <Riostream.h>
+
+#include <TList.h>
+#include <TObject.h>
+#include <TXMLAttr.h>
+#include <TSAXParser.h>
+
+#include "AliLog.h"
+#include "AliTOFNoiseConfigHandler.h"
+
+ClassImp(AliTOFNoiseConfigHandler)
+
+  
+//_____________________________________________________________________________
+AliTOFNoiseConfigHandler::AliTOFNoiseConfigHandler()
+       :TObject(),
+        fDebugFlag(0)
+{
+       //
+       // AliTOFNoiseConfigHandler default constructor
+       //
+}
+
+//_____________________________________________________________________________
+AliTOFNoiseConfigHandler::AliTOFNoiseConfigHandler(const AliTOFNoiseConfigHandler &sh)
+       :TObject(sh),
+        fDebugFlag(sh.fDebugFlag)
+{
+       //
+       // AliTOFNoiseConfigHandler copy constructor
+       //
+}
+
+//_____________________________________________________________________________
+AliTOFNoiseConfigHandler &AliTOFNoiseConfigHandler::operator=(const AliTOFNoiseConfigHandler &sh)
+{
+       //
+       // Assignment operator
+       //
+       if (&sh == this) return *this;
+       
+       new (this) AliTOFNoiseConfigHandler(sh);
+       return *this;
+}
+
+//_____________________________________________________________________________
+AliTOFNoiseConfigHandler::~AliTOFNoiseConfigHandler()
+{
+       //
+       // AliTOFNoiseConfigHandler destructor
+       //      
+}
+
+//_____________________________________________________________________________
+void AliTOFNoiseConfigHandler::OnStartDocument()
+{
+       // if something should happen right at the beginning of the
+       // XML document, this must happen here
+       AliInfo("Reading XML file for TOFnoiseda Config");
+}
+
+//_____________________________________________________________________________
+void AliTOFNoiseConfigHandler::OnEndDocument()
+{
+       // if something should happen at the end of the XML document
+       // this must be done here
+}
+
+//_____________________________________________________________________________
+void AliTOFNoiseConfigHandler::OnStartElement(const char *name, const TList *attributes)
+{
+       // when a new XML element is found, it is processed here
+
+       // set the current system if necessary
+       TString strName(name);
+       AliDebug(2,Form("name = %s",strName.Data()));
+       TXMLAttr* attr;
+       TIter next(attributes);
+       while ((attr = (TXMLAttr*) next())) {
+               TString attrName = attr->GetName();
+               AliDebug(2,Form("Name = %s",attrName.Data())); 
+               if (attrName == "DebugFlag"){
+                       TString debugFlag = (TString)(attr->GetValue());
+                       if (debugFlag == "ON" || debugFlag == "On" || debugFlag == "on"){       
+                               fDebugFlag = 1;
+                       }
+                       else if (debugFlag == "OFF" || debugFlag == "Off"|| debugFlag == "off"){
+                               fDebugFlag = 0;
+                       }
+                       else {
+                               AliWarning("Invalid Debug Flag. Keeping debug off");
+                               fDebugFlag = 0;
+                       }
+               }
+       }       
+       AliDebug(2,Form("Debug Flag = %i",fDebugFlag)); 
+       return;
+}
+//_____________________________________________________________________________
+void AliTOFNoiseConfigHandler::OnEndElement(const char *name)
+{
+       // do everything that needs to be done when an end tag of an element is found
+       TString strName(name);
+       AliDebug(2,Form("name = %s",strName.Data()));
+}
+
+//_____________________________________________________________________________
+void AliTOFNoiseConfigHandler::OnCharacters(const char *characters)
+{
+       // copy the text content of an XML element
+       //fContent = characters;
+       TString strCharacters(characters);
+       AliDebug(2,Form("characters = %s",strCharacters.Data()));
+}
+
+//_____________________________________________________________________________
+void AliTOFNoiseConfigHandler::OnComment(const char* /*text*/)
+{
+       // comments within the XML file are ignored
+}
+
+//_____________________________________________________________________________
+void AliTOFNoiseConfigHandler::OnWarning(const char *text)
+{
+       // process warnings here
+       AliInfo(Form("Warning: %s",text));
+}
+
+//_____________________________________________________________________________
+void AliTOFNoiseConfigHandler::OnError(const char *text)
+{
+       // process errors here
+       AliError(Form("Error: %s",text));
+}
+
+//_____________________________________________________________________________
+void AliTOFNoiseConfigHandler::OnFatalError(const char *text)
+{
+       // process fatal errors here
+       AliFatal(Form("Fatal error: %s",text));
+}
+
+//_____________________________________________________________________________
+void AliTOFNoiseConfigHandler::OnCdataBlock(const char* /*text*/, Int_t /*len*/)
+{
+       // process character data blocks here
+       // not implemented and should not be used here
+}
+