Commits

ca...@4525493e-7705-40b1-a816-d608a930855b  committed 41353d7

OBO Thomas, src/UserDataSvc.cxx: protect DEBUG printouts

  • Participants
  • Parent commits 5790f30

Comments (0)

Files changed (2)

+2012-03-02  Paolo Calafiura for Thomas Kittelmann
+
+	* tagging AthenaServices-01-56-02
+	* src/UserDataSvc.cxx: protect DEBUG printouts 
+
 2012-03-02  Sebastien Binet  <sebastien.binet@cern.ch>
 
 	* tagging AthenaServices-01-56-01

File src/UserDataSvc.cxx

     StatusCode sc = theAlgMgr.retrieve();
 
     if (sc.isSuccess()) {
-      msg() << MSG::DEBUG << "Got Alg Mgr " << theAlgMgr << endreq;
+      ATH_MSG_DEBUG("Got Alg Mgr " << theAlgMgr);
     } else {
       msg() << MSG::FATAL << "Can't Get Alg Mgr " << theAlgMgr << endreq;
       throw GaudiException("Unable to get Algorithm Mgr", name(), sc);
 
   sc = this->service("THistSvc", m_propTHistSvc, false);
   if (!sc.isSuccess()) {
-    msg() << MSG::DEBUG
-        << "Could not retrieve IProperty Interface to 'THistSvc' " << sc
-        << endreq;
+    ATH_MSG_DEBUG("Could not retrieve IProperty Interface to 'THistSvc' " << sc);
     return StatusCode::FAILURE;
   }
 
   if ( ! m_doMerge )
      m_doRead = true;
 
-  msg() << MSG::DEBUG << "Doing Write = " << m_outputstreamname.value()
-      << endreq;
+  ATH_MSG_DEBUG("Doing Write = " << m_outputstreamname.value());
 
   if (m_outputStream && m_outputstreamname.value() != "none") {
 
-    msg() << MSG::DEBUG << "Doing Write = " << m_outputStream->m_outputName
-        << endreq;
+    ATH_MSG_DEBUG("Doing Write = " << m_outputStream->m_outputName);
     m_doWrite = true;
     m_doWriteTransient = true;
   }
     if (0 == gROOT) {
       static TROOT root("root", "ROOT I/O");
       //    gDebug = 99;
-      msg() << MSG::DEBUG << "ROOT not initialized, debug = " << gDebug
-          << endreq;
+      ATH_MSG_DEBUG("ROOT not initialized, debug = " << gDebug);
 
     }
     else {
-      msg() << MSG::DEBUG << "ROOT already initialized, debug = " << gDebug
-          << endreq;
+      ATH_MSG_DEBUG("ROOT already initialized, debug = " << gDebug);
     }
   }
   return StatusCode::SUCCESS;
 UserDataSvc::handle(const Incident &inc) {
 
   if (inc.type() == "BeginEvent") {
-    msg() << MSG::DEBUG << "UserDataSvc::BeginEvent" << endreq;
+    ATH_MSG_DEBUG("UserDataSvc::BeginEvent");
 
     const EventInfo* evt = 0;
     StatusCode sc = eventStore()->retrieve(evt);
     m_currRunNumber = evt->event_ID()->run_number();
     m_currEventNumber = evt->event_ID()->event_number();
 
-    msg() << MSG::DEBUG << "Run:" << m_currRunNumber << " Event:"
-        << m_currEventNumber << endreq;
+    ATH_MSG_DEBUG("Run:" << m_currRunNumber << " Event:" << m_currEventNumber);
 
     if (m_doWriteTransient) {
 
 
   }
   else if (inc.type() == "EndEvent") {
-    msg() << MSG::DEBUG << "UserDataSvc::EndEvent" << endreq;
-    //msg()<<MSG::DEBUG<<m_outputStream->name()<<endreq;
-    //msg()<<MSG::DEBUG<<m_outputStream->m_outputName<<endreq;
-    //msg() << MSG::DEBUG << "m_doWrite="<<m_doWrite << endreq;
+    ATH_MSG_DEBUG( "UserDataSvc::EndEvent");
+    //ATH_MSG_DEBUG(m_outputStream->name());
+    //ATH_MSG_DEBUG(m_outputStream->m_outputName);
+    //ATH_MSG_DEBUG("m_doWrite="<<m_doWrite);
 
     if (m_doWrite && m_outputStream) {
       if (m_outputStream->isEventAccepted()) {
-        msg() << MSG::INFO << "Event Accepted, saving decorations" << endreq;
-
-	msg() << MSG::DEBUG << "#of Entries in the ElTree "
-	      << m_el_tree->GetEntries() 
-	      << " m_el_curevent_begin="<< m_el_curevent_begin 
-	      << " m_el_curevent_end="<< m_el_curevent_end 
-	      << endreq;
+        ATH_MSG_INFO("Event Accepted, saving decorations");
+
+	ATH_MSG_DEBUG("#of Entries in the ElTree "
+		      << m_el_tree->GetEntries() 
+		      << " m_el_curevent_begin="<< m_el_curevent_begin 
+		      << " m_el_curevent_end="<< m_el_curevent_end );
 	
         //Element Level
 
         for (std::vector<ElDataEntry>::size_type it = 0; it
             < m_el_decodata.size(); it++) {
 
-          msg() << MSG::DEBUG << "\t" << it << "\t"
-		<< m_el_decodata[it].m_label << "\t" << std::hex
-		<< m_el_decodata[it].m_abc << "\t"
-		<< m_el_decodata[it].m_object.Address() << "\t" << endreq;
+          ATH_MSG_DEBUG("\t" << it << "\t"
+			<< m_el_decodata[it].m_label << "\t" << std::hex
+			<< m_el_decodata[it].m_abc << "\t"
+			<< m_el_decodata[it].m_object.Address() << "\t");
 	  
           std::string *labelstr = &(m_el_decodata[it].m_label);
           TBufferFile *buf = objectToStream(m_el_decodata[it].m_object); //need delete
         }
 	
         if (m_el_curevent_end < m_el_curevent_begin) {//no decoration for this event
-	  msg() << MSG::DEBUG << "No decoration for this event"<<endreq;
+	  ATH_MSG_DEBUG("No decoration for this event");
         }
         else {
-	  msg() << MSG::DEBUG << "Yes decoration for this event"<<endreq;	  
+	  ATH_MSG_DEBUG("Yes decoration for this event");	  
         }
 
         if (!(decorateEvent("ElDecoBegin", m_el_curevent_begin)).isSuccess()) {
             void **addr = 0;
             if (m_numbersetinthisevent[i]) {//use new address
               addr = m_number2address[i];
-              msg() << MSG::DEBUG << "UserDataSvc::EndEvent:UseNewAddress"
-                  << endreq;
+              ATH_MSG_DEBUG("UserDataSvc::EndEvent:UseNewAddress");
             }
             else {//use default address
               addr = m_number2defaultaddress[i];
-              msg() << MSG::DEBUG << "UserDataSvc::EndEvent:UseDefaultAddress"
-                  << endreq;
+              ATH_MSG_DEBUG("UserDataSvc::EndEvent:UseDefaultAddress");
             }
 
             if (m_numberissimpletype[i]) {
   }
   else if (inc.type() == "BeginRun") {
     //Todos On the BeginRun Incident
-    msg() << MSG::DEBUG << "UserDataSvc::BeginRun" << endreq;
+    ATH_MSG_DEBUG("UserDataSvc::BeginRun");
   }
   else if (inc.type() == "EndRun") {
-    msg() << MSG::DEBUG << "UserDataSvc::EndRun" << endreq;
+    ATH_MSG_DEBUG("UserDataSvc::EndRun");
     if (m_doMerge)
       SaveAssociations();
 
           void **addr = 0;
           if (m_numbersetinthisevent[i]) {//use new address
             addr = m_number2address[i];
-            msg() << MSG::DEBUG << "UserDataSvc::EndEvent:UseNewAddress"
-                << endreq;
+            ATH_MSG_DEBUG("UserDataSvc::EndEvent:UseNewAddress");
           }
           else {//use default address
             addr = m_number2defaultaddress[i];
-            msg() << MSG::DEBUG << "UserDataSvc::EndEvent:UseDefaultAddress"
-                << endreq;
+            ATH_MSG_DEBUG("UserDataSvc::EndEvent:UseDefaultAddress");
           }
 
           if (m_numberissimpletype[i]) {
     }
   }
   else if (inc.type() == "BeginInputFile") {
-    msg() << MSG::DEBUG << "UserDataSvc::BeginInputFile" << endreq;
+    ATH_MSG_DEBUG("UserDataSvc::BeginInputFile");
     if (m_doRead || m_doMerge) {
       const FileIncident* fileInc = dynamic_cast<const FileIncident*> (&inc);
       if (fileInc == 0) {
             << " Unable to get FileName from BeginInputFile incident" << endreq;
         return;
       }
-      msg() << MSG::DEBUG << "UserDataSvc::BeginInputFile::Filename:" << fileInc->fileName() << endreq;
+      ATH_MSG_DEBUG("UserDataSvc::BeginInputFile::Filename:" << fileInc->fileName());
 
       //FIXME: THistSvc will not close the files
       m_r_inputfilename = fileInc->fileName();
     }
   }
   else if (inc.type() == "EndInputFile") {
-    msg() << MSG::DEBUG << "UserDataSvc::EndInputFile" << endreq;
+    ATH_MSG_DEBUG("UserDataSvc::EndInputFile");
     if (m_doRead) {
       const FileIncident* fileInc = dynamic_cast<const FileIncident*> (&inc);
       if (fileInc == 0) {
             << " Unable to get FileName from EndInputFile incident" << endreq;
         return;
       }
-      msg() << MSG::DEBUG << "UserDataSvc::Filename:" << fileInc->fileName() << endreq;
+      ATH_MSG_DEBUG("UserDataSvc::Filename:" << fileInc->fileName());
     }
   }
   else if (inc.type() == "BeginTagFile") {
-    msg() << MSG::DEBUG << "UserDataSvc::BeginTagFile" << endreq;
+    ATH_MSG_DEBUG("UserDataSvc::BeginTagFile");
     if (m_doRead) {
       const FileIncident* fileInc = dynamic_cast<const FileIncident*> (&inc);
       if (fileInc == 0) {
             << endreq;
         return;
       }
-      msg() << MSG::DEBUG << "UserDataSvc::Filename:" << fileInc->fileName() << endreq;
+      ATH_MSG_DEBUG("UserDataSvc::Filename:" << fileInc->fileName());
     }
   }
   else if (inc.type() == "EndTagFile") {
-    msg() << MSG::DEBUG << "UserDataSvc::EndTagFile" << endreq;
+    ATH_MSG_DEBUG("UserDataSvc::EndTagFile");
     if (m_doRead) {
       const FileIncident* fileInc = dynamic_cast<const FileIncident*> (&inc);
       if (fileInc == 0) {
             << endreq;
         return;
       }
-      msg() << MSG::DEBUG << "UserDataSvc::Filename:" << fileInc->fileName() << endreq;
+      ATH_MSG_DEBUG("UserDataSvc::Filename:" << fileInc->fileName());
     }
   }
 }
   if (m_doMerge)
     return 0;
 
-  msg() << MSG::DEBUG << "UserDataSvc::vdecorate:" << "\tlabel=" << lab
-      << "\ttype_info.name()=" << decoinfo.name() << "\tdeco=" << deco
-      << "\tdefaultobj=" << defaultobj << "\tlevel=" << level << "\tclid="
-      << clid << "\tkey=" << key << endreq;
+  ATH_MSG_DEBUG("UserDataSvc::vdecorate:" << "\tlabel=" << lab
+		<< "\ttype_info.name()=" << decoinfo.name() << "\tdeco=" << deco
+		<< "\tdefaultobj=" << defaultobj << "\tlevel=" << level << "\tclid="
+		<< clid << "\tkey=" << key);
 
   //Check if in the writing mode
   if (!m_doWriteTransient) {
     return -1;
   }
   std::string demangledname(str);
-  msg() << MSG::DEBUG << "UserDataSvc::dis-mangled name:" << demangledname
-      << endreq;
+  ATH_MSG_DEBUG("UserDataSvc::dis-mangled name:" << demangledname);
   free (str);
 
   std::vector<UserDataAssociation>::size_type mynumber;
 
   //generate a label for this decoration
   std::string label = GenerateLabel(lab, level, clid, key);
-  msg() << MSG::DEBUG << "UserDataSvc::decorate:GeneratedLabel=" << label
-      << endreq;
+  ATH_MSG_DEBUG("UserDataSvc::decorate:GeneratedLabel=" << label);
 
   TTree *treelevel =
       ((level == UserDataAssociation::FILE) ? m_fileleveluserdatatree
     if (m_infirstevent) {
       //See if deco is one of the simple types
       if (!IsSimpleType(decoinfo)) {// not simple type
-        msg() << MSG::DEBUG << "UserDataSvc::not simple type:" << demangledname
-            << endreq;
+        ATH_MSG_DEBUG("UserDataSvc::not simple type:" << demangledname);
 
         //see if the class can be obtained by TClass
         TClass *cl = TClass::GetClass(demangledname.c_str());
         if (cl) { //Class definition found, can be added to TTree
-          msg() << MSG::DEBUG << "UserDataSvc::FIND CLASS:" << demangledname
-              << endreq;
+          ATH_MSG_DEBUG("UserDataSvc::FIND CLASS:" << demangledname);
           void **defaultaddr = new void*((void*) defaultobj);
           void **addr = new void*((void*) deco);
 
               defaultaddr);//, 32000, 0); //Do not split it
 
           if (!mybranch) {
-            msg() << MSG::DEBUG << "Can't call bronch" << endreq;
+            ATH_MSG_DEBUG("Can't call bronch");
           }
 
           int result =
       }
       else { //Is simple type
         std::string rootstr(GetSimpleTypeString(label, decoinfo));
-        msg() << MSG::DEBUG << "Adding simple type:" << rootstr.c_str()
-            << endreq;
+        ATH_MSG_DEBUG("Adding simple type:" << rootstr.c_str());
         //FIXME: catch exceptions of branch
 
         void **defaultaddr = new void*((void*) defaultobj);
             rootstr.c_str());
 
         if (!mybranch) {
-          msg() << MSG::DEBUG << "Can't call Branch" << endreq;
+          ATH_MSG_DEBUG("Can't call Branch");
         }
 
         int result = CreateAssociation(label, level, demangledname, key, clid);
     }
   }
   else { //label already exist
-    msg() << MSG::DEBUG << "Label exist:" << label << endreq;
+    ATH_MSG_DEBUG("Label exist:" << label);
 
     mynumber = itr->second;
 
     if (m_numberissimpletype[mynumber]) {// simple type
-      msg() << MSG::DEBUG << "Simple type:"
-          << m_associations[mynumber].getLongType() << endreq;
+      ATH_MSG_DEBUG("Simple type:"
+		    << m_associations[mynumber].getLongType());
     }
     else {// complex type
-      msg() << MSG::DEBUG << "Complex type:"
-          << m_associations[mynumber].getLongType() << endreq;
+      ATH_MSG_DEBUG("Complex type:"
+		    << m_associations[mynumber].getLongType());
     }
 
     if (m_associations[mynumber].getLongType() != demangledname) {
 
       m_numbersetinthisevent[mynumber] = true;
 
-      msg() << MSG::DEBUG << "Label Exists, address updated. Label=" << label
-          << endreq;
+      ATH_MSG_DEBUG("Label Exists, address updated. Label=" << label);
 
       return 0;
     }
 
   std::string label = GenerateLabel(lab, level, clid, key);
 
-  msg() << MSG::DEBUG << "UserDataSvc::vgetDecoration('" << label << "','"
-      << demangledname << "')" << endreq;
-
-  msg() << MSG::DEBUG << "Demangled name=" << demangledname
-      << "\ttypeid.name()" << decoinfo.name() << endreq;
+  ATH_MSG_DEBUG("UserDataSvc::vgetDecoration('" << label << "','"
+		<< demangledname << "')");
+
+  ATH_MSG_DEBUG("Demangled name=" << demangledname
+		<< "\ttypeid.name()" << decoinfo.name());
 
   //see if the input file is opened
   if (!m_r_fileopened) {
   std::vector<UserDataAssociation>::size_type mynumber;
   mynumber = itr->second;
 
-  msg() << MSG::DEBUG << "label found:"
-      << m_r_associations[mynumber].getLabel() << endreq;
+  ATH_MSG_DEBUG("label found:"
+		<< m_r_associations[mynumber].getLabel());
 
   //**first check if the data type matches
   if (m_r_associations[mynumber].getLongType() == demangledname) {
-    msg() << MSG::DEBUG << "Type Match:"
-        << m_r_associations[mynumber].getLongType() << endreq;
+    ATH_MSG_DEBUG("Type Match:"
+		  << m_r_associations[mynumber].getLongType());
   }
   else {
     msg() << MSG::ERROR << "Type does not Match, in root file:"
         bool SecondTry=false;
         while (m_r_currententry<m_r_userdatatree->GetEntries()) {
           m_r_userdatatree->GetEntry(m_r_currententry);
-          msg() << MSG::DEBUG << "RunNumber=" << runn << "\tEventNumber="
-              << evtn << "\tm_currEventNumber=" << m_currEventNumber
-              << "\tm_r_currententry=" << m_r_currententry << endreq;
+          ATH_MSG_DEBUG("RunNumber=" << runn << "\tEventNumber="
+			<< evtn << "\tm_currEventNumber=" << m_currEventNumber
+			<< "\tm_r_currententry=" << m_r_currententry);
           if (evtn == m_currEventNumber && runn == m_currRunNumber) { //correctly synchronized, can go ahead to read
             synchronized = true;
             break;
     }
   }
 
-  msg() << MSG::DEBUG << "Synchronized:\n" << "\tm_currRunNumber="
-      << m_currRunNumber << "\tm_currEventNumber=" << m_currEventNumber
-      << "\tm_r_currententry=" << m_r_currententry << "\tlabel=" << label
-      << endreq;
+  ATH_MSG_DEBUG("Synchronized:\n" << "\tm_currRunNumber="
+		<< m_currRunNumber << "\tm_currEventNumber=" << m_currEventNumber
+		<< "\tm_r_currententry=" << m_r_currententry << "\tlabel=" << label);
 
   TTree *currenttree = 0;
   unsigned int entrytoread = 0;
   //Now start to read the decoration
   if (IsSimpleType(decoinfo)) { //if is simple type
 
-    msg() << MSG::DEBUG << "Getting data from UserDataTree, longtype="
-        << demangledname << endreq;
+    ATH_MSG_DEBUG("Getting data from UserDataTree, longtype="
+		  << demangledname);
 
     void *data = 0;
     currenttree->SetBranchStatus("*", 0); //disable all branches
      if (info==typeid(const char *))
      return true;
      */
-    msg() << MSG::DEBUG << "Trying to GetEntry #" << entrytoread << endreq;
-    msg() << MSG::DEBUG << "After GetEntry, data=" << data << endreq;
+    ATH_MSG_DEBUG("Trying to GetEntry #" << entrytoread);
+    ATH_MSG_DEBUG("After GetEntry, data=" << data);
 
     if (data) {
       deco = data;
     //**then check if the data type (class) is accessable in ROOT
     //get the name of the class
     bool foundclass = false;
-    msg() << MSG::DEBUG << "UserDataSvc::dis-mangled name:" << demangledname
-        << endreq;
+    ATH_MSG_DEBUG("UserDataSvc::dis-mangled name:" << demangledname);
     //see if the class can be obtained by TClass
     TClass *cl = TClass::GetClass(demangledname.c_str());
     if (cl) { //Class definition found, can be added to TTree
-      msg() << MSG::DEBUG << "UserDataSvc::FIND CLASS:" << demangledname
-          << endreq;
+      ATH_MSG_DEBUG("UserDataSvc::FIND CLASS:" << demangledname);
       foundclass = true;
     }
     if (!foundclass) {
-      msg() << MSG::DEBUG << "Can not find class in ROOT" << demangledname
-          << endreq;
+      ATH_MSG_DEBUG("Can not find class in ROOT" << demangledname);
       return -1;
     }
 
       return -1;
     }
 
-    msg() << MSG::DEBUG << "Using branch name:" << brname << endreq;
+    ATH_MSG_DEBUG("Using branch name:" << brname);
 
     void *data = 0;
     currenttree->SetBranchStatus("*", 0); //disable all branches
 
     if (data) {
       deco = data;
-      msg() << MSG::DEBUG << "data=" << data << " deco=" << deco << endreq;
+      ATH_MSG_DEBUG("data=" << data << " deco=" << deco);
     }
     else {
       msg() << MSG::ERROR << "Can not get data for branch:" << label
 
   std::string label = GenerateLabel(lab, level, clid, key);
 
-  msg() << MSG::DEBUG << "UserDataSvc::vgetInMemDecoration('" << label << "','"
-      << demangledname << "')" << endreq;
-
-  msg() << MSG::DEBUG << "Demangled name=" << demangledname
-      << "\ttypeid.name()" << decoinfo.name() << endreq;
+  ATH_MSG_DEBUG("UserDataSvc::vgetInMemDecoration('" << label << "','"
+		<< demangledname << "')");
+
+  ATH_MSG_DEBUG("Demangled name=" << demangledname
+		<< "\ttypeid.name()" << decoinfo.name());
 
   //** see if the label exist
   std::map<std::string, std::vector<UserDataAssociation>::size_type>::iterator
   mynumber = itr->second;
   //now mynumber is the index of the decoration in the associations list
 
-  msg() << MSG::DEBUG << "label found:"
-      << m_associations[mynumber].getLabel() << endreq;
+  ATH_MSG_DEBUG("label found:"
+		<< m_associations[mynumber].getLabel());
 
   //**first check if the data type matches
   if (m_associations[mynumber].getLongType() == demangledname) {
-    msg() << MSG::DEBUG << "Type Match:"
-        << m_associations[mynumber].getLongType() << endreq;
+    ATH_MSG_DEBUG("Type Match:"
+		  << m_associations[mynumber].getLongType());
   }
   else {
     msg() << MSG::ERROR << "Type does not Match, in root file:"
   if (m_doMerge)
     return 0;
 
-  msg() << MSG::DEBUG << "UserDataSvc::vdecorateElement:" << "\tABC="
-      << abc.getAthenaBarCode() << "\tlabel=" << label << "\ttype_info.name()="
-      << decoinfo.name() << "\tdeco=" << deco << "\tdefaultobj=" << defaultobj
-      << endreq;
+  ATH_MSG_DEBUG("UserDataSvc::vdecorateElement:" << "\tABC="
+		<< abc.getAthenaBarCode() << "\tlabel=" << label << "\ttype_info.name()="
+		<< decoinfo.name() << "\tdeco=" << deco << "\tdefaultobj=" << defaultobj);
 
   el_dump();
 
 
   REFLEX_NS::Type mytype = REFLEX_NS::Type::ByTypeInfo(decoinfo);
   if (!mytype.IsComplete()) {
-    msg() << MSG::DEBUG << "vdecorateElement::The type:" << decoinfo.name()
-        << " is not complete. Make sure the reflex library is properly generated for this type"
-        << endreq;
+    ATH_MSG_DEBUG("vdecorateElement::The type:" << decoinfo.name()
+		  << " is not complete. Make sure the reflex library is properly generated for this type");
     //    return -1;
   }
 
-  msg() << MSG::DEBUG << "Successfully obtained reflex dictionary. "
-      << "\tName=" << mytype.Name() << "\tIsFundamental="
-      << mytype.IsFundamental() << "\tSizeOf=" << mytype.SizeOf() << endl;
+  ATH_MSG_DEBUG("Successfully obtained reflex dictionary. "
+		<< "\tName=" << mytype.Name() << "\tIsFundamental="
+		<< mytype.IsFundamental() << "\tSizeOf=" << mytype.SizeOf());
 
   REFLEX_NS::Object myobject(mytype, deco);
 
   }
   else /*myentryid <= -1*/ {
 
-    msg() << MSG::DEBUG << "el_newDecoration::" << endreq;
+    ATH_MSG_DEBUG("el_newDecoration::");
 
     /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
     // DOREALWORK:create a new entry
     }
   }
 
-  msg() << MSG::DEBUG << "UserDataSvc::entryNumber=" << entryNumber << endreq;
+  ATH_MSG_DEBUG("UserDataSvc::entryNumber=" << entryNumber);
 
   //read the blob
   m_r_el_tree->SetBranchStatus("*", 0); //disable all branches
 
   REFLEX_NS::Type mytype = REFLEX_NS::Type::ByTypeInfo(decoinfo);
   if (!mytype.IsComplete()) {
-    msg() << MSG::DEBUG << "vdecorateElement::The type:" << decoinfo.name()
-        << " is not complete. Make sure the reflex library is properly generated for this type"
-        << endreq;
+    ATH_MSG_DEBUG("vdecorateElement::The type:" << decoinfo.name()
+		  << " is not complete. Make sure the reflex library is properly generated for this type");
     //    return -1;
   }
 
     return -1;
   }
 
-  msg() << MSG::DEBUG << "Successfully obtained reflex dictionary. "
-      << "\tName=" << mytype.Name(REFLEX_NS::SCOPED) << "\tIsFundamental="
-      << mytype.IsFundamental() << "\tSizeOf=" << mytype.SizeOf() << endl;
-
-  msg() << MSG::DEBUG << "m_r_el_tree_type=" << *m_r_el_tree_type << endreq;
+  ATH_MSG_DEBUG("Successfully obtained reflex dictionary. "
+		<< "\tName=" << mytype.Name(REFLEX_NS::SCOPED) << "\tIsFundamental="
+		<< mytype.IsFundamental() << "\tSizeOf=" << mytype.SizeOf());
+
+  ATH_MSG_DEBUG("m_r_el_tree_type=" << *m_r_el_tree_type);
 
 
   //create object
 
   deco = theobj.Address();
 
-  msg() << MSG::DEBUG << "theobj->AddressOf()=" << theobj.Address()
-      << " deco=" << deco << endreq;
+  ATH_MSG_DEBUG("theobj->AddressOf()=" << theobj.Address()
+		<< " deco=" << deco);
 
   //  delete theobj;
   //FIXME: delete the reflex object theobj somewhere to avoid memory leak
 
-  //  msg() << MSG::DEBUG << "theobj->AddressOf()=" << theobj->Address()
-  //      << " deco=" << deco << endreq;
+  //  ATH_MSG_DEBUG("theobj->AddressOf()=" << theobj->Address()
+  //      << " deco=" << deco);
 
   delete m_r_el_tree_type;
   m_r_el_tree_type = 0;
   int64_t myentryid = el_findEntryID(abc, lab);
   
   if (myentryid >= 0) {//found valid entry
-    msg() << MSG::DEBUG << "UserDataSvc::myentryid=" << myentryid << endreq;
+    ATH_MSG_DEBUG("UserDataSvc::myentryid=" << myentryid);
     
     //Get a ReflexObject from the object deco&decoinfo
     if (!m_dictLoaderSvc->load_type(decoinfo)) {
 
     REFLEX_NS::Type mytype = REFLEX_NS::Type::ByTypeInfo(decoinfo);
     if (!mytype.IsComplete()) {
-      msg() << MSG::DEBUG << "vgetInMemElementDecoration::The type:" << decoinfo.name()
-	    << " is not complete. Make sure the reflex library is properly generated for this type"
-	    << endreq;
+      ATH_MSG_DEBUG("vgetInMemElementDecoration::The type:" << decoinfo.name()
+		    << " is not complete. Make sure the reflex library is properly generated for this type");
     }
 
     if (mytype.Name(REFLEX_NS::SCOPED) != m_el_decodata[myentryid].m_object.TypeOf().Name(REFLEX_NS::SCOPED)) {
       return -1;
     }
 
-    msg() << MSG::DEBUG << "vgetInMemElementDecoration::Successfully obtained and matched reflex dictionary. "
-	  << "\tName=" << mytype.Name(REFLEX_NS::SCOPED) << "\tIsFundamental="
-	  << mytype.IsFundamental() << "\tSizeOf=" << mytype.SizeOf() << endl;
+    ATH_MSG_DEBUG("vgetInMemElementDecoration::Successfully obtained and matched reflex dictionary. "
+		  << "\tName=" << mytype.Name(REFLEX_NS::SCOPED) << "\tIsFundamental="
+		  << mytype.IsFundamental() << "\tSizeOf=" << mytype.SizeOf());
     
     deco = m_el_decodata[myentryid].m_object.Address();
 
 
   m_el_decodata.push_back(mydataentry);
 
-  msg() << MSG::DEBUG << "el_newDataEntry: entryID=" << m_el_decodata.size()
-      - 1 << endreq;
+  ATH_MSG_DEBUG("el_newDataEntry: entryID=" << m_el_decodata.size() - 1);
 
   return m_el_decodata.size() - 1;
 
 
 void
 UserDataSvc::el_dump() const {
-  msg() << MSG::DEBUG << "el_dump()\n" << "Number of Data Entries="
-      << m_el_decodata.size() << "List of Entries:" << endreq;
-
-  msg() << MSG::DEBUG << "\t" << "entryID" << "\t" << "label" << "\t"
-      << "AthenaBarCode" << "\t" << "m_object.Address()" << "\t" << endreq;
+  //TK!!!!
+  ATH_MSG_DEBUG("el_dump()\n" << "Number of Data Entries="
+		<< m_el_decodata.size() << "List of Entries:");
+
+  ATH_MSG_DEBUG("\t" << "entryID" << "\t" << "label" << "\t"
+		<< "AthenaBarCode" << "\t" << "m_object.Address()" << "\t");
 
   for (std::vector<ElDataEntry>::size_type it = 0; it < m_el_decodata.size(); it++) {
-    msg() << MSG::DEBUG << "\t" << it << "\t" << m_el_decodata[it].m_label
-        << "\t" << std::hex << m_el_decodata[it].m_abc << "\t"
-        << m_el_decodata[it].m_object.Address() << "\t" << endreq;
+    ATH_MSG_DEBUG("\t" << it << "\t" << m_el_decodata[it].m_label
+		  << "\t" << std::hex << m_el_decodata[it].m_abc << "\t"
+		  << m_el_decodata[it].m_object.Address() << "\t");
   }
 
   //Dump the map
-  msg() << MSG::DEBUG << "Dumping map:" << endreq;
+  ATH_MSG_DEBUG("Dumping map:");
 
   for (std::map<AthenaBarCode_t, std::map<uint32_t, uint32_t> >::const_iterator
       itDecoMap = m_el_decomap.begin(); itDecoMap != m_el_decomap.end(); itDecoMap++) {
 
-    msg() << MSG::DEBUG << "AthenaBarCode=" << (*itDecoMap).first << endreq;
+    ATH_MSG_DEBUG("AthenaBarCode=" << (*itDecoMap).first);
 
     for (std::map<uint32_t, uint32_t>::const_iterator itLabelID2EntryID =
         (*itDecoMap).second.begin(); itLabelID2EntryID
         != (*itDecoMap).second.end(); itLabelID2EntryID++) {
 
-      msg() << MSG::DEBUG << "AthenaBarCode=" << (*itDecoMap).first
-          << "\tLabelID=" << (*itLabelID2EntryID).first << "\tEntryID="
-          << (*itLabelID2EntryID).second << endreq;
+      ATH_MSG_DEBUG("AthenaBarCode=" << (*itDecoMap).first
+		    << "\tLabelID=" << (*itLabelID2EntryID).first << "\tEntryID="
+		    << (*itLabelID2EntryID).second);
     }
   }
   //Dump label array and maps
 
-  msg() << MSG::DEBUG << "Dumping m_el_labelarray:\n" << "LabelID\tLABEL"
-      << endreq;
+  ATH_MSG_DEBUG("Dumping m_el_labelarray:\n" << "LabelID\tLABEL");
 
   for (std::vector<std::string>::size_type i = 0; i < m_el_labelarray.size(); i++) {
-    msg() << MSG::DEBUG << i << "\t" << m_el_labelarray[i] << endreq;
+    ATH_MSG_DEBUG(i << "\t" << m_el_labelarray[i]);
   }
 
-  msg() << MSG::DEBUG << "Dumping m_el_label2id:\n" << endreq;
+  ATH_MSG_DEBUG("Dumping m_el_label2id:\n");
 
   for (std::map<std::string, uint32_t>::const_iterator it =
       m_el_label2id.begin(); it != m_el_label2id.end(); it++) {
-    msg() << MSG::DEBUG << "\tLabel=" << (*it).first << "\tLabelID="
-        << (*it).second << endreq;
+    ATH_MSG_DEBUG("\tLabel=" << (*it).first << "\tLabelID="
+		  << (*it).second);
   }
 
-  msg() << MSG::DEBUG << "Dumping m_el_id2label:\n" << endreq;
+  ATH_MSG_DEBUG("Dumping m_el_id2label:\n");
 
   for (std::map<uint32_t, std::string>::const_iterator it =
       m_el_id2label.begin(); it != m_el_id2label.end(); it++) {
-    msg() << MSG::DEBUG << "\tLabelID=" << (*it).first << "\tLabel="
-        << (*it).second << endreq;
+    ATH_MSG_DEBUG("\tLabelID=" << (*it).first << "\tLabel="
+		  << (*it).second);
   }
 
 }
 void
 UserDataSvc::r_el_dump() const {
   //Dump the map
-  msg() << MSG::DEBUG << "Dumping map:" << endreq;
+  ATH_MSG_DEBUG("Dumping map:");
 
   for (std::map<AthenaBarCode_t, std::map<uint32_t, uint32_t> >::const_iterator
       itDecoMap = m_r_el_decomap.begin(); itDecoMap != m_r_el_decomap.end(); itDecoMap++) {
 
-    msg() << MSG::DEBUG << "AthenaBarCode=" << (*itDecoMap).first << endreq;
+    ATH_MSG_DEBUG("AthenaBarCode=" << (*itDecoMap).first);
 
     for (std::map<uint32_t, uint32_t>::const_iterator itLabelID2EntryID =
         (*itDecoMap).second.begin(); itLabelID2EntryID
         != (*itDecoMap).second.end(); itLabelID2EntryID++) {
 
-      msg() << MSG::DEBUG << "AthenaBarCode=" << (*itDecoMap).first
-          << "\tLabelID=" << (*itLabelID2EntryID).first << "\tEntryID="
-          << (*itLabelID2EntryID).second << endreq;
+      ATH_MSG_DEBUG("AthenaBarCode=" << (*itDecoMap).first
+		    << "\tLabelID=" << (*itLabelID2EntryID).first << "\tEntryID="
+		    << (*itLabelID2EntryID).second);
     }
   }
   //Dump label array and maps
 
-  msg() << MSG::DEBUG << "Dumping m_r_el_labelarray:\n" << "LabelID\tLABEL"
-      << endreq;
+  ATH_MSG_DEBUG("Dumping m_r_el_labelarray:\n" << "LabelID\tLABEL");
 
   for (std::vector<std::string>::size_type i = 0; i < m_r_el_labelarray.size(); i++) {
-    msg() << MSG::DEBUG << i << "\t" << m_r_el_labelarray[i] << endreq;
+    ATH_MSG_DEBUG(i << "\t" << m_r_el_labelarray[i]);
   }
 
-  msg() << MSG::DEBUG << "Dumping m_r_el_label2id:\n" << endreq;
+  ATH_MSG_DEBUG("Dumping m_r_el_label2id:\n");
 
   for (std::map<std::string, uint32_t>::const_iterator it =
       m_r_el_label2id.begin(); it != m_r_el_label2id.end(); it++) {
-    msg() << MSG::DEBUG << "\tLabel=" << (*it).first << "\tLabelID="
-        << (*it).second << endreq;
+    ATH_MSG_DEBUG("\tLabel=" << (*it).first << "\tLabelID="
+		  << (*it).second);
   }
 
-  msg() << MSG::DEBUG << "Dumping m_r_el_id2label:\n" << endreq;
+  ATH_MSG_DEBUG("Dumping m_r_el_id2label:\n");
 
   for (std::map<uint32_t, std::string>::const_iterator it =
       m_r_el_id2label.begin(); it != m_r_el_id2label.end(); it++) {
-    msg() << MSG::DEBUG << "\tLabelID=" << (*it).first << "\tLabel="
-        << (*it).second << endreq;
+    ATH_MSG_DEBUG("\tLabelID=" << (*it).first << "\tLabel="
+		  << (*it).second);
   }
 }
 
     //Compare the two
 
     if (!(getEventDecoration("ElDecoBegin", m_r_el_curevent_begin)).isSuccess()) {
-      msg() << MSG::DEBUG
-          << "Could not retrieve ElDecoBegin as event decoration, maybe file does not contain element level userdata"
-          << endreq;
+      ATH_MSG_DEBUG("Could not retrieve ElDecoBegin as event decoration, maybe file does not contain element level userdata");
       return -1;
     }
 
     if (!(getEventDecoration("ElDecoEnd", m_r_el_curevent_end)).isSuccess()) {
-      msg() << MSG::DEBUG
-          << "Could not retrieve ElDecoEnd as event decoration, maybe file does not contain element level userdata"
-          << endreq;
+      ATH_MSG_DEBUG("Could not retrieve ElDecoEnd as event decoration, maybe file does not contain element level userdata");
       return -1;
     }
 
     if (m_r_el_curevent_begin > m_r_el_curevent_end) {
-      msg() << MSG::DEBUG
-          << "ElDecoEnd<=ElDecoBegin, Noelement level userdata for this event"
-          << endreq;
+      ATH_MSG_DEBUG("ElDecoEnd<=ElDecoBegin, Noelement level userdata for this event");
       return -1;
     }
 
     if (m_r_el_tree == 0) {
-      msg() << MSG::DEBUG
-          << "No ElementLevelUserDataTree tree in the input file, ignoring"
-          << endreq;
+      ATH_MSG_DEBUG("No ElementLevelUserDataTree tree in the input file, ignoring");
       return -1;
     }
 
       //Read in the row
       m_r_el_tree->GetEntry(ii);
       if (!m_r_el_tree_label) {
-        msg() << MSG::DEBUG
-              << "Couldn't read m_r_el_tree_label"
-              << endreq;
+        ATH_MSG_DEBUG("Couldn't read m_r_el_tree_label");
         return -1;
       }
 
-      msg() << MSG::DEBUG << "label=" << *m_r_el_tree_label << " abc="
-          << std::hex << m_r_el_tree_abc << endreq;
+      ATH_MSG_DEBUG("label=" << *m_r_el_tree_label << " abc="
+		    << std::hex << m_r_el_tree_abc);
 
       //add the label into labelid
       std::vector<std::string>::size_type labelid;
 
 std::vector<std::string>
 UserDataSvc::getElListOfLabel(const AthenaBarCode_t &abc) {
-  msg() << MSG::DEBUG << "GG1" << endreq;
+  ATH_MSG_DEBUG("GG1");
   std::vector<std::string> myvec;
   if (r_el_init() < 0) {
     return myvec;
   }
-  msg() << MSG::DEBUG << "GG2" << endreq;
+  ATH_MSG_DEBUG("GG2");
 
   std::map<AthenaBarCode_t, std::map<uint32_t, uint32_t> >::iterator
       itRDecoMap = m_r_el_decomap.find(abc);
   std::auto_ptr<Property> prop(m_propTHistSvc->getProperty("Input").clone());
   StringArrayProperty *pp = dynamic_cast<StringArrayProperty *> (prop.get());
   if (!pp) return -1;
-  msg() << MSG::DEBUG
-        << "UserDataSvc::BeginInputFile::Before Update:THistSvc.Input=";
-  msg() << MSG::DEBUG << pp->value() << endreq;
+  ATH_MSG_DEBUG("UserDataSvc::BeginInputFile::Before Update:THistSvc.Input=");
+  ATH_MSG_DEBUG(pp->value());
   
   //Set new property
   std::vector<std::string> strarr = pp->value();
   m_r_inputstreamname = std::string("/") + s1.str();
   s1 << " DATAFILE='" << m_r_inputfilename << "' OPT='READ'";
   strarr.push_back(s1.str());
-  msg() << MSG::DEBUG
-        << "UserDataSvc::BeginInputFile::After Update:THistSvc.Input=";
-  msg() << MSG::DEBUG << strarr << endreq;
+  ATH_MSG_DEBUG("UserDataSvc::BeginInputFile::After Update:THistSvc.Input=");
+  ATH_MSG_DEBUG(strarr);
   *pp = strarr;
   //activate the handler of this property in THistSvc
   if (!(m_propTHistSvc->setProperty(*prop)).isSuccess()) {
     m_r_associationtree->GetEntry(i);
     
     m_r_associations.push_back(*uda);
-    msg() << MSG::DEBUG << "UserDataSvc::vgetDecoration::uda=" << *uda
-	  << endreq;
+    ATH_MSG_DEBUG("UserDataSvc::vgetDecoration::uda=" << *uda);
     std::vector<UserDataAssociation>::size_type mynumber =
       m_r_associations.size() - 1;
     m_r_label2number[uda->getLabel()] = mynumber;