LCOV - code coverage report
Current view: top level - TRD/TRDbase - AliTRDSaxHandler.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 330 0.3 %
Date: 2016-06-14 17:26:59 Functions: 1 22 4.5 %

          Line data    Source code
       1             : /*************************************************************************
       2             :  * * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
       3             :  * *                                                                        *
       4             :  * * Author: The ALICE Off-line Project.                                    *
       5             :  * * Contributors are mentioned in the code where appropriate.              *
       6             :  * *                                                                        *
       7             :  * * Permission to use, copy, modify and distribute this software and its   *
       8             :  * * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * * without fee, provided that the above copyright notice appears in all   *
      10             :  * * copies and that both the copyright notice and this permission notice   *
      11             :  * * appear in the supporting documentation. The authors make no claims     *
      12             :  * * about the suitability of this software for any purpose. It is          *
      13             :  * * provided "as is" without express or implied warranty.                  *
      14             :  * **************************************************************************/
      15             : 
      16             : /* $Id: AliTRDSaxHandler.cxx 26327 2008-06-02 15:36:18Z cblume $ */
      17             : 
      18             : ////////////////////////////////////////////////////////////////////////////
      19             : //                                                                        //
      20             : //  The SAX XML file handler used in the TRD preprocessor                 //
      21             : //                                                                        //
      22             : //  Authors:                                                              //
      23             : //    Frederick Kramer (kramer@ikf.uni-frankfurt.de)                      //
      24             : //    Thomas Bird      (thomas@thomasbird.com)                            //
      25             : //                                                                        //
      26             : ////////////////////////////////////////////////////////////////////////////
      27             : 
      28             : 
      29             : #include <TList.h>
      30             : #include <TMath.h>
      31             : #include "AliLog.h"
      32             : #include "AliTRDCalDCSGTUTgu.h"
      33             : #include "AliTRDCalDCSPTR.h"
      34             : 
      35             : #include <TXMLAttr.h>
      36             : #include <TObjArray.h>
      37             : #include "AliTRDSaxHandler.h"
      38             : #include "AliTRDgeometry.h"
      39             : #include "AliTRDcalibDB.h"
      40             : #include "AliTRDCalDCSv2.h"
      41             : #include "AliTRDCalDCSFEEv2.h"
      42             : #include "AliTRDCalDCSGTU.h"
      43             : 
      44          48 : ClassImp(AliTRDSaxHandler)
      45             :   
      46             : //_____________________________________________________________________________
      47             : AliTRDSaxHandler::AliTRDSaxHandler()
      48           0 :   :TObject()
      49           0 :   ,fHandlerStatus(0)
      50           0 :   ,fNDCSPTR(0)
      51           0 :   ,fNDCSGTU(0)
      52           0 :   ,fFEEArr(new TObjArray(540))
      53           0 :   ,fPTRArr(new TObjArray(6))
      54           0 :   ,fSystem(0)
      55           0 :   ,fInsideRstate(0)
      56           0 :   ,fCurrentSM(0)
      57           0 :   ,fCurrentStack(0)
      58           0 :   ,fCurrentROB(-1)
      59           0 :   ,fCurrentMCM(-1)
      60           0 :   ,fCurrentADC(-1)
      61           0 :   ,fContent(0)
      62           0 :   ,fDCSFEEObj(0)
      63           0 :   ,fDCSPTRObj(0)
      64           0 :   ,fDCSGTUObj(0)
      65           0 :   ,fCalDCSObj(new AliTRDCalDCSv2())
      66           0 :   ,fLevel1Tag(-2)
      67           0 :   ,fLevel2Tag(-2)
      68           0 :   ,fInsideBoardInfo(false)
      69           0 :   ,fTmu(0)
      70           0 :   ,fCtpOpc(0)
      71           0 :   ,fSegment(0)
      72           0 :   ,fBoardInfo(0)
      73           0 : {
      74             :   // AliTRDSaxHandler default constructor
      75           0 :   fFEEArr->SetOwner();
      76           0 :   fPTRArr->SetOwner();
      77           0 : }
      78             : 
      79             : //_____________________________________________________________________________
      80             : AliTRDSaxHandler::AliTRDSaxHandler(const AliTRDSaxHandler &sh)
      81           0 :   :TObject(sh)
      82           0 :   ,fHandlerStatus(0)
      83           0 :   ,fNDCSPTR(0)
      84           0 :   ,fNDCSGTU(0)
      85           0 :   ,fFEEArr(0)
      86           0 :   ,fPTRArr(0)
      87           0 :   ,fSystem(0)
      88           0 :   ,fInsideRstate(0)
      89           0 :   ,fCurrentSM(0)
      90           0 :   ,fCurrentStack(0)
      91           0 :   ,fCurrentROB(-1)
      92           0 :   ,fCurrentMCM(-1)
      93           0 :   ,fCurrentADC(-1)
      94           0 :   ,fContent(0)
      95           0 :   ,fDCSFEEObj(0)
      96           0 :   ,fDCSPTRObj(0)
      97           0 :   ,fDCSGTUObj(0)
      98           0 :   ,fCalDCSObj(0)
      99           0 :   ,fLevel1Tag(-2)
     100           0 :   ,fLevel2Tag(-2)
     101           0 :   ,fInsideBoardInfo(false)
     102           0 :   ,fTmu(0)
     103           0 :   ,fCtpOpc(0)
     104           0 :   ,fSegment(0)
     105           0 :   ,fBoardInfo(0)
     106           0 : {
     107             :   // AliTRDSaxHandler copy constructor
     108           0 : }
     109             : 
     110             : //_____________________________________________________________________________
     111             : AliTRDSaxHandler &AliTRDSaxHandler::operator=(const AliTRDSaxHandler &sh)
     112             : {
     113             :   // Assignment operator
     114           0 :   if (&sh == this) return *this;
     115           0 :   new (this) AliTRDSaxHandler(sh);
     116           0 :   return *this;
     117           0 : }
     118             : 
     119             : //_____________________________________________________________________________
     120             : AliTRDSaxHandler::~AliTRDSaxHandler()
     121           0 : {
     122             :   // AliTRDSaxHandler destructor
     123           0 :   if (fFEEArr) {
     124           0 :     delete fFEEArr;
     125           0 :     fFEEArr    = 0x0;
     126           0 :   }
     127           0 :   if (fPTRArr) {
     128           0 :     delete fPTRArr;
     129           0 :     fPTRArr    = 0x0;
     130           0 :   }
     131           0 :   if (fDCSGTUObj) {
     132           0 :     delete fDCSGTUObj;
     133           0 :     fDCSGTUObj    = 0x0;
     134           0 :   }
     135           0 :   if (fCalDCSObj) {
     136           0 :     delete fCalDCSObj;
     137           0 :     fCalDCSObj = 0x0;
     138           0 :   }
     139           0 : }
     140             : 
     141             : //_____________________________________________________________________________
     142             : AliTRDCalDCSv2* AliTRDSaxHandler::GetCalDCSObj()
     143             : {
     144             :   // put the arrays in the global calibration object and return this
     145             : 
     146           0 :   fCalDCSObj->SetFEEArr(fFEEArr);
     147           0 :   fCalDCSObj->SetPTRArr(fPTRArr);
     148           0 :   fCalDCSObj->SetGTUObj(fDCSGTUObj);
     149           0 :   return fCalDCSObj;
     150             : }
     151             : 
     152             : //_____________________________________________________________________________
     153             : void AliTRDSaxHandler::ParseConfigName(TString cfgname) const
     154             : {
     155             :   // Evaluate the config name and set the individual parameters
     156             : 
     157           0 :   TString cfg = "", par = "", pars = "";
     158           0 :   Int_t nPar = AliTRDcalibDB::GetNumberOfParsDCS(cfgname);
     159           0 :   if (nPar == 0) return;
     160             : 
     161           0 :   for (Int_t i=1; i<=nPar; i++) {
     162             :     // Get the configuration parameter
     163           0 :     AliTRDcalibDB::GetDCSConfigParOption(cfgname, i, 0, cfg);
     164             : 
     165             :     // Set Parameters accordingly
     166           0 :     if (i == AliTRDcalibDB::kFltrSet) fDCSFEEObj->SetFilterType(cfg);
     167           0 :     if (i == AliTRDcalibDB::kTrigSet) fDCSFEEObj->SetTriggerSetup(cfg);
     168           0 :     if (i == AliTRDcalibDB::kAddOpti) fDCSFEEObj->SetAddOptions(cfg);
     169           0 :     if (i == AliTRDcalibDB::kTimebin) fDCSFEEObj->SetNumberOfTimeBins(AliTRDcalibDB::ExtractTimeBinsFromString(cfg));
     170           0 :     if (i == AliTRDcalibDB::kReadout) fDCSFEEObj->SetReadoutParam(cfg);
     171           0 :     if (i == AliTRDcalibDB::kTrkMode) fDCSFEEObj->SetTrackletMode(cfg);
     172             : 
     173             :     // Set options of parameters accordingly
     174           0 :     Int_t nOpt = AliTRDcalibDB::GetNumberOfOptsDCS(cfgname, i);
     175           0 :     if (nOpt == 0) continue;
     176             : 
     177           0 :     for (Int_t j=1; j<=nOpt; j++) {
     178             :       // Get the parameter option
     179           0 :       AliTRDcalibDB::GetDCSConfigParOption(cfgname, i, j, par);
     180             : 
     181           0 :       if (i == AliTRDcalibDB::kReadout) {
     182           0 :         if (par.EqualTo("stat")) fDCSFEEObj->SetFastStatNoise(1);
     183             :       }
     184           0 :       if (i == AliTRDcalibDB::kTrkMode) {
     185           0 :         if ((j > 1) && (par.Length() != 0)) pars += "-";
     186           0 :         pars += par;
     187             :       }
     188             :       // SetTCFilterWeight, SetTCFilterShortDecPar, SetTCFilterLongDecPar might be filled here, too
     189             :       // SetSingleHitThres, SetThreePadClustThres, SetSelectiveNoZS, SetTestPattern might be filled here, too
     190             :     }
     191             : 
     192           0 :     fDCSFEEObj->SetTrackletDef(pars);
     193           0 :   }
     194           0 : }
     195             : 
     196             : //_____________________________________________________________________________
     197             : void AliTRDSaxHandler::OnStartDocument() const
     198             : {
     199             :   // if something should happen right at the beginning of the
     200             :   // XML document, this must happen here
     201           0 : }
     202             : 
     203             : //_____________________________________________________________________________
     204             : void AliTRDSaxHandler::OnEndDocument() const
     205             : {
     206             :   // if something should happen at the end of the XML document
     207             :   // this must be done here
     208           0 : }
     209             : 
     210             : //_____________________________________________________________________________
     211             : bool AliTRDSaxHandler::CompareString(TString str, const char *str2)
     212             : {
     213             :   // compre strings, ignoring case
     214             :   // returns true if they are the same, else false
     215           0 :   return !(bool)str.CompareTo(str2,str.kIgnoreCase);
     216             : }
     217             : 
     218             : 
     219             : //_____________________________________________________________________________
     220             : void AliTRDSaxHandler::OnStartElement(const char *name, const TList *attributes)
     221             : {
     222             :   // when a new XML element is found, it is processed here
     223           0 :   fContent    = ""; // Technically <p> This <em>is</em> ok but would be a problem here</p>
     224             :   Int_t dcsId = 0;
     225           0 :   TString tagName  = name;
     226           0 :   TString dcsTitle = "";
     227             : 
     228             :   // set the current system if necessary
     229           0 :   if (CompareString(tagName, "FEE")) fSystem = kInsideFEE;
     230           0 :   if (CompareString(tagName, "PTR")) fSystem = kInsidePTR;
     231           0 :   if (CompareString(tagName, "GTU")) {
     232           0 :     fSystem = kInsideGTU;
     233           0 :     fDCSGTUObj = new AliTRDCalDCSGTU(tagName,tagName);
     234           0 :   }
     235             : 
     236           0 :   if (fSystem == kInsideGTU) {
     237           0 :     if (CompareString(tagName, "tgu")) fLevel1Tag = kInsideTgu;
     238           0 :     if (CompareString(tagName, "board_info")) {
     239           0 :       fInsideBoardInfo = true;
     240           0 :       fBoardInfo = new AliTRDCalDCSGTUBoardInfo(tagName,tagName);
     241           0 :     }
     242           0 :     if (CompareString(tagName(0,tagName.Length()-3), "segment")) { 
     243           0 :       fSegment = new AliTRDCalDCSGTUSegment(tagName,tagName);
     244           0 :       fSegment->SetId(TString(tagName(8,2)).Atoi());
     245           0 :       fLevel1Tag = kInsideSegment;
     246           0 :     }
     247           0 :     if (fLevel1Tag == kInsideTgu) {
     248           0 :       if (CompareString(tagName, "ctp_opc"))   fCtpOpc = new AliTRDCalDCSGTUCtpOpc(tagName,tagName);
     249           0 :     } else if (fLevel1Tag == kInsideSegment) {
     250           0 :       if (CompareString(tagName, "smu")) {
     251           0 :         fLevel2Tag = kInsideSmu;
     252           0 :       }
     253           0 :       if (CompareString(tagName(0,3), "tmu")) {
     254           0 :         fTmu = new AliTRDCalDCSGTUTmu(tagName,tagName);
     255           0 :         fTmu->SetId(TString(tagName(4,2)).Atoi());
     256           0 :         fLevel2Tag = kInsideTmu;
     257           0 :       }
     258             :     }
     259           0 :   } else if (fSystem == kInsideFEE) {
     260           0 :     if (CompareString(tagName, "gaintbl")) fLevel1Tag = kInsideGainTable;
     261             :   }
     262             : 
     263             :   // set if we are inside rstate 
     264             :   // (in principle not necessary - just to be more safe against stupid tags)
     265           0 :   if (CompareString(tagName, "rstate")) fInsideRstate = 1;
     266             : 
     267             :   // get the attributes of the element
     268             :   TXMLAttr *attr;
     269           0 :   TIter next(attributes);
     270           0 :   while ((attr = (TXMLAttr*) next())) {
     271           0 :     TString attribName = attr->GetName();
     272           0 :     TString attribValue = attr->GetValue();
     273           0 :     if (fSystem == kInsideFEE && fLevel1Tag == kInsideNone) {
     274           0 :       if (CompareString(attribName, "id") && CompareString(tagName, "DCS")) {
     275           0 :         dcsTitle = name;
     276           0 :         dcsId = atoi(attr->GetValue());
     277           0 :       }
     278           0 :       if (CompareString(attribName, "roc") && CompareString(tagName, "ack")) {
     279           0 :         if (attribValue.Atoi() != fDCSFEEObj->GetDCSid())
     280           0 :           fDCSFEEObj->SetStatusBit(4); // consistency check
     281             :       }
     282           0 :       if (CompareString(attribName, "rob") && CompareString(tagName, "ro-board") && (fInsideRstate == 1)) {
     283           0 :         fCurrentROB = attribValue.Atoi();
     284           0 :       }
     285           0 :       if (CompareString(attribName, "mcm") && CompareString(tagName, "m") && (fInsideRstate == 1)) {
     286           0 :         fCurrentMCM = attribValue.Atoi();
     287           0 :       }
     288           0 :       if (CompareString(attribName, "sm") && CompareString(tagName, "DCS")) {
     289           0 :         fCurrentSM = attribValue.Atoi(); // only for GTU/PTR
     290           0 :       }
     291           0 :       if (CompareString(attribName, "id") && CompareString(tagName, "STACK")) {// hmmmm not exist?
     292           0 :         fCurrentStack = attribValue.Atoi(); // only for GTU/PTR
     293           0 :       }
     294           0 :     } else if (fSystem == kInsideFEE && fLevel1Tag == kInsideGainTable) {
     295           0 :       if (CompareString(tagName, "roc") && CompareString(attribName, "type"))    fDCSFEEObj->SetGainTableRocType(attribValue);
     296           0 :       if (CompareString(tagName, "roc") && CompareString(attribName, "serial"))  fDCSFEEObj->SetGainTableRocSerial(attribValue.Atoi());
     297           0 :       if (CompareString(tagName, "mcm") && CompareString(attribName, "rob"))     fCurrentROB = attribValue.Atoi();
     298           0 :       if (CompareString(tagName, "mcm") && CompareString(attribName, "pos"))     fCurrentMCM = attribValue.Atoi();
     299           0 :       if (CompareString(tagName, "adc") && CompareString(attribName, "id"))      fCurrentADC = attribValue.Atoi();
     300             :       
     301           0 :     } else if (fSystem == kInsideGTU && fLevel1Tag == kInsideNone) {
     302           0 :       if (CompareString(tagName, "publisher")) {
     303           0 :         if (CompareString(attribName, "at"))         fDCSGTUObj->SetSORFlag(attribValue.Atoi());
     304           0 :         if (CompareString(attribName, "serial"))     fDCSGTUObj->SetSerial(attribValue.Atoi());
     305           0 :         if (CompareString(attribName, "runnr"))      fDCSGTUObj->SetRunNumber(attribValue.Atoi());
     306             :       }
     307           0 :     } else if (fSystem == kInsideGTU && fLevel1Tag == kInsideTgu) {
     308           0 :       if (CompareString(tagName, "from")) {
     309           0 :         if (CompareString(attribName, "at"))         fDCSGTUObj->GetTgu()->SetFromSORFlag(attribValue.Atoi());
     310           0 :         if (CompareString(attribName, "runnr"))      fDCSGTUObj->GetTgu()->SetFromRunNumber(attribValue.Atoi());
     311           0 :         if (CompareString(attribName, "child"))      fDCSGTUObj->GetTgu()->SetFromChild(attribValue.Atoi());
     312             :       }
     313           0 :       if (CompareString(tagName, "segmentmask") && CompareString(attribName, "value"))  fDCSGTUObj->GetTgu()->SetSegmentMask(attribValue);
     314           0 :       if (CompareString(tagName, "busymask") && CompareString(attribName, "value"))     fDCSGTUObj->GetTgu()->SetBusyMask(attribValue);
     315           0 :       if (CompareString(tagName, "contribmask") && CompareString(attribName, "value"))  fDCSGTUObj->GetTgu()->SetContribMask(attribValue);
     316             :       
     317           0 :       if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "id"))         fCtpOpc->SetId(attribValue.Atoi());
     318           0 :       if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "opcode"))     fCtpOpc->SetOpcode(attribValue.Atoi());
     319           0 :       if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "direction"))  fCtpOpc->SetDirection(attribValue.Atoi());
     320           0 :       if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "inverted"))   fCtpOpc->SetInverted(attribValue.Atoi());
     321           0 :       if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "delay"))      fCtpOpc->SetDelay(attribValue.Atoi());
     322           0 :       if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "connected"))  fCtpOpc->SetConnected(attribValue.Atoi());
     323             :       
     324           0 :     } else if (fSystem == kInsideGTU && fLevel1Tag == kInsideSegment) {
     325           0 :       if (CompareString(tagName, "from")) {
     326           0 :         if (CompareString(attribName, "at"))         fSegment->SetFromSORFlag(attribValue.Atoi());
     327           0 :         if (CompareString(attribName, "runnr"))      fSegment->SetFromRunNumber(attribValue.Atoi());
     328           0 :         if (CompareString(attribName, "child"))      fSegment->SetFromChild(attribValue.Atoi());
     329             :       }
     330           0 :       if (fLevel2Tag == kInsideSmu) {
     331           0 :         if (CompareString(tagName, "stackmask") && CompareString(attribName, "value"))     fSegment->SetSmuStackMask(attribValue);
     332           0 :         if (CompareString(tagName, "tracklets") && CompareString(attribName, "send"))      fSegment->SetSmuTracklets(attribValue.Atoi());
     333           0 :         if (CompareString(tagName, "tracks") && CompareString(attribName, "send"))         fSegment->SetSmuTracks(attribValue.Atoi());
     334           0 :         if (CompareString(tagName, "idelay") && CompareString(attribName, "value"))        fSegment->SetSmuIdelay(attribValue.Atoi());
     335           0 :         if (CompareString(tagName, "ttc_emulator") && CompareString(attribName, "enable")) fSegment->SetSmuTtcEmulatorEnable(attribValue.Atoi());
     336             :         
     337           0 :         if (CompareString(tagName, "trigger_window") && CompareString(attribName, "l1_low"))  
     338           0 :           fSegment->SetSmuTriggerWindowL1Low(attribValue.Atoi());
     339           0 :         if (CompareString(tagName, "trigger_window") && CompareString(attribName, "l1_high"))  
     340           0 :           fSegment->SetSmuTriggerWindowL1High(attribValue.Atoi());
     341           0 :         if (CompareString(tagName, "trigger_window") && CompareString(attribName, "l2_low"))  
     342           0 :           fSegment->SetSmuTriggerWindowL2Low(attribValue.Atoi());
     343           0 :         if (CompareString(tagName, "trigger_window") && CompareString(attribName, "l2_high"))  
     344           0 :           fSegment->SetSmuTriggerWindowL2High(attribValue.Atoi());
     345             :         
     346           0 :       } else if (fLevel2Tag == kInsideTmu) {
     347           0 :         if (CompareString(tagName, "linkmask") && CompareString(attribName, "value"))      fTmu->SetLinkMask(attribValue);
     348           0 :         if (CompareString(tagName, "pattern_generator") && CompareString(attribName, "enable")) 
     349           0 :           fTmu->SetPatternGeneratorEnable(attribValue.Atoi());
     350           0 :         if (CompareString(tagName, "pattern_generator") && CompareString(attribName, "datawords")) 
     351           0 :           fTmu->SetPatternGeneratorDataWords(attribValue.Atoi());
     352           0 :         if (CompareString(tagName, "pattern_generator") && CompareString(attribName, "trackletwords")) 
     353           0 :           fTmu->SetPatternGeneratorTrackletWords(attribValue.Atoi());
     354             :       }
     355             :     }
     356             :     
     357           0 :     if (fInsideBoardInfo) {
     358           0 :       if (CompareString(tagName, "board_info") && CompareString(attribName, "board_id"))    fBoardInfo->SetId(attribValue);
     359           0 :       if (CompareString(tagName, "board_info") && CompareString(attribName, "design_type")) fBoardInfo->SetType(attribValue.Atoi());
     360           0 :       if (CompareString(tagName, "board_info") && CompareString(attribName, "pci_ga"))      fBoardInfo->SetPciGa(attribValue.Atoi());
     361           0 :       if (CompareString(tagName, "hardware") && CompareString(attribName, "date"))          fBoardInfo->SetHwDate(attribValue);
     362           0 :       if (CompareString(tagName, "hardware") && CompareString(attribName, "rev"))           fBoardInfo->SetHwRev(attribValue.Atoi());
     363           0 :       if (CompareString(tagName, "hardware") && CompareString(attribName, "clean"))         fBoardInfo->SetHwClean(attribValue.Atoi());
     364           0 :       if (CompareString(tagName, "software") && CompareString(attribName, "date"))          fBoardInfo->SetSwDate(attribValue);
     365           0 :       if (CompareString(tagName, "software") && CompareString(attribName, "rev"))           fBoardInfo->SetSwRev(attribValue.Atoi());
     366           0 :       if (CompareString(tagName, "software") && CompareString(attribName, "clean"))         fBoardInfo->SetSwClean(attribValue.Atoi());
     367             :     }
     368           0 :   }
     369             : 
     370             :   // if there is a new DCS element put it in the correct array
     371           0 :   if (CompareString(tagName, "DCS")) {
     372           0 :     if (fSystem == kInsideFEE) {
     373           0 :       fDCSFEEObj = new AliTRDCalDCSFEEv2();
     374           0 :       fDCSFEEObj->SetDCSid(dcsId);
     375           0 :     }
     376           0 :     if (fSystem == kInsidePTR) {
     377             : //       fDCSPTRObj = new AliTRDCalDCSPTR(name,dcsTitle);
     378             : //       fDCSPTRObj->SetDCSid(dcsId);
     379             :     }
     380             :     if (fSystem == kInsideGTU) {
     381             : //       fDCSGTUObj = new AliTRDCalDCSGTU(name,dcsTitle);
     382             : //       fDCSGTUObj->SetDCSid(dcsId);
     383             :     }
     384           0 :   }
     385           0 : }
     386             : 
     387             : //_____________________________________________________________________________
     388             : void AliTRDSaxHandler::OnEndElement(const char *name)
     389             : {
     390             :   // do everything that needs to be done when an end tag of an element is found
     391           0 :   TString tagName = name;
     392             :   
     393             :   // if done with this DCS board, put it in the correct array
     394             :   // no check for </ack> necessary since this check is done during XML validation
     395           0 :   if (CompareString(tagName, "DCS")) {
     396           0 :     if (fSystem == kInsideFEE) {
     397             :       Int_t detID = 0;
     398           0 :       if (fDCSFEEObj->GetStatusBit() == 0) {
     399             :         // if there were no errors (StatusBit==0) the following should match
     400           0 :         detID = fDCSFEEObj->GetDCSid();
     401           0 :         AliTRDgeometry aliGeo;
     402           0 :         Int_t calDetID = aliGeo.GetDetector(fDCSFEEObj->GetLayer(),
     403           0 :                                             fDCSFEEObj->GetStack(),
     404           0 :                                             fDCSFEEObj->GetSM());
     405           0 :         if (detID != calDetID) fDCSFEEObj->SetStatusBit(4);
     406           0 :       } else {
     407             :         // if the dcs board didn't properly respond, don't compare
     408             :         detID = fDCSFEEObj->GetDCSid();
     409             :       }
     410           0 :       fFEEArr->AddAt(fDCSFEEObj,detID);
     411           0 :     }
     412           0 :     if (fSystem == kInsidePTR) {
     413           0 :       fPTRArr->AddAt(fDCSPTRObj,fNDCSPTR);
     414           0 :       fNDCSPTR++;
     415           0 :     }
     416             : //     if (fSystem == kInsideGTU) {
     417             : //       fGTUArr->AddAt(fDCSGTUObj,fNDCSGTU);
     418             : //       fNDCSGTU++;
     419             : //     }
     420           0 :     fCurrentSM = 99; // 99 for no SM set
     421           0 :     fDCSFEEObj = 0;  // just to be sure
     422           0 :     return;
     423             :   }
     424             : 
     425             :   // done with this stack? 
     426           0 :   if (CompareString(tagName, "STACK")) {// TODO: errrrm ???? always 99?
     427           0 :     fCurrentStack = 99; // 99 for no stack set
     428           0 :   }
     429             : 
     430             :   // outside of rstate again?
     431           0 :   if (CompareString(tagName, "rstate")) {
     432           0 :     fInsideRstate = 0;
     433           0 :     fCurrentROB   = -1;
     434           0 :     fCurrentMCM   = -1;
     435           0 :   }
     436           0 :   if (CompareString(tagName, "ro-board")) fCurrentROB = -1;
     437             :   
     438             :   // store informations of the FEE DCS-Board
     439           0 :   if (fSystem == kInsideFEE) {
     440           0 :     if (CompareString(tagName, "DNR"))            fDCSFEEObj->SetStatusBit(fContent.Atoi());
     441           0 :     if (CompareString(tagName, "CFGTAG"))         fDCSFEEObj->SetConfigTag(fContent.Atoi());
     442           0 :     if (CompareString(tagName, "CFGVRSN"))        fDCSFEEObj->SetConfigVersion(fContent);
     443           0 :     if (CompareString(tagName, "SM-ID"))          fDCSFEEObj->SetSM(fContent.Atoi());
     444           0 :     if (CompareString(tagName, "STACK-ID"))       fDCSFEEObj->SetStack(fContent.Atoi());
     445           0 :     if (CompareString(tagName, "LAYER-ID"))       fDCSFEEObj->SetLayer(fContent.Atoi());
     446           0 :     if (CompareString(tagName, "CFGNME")) {
     447           0 :       fDCSFEEObj->SetConfigName(fContent);
     448           0 :       ParseConfigName(fContent);
     449           0 :     }
     450           0 :     if (CompareString(tagName, "gaintbl")) {
     451           0 :       fLevel1Tag = kInsideNone;
     452           0 :       fCurrentROB = -1;
     453           0 :       fCurrentMCM = -1;
     454           0 :       fCurrentADC = -1;
     455           0 :     }
     456           0 :     if (fLevel1Tag == kInsideGainTable) {
     457           0 :       if (CompareString(tagName, "name"))   fDCSFEEObj->SetGainTableName(fContent);
     458           0 :       if (CompareString(tagName, "desc"))   fDCSFEEObj->SetGainTableDesc(fContent);
     459           0 :       if (fCurrentROB>=0 && fCurrentMCM>=0) {
     460           0 :         if (CompareString(tagName, "adcdac")) fDCSFEEObj->SetGainTableAdcdac(fCurrentROB, fCurrentMCM, fContent.Atoi());
     461           0 :         if (fCurrentADC>=0) {
     462           0 :           if (CompareString(tagName, "fgfn"))   fDCSFEEObj->SetGainTableFgfn(fCurrentROB, fCurrentMCM, fCurrentADC, fContent.Atoi());
     463           0 :           if (CompareString(tagName, "fgan"))   fDCSFEEObj->SetGainTableFgan(fCurrentROB, fCurrentMCM, fCurrentADC, fContent.Atoi());
     464             :         }
     465             :       }
     466             :     }
     467           0 :     if (fInsideRstate == 1) {
     468           0 :       if (fCurrentROB>=0 && fCurrentMCM>=0) {
     469           0 :         if (CompareString(tagName, "gsm")) fDCSFEEObj->SetMCMGlobalState(fCurrentROB, fCurrentMCM, fContent.Atoi());
     470           0 :         if (CompareString(tagName, "ni")) fDCSFEEObj->SetMCMStateNI(fCurrentROB, fCurrentMCM, fContent.Atoi());
     471           0 :         if (CompareString(tagName, "ev")) fDCSFEEObj->SetMCMEventCnt(fCurrentROB, fCurrentMCM, fContent.Atoi());
     472           0 :         if (CompareString(tagName, "ptrg")) fDCSFEEObj->SetMCMPtCnt(fCurrentROB, fCurrentMCM, fContent.Atoi());
     473             :       }
     474             :     }
     475             :   }
     476             : 
     477           0 :   if (fSystem == kInsideGTU) {
     478             : //     if (CompareString(tagName, "run")) { 
     479             : //       fDCSGTUObj->SetSORFlag(TString(fContent(fContent.Length()-1,1)).Atoi());
     480             : //       fDCSGTUObj->SetRunNumber(TString(fContent(0,fContent.Length()-2)).Atoi());
     481             : //     }
     482             : //     if (CompareString(tagName, "serial"))         fDCSGTUObj->SetSerial(fContent.Atoi());
     483           0 :     if (CompareString(tagName, "board_info")) {
     484           0 :       fInsideBoardInfo = false;
     485           0 :       if (fLevel1Tag == kInsideTgu)                                  fDCSGTUObj->GetTgu()->SetBoardInfo(fBoardInfo);
     486           0 :       if (fLevel1Tag == kInsideSegment && fLevel2Tag == kInsideSmu)  fSegment->SetSmuBoardInfo(fBoardInfo);
     487           0 :       if (fLevel1Tag == kInsideSegment && fLevel2Tag == kInsideTmu)  fTmu->SetBoardInfo(fBoardInfo);
     488             :     }
     489           0 :     if (CompareString(tagName, "dnr"))            fDCSGTUObj->SetDNR(fContent.Atoi());
     490           0 :     if (CompareString(tagName, "tgu"))            fLevel1Tag = kInsideNone;
     491           0 :     if (CompareString(tagName(0,tagName.Length()-3), "segment")) { 
     492           0 :       fDCSGTUObj->GetSegmentArray()->Add(fSegment);
     493           0 :       fLevel1Tag = kInsideNone;
     494           0 :     }
     495           0 :     if (fLevel1Tag == kInsideTgu) {
     496           0 :       if (CompareString(tagName, "ctp_opc"))        fDCSGTUObj->GetTgu()->GetCtpOpcArray()->Add(fCtpOpc);
     497           0 :     } else if (fLevel1Tag == kInsideSegment) {
     498           0 :       if (CompareString(tagName, "smu"))          fLevel2Tag = kInsideNone;
     499           0 :       if (CompareString(tagName(0,3), "tmu")) {
     500           0 :         fSegment->GetTmuArray()->Add(fTmu);
     501           0 :         fLevel2Tag = kInsideNone;
     502           0 :       }
     503             :     }
     504             :   }
     505             : 
     506             :   
     507             :   // store pretrigger informations
     508           0 :   if (fSystem == kInsidePTR) {
     509             :     // no informations available yet
     510             :   }
     511             : //   // store GTU informations
     512             : //   if (fSystem == kInsideGTU) {
     513             : //     if (CompareString(tagName, "SMMASK"))
     514             : //       fHandlerStatus = fDCSGTUObj->SetSMMask(fContent);
     515             : //     if (CompareString(tagName, "LINKMASK")) 
     516             : //       fHandlerStatus = fDCSGTUObj->SetLinkMask(fCurrentSM, fCurrentStack, fContent);
     517             : //     if (CompareString(tagName, "STMASK"))
     518             : //       fDCSGTUObj->SetStackMaskBit(fCurrentSM, fCurrentStack, fContent.Atoi());
     519             : //   }
     520           0 : }
     521             : 
     522             : //_____________________________________________________________________________
     523             : void AliTRDSaxHandler::OnCharacters(const char *characters)
     524             : {
     525             :   // copy the the text content of an XML element
     526           0 :   fContent = characters;
     527           0 : }
     528             : 
     529             : //_____________________________________________________________________________
     530             : void AliTRDSaxHandler::OnComment(const char* /*text*/) const
     531             : {
     532             :   // comments within the XML file are ignored
     533           0 : }
     534             : 
     535             : //_____________________________________________________________________________
     536             : void AliTRDSaxHandler::OnWarning(const char *text)
     537             : {
     538             :   // process warnings here
     539           0 :   AliInfo(Form("Warning: %s",text));
     540           0 : }
     541             : 
     542             : //_____________________________________________________________________________
     543             : void AliTRDSaxHandler::OnError(const char *text)
     544             : {
     545             :   // process errors here
     546           0 :   AliError(Form("Error: %s",text));
     547           0 : }
     548             : 
     549             : //_____________________________________________________________________________
     550             : void AliTRDSaxHandler::OnFatalError(const char *text)
     551             : {
     552             :   // process fatal errors here
     553           0 :   AliError(Form("Fatal error: %s",text)); // use AliFatal?
     554           0 : }
     555             : 
     556             : //_____________________________________________________________________________
     557             : void AliTRDSaxHandler::OnCdataBlock(const char* /*text*/, Int_t /*len*/) const
     558             : {
     559             :   // process character data blocks here
     560             :   // not implemented and should not be used here
     561           0 : }
     562             : 

Generated by: LCOV version 1.11