1 /**************************************************************************
2 * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 #include "Riostream.h"
17 #include "TObjArray.h"
18 #include "AliTPCBuffer.h"
19 #include "AliSimDigits.h"
24 ClassImp(AliTPCBuffer)
25 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
26 AliTPCBuffer::AliTPCBuffer(const char* fileName){
27 f.open("AliTPCDDL.dat",ios::binary|ios::out);
28 // fout=new TFile(fileName,"recreate");
29 // tree=new TTree("tree","Values");
34 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
35 AliTPCBuffer::~AliTPCBuffer(){
40 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
41 AliTPCBuffer::AliTPCBuffer(const AliTPCBuffer &source){
45 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
46 AliTPCBuffer& AliTPCBuffer::operator=(const AliTPCBuffer &source){
50 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
52 void AliTPCBuffer::WriteRow(Int_t eth,AliSimDigits *digrow,Int_t minPad,Int_t maxPad,Int_t flag,Int_t sec,Int_t SubSec,Int_t row){
53 //flag=0 the whole row is written to the root file
54 //flag=1 only value in the range [minPad,MaxPasd] are written to the root file
55 //flag=2 complementary case of 1
59 tree->Branch("sec",&sec,"sec/I");
60 tree->Branch("SubSec",&SubSec,"SubSec/I");
61 tree->Branch("row",&row,"row/I");
62 tree->Branch("Pad",&Pad,"Pad/I");
63 tree->Branch("Dig",&Dig,"Dig/I");
64 tree->Branch("Time",&Time,"Time/I");
67 Dig=digrow->CurrentDigit(); //adc
68 Time=digrow->CurrentRow(); //time
69 Pad =digrow->CurrentColumn(); // pad
70 // cout<<"Sec "<<sec<<" row "<<row<<" Pad "<<Pad<<" Dig "<<Dig<<" Time "<<Time<<endl;
79 if((Pad>=minPad)&&(Pad<=maxPad)){
86 if((Pad<minPad)||(Pad>maxPad)){
94 }while (digrow->Next());
99 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
100 void AliTPCBuffer::WriteRowBinary(Int_t eth,AliSimDigits *digrow,Int_t minPad,Int_t maxPad,Int_t flag,Int_t sec,Int_t SubSec,Int_t row){
101 //flag=0 the whole row is written intto the file
102 //flag=1 only value in the range [minPad,MaxPasd] are written into the file
103 //flag=2 complementary case of 1
118 data.Dig=digrow->CurrentDigit(); //adc
119 data.Time=digrow->CurrentRow(); //time
120 data.Pad =digrow->CurrentColumn(); // pad
125 f.write((char*)(&data),sizeof(data));
129 if((data.Pad>=minPad)&&(data.Pad<=maxPad)){
130 f.write((char*)(&data),sizeof(data));
136 if((data.Pad<minPad)||(data.Pad>maxPad)){
137 f.write((char*)(&data),sizeof(data));
144 }while (digrow->Next());
147 //////////////////////////////////////////////////////////////////////////////////////////////////////////////