--- /dev/null
+////////////////////////////////////////////////////
+// Base class to define //
+// ITS beam test //
+// //
+// Origin: E. Crescio crescio@to.infn.it //
+////////////////////////////////////////////////////
+
+#include "AliITSBeamTest.h"
+
+const Int_t AliITSBeamTest::fgkNumberOfSPD=6;
+const Int_t AliITSBeamTest::fgkNumberOfSDD=2;
+const Int_t AliITSBeamTest::fgkNumberOfSSD=4;
+
+
+ClassImp(AliITSBeamTest)
+
+
+//_____________________________________________________________
+AliITSBeamTest::AliITSBeamTest() : AliITS()
+{
+ //
+ // Constructor
+ //
+
+
+ SetNumberOfSPD(fgkNumberOfSPD);
+ SetNumberOfSDD(fgkNumberOfSDD);
+ SetNumberOfSSD(fgkNumberOfSSD);
+}
+
+//_____________________________________________________________
+AliITSBeamTest::AliITSBeamTest(const char* name,const char *title) : AliITS(name,title)
+{
+ //
+ // Constructor
+ //
+
+
+ SetNumberOfSPD(fgkNumberOfSPD);
+ SetNumberOfSDD(fgkNumberOfSDD);
+ SetNumberOfSSD(fgkNumberOfSSD);
+}
+
+
+//__________________________________________________________________
+AliITSBeamTest::~AliITSBeamTest()
+{
+ //
+ // Destructor
+ //
+
+}
+
+//____________________________________________________________________
+Int_t AliITSBeamTest::GetNumberOfSubDet(const TString& det) const{
+
+ if(det.Contains("SPD")) return fNspd;
+ if(det.Contains("SDD")) return fNsdd;
+ if(det.Contains("SSD")) return fNssd;
+ return 0;
+}
--- /dev/null
+#ifndef ALIITSBEAMTEST_H
+#define ALIITSBEAMTEST_H
+
+////////////////////////////////////////////////////
+// Base class to define //
+// ITS beam test //
+// //
+// Origin: E. Crescio crescio@to.infn.it //
+////////////////////////////////////////////////////
+
+#include "AliITS.h"
+
+typedef enum {kAug04,kNov04} BeamtestPeriod_t;
+
+class AliITSBeamTest : public AliITS {
+
+ public:
+
+
+ AliITSBeamTest();
+ AliITSBeamTest(const char* name,const char *title);
+ virtual ~AliITSBeamTest();
+
+ virtual void SetNumberOfSPD(Int_t nSPD) {fNspd=nSPD;}
+ virtual void SetNumberOfSDD(Int_t nSDD) {fNsdd=nSDD;}
+ virtual void SetNumberOfSSD(Int_t nSSD) {fNssd=nSSD;}
+
+ Int_t GetNSPD() const {return fNspd;}
+ Int_t GetNSDD() const {return fNsdd;}
+ Int_t GetNSSD() const {return fNssd;}
+
+ Int_t GetNumberOfSubDet(const TString& det) const;
+
+
+ protected:
+
+ static const Int_t fgkNumberOfSPD; //number of SPD detectors
+ static const Int_t fgkNumberOfSDD; //number of SDD detectors
+ static const Int_t fgkNumberOfSSD; //number of SSD detectors
+
+
+ Int_t fNspd; //Number of SPD modules
+ Int_t fNsdd; //Number of SDD modules
+ Int_t fNssd; //Number of SSD modules
+
+
+ ClassDef(AliITSBeamTest,0) // An Alice ITS beam test
+
+ };
+
+
+#endif
+
+
--- /dev/null
+////////////////////////////////////////////////////
+// Class to define //
+// beam test raw 2 dig conv. //
+// Origin: E. Crescio crescio@to.infn.it //
+// //
+////////////////////////////////////////////////////
+
+#include "AliITSBeamTestDig.h"
+
+ClassImp(AliITSBeamTestDig)
+
+
+
+//_____________________________________________________________
+ AliITSBeamTestDig::AliITSBeamTestDig(): TTask()
+{
+ //
+ // Default constructor
+ //
+ fReaderDate=0;
+ fTreeD=0;
+ fBt=0;
+ fITSHeader=0;
+}
+
+//_____________________________________________________________
+ AliITSBeamTestDig::AliITSBeamTestDig(const Text_t* name, const Text_t* title): TTask(name,title)
+{
+ //
+ // Standard constructor
+ //
+
+ fReaderDate=0;
+ fTreeD=0;
+ fBt=0;
+ fITSHeader=0;
+
+}
+
+//______________________________________________________________________
+AliITSBeamTestDig::AliITSBeamTestDig(const AliITSBeamTestDig &bt):TTask(bt){
+ // Copy constructor.
+
+ fReaderDate=bt.fReaderDate;
+ fTreeD=bt.fTreeD;
+ fBt=bt.fBt;
+ fITSHeader=bt.fITSHeader;
+}
+//______________________________________________________________________
+AliITSBeamTestDig& AliITSBeamTestDig::operator=(AliITSBeamTestDig &bt){
+ // Assignment operator. This is a function which is not allowed to be
+ // done to the ITS beam test dig. It exits with an error.
+ // Inputs:
+ if(this==&bt) return *this;
+ Error("operator=","You are not allowed to make a copy of the AliITSBeamTestDig");
+ exit(1);
+ return *this; //fake return
+}
+
+
+
+
--- /dev/null
+#ifndef ALIITSBEAMTESTDIG_H
+#define ALIITSBEAMTESTDIG_H
+
+////////////////////////////////////////////////////
+// Class to define //
+// beam test raw 2 dig conv. //
+// Origin: E. Crescio crescio@to.infn.it //
+// November 2004 //
+////////////////////////////////////////////////////
+
+#include "TTask.h"
+#include "AliITSEventHeader.h"
+
+class AliITSBeamTest;
+class AliRawReaderDate;
+class TTree;
+
+
+class AliITSBeamTestDig: public TTask {
+
+ public:
+
+
+ AliITSBeamTestDig();
+ AliITSBeamTestDig(const Text_t* name, const Text_t* title);
+ AliITSBeamTestDig(const AliITSBeamTestDig& bt);
+ AliITSBeamTestDig& operator=(AliITSBeamTestDig &bt);
+ virtual ~AliITSBeamTestDig() {}
+
+ void SetRawReaderDate(AliRawReaderDate* rd) {fReaderDate=rd;}
+ void SetTree(TTree* treedig) {fTreeD=treedig;}
+ void SetITSEventHeader(AliITSEventHeader* header){fITSHeader = header;}
+
+ void SetBeamTest(AliITSBeamTest* bt) {fBt=bt;}
+
+
+ protected:
+
+ AliITSEventHeader* fITSHeader; // its event header
+ AliRawReaderDate* fReaderDate; // !reader date;
+ TTree* fTreeD; // tree of digits
+
+ AliITSBeamTest* fBt; // !beam test object
+
+ ClassDef(AliITSBeamTestDig,1) // its beam test digitization
+
+ };
+
+
+
+#endif
+
+
--- /dev/null
+////////////////////////////////////////////////////
+// Class to define //
+// SDD beam test raw 2 dig conv. //
+// Origin: E. Crescio crescio@to.infn.it //
+// //
+// //
+////////////////////////////////////////////////////
+#include "AliITSdigitSDD.h"
+#include "AliRawReaderDate.h"
+#include "AliITSRawStreamSDDv2.h"
+#include "AliITSRawStreamSDDv3.h"
+#include "AliITSRawStreamSDD.h"
+#include "AliITSBeamTestDigSDD.h"
+#include "AliITSBeamTest.h"
+
+ClassImp(AliITSBeamTestDigSDD)
+
+//_____________________________________________________________
+ AliITSBeamTestDigSDD::AliITSBeamTestDigSDD(): AliITSBeamTestDig()
+{
+ //
+ // Constructor
+ //
+ SetBtPeriod();
+ fSubEventAttributes=0;
+ fThreshold=0;
+ fStreamer=0;
+}
+
+//_____________________________________________________________
+AliITSBeamTestDigSDD::AliITSBeamTestDigSDD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title)
+{
+ //
+ // Constructor
+ //
+ SetBtPeriod();
+ fSubEventAttributes=0;
+ fThreshold=0;
+ fStreamer=0;
+}
+
+//__________________________________________________________________
+AliITSBeamTestDigSDD::~AliITSBeamTestDigSDD()
+{
+ //
+ // Destructor
+ //
+ if(fSubEventAttributes) delete fSubEventAttributes;
+ if(fStreamer) delete fStreamer;
+ }
+
+
+//_______________________________________________________________________
+void AliITSBeamTestDigSDD::Exec(Option_t* /*opt*/)
+{
+
+ // Reads raw data and fills the tree of digits
+
+ TBranch* branch = fTreeD->GetBranch("ITSDigitSDD");
+
+ TClonesArray** digits = new TClonesArray*[fBt->GetNSDD()+fBt->GetNSPD()];
+ Int_t* idig = new Int_t[fBt->GetNSDD()+fBt->GetNSPD()];
+ for(Int_t idet=0;idet<(fBt->GetNSDD()+fBt->GetNSPD());idet++){
+ digits[idet]=new TClonesArray("AliITSdigitSDD");
+ idig[idet]=0;
+ }
+
+
+ switch(fBtPer){
+ case kNov04:
+ fStreamer = new AliITSRawStreamSDDv3(fReaderDate);
+ break;
+ case kAug04:
+ fStreamer = new AliITSRawStreamSDDv2(fReaderDate);
+ fReaderDate->RequireHeader(kFALSE);
+ fReaderDate->ReadHeader();
+ do{
+ fSubEventAttributes = fReaderDate->GetSubEventAttributes();
+ }while(fReaderDate->ReadHeader());
+ fSDDEvType=GetEventType();
+ if(fSDDEvType==1) fITSHeader->SetEventTypeSDD(kReal);
+ if(fSDDEvType==2) fITSHeader->SetEventTypeSDD(kCalibration1);
+ if(fSDDEvType==3) fITSHeader->SetEventTypeSDD(kCalibration2);
+ fReaderDate->Reset();
+ break;
+ }
+
+
+ fStreamer->SetLowCarlosThreshold(fThreshold,0);
+ fStreamer->SetLowCarlosThreshold(fThreshold,1);
+
+ //from raw data the signal is already decompressed..
+ //set compressed fSignal of AliITSdigitSDD to -1000
+ //set expanded fSignalExpanded of AliITSdigitSDD equal to fStreamer.GetSignal()
+ while(fStreamer->Next()){
+
+ Int_t ndet = fStreamer->GetChannel()+fBt->GetNSPD();
+ Int_t anode = fStreamer->GetCoord1();
+
+ /* if we are reading only one det, two wings
+ if(fStreamer.GetChannel()==1) anode+=256; //wing 1 0-255, wing 2 256-511
+ */
+
+ /* bt august 2004 and november 2004: with only 1 carlos
+ channel 0 for one wing of one
+ det, channel 1 for the wing of the second det*/
+
+ const Int_t kdgt[3]={anode,fStreamer->GetCoord2(),-1000};
+ const Int_t ktracks[10]={0,0,0,0,0,0,0,0,0,0};
+ const Int_t khits[10]={0,0,0,0,0,0,0,0,0,0};
+ const Float_t kcharges[10]={0,0,0,0,0,0,0,0,0,0};
+
+
+ new ((*digits[ndet])[idig[ndet]]) AliITSdigitSDD(0,kdgt,ktracks,khits,kcharges,fStreamer->GetSignal());
+ idig[ndet]++;
+
+ }
+
+ if(GetBtPeriod()==kNov04){
+ Int_t jitter=fStreamer->ReadJitter();
+ fITSHeader->SetJitterSDD(jitter);
+ }
+ for(Int_t n = fBt->GetNSPD();n<fBt->GetNSDD()+fBt->GetNSPD();n++){
+ branch->SetAddress(&digits[n]);
+ branch->Fill();
+ }
+
+ fTreeD->SetEntries(fBt->GetNSPD()+fBt->GetNSDD()+fBt->GetNSSD());
+ fReaderDate->Reset();
+ fTreeD->AutoSave();
+
+ for(Int_t n=0;n<fBt->GetNSPD()+fBt->GetNSDD();n++){
+ delete digits[n];
+ }
+
+
+ delete[] digits;
+ delete[] idig;
+ delete fStreamer;
+}
+
+
+//______________________________________
+Int_t AliITSBeamTestDigSDD::GetEventType(){
+
+ // defines the SDD event type:
+ // 1: physics event (kReal)
+ // 2: calibration 1 (kCalibration1, injector pulse)
+ // 3: calibration 2 (kCalibration2, test pulse)
+
+ fSDDEvType = 2;
+ if(fSubEventAttributes[0]==0 && fSubEventAttributes[1]==0 && fSubEventAttributes[2]==0) fSDDEvType = 1;
+
+ if(fSubEventAttributes[0]==2 && fSubEventAttributes[1]==0 && fSubEventAttributes[2]==0) fSDDEvType = 3;
+
+ fSubEventAttributes = 0;
+ return fSDDEvType;
+}
+
+//______________________________________________________________________
+AliITSBeamTestDigSDD::AliITSBeamTestDigSDD(const AliITSBeamTestDigSDD &bt):AliITSBeamTestDig(bt){
+ // Copy constructor.
+
+ fSDDEvType = bt.fSDDEvType;
+ fSubEventAttributes = bt.fSubEventAttributes;
+ fBtPer = bt.fBtPer;
+ fThreshold = bt.fThreshold;
+ fStreamer = bt.fStreamer;
+}
+//______________________________________________________________________
+AliITSBeamTestDigSDD& AliITSBeamTestDigSDD::operator=(AliITSBeamTestDigSDD &bt){
+ // Assignment operator. This is a function which is not allowed to be
+ // done to the ITS beam test dig. It exits with an error.
+ // Inputs:
+ if(this==&bt) return *this;
+ Error("operator=","You are not allowed to make a copy of the AliITSBeamTestDig");
+ exit(1);
+ return *this; //fake return
+}
+
+
+
+
--- /dev/null
+#ifndef ALIITSBEAMTESTDIGSDD_H
+#define ALIITSBEAMTESTDIGSDD_H
+
+////////////////////////////////////////////////////
+// Class to define //
+// SDD beam test raw 2 dig conv. //
+// Origin: E. Crescio crescio@to.infn.it //
+// //
+////////////////////////////////////////////////////
+
+#include "AliITSBeamTestDig.h"
+#include "AliITSBeamTest.h"
+
+class AliRawReaderDate;
+class AliITSRawStreamSDD;
+
+class AliITSBeamTestDigSDD: public AliITSBeamTestDig {
+
+ public:
+
+
+ AliITSBeamTestDigSDD();
+ AliITSBeamTestDigSDD(const Text_t* name, const Text_t* title);
+ AliITSBeamTestDigSDD(const AliITSBeamTestDigSDD& bt);
+ AliITSBeamTestDigSDD& operator=(AliITSBeamTestDigSDD &bt);
+
+ virtual ~AliITSBeamTestDigSDD();
+
+ void SetBtPeriod(BeamtestPeriod_t per=kNov04) {fBtPer=per;}
+ void SetThreshold(Int_t threshold) {fThreshold=threshold;}
+
+ BeamtestPeriod_t GetBtPeriod() const {return fBtPer;}
+ Int_t GetThreshold() const {return fThreshold;}
+
+ virtual void Exec(Option_t* opt);
+
+
+
+ protected:
+
+ Int_t fSDDEvType; //SDD event type (real, calibration)
+ const UInt_t* fSubEventAttributes; //SDD sub-event attributes
+ BeamtestPeriod_t fBtPer; //beam test version
+ // November 2004 = kNov04
+ // August 2004 = kAug04
+ Int_t fThreshold; // Low carlos threshold
+ AliITSRawStreamSDD* fStreamer; //! SDD streamer
+
+ private:
+
+ Int_t GetEventType();
+
+
+ ClassDef(AliITSBeamTestDigSDD,1) // An Alice SDD beam test digitizer
+
+ };
+
+
+
+#endif
+
+
--- /dev/null
+////////////////////////////////////////////////////
+// Class to define //
+// SPD beam test raw 2 dig conv. //
+// //
+// Origin: Jan Conrad Jan.Conrad@cern.ch //
+// //
+////////////////////////////////////////////////////
+
+
+#include "AliITSdigitSPD.h"
+#include "AliRawReaderDate.h"
+#include "AliRawDataHeader.h"
+#include "AliITSRawStreamSPD.h"
+#include "AliITSBeamTestDigSPD.h"
+#include "AliITSBeamTest.h"
+
+
+ClassImp(AliITSBeamTestDigSPD)
+
+
+
+//_____________________________________________________________
+ AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(): AliITSBeamTestDig()
+{
+ //
+ // Constructor
+ //
+
+
+}
+
+//_____________________________________________________________
+ AliITSBeamTestDigSPD::AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title)
+{
+ //
+ // Constructor
+ //
+
+
+}
+
+//__________________________________________________________________
+AliITSBeamTestDigSPD::~AliITSBeamTestDigSPD()
+{
+ //
+ // Destructor
+ //
+
+ }
+
+
+//_______________________________________________________________________
+void AliITSBeamTestDigSPD::Exec(Option_t* /*opt*/)
+{
+ //Reads raw data for SPD, fill SPD digits tree
+
+
+ TBranch* branch = fTreeD->GetBranch("ITSDigitSPD");
+ TClonesArray** newdigits = new TClonesArray*[fBt->GetNSPD()];
+
+ Int_t* idig = new Int_t[fBt->GetNSPD()];
+
+
+
+ for (Int_t idet =0; idet < fBt->GetNSPD();idet++){
+ newdigits[idet]=new TClonesArray("AliITSdigitSPD");
+ idig[idet]=0;
+ }
+
+
+
+
+ //cout <<"still here"<< endl;
+ AliITSRawStreamSPD str(fReaderDate);
+
+ fReaderDate->SelectEquipment(17,211,211);
+
+ while(str.Next()){
+
+ const AliRawDataHeader* rdh = fReaderDate->GetDataHeader();
+ UChar_t blockAttributes = fReaderDate->GetBlockAttributes();
+ UInt_t statusBits = fReaderDate->GetStatusBits();
+ UInt_t orbitNumber = rdh->fEventID2;
+ UShort_t bunchCross = rdh->fEventID1;
+ // UInt_t DataSize = rdh->fSize;
+ //UChar_t L1TrigType = rdh->fL1TriggerType;
+ //UInt_t MiniEvId = rdh->GetMiniEventID();
+ // ULong64_t TriggerCL = rdh->GetTriggerClasses();
+ //ULong64_t ROI = rdh->GetROI();
+ // UChar_t Version =rdh->fVersion;
+
+
+ Int_t modID = str.GetModuleID();
+ // Int_t triggernumber = str.GetTriggerEventNumber();
+
+ Int_t row = str.GetRow();
+ Int_t col = str.GetColumn();
+
+
+
+ // if (modID == 0 || modID == 1) {
+ // cout <<"Mod ID " << modID <<" Row : "<< row << "Col : " << col << endl;
+ //}
+
+
+ const Int_t kdgt[3]={row,col,1};
+
+ // newdigits = new TClonesArray*[fBt->GetNSPD()];
+
+ new ((*newdigits[modID])[idig[modID]]) AliITSdigitSPD(kdgt);
+
+ idig[modID]++;
+
+ fITSHeader->SetOrbitNumber(0,orbitNumber);
+ fITSHeader->SetStatusBits(0,statusBits);
+ fITSHeader->SetBlockAttributes(0,blockAttributes);
+ fITSHeader->SetBunchCross(0,bunchCross);
+ //fITSHeader->SetTriggerClass(0,TriggerCL);
+ //fITSHeader->SetSubDet(0,
+ //fITSHeader->SetMiniEvId(0,MiniEvId);
+ //fITSHeader->SetVersion(0,Version);
+ //fITSHeader->SetSubDet(0,Subdets);
+ //fITSHeader->SetL1TriggerType(0,L1TrigType);
+
+ // fITSHeader->SetOrbitNumberSPD(OrbitNumber);
+ //printf("Bunch Crossing = %x\n ",BunchCross);
+ if ( blockAttributes != 0x3a ) {
+ Info("Exec","Block Attribs = %x\n ",blockAttributes);
+ }
+
+
+
+ } // while(str.Next());
+
+
+ for(Int_t n=0;n<fBt->GetNSPD();n++){
+ branch->SetAddress(&newdigits[n]);
+ branch->Fill();
+ }
+
+ fTreeD->SetEntries(fBt->GetNSDD()+fBt->GetNSPD()+fBt->GetNSSD());
+
+
+
+ fReaderDate->Reset();
+ fTreeD->AutoSave();
+
+
+ for(Int_t n=0;n<fBt->GetNSPD();n++){
+ delete newdigits[n];
+ }
+
+ delete[] newdigits;
+ delete[] idig;
+
+}
+
+
--- /dev/null
+#ifndef ALIITSBEAMTESTDIGSPD_H
+#define ALIITSBEAMTESTDIGSPD_H
+
+////////////////////////////////////////////////////
+// Class to define //
+// SPD beam test raw 2 dig conv. //
+//
+// Origin: Jan Conrad Jan.Conrad@cern.ch //
+////////////////////////////////////////////////////
+
+#include "AliITSBeamTestDig.h"
+
+
+class AliRawReaderDate;
+class AliITSBeamTest;
+
+class AliITSBeamTestDigSPD: public AliITSBeamTestDig {
+
+ public:
+
+
+ AliITSBeamTestDigSPD();
+ AliITSBeamTestDigSPD(const Text_t* name, const Text_t* title);
+ virtual ~AliITSBeamTestDigSPD();
+
+ virtual void Exec(Option_t* opt);
+
+
+ protected:
+
+
+ Bool_t fFlagHeader; // flag for the event header
+
+
+
+ ClassDef(AliITSBeamTestDigSPD,0) // An Alice SPD beam test run
+
+ };
+
+
+#endif
+
+
--- /dev/null
+/////////////////////////////////////////
+// Class for SSD raw2digits conv //
+// //
+// Author: Enrico Fragiacomo //
+// Date: October 2004 //
+////////////////////////////////////////
+
+#include "AliITSdigitSSD.h"
+#include "AliRawReaderDate.h"
+#include "AliITSRawStreamSSDv1.h"
+#include "AliITSBeamTestDigSSD.h"
+#include "AliITSBeamTest.h"
+
+ClassImp(AliITSBeamTestDigSSD)
+
+//_____________________________________________________________
+AliITSBeamTestDigSSD::AliITSBeamTestDigSSD(): AliITSBeamTestDig() {
+ //
+ // Constructor
+ //
+}
+
+//_____________________________________________________________
+AliITSBeamTestDigSSD::AliITSBeamTestDigSSD(const Text_t* name, const Text_t* title): AliITSBeamTestDig(name,title) {
+ //
+ // Constructor
+ //
+}
+
+//__________________________________________________________________
+AliITSBeamTestDigSSD::~AliITSBeamTestDigSSD() {
+ //
+ // Destructor
+ //
+}
+
+//_______________________________________________________________________
+void AliITSBeamTestDigSSD::Exec(Option_t* /*opt*/) {
+ //Reads raw data for SSD, fill SSD digits tree, returns 1 if real data,
+ //returns 2 if calibration (injector) data, returns 3 if calibration (test pul //se) event
+
+ TBranch* branch = fTreeD->GetBranch("ITSDigitSSD");
+
+ TClonesArray** newdigits = new TClonesArray*[fBt->GetNSSD()];
+
+ Int_t* idig = new Int_t[fBt->GetNSSD()];
+
+ for (Int_t idet =0; idet < fBt->GetNSSD();idet++) {
+ newdigits[idet] = new TClonesArray("AliITSdigitSSD");
+ idig[idet]=0;
+ }
+
+ // this constructor sets the flag to select SSD data only
+ // the Next method below will then jump to SSD data for this event
+
+ AliITSRawStreamSSDv1 str(fReaderDate);
+
+ // no selection of equipment
+ //fReaderDate->SelectEquipment(-1);
+ //fReaderDate->SelectEquipment(17,102,102);
+
+ while(str.Next()){
+
+ //if((str.GetADModule()!=2)&&(str.GetADModule()!=6)) continue;
+
+ Int_t side = str.GetSideFlag();
+ Int_t strip = str.GetStrip();
+ Int_t signal = str.GetSignal();
+ Int_t module = str.GetModuleID();
+ if( (module<10) || (module>13) ) continue;
+ const Int_t kdgt[3]={side,strip,signal};
+
+ // SSD modules 10, 11, 12 and 13
+ new ( (*newdigits[module-10])[idig[module-10]] ) AliITSdigitSSD(kdgt);
+ idig[module-10]++;
+
+ } // end while
+
+ for(Int_t n=0;n<fBt->GetNSSD();n++){
+ branch->SetAddress(&newdigits[n]);
+ branch->Fill();
+ }
+
+ fTreeD->SetEntries(fBt->GetNSPD()+fBt->GetNSDD()+fBt->GetNSSD());
+
+ fReaderDate->Reset();
+
+ fTreeD->AutoSave();
+
+ for(Int_t n=0;n<fBt->GetNSSD();n++){
+ delete newdigits[n];
+ }
+
+}
+
+
+
--- /dev/null
+#ifndef ALIITSBEAMTESTDIGSSD_H
+#define ALIITSBEAMTESTDIGSSD_H
+
+////////////////////////////////////////////////////
+// Class to define //
+// SSD beam test raw 2 dig conv. //
+// //
+// Origin: Enrico Fragiacomo //
+// //
+////////////////////////////////////////////////////
+
+#include "AliITSBeamTestDig.h"
+
+
+class AliRawReaderDate;
+class AliITSBeamTest;
+
+class AliITSBeamTestDigSSD: public AliITSBeamTestDig {
+
+ public:
+
+
+ AliITSBeamTestDigSSD();
+ AliITSBeamTestDigSSD(const Text_t* name, const Text_t* title);
+ virtual ~AliITSBeamTestDigSSD();
+
+ virtual void Exec(Option_t* opt);
+
+ // void SetRawReaderDate(AliRawReaderDate* rd) {fReaderDate=rd;}
+ // void SetHeader(Bool_t H){fFlagHeader = H;}
+
+ //void SetTree(TTree* treedig) {fTreeD=treedig;}
+
+ protected:
+
+
+
+ Bool_t fFlagHeader; //flag for the header
+
+
+ ClassDef(AliITSBeamTestDigSSD,1) // An Alice SSD beam test run
+
+ };
+
+
+#endif
+
+
+
--- /dev/null
+////////////////////////////////////////////////////
+// Class to manage the //
+// ITS beam test conversion from rawdata //
+// to digits. It executes the digitization for //
+// SPD, SDD and SSD. //
+// Origin: E. Crescio crescio@to.infn.it //
+// J. Conrad Jan.Conrad@cern.ch //
+////////////////////////////////////////////////////
+#include "AliHeader.h"
+#include "AliRun.h"
+#include "AliRunLoader.h"
+#include "AliITSEventHeader.h"
+#include "AliITSLoader.h"
+#include "AliITSBeamTest.h"
+#include "AliITSBeamTestDigSDD.h"
+#include "AliITSBeamTestDigSPD.h"
+#include "AliITSBeamTestDigSSD.h"
+#include "AliITSBeamTestDigitizer.h"
+#include "AliRawReaderDate.h"
+
+
+const TString AliITSBeamTestDigitizer::fgkDefaultDigitsFileName="ITSbt.Digits.root";
+
+ClassImp(AliITSBeamTestDigitizer)
+
+
+//_____________________________________________________________
+AliITSBeamTestDigitizer::AliITSBeamTestDigitizer():TTask()
+{
+ //
+ // Default constructor
+ //
+ fRunLoader = 0;
+ fLoader =0;
+ fEvIn=0;
+ fEvFin=0;
+ fFlagHeader=kTRUE;
+ fDATEEvType=7;
+ fRunNumber=-1;
+ SetFlagInit();
+ fBt=0;
+ SetBeamTestPeriod();
+}
+
+//_____________________________________________________________
+ AliITSBeamTestDigitizer::AliITSBeamTestDigitizer(const Text_t* name, const Text_t* title):TTask(name,title)
+{
+ //
+ // Standard constructor
+ //
+ Init();
+ fEvIn=0;
+ fEvFin=0;
+ fDATEEvType=7;
+ fFlagHeader=kTRUE;
+ fRunNumber=-1;
+ SetBeamTestPeriod();
+ }
+
+//_____________________________________________________________
+ AliITSBeamTestDigitizer::AliITSBeamTestDigitizer(const Text_t* name, const Text_t* title, Int_t run):TTask(name,title)
+
+{
+ //
+ // Constructor
+ //
+ Init();
+ fEvIn=0;
+ fEvFin=0;
+ fDATEEvType=7;
+ fFlagHeader=kTRUE;
+ fRunNumber=run;
+ SetBeamTestPeriod();
+ }
+
+//___________________________________________________________
+void AliITSBeamTestDigitizer::Init(){
+
+ //
+ //Initialization of run loader and its loader
+ //creation of galice.root
+ //
+ fRunLoader = AliRunLoader::Open("galice.root",
+ AliConfig::GetDefaultEventFolderName(),"recreate");
+
+ gAlice->SetRunLoader(fRunLoader);
+ fRunLoader->SetEventFolderName();
+ fBt = new AliITSBeamTest("ITS","ITS beam test");
+ fBt->SetDefaults();
+ gAlice->AddModule(fBt);
+ fRunLoader->AddLoader(fBt);
+ fLoader = (AliITSLoader*)fRunLoader->GetLoader("ITSLoader");
+ fRunLoader->MakeTree("E");
+
+ fRunLoader->WriteRunLoader("OVERWRITE");
+ fRunLoader->WriteAliRun("OVERWRITE");
+ fDigitsFileName=fgkDefaultDigitsFileName;
+ this->Add(new AliITSBeamTestDigSPD("DigSPD","SPD Digitization"));
+ this->Add(new AliITSBeamTestDigSDD("DigSDD","SDD Digitization"));
+ this->Add(new AliITSBeamTestDigSSD("DigSSD","SSD Digitization"));
+
+ SetFlagInit(kTRUE);
+}
+
+//_____________________________________________________________
+ AliITSBeamTestDigitizer::AliITSBeamTestDigitizer(const char* filename)
+{
+ //
+ // Constructor for reading (reads galice.root)
+ //
+
+ fRunLoader = AliRunLoader::Open(filename);
+ if (fRunLoader == 0x0)
+ {
+ Error("AliITSBeamTestDigitizer","Can not load the session",filename);
+ return;
+ }
+ fRunLoader->LoadgAlice();
+ gAlice = fRunLoader->GetAliRun();
+
+ if(!gAlice) {
+ Error("AliITSBeamTestDigitizer","gAlice not found on file. Aborting.");
+ return;
+ }
+
+ fLoader = (AliITSLoader*)fRunLoader->GetLoader("ITSLoader");
+
+ fBt = (AliITSBeamTest*)gAlice->GetDetector("ITS");
+ fBt->SetDefaults();
+
+ fDigitsFileName=fgkDefaultDigitsFileName;
+
+ fEvIn=0;
+ fEvFin=0;
+
+}
+
+//______________________________________________________________________
+AliITSBeamTestDigitizer::AliITSBeamTestDigitizer(const AliITSBeamTestDigitizer &bt):TTask(bt){
+ // Copy constructor.
+ //not allowed
+ if(this==&bt) return;
+ Error("Copy constructor",
+ "You are not allowed to make a copy of the AliITSBeamTestDigitizer");
+ exit(1);
+
+}
+//______________________________________________________________________
+AliITSBeamTestDigitizer& AliITSBeamTestDigitizer::operator=(AliITSBeamTestDigitizer &bt){
+ // Assignment operator. This is a function which is not allowed to be
+ // done to the ITS beam test digitizer. It exits with an error.
+ // Inputs:
+ if(this==&bt) return *this;
+ Error("operator=","You are not allowed to make a copy of the AliITSBeamTestDigitizer");
+ exit(1);
+ return *this; //fake return
+}
+
+
+//______________________________________________________________
+AliITSBeamTestDigitizer::~AliITSBeamTestDigitizer(){
+
+ //Destructor
+ if(fBt) delete fBt;
+ if(fLoader) delete fLoader;
+ if(fRunLoader) delete fRunLoader;
+}
+
+
+//_____________________________________________________________
+void AliITSBeamTestDigitizer::SetNumberOfEventsPerFile(Int_t nev)
+{
+ //Sets number of events per file
+
+ if(fRunLoader) fRunLoader->SetNumberOfEventsPerFile(nev);
+ else Warning("SetNumberOfEventsPerFile","fRunLoader is 0");
+}
+
+
+//____________________________________________________
+void AliITSBeamTestDigitizer::ExecDigitization(){
+
+ // Execution of digitisation for SPD,SDD and SSD
+
+ if(!GetFlagInit()){
+ Warning("ExecDigitization()","Run Init() please..");
+ return;
+ }
+ fLoader->SetDigitsFileName(fDigitsFileName);
+ fLoader->LoadDigits("recreate");
+
+ AliRawReaderDate rd(fRawdataFileName,fEvIn);
+ AliHeader* header = fRunLoader->GetHeader();
+
+ Int_t iev=fEvIn-1;
+
+
+ AliITSBeamTestDigSDD* digSDD = (AliITSBeamTestDigSDD*)fTasks->FindObject("DigSDD");
+ AliITSBeamTestDigSPD* digSPD = (AliITSBeamTestDigSPD*)fTasks->FindObject("DigSPD");
+ AliITSBeamTestDigSSD* digSSD = (AliITSBeamTestDigSSD*)fTasks->FindObject("DigSSD");
+
+
+ do{
+ iev++;
+ if(fEvFin!=0){
+ if(iev>fEvFin) break;
+ }
+ AliITSEventHeader* itsh = new AliITSEventHeader("ITSHeader");
+ fRunLoader->SetEventNumber(iev);
+
+ rd.RequireHeader(fFlagHeader);
+ rd.SelectEvents(fDATEEvType);
+
+ digSDD->SetRawReaderDate(&rd);
+ digSPD->SetRawReaderDate(&rd);
+ digSSD->SetRawReaderDate(&rd);
+
+ if(fLoader->TreeD() == 0x0) fLoader->MakeTree("D");
+
+ TTree* treeD = (TTree*)fLoader->TreeD();
+
+ // Make branches outside the dig-classes
+
+ TClonesArray* digitsSPD = new TClonesArray("AliITSdigitSPD",1000);
+ treeD->Branch("ITSDigitSPD",&digitsSPD);
+
+ TClonesArray* digitsSDD = new TClonesArray("AliITSdigitSDD",1000);
+ treeD->Branch("ITSDigitSDD",&digitsSDD);
+
+ TClonesArray* digitsSSD = new TClonesArray("AliITSdigitSSD",1000);
+ treeD->Branch("ITSDigitSSD",&digitsSSD);
+
+
+ digSSD->SetTree(treeD);
+ digSDD->SetTree(treeD);
+ digSPD->SetTree(treeD);
+
+ digSSD->SetBeamTest(fBt);
+ digSDD->SetBeamTest(fBt);
+ digSPD->SetBeamTest(fBt);
+
+ digSSD->SetITSEventHeader(itsh);
+ digSDD->SetITSEventHeader(itsh);
+ digSPD->SetITSEventHeader(itsh);
+
+ digSDD->SetBtPeriod(GetBeamTestPeriod());
+ digSDD->SetThreshold(16);
+
+ ExecuteTask(0);
+
+ header->SetEventNrInRun(iev);
+ header->SetEvent(iev);
+ header->SetRun(fRunNumber);
+ fRunLoader->GetHeader()->AddDetectorEventHeader(itsh);
+ fRunLoader->TreeE()->Fill();
+ header->Reset(fRunNumber,iev);
+
+ delete digitsSPD;
+ delete digitsSDD;
+ delete digitsSSD;
+
+ }while(rd.NextEvent());
+
+ fRunLoader->WriteHeader("OVERWRITE");
+ fRunLoader->WriteRunLoader("OVERWRITE");
+ fLoader->UnloadDigits();
+ fLoader->UnloadRawClusters();
+ fRunLoader->UnloadHeader();
+
+}
+
+
+
+//_______________________________________________
+void AliITSBeamTestDigitizer:: SetActive(const TString& subdet,Bool_t value){
+
+ //Sets active sub-tasks (detectors)
+
+ Bool_t sdd = subdet.Contains("SDD");
+ Bool_t spd = subdet.Contains("SPD");
+ Bool_t ssd = subdet.Contains("SSD");
+
+ if(sdd){
+ AliITSBeamTestDigSDD* digSDD = (AliITSBeamTestDigSDD*)fTasks->FindObject("DigSDD");
+ digSDD->SetActive(value);
+ }
+
+ if(spd){
+ AliITSBeamTestDigSPD* digSPD = (AliITSBeamTestDigSPD*)fTasks->FindObject("DigSPD");
+ digSPD->SetActive(value);
+
+ }
+
+ if(ssd){
+ AliITSBeamTestDigSSD* digSSD = (AliITSBeamTestDigSSD*)fTasks->FindObject("DigSSD");
+ digSSD->SetActive(value);
+
+ }
+
+
+
+}
+
--- /dev/null
+#ifndef ALIITSBEAMTESTDIGITIZER_H
+#define ALIITSBEAMTESTDIGITIZER_H
+
+////////////////////////////////////////////////////
+// Class to manage the //
+// ITS beam test conversion from rawdata //
+// to digits. It executes the digitization for //
+// SPD, SDD and SSD. //
+// Origin: E. Crescio crescio@to.infn.it //
+// J. Conrad Jan.Conrad@cern.ch //
+////////////////////////////////////////////////////
+#include <TTask.h>
+
+class AliITSBeamTest;
+class AliITSBeamTestDigSDD;
+class AliRawReaderDate;
+class AliRunLoader;
+class AliITSLoader;
+class AliITS;
+class AliITSEventHeader;
+class AliRawDataHeader;
+
+class AliITSBeamTestDigitizer : public TTask {
+
+ public:
+
+ AliITSBeamTestDigitizer();
+ AliITSBeamTestDigitizer(const Text_t* name,const Text_t* title);
+ AliITSBeamTestDigitizer(const Text_t* name,const Text_t* title, Int_t run);
+ AliITSBeamTestDigitizer(const char* filename);
+ AliITSBeamTestDigitizer(const AliITSBeamTestDigitizer& bt);
+ AliITSBeamTestDigitizer& operator=(AliITSBeamTestDigitizer &bt);
+
+ virtual ~AliITSBeamTestDigitizer();
+
+ void SetDigitsFileName(const TString& name) {fDigitsFileName=name;}
+ void SetRawdataFileName(const TString& name) {fRawdataFileName=name;}
+ void SetNumberOfEventsPerFile(Int_t nev);
+
+ void SetStartEventNumber(Int_t evin) {fEvIn=evin;}
+ void SetStopEventNumber(Int_t evfin) {fEvFin=evfin;}
+ void SetFlagHeader(Bool_t flag=kFALSE){fFlagHeader=flag;}
+ void SetFlagInit(Bool_t flag=kFALSE){fFlagInit=flag;}
+ void SelectEvents(Int_t eventtype) {fDATEEvType=eventtype;}
+ void SetBeamTestPeriod(BeamtestPeriod_t per=kNov04) {fPeriod=per;}
+ void SetRunNumber(Int_t run) {fRunNumber=run;}
+
+ void SetActive(const TString& subdet,Bool_t value);
+
+ void ExecDigitization();
+ void Init();
+
+ Int_t GetRunNumber() const {return fRunNumber;}
+ Bool_t GetFlagInit() const {return fFlagInit;}
+ BeamtestPeriod_t GetBeamTestPeriod() const {return fPeriod;}
+
+
+ protected:
+
+
+ Int_t fEvIn; //starting event to be read
+ Int_t fEvFin; //last event to be read
+ Int_t fRunNumber; //run number
+ Int_t fDATEEvType; //date eventtype (JC)
+
+ Bool_t fFlagHeader; //flag for the hader
+ Bool_t fFlagInit; //flag for initialization
+
+ TString fDigitsFileName; //Digits file name
+ TString fRawdataFileName; //Raw data file name
+ BeamtestPeriod_t fPeriod; //Beam test period
+
+ AliITSBeamTest* fBt; //! Local pointer to ITS beam test class.
+
+ AliRunLoader* fRunLoader; // Local pointer to run loader
+ AliITSLoader* fLoader; // Pointer to ITS loader
+
+ const AliRawDataHeader* fHeader; //!current data header
+
+ static const TString fgkDefaultDigitsFileName; // default name for dig. file
+
+ ClassDef(AliITSBeamTestDigitizer,1) // An Alice SDD beam test digitization class
+
+ };
+
+
+#endif
+
+
--- /dev/null
+////////////////////////////////////////////////////
+// Base class to define //
+// ITS Event Header //
+//
+// Origin: E. Crescio crescio@to.infn.it //
+// //
+////////////////////////////////////////////////////
+
+#include "AliITSEventHeader.h"
+
+ClassImp(AliITSEventHeader)
+
+
+//_____________________________________________________________
+AliITSEventHeader::AliITSEventHeader():AliDetectorEventHeader()
+{
+ //
+ // Defaulst Constructor
+ //
+
+ SetEventTypeSDD();
+
+ for(Int_t idet=0;idet<3;idet++){
+ fL1TriggerType[idet]=0;
+ fOrbitNumber[idet]=0;
+ fBunchCross[idet]=0;
+ fBlockAttr[idet]=0;
+ fTriggerClass[idet]=0;
+ fStatusBits[idet]=0;
+ fMiniEvId[idet]=0;
+ fSubDet[idet]=0;
+ fVersion[idet]=0;
+ fJitterSDD=0;
+ }
+
+
+}
+
+//_____________________________________________________________
+AliITSEventHeader::AliITSEventHeader(const char* name):AliDetectorEventHeader(name)
+{
+ //
+ // Constructor
+ //
+ SetEventTypeSDD();
+ for(Int_t idet=0;idet<3;idet++){
+ fL1TriggerType[idet]=0;
+ fOrbitNumber[idet]=0;
+ fBunchCross[idet]=0;
+ fBlockAttr[idet]=0;
+ fTriggerClass[idet]=0;
+ fStatusBits[idet]=0;
+ fMiniEvId[idet]=0;
+ fSubDet[idet]=0;
+ fVersion[idet]=0;
+ fJitterSDD=-123;
+ }
+
+
+}
+
+
+
+
+
--- /dev/null
+#ifndef ALIITSEVENTHEADER_H
+#define ALIITSEVENTHEADER_H
+
+////////////////////////////////////////////////////
+// Base class to define //
+// ITS Event Header //
+//
+// Origin: E. Crescio crescio@to.infn.it //
+// //
+////////////////////////////////////////////////////
+
+#include "AliDetectorEventHeader.h"
+
+typedef enum { kSimulated, kReal, kCalibration1, kCalibration2 } EventType_t;
+
+class AliITSEventHeader : public AliDetectorEventHeader {
+
+ public:
+
+
+ AliITSEventHeader(const char* name);
+ AliITSEventHeader();
+
+ virtual ~AliITSEventHeader() {}
+
+ EventType_t GetEventTypeSDD() const {return fEventTypeSDD;};
+ UChar_t GetL1TriggerType(Int_t i) const {return fL1TriggerType[i];}
+ UInt_t GetOrbitNumber(Int_t i) const {return fOrbitNumber[i];}
+ UShort_t GetBunchCross(Int_t i) const {return fBunchCross[i];}
+ UChar_t GetBlockAttributes(Int_t i) const {return fBlockAttr[i];}
+ ULong64_t GetTriggerClass(Int_t i) const {return fTriggerClass[i];}
+ UInt_t GetStatusBits(Int_t i) const {return fStatusBits[i];}
+ UInt_t GetMiniEvId(Int_t i) const {return fMiniEvId[i];}
+ UInt_t GetSubDet(Int_t i) const {return fSubDet[i];}
+ UInt_t GetVersion(Int_t i) const {return fVersion[i];}
+ Int_t GetJitterSDD() const {return fJitterSDD;}
+
+ void SetEventTypeSDD(EventType_t type=kSimulated){fEventTypeSDD=type;}
+ void SetL1TriggerType(Int_t i,UChar_t l1trig) {fL1TriggerType[i]=l1trig;}
+ void SetOrbitNumber(Int_t i,UInt_t orbitnum) {fOrbitNumber[i]=orbitnum;}
+ void SetBunchCross(Int_t i,UShort_t bunchcross) {fBunchCross[i]=bunchcross;}
+ void SetBlockAttributes(Int_t i,UChar_t attr) {fBlockAttr[i]=attr;}
+ void SetTriggerClass(Int_t i,ULong64_t trigclass){fTriggerClass[i]=trigclass;}
+ void SetStatusBits(Int_t i,UInt_t bits) {fStatusBits[i]=bits;}
+ void SetMiniEvId(Int_t i,UInt_t minievid) {fMiniEvId[i]=minievid;}
+ void SetSubDet(Int_t i,UInt_t subdet) {fSubDet[i]=subdet;}
+ void SetVersion(Int_t i,UInt_t version) {fVersion[i]=version;}
+ void SetJitterSDD(Int_t jitter) {fJitterSDD=jitter;}
+
+ protected:
+
+ EventType_t fEventTypeSDD; //event type for SDD
+ UChar_t fL1TriggerType[3]; //Level 1 trigger type (0 spd,1 sdd,2 ssd)
+ UInt_t fOrbitNumber[3]; //Orbit Number (0 spd,1 sdd,2 ssd)
+ UShort_t fBunchCross[3]; //Bunch Crossing Number (0 spd,1 sdd,2 ssd)
+ UChar_t fBlockAttr[3]; //Block Attributes (0 spd,1 sdd,2 ssd)
+ ULong64_t fTriggerClass[3]; //Trigger classes (0 spd,1 sdd,2 ssd)
+ UInt_t fStatusBits[3]; //Status Bits (0 spd,1 sdd,2 ssd)
+ UInt_t fMiniEvId[3]; //MiniEvent ID (0 spd,1 sdd,2 ssd)
+ UInt_t fSubDet[3]; //partic. sub-detectors (0 spd,1 sdd,2 ssd)
+ UInt_t fVersion[3]; //Header Version (0 spd,1 sdd,2 ssd)
+ Int_t fJitterSDD; // SDD jitter between L0 and pascal stop
+
+ ClassDef(AliITSEventHeader,1) // An Alice ITS event header
+
+ };
+
+
+#endif
+
+
virtual UInt_t ReadBits();
virtual Int_t DecompAmbra(Int_t value) const;
- static const UInt_t fgkCodeLength[8];
+ static const UInt_t fgkCodeLength[8]; //code length
UInt_t fData; // data read for file
Int_t fSkip; // number of skipped words
Int_t AliITSRawStreamSDDv3::GetJitter() {
+ // Reads the value of the jitter between L0 and pascal stop
+ // written in the last word of the buffer
+
if (!fRawReader->ReadNextInt(fData)){
Error("GetJitter","Jitter word not found!!");
return -1; // read last word
static Int_t GetModuleNumber(UInt_t iDDL, UInt_t iModule)
{return fgkDDLModuleMap[iDDL][iModule];}
- private :
+ protected :
static const Int_t fgkDDLModuleMap[kDDLsNumber][kModulesPerDDL]; // mapping DDL/module -> module number
UInt_t fData; // data read for file
--- /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. *
+ **************************************************************************/
+
+/* $Id$ */
+///////////////////////////////////////////////////////////////////////////////
+///
+/// This class provides access to beam test ITS SSD digits in raw data.
+// Modified by Enrico Fragiacomo, October 2004, for beamtest analysis
+///
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliITSRawStreamSSDv1.h"
+#include "AliRawReader.h"
+
+ClassImp(AliITSRawStreamSSDv1)
+
+
+AliITSRawStreamSSDv1::AliITSRawStreamSSDv1(AliRawReader* rawReader) :
+ AliITSRawStreamSSD(rawReader)
+{
+// create an object to read ITS SSD raw digits
+
+ fADC =0;
+ fADModule=0;
+ fRawReader->Select(3);
+ fRawReader->SelectEquipment(17,102,102);
+}
+
+
+Bool_t AliITSRawStreamSSDv1::Next()
+{
+// read the next raw digit
+// returns kFALSE if there is no digit left
+
+ Int_t seq=0;
+
+ fPrevModuleID = fModuleID;
+
+ if (!fRawReader->ReadNextInt(fData)) return kFALSE;
+
+ fADModule = (fData >> 27) & 0x0000000F;
+ fADC = (fData >> 23) & 0x0000000F;
+
+ // seq 0 (first 768 strips) or 1 are obtained from fCoord2
+ fCoord2 = (fData >> 12) & 0x000007FF;
+ seq = (fCoord2 >= 768) ? 1 : 0;
+ if(seq) fCoord2 = 1535 - fCoord2;
+
+ if((fCoord2<0)||(fCoord2>=768)) return kFALSE;
+
+ // ADModule 2 -> layer 5
+ // fCoord1 is set according to the cabling map
+ if(fADModule==2) {
+ if ((fADC==0)&&(seq==0)) {fModuleID = 10; fCoord1=1;}
+ else if ((fADC==0)&&(seq==1)) {fModuleID = 11; fCoord1=1;}
+ else if ((fADC==1)&&(seq==0)) {fModuleID = 11; fCoord1=0;}
+ else if ((fADC==1)&&(seq==1)) {fModuleID = 10; fCoord1=0;}
+ }
+ // ADModule 6 -> layer 6
+ // fCoord1 is set according to the cabling map
+ else if(fADModule==6) {
+ if ((fADC==0)&&(seq==0)) {fModuleID = 12; fCoord1=0;}
+ else if ((fADC==0)&&(seq==1)) {fModuleID = 13; fCoord1=0;}
+ else if ((fADC==1)&&(seq==0)) {fModuleID = 13; fCoord1=1;}
+ else if ((fADC==1)&&(seq==1)) {fModuleID = 12; fCoord1=1;}
+ }
+
+ fSignal = (fData & 0x00000FFF);
+
+ if(fSignal>=2048) fSignal-=4096;
+
+ return kTRUE;
+}
+
--- /dev/null
+#ifndef ALIITSRAWSTREAMSSDV1_H
+#define ALIITSRAWSTREAMSSDV1_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+///
+/// This class provides access to ITS SSD digits in raw data.
+///
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliITSRawStreamSSD.h"
+
+class AliRawReader;
+
+
+class AliITSRawStreamSSDv1: public AliITSRawStreamSSD {
+ public :
+ AliITSRawStreamSSDv1(AliRawReader* rawReader);
+ virtual ~AliITSRawStreamSSDv1() {};
+
+ virtual Bool_t Next();
+
+ Int_t GetADC() const {return fADC;}
+ Int_t GetADModule() const {return fADModule;}
+
+ protected :
+
+ Int_t fADModule; // FEROM module
+ Int_t fADC; // ADC within the ADModule
+
+
+ ClassDef(AliITSRawStreamSSDv1, 0) // class for reading beam test ITS digits
+};
+
+#endif
+
#pragma link C++ class AliITStrackSA+;
#pragma link C++ class AliITSVertexerFast+;
#pragma link C++ class AliITSRawStream+;
-#pragma link C++ class AliITSRawStreamSDD;
-#pragma link C++ class AliITSRawStreamSDDv2;
-#pragma link C++ class AliITSRawStreamSDDv3;
-#pragma link C++ class AliITSRawStreamSPD;
-#pragma link C++ class AliITSRawStreamSSD;
+#pragma link C++ class AliITSRawStreamSDD+;
+#pragma link C++ class AliITSRawStreamSDDv2+;
+#pragma link C++ class AliITSRawStreamSDDv3+;
+#pragma link C++ class AliITSRawStreamSPD+;
+#pragma link C++ class AliITSRawStreamSSD+;
+#pragma link C++ class AliITSRawStreamSSDv1+;
+#pragma link C++ class AliITSBeamTest+;
+#pragma link C++ class AliITSBeamTestDig+;
+#pragma link C++ class AliITSBeamTestDigSPD+;
+#pragma link C++ class AliITSBeamTestDigSDD+;
+#pragma link C++ class AliITSBeamTestDigSSD+;
+#pragma link C++ class AliITSBeamTestDigitizer+;
+#pragma link C++ class AliITSEventHeader+;
#pragma link C++ class AliITSReconstructor+;
AliITSRawStreamSSD.cxx \
AliITSRawStreamSDD.cxx \
AliITSRawStreamSPD.cxx \
+ AliITSBeamTest.cxx \
+ AliITSBeamTestDig.cxx \
+ AliITSBeamTestDigSDD.cxx \
+ AliITSBeamTestDigSPD.cxx \
+ AliITSBeamTestDigSSD.cxx \
+ AliITSBeamTestDigitizer.cxx \
+ AliITSEventHeader.cxx \
+ AliITSRawStreamSSDv1.cxx \
# AliITSv11.cxx \
# AliITSv11Geometry.cxx \
# AliITSv11GeometrySupport.cxx \