#include <stream.h>
#include <libgen.h>
+#include "AliL3RootTypes.h"
+#include "AliL3Logger.h"
#include "AliL3MemHandler.h"
#include "AliL3AltroMemHandler.h"
#include "AliL3DigitData.h"
int main(int argc,char **argv)
{
- Int_t nrows=175;
+ Int_t slice=0;
+ Int_t patch=0;
Bool_t altroout=kFALSE;
FILE *afile=0;
+
+ /*
+ AliL3Logger l;
+ l.Set(AliL3Logger::kAll);
+ //l.UseStdout();
+ l.UseStream();
+ */
if(argc<2)
{
- cout<<"Usage: read datafile [padrows] [altrodatfile]"<<endl;
+ cout<<"Usage: read datafile [slice] [patch] [altrodatfile]"<<endl;
return -1;
}
if (argc>2) {
- nrows=atoi(argv[2]);
+ slice=atoi(argv[2]);
}
if (argc>3) {
+ patch=atoi(argv[3]);
+ }
+ if (argc>4) {
altroout=kTRUE;
- afile=fopen(argv[3],"w");
+ afile=fopen(argv[4],"w");
}
+
+ //Loading all specific aliroot version quantities, needed.
+ Char_t fname[1024];
+ strcpy(fname,argv[1]);
+ AliL3Transform::Init(dirname(fname));
+ strcpy(fname,argv[1]);
//Filehandler object:
AliL3MemHandler file;
+ //Give slice and patch information (see filename convention)
+ if((patch>=0)&&(patch<6)) file.Init(slice,patch);
+ else {
+ Int_t srows[2]={0,175};
+ file.Init(slice,0,srows);
+ }
+
//Open the data file:
if(!file.SetBinaryInput(argv[1]))
{
cerr<<"Error opening file "<<argv[1]<<endl;
return -1;
}
-
- //Storing all detector-spesific quantities, needed.
- AliL3Transform::Init(dirname(argv[1]));
//Create an RowData object to access the data
AliL3DigitRowData *digits=0;
- UInt_t ndigits=0;
+ UInt_t nrows=0;
//Read the file, and store the data in memory. Return value is a pointer to the data.
- digits = file.CompBinary2Memory(ndigits);
- if((Int_t)ndigits<nrows) nrows=ndigits;
+ digits = file.CompBinary2Memory(nrows);
//Create an ALtroMemHandler object
AliL3AltroMemHandler altromem;
UShort_t time,charge;
UChar_t pad;
- Int_t crows=0,lrow=-1;
- for(Int_t row=0; row<nrows; row++) //Loop over padrows
+ Int_t row=file.GetRowMin()-1,crows=0,lrow=row;
+
+ for(UInt_t r=0; r<nrows; r++) //Loop over padrows
{
//Get the data on this padrow:
AliL3DigitData *dataPt = (AliL3DigitData*)digits->fDigitData;
+ row++;
if(lrow+1==row) crows++;
//Loop over all digits on this padrow:
for(UInt_t ndig=0; ndig<digits->fNDigit; ndig++)
- //for(UInt_t ndig=digits->fNDigit;ndig>0;ndig--)
+ //for(UInt_t ndig=digits->fNDigit;ndig>0;ndig--)
{
lrow=row;
pad = dataPt[ndig].fPad;
fclose(afile);
}
- cerr << "Rows: " << nrows << " Consecutive: " << crows << endl;
+ //cerr << "Rows: " << (file.GetRowMax()-file.GetRowMin()+1) << " Consecutive: " << crows << endl;
return 0;
}
+
+
#include <stream.h>
#include <libgen.h>
+#include "AliL3RootTypes.h"
#include "AliL3Transform.h"
#include "AliL3ClustFinderNew.h"
#include "AliL3MemHandler.h"
int main(int argc,char **argv)
{
- if(argc!=2)
- {
- cout<<"Usage: runit datafile"<<endl;
- return -1;
- }
+ Int_t slice=0;
+ Int_t patch=0;
+
+ /*
+ AliL3Logger l;
+ l.Set(AliL3Logger::kAll);
+ l.UseStdout();
+ //l.UseStream();
+ */
+
+ if(argc<2){
+ cout<<"Usage: runit datafile [slice] [patch]"<<endl;
+ return -1;
+ }
+ if (argc>2) {
+ slice=atoi(argv[2]);
+ }
+ if (argc>3) {
+ patch=atoi(argv[3]);
+ }
AliL3DigitRowData *digits = 0;
unsigned int ndigits=0;
+ //Storing all specific quantities, needed by the Cluster Finder.
+ Char_t fname[1024];
+ strcpy(fname,argv[1]);
+ AliL3Transform::Init(dirname(fname));
+ strcpy(fname,argv[1]);
+
//Does all the file/data handling
AliL3MemHandler file;
+ //Give slice and patch information (see filename convention)
+ if((patch>=0)&&(patch<6)) file.Init(slice,patch);
+ else {
+ Int_t srows[2]={0,175};
+ file.Init(slice,0,srows);
+ }
+
//Open the data file:
- if(!file.SetBinaryInput(argv[1]))
+ if(!file.SetBinaryInput(fname))
{
- cerr<<"Error opening file "<<argv[1]<<endl;
+ cerr<<"Error opening file "<<fname<<endl;
return -1;
}
digits = file.CompBinary2Memory(ndigits);
file.CloseBinaryInput();
- //Storing all detector-spesific quantities, needed by the clusterfinder.
- AliL3Transform::Init(dirname(argv[1]));
-
//The cluster finder itself.
AliL3ClustFinderNew cf;
cf.SetCalcErr(kTRUE);
//Switch off deconvolution:
- cf.SetDeconv(false);
+ cf.SetDeconv(kFALSE);
//Allocate memory to store found spacepoints
AliL3MemHandler fpoints;
return 0;
}
-