#include "AliL3StandardIncludes.h"
#include <TClonesArray.h>
#include <TSystem.h>
+#include <TMath.h>
#ifdef use_newio
#include <AliRunLoader.h>
-#include <AliTPC.h>
#endif
#include <AliTPCParamSR.h>
#include <AliTPCDigitsArray.h>
#include "AliL3TrackArray.h"
#include "AliL3FileHandler.h"
-#if __GNUC__ == 3
+#if __GNUC__ >= 3
using namespace std;
#endif
ClassImp(AliL3FileHandler)
// of course on start up the index is not created
-Bool_t AliL3FileHandler::fStaticIndexCreated=kFALSE;
-Int_t AliL3FileHandler::fStaticIndex[36][159];
+Bool_t AliL3FileHandler::fgStaticIndexCreated=kFALSE;
+Int_t AliL3FileHandler::fgStaticIndex[36][159];
void AliL3FileHandler::CleanStaticIndex()
-{ // use this static call to clean static index after
+{
+ // use this static call to clean static index after
// running over one event
-
for(Int_t i=0;i<AliL3Transform::GetNSlice();i++){
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
- fStaticIndex[i][j]=-1;
+ fgStaticIndex[i][j]=-1;
}
- fStaticIndexCreated=kFALSE;
+ fgStaticIndexCreated=kFALSE;
}
Int_t AliL3FileHandler::SaveStaticIndex(Char_t *prefix,Int_t event)
-{ // use this static call to store static index after
- if(!fStaticIndexCreated) return -1;
+{
+ // use this static call to store static index after
+ if(!fgStaticIndexCreated) return -1;
Char_t fname[1024];
if(prefix)
for(Int_t i=0;i<AliL3Transform::GetNSlice();i++){
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
- file << fStaticIndex[i][j] << " ";
+ file << fgStaticIndex[i][j] << " ";
file << endl;
}
file.close();
}
Int_t AliL3FileHandler::LoadStaticIndex(Char_t *prefix,Int_t event)
-{ // use this static call to store static index after
- if(fStaticIndexCreated){
+{
+ // use this static call to store static index after
+ if(fgStaticIndexCreated){
LOG(AliL3Log::kWarning,"AliL3FileHandler::LoadStaticIndex","Inxed")
<<"Static index already created, will overwrite"<<ENDLOG;
CleanStaticIndex();
for(Int_t i=0;i<AliL3Transform::GetNSlice();i++){
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
- file >> fStaticIndex[i][j];
+ file >> fgStaticIndex[i][j];
}
file.close();
- fStaticIndexCreated=kTRUE;
+ fgStaticIndexCreated=kTRUE;
return 0;
}
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
fIndex[i][j]=-1;
- if(fUseStaticIndex&&!fStaticIndexCreated) CleanStaticIndex();
+ if(fUseStaticIndex&&!fgStaticIndexCreated) CleanStaticIndex();
}
AliL3FileHandler::~AliL3FileHandler()
}
void AliL3FileHandler::FreeDigitsTree()
-{
+{
+ //free digits tree
if(!fDigitsTree)
{
LOG(AliL3Log::kInformational,"AliL3FileHandler::FreeDigitsTree()","Pointer")
}
Bool_t AliL3FileHandler::SetMCOutput(Char_t *name)
-{
+{
+ //set mc input
fMC = fopen(name,"w");
if(!fMC){
LOG(AliL3Log::kWarning,"AliL3FileHandler::SetMCOutput","File Open")
}
Bool_t AliL3FileHandler::SetMCOutput(FILE *file)
-{
+{
+ //set mc output
fMC = file;
if(!fMC){
LOG(AliL3Log::kWarning,"AliL3FileHandler::SetMCOutput","File Open")
}
void AliL3FileHandler::CloseMCOutput()
-{
+{
+ //close mc output
if(!fMC){
LOG(AliL3Log::kWarning,"AliL3FileHandler::CloseMCOutPut","File Close")
<<"Nothing to Close"<<ENDLOG;
}
Bool_t AliL3FileHandler::SetAliInput()
-{
+{
+ //set ali input
#ifdef use_newio
fInAli->CdGAFile();
- fParam = AliTPC::LoadTPCParam(gFile);
+ fParam = (AliTPCParam*)gFile->Get("75x40_100x60_150x60");
if(!fParam){
LOG(AliL3Log::kWarning,"AliL3FileHandler::SetAliInput","File")
<<"No TPC parameters found in \""<<gFile->GetName()
}
Bool_t AliL3FileHandler::SetAliInput(Char_t *name)
-{
+{
//Open the AliROOT file with name.
#ifdef use_newio
fInAli= AliRunLoader::Open(name);
#ifdef use_newio
Bool_t AliL3FileHandler::SetAliInput(AliRunLoader *runLoader)
-{
+{
+ //set ali input as runloader
fInAli=runLoader;
fUseRunLoader = kTRUE;
if(!fInAli){
#ifdef use_newio
Bool_t AliL3FileHandler::SetAliInput(TFile */*file*/)
{
+ //Specify already opened AliROOT file to use as an input.
LOG(AliL3Log::kFatal,"AliL3FileHandler::SetAliInput","File Open")
<<"This function is not supported for NEWIO, check ALIHLT_USENEWIO settings in Makefile.conf"<<ENDLOG;
return kFALSE;
}
#else
Bool_t AliL3FileHandler::SetAliInput(TFile *file)
-{
+{
//Specify already opened AliROOT file to use as an input.
fInAli=file;
if(!fInAli){
#endif
void AliL3FileHandler::CloseAliInput()
-{
+{
+ //close ali input
#ifdef use_newio
if(fUseRunLoader) return;
#endif
///////////////////////////////////////// Digit IO
Bool_t AliL3FileHandler::AliDigits2Binary(Int_t event,Bool_t altro)
{
+ //save alidigits as binary
Bool_t out = kTRUE;
UInt_t nrow;
AliL3DigitRowData* data = 0;
//create the access index or copy from static index
fIndexCreated=kFALSE;
- if(!fStaticIndexCreated || !fUseStaticIndex) { //we have to create index
+ if(!fgStaticIndexCreated || !fUseStaticIndex) { //we have to create index
LOG(AliL3Log::kInformational,"AliL3FileHandler::CreateIndex","Index")
<<"Starting to create index, this can take a while."<<ENDLOG;
if(fUseStaticIndex) { // create static index
for(Int_t i=0;i<AliL3Transform::GetNSlice();i++){
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
- fStaticIndex[i][j]=fIndex[i][j];
+ fgStaticIndex[i][j]=fIndex[i][j];
}
- fStaticIndexCreated=kTRUE; //remember that index has been created
+ fgStaticIndexCreated=kTRUE; //remember that index has been created
}
LOG(AliL3Log::kInformational,"AliL3FileHandler::CreateIndex","Index")
} else if(fUseStaticIndex) { //simply copy static index
for(Int_t i=0;i<AliL3Transform::GetNSlice();i++){
for(Int_t j=0;j<AliL3Transform::GetNRows();j++)
- fIndex[i][j]=fStaticIndex[i][j];
+ fIndex[i][j]=fgStaticIndex[i][j];
}
LOG(AliL3Log::kInformational,"AliL3FileHandler::CreateIndex","Index")
<<"Index successfully taken from static copy."<<ENDLOG;
-
}
-
fIndexCreated=kTRUE;
return kTRUE;
}
return data;
}
- Int_t * ndigits = new Int_t[entries];
+ Int_t * ndigits = new Int_t[fRowMax+1];
Float_t xyz[3];
for(Int_t r=fRowMin;r<=fRowMax;r++){
dig = AliL3Transform::GetADCSat();
AliL3Transform::Raw2Local(xyz,sector,row,pad,time);
- if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2]))
- continue; // why 230???
+ // if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2]))
+ // continue; // why 230???
ndigits[lrow]++; //for this row only
ndigitcount++; //total number of digits to be published
//Exclude data outside cone:
AliL3Transform::Raw2Local(xyz,sector,row,pad,time);
- if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2]))
- continue; // why 230???
+ // if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2]))
+ // continue; // why 230???
if(localcount >= ndigits[lrow])
LOG(AliL3Log::kFatal,"AliL3FileHandler::AliDigits2Binary","Memory")
}
return data;
}
- Int_t * ndigits = new Int_t[entries];
+ Int_t * ndigits = new Int_t[fRowMax+1];
Int_t lslice,lrow;
Int_t zerosupval=AliL3Transform::GetZeroSup();
Float_t xyz[3];
}
AliL3Transform::Raw2Local(xyz,sector,row,pad,time);
- if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2]))
- continue;
+ // if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2]))
+ // continue;
ndigits[lrow]++; //for this row only
ndigitcount++; //total number of digits to be published
}
AliL3Transform::Raw2Local(xyz,sector,row,pad,time);
- if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2]))
- continue;
+ // if(fParam->GetPadRowRadii(sector,row)<230./250.*fabs(xyz[2]))
+ // continue;
if(localcount >= ndigits[lrow])
LOG(AliL3Log::kFatal,"AliL3FileHandler::AliAltroDigits2Binary","Memory")
}
///////////////////////////////////////// Point IO
-Bool_t AliL3FileHandler::AliPoints2Binary(Int_t eventn){
+Bool_t AliL3FileHandler::AliPoints2Binary(Int_t eventn)
+{
+ //points to binary
Bool_t out = kTRUE;
UInt_t npoint;
AliL3SpacePointData *data = AliPoints2Memory(npoint,eventn);
return out;
}
-AliL3SpacePointData * AliL3FileHandler::AliPoints2Memory(UInt_t & npoint,Int_t eventn){
+AliL3SpacePointData * AliL3FileHandler::AliPoints2Memory(UInt_t & npoint,Int_t eventn)
+{
+ //points to memory
AliL3SpacePointData *data = 0;
npoint=0;
if(!fInAli){