Removal of warnings and compliance with ALICE coding conventions (Raphaƫl)
[u/mrichter/AliRoot.git] / VZERO / AliVZERODataFEE.cxx
index ae98fd6..983b2c7 100644 (file)
-
-/**************************************************************************
- * Copyright(c) 1998-1999, 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.                  *
- **************************************************************************/
-
-
-//  Simulate the VZERO Trigger response
-// Use FEE parameters stored in Database
-// Can work on real data or in simulation
-#include <TTimeStamp.h>
-#include <TObjString.h>
-
-#include "AliDCSValue.h"
-#include "AliLog.h"
-#include "AliVZERODataFEE.h"
-
-//ClassImp(AliVZERODataFEE)
-
-//_____________________________________________________________________________
-AliVZERODataFEE::AliVZERODataFEE() :
-       TObject(),
-       fRun(0),
-       fStartTime(0),
-       fEndTime(0),
-       fIsProcessed(kFALSE),
-       fParameters(NULL)
-{
-       // Default constructor
-}
-
-//_____________________________________________________________________________
-AliVZERODataFEE::AliVZERODataFEE(Int_t nRun, UInt_t startTime, UInt_t endTime) : 
-       TObject(),
-       fRun(nRun),
-       fStartTime(startTime),
-       fEndTime(endTime),
-       fIsProcessed(kFALSE),
-       fParameters(new TMap())
-{
-       AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", nRun,
-                                TTimeStamp(startTime).AsString(),
-                                TTimeStamp(endTime).AsString()));
-       fParameters->SetOwnerValue();
-       Init();
-}
-//________________________________________________________________
-AliVZERODataFEE::AliVZERODataFEE (const AliVZERODataFEE& ) :
-       TObject(),
-       fRun(0),
-       fStartTime(0),
-       fEndTime(0),
-       fIsProcessed(kFALSE),
-       fParameters(NULL)
-{
-
-       AliInfo("Not Implemented");
-
-}
-//________________________________________________________________
-AliVZERODataFEE &AliVZERODataFEE::operator= (const AliVZERODataFEE& ) 
-{
-       AliInfo("Not Implemented");
-       return *this;
-}
-
-//_____________________________________________________________________________
-AliVZERODataFEE::~AliVZERODataFEE()
-{
-       delete fAliasNames;
-       delete fParameters;
-}
-
-//_____________________________________________________________________________
-void AliVZERODataFEE::Init(){
-       // initialization of DCS aliases
-       int iAlias = 0;
-
-       // CCIU Parameters
-       
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/BBAThreshold";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/BBCThreshold";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/BGAThreshold";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/BGCThreshold";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/BBAForBGThreshold";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/BBCForBGThreshold";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0AThrLow";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0AThrHigh";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0CThrLow";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0CThrHigh";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0AThrLow";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0AThrHigh";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0CThrLow";
-       fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0CThrHigh";
-       for(int i=1;i<=5;i++) {
-               fAliasNames[iAlias] = "V00/FEE/CCIU/TriggerSelect";
-               fAliasNames[iAlias++] += Form("%d",i);
-       }
-       
-       // CIU  Parameters
-       
-       for(int iCIU = 0; iCIU<8 ; iCIU++){
-               for(int iParam=0; iParam<kNCIUParam;iParam++){
-                       fAliasNames[iAlias] = "V00/FEE/";
-                       fAliasNames[iAlias] += Form("CIU%d/",iCIU+1);
-                       
-                       fAliasNames[iAlias] += GetFEEParamName(iParam);
-                       iAlias++;
-               }
-               for(int iParam=kNCIUParam; iParam<kNCIUParam+kNChannelParam;iParam++){
-                       for(int iCh=1;iCh<=8;iCh++){
-                               fAliasNames[iAlias] = "V00/FEE/";
-                               fAliasNames[iAlias] += Form("CIU%d/",iCIU+1);
-                       
-                               fAliasNames[iAlias] += GetFEEParamName(iParam);
-                               fAliasNames[iAlias] += Form("%d",iCh);
-                       
-                               iAlias++;
-                       }
-               }
-               
-       }
-
-       if(iAlias!=kNAliases) 
-               AliError(Form("Number of FEE Aliases defined not correct"));
-       
-}
-//_____________________________________________________________________________
-void AliVZERODataFEE::ProcessData(TMap& aliasMap){
-
-       if(!(fAliasNames[0])) Init();
-       
-       TObjArray *aliasArr;
-       AliDCSValue* aValue;
-
-       // starting loop on aliases
-       for(int iAlias=0; iAlias<kNAliases; iAlias++){
-               
-               aliasArr = (TObjArray*) aliasMap.GetValue(fAliasNames[iAlias].Data());
-               if(!aliasArr){
-                       AliError(Form("Alias %s not found!", fAliasNames[iAlias].Data()));
-                       return;
-               }
-                               
-               if(aliasArr->GetEntries()<1){
-                       AliError(Form("Alias %s has no entries!", fAliasNames[iAlias].Data()));
-                       continue;
-               }
-               
-               TIter iterarray(aliasArr);
-                               
-               AliDCSValue * lastVal;
-               while((aValue = (AliDCSValue*) iterarray.Next())) lastVal = aValue; // Take only the last value
-               
-               //AliInfo(Form("%s %f",fAliasNames[iAlias].Data(), val));
-               fParameters->Add(new TObjString(fAliasNames[iAlias].Data()),lastVal);
-               
-       }
-       
-       // calculate mean and rms of the first two histos
-       // and convert index to aliroot channel
-    
-       fIsProcessed=kTRUE;
-       
-}
-//_____________________________________________________________________________
-
-TString AliVZERODataFEE::GetFEEParamName(Int_t iParam){
-// Return the name of the FEE Parameter iParam
-       TString Result;
-       if(iParam>kNCIUParam + kNChannelParam -1) {
-               AliError(Form("Requesting FEE parameter number %d. Max parameter number is : %d",iParam,kNCIUParam + kNChannelParam-1));
-               return Result;
-       }
-       switch (iParam) {
-               case 0: Result = "Clk1Win1"; break;
-               case 1: Result = "Clk2Win1"; break;
-               case 2: Result = "Clk1Win2"; break;
-               case 3: Result = "Clk2Win2"; break;
-               case 4: Result = "DelayClk1Win1"; break;
-               case 5: Result = "DelayClk2Win1"; break;
-               case 6: Result = "DelayClk1Win2"; break;
-               case 7: Result = "DelayClk2Win2"; break;
-               case 8: Result = "LatchWin1"; break;
-               case 9: Result = "LatchWin2"; break;
-               case 10: Result = "ResetWin1"; break;
-               case 11: Result = "ResetWin2"; break;
-               case 12: Result = "PedestalSubtraction"; break;
-               case 13: Result = "EnableCharge"; break;
-               case 14: Result = "EnableTiming"; break;
-               case 15: Result = "PedEven"; break;
-               case 16: Result = "PedOdd"; break;
-               case 17: Result = "PedCutEven"; break;
-               case 18: Result = "PedCutOdd"; break;
-               case 19: Result = "DelayHit"; break;
-               case 20: Result = "DiscriThr"; break;
-       }
-       return Result;
-}
-
-void AliVZERODataFEE::PrintAliases(){
-       for(int i=0;i<kNAliases;i++) AliInfo(Form("%s",fAliasNames[i].Data()));
-}
+/**************************************************************************\r
+ * Copyright(c) 1998-1999, 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
+// Class AliVZERODataFEE\r
+// ---------------------\r
+// Used to process the TMap of DCS values comming from the shuttle.\r
+// It stores into a TMap the FEE parameters for the given run number\r
+//\r
+\r
+#include <TTimeStamp.h>\r
+#include <TObjString.h>\r
+#include <TMap.h>\r
+\r
+#include "AliDCSValue.h"\r
+#include "AliLog.h"\r
+#include "AliVZERODataFEE.h"\r
+\r
+ClassImp(AliVZERODataFEE)\r
+\r
+//_____________________________________________________________________________\r
+AliVZERODataFEE::AliVZERODataFEE() :\r
+       TObject(),\r
+       fRun(0),\r
+       fStartTime(0),\r
+       fEndTime(0),\r
+       fIsProcessed(kFALSE),\r
+       fParameters(NULL)\r
+{\r
+       // Default constructor\r
+}\r
+\r
+//_____________________________________________________________________________\r
+AliVZERODataFEE::AliVZERODataFEE(Int_t nRun, UInt_t startTime, UInt_t endTime) : \r
+       TObject(),\r
+       fRun(nRun),\r
+       fStartTime(startTime),\r
+       fEndTime(endTime),\r
+       fIsProcessed(kFALSE),\r
+       fParameters(new TMap())\r
+{\r
+       // Constructor\r
+       AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", nRun,\r
+                                TTimeStamp(startTime).AsString(),\r
+                                TTimeStamp(endTime).AsString()));\r
+       fParameters->SetOwnerValue();\r
+       Init();\r
+}\r
+\r
+//_____________________________________________________________________________\r
+AliVZERODataFEE::~AliVZERODataFEE()\r
+{\r
+       delete fAliasNames;\r
+       delete fParameters;\r
+}\r
+\r
+//_____________________________________________________________________________\r
+void AliVZERODataFEE::Init(){\r
+       // Initialization of DCS aliases\r
+       int iAlias = 0;\r
+\r
+       // CCIU Parameters\r
+       \r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/BBAThreshold";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/BBCThreshold";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/BGAThreshold";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/BGCThreshold";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/BBAForBGThreshold";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/BBCForBGThreshold";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0AThrLow";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0AThrHigh";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0CThrLow";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/CentralityV0CThrHigh";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0AThrLow";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0AThrHigh";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0CThrLow";\r
+       fAliasNames[iAlias++] = "V00/FEE/CCIU/MultV0CThrHigh";\r
+       for(int i=1;i<=5;i++) {\r
+               fAliasNames[iAlias] = "V00/FEE/CCIU/TriggerSelect";\r
+               fAliasNames[iAlias++] += Form("%d",i);\r
+       }\r
+       \r
+       // CIU  Parameters\r
+       \r
+       for(int iCIU = 0; iCIU<8 ; iCIU++){\r
+               for(int iParam=0; iParam<kNCIUParam;iParam++){\r
+                       fAliasNames[iAlias] = "V00/FEE/";\r
+                       fAliasNames[iAlias] += Form("CIU%d/",iCIU+1);\r
+                       \r
+                       fAliasNames[iAlias] += GetFEEParamName(iParam);\r
+                       iAlias++;\r
+               }\r
+               for(int iParam=kNCIUParam; iParam<kNCIUParam+kNChannelParam;iParam++){\r
+                       for(int iCh=1;iCh<=8;iCh++){\r
+                               fAliasNames[iAlias] = "V00/FEE/";\r
+                               fAliasNames[iAlias] += Form("CIU%d/",iCIU+1);\r
+                       \r
+                               fAliasNames[iAlias] += GetFEEParamName(iParam);\r
+                               fAliasNames[iAlias] += Form("%d",iCh);\r
+                       \r
+                               iAlias++;\r
+                       }\r
+               }\r
+               \r
+       }\r
+\r
+       if(iAlias!=kNAliases) \r
+               AliError(Form("Number of FEE Aliases defined not correct"));\r
+       \r
+}\r
+//_____________________________________________________________________________\r
+void AliVZERODataFEE::ProcessData(TMap& aliasMap){\r
+// Process the TMap of DCS data\r
+       \r
+       if(!(fAliasNames[0])) Init();\r
+       \r
+       TObjArray *aliasArr;\r
+       AliDCSValue* aValue;\r
+\r
+       // starting loop on aliases\r
+       for(int iAlias=0; iAlias<kNAliases; iAlias++){\r
+               \r
+               aliasArr = (TObjArray*) aliasMap.GetValue(fAliasNames[iAlias].Data());\r
+               if(!aliasArr){\r
+                       AliError(Form("Alias %s not found!", fAliasNames[iAlias].Data()));\r
+                       return;\r
+               }\r
+                               \r
+               if(aliasArr->GetEntries()<1){\r
+                       AliError(Form("Alias %s has no entries!", fAliasNames[iAlias].Data()));\r
+                       continue;\r
+               }\r
+               \r
+               TIter iterarray(aliasArr);\r
+                               \r
+               AliDCSValue * lastVal = NULL;\r
+               while((aValue = (AliDCSValue*) iterarray.Next())) lastVal = aValue; // Take only the last value\r
+               \r
+               //AliInfo(Form("%s %f",fAliasNames[iAlias].Data(), val));\r
+               fParameters->Add(new TObjString(fAliasNames[iAlias].Data()),lastVal);\r
+               \r
+       }\r
+       \r
+       // calculate mean and rms of the first two histos\r
+       // and convert index to aliroot channel\r
+    \r
+       fIsProcessed=kTRUE;\r
+       \r
+}\r
+//_____________________________________________________________________________\r
+\r
+TString AliVZERODataFEE::GetFEEParamName(Int_t iParam){\r
+// Return the name of the FEE Parameter iParam\r
+       TString result;\r
+       if(iParam>kNCIUParam + kNChannelParam -1) {\r
+               AliError(Form("Requesting FEE parameter number %d. Max parameter number is : %d",iParam,kNCIUParam + kNChannelParam-1));\r
+               return result;\r
+       }\r
+       switch (iParam) {\r
+               case 0: result = "Clk1Win1"; break;\r
+               case 1: result = "Clk2Win1"; break;\r
+               case 2: result = "Clk1Win2"; break;\r
+               case 3: result = "Clk2Win2"; break;\r
+               case 4: result = "DelayClk1Win1"; break;\r
+               case 5: result = "DelayClk2Win1"; break;\r
+               case 6: result = "DelayClk1Win2"; break;\r
+               case 7: result = "DelayClk2Win2"; break;\r
+               case 8: result = "LatchWin1"; break;\r
+               case 9: result = "LatchWin2"; break;\r
+               case 10: result = "ResetWin1"; break;\r
+               case 11: result = "ResetWin2"; break;\r
+               case 12: result = "PedestalSubtraction"; break;\r
+               case 13: result = "EnableCharge"; break;\r
+               case 14: result = "EnableTiming"; break;\r
+               case 15: result = "PedEven"; break;\r
+               case 16: result = "PedOdd"; break;\r
+               case 17: result = "PedCutEven"; break;\r
+               case 18: result = "PedCutOdd"; break;\r
+               case 19: result = "DelayHit"; break;\r
+               case 20: result = "DiscriThr"; break;\r
+       }\r
+       return result;\r
+}\r
+\r
+void AliVZERODataFEE::PrintAliases(){\r
+       for(int i=0;i<kNAliases;i++) AliInfo(Form("%s",fAliasNames[i].Data()));\r
+}\r
+\r