--- /dev/null
+/**************************************************************************
+ * 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");
+}
--- /dev/null
+#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