]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
ZDC scalers (Chiara)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 3 Jul 2009 23:05:30 +0000 (23:05 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 3 Jul 2009 23:05:30 +0000 (23:05 +0000)
STEER/AliESDZDCScalers.cxx [new file with mode: 0644]
STEER/AliESDZDCScalers.h [new file with mode: 0644]
STEER/CMake_libESD.txt
STEER/ESDLinkDef.h
STEER/libESD.pkg

diff --git a/STEER/AliESDZDCScalers.cxx b/STEER/AliESDZDCScalers.cxx
new file mode 100644 (file)
index 0000000..896038b
--- /dev/null
@@ -0,0 +1,98 @@
+/**************************************************************************
+ * 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.                  *
+ **************************************************************************/
+
+
+//-------------------------------------------------------------------------
+//  This class is used to store data in events where scalers are read
+//   in SOFTWARE_TRIGGER events, no ADC datum filled in such events
+//  Author: Chiara Oppedisano  Chiara.Oppedisano@to.infn.it    
+//-------------------------------------------------------------------------
+
+#include "AliESDZDCScalers.h"
+
+ClassImp(AliESDZDCScalers)
+
+//______________________________________________________________________________
+AliESDZDCScalers::AliESDZDCScalers() :
+  TObject()
+{
+  // constructor
+  for(Int_t i=0; i<2; i++)  fScalerDown[i]=0;
+  for(Int_t i=0; i<8; i++)  fScalerUp[i]=0;
+  for(Int_t i=0; i<32; i++) fVMEScaler[i]=0;
+
+}//______________________________________________________________________________
+AliESDZDCScalers::AliESDZDCScalers(const AliESDZDCScalers& zdc) :
+  TObject(zdc)
+{
+  // copy constructor
+  for(Int_t i=0; i<32; i++){
+     if(i<2) fScalerDown[i] = zdc.fScalerDown[i];
+     if(i<8) fScalerUp[i] = zdc.fScalerUp[i];
+     fVMEScaler[i] = zdc.fVMEScaler[i];
+  }
+}
+
+//______________________________________________________________________________
+AliESDZDCScalers& AliESDZDCScalers::operator=(const AliESDZDCScalers&zdc)
+{
+  // assigment operator
+  if(this!=&zdc) {
+    TObject::operator=(zdc);
+    for(Int_t i=0; i<32; i++){
+       if(i<2) fScalerDown[i] = zdc.fScalerDown[i];
+       if(i<8) fScalerUp[i] = zdc.fScalerUp[i];
+       fVMEScaler[i] = zdc.fVMEScaler[i];
+    }
+  } 
+  return *this;
+}
+
+//______________________________________________________________________________
+void AliESDZDCScalers::Copy(TObject &obj) const {
+  
+  // this overwrites the virtual TOBject::Copy()
+  // to allow run time copying without casting
+  // in AliESDEvent
+
+  if(this==&obj)return;
+  AliESDZDCScalers *robj = dynamic_cast<AliESDZDCScalers*>(&obj);
+  if(!robj)return; // not an AliESDZDCScalers
+  *robj = *this;
+
+}
+
+
+//______________________________________________________________________________
+void AliESDZDCScalers::Reset()
+{
+  // reset all data members
+  for(Int_t i=0; i<32; i++){
+     if(i<2) fScalerDown[i] = 0;
+     if(i<8) fScalerUp[i] = 0;
+     fVMEScaler[i] = 0;
+  }
+}
+
+//______________________________________________________________________________
+void AliESDZDCScalers::Print(const Option_t *) const
+{
+  //  Print ESD scaler events for the ZDC
+  printf("\n");
+  for(Int_t i=0; i<2; i++) printf("\tfScalerDown[%d] = %d \n",i,fScalerDown[i]);
+  for(Int_t i=0; i<8; i++) printf("\tfScalerUp[%d] = %d \n",i,fScalerUp[i]);
+  for(Int_t i=0; i<32; i++) printf("\tfVMEScaler[%d] = %d \n",i,fVMEScaler[i]);
+  printf("\n");
+}
diff --git a/STEER/AliESDZDCScalers.h b/STEER/AliESDZDCScalers.h
new file mode 100644 (file)
index 0000000..a316069
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef ALIESDZDCSCALERS_H
+#define ALIESDZDCSCALERS_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//-------------------------------------------------------------------------
+//  This class is used to store data in events where scalers are read
+//  Scaler format: 1(in)+1(out) floats from Benotto's card downstairs
+//                4(in)+4(out) floats from Benotto's card upstairs
+//                32 floats from VME scaler
+//-------------------------------------------------------------------------
+
+#include <TObject.h>
+#include <TMath.h>
+
+
+class AliESDZDCScalers: public TObject {
+
+public:
+  AliESDZDCScalers();
+  AliESDZDCScalers(const AliESDZDCScalers& zdc);
+  AliESDZDCScalers& operator=(const AliESDZDCScalers& zdc);
+  virtual void Copy(TObject &obj) const;
+  
+  UInt_t GetScalerDown(Int_t i) const {return fScalerDown[i];}
+  UInt_t GetScalerUp(Int_t i)   const {return fScalerUp[i];}
+  UInt_t GetVMEScaler(Int_t i)  const {return fVMEScaler[i];}
+  const UInt_t* GetScalerDown() const {return fScalerDown;}
+  const UInt_t* GetScalerUp()   const {return fScalerUp;}
+  const UInt_t* GetVMEScaler()  const {return fVMEScaler;}
+  
+  void SetScalerDown(UInt_t count[2]) 
+       {for(Int_t k=0; k<2; k++) fScalerDown[k] = count[k];}
+  void SetScalerUp(UInt_t count[8]) 
+       {for(Int_t k=0; k<8; k++) fScalerUp[k] = count[k];}
+  void SetVMEScaler(UInt_t count[32]) 
+       {for(Int_t k=0; k<32; k++) fVMEScaler[k] = count[k];}
+
+  void    Reset();
+  void    Print(const Option_t *opt=0) const;
+
+private:
+  UInt_t fScalerDown[2]; // counts from Benotto's card downstairs
+  UInt_t fScalerUp[8];   // counts from Benotto's card upstairs
+  UInt_t fVMEScaler[32]; // counts from VME scaler
+
+  ClassDef(AliESDZDCScalers,1)
+  
+};
+
+#endif
index 2c39226f29316973eeaa93dfcd56e73fc6b73dca..8cae8c51909d16dc82b2702eb886b8fb6e8a6ece 100644 (file)
@@ -32,6 +32,7 @@ set(SRCS
        AliTOFpidESD.cxx
        AliTriggerScalersESD.cxx
        AliTriggerScalersRecordESD.cxx 
+       AliESDZDCScalers.cxx
 )
 
 # fill list of header files from list of source files
index d00d8cc2846c615ed0963d35686a9c4d66195355..e363119e9d94d61c912435b8a24a77d5a384faf0 100644 (file)
@@ -79,6 +79,7 @@
 
 #pragma link C++ class  AliTriggerScalersESD+;
 #pragma link C++ class  AliTriggerScalersRecordESD+;
+#pragma link C++ class  AliESDZDCScalers+;
   
 #endif
 
index 4d8c4d9e95a6323da394ec1ae005d4e422877290..4dab3e80ed01d4f265e5d9ba610a6210f0ba347e 100644 (file)
@@ -30,7 +30,8 @@ SRCS = AliESDEvent.cxx AliESDInputHandler.cxx AliESDInputHandlerRP.cxx AliESDfri
        AliTPCpidESD.cxx \
        AliTOFpidESD.cxx \
        AliTriggerScalersESD.cxx \
-       AliTriggerScalersRecordESD.cxx 
+       AliTriggerScalersRecordESD.cxx \
+       AliESDZDCScalers.cxx
 
 HDRS:= $(SRCS:.cxx=.h)