Removal of warnings and compliance with ALICE coding conventions (Raphaƫl)
authorcheynis <cheynis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Jul 2009 09:50:04 +0000 (09:50 +0000)
committercheynis <cheynis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Jul 2009 09:50:04 +0000 (09:50 +0000)
VZERO/AliVZERODataFEE.cxx
VZERO/AliVZERODataFEE.h
VZERO/AliVZEROLogicalSignal.cxx
VZERO/AliVZEROLogicalSignal.h
VZERO/AliVZEROTrigger.cxx
VZERO/AliVZEROTrigger.h
VZERO/AliVZEROTriggerData.cxx
VZERO/AliVZEROTriggerData.h
VZERO/AliVZEROTriggerSimulator.cxx
VZERO/AliVZEROTriggerSimulator.h

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
index 19123c2..44a7829 100644 (file)
@@ -1,55 +1,64 @@
-#ifndef ALIVZERODATAFEE_H
-#define ALIVZERODATAFEE_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
- * reserved. 
- *
- * See cxx source for full Copyright notice                               
- */
-class TMap;
-
-#include <TObject.h>
-#include <TString.h>
-#include <TMap.h>
-
-class AliVZERODataFEE : public TObject {
-public:
-       //enum {kNAliases=64};
-       AliVZERODataFEE();
-       AliVZERODataFEE(Int_t nRun, UInt_t startTime, UInt_t endTime);
-       AliVZERODataFEE(const AliVZERODataFEE &dataFEE);
-       AliVZERODataFEE& operator= (const AliVZERODataFEE &dataFEE);
-       virtual ~AliVZERODataFEE();
-       
-       void SetRun(Int_t run) {fRun = run;}
-       void SetStartTime(Int_t startTime) {fStartTime = startTime;}
-       void SetEndTime(Int_t endTime) {fEndTime = endTime;}
-       Int_t GetRun() const {return fRun;}
-       Int_t GetStartTime() const {return fStartTime;}
-       Int_t GetEndTime() const {return fEndTime;}
-
-       void ProcessData(TMap& aliasMap);
-       void Init();
-       void PrintAliases();
-       
-       TMap * GetParameters() const {return fParameters;};
-       
-       enum { kNCIUBoards = 8, kNCIUParam = 13, kNChannelParam = 8, kNCCIUParam = 19, kNAliases  = kNChannelParam*8*kNCIUBoards +kNCIUParam*kNCIUBoards + kNCCIUParam };
-
-private:
-
-       Int_t fRun;       // Run number
-       Int_t fStartTime; // Start time
-       Int_t fEndTime;   // End time
-       TString fAliasNames[kNAliases]; // aliases for DCS data
-       Bool_t fIsProcessed; // bool to know processing status
-
-       TString GetFEEParamName(Int_t iParam);
-       
-       TMap * fParameters;
-       
-       ClassDef( AliVZERODataFEE, 1 )  
-       
-};
-
-
-#endif // ALIVZERODATAFEE_H
+#ifndef ALIVZERODATAFEE_H\r
+#define ALIVZERODATAFEE_H\r
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights\r
+ * reserved. \r
+ *\r
+ * See cxx source for full Copyright notice                               \r
+ */\r
+class TMap;\r
+class TString;\r
+\r
+#include <TObject.h>\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
+\r
+class AliVZERODataFEE : public TObject {\r
+public:\r
+       //enum {kNAliases=64};\r
+       AliVZERODataFEE();\r
+       AliVZERODataFEE(Int_t nRun, UInt_t startTime, UInt_t endTime);\r
+       virtual ~AliVZERODataFEE();\r
+       \r
+       void SetRun(Int_t run) {fRun = run;}\r
+       void SetStartTime(Int_t startTime) {fStartTime = startTime;}\r
+       void SetEndTime(Int_t endTime) {fEndTime = endTime;}\r
+       Int_t GetRun() const {return fRun;}\r
+       Int_t GetStartTime() const {return fStartTime;}\r
+       Int_t GetEndTime() const {return fEndTime;}\r
+\r
+       void ProcessData(TMap& aliasMap);\r
+       void Init();\r
+       void PrintAliases();\r
+       \r
+       TMap * GetParameters() const {return fParameters;};\r
+       \r
+       enum { kNCIUBoards = 8, kNCIUParam = 13, kNChannelParam = 8, kNCCIUParam = 19, kNAliases  = kNChannelParam*8*kNCIUBoards +kNCIUParam*kNCIUBoards + kNCCIUParam };\r
+\r
+private:\r
+       \r
+       AliVZERODataFEE(const AliVZERODataFEE & /*dataFEE*/); // Not implemented\r
+       AliVZERODataFEE& operator= (const AliVZERODataFEE &/*dataFEE*/); // Not implemented\r
+\r
+       Int_t fRun;       // Run number\r
+       Int_t fStartTime; // Start time\r
+       Int_t fEndTime;   // End time\r
+       TString fAliasNames[kNAliases]; // aliases for DCS data\r
+       Bool_t fIsProcessed; // bool to know processing status\r
+       TMap * fParameters;  // TMap holding the FEE parameters\r
+\r
+       TString GetFEEParamName(Int_t iParam);\r
+       \r
+       \r
+       ClassDef( AliVZERODataFEE, 1 )  \r
+       \r
+};\r
+\r
+\r
+#endif // ALIVZERODATAFEE_H\r
+\r
index 4fd2109..a854356 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.                  *
- **************************************************************************/
-
-
-//  Describes a logical signal
-// Used by AliVZEROTriggerSim class
-// 
-
-#include "AliLog.h"
-#include "AliVZEROLogicalSignal.h"
-
-ClassImp(AliVZEROLogicalSignal)
-
-//_____________________________________________________________________________
-AliVZEROLogicalSignal::AliVZEROLogicalSignal() : TObject(), fStart(0.), fStop(0.)
-{
-}
-//_____________________________________________________________________________
-AliVZEROLogicalSignal::AliVZEROLogicalSignal(Float_t start, Float_t stop) : TObject(), fStart(start), fStop(stop)
-{
-       if(fStart>fStop) AliError("Logical Signal has a Start time AFTER the Stop time");
-       if(fStart==fStop) AliWarning("Logical Signal has a zero width");
-}
-//_____________________________________________________________________________
-AliVZEROLogicalSignal::AliVZEROLogicalSignal(UShort_t profilClock, UInt_t delay) : TObject(), fStart(0.), fStop(0.)
-{
-       Bool_t word;
-       Bool_t up=kFALSE;
-       Bool_t down=kFALSE;
-       
-       for(int i=0 ; i<5 ; i++) {
-               word = (profilClock >> i) & 0x1;
-               if(word&&!up) {
-                       fStart = 5. * i;
-                       up = kTRUE;
-               }
-               if(!word&&up&&!down) {
-                       fStop = 5. * i;
-                       down = kTRUE;
-               }               
-       }
-       if(!down) fStop = 25.;
-       
-       fStart += delay*10.e-3; // Add 10 ps par register unit
-       fStop  += delay*10.e-3; 
-}
-//_____________________________________________________________________________
-AliVZEROLogicalSignal::AliVZEROLogicalSignal(const AliVZEROLogicalSignal &signal) : 
-       TObject(), fStart(signal.fStart), 
-       fStop(signal.fStop)
-{
-       // Copy constructor
-}
-
-//_____________________________________________________________________________
-AliVZEROLogicalSignal::~AliVZEROLogicalSignal(){
-}
-
-//_____________________________________________________________________________
-AliVZEROLogicalSignal& AliVZEROLogicalSignal::operator = 
-(const AliVZEROLogicalSignal& signal)
-{
-       fStart = signal.fStart;
-       fStop  = signal.fStop;
-       return *this;
-}
-
-//_____________________________________________________________________________
-AliVZEROLogicalSignal AliVZEROLogicalSignal::operator|(const AliVZEROLogicalSignal& signal) const 
-{
-       // Perform the Logical OR of two signals: C = A or B
-       if((fStart>signal.fStop) || (signal.fStart>fStop))
-               AliError(Form("Both signal do not superpose in time.\n  Start(A) = %f Stop(A) = %f\n   Start(B) = %f Stop(B) = %f",fStart, fStop, signal.fStart,signal.fStop));
-       
-       AliVZEROLogicalSignal result;
-       if(fStart<signal.fStart) result.fStart = fStart;
-       else result.fStart = signal.fStart;
-       
-       if(fStop>signal.fStop) result.fStop = fStop;
-       else result.fStop = signal.fStop;
-               
-       return result;
-}
-//_____________________________________________________________________________
-AliVZEROLogicalSignal AliVZEROLogicalSignal::operator&(const AliVZEROLogicalSignal& signal) const
-{
-       // Perform the Logical AND of two signals: C = A and B
-       if((fStart>signal.fStop) || (signal.fStart>fStop))
-               AliError(Form("Both signal do not superpose in time.\n  Start(A) = %f Stop(A) = %f\n   Start(B) = %f Stop(B) = %f",fStart, fStop, signal.fStart,signal.fStop));
-       
-       AliVZEROLogicalSignal result;
-       if(fStart>signal.fStart) result.fStart = fStart;
-       else result.fStart = signal.fStart;
-       
-       if(fStop<signal.fStop) result.fStop = fStop;
-       else result.fStop = signal.fStop;
-       
-       return result;
-}
-
-//_____________________________________________________________________________
-Bool_t AliVZEROLogicalSignal::IsInCoincidence(Float_t time)
-{
-       Bool_t result = kFALSE;
-       if((time>fStart) && (time<fStop)) result = kTRUE;
-       return result;
-}
+/**************************************************************************\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
+// \r
+// Class AliVZEROLogicalSignal\r
+// ---------------------------\r
+// Describes a logical signal in the electronics. \r
+// Use it to generate observation windows\r
+// which are used by AliVZEROTriggerSimulator class\r
+// \r
+\r
+#include "AliLog.h"\r
+#include "AliVZEROLogicalSignal.h"\r
+\r
+ClassImp(AliVZEROLogicalSignal)\r
+\r
+//_____________________________________________________________________________\r
+AliVZEROLogicalSignal::AliVZEROLogicalSignal() : TObject(), fStart(0.), fStop(0.)\r
+{\r
+       // Default constructor\r
+}\r
+//_____________________________________________________________________________\r
+AliVZEROLogicalSignal::AliVZEROLogicalSignal(Float_t start, Float_t stop) : TObject(), fStart(start), fStop(stop)\r
+{\r
+       // Constructor using start and stop time\r
+       if(fStart>fStop) AliError("Logical Signal has a Start time AFTER the Stop time");\r
+       if(fStart==fStop) AliWarning("Logical Signal has a zero width");\r
+}\r
+//_____________________________________________________________________________\r
+AliVZEROLogicalSignal::AliVZEROLogicalSignal(UShort_t profilClock, UInt_t delay) : TObject(), fStart(0.), fStop(0.)\r
+{\r
+       // Constructor using the profilClock and delay parameters comming from the FEE\r
+       \r
+       Bool_t word;\r
+       Bool_t up=kFALSE;\r
+       Bool_t down=kFALSE;\r
+       \r
+       for(int i=0 ; i<5 ; i++) {\r
+               word = (profilClock >> i) & 0x1;\r
+               if(word&&!up) {\r
+                       fStart = 5. * i;\r
+                       up = kTRUE;\r
+               }\r
+               if(!word&&up&&!down) {\r
+                       fStop = 5. * i;\r
+                       down = kTRUE;\r
+               }               \r
+       }\r
+       if(!down) fStop = 25.;\r
+       \r
+       fStart += delay*10.e-3; // Add 10 ps par register unit\r
+       fStop  += delay*10.e-3; \r
+}\r
+//_____________________________________________________________________________\r
+AliVZEROLogicalSignal::AliVZEROLogicalSignal(const AliVZEROLogicalSignal &signal) : \r
+       TObject(), fStart(signal.fStart), \r
+       fStop(signal.fStop)\r
+{\r
+       // Copy constructor\r
+}\r
+\r
+//_____________________________________________________________________________\r
+AliVZEROLogicalSignal::~AliVZEROLogicalSignal(){\r
+       // Destructor\r
+}\r
+\r
+//_____________________________________________________________________________\r
+AliVZEROLogicalSignal& AliVZEROLogicalSignal::operator = \r
+(const AliVZEROLogicalSignal& signal)\r
+{\r
+       // Operator =\r
+       fStart = signal.fStart;\r
+       fStop  = signal.fStop;\r
+       return *this;\r
+}\r
+\r
+//_____________________________________________________________________________\r
+AliVZEROLogicalSignal AliVZEROLogicalSignal::operator|(const AliVZEROLogicalSignal& signal) const \r
+{\r
+       // Perform the Logical OR of two signals: C = A or B\r
+       if((fStart>signal.fStop) || (signal.fStart>fStop))\r
+               AliError(Form("Both signal do not superpose in time.\n  Start(A) = %f Stop(A) = %f\n   Start(B) = %f Stop(B) = %f",fStart, fStop, signal.fStart,signal.fStop));\r
+       \r
+       AliVZEROLogicalSignal result;\r
+       if(fStart<signal.fStart) result.fStart = fStart;\r
+       else result.fStart = signal.fStart;\r
+       \r
+       if(fStop>signal.fStop) result.fStop = fStop;\r
+       else result.fStop = signal.fStop;\r
+               \r
+       return result;\r
+}\r
+//_____________________________________________________________________________\r
+AliVZEROLogicalSignal AliVZEROLogicalSignal::operator&(const AliVZEROLogicalSignal& signal) const\r
+{\r
+       // Perform the Logical AND of two signals: C = A and B\r
+       if((fStart>signal.fStop) || (signal.fStart>fStop))\r
+               AliError(Form("Both signal do not superpose in time.\n  Start(A) = %f Stop(A) = %f\n   Start(B) = %f Stop(B) = %f",fStart, fStop, signal.fStart,signal.fStop));\r
+       \r
+       AliVZEROLogicalSignal result;\r
+       if(fStart>signal.fStart) result.fStart = fStart;\r
+       else result.fStart = signal.fStart;\r
+       \r
+       if(fStop<signal.fStop) result.fStop = fStop;\r
+       else result.fStop = signal.fStop;\r
+       \r
+       return result;\r
+}\r
+\r
+//_____________________________________________________________________________\r
+Bool_t AliVZEROLogicalSignal::IsInCoincidence(Float_t time) const\r
+{\r
+       // Check if a signal arriving at the time "time" is in coincidence with the logical signal\r
+       Bool_t result = kFALSE;\r
+       if((time>fStart) && (time<fStop)) result = kTRUE;\r
+       return result;\r
+}\r
+\r
index cb085d1..85977dc 100644 (file)
@@ -6,6 +6,16 @@
  * See cxx source for full Copyright notice                               \r
  */\r
 \r
+\r
+// \r
+// Class AliVZEROLogicalSignal\r
+// ---------------------------\r
+// Describes a logical signal in the electronics. \r
+// Use it to generate observation windows\r
+// which are used by AliVZEROTriggerSimulator class\r
+// \r
+\r
+\r
 #include <TObject.h>\r
 \r
 class AliVZEROLogicalSignal  : public TObject {\r
@@ -13,7 +23,7 @@ public:
        AliVZEROLogicalSignal();\r
        AliVZEROLogicalSignal(Float_t start, Float_t stop);\r
        AliVZEROLogicalSignal(UShort_t profilClock, UInt_t delay);\r
-       ~AliVZEROLogicalSignal();\r
+       virtual ~AliVZEROLogicalSignal();\r
        AliVZEROLogicalSignal(const AliVZEROLogicalSignal &signal);\r
        AliVZEROLogicalSignal& operator= (const AliVZEROLogicalSignal &signal);\r
        AliVZEROLogicalSignal operator& (const AliVZEROLogicalSignal &signal) const;\r
@@ -28,7 +38,7 @@ public:
        void SetStartTime(Float_t time){fStart = time;};\r
        void SetStopTime(Float_t time){fStop = time;};\r
        \r
-       Bool_t IsInCoincidence(Float_t time);\r
+       Bool_t IsInCoincidence(Float_t time) const;\r
        \r
 private:\r
        \r
@@ -42,3 +52,4 @@ private:
 \r
 #endif // ALIVZEROLOGICALSIGNAL_H\r
 \r
+\r
index 5b44904..707b23e 100644 (file)
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-
 /* $Id$ */
+// ---------------------
+// Class AliVZEROTrigger
+// ---------------------
+// Top class to simulate the VZERO trigger response
+// This class is only used for interface with AliTriggerDetector
+// Its create and Set  Inputs of the CTP
+// The Calculation of the trigger response is done into AliVZEROTriggerSimulator
+//
+
 
 #include <TClonesArray.h>
 
 
 //______________________________________________________________________
 ClassImp(AliVZEROTrigger)
-////////////////////////////////////////////////////////////////////////
-//
-// Version 1
-//
-// AliVZEROTrigger: 
-//
-////////////////////////////////////////////////////////////////////////
 
 //______________________________________________________________________
 
@@ -127,3 +128,4 @@ void AliVZEROTrigger::Trigger()
 }
 
 
+
index 2c776bb..1a00214 100644 (file)
@@ -1,10 +1,13 @@
 #ifndef ALIVZEROTrigger_H
 #define ALIVZEROTrigger_H
-
-///_________________________________________________________________________
-///
-///  Class for making  VZERO Trigger
-///_________________________________________________________________________   
+// ---------------------
+// Class AliVZEROTrigger
+// ---------------------
+// Top class to simulate the VZERO trigger response
+// This class is only used for interface with AliTriggerDetector
+// Its create and Set  Inputs of the CTP
+// The Calculation of the trigger response is done into AliVZEROTriggerSimulator
+//
 
 
 #include "AliTriggerDetector.h"
@@ -22,3 +25,4 @@ class AliVZEROTrigger : public AliTriggerDetector
 
 #endif // AliVZEROTrigger_H
 
+
index 3401973..4bf1e11 100644 (file)
  * provided "as is" without express or implied warranty.                  *\r
  **************************************************************************/\r
 \r
+// Class AliVZEROTriggerData\r
+// -------------------------\r
+// Retrieves and hold the FEE parameters\r
+// The parameters are recieved from the shuttle \r
+// AliVZEROTriggerData is then used in the AliVZEROTriggerSimulator\r
+//\r
 \r
-//  \r
-// \r
-// \r
 #include <TObjString.h>\r
+#include <TMap.h>\r
 \r
 #include "AliLog.h"\r
 #include "AliDCSValue.h"\r
@@ -49,6 +53,7 @@ AliVZEROTriggerData::AliVZEROTriggerData() :
        fIsProcessed(kFALSE)    \r
 \r
 {\r
+       // default constructor\r
        for(int i=0; i<kNCIUBoards ;i++) {\r
                fClk1Win1[i] = fClk1Win2[i] = 0;\r
                fDelayClk1Win1[i] = fDelayClk1Win2[i] = 0;\r
@@ -81,6 +86,7 @@ AliVZEROTriggerData::AliVZEROTriggerData(Int_t nRun, UInt_t startTime, UInt_t en
        fEndTime(endTime),\r
        fIsProcessed(kFALSE)\r
 {\r
+       // Constructor\r
        for(int i=0; i<kNCIUBoards ;i++) {\r
                fClk1Win1[i] = fClk1Win2[i] = 0;\r
                fDelayClk1Win1[i] = fDelayClk1Win2[i] = 0;\r
@@ -98,9 +104,11 @@ AliVZEROTriggerData::AliVZEROTriggerData(Int_t nRun, UInt_t startTime, UInt_t en
 \r
 //________________________________________________________________\r
 AliVZEROTriggerData::~AliVZEROTriggerData(){\r
+       // destructor\r
 }\r
 //_____________________________________________________________________________\r
 void AliVZEROTriggerData::FillData(AliVZERODataFEE * data){\r
+       // Set all parameters from the data get by the shuttle\r
        TMap * params = data->GetParameters();\r
        TIter iter(params);     \r
        TObjString* aliasName;\r
@@ -116,6 +124,8 @@ void AliVZEROTriggerData::FillData(AliVZERODataFEE * data){
 \r
 //_____________________________________________________________________________\r
 void AliVZEROTriggerData::SetParameter(TString name, Float_t val){\r
+       // Set given parameter\r
+       \r
        Int_t iBoard = -1;\r
        Int_t iChannel = -1;\r
 \r
@@ -169,6 +179,7 @@ void AliVZEROTriggerData::SetParameter(TString name, Float_t val){
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetPedestalCut(UShort_t val,Int_t integrator, Int_t board, Int_t channel)\r
 {\r
+       // Set Pedestal Cut of individual channel \r
        if(board<kNCIUBoards && channel<kNChannels) {\r
                if(integrator) fPedestalCutOdd[board][channel] = val;\r
                else fPedestalCutEven[board][channel] = val;\r
@@ -177,6 +188,7 @@ void AliVZEROTriggerData::SetPedestalCut(UShort_t val,Int_t integrator, Int_t bo
 //________________________________________________________________\r
 UShort_t AliVZEROTriggerData::GetPedestalCut(Int_t integrator, Int_t board, Int_t channel)\r
 {\r
+       // Get Pedestal Cut of individual channel \r
        if(board<kNCIUBoards && channel<kNChannels) {\r
                if(integrator) return(fPedestalCutOdd[board][channel]);\r
                else return(fPedestalCutEven[board][channel]);\r
@@ -186,6 +198,7 @@ UShort_t AliVZEROTriggerData::GetPedestalCut(Int_t integrator, Int_t board, Int_
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetPedestal(UShort_t val, Int_t integrator, Int_t board, Int_t channel)\r
 {\r
+       // Set Pedestal of individual channel \r
        if(board<kNCIUBoards && channel<kNChannels) {\r
                if(integrator) fPedestalOdd[board][channel] = val;\r
                else fPedestalEven[board][channel] = val;\r
@@ -194,6 +207,7 @@ void AliVZEROTriggerData::SetPedestal(UShort_t val, Int_t integrator, Int_t boar
 //________________________________________________________________\r
 UShort_t AliVZEROTriggerData::GetPedestal(Int_t integrator, Int_t board, Int_t channel)\r
 {\r
+       // Get Pedestal of individual channel \r
        if(board<kNCIUBoards && channel<kNChannels) {\r
                if(integrator) return(fPedestalOdd[board][channel]);\r
                else return(fPedestalEven[board][channel]);\r
@@ -203,12 +217,14 @@ UShort_t AliVZEROTriggerData::GetPedestal(Int_t integrator, Int_t board, Int_t c
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayHit(UShort_t val,Int_t board, Int_t channel)\r
 {\r
+       // Set Delay of individual channel \r
        if(board<kNCIUBoards && channel<kNChannels) fDelayHit[board][channel] = val;\r
        else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));\r
 }\r
 //________________________________________________________________\r
 UShort_t AliVZEROTriggerData::GetDelayHit(Int_t board, Int_t channel)\r
 {\r
+       // Get Delay of individual channel \r
        if(board<kNCIUBoards && channel<kNChannels) return(fDelayHit[board][channel]);\r
        else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));\r
        return 0;\r
@@ -216,12 +232,14 @@ UShort_t AliVZEROTriggerData::GetDelayHit(Int_t board, Int_t channel)
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDiscriThr(UShort_t val,Int_t board, Int_t channel)\r
 {\r
+       // Set discriminator threshold\r
        if(board<kNCIUBoards && channel<kNChannels) fDiscriThr[board][channel] = val;\r
        else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));\r
 }\r
 //________________________________________________________________\r
 UShort_t AliVZEROTriggerData::GetDiscriThr(Int_t board, Int_t channel)\r
 {\r
+       // Get discriminator threshold\r
        if(board<kNCIUBoards && channel<kNChannels) return(fDiscriThr[board][channel]);\r
        else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));\r
        return 0;\r
@@ -229,12 +247,14 @@ UShort_t AliVZEROTriggerData::GetDiscriThr(Int_t board, Int_t channel)
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetEnableCharge(Bool_t val,Int_t board, Int_t channel)\r
 {\r
+       // Set the channels enabled for Charge triggers\r
        if(board<kNCIUBoards && channel<kNChannels) fEnableCharge[board][channel] = val;\r
        else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));\r
 }\r
 //________________________________________________________________\r
 Bool_t AliVZEROTriggerData::GetEnableCharge(Int_t board, Int_t channel)\r
 {\r
+       // Get the channels enabled for Charge triggers\r
        if(board<kNCIUBoards && channel<kNChannels) return(fEnableCharge[board][channel]);\r
        else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));\r
        return kFALSE;\r
@@ -242,12 +262,14 @@ Bool_t AliVZEROTriggerData::GetEnableCharge(Int_t board, Int_t channel)
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetEnableTiming(Bool_t val,Int_t board, Int_t channel)\r
 {\r
+       // Set the channels enabled for Timing triggers\r
        if(board<kNCIUBoards && channel<kNChannels) fEnableTiming[board][channel] = val;\r
        else AliError(Form("Impossible to write at : Board %d ; Channel %d",board,channel));\r
 }\r
 //________________________________________________________________\r
 Bool_t AliVZEROTriggerData::GetEnableTiming(Int_t board, Int_t channel)\r
 {\r
+       // Get the channels enabled for Timing triggers\r
        if(board<kNCIUBoards && channel<kNChannels) return(fEnableTiming[board][channel]);\r
        else AliError(Form("Impossible to read at : Board %d ; Channel %d",board,channel));\r
        return kFALSE;\r
@@ -255,6 +277,7 @@ Bool_t AliVZEROTriggerData::GetEnableTiming(Int_t board, Int_t channel)
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetTriggerSelected(UShort_t trigger, Int_t output)\r
 {\r
+       // Set the trigger selected on the outputs to CTP\r
        if(output<kNTriggerOutputs) fTriggerSelected[output] = trigger;\r
        else AliError(Form("Trigger output number %d not valid",output));\r
 }\r
@@ -262,60 +285,70 @@ void AliVZEROTriggerData::SetTriggerSelected(UShort_t trigger, Int_t output)
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk1Win1(UShort_t* clks)\r
 {\r
+       // Set Win clock of BB\r
        if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk1Win1(clks[t],t);\r
        else AliFatal("Profil Clock1 Win1 Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk2Win1(UShort_t* clks)\r
 {\r
+       // Set Win clock of BB\r
        if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk2Win1(clks[t],t);\r
        else AliFatal("Profil Clock2 Win1 Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk1Win1(UShort_t clk, Int_t board)\r
 {\r
+       // Set Win clock of BB\r
        if(IsClkValid(clk) && (board<kNCIUBoards)) fClk1Win1[board] = clk;\r
        else AliError(Form("Profil Clock1 Win1 of board %d is not valid : %d",board,clk));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk2Win1(UShort_t clk, Int_t board)\r
 {\r
+       // Set Win clock of BB\r
        if(IsClkValid(clk) && (board<kNCIUBoards)) fClk2Win1[board] = clk;\r
        else AliError(Form("Profil Clock2 Win1 of board %d is not valid",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk1Win2(UShort_t* clks)\r
 {\r
+       // Set Win clock of BG\r
        if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk1Win2(clks[t],t);\r
        else AliFatal("Profil Clock1 Win2 Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk2Win2(UShort_t* clks)\r
 {\r
+       // Set Win clock of BG\r
        if(clks) for(int t=0; t<kNCIUBoards; t++) SetClk2Win2(clks[t],t);\r
        else AliFatal("Profil Clock2 Win2 Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk1Win2(UShort_t clk, Int_t board)\r
 {\r
+       // Set Win clock of BG\r
        if(IsClkValid(clk) && (board<kNCIUBoards)) fClk1Win2[board] = clk;\r
        else AliError(Form("Profil Clock1 Win2 of board %d is not valid",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetClk2Win2(UShort_t clk, Int_t board)\r
 {\r
+       // Set Win clock of BG\r
        if(IsClkValid(clk) && (board<kNCIUBoards)) fClk2Win2[board] = clk;\r
        else AliError(Form("Profil Clock2 Win2 of board %d is not valid",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk1Win1(UShort_t* delays)\r
 {\r
+       // Set Delay for Win clock of BB\r
        if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk1Win1(delays[t],t);\r
        else AliFatal("Profil Clock1 Win1 Delays Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk1Win1(UShort_t delay, Int_t board)\r
 {\r
+       // Set Delay for Win clock of BB\r
        if(delay>1023){\r
                AliWarning(Form("Profil Clock1 Win1 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));\r
                delay = delay & 0x3FF;\r
@@ -326,12 +359,14 @@ void AliVZEROTriggerData::SetDelayClk1Win1(UShort_t delay, Int_t board)
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk2Win1(UShort_t* delays)\r
 {\r
+       // Set Delay for Win clock of BB\r
        if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk2Win1(delays[t],t);\r
        else AliFatal("Profil Clock2 Win1 Delays Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk2Win1(UShort_t delay, Int_t board)\r
 {\r
+       // Set Delay for Win clock of BB\r
        if(delay>1023){\r
                AliWarning(Form("Profil Clock2 Win1 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));\r
                delay = delay & 0x3FF;\r
@@ -342,12 +377,14 @@ void AliVZEROTriggerData::SetDelayClk2Win1(UShort_t delay, Int_t board)
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk1Win2(UShort_t* delays)\r
 {\r
+       // Set Delay for Win clock of BG\r
        if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk1Win2(delays[t],t);\r
        else AliFatal("Profil Clock1 Win2 Delays Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk1Win2(UShort_t delay, Int_t board)\r
 {\r
+       // Set Delay for Win clock of BG\r
        if(delay>1023){\r
                AliWarning(Form("Profil Clock1 Win2 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));\r
                delay = delay & 0x3FF;\r
@@ -358,12 +395,14 @@ void AliVZEROTriggerData::SetDelayClk1Win2(UShort_t delay, Int_t board)
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk2Win2(UShort_t* delays)\r
 {\r
+       // Set Delay for Win clock of BG\r
        if(delays) for(int t=0; t<kNCIUBoards; t++) SetDelayClk2Win2(delays[t],t);\r
        else AliFatal("Profil Clock2 Win2 Delays Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetDelayClk2Win2(UShort_t delay, Int_t board)\r
 {\r
+       // Set Delay for Win clock of BG\r
        if(delay>1023){\r
                AliWarning(Form("Profil Clock2 Win2 Delay of board %d should be less 1023 is currently %d. Truncated to the first 10 bits",board, delay));\r
                delay = delay & 0x3FF;\r
@@ -373,50 +412,59 @@ void AliVZEROTriggerData::SetDelayClk2Win2(UShort_t delay, Int_t board)
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetLatchWin1(UShort_t *latchs){\r
+       // Set Latch Win clock for BB\r
        if(latchs) for(int t=0; t<kNCIUBoards; t++) SetLatchWin1(latchs[t],t);\r
        else AliFatal("Latch Win1 profil Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetLatchWin1(UShort_t latch, Int_t board)\r
 {\r
+       // Set Latch Win clock for BB\r
        if(IsClkValid(latch) && (board<kNCIUBoards)) fLatchWin1[board] = latch;\r
        else AliError(Form("Latch Win1 profil of board %d is not valid",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetLatchWin2(UShort_t *latchs){\r
+       // Set Latch Win clock for BG\r
        if(latchs) for(int t=0; t<kNCIUBoards; t++) SetLatchWin2(latchs[t],t);\r
        else AliFatal("Latch Win2 profil Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetLatchWin2(UShort_t latch, Int_t board)\r
 {\r
+       // Set Latch Win clock for BG\r
        if(IsClkValid(latch) && (board<kNCIUBoards)) fLatchWin2[board] = latch;\r
        else AliError(Form("Latch Win2 profil of board %d is not valid",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetResetWin1(UShort_t *resets){\r
+       // Set Reset Win clock for BB\r
        if(resets) for(int t=0; t<kNCIUBoards; t++) SetResetWin1(resets[t],t);\r
        else AliFatal("Reset Win1 profil Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetResetWin1(UShort_t reset, Int_t board)\r
 {\r
+       // Set Reset Win clock for BB\r
        if(IsClkValid(reset) && (board<kNCIUBoards)) fResetWin1[board] = reset;\r
        else AliError(Form("Reset Win1 profil of board %d is not valid",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetResetWin2(UShort_t *resets){\r
+       // Set Reset Win clock for BG\r
        if(resets)  for(int t=0; t<kNCIUBoards; t++) SetResetWin2(resets[t],t);\r
        else AliFatal("Reset Win2 profil Not defined.");\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetResetWin2(UShort_t reset, Int_t board)\r
 {\r
+       // Set Reset Win clock for BG\r
        if(IsClkValid(reset) && (board<kNCIUBoards)) fResetWin2[board] = reset;\r
        else AliError(Form("Reset Win2 profil of board %d is not valid",board));\r
 }\r
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetPedestalSubtraction(Bool_t *peds){\r
+       // Set Pedestal Subtraction Parameter\r
        if(peds)  for(int t=0; t<kNCIUBoards; t++) SetPedestalSubtraction(peds[t],t);\r
        else AliFatal("Pedestal Subtraction Not defined.");\r
        \r
@@ -424,31 +472,34 @@ void AliVZEROTriggerData::SetPedestalSubtraction(Bool_t *peds){
 //________________________________________________________________\r
 void AliVZEROTriggerData::SetPedestalSubtraction(Bool_t ped, Int_t board)\r
 {\r
+       // Set Pedestal Subtraction Parameter\r
        if((board<kNCIUBoards)) fPedestalSubtraction[board] = ped;\r
        else AliError(Form("Board %d is not valid",board));\r
 }\r
 \r
 //________________________________________________________________\r
-Bool_t AliVZEROTriggerData::IsClkValid(UShort_t clock){\r
+Bool_t AliVZEROTriggerData::IsClkValid(UShort_t clock) const {\r
+       // Check if the given clock has a valid profil.\r
        Bool_t word[5];\r
        Bool_t isValid = kTRUE;\r
-       Short_t RisingEdge = 0;\r
-       Short_t FallingEdge = 0;\r
+       Short_t risingEdge = 0;\r
+       Short_t fallingEdge = 0;\r
        for(int i=0 ; i<5 ; i++) word[i] = (clock >> i) & 0x1;\r
        \r
        if(word[0] != word[4]){\r
-               if(word[4]) FallingEdge++;\r
-               else RisingEdge++;\r
+               if(word[4]) fallingEdge++;\r
+               else risingEdge++;\r
        }       \r
        for(int i=1 ; i<5 ; i++){\r
                if(word[i] != word[i-1]) {\r
-                       if(word[i-1]) FallingEdge++;\r
-                       else RisingEdge++;\r
+                       if(word[i-1]) fallingEdge++;\r
+                       else risingEdge++;\r
                }\r
        }\r
-       if((FallingEdge>1)||(RisingEdge>1)) isValid = kFALSE;\r
-       if(((RisingEdge==0)&&(FallingEdge==0)) &&(!word[0]))  isValid = kFALSE;\r
+       if((fallingEdge>1)||(risingEdge>1)) isValid = kFALSE;\r
+       if(((risingEdge==0)&&(fallingEdge==0)) &&(!word[0]))  isValid = kFALSE;\r
        return isValid;\r
 }\r
 \r
 \r
+\r
index 087e33f..1ceb7c9 100644 (file)
@@ -5,10 +5,19 @@
  *\r
  * See cxx source for full Copyright notice                               \r
  */\r
-#include "AliVZERODataFEE.h"\r
+\r
+// Class AliVZEROTriggerData\r
+// -------------------------\r
+// Retrieves and hold the FEE parameters\r
+// The parameters are recieved from the shuttle \r
+// AliVZEROTriggerData is then used in the AliVZEROTriggerSimulator\r
+//\r
 \r
 #include <TNamed.h>\r
 \r
+#include "AliVZERODataFEE.h"\r
+\r
+\r
 class AliVZEROTriggerData : public TNamed {\r
 public:\r
        AliVZEROTriggerData();\r
@@ -202,7 +211,7 @@ private:
        TString fAliasNames[kNAliases]; // aliases for DCS data\r
        Bool_t fIsProcessed; // bool to know processing status\r
        \r
-       Bool_t  IsClkValid(UShort_t clock);\r
+       Bool_t  IsClkValid(UShort_t clock) const;\r
        void SetParameter(TString name, Float_t val);\r
        \r
        \r
@@ -211,4 +220,5 @@ private:
 };\r
 \r
 #endif // ALIVZEROTRIGGERDATA_H\r
-
+\r
+\r
index bb90290..518bad6 100644 (file)
  * 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
+// Class AliVZEROTriggerSimulator\r
+// ------------------------------\r
 //  Simulate the VZERO Trigger response\r
 // Use FEE parameters stored in Database\r
 // Can work on real data or in simulation\r
-#include "TTree.h"\r
-#include "TClonesArray.h"\r
+//\r
+\r
+#include <TTree.h>\r
+#include <TClonesArray.h>\r
 \r
 #include "AliLog.h"\r
 #include "AliCDBManager.h"\r
@@ -36,6 +39,7 @@ ClassImp(AliVZEROTriggerSimulator)
 AliVZEROTriggerSimulator::AliVZEROTriggerSimulator(TTree * digitsTree, TClonesArray* digits) : \r
 TObject(),fTriggerData(NULL),fDigitsTree(digitsTree),fDigits(digits),fTriggerWord(0)\r
 {\r
+       // constructor\r
        fTriggerData = LoadTriggerData();\r
        \r
        for(int i=0;i<64;i++) {\r
@@ -55,6 +59,7 @@ TObject(),fTriggerData(NULL),fDigitsTree(digitsTree),fDigits(digits),fTriggerWor
 AliVZEROTriggerSimulator::AliVZEROTriggerSimulator() : \r
 TObject(),fTriggerData(NULL),fDigitsTree(NULL),fDigits(NULL),fTriggerWord(0)\r
 {\r
+       // Default constructor\r
        fTriggerData = LoadTriggerData();\r
 \r
        for(int i=0;i<64;i++) {\r
@@ -73,6 +78,7 @@ TObject(),fTriggerData(NULL),fDigitsTree(NULL),fDigits(NULL),fTriggerWord(0)
 \r
 //_____________________________________________________________________________\r
 AliVZEROTriggerSimulator::~AliVZEROTriggerSimulator(){\r
+// Destructor\r
        if(fBBGate) delete [] fBBGate;\r
        if(fBGGate) delete [] fBGGate;\r
        if(fBBLatch) delete [] fBBLatch;\r
@@ -84,19 +90,21 @@ AliVZEROTriggerSimulator::~AliVZEROTriggerSimulator(){
 //_____________________________________________________________________________\r
 void AliVZEROTriggerSimulator::GenerateBBWindows() \r
 {\r
+       // Generates the BB observation window\r
        for (int i=0; i<AliVZEROTriggerData::kNCIUBoards; i++) {\r
-               AliVZEROLogicalSignal Clk1BB(fTriggerData->GetClk1Win1(i),fTriggerData->GetDelayClk1Win1(i));\r
-               AliVZEROLogicalSignal Clk2BB(fTriggerData->GetClk2Win1(i),fTriggerData->GetDelayClk2Win1(i));\r
-               fBBGate[i] = new AliVZEROLogicalSignal(Clk1BB & Clk2BB);\r
+               AliVZEROLogicalSignal clk1BB(fTriggerData->GetClk1Win1(i),fTriggerData->GetDelayClk1Win1(i));\r
+               AliVZEROLogicalSignal clk2BB(fTriggerData->GetClk2Win1(i),fTriggerData->GetDelayClk2Win1(i));\r
+               fBBGate[i] = new AliVZEROLogicalSignal(clk1BB & clk2BB);\r
        }\r
 }\r
 //_____________________________________________________________________________\r
 void AliVZEROTriggerSimulator::GenerateBGWindows() \r
 {\r
+       // Generates the BG observation window\r
        for (int i=0; i<AliVZEROTriggerData::kNCIUBoards; i++) {\r
-               AliVZEROLogicalSignal Clk1BG(fTriggerData->GetClk1Win2(i),fTriggerData->GetDelayClk1Win2(i));\r
-               AliVZEROLogicalSignal Clk2BG(fTriggerData->GetClk2Win2(i),fTriggerData->GetDelayClk2Win2(i));\r
-               fBGGate[i] = new AliVZEROLogicalSignal(Clk1BG & Clk2BG);\r
+               AliVZEROLogicalSignal clk1BG(fTriggerData->GetClk1Win2(i),fTriggerData->GetDelayClk1Win2(i));\r
+               AliVZEROLogicalSignal clk2BG(fTriggerData->GetClk2Win2(i),fTriggerData->GetDelayClk2Win2(i));\r
+               fBGGate[i] = new AliVZEROLogicalSignal(clk1BG & clk2BG);\r
        }\r
 }\r
 \r
@@ -150,12 +158,13 @@ void AliVZEROTriggerSimulator::Run() {
                        \r
                        if(fTriggerData->GetEnableCharge(board,channel)) {\r
                                fCharges[pmNumber] = digit->ADC();\r
-                               if(fTriggerData->GetPedestalSubtraction(board)) \r
+                               if(fTriggerData->GetPedestalSubtraction(board)) {\r
                                        if(fCharges[pmNumber]>=fTriggerData->GetPedestalCut(integrator,board,channel)){ \r
                                                fCharges[pmNumber] -= fTriggerData->GetPedestal(integrator,board,channel);\r
                                        } else {\r
                                                fCharges[pmNumber] = 0;\r
                                        }\r
+                               }\r
                        } else {\r
                                fCharges[pmNumber] = 0;\r
                        }\r
@@ -163,7 +172,7 @@ void AliVZEROTriggerSimulator::Run() {
                        Float_t time = (Float_t)digit->Time() / 10.; // digit->Time() in bin of 100 picoseconds. Divide by 10 to have it in nanoseconds\r
                        time += fTriggerData->GetDelayHit(board,channel);\r
                        \r
-                       AliInfo(Form(" PM nb : %d ; ADC= %d ; TDC= %f  Enable Time %d charge %d",pmNumber,digit->ADC(),time,fTriggerData->GetEnableTiming(board,channel),fTriggerData->GetEnableCharge(board,channel)));\r
+                       //AliInfo(Form(" PM nb : %d ; ADC= %d ; TDC= %f  Enable Time %d charge %d",pmNumber,digit->ADC(),time,fTriggerData->GetEnableTiming(board,channel),fTriggerData->GetEnableCharge(board,channel)));\r
                        fBBFlags[pmNumber] = fTriggerData->GetEnableTiming(board,channel) && fBBGate[board]->IsInCoincidence(time);\r
                        fBGFlags[pmNumber] = fTriggerData->GetEnableTiming(board,channel) && fBGGate[board]->IsInCoincidence(time);\r
                        \r
@@ -242,10 +251,11 @@ void AliVZEROTriggerSimulator::Run() {
        // (BGA and BBC) or (BGC and BBA) (Beam Gas from one of the two sides)\r
        if(GetBGAandBBC() || GetBGCandBBA()) SetBeamGas();\r
 \r
-       AliInfo(Form("BB Flags : V0A = %d  V0C = %d ",nBBflagsV0A, nBBflagsV0C )); \r
-       AliInfo(Form("BG Flags : V0A = %d  V0C = %d ",nBGflagsV0A, nBGflagsV0C )); \r
-       AliInfo(Form("Charges  : V0A = %d  V0C = %d ",chargeV0A, chargeV0C )); \r
+//     AliInfo(Form("BB Flags : V0A = %d  V0C = %d ",nBBflagsV0A, nBBflagsV0C )); \r
+//     AliInfo(Form("BG Flags : V0A = %d  V0C = %d ",nBGflagsV0A, nBGflagsV0C )); \r
+//     AliInfo(Form("Charges  : V0A = %d  V0C = %d ",chargeV0A, chargeV0C )); \r
        \r
 }\r
 \r
 \r
+\r
index c474888..714b85d 100644 (file)
@@ -5,6 +5,13 @@
  *\r
  * See cxx source for full Copyright notice                               \r
  */\r
+// \r
+// Class AliVZEROTriggerSimulator\r
+// ------------------------------\r
+//  Simulate the VZERO Trigger response\r
+// Use FEE parameters stored in Database\r
+// Can work on real data or in simulation\r
+//\r
 \r
 #include <TObject.h>\r
 \r
@@ -67,24 +74,24 @@ private:
        void GenerateBGWindows();\r
        \r
        // Members\r
-       AliVZEROLogicalSignal * fBBGate[AliVZEROTriggerData::kNCIUBoards];\r
-       AliVZEROLogicalSignal * fBBLatch[AliVZEROTriggerData::kNCIUBoards];\r
-       AliVZEROLogicalSignal * fBBReset[AliVZEROTriggerData::kNCIUBoards];\r
+       AliVZEROLogicalSignal * fBBGate[AliVZEROTriggerData::kNCIUBoards];  // BB Observation window\r
+       AliVZEROLogicalSignal * fBBLatch[AliVZEROTriggerData::kNCIUBoards]; // BB Latch window\r
+       AliVZEROLogicalSignal * fBBReset[AliVZEROTriggerData::kNCIUBoards]; // BB Reset Window\r
        \r
-       AliVZEROLogicalSignal * fBGGate[AliVZEROTriggerData::kNCIUBoards];\r
-       AliVZEROLogicalSignal * fBGLatch[AliVZEROTriggerData::kNCIUBoards];\r
-       AliVZEROLogicalSignal * fBGReset[AliVZEROTriggerData::kNCIUBoards];\r
+       AliVZEROLogicalSignal * fBGGate[AliVZEROTriggerData::kNCIUBoards];  // BG Observation window\r
+       AliVZEROLogicalSignal * fBGLatch[AliVZEROTriggerData::kNCIUBoards]; // BG Latch Window\r
+       AliVZEROLogicalSignal * fBGReset[AliVZEROTriggerData::kNCIUBoards]; // BG Reset Window\r
 \r
        AliVZEROTriggerData *fTriggerData; // Object holding the trigger configuration parameters\r
        \r
-       TTree* fDigitsTree;\r
-       TClonesArray* fDigits;\r
+       TTree* fDigitsTree; //Pointer to VZERO digit tree\r
+       TClonesArray* fDigits; //Pointer to VZERO digit array\r
        \r
-       Bool_t fBBFlags[64];\r
-       Bool_t fBGFlags[64];\r
-       Int_t  fCharges[64];\r
+       Bool_t fBBFlags[64]; // Individual BB Flags\r
+       Bool_t fBGFlags[64]; // Individual BG Flags\r
+       Int_t  fCharges[64]; // Individual Charge\r
        \r
-       UShort_t fTriggerWord;\r
+       UShort_t fTriggerWord; // Word holding the 16 triggers return by the FEE\r
                \r
        ClassDef( AliVZEROTriggerSimulator, 1 )  \r
 \r
@@ -93,3 +100,4 @@ private:
 \r
 #endif // ALIVZEROTRIGGERSIMULATOR_H\r
 \r
+\r