FMDbase FMDsim FMDrec TOFbase TOFrec TOFsim PHOS CRT \
RICHbase RICHrec RICHsim \
ZDCbase ZDCsim ZDCrec VZERObase VZEROsim VZEROrec EMCAL \
- STRUCT STARTbase STARTsim STARTrec EVGEN ESD STEER CONTAINERS \
+ STRUCT STARTbase STARTsim STARTrec EVGEN ESD STEER \
pythia6 AliPythia6 pdf THijing \
hijing TMEVSIM mevsim THbtp HBTP TEPEMGEN EPEMGEN \
FASTSIM microcern RAWData AliL3Src AliL3Comp AliL3Misc \
# variable SHLIBS (SHared LIBrarieS).
# Please note that the order of static libraries is important, the ones
# which provide code for the others have to be placed after their "clients".
-# For example ITS uses TPC code, TPC uses CONTAINERS code, so the order has
-# to be ITS TPC CONTAINERS
+# For example if ITS uses TPC code, the order has to be ITS TPC
ARLIBS:= \
FMD/tgt_$(ALICE_TARGET)/G__FMDbase.o $(LIBPATH)/libFMDbase.a \
TPC/tgt_$(ALICE_TARGET)/G__TPCfast.o $(LIBPATH)/libTPCfast.a \
STEER/tgt_$(ALICE_TARGET)/G__STEER.o $(LIBPATH)/libSTEER.a \
STEER/tgt_$(ALICE_TARGET)/G__ESD.o $(LIBPATH)/libESD.a \
- CONTAINERS/tgt_$(ALICE_TARGET)/G__CONTAINERS.o $(LIBPATH)/libCONTAINERS.a \
RAW/tgt_$(ALICE_TARGET)/G__RAW.o $(LIBPATH)/libRAWData.a
SHLIBS:= $(BINLIBDIRS) -lEVGEN -lpythia6 -lAliPythia6 -lpdf -lTHijing -lhijing -lTMEVSIM -lmevsim -lTHbtp -lHBTP -lTHerwig -lherwig -lTEPEMGEN -lEPEMGEN -lTPHIC -lFASTSIM -lmicrocern
AliFlowAnalysis.h AliReaderESDTree.h \
AliMuonAnalysis.h AliAODv0.h
-EINCLUDE:= TPC CONTAINERS ITS
+EINCLUDE:= TPC ITS
+++ /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$ */
-
-//-----------------------------------------------------
-// A Branch for the case of an array of clone objects.
-//-----------------------------------------------------
-// Author M.Ivanov
-//*KEND.
-
-#include "TROOT.h"
-#include "AliArrayBranch.h"
-#include "TFile.h"
-#include "TTree.h"
-#include "TBasket.h"
-#include "TClass.h"
-#include "TRealData.h"
-#include "TDataType.h"
-#include "TDataMember.h"
-
-#include "TBranch.h"
-#include "TBranchClones.h"
-#include "TLeaf.h"
-#include "TLeafB.h"
-#include "TLeafC.h"
-#include "TLeafF.h"
-#include "TLeafD.h"
-#include "TLeafI.h"
-#include "TLeafS.h"
-#include "TLeafObject.h"
-
-#include "AliObjectArray.h"
-#include "AliDataType.h"
-
-
-R__EXTERN TTree *gTree;
-
-ClassImp(AliArraySubBranch)
-ClassImp(AliArrayBranch)
-ClassImp(AliObjectBranch)
-ClassImp(AliTree)
-
-
-
- Int_t AliArraySubBranch::GetEntryExport(Int_t entry, Int_t /*getall*/, AliObjectArray *list, Int_t nentries)
-{
-//*-*-*-*-*-*Read all leaves of entry and return total number of bytes*-*-*
-//*-* export buffers to real objects in the AliObjectArray list.
-//*-*
-
- if (TestBit(kDoNotProcess)) return 0;
- if (fReadEntry == entry) return 1;
- if (entry < 0 || entry >= fEntryNumber) return 0;
- Int_t nbytes;
- Int_t first = fBasketEntry[fReadBasket];
- Int_t last;
- if (fReadBasket == fWriteBasket) last = fEntryNumber - 1;
- else last = fBasketEntry[fReadBasket+1] - 1;
-//
-// Are we still in the same ReadBasket?
- if (entry < first || entry > last) {
- fReadBasket = TMath::BinarySearch(fWriteBasket+1, fBasketEntry, entry);
- first = fBasketEntry[fReadBasket];
- }
-
-// We have found the basket containing this entry.
-// make sure basket buffers are in memory.
- TBasket *basket = GetBasket(fReadBasket);
- if (!basket) return 0;
- TBuffer *buf = basket->GetBufferRef();
-// Set entry offset in buffer and read data from all leaves
- if (!buf->IsReading()) {
- basket->SetReadMode();
- }
-// Int_t bufbegin = basket->GetEntryPointer(entry-first);
- Int_t bufbegin;
- Int_t *entryOffset = basket->GetEntryOffset();
- if (entryOffset) bufbegin = entryOffset[entry-first];
- else bufbegin = basket->GetKeylen() + (entry-first)*basket->GetNevBufSize();
- buf->SetBufferOffset(bufbegin);
-
- TLeaf *leaf = (TLeaf*)fLeaves.UncheckedAt(0);
- // leaf->ReadBasketExport(*buf,list,nentries); //!!! MI
- ReadBasketExport(*buf,leaf, list,nentries);
- nbytes = buf->Length() - bufbegin;
- fReadEntry = entry;
-
- return nbytes;
-}
-
-void AliArraySubBranch::ReadBasketExport(TBuffer &b, TLeaf *leaf, AliObjectArray *list, Int_t n)
-{
- //
- //
- Int_t len = leaf->GetLenStatic();
- Int_t offset = leaf->GetOffset();
- void *value = leaf->GetValuePointer();
-
- //8bit integer
- if (leaf->IsA()==TLeafB::Class()){
- Int_t j = 0;
- for (Int_t i=0;i<n;i++) {
- memcpy((char*)list->UncheckedAt(i) + offset,&((Char_t*)value)[j], len);
- j += len;
- }
- }
- //variable length string.
- if (leaf->IsA()==TLeafC::Class()){
- UChar_t len;
- b >> len;
- if (len) {
- if (len >= len) len = len-1;
- b.ReadFastArray((Char_t*)value,len);
- ((Char_t*)value)[len] = 0;
- } else {
- value = 0;
- }
- Int_t j = 0;
- for (Int_t i=0;i<n;i++) {
- memcpy((char*)list->UncheckedAt(i) + offset,&((Char_t*)value)[j], 1);
- j += len;
- }
- }
- //double
- if (leaf->IsA()==TLeafD::Class()){
- b.ReadFastArray(((Double_t*)value),n*len);
- Int_t j = 0;
- for (Int_t i=0;i<n;i++) {
- memcpy((char*)list->UncheckedAt(i) + offset,&((Double_t*)value)[j], 8*len);
- j += len;
- }
- }
- //float
- if (leaf->IsA()==TLeafF::Class()){
- if (n*len == 1) {
- b >> ((Float_t*)value)[0];
- } else {
- b.ReadFastArray(((Float_t*)value),n*len);
- }
-
- Float_t *val = (Float_t*)value;
- for (Int_t i=0;i<n;i++) {
- char *first = (char*)list->UncheckedAt(i);
- Float_t *ff = (Float_t*)&first[offset];
- for (Int_t j=0;j<len;j++) {
- ff[j] = val[j];
- }
- val += len;
- }
- return;
- }
- //int2
- if (leaf->IsA()==TLeafS::Class()){
- if (n*len == 1) {
- b >> ((Short_t*)value)[0];
- } else {
- b.ReadFastArray(((Short_t*)value),n*len);
- }
- Short_t *val = (Short_t*)value;
- for (Int_t i=0;i<n;i++) {
- char *first = (char*)list->UncheckedAt(i);
- Short_t *ii = (Short_t*)&first[offset];
- for (Int_t j=0;j<len;j++) {
- ii[j] = val[j];
- }
- val += len;
- }
- return;
- }
- //int4
- if (leaf->IsA()==TLeafI::Class()){
- if (n*len == 1) {
- b >> ((Int_t*)value)[0];
- } else {
- b.ReadFastArray(((Int_t*)value),n*len);
- }
- Int_t *val = (Int_t*)value;
- for (Int_t i=0;i<n;i++) {
- char *first = (char*)list->UncheckedAt(i);
- Int_t *ii = (Int_t*)&first[offset];
- for (Int_t j=0;j<len;j++) {
- ii[j] = val[j];
- }
- val += len;
- }
- return;
- }
-}
-
-
-//______________________________________________________________________________
-AliArrayBranch::AliArrayBranch(): TBranch()
-{
-//*-*-*-*-*-*Default constructor for BranchClones*-*-*-*-*-*-*-*-*-*
-//*-* ====================================
-
- fList = 0;
- fRead = 0;
- fN = 0;
- fNdataMax = 0;
- fBranchCount = 0;
-}
-
-
-//______________________________________________________________________________
-AliArrayBranch::AliArrayBranch(const Text_t *name, void *pointer, TTree * tree, Int_t basketsize, Int_t compress)
- :TBranch()
-{
-//*-*-*-*-*-*-*-*-*-*-*-*-*Create a BranchClones*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-//*-* =====================
-//
- char leaflist[80];
- char branchname[80];
- char branchcount[64];
- fTree = tree;
- gTree = tree; // MI because some bug in ROOT I didn't obtain proper gTree
- // it is necesary to set gTree because oder subranchces defined below need it
- SetName(name);
- if (compress == -1) {
- TFile *bfile = fTree->GetDirectory()->GetFile();
- if (bfile) compress = bfile->GetCompressionLevel();
- }
- char *cpointer = (char*)pointer;
- char **ppointer = (char**)(cpointer);
- fList = (AliObjectArray*)(*ppointer);
- fAddress = cpointer;
- fRead = 0;
- fN = 0;
- fNdataMax = 0;
-
- AliClassInfo *clinfo = fList->GetClassInfo();
- if (!clinfo) return;
- fClassName = clinfo->GetName();
-
-//*-*- Create a branch to store the array count
- if (basketsize < 100) basketsize = 100;
- sprintf(leaflist,"%s_/I",name);
- sprintf(branchcount,"%s_",name);
- fBranchCount = new TBranch(branchcount,&fN,leaflist,basketsize);
- fBranchCount->SetBit(kIsClone);
- TLeaf *leafcount = (TLeaf*)fBranchCount->GetListOfLeaves()->UncheckedAt(0);
-
-//*-*- Create the first basket
-
- fDirectory = fTree->GetDirectory();
- fFileName = "";
-
- TBasket *basket = new TBasket(branchcount,fTree->GetName(),this);
- fBaskets.Add(basket);
-
-//*-*- Loop on all public data members of the class and its base classes
-
- TClass *cl = fList->GetClass();
- if (cl){
- if (!cl->GetListOfRealData()) cl->BuildRealData();
-
- const char *itype = 0;
- TRealData *rd;
- TIter next(cl->GetListOfRealData());
- while ((rd = (TRealData *) next())) {
- TDataMember *member = rd->GetDataMember();
- if (!member->IsBasic()) {
- Warning("BranchClones","Cannot process member:%s",member->GetName());
- continue;
- }
- if (!member->IsPersistent()) continue; //do not process members with a ! as the first
- // character in the comment field
- TDataType *membertype = member->GetDataType();
- Int_t type = membertype->GetType();
- if (type == 0) {
- Warning("BranchClones","Cannot process member:%s",member->GetName());
- continue;
- }
- if (type == 1) itype = "B";
- if (type == 11) itype = "b";
- if (type == 3) itype = "I";
- if (type == 5) itype = "F";
- if (type == 8) itype = "D";
- if (type == 13) itype = "i";
- if (type == 2) itype = "S";
- if (type == 12) itype = "s";
-
-
- Int_t arraydim = member->GetArrayDim();
- if (arraydim!=1){
- // OLD Version
- sprintf(leaflist,"%s[%s]/%s",member->GetName(),branchcount,itype);
- Int_t comp = compress;
- if (type == 5) comp--;
- sprintf(branchname,"%s.%s",name,rd->GetName());
- TBranch *branch = new AliArraySubBranch(branchname,this,leaflist,basketsize,comp);
- branch->SetBit(kIsClone);
- TObjArray *leaves = branch->GetListOfLeaves();
- TLeaf *leaf = (TLeaf*)leaves->UncheckedAt(0);
- leaf->SetOffset(rd->GetThisOffset());
- leaf->SetLeafCount(leafcount);
- Int_t arraydim = member->GetArrayDim();
- if (arraydim) {
- Int_t maxindex = member->GetMaxIndex(arraydim-1);
- leaf->SetLen(maxindex);
- }
- fBranches.Add(branch);
- }
- else
- for (Int_t i=0;i< member->GetMaxIndex(0);i++){
- const char * dmname = member->GetName() ;
- char bname[200];
- Int_t j=0;
- while ( (dmname[j]!='[') && (dmname[j]!=0) ){
- bname[j]=dmname[j];
- j++;
- }
- bname[j]=0;
- sprintf(leaflist,"%s(%d)[%s]/%s",bname,i,branchcount,itype);
- Int_t comp = compress;
- if (type == 5) comp--;
- sprintf(branchname,"%s.%s(%d)",name,bname,i);
- TBranch *branch = new AliArraySubBranch(branchname,this,leaflist,basketsize,comp);
- branch->SetBit(kIsClone);
- TObjArray *leaves = branch->GetListOfLeaves();
- TLeaf *leaf = (TLeaf*)leaves->UncheckedAt(0);
- leaf->SetOffset(rd->GetThisOffset()+membertype->Size()*i);
- leaf->SetLeafCount(leafcount);
- fBranches.Add(branch);
- }
-
- }
- }
- else if (clinfo->IsA()->InheritsFrom("AliDataType")){ //branch for basic type
- Int_t type = (((AliDataType*)clinfo)->GetDataType())->GetType();
- const char *itype = 0;
- if (type <=0)
- Warning("BranchClones","Cannot process member:%s",clinfo->GetName());
- else{
-
- if (type == 1) itype = "B";
- if (type == 11) itype = "b";
- if (type == 3) itype = "I";
- if (type == 5) itype = "F";
- if (type == 8) itype = "D";
- if (type == 13) itype = "i";
- if (type == 2) itype = "S";
- if (type == 12) itype = "s";
- sprintf(leaflist,"%s[%s]/%s",name,branchcount,itype);
- Int_t comp = compress;
- if (type == 5) comp--;
- sprintf(branchname,"%s",clinfo->GetName());
- TBranch *branch = new AliArraySubBranch(branchname,this,leaflist,basketsize,comp);
- branch->SetBit(kIsClone);
- TObjArray *leaves = branch->GetListOfLeaves();
- TLeaf *leaf = (TLeaf*)leaves->UncheckedAt(0);
- leaf->SetOffset(0);
- leaf->SetLeafCount(leafcount);
- fBranches.Add(branch);
- }
- }
-
-}
-
-
-//______________________________________________________________________________
-AliArrayBranch::~AliArrayBranch()
-{
-//*-*-*-*-*-*Default destructor for a BranchClones*-*-*-*-*-*-*-*-*-*-*-*
-//*-* =====================================
-
- delete fBranchCount;
- fBranchCount = 0;
- fBranches.Delete();
- fList = 0;
-}
-
-
-//______________________________________________________________________________
-void AliArrayBranch::Browse(TBrowser *b)
-{
- fBranches.Browse( b );
-}
-
-//______________________________________________________________________________
-Int_t AliArrayBranch::Fill()
-{
-//*-*-*-*-*Loop on all Branches of this BranchClones to fill Basket buffer*-*
-//*-* ===============================================================
-
- Int_t i;
- Int_t nbytes = 0;
- Int_t nbranches = fBranches.GetEntriesFast();
- char **ppointer = (char**)(fAddress);
- if (ppointer == 0) return 0;
- fList = (AliObjectArray*)(*ppointer);
- // fN = fList->GetEntriesFast();
- fN = fList->GetSize();
- fEntries++;
-
- if (fN > fNdataMax) {
- fNdataMax = fList->GetSize();
- char branchcount[64];
- sprintf(branchcount,"%s_",GetName());
- TLeafI *leafi = (TLeafI*)fBranchCount->GetLeaf(branchcount);
- leafi->SetMaximum(fNdataMax);
- for (i=0;i<nbranches;i++) {
- TBranch *branch = (TBranch*)fBranches.UncheckedAt(i);
- TObjArray *leaves = branch->GetListOfLeaves();
- TLeaf *leaf = (TLeaf*)leaves->UncheckedAt(0);
- leaf->SetAddress();
- }
- }
- nbytes += fBranchCount->Fill();
- for (i=0;i<nbranches;i++) {
- TBranch *branch = (TBranch*)fBranches.UncheckedAt(i);
- TObjArray *leaves = branch->GetListOfLeaves();
- TLeaf *leaf = (TLeaf*)leaves->UncheckedAt(0);
- // leaf->Import(fList, fN); // MI
- Import(leaf,fN); // MI change
- nbytes += branch->Fill();
- }
- return nbytes;
-}
-
-//______________________________________________________________________________
-Int_t AliArrayBranch::GetEntry(Long64_t entry, Int_t getall)
-{
-//*-*-*-*-*Read all branches of a BranchClones and return total number of bytes
-//*-* ====================================================================
-
- if (TestBit(kDoNotProcess) && !getall) return 0;
- Int_t nbytes = fBranchCount->GetEntry(entry);
- TLeaf *leafcount = (TLeaf*)fBranchCount->GetListOfLeaves()->UncheckedAt(0);
- fN = Int_t(leafcount->GetValue());
- if (fN <= 0) return 0;
-
- TBranch *branch;
- Int_t nbranches = fBranches.GetEntriesFast();
-
- // if fList exists, create clonesarray objects
- if (fList) {
- //fList->ExpandCreateFast(fN); //MI
- fList->Resize(fN); //MI change
- for (Int_t i=0;i<nbranches;i++) {
- branch = (TBranch*)fBranches.UncheckedAt(i);
- nbytes += ((AliArraySubBranch*)branch)->GetEntryExport(entry, getall, fList, fN); // !!!MI
- }
- } else {
- for (Int_t i=0;i<nbranches;i++) {
- branch = (TBranch*)fBranches.UncheckedAt(i);
- nbytes += branch->GetEntry(entry, getall);
- }
- }
- return nbytes;
-}
-
-//______________________________________________________________________________
-void AliArrayBranch::Print(Option_t *option) const
-{
-//*-*-*-*-*-*-*-*-*-*-*-*Print TBranch parameters*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-//*-* ========================
-
- fBranchCount->Print(option);
- Int_t i;
- Int_t nbranches = fBranches.GetEntriesFast();
- for (i=0;i<nbranches;i++) {
- TBranch *branch = (TBranch*)fBranches[i];
- branch->Print(option);
- }
-}
-
-//______________________________________________________________________________
-void AliArrayBranch::Reset(Option_t *option)
-{
-//*-*-*-*-*-*-*-*Reset a Branch*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-//*-* ====================
-//
-// Existing buffers are deleted
-// Entries, max and min are reset
-//
-
- fEntries = 0;
- fTotBytes = 0;
- fZipBytes = 0;
- Int_t i;
- Int_t nbranches = fBranches.GetEntriesFast();
- for (i=0;i<nbranches;i++) {
- TBranch *branch = (TBranch*)fBranches[i];
- branch->Reset(option);
- }
- fBranchCount->Reset();
-}
-
-//______________________________________________________________________________
-void AliArrayBranch::SetAddress(void *add)
-{
-//*-*-*-*-*-*-*-*Set address of this branch*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-//*-* ====================
-//*-*
-
- fReadEntry = -1;
- fAddress = (char*)add;
- char **ppointer = (char**)(fAddress);
- if ( (*ppointer)==0 ) { //MI change
- *ppointer = (char*) new AliObjectArray(fClassName);
- fAddress = (char*)ppointer;
- }
- fList = (AliObjectArray*)(*ppointer);
- fBranchCount->SetAddress(&fN);
-
-}
-
-//______________________________________________________________________________
-void AliArrayBranch::SetBasketSize(Int_t buffsize)
-{
-//*-*-*-*-*-*-*-*Reset basket size for all subbranches of this branchclones
-//*-* ==========================================================
-//
-
- fBasketSize = buffsize;
- Int_t i;
- Int_t nbranches = fBranches.GetEntriesFast();
- for (i=0;i<nbranches;i++) {
- TBranch *branch = (TBranch*)fBranches[i];
- branch->SetBasketSize(buffsize);
- }
-}
-
-//_______________________________________________________________________
-void AliArrayBranch::Streamer(TBuffer &b)
-{
-//*-*-*-*-*-*-*-*-*Stream a class object*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-//*-* =========================================
- if (b.IsReading()) {
- b.ReadVersion(); //Version_t v = b.ReadVersion();
- TNamed::Streamer(b);
- b >> fCompress;
- b >> fBasketSize;
- b >> fEntryOffsetLen;
- b >> fMaxBaskets;
- b >> fWriteBasket;
- b >> fEntryNumber;
- b >> fEntries;
- b >> fTotBytes;
- b >> fZipBytes;
- b >> fOffset;
- b >> fBranchCount;
- fClassName.Streamer(b);
- fBranches.Streamer(b);
- fTree = gTree;
- TBranch *branch;
- TLeaf *leaf;
- Int_t nbranches = fBranches.GetEntriesFast();
- for (Int_t i=0;i<nbranches;i++) {
- branch = (TBranch*)fBranches[i];
- branch->SetBit(kIsClone);
- leaf = (TLeaf*)branch->GetListOfLeaves()->UncheckedAt(0);
- leaf->SetOffset(0);
- }
- fRead = 1;
-
- AliClassInfo *clinfo = AliClassInfo::FindClassInfo(fClassName);
- if (!clinfo) {
- AliObjectArray tmp(fClassName);
- //MI change - object array to construct class description
- clinfo = AliClassInfo::FindClassInfo(fClassName);
- }
- if (!clinfo) return;
-
- TClass *cl = clinfo->GetClass();
- // if (!cl) {
- // Warning("Streamer","Unknow class: %s. Cannot read BranchClones: %s",
- // fClassName.Data(),GetName());
- // return;
- //}
- if (cl){
-
- if (!cl->GetListOfRealData()) cl->BuildRealData();
- char branchname[80];
- TRealData *rd;
- TIter next(cl->GetListOfRealData());
- while ((rd = (TRealData *) next())) {
- TDataMember *member = rd->GetDataMember();
- if (!member->IsBasic()) continue;
- if (!member->IsPersistent()) continue;
- TDataType *membertype = member->GetDataType();
- if (membertype->GetType() == 0) continue;
- //MI change - for array spliting
- Int_t arraydim = member->GetArrayDim();
- if (arraydim==1){
- for (Int_t i=0;i< member->GetMaxIndex(0);i++){
- const char * dmname = member->GetName() ;
- char bname[200];
- Int_t j=0;
- while ( (dmname[j]!='[') && (dmname[j]!=0) ){
- bname[j]=dmname[j];
- j++;
- }
- bname[j]=0;
- sprintf(branchname,"%s.%s(%d)",GetName(),bname,i);
- branch = (TBranch*)fBranches.FindObject(branchname);
- if (!branch) continue;
- TObjArray *leaves = branch->GetListOfLeaves();
- leaf = (TLeaf*)leaves->UncheckedAt(0);
- leaf->SetOffset(rd->GetThisOffset()+membertype->Size()*i);
- }
- }
- sprintf(branchname,"%s.%s",GetName(),rd->GetName());
- branch = (TBranch*)fBranches.FindObject(branchname);
- if (!branch) continue;
- TObjArray *leaves = branch->GetListOfLeaves();
- leaf = (TLeaf*)leaves->UncheckedAt(0);
- leaf->SetOffset(rd->GetThisOffset());
- }
-
- }
- else if (clinfo->IsA()->InheritsFrom("AliDataType")){ //branch for basic type
- char branchname[100];
- sprintf(branchname,"%s",clinfo->GetName());
- branch = (TBranch*)fBranches.FindObject(branchname);
- if (branch){
- TObjArray *leaves = branch->GetListOfLeaves();
- leaf = (TLeaf*)leaves->UncheckedAt(0);
- leaf->SetOffset(0);
- }
- }
- }
- else{
-
- b.WriteVersion(AliArrayBranch::IsA());
- TNamed::Streamer(b);
- b << fCompress;
- b << fBasketSize;
- b << fEntryOffsetLen;
- b << fMaxBaskets;
- b << fWriteBasket;
- b << fEntryNumber;
- b << fEntries;
- b << fTotBytes;
- b << fZipBytes;
- b << fOffset;
- b << fBranchCount;
- fClassName.Streamer(b);
- fBranches.Streamer(b);
- }
-}
-
-
-
-void AliArrayBranch::Import(TLeaf * leaf, Int_t n)
-{
- //
- // Import leaf n from the branch
- //
-
- const Int_t kIntUndefined = -9999;
- Int_t j = 0;
- char *clone;
- Int_t len = leaf->GetLenStatic();
- Int_t offset = leaf->GetOffset();
- void *value = leaf->GetValuePointer();
- //
- for (Int_t i=0;i<n;i++) {
- clone = (char*)fList->UncheckedAt(i);
- //8bit int
- if (leaf->IsA()==TLeafB::Class()){
- memcpy(&((Char_t*)value)[j],clone + offset, len);
- }
- //var size
- if (leaf->IsA()==TLeafC::Class()){
- memcpy(&((Char_t*)value)[j],clone + offset, 1);
- }
- //double
- if (leaf->IsA()==TLeafD::Class()){
- if (clone) memcpy(&((Double_t*)value)[j],clone + offset, 8*len);
- else memcpy(&((Double_t*)value)[j],&kIntUndefined, 8*len);
- }
- //float
- if (leaf->IsA()==TLeafF::Class()){
- if (clone) memcpy(&((Float_t*)value)[j],clone + offset, 4*len);
- else memcpy(&((Float_t*)value)[j],&kIntUndefined, 4*len);
- }
- //int
- if (leaf->IsA()==TLeafI::Class()){
- if (clone) memcpy(&((Int_t*)value)[j],clone + offset, 4*len);
- else memcpy(&((Int_t*)value)[j],&kIntUndefined, 4*len);
- }
- //short
- if (leaf->IsA()==TLeafS::Class()){
- if (clone) memcpy(&((Short_t*)value)[j],clone + offset, 2*len);
- else memcpy(&((Short_t*)value)[j],&kIntUndefined, 2*len);
- }
- j += len;
- }
- //
-}
-
-AliObjectBranch::AliObjectBranch(const Text_t *name, const Text_t *classname, void *addobj,
- TTree * tree,
- Int_t basketsize, Int_t splitlevel, Int_t compress): TBranchObject()
-{
-//*-*-*-*-*-*-*-*-*-*-*-*-*Create a BranchObject*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-//*-* =====================
-//
- TClass *cl = gROOT->GetClass(classname);
- fTree =tree; //MI change
- if (!cl) {
- Error("TBranchObject","Cannot find class:%s",classname);
- return;
- }
- if (!cl->GetListOfRealData()) cl->BuildRealData();
- Int_t bufsize=basketsize; //MI ?
- SetName(name);
- SetTitle(name);
- fCompress = compress;
- if (compress == -1) {
- TFile *bfile = fTree->GetDirectory()->GetFile(); //MI chnge fTrre - gTree
- if (bfile) fCompress = bfile->GetCompressionLevel();
- }
- if (basketsize < 100) basketsize = 100;
- fBasketSize = basketsize;
- fAddress = (char*)addobj;
- fClassName = classname;
-#if ROOT_VERSION_CODE >= 262401
- fBasketEntry = new Long64_t[fMaxBaskets];
-#else
- fBasketEntry = new Int_t[fMaxBaskets];
-#endif
- fBasketBytes = new Int_t[fMaxBaskets];
-#if ROOT_VERSION_CODE >= 262146
- fBasketSeek = new Long64_t[fMaxBaskets];
-#else
- fBasketSeek = new Seek_t[fMaxBaskets];
-#endif
- fOldObject = 0;
-
- fBasketEntry[0] = fEntryNumber;
- fBasketBytes[0] = 0;
-
- TLeaf *leaf = new TLeafObject(name,classname);
- leaf->SetBranch(this);
- leaf->SetAddress(addobj);
- fNleaves = 1;
- fLeaves.Add(leaf);
- fTree->GetListOfLeaves()->Add(leaf); //MI change fTree-gTree
-
-// Set the bit kAutoDelete to specify that when reading
-// in TLeafObject::ReadBasket, the object should be deleted
-// before calling Streamer.
-// It is foreseen to not set this bit in a future version.
- SetAutoDelete(kTRUE);
-
-//*-*- Create the first basket
- // fTree = gTree; //MI change - no need anymore
- fDirectory = fTree->GetDirectory();
- fFileName = "";
-
- if (!splitlevel){
- TBasket *basket = new TBasket(name,fTree->GetName(),this);
- fBaskets.Add(basket);
- return;
- }
-
- //
- //
- TBranch * branch =this;
- TObjArray *blist = branch->GetListOfBranches();
- const char *rdname;
- const char *dname;
- char branchname[64];
- if (!cl->GetListOfRealData()) cl->BuildRealData();
- char **apointer = (char**)(addobj);
- TObject *obj = (TObject*)(*apointer);
- Bool_t delobj = kFALSE;
- if (!obj) {
- obj = (TObject*)cl->New();
- delobj = kTRUE;
- }
-//*-*- Loop on all public data members of the class and its base classes
- Int_t lenName = strlen(name);
- Int_t isDot = 0;
- if (name[lenName-1] == '.') isDot = 1;
- TBranch *branch1 = 0;
- TRealData *rd;
- TIter next(cl->GetListOfRealData());
- while ((rd = (TRealData *) next())) {
- TDataMember *dm = rd->GetDataMember();
- if (!dm->IsPersistent()) continue; //do not process members with a ! as the first
- // character in the comment field
- rdname = rd->GetName();
- dname = dm->GetName();
-
- // Next line now commented, functionality to process arrays is now implemented
- // the statement is left to show how to use Property() and kIsArray
- // if (dm->Property() & kIsArray) continue;
-
- TDataType *dtype = dm->GetDataType();
- Int_t code = 0;
- if (dtype) code = dm->GetDataType()->GetType();
-
-//*-*- Encode branch name. Use real data member name
- sprintf(branchname,"%s",rdname);
- if (isDot) {
- if (dm->IsaPointer()) sprintf(branchname,"%s%s",name,&rdname[1]);
- else sprintf(branchname,"%s%s",name,&rdname[0]);
- }
- char leaflist[64];
- Int_t offset = rd->GetThisOffset();
- char *pointer = (char*)obj + offset;
- if (dm->IsaPointer()) {
- TClass *clobj = 0;
- if (!dm->IsBasic()) clobj = gROOT->GetClass(dm->GetTypeName());
- if (clobj && !strcmp("TClonesArray",clobj->GetName())) {
- char *cpointer =(char*)pointer;
- char **ppointer =(char**)cpointer;
- TClonesArray *list = (TClonesArray*)(*ppointer);
- if (splitlevel != 100) {
- if (isDot) branch1 = new TBranchClones(&branchname[0],pointer,bufsize);
- else branch1 = new TBranchClones(&branchname[1],pointer,bufsize);
- blist->Add(branch1);
- } else {
- if (isDot) branch1 = new TBranchObject(&branchname[0],list->ClassName(),pointer,bufsize);
- else branch1 = new TBranchObject(&branchname[1],list->ClassName(),pointer,bufsize);
- blist->Add(branch1);
- }
- }
- else
- if (clobj && !strcmp("AliObjectArray",clobj->GetName())) {
- char *cpointer =(char*)pointer;
- char **ppointer =(char**)cpointer;
- TClonesArray *list = (TClonesArray*)(*ppointer);
- if (splitlevel != 100) {
- if (isDot) branch1 = new AliArrayBranch(&branchname[0],pointer,fTree,bufsize,compress);
- else branch1 = new AliArrayBranch(&branchname[1],pointer,fTree,bufsize,compress);
- blist->Add(branch1);
- } else {
- if (isDot) branch1 = new AliObjectBranch(&branchname[0],list->ClassName(),pointer,fTree,bufsize);
- else branch1 = new AliObjectBranch(&branchname[1],list->ClassName(),pointer,fTree,bufsize);
- blist->Add(branch1);
- }
- }
- else {
- if (!clobj) {
- if (code != 1) continue;
- sprintf(leaflist,"%s/%s",dname,"C");
- branch1 = new TBranch(branchname,pointer,leaflist,bufsize);
- branch1->SetTitle(dname);
- blist->Add(branch1);
- } else {
- if (!clobj->InheritsFrom(TObject::Class())) continue;
- //branch1 = new TBranchObject(dname,clobj->GetName(),pointer,bufsize,0); //MI change
- branch1 = new AliObjectBranch(dname,clobj->GetName(),pointer,fTree,bufsize,splitlevel);
- if (isDot) branch1->SetName(&branchname[0]);
- else branch1->SetName(&branchname[1]); //do not use the first character (*)
- blist->Add(branch1);
- }
- }
- }else {
-//*-*-------------Data Member is a basic data type----------
- if (dm->IsBasic()) {
- if (code == 1) sprintf(leaflist,"%s/%s",rdname,"B");
- else if (code == 11) sprintf(leaflist,"%s/%s",rdname,"b");
- else if (code == 2) sprintf(leaflist,"%s/%s",rdname,"S");
- else if (code == 12) sprintf(leaflist,"%s/%s",rdname,"s");
- else if (code == 3) sprintf(leaflist,"%s/%s",rdname,"I");
- else if (code == 13) sprintf(leaflist,"%s/%s",rdname,"i");
- else if (code == 5) sprintf(leaflist,"%s/%s",rdname,"F");
- else if (code == 8) sprintf(leaflist,"%s/%s",rdname,"D");
- else {
- printf("Cannot create branch for rdname=%s, code=%d\n",branchname, code);
- leaflist[0] = 0;
- }
- branch1 = new TBranch(branchname,pointer,leaflist,bufsize);
- branch1->SetTitle(rdname);
- blist->Add(branch1);
- }
- }
- if (branch1) branch1->SetOffset(offset);
- else Warning("Branch","Cannot process member:%s",rdname);
- }
- if (delobj) delete obj;
-}
-
-
-
-//______________________________________________________________________________
-void AliObjectBranch::SetAddress(void *add)
-{
-//*-*-*-*-*-*-*-*Set address of this branch*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-//*-* ====================
-//
-
- //special case when called from code generated by TTree::MakeClass
- if (Long_t(add) == -1) {
- SetBit(kWarn);
- return;
- }
- fReadEntry = -1;
- Int_t nbranches = fBranches.GetEntriesFast();
- TLeaf *leaf = (TLeaf*)fLeaves.UncheckedAt(0);
- if (leaf) leaf->SetAddress(add);
- TBranch *branch;
- fAddress = (char*)add;
- char *pointer = fAddress;
- void **ppointer = (void**)add;
- TObject *obj = (TObject*)(*ppointer);
- TClass *cl = gROOT->GetClass(fClassName.Data());
- if (!obj && cl) {
- obj = (TObject*)cl->New();
- *ppointer = (void*)obj;
- }
- Int_t i, offset;
- if (!cl) {
- for (i=0;i<nbranches;i++) {
- branch = (TBranch*)fBranches[i];
- pointer = (char*)obj;
- branch->SetAddress(pointer);
- }
- return;
- }
- if (!cl->GetListOfRealData()) cl->BuildRealData();
- char *fullname = new char[200];
- const char *bname = GetName();
- Int_t lenName = strlen(bname);
- Int_t isDot = 0;
- if (bname[lenName-1] == '.') isDot = 1;
- const char *rdname;
- TRealData *rd;
- TIter next(cl->GetListOfRealData());
- while ((rd = (TRealData *) next())) {
- TDataMember *dm = rd->GetDataMember();
- if (!dm->IsPersistent()) continue;
- rdname = rd->GetName();
- TDataType *dtype = dm->GetDataType();
- Int_t code = 0;
- if (dtype) code = dm->GetDataType()->GetType();
- offset = rd->GetThisOffset();
- pointer = (char*)obj + offset;
- branch = 0;
- if (dm->IsaPointer()) {
- TClass *clobj = 0;
- if (!dm->IsBasic()) clobj = gROOT->GetClass(dm->GetTypeName());
- if (clobj && !strcmp("TClonesArray",clobj->GetName())) {
- if (isDot) sprintf(fullname,"%s%s",bname,&rdname[1]);
- else sprintf(fullname,"%s",&rdname[1]);
- branch = (TBranch*)fBranches.FindObject(fullname);
- }
- else
- if (clobj && !strcmp("AliObjectArray",clobj->GetName())) {
- if (isDot) sprintf(fullname,"%s%s",bname,&rdname[1]);
- else sprintf(fullname,"%s",&rdname[1]);
- branch = (TBranch*)fBranches.FindObject(fullname);
- }
- else {
- if (!clobj) {
- if (code != 1) continue;
- if (isDot) sprintf(fullname,"%s%s",bname,&rdname[0]);
- else sprintf(fullname,"%s",&rdname[0]);
- branch = (TBranch*)fBranches.FindObject(fullname);
- } else {
- if (!clobj->InheritsFrom(TObject::Class())) continue;
- if (isDot) sprintf(fullname,"%s%s",bname,&rdname[1]);
- else sprintf(fullname,"%s",&rdname[1]);
- branch = (TBranch*)fBranches.FindObject(fullname);
- }
- }
- } else {
- if (dm->IsBasic()) {
- if (isDot) sprintf(fullname,"%s%s",bname,&rdname[0]);
- else sprintf(fullname,"%s",&rdname[0]);
- branch = (TBranch*)fBranches.FindObject(fullname);
- }
- }
- if(branch) branch->SetAddress(pointer);
- }
- delete [] fullname;
-}
-
-
-
-
-
-AliTree::AliTree(const char *name,const char *title, Int_t maxvirtualsize):
- TTree(name,title,maxvirtualsize)
-{
- //
- //default constructor for AliTree
- gTree =this;
-}
-
-TBranch * AliTree::AliBranch(const char *name, void *clonesaddress, Int_t bufsize, Int_t splitlevel,
- Int_t compres)
-{
- //
- // Create an AliBranch and returns a reference to the TBranch
- //
- if (clonesaddress == 0) return 0;
- char *cpointer =(char*)clonesaddress;
- char **ppointer =(char**)cpointer;
- AliObjectArray *list = (AliObjectArray*)(*ppointer);
- if (list == 0) return 0;
- gTree = this;
- if (splitlevel) {
- TBranch *branch = new AliArrayBranch(name,clonesaddress,this,bufsize, compres);
- fBranches.Add(branch);
- return branch;
- } else {
- TBranchObject *branch = new TBranchObject(name,list->ClassName(),clonesaddress,bufsize,0);
- fBranches.Add(branch);
- return branch;
- }
-}
-
-TBranch* AliTree::AliBranch(const char *name, const char *classname, void *addobj,
- Int_t bufsize, Int_t splitlevel)
-{
- //
- // Create an AliBranch and returns a reference to the TBranch
- //
- gTree = this;
- TClass *cl = gROOT->GetClass(classname);
- if (!cl) {
- Error("BranchObject","Cannot find class:%s",classname);
- return 0;
- }
- TBranch * branch = new AliObjectBranch(name,classname,addobj, this, bufsize,splitlevel);
- fBranches.Add(branch);
- return branch;
-}
-
-
+++ /dev/null
-#ifndef ALIARRAYBRANCH_H
-#define ALIARRAYBRANCH_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-//////////////////////////////////////////////////////////////////////////
-// //
-// AliArrayBranch //
-// //
-// A Branch for the case of an array of clone objects. //
-//////////////////////////////////////////////////////////////////////////
-
-
-#include "TBranch.h"
-#include "TTree.h"
-#include "TBranchObject.h"
-class TClonesArray;
-class AliObjectArray;
-
-class AliArraySubBranch : public TBranch {
-public:
- AliArraySubBranch(){}
- AliArraySubBranch(const char* name, void* address, const char* leaflist, Int_t basketsize = 32000,
- Int_t compress = -1):TBranch(name, address, leaflist, basketsize, compress){}
- virtual ~AliArraySubBranch() {}
- virtual Int_t GetEntryExport(Long64_t entry, Int_t getall, TClonesArray* list, Int_t n) { return TBranch::GetEntryExport(entry, getall, list, n); }
- virtual Int_t GetEntryExport(Int_t entry, Int_t getall, AliObjectArray* list, Int_t n);
- virtual void ReadBasketExport(TBuffer &b, TLeaf *leaf, AliObjectArray *list, Int_t n);
- ClassDef(AliArraySubBranch,1) //Branch in case of an array of clone objects
-};
-
-class AliArrayBranch : public TBranch {
-
-public:
- AliArrayBranch();
- AliArrayBranch(const Text_t *name, void *clonesaddress, TTree * tree, Int_t basketsize=32000,Int_t compress=-1);
- virtual ~AliArrayBranch();
-
- virtual void Browse(TBrowser *b);
- virtual Int_t Fill();
- virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
- virtual Int_t GetN() const {return fN;}
- AliObjectArray *GetList() const {return fList;}
- virtual void Print(Option_t *option="") const;
- virtual void Reset(Option_t *option="");
- virtual void SetAddress(void *add);
- virtual void SetBasketSize(Int_t buffsize);
- virtual Bool_t IsFolder() const {return kTRUE;}
-
-protected:
- AliObjectArray *fList; //Pointer to the clonesarray
- Int_t fRead; //flag = 1 if clonesarray has been read
- Int_t fN; //Number of elements in ClonesArray
- Int_t fNdataMax; //Maximum value of fN
- TString fClassName; //name of the class of the objets in the ClonesArray
- TBranch *fBranchCount; //Branch with clones count
-
-private:
- AliArrayBranch(const AliArrayBranch &);
- AliArrayBranch & operator=(const AliArrayBranch &);
- void Import(TLeaf * leaf, Int_t n); //integer fill leef buffer
- ClassDef(AliArrayBranch,1) //Branch in case of an array of clone objects
-};
-
-
-class AliObjectBranch: public TBranchObject{
-public:
- AliObjectBranch():TBranchObject(){;}
- AliObjectBranch(const Text_t *name, const Text_t *classname, void *addobj, TTree * tree,
- Int_t basketsize=32000, Int_t splitlevel = 0, Int_t compress=-1);
- void SetAddress(void *add);
- ClassDef(AliObjectBranch,1)
-};
-
-class AliTree : public TTree {
-public:
- AliTree():TTree(){;}
- AliTree(const char *name,const char *title, Int_t maxvirtualsize=0);
- TBranch* AliBranch(const char *name, void *clonesaddress, Int_t bufsize =32000,
- Int_t splitlevel=99,Int_t compres=1);
- TBranch* AliBranch(const char *name, const char *classname, void *addobj,
- Int_t bufsize=32000, Int_t splitlevel=99);
- ClassDef(AliTree,1)
-};
-
-#endif
+++ /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$ */
-
-///////////////////////////////////////////////////////////////////////
-// Added additional functionality to original TArrayI //
-// multiple inheritance from TObject to be possible use automatic //
-// branch mechanism for tree
-// function Expand to be possible expand array without deleting //
-// array contents //
-// //
-// Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
-// //
-///////////////////////////////////////////////////////////////////////
-#include "AliArrayI.h"
-ClassImp(AliArrayI)
-void AliArrayI::Expand(Int_t n)
-{
- //
- // Set array size of TArrayI object to n integers and copy old array
- // If n<0 leave array unchanged.
- // user are responsible for appopiate size of array
- //
- if (n < 0) return;
- fArray = (Int_t*) TStorage::ReAlloc(fArray, n * sizeof(Int_t),fN * sizeof(Int_t));
- if (fArray!=0) fN= n;
-}
+++ /dev/null
-#ifndef ALIARRAYI_H
-#define ALIARRAYI_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-///////////////////////////////////////////////////////////////////////
-// Added additional functionality to original TArrayI //
-// multiple inheritance from TObject to be possible use automatic //
-// branch mechanism for tree
-// function Expand to be possible expand array without deleting //
-// array contents //
-// //
-// Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
-// //
-///////////////////////////////////////////////////////////////////////
-
-
-#include "TObject.h"
-#include "TArrayI.h"
-
-class AliArrayI: public TObject ,public TArrayI {
-public:
- void Expand(Int_t n);
- ClassDef(AliArrayI,1) // Array handling
-};
-
-#endif //ALIARRAY_I
-
+++ /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$ */
-
-///////////////////////////////////////////////////////////////////////
-// Added additional functionality to original TArrayS //
-// multiple inheritance from TObject to be possible use automatic //
-// branch mechanism for tree
-// function Expand to be possible expand array without deleting //
-// array contents // //
-// //
-// Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
-// //
-///////////////////////////////////////////////////////////////////////
-#include "AliArrayS.h"
-ClassImp(AliArrayS)
-void AliArrayS::Expand(Int_t n)
-{
- //
- // Set array size of TArrayS object to n integers and copy old array
- // If n<0 leave array unchanged.
- // user are responsible for apropriate size of array
- //
- if (n < 0) return;
- fArray = (Short_t*) TStorage::ReAlloc(fArray, n * sizeof(UShort_t),fN * sizeof(UShort_t));
- if (fArray!=0) fN= n;
- else fN =0;
-}
+++ /dev/null
-#ifndef ALIARRAYS_H
-#define ALIARRAYS_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-///////////////////////////////////////////////////////////////////////
-// Added additional functionality to original TArrayS //
-// multiple inheritance from TObject to be possible use automatic //
-// branch mechanism for tree
-// function Expand to be possible expand array without deleting //
-// array contents //
-// //
-// Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
-// //
-///////////////////////////////////////////////////////////////////////
-#include "TObject.h"
-#include "TArrayS.h"
-
-
-class AliArrayS: public TObject,public TArrayS {
-public:
- void Expand(Int_t n);
- ClassDef(AliArrayS,1) // Array handling
-};
-#endif //ALIARRAYS_H
+++ /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$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// AliArrayVT //
-//
-//
-// //
-/*
-
-
-*/
-//Begin_Html
-/*
-
-<img src="../gif/AliObjectArray.gif">
-*/
-//End_Html
-// //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-
-
-ClassImp(AliArrayVT)
+++ /dev/null
-#ifndef ALIARRAYVT_H
-#define ALIARRAYVT_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-
-class AliArrayVT: public TObject{
- //
- //function object
- //for AliObjectArray
- //
-public:
- AliArrayVT(){cmp=0; mkbuffer=0; delbuffer=0; stream=0; dump=0;fClass=0;}
-
- int Compare(void* p1, void* p2) { return (*cmp)(p1,p2);}
- char * MakeBuffer(UInt_t size) { return (*mkbuffer)(size);}
- void DeleteBuffer(void * p) { return (*delbuffer)(p);}
- void CTORBuffer(void *p, const UInt_t size) { return (*ctorbuffer)(p,size);}
- void DTORBuffer(void * p, const UInt_t size) { return (*dtorbuffer)(p,size);}
- void ObjectCTOR(void *p) { return (*objectctor)(p);}
- void ObjectDTOR(void * p) { return (*objectdtor)(p);}
- void StreamObject(TBuffer& b, void * object) {return (*stream)(b, object);}
- void StreamBuffer(TBuffer& b, const void *object, UInt_t size) {return (*streamb)(b,object,size);}
- void ClassDump(void *p) { return (*dump)(p);}
-public:
- int (*cmp)(void*, void*);
- char* (*mkbuffer)(UInt_t );
- void (*delbuffer)(void*);
- void (*objectctor)(void*);
- void (*objectdtor)(void*);
- void (*ctorbuffer)(void*, UInt_t size);
- void (*dtorbuffer)(void*, UInt_t size);
-
- void (*stream)(TBuffer &, void *);
- void (*streamb)(TBuffer &, const void *,UInt_t);
- void (*dump)(void*);
- TString fClassName; //class name of the object
- TClass * fClass; //!class type of the object
- UInt_t fSize; //size of object
- //ClassDef(AliArrayVT,0)
- ClassDef(AliArrayVT,1)
-};
-
-#endif //ALIARRAYVT
-
+++ /dev/null
-#ifndef ALI_CTypes
-#define ALI_CTypes
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-//////////////////////////////////////////////////////////////////////////
-// //
-// Ali C types //
-//
-// MI //
-// Macros for defining Containers //
-// //
-//////////////////////////////////////////////////////////////////////////
-#include "TMemberInspector.h"
-#include "TClass.h"
-#include "TStorage.h"
-
-class TDumpMembers : public TMemberInspector {
-public:
- TDumpMembers() { }
- void Inspect(TClass *cl, const char *parent, const char *name, const void *addr);
-};
-
-//////////////////////////////////////////////////////////////////////////
-
-
-
-// Removed:
-// friend operator>>
-// _ClassInit_
-#define LClassDef(name,id) \
-private: \
- static TClass *fgIsA; \
-public: \
- static TClass *Class(); \
- static const char *Class_Name(); \
- static Version_t Class_Version() { return id; } \
- static void Dictionary(); \
- TClass *IsA() const { return name::Class(); } \
- void ShowMembers(TMemberInspector &insp, char *parent); \
- void Streamer(TBuffer &b); \
- static const char *DeclFileName() { return __FILE__; } \
- static int DeclFileLine() { return __LINE__; } \
- static const char *ImplFileName(); \
- static int ImplFileLine(); \
- void Dump();
-
-//static int ImplFileLine(){return 0;}
-
-#define LClassImp(name) \
- void name::Dump() { \
- char parent[256]; \
- parent[0] = 0; \
- TDumpMembers dm; \
- ShowMembers(dm, parent); \
- } \
- ClassImp(name)
-
-
-/*
-#define ClassArrayDef(name) \
-private: \
- static AliArrayVT * fgArrayInfo; \
-public: \
- static name * Unchecked1DAt(const AliObjectArray & arr, UInt_t index)\
- { return ((name*)arr.Unchecked1DAt(index));} \
- static name * Unchecked2DAt(const AliObjectArray & arr, UInt_t index) \
- { return ((name*)arr.Unchecked2DAt(index));} \
- static name * UncheckedAt(const AliObjectArray & arr, UInt_t index) \
- { return (name*)arr.UncheckedAt(index);} \
- static name * At(const AliObjectArray & arr, UInt_t index) \
- { return (arr.GetClassInfo()==fgArrayInfo) ? (name*)arr.At(index): 0;} \
- static name * CastAt(const AliObjectArray & arr, UInt_t index) \
- { return (name*) ((arr.GetClass())->DynamicCast(Class(), arr.At(index))) ;} \
- static AliArrayVT * GetArrayInfo(); \
-
-
-
-//This should be in automatic generated code
-#define ClassArrayImp(name) \
-AliArrayVT * name::fgArrayInfo = 0; \
-char *name ##__MakeBuffer(UInt_t size) { return (char*)new name[size];} \
-void name ##__DeleteBuffer(void *p) {delete [] (name*)p;} \
-int name ##__Cmp(char *p1, char * p2){return ((name*)p1)->Compare((name*)p2);} \
-void name ##__StreamObject(TBuffer& b, char * object){ ((name*)object)->Streamer(b);} \
-void name ##__StreamBuffer(TBuffer& b, char * object, UInt_t size ); \
-void name ##__DumpObject(char *p) {return ((name*)p)->Dump();} \
-void name ##__StreamBuffer(TBuffer& b, char * object, UInt_t size ) \
-{ \
- for (UInt_t i=0;i<size;i++) ((name*)object)[i].Streamer(b); \
-} \
-void name ##__DTORBuffer(void *p) { \
- ((name*)p)->~name(); \
-} \
-void name ##__CTORBuffer(void *p) { \
- new (p)name; \
-} \
-void name ##__DTORBuffer(void *p, const UInt_t size) { \
- name * pp = (name*)p; \
- name * pmax = pp+size; \
- while (pp<pmax) (pp++)->~name(); \
-} \
-void name ##__CTORBuffer(void *p, const UInt_t size) { \
- name * pp = (name*)p; \
- name * pmax = pp+size; \
- while (pp<pmax) new (pp++)name; \
-} \
-AliArrayVT *name::GetArrayInfo() \
-{ \
- if (!fgArrayInfo) { \
- fgArrayInfo = new AliArrayVT; \
- fgArrayInfo->cmp = &(name ##__Cmp); \
- fgArrayInfo->delbuffer = &(name ##__DeleteBuffer); \
- fgArrayInfo->mkbuffer = &(name ##__MakeBuffer); \
- fgArrayInfo->ctorbuffer = &(name ##__CTORBuffer); \
- fgArrayInfo->dtorbuffer = &(name ##__DTORBuffer); \
- fgArrayInfo->stream = &(name ##__StreamObject); \
- fgArrayInfo->streamb = &(name ##__StreamBuffer); \
- fgArrayInfo->dump = &(name ##__DumpObject); \
- fgArrayInfo->fClass = name::Class(); \
- fgArrayInfo->fClassName = "name"; \
- fgArrayInfo->fSize = sizeof(name); \
- } \
- return fgArrayInfo; \
-}
-*/
-
-
-#endif // ALI_CTypes
+++ /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$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// AliClassInfo //
-// //
-//Defined to make unified interface to primitive types (in Root described by //
-// TDataType) and TClass. //
-// Additional virtual function (comparing to ROOT TClass) neccesary //
-// for AliContainers //
-// virtual void CTORBuffer(void * pointer, UInt_t size=1) //
-// should construct buffer of size =size objects at position pointer //
-// virtual void DTORBuffer(void * pointer, UInt_t size=1) //
-// should destruct buffer of size =size objects at position pointer //
-// virtual void StreamBuffer(TBuffer& b, const void *object, UInt_t size) //
-// stream buffer of objects `
-//Begin_Html
-//<img src="../gif/AliClassInfo.gif">
-//End_Html
-// //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-
-#include "AliClassInfo.h"
-#include "TMath.h"
-#include "TClass.h"
-
-#include "TROOT.h"
-#include "Riostream.h"
-#include "AliDataType.h"
-
-ClassImp(AliClassInfo)
-
-
-TList AliClassInfo::fgList; // list of loaded class
-
-AliClassInfo * AliClassInfo::FindClassInfo(const char * name)
-{
- //
- TIter next(&fgList);
- TString sname(name);
- AliClassInfo * info;
- while ((info = (AliClassInfo *) next()))
- if (info->GetName()==sname) return info;
- return 0;
-}
-
-
-
-AliClassInfo * AliClassInfo::GenerClassInfo(const char * classname)
-{
- //
- // Set class information fClassInfo according class name
- //
- char name[100];
- AliClassInfo *info=0;
- sprintf(name,"AliClassType%s",classname);
- info = AliClassInfo::FindClassInfo(classname);
- if (info) return info;
- //
- if ( (!info) && (gROOT->GetType(classname),kTRUE)){
- //if data type information exist
- // char line[100];
- // sprintf(line,"(*((AliClassInfo**)%p))= new AliDataType(\"%s\");",
- // &info,classname);
- // sprintf(line,"new AliDataType(\"%s\");",
- // classname);
-
- //cout<<line<<"\n";
- // gROOT->ProcessLine(line);
- new AliDataType(classname);
- info = AliClassInfo::FindClassInfo(classname);
- }
- if (info) return info;
-
- TClass * cl = gROOT->GetClass(classname);
- // if exist root class information
- if ( (!info) && (gROOT->GetClass(classname))){ //is it class?
- char chinter[1000];
- sprintf(chinter,"%s.C",classname);
- GenerClassInfoCode(classname,kTRUE,cl->GetDeclFileName(),chinter);
- info = AliClassInfo::FindClassInfo(classname);
- }
- if (!info){
- TClass * cl = new TClass(classname,0);
- if (cl->Size()>0){ //if root information doesn't exist
- //but exist cint information
- char chinclude[1000];
- sprintf(chinclude,"%s.h",classname);
- char chinter[1000];
- sprintf(chinter,"%s.C",classname);
- GenerClassInfoCode(classname,kTRUE,chinclude,chinter);
- }
- }
-
- return info;
-}
-
-
-
-void AliClassInfo::GenerClassInfoCode(const char * clname, Bool_t load,
- const char *incpath, const char *outfile)
-{
-
- // gener temporary file - name
-
- FILE *fout = fopen(outfile,"w");
- if (!clname){
- cerr<<"Class not specified\n";
- return ;
- }
- char buff[1000];
- const char *pchar =incpath;
- //replace with /0
- char * pchar2 =buff;
- fprintf(fout,"#include \"AliClassInfo.h\"\n");
-
- if (incpath==0) {}
- else{
- // proces headers - header separated by
- pchar =incpath;
- pchar2 =buff;
- //
- while (*pchar==' ') pchar++;
- while (*pchar) {
- if (*pchar!=' ') *pchar2++ = *pchar;
- else
- if (*(pchar2-1)!=0) *pchar2++=0;
- pchar++;
- }
- *pchar2=0;
- Int_t index = pchar2-buff;
- for (Int_t i=0;i<index;i++)
- if ( (i==0) ||(buff[i-1]==0))
- fprintf(fout,"#include \"%s\"\n",&buff[i]);
- }
- //process classes
- pchar =clname;
- pchar2 =buff;
- while (*pchar==' ') pchar++;
- while (*pchar) {
- if (*pchar!=' ') *pchar2++ = *pchar;
- else
- if (*(pchar2-1)!=0) *pchar2++=0;
- pchar++;
- }
- *pchar2=0;
- Int_t index = pchar2-buff;
- for (Int_t i=0;i<index;i++)
- if ( (i==0) ||(buff[i-1]==0))
- GenerClassInterface(&buff[i],fout);
-
- fclose(fout);
- //
-
- if (load) {
- char line[100];
- // gSystem->Rename("/tmp/root_tmpinterinter"
- sprintf(line,".L %s+",outfile);
- cout<<line<<"\nGenerating class Interface \n";
- cout<<line<<"\n*****************************\n";
- gROOT->ProcessLine(line);
- cout<<line<<"\n*****************************\n";
- cout<<line<<"\nClass Interface generated \n";
- }
-}
-
-
-
-Bool_t AliClassInfo::GenerClassInterface(const char * clname, FILE * fout)
-{
- // TClass * cl = gROOT->GetClass("AliLHit",kTRUE);
- fprintf(fout,"\n/************************************************/\n");
- fprintf(fout,"/* Automaticaly generated interface for class \n");
- fprintf(fout," %s \n",clname);
- fprintf(fout,"**************************************************/\n");
- fprintf(fout,"\n\n");
- //constructor
- fprintf(fout,"class AliClass%s : public AliClassInfo {\n",clname);
- fprintf(fout,"public:\n");
- fprintf(fout,"\tAliClass%s(){\n",clname);
- fprintf(fout,"\t SetName(\"%s\");\n",clname);
- fprintf(fout,"\t SetTitle(\"Interface for %s class \");\n",clname);
- fprintf(fout,"\t fgList.Add(this);\n");
- fprintf(fout,"\t fSize = sizeof(%s);\n\t}\n",clname);
- //
- fprintf(fout,"\tconst char * GetClassName(){ return \"%s\";}\n",clname);
- //
- fprintf(fout,"\tvirtual TClass* GetClass(){return %s::Class();}\n",clname);
- //placement constructor interface
- fprintf(fout,"\tvoid CTORBuffer(void * pointer, UInt_t size=1)\n\t{\n");
- fprintf(fout,"\t %s * last = &((%s*)pointer)[size];\n",clname,clname);
- fprintf(fout,"\t %s * p = (%s*)pointer;\n",clname,clname);
- fprintf(fout,"\t while (p!=last) new (p++)%s;\n\t}\n",clname);
- //placement destructor interface
- fprintf(fout,"\tvoid DTORBuffer(void * pointer, UInt_t size=1)\n\t{\n");
- fprintf(fout,"\t %s * last = &((%s*)pointer)[size];\n",clname,clname);
- fprintf(fout,"\t %s * p = (%s*)pointer;\n",clname,clname);
- fprintf(fout,"\t while (p!=last) (p++)->~%s();\n\t}\n",clname);
- //streamer interface
- fprintf(fout,"\tvoid StreamBuffer(TBuffer &b,const void * pointer, UInt_t size=1)\n\t{\n");
- fprintf(fout,"\t for (UInt_t i=0;i<size;i++) ((%s*)pointer)[i].Streamer(b);\n\t}\n",clname);
- //
- fprintf(fout,"\t void ObjectDump(void *p) {((%s*)p)->Dump();}\n",clname);
- fprintf(fout,"};\n");
- //make instance of the class
- fprintf(fout,"AliClass%s galiclass____%s; \n",clname,clname);
- return kTRUE;
-}
-
-
-
-
-
-
-
-
-
+++ /dev/null
-#ifndef ALICLASSINFO_H
-#define ALICLASSINFO_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-///////////////////////////////////////////////////////////////////////////////
-// //
-// AliClassInfo //
-// //
-// Defined to make unified interface to primitive types (in Root described by//
-// TDataType) and TClass. //
-// //
-// Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
-///////////////////////////////////////////////////////////////////////////////
-
-
-#include "TNamed.h"
-class TDataType;
-
-
-
-class AliClassInfo : public TNamed {
-public:
- AliClassInfo() : fSize(0) {}
- virtual ~AliClassInfo(){;}
- virtual void CTORBuffer(void * /*pointer*/, UInt_t /*size=1*/){;}
- // {return (*ctorbuffer)(p,size);}
- virtual void DTORBuffer(void * /*pointer*/, UInt_t /*size=1*/){;}
- //{return (*dtorbuffer)(p,size);}
- virtual void StreamBuffer(TBuffer& /*b*/,
- const void */*object*/, UInt_t /*size*/){;}
- //{return (*streamb)(b,object,size);}
- virtual void ObjectDump(void */*p*/){;}
- virtual const char * GetClassName(){ return 0;}
- virtual TClass * GetClass(){return 0;}
- virtual TDataType * GetDataType(){return 0;}
- UInt_t Size(){return fSize;}
- static AliClassInfo * FindClassInfo(const char * name);
- static AliClassInfo * GenerClassInfo(const char * clname);
- static void GenerClassInfoCode(const char * clname, Bool_t load,
- const char *incpath, const char *outfile);
- const TList & GetListOfClass(){return fgList;}
-protected:
- static Bool_t GenerClassInterface(const char * clname, FILE * fout);
- static TList fgList; // list of loaded class
- UInt_t fSize; //size of object
- ClassDef(AliClassInfo,1)
-};
-
-
-#endif //ALICLASSINFO_H
-
+++ /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$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// AliDataType //
-// //
-// Defined to make unified interface to primitive types (in Root described by//
-// TDataType) and TClass. //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-
-#include "AliDataType.h"
-
-#include "TMath.h"
-#include "TClass.h"
-#include "TDataType.h"
-
-#include "TROOT.h"
-#include "Riostream.h"
-
-
-ClassImp(AliDataType)
-
-
-
-AliDataType::AliDataType(const char *name)
-{
- //
- // AliData type constructor
- fDataType = new TDataType(name);
- if (fDataType->GetType()<0) fDataType= (gROOT->GetType(name,kTRUE));
- if ((fDataType) && (fDataType->GetType())){
- fSize = fDataType->Size();
- // fType = (EDataType) fDataType->GetType();
- SetTitle(name);
- SetName(name);
- fgList.Add(this);
- }
-}
-
-
-const char * AliDataType::GetClassName()
-{
- //class name of the object
- return (fDataType) ? fDataType->GetName():0;
-}
-
-void AliDataType::StreamBuffer(TBuffer& b, const void *object, UInt_t size)
-{
- //streamer for buffer of objects
- char * last = &((char*)object)[size*fSize];
- char * pfirst = (char*)object;
- char *p;
- if (b.IsWriting()){
- switch ((EDataType) fDataType->GetType()){
- case kChar_t:
- for (p= pfirst; p<last;p+=fSize) b<<*((Char_t*)p);
- break;
- case kShort_t:
- for (p= pfirst; p<last;p+=fSize) b<<*((Short_t*)p);
- break;
- case kInt_t:
- for (p= pfirst; p<last;p+=fSize) b<<*((Int_t*)p);
- break;
- case kLong_t:
- for (p= pfirst; p<last;p+=fSize) b<<*((Long_t*)p);
- break;
- case kUChar_t:
- for (p= pfirst; p<last;p+=fSize) b<<*((UChar_t*)p);
- break;
- case kUShort_t:
- for (p= pfirst; p<last;p+=fSize) b<<*((UShort_t*)p);
- break;
- case kUInt_t:
- for (p= pfirst; p<last;p+=fSize) b<<*((UInt_t*)p);
- break;
- case kFloat_t:
- for (p= pfirst; p<last;p+=fSize) b<<*((Float_t*)p);
- break;
- case kDouble_t:
- for (p= pfirst; p<last;p+=fSize) b<<*((Double_t*)p);
- break;
- default:
- break;
- }
- }
- else
- switch ((EDataType) fDataType->GetType()){
- case kChar_t:
- for (p= pfirst; p<last;p+=fSize) b>>*((Char_t*)p);
- break;
- case kShort_t:
- for (p= pfirst; p<last;p+=fSize) b>>*((Short_t*)p);
- break;
- case kInt_t:
- for (p= pfirst; p<last;p+=fSize) b>>*((Int_t*)p);
- break;
- case kLong_t:
- for (p= pfirst; p<last;p+=fSize) b>>*((Long_t*)p);
- break;
- case kUChar_t:
- for (p= pfirst; p<last;p+=fSize) b>>*((UChar_t*)p);
- break;
- case kUShort_t:
- for (p= pfirst; p<last;p+=fSize) b>>*((UShort_t*)p);
- break;
- case kUInt_t:
- for (p= pfirst; p<last;p+=fSize) b>>*((UInt_t*)p);
- break;
- case kFloat_t:
- for (p= pfirst; p<last;p+=fSize) b>>*((Float_t*)p);
- break;
- case kDouble_t:
- for (p= pfirst; p<last;p+=fSize) b>>*((Double_t*)p);
- break;
- default:
- break;
- }
-
-}
-
-void AliDataType::ObjectDump(void *p)
-{
- //
- // dump object information
- // assume that object p has type described by AliDataTYPE
- switch ((EDataType) fDataType->GetType()){
- case kChar_t:
- cout<<*((Char_t*)p)<<"\n";
- break;
- case kShort_t:
- cout<<*((Short_t*)p)<<"\n";
- break;
- case kInt_t:
- cout<<*((Int_t*)p)<<"\n";
- break;
- case kLong_t:
- cout<<*((Long_t*)p)<<"\n";
- break;
- case kUChar_t:
- cout<<*((UChar_t*)p)<<"\n";
- break;
- case kUShort_t:
- cout<<*((UShort_t*)p)<<"\n";
- break;
- case kUInt_t:
- cout<<*((UInt_t*)p)<<"\n";
- break;
- case kFloat_t:
- cout<<*((Float_t*)p)<<"\n";
- break;
- case kDouble_t:
- cout<<*((Double_t*)p)<<"\n";
- break;
- default:
- break;
- }
-}
+++ /dev/null
-#ifndef ALIDATATYPE_H
-#define ALIDATATYPE_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// AliDataType //
-// //
-// Defined to make unified interface to primitive types (in Root described by//
-// TDataType) and TClass. //
-// //
-// Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
-///////////////////////////////////////////////////////////////////////////////
-
-#include "AliClassInfo.h"
-
-
-class AliDataType : public AliClassInfo {
-public:
- AliDataType(const char *name);
- const char * GetClassName();
- void StreamBuffer(TBuffer& b, const void *object, UInt_t size);
- void ObjectDump(void *p);
- TDataType * GetDataType(){return fDataType;}
-protected:
- AliDataType(const AliDataType & type): AliClassInfo(type) {;}
- AliDataType &operator = (const AliDataType & /*type*/){return *this;} //assignment operator
- TDataType * fDataType; //root type information
- ClassDef(AliDataType,0)
-};
-
-#endif
-
+++ /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$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// AliMemArray //
-// (Pseudo)Container optimised for fast random access operator[ ].
-// Operator [] time doesn\92t depend on the number of elements in container O(1) -
-// like in standard array or like in STL vector
-// To achieve maximally-fast indexing and iteration in one buffer mode
-// the vector maintains its storage as a single contiguous array of objects (one buffer mode)
-
-// When a vector runs out of pre-allocated storage, in order to maintain it
-// contiguous array it must allocate a whole new (larger) chunk of storage
-// elsewhere and copy the objects to the new storage.
-// void * AliMemArray::Unchecked1DAt(UInt_t i) const
-// return &(((char*)fCont)[fObjectSize*i]);
-
-// In multi buffer mode (like two dimensional array) when a vector runs out of
-// pre-allocated storage we don\92t need to copy whole array only small buffer but operator [] is slower
-// void * AliMemArray::Unchecked2DAt(UInt_t i, UInt_t j) const
-// return &( ((char**)fCont)[i] [j*fObjectSize]);
-// void * AliMemArray::Unchecked2DAt(UInt_t i) const
-// return &( ((char**)fCont)[i/fBufferSize] [(i%fBufferSize)*fObjectSize]) ;
-
-
-//Begin_Html
-//<img src="../gif/AliMemArray.gif">
-//End_Html
-
-
-// Streamer CTORBuffer and DTORBuffer are virtual - should be implemented in derived
-// classes. For example AliObjectArray derived from AliMemArray is general array
-// for objects with defined AliClassInfo information.
-// //
-// //
-// Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
-///////////////////////////////////////////////////////////////////////////////
-
-
-
-#include "AliMemArray.h"
-#include "Riostream.h"
-#include "TMath.h"
-#include "TError.h"
-
-
-ClassImp(AliMemArray)
-
-
-AliMemArray::AliMemArray()
-{
- //
- //default constructor
- //
- fCont = 0;
- fSize = 0;
- fCapacity=0;
- fObjectSize = 0;
- fBufferSize = 0;
-}
-
-AliMemArray::AliMemArray(Int_t objectSize, Int_t buffersize)
-{
- //
- // AliMemArray constructor
- fCont = 0;
- fSize = 0;
- fCapacity=0;
- fObjectSize =objectSize;
- fBufferSize =buffersize;
-}
-
-AliMemArray::AliMemArray(const AliMemArray & arr):
- TObject(arr)
-{
- //
- //copy constructor
- fCont = arr.fCont;
- fSize = arr.fSize;
- fCapacity = arr.fCapacity;
- fObjectSize = arr.fObjectSize;
- fBufferSize =arr.fBufferSize;
-
- if (arr.fBufferSize==0) {
- fCont = new char[fCapacity*fObjectSize];
- CopyBuffer(fCont, arr.fCont, fSize);
- }
- else{
- Int_t buffers = fCapacity/fBufferSize;
- if (fCapacity%fBufferSize) buffers++;
- void ** table = (void**) new char*[buffers];
- for (Int_t i=0; i<buffers;i++){
- table[i] = new char[fBufferSize*fObjectSize];
- Int_t size = fSize - i*fBufferSize;
- if (size > (Int_t)fBufferSize) size = fBufferSize;
- if (size >0) CopyBuffer(table[i], ((void**)arr.fCont)[i],size);
- }
- fCont = (void*)table;
- }
-}
-
-
-void AliMemArray::Swap( AliMemArray &arr)
-{
- //swap contents of array
- UInt_t size = arr.fSize;
- arr.fSize = fSize;
- fSize = size;
- UInt_t capacity = arr.fCapacity;
- arr.fCapacity = fCapacity;
- fCapacity = capacity;
- UInt_t objectSize = arr.fObjectSize;
- arr.fObjectSize = fObjectSize;
- fObjectSize = objectSize;
- UInt_t bufferSize = arr.fBufferSize;
- arr.fBufferSize = fBufferSize;
- fBufferSize = bufferSize;
- void * cont = arr.fCont;
- arr.fCont = fCont;
- fCont = cont;
-}
-
-void AliMemArray::CopyBuffer(void *dest, void *src, UInt_t size)
-{
- //
- //array placement copy constructor
- memcpy(dest, src,size*fObjectSize);
-}
-
-AliMemArray::~AliMemArray()
-{
- //
- //default destructor
- Delete();
-}
-
-
-void AliMemArray::SetObjectSize(UInt_t bufsize)
-{
- //
- //set memory size for one object - it can be changed only when the array is empty
- if (fCont){
- ::Error("AliMemArray::SetObjectSize", "forbidden to resize just allocated objects");
- return;
- };
- fBufferSize=bufsize;
-}
-
-AliMemArray & AliMemArray::operator = (const AliMemArray &arr)
-{
- //
- //
- AliMemArray tmparr(arr);
- Swap(tmparr);
- return *this;
-}
-
-void AliMemArray::SetBufferSize(UInt_t bufsize)
-{
- //
- //set buffer size - it can be changed only when the array is empty
- if (fCont==0) {
- fBufferSize = bufsize;
- return;
- }
- if (fBufferSize == bufsize) return;
-
- if (bufsize==0){
- char *table = new char[fObjectSize*fCapacity];
- char * p = table;
- for (UInt_t i=0; i<fSize; i++,p+=fObjectSize)
- memcpy(p, At(i), fObjectSize);
- //delete [](char*)fCont;
- Delete();
- fCont = table;
- fBufferSize = bufsize;
- }
- else{
- Int_t buffers = fCapacity/bufsize;
- if (fCapacity%bufsize) buffers++;
- char ** table = new char*[buffers];
- for (Int_t ibuf=0; ibuf<buffers;ibuf++){
- table[ibuf] = new char[bufsize*fObjectSize];
- Int_t size = fSize - ibuf*bufsize;
- if (size > (Int_t)bufsize) size = bufsize;
- if (size >0) for ( Int_t ip=0;ip<size;ip++)
- memcpy(&table[ibuf][ip*fObjectSize], At(ibuf*bufsize+ip), fObjectSize);
- }
- // delete [](char**)fCont;
- Delete();
- fCont = (void*)table;
- fBufferSize = bufsize;
- }
-
-}
-
-
-
-void AliMemArray::Delete(Option_t *)
-{
- //
- //delete memory space occupied by the array -
- //Use this routine when your objects allocate
- //memory (e.g. objects inheriting from TNamed or containing TStrings
- //allocate memory). If not you better use Clear() since if is faster.
- if (fCont){
- if (fBufferSize) {
- Delete2D();
- fSize = 0;
- fCapacity = 0;
- return;
- }
- DTORBuffer(Unchecked1DAt(0),fSize);
- delete [] (char*)fCont;
- fCont = 0;
- fSize = 0;
- fCapacity = 0;
- }
-}
-
-void AliMemArray::Clear(Option_t *)
-{
- //
- //clear array -
- // Only use this routine when your objects don't
- // allocate memory since it will not call the object dtors.
- if (fBufferSize){
- Clear2D();
- return;
- }
- if (fCont){
- // memset(fCont, 0, fSize*fObjectSize);
- //MI change - to have the same as in TClonesArray
- fSize = 0;
- }
-}
-
-void AliMemArray::Reserve(UInt_t n)
-{
- //
- //reserve arrays space
- //
- if (fObjectSize<=0) {
- cout<<"Object length not defined\n";
- return;
- }
- if (n==fCapacity) return;
-
- if (fBufferSize>0) {
- Reserve2D(n); //if 2D buffer
- return;
- }
- //
- if (fCapacity){
- if (fSize>n) {
- DTORBuffer(Unchecked1DAt(n),fSize-n);
- memset(&((char*)fCont)[n*fObjectSize], 0, (fSize-n)*fObjectSize);
- fSize =n;
- }
- fCont = (char*)TStorage::ReAlloc(fCont, n*fObjectSize,fCapacity*fObjectSize);
- }
- else fCont = new char[n*fObjectSize];
-
- if (!fCont) fCapacity = 0;
- else fCapacity = n;
-}
-
-
-void AliMemArray::Resize(UInt_t n)
-{
- //
- //resize buffer
- //
- if (fObjectSize<=0) {
- cout<<"Object length not defined\n";
- return;
- }
- if (fBufferSize>0) {
- Resize2D(n); //if 2D buffer
- return;
- }
- //
- if (n>fCapacity) Reserve(2*n); //reserve automaticaly space if sie >capacity
- if (fSize>n){
- DTORBuffer(Unchecked1DAt(n),fSize-n);
- //memset(&((char*)fCont)[n*fObjectSize], 0, (fSize-n)*fObjectSize);
- //MI change - to have the same as in TClonesArray
- }
- if (fSize<n) CTORBuffer(Unchecked1DAt(fSize),n-fSize);
- fSize = n;
- return;
-}
-
-void AliMemArray::Delete2D()
-{
- //
- //delete memory space occupied by the array
- if (!fBufferSize) return;
-
- Int_t nbuff = (fCapacity/fBufferSize);
- if ( (fCapacity%fBufferSize)!=0) nbuff++;
- for (Int_t i=0;i<nbuff;i++) {
- Int_t size = fSize-i*fBufferSize;
- if (size>0)
- DTORBuffer(GetRow(i),UInt_t(size)<fBufferSize? size:fBufferSize);
- delete [] (char*)GetRow(i);
- }
- delete [] (void**)fCont;
- fCont =0;
- fSize = 0;
- fCapacity = 0;
-}
-
-void AliMemArray::Clear2D()
-{
- //
- //clear memory space occupied by the array - doesn't call DTOR
- Int_t nbuff = (fCapacity/fBufferSize);
- if ( (fCapacity%fBufferSize)!=0) nbuff++;
- // for (Int_t i=0;i<nbuff;i++) memset(GetRow(i), 0, fSize*fObjectSize);
- //MI change - to have the same as in TClonesArray
- fSize = 0;
-}
-
-
-
-
-void AliMemArray::Reserve2D(UInt_t n)
-{
- //
- //
- Int_t buffers = n/fBufferSize;
- if (n%fBufferSize) buffers++;
- UInt_t nobjects=buffers*fBufferSize;
- Int_t oldbuffers = GetNBuffers() ;
- if (buffers==oldbuffers) return;
- //
- void ** table = (void**) new char*[buffers];
-
- Int_t max = buffers>oldbuffers ? buffers: oldbuffers;
- for (Int_t i = 0;i<max;i++) {
- if ( (i<oldbuffers) && (i<buffers)) table[i] = GetRow(i);
- if ( (i<oldbuffers)&&(i>=buffers) ){
- Int_t dsize = TMath::Min(Int_t(fSize) - i*Int_t(fBufferSize),Int_t(fBufferSize));
- if (dsize>0) DTORBuffer(GetRow(i),dsize);
- delete [] (char*)GetRow(i);
- }
- if (i>=oldbuffers)
- table[i] = new char[fBufferSize*fObjectSize];
- }
- if (fSize>nobjects) fSize=nobjects;
-
- fCapacity = nobjects ;
- delete [] (void**)fCont;
- fCont = (void*)table;
-}
-
-
-
-void AliMemArray::Resize2D(UInt_t n)
-{
- //
- //
- if (n>fCapacity) Reserve2D(n); //reserve automaticaly space
- Int_t buffers = n/fBufferSize;
- if (n%fBufferSize) buffers++;
-
- if (fSize>n){ //call destructor if we decrease the size of array
- Int_t oldbuffer = fSize/fBufferSize;
-
- for (Int_t i=buffers;i<oldbuffer; i++){
- Int_t iold= fSize-i*fBufferSize;
- if (iold>(Int_t)fBufferSize) iold= fBufferSize;
- Int_t inew= n -i*fBufferSize;
- if (inew<0) inew =0;
- DTORBuffer(Unchecked2DAt(i,inew),iold-inew);
- }
- }
- if (fSize<n){ //call constructor if we increase the size of array
- Int_t oldbuffer = fSize/fBufferSize;
- for (Int_t i=oldbuffer;i<buffers; i++){
- Int_t iold = fSize-i*fBufferSize;
- if (iold<0) iold = 0;
- Int_t inew = n -i*fBufferSize;
- if (inew>(Int_t)fBufferSize) inew = fBufferSize;
- CTORBuffer(Unchecked2DAt(i,iold),inew-iold);
- }
- }
- fSize = n;
-}
-
-
-
-
-
-
+++ /dev/null
-#ifndef ALIMEMARRAY_H
-#define ALIMEMARRAY_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-///////////////////////////////////////////////////////////////////////////////
-// //
-// AliMemArray //
-// (Pseudo)Container optimised for fast random access operator[ ]. //
-// Operator [] time doesn\92t depend on the number of elements in container O(1) -
-// like in standard array or like in STL vector
-///////////////////////////////////////////////////////////////////////////////
-#include "TObject.h"
-
-class AliMemArray: public TObject {
-public:
- AliMemArray();
- AliMemArray(Int_t objectSize, Int_t buffersize=0);
- AliMemArray(const AliMemArray & arr);
- AliMemArray & operator = (const AliMemArray &arr);
- virtual ~AliMemArray();
- void Swap(AliMemArray & arr);
- //
- inline void * UncheckedAt(UInt_t index) const; //
- inline void * At(UInt_t i) const ; //controled return pointer to object
- inline void * Unchecked1DAt(UInt_t i) const; //return pointer to the object
- inline void * Unchecked2DAt(UInt_t i) const ; //return pointer to the object
- inline void * Unchecked2DAt(UInt_t i, UInt_t j) const ; //return pointer to the object
-
- Bool_t Is1D(){return (fBufferSize==0);} //true if 1D array
- Bool_t Is2D(){return (fBufferSize!=0);} //true if 2D array
- //
- const void * GetArray()const {return fCont;} //return pointer to the buffer
- void * GetRow(UInt_t row)const {return fBufferSize? ((void**)fCont)[row]: fCont;}
-
- // return pointer to the object
- //
- UInt_t GetCapacity() const {return fCapacity;} //return number of stored objects
- UInt_t GetSize() const {return fSize;} //return number of stored objects
- //
- void Delete(Option_t *option="");
- //delete memory space occupated by the array
- void Clear(Option_t *option="");
- //clear memory space occupied by the array - doesn't call destructor
- void Resize(UInt_t n);
- void Reserve(UInt_t n);
- //
- UInt_t GetBufferSize() const {return fBufferSize;}
- UInt_t GetObjectSize() const {return fObjectSize;}
- UInt_t GetNBuffers() const {return fBufferSize? fCapacity/fBufferSize :1;}
- void SetBufferSize(UInt_t bufsize);
-protected :
- void SetObjectSize(UInt_t size);
- void Delete2D(); //delete memory space occupated by the array
- void Clear2D(); //clear memory space occupated by the array
- void Resize2D(UInt_t n);
- void Reserve2D(UInt_t n);
- //
-protected:
- virtual void CTORBuffer(void */*buffer*/, UInt_t /*size*/){;} //array placement constructor
- virtual void DTORBuffer(void */*buffer*/, UInt_t /*size*/){;} //array placement destructor
- virtual void CopyBuffer(void *src, void *dest, UInt_t size); //array placement copy constructor
- UInt_t fSize; //total number of valid objects
- UInt_t fCapacity; //capacity of array
- UInt_t fObjectSize; // object size
- UInt_t fBufferSize; //number of object in one full buffer (0 means array in one buffer)
- //
-private:
- void * fCont; //!data buffer
- //ClassDef(AliMemArray,0)
- ClassDef(AliMemArray,1)
-};
-
-void * AliMemArray::Unchecked1DAt(UInt_t i) const
-{
- return &(((char*)fCont)[fObjectSize*i]);
-}
-
-void * AliMemArray::Unchecked2DAt(UInt_t i, UInt_t j) const
-{
- return &( ((char**)fCont)[i] [j*fObjectSize]);
-}
-
-//********************************************************************
-void * AliMemArray::Unchecked2DAt(UInt_t i) const
-{
- //
- // called in GePointer if we have more then one buffer
- return &( ((char**)fCont)[i/fBufferSize] [(i%fBufferSize)*fObjectSize]) ;
-}
-
-void * AliMemArray::UncheckedAt(UInt_t i) const
-{
-
- return (!fBufferSize) ?Unchecked1DAt(i): Unchecked2DAt(i);
-}
-
-void * AliMemArray::At(UInt_t i) const
-{
- return (i<fSize) ? UncheckedAt(i):0; //controled return pointer to object
-}
-
-#endif
+++ /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$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// AliObjectArray //
-// //
-//AliObjectArray is an array of clone (identical) objects. //
-//In comparison with the TClonesArray objects in this array don't need //
-//to derive from TObject. They also don't need RTTI - type information. //
-// //
-//Objects type information is stored in object fClassInfo (instance of //
-//the AliClassInfo). //
-//Objects in array are stored sequentialy in buffers. Buffer is standart C++ //
-//array of objects. Buffers size is equal for all of the buffers. If we specify
-//fBufferSize==0 objects are stored in one big standart C++ array.
-//
-// Origin: Marian Ivanov, Uni. of Bratislava, ivanov@fmph.uniba.sk //
-//
-//Begin_Html
-/*
-<img src="../gif/AliObjectArray.gif">
-*/
-///////////////////////////////////////////////////////////////////////////////
-
-
-#include "AliObjectArray.h"
-
-ClassImp(AliObjectArray)
-
-AliObjectArray::AliObjectArray():AliMemArray()
-{
- //
- //default constructor
- //
- fClassInfo = 0;
-}
-
-AliObjectArray::AliObjectArray(const char * classname, Int_t buffersize):AliMemArray()
-{
- //
- // AliObject array constructor
- // Set class information fClassInfo according specified type and set the array size -size
- // Buufer size fBufferSize
- fClassInfo = 0;
- fBufferSize = buffersize;
- SetClass(classname);
-}
-
-AliObjectArray::AliObjectArray(const AliObjectArray &arr):
- AliMemArray(arr)
-{
- //
- //
- *((AliMemArray*)this) = *((AliMemArray*)&arr);
- fClassInfo = arr.GetClassInfo();
-}
-
-
-AliObjectArray & AliObjectArray::operator=(const AliObjectArray &arr)
-{
- //
- //
- *((AliMemArray*)this) = *((AliMemArray*)&arr);
- fClassInfo = arr.GetClassInfo();
- return (*this);
-}
-
-AliObjectArray::~AliObjectArray()
-{
- //
- //default destructor
- Delete();
-}
-
-Bool_t AliObjectArray::SetClass(const char * classname)
-{
- //
- // Set class information fClassInfo according class name
- //
- Delete();
-
- fClassInfo = AliClassInfo::GenerClassInfo(classname);
- fObjectSize = fClassInfo->Size();
- return (fClassInfo!=0);
-}
-
-void AliObjectArray::Dump(Int_t i) const
-{
- //dump object at position i
- if (At(i)) fClassInfo->ObjectDump(At(i));
- else printf("index %d - out of range\n",i);
-}
-
-void AliObjectArray::Dump() const
-{
- //dump all objects
- for (UInt_t i=0;i<fSize;i++) {
- if (At(i)) fClassInfo->ObjectDump(At(i));
- else printf("index %d - out of range\n",i);
- }
-}
-
-void AliObjectArray::Streamer(TBuffer& R__b)
-{
- //
- //Stream of the AliVector2D
- //
- TString s;
- if (R__b.IsReading()) {
- Version_t R__v = R__b.ReadVersion(); if (R__v) { }
- TObject::Streamer(R__b);
- s.Streamer(R__b); //read class info
- if (s!=" ") SetClass(s.Data());
- else fClassInfo=0;
- R__b >> fBufferSize;
- R__b >> fObjectSize;
- Int_t size;
- R__b >> size;
- Resize(size);
- if (fSize>0){
- if (fBufferSize==0) fClassInfo->StreamBuffer(R__b, GetArray(), fSize);
- else
- for (UInt_t i=0;i<GetNBuffers();i++)
- fClassInfo->StreamBuffer(R__b, GetRow(i), fBufferSize);
- }
- } else {
- R__b.WriteVersion(AliObjectArray::IsA());
- TObject::Streamer(R__b);
- if (fClassInfo) s = fClassInfo->GetClassName();
- else s=" ";
- s.Streamer(R__b);
- R__b << fBufferSize;
- R__b << fObjectSize;
- R__b << fSize;
-
- if (fSize>0){
- if (fBufferSize==0) fClassInfo->StreamBuffer(R__b, GetArray(), fSize);
- else
- for (UInt_t i=0;i<GetNBuffers();i++)
- fClassInfo->StreamBuffer(R__b, GetRow(i), fBufferSize);
- }
- }
-}
-
-
-
-
-
+++ /dev/null
-#ifndef ALIOBJECTARRAY_H
-#define ALIOBJECTARRAY_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-/////////////////////////////////////////////////////////////////////////
-// AliObjectArray //
-//AliObjectArray is an array of clone (identical) objects. //
-//In comparison with the TClonesArray objects in this array don't need //
-//to derive from TObject. They also don't need RTTI - type information.//
-//Objects type information is stored in object fClassInfo (instance of //
-//the AliClassInfo). //
-// //
-/////////////////////////////////////////////////////////////////////////
-
-#include "AliClassInfo.h"
-#include "AliMemArray.h"
-class TClass;
-
-class AliObjectArray: public AliMemArray {
-public:
- AliObjectArray();
- AliObjectArray(const char * classname, Int_t buffersize=0);
- AliObjectArray(const AliObjectArray &arr); //copy constructor
- AliObjectArray & operator = (const AliObjectArray &arr);
- ~AliObjectArray();
- Bool_t SetClass(const char * classname);
- //
- TClass * GetClass() {return fClassInfo->GetClass();}
- AliClassInfo * GetClassInfo() const {return fClassInfo;}
- virtual void Dump(Int_t i) const;
- virtual void Dump() const;
- //
-protected :
- void CTORBuffer(void * buffer, UInt_t size)
- {fClassInfo->CTORBuffer(buffer,size);} // buffer constructor
- void DTORBuffer(void * buffer, UInt_t size)
- {fClassInfo->DTORBuffer(buffer,size);} // buffer constructor
-private:
- AliClassInfo *fClassInfo; //pointer to containg class info
- //
- //ClassDef(AliObjectArray,0)
- ClassDef(AliObjectArray,1)
-};
-
-
-
-
-
-
-
-#endif //ALIMEMARRAY_I
-
+++ /dev/null
-#ifdef __CINT__
-
-#pragma link off all globals;
-#pragma link off all classes;
-#pragma link off all functions;
-
-
-#pragma link C++ class AliClassInfo+;
-#pragma link C++ class AliDataType+;
-
-#pragma link C++ class AliMemArray+;
-#pragma link C++ class AliObjectArray-;
-//#pragma link C++ class TArrayOfArray+;
-
-//#pragma link C++ class TArrayOfArrayVStack+;
-//#pragma link C++ class TArrayOfArrayVList+;
-
-
-#pragma link C++ class AliArraySubBranch+;
-#pragma link C++ class AliArrayBranch-;
-#pragma link C++ class AliObjectBranch+;
-#pragma link C++ class AliTree+;
-
-#pragma link C++ class AliSegmentID+;
-#pragma link C++ class AliSegmentArray-;
-#pragma link C++ class AliDigits+;
-#pragma link C++ class AliArrayI+;
-#pragma link C++ class AliArrayS+;
-
-#pragma link C++ class AliH2F+;
-
-#endif
+++ /dev/null
-
-SRCS= AliMemArray.cxx AliClassInfo.cxx AliDataType.cxx\
- AliObjectArray.cxx AliArrayBranch.cxx\
- AliSegmentID.cxx AliSegmentArray.cxx \
- AliDigits.cxx AliArrayI.cxx AliArrayS.cxx \
- AliH2F.cxx
-
-
-HDRS= $(SRCS:.cxx=.h)
-
-DHDR:= CONTAINERSLinkDef.h
-
DHDR=DISPLAYLinkDef.h
-EINCLUDE:= ITS TPC CONTAINERS
+EINCLUDE:= ITS TPC
DHDR= HBTAnalysisLinkDef.h
-EINCLUDE:= TPC CONTAINERS ITS
+EINCLUDE:= TPC ITS
PACKCFLAGS := ${HLTCLFAGS}
PACKDCXXFLAGS:= ${HLTDCXXFLAGS}
-EINCLUDE+= HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER CONTAINERS RAW
+EINCLUDE+= HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER RAW
SUBDIR:=comp
PACKCFLAGS := ${HLTCLFAGS}
PACKDCXXFLAGS:= ${HLTDCXXFLAGS}
-EINCLUDE+= HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER CONTAINERS RAW
+EINCLUDE+= HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER RAW
SUBDIR:=hough
PACKCFLAGS := ${HLTCLFAGS}
PACKDCXXFLAGS:= ${HLTDCXXFLAGS}
-EINCLUDE += HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER CONTAINERS RAW
+EINCLUDE += HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER RAW
SUBDIR:=ITS
PACKCFLAGS := ${HLTCLFAGS}
PACKDCXXFLAGS:= ${HLTDCXXFLAGS}
-EINCLUDE += HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER CONTAINERS RAW
+EINCLUDE += HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER RAW
SUBDIR:=MUON/src
PACKCFLAGS := ${HLTCLFAGS}
PACKDCXXFLAGS:= ${HLTDCXXFLAGS}
-EINCLUDE+= HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER CONTAINERS RAW
+EINCLUDE+= HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER RAW
SUBDIR:=misc
PACKCFLAGS := ${HLTCLFAGS}
PACKDCXXFLAGS:= ${HLTDCXXFLAGS}
-EINCLUDE += HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER CONTAINERS RAW
+EINCLUDE += HLT/src HLT/hough HLT/comp HLT/misc HLT/ITS HLT/MUON/src TPC ITS MUON STEER RAW
SUBDIR:=src
DHDR=ITSLinkDef.h
-EINCLUDE:=$(ALICE)/geant3/TGeant3 TPC CONTAINERS RAW
+EINCLUDE:=$(ALICE)/geant3/TGeant3 TPC RAW
EXPORT:=AliITStrackV2.h AliITSVertexerTracks.h AliV0vertexer.h \
AliV0vertex.h AliITSVertexer.h AliITSrecoV2.h
SRCS:=monitorCheck.cxx
-EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
+EINCLUDE+= TPC ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
PACKBLIBS := $(ROOTCLIBS) $(SYSLIBS)
ifdef DATE_ROOT
ELIBSDIR:=${DATE_MONITOR_DIR}/${DATE_SYS}
-ELIBS:= ESD STEER CONTAINERS RAWData monitor shift TPCbase TPCsim TPCrec ITS AliL3Src AliL3Comp AliL3Misc AliL3Hough AliL3ITS
+ELIBS:= ESD STEER RAWData monitor shift TPCbase TPCsim TPCrec ITS AliL3Src AliL3Comp AliL3Misc AliL3Hough AliL3ITS
EINCLUDE+= ${DATE_COMMON_DEFS} ${DATE_MONITOR_DIR}
endif
SRCS:=monitorGDC.cxx
-EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
+EINCLUDE+= TPC ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
PACKBLIBS := $(ROOTCLIBS) $(SYSLIBS)
ifdef DATE_ROOT
ELIBSDIR:=${DATE_MONITOR_DIR}/${DATE_SYS}
-ELIBS:=ESD STEER RAWData TPCbase TPCsim TPCrec CONTAINERS AliL3Src AliL3Misc AliL3Hough AliL3Comp AliL3ITS ITS monitor shift
+ELIBS:=ESD STEER RAWData TPCbase TPCsim TPCrec AliL3Src AliL3Misc AliL3Hough AliL3Comp AliL3ITS ITS monitor shift
EINCLUDE+= ${DATE_COMMON_DEFS} ${DATE_MONITOR_DIR}
endif
DHDR:= MONITORLinkDef.h
-EINCLUDE:=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp
+EINCLUDE:= TPC ITS RAW HLT/src HLT/hough HLT/comp
ALIROOTMODULES := STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS \
CRT RICH START STRUCT EVGEN RALICE ALIFAST VZERO \
- THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN \
+ THijing MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN \
THerwig TEPEMGEN EPEMGEN FASTSIM TPHIC RAW MONITOR DISPLAY ANALYSIS \
JETAN HLT LHC
ALILIBS := -L$(LIBDIR) -lMUON -lTPC -lPMD -lTRD -lFMD -lTOF \
-lITS -lPHOS -lCRT -lRICH -lVZERO -lZDC -lSTRUCT \
- -lSTART -lEVGEN -lSTEER -lCONTAINERS
+ -lSTART -lEVGEN -lSTEER
LIBS := $(ROOTCLIBS) $(ROOTPLIBS) $(SYSLIBS)
SRCS:= alimdc_main.cxx ${ESRCS}
-EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
+EINCLUDE+= TP ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
# -DUSE_DEBUG for alimdc debug printout
PACKBLIBS := $(ROOTCLIBS) $(SYSLIBS)
-ELIBS:=ESD RAWData MDC MDCFilter STEER TPCbase TPCsim TPCrec CONTAINERS AliL3Src AliL3Misc AliL3Hough AliL3Comp AliL3ITS ITS
+ELIBS:=ESD RAWData MDC MDCFilter STEER TPCbase TPCsim TPCrec AliL3Src AliL3Misc AliL3Hough AliL3Comp AliL3ITS ITS
ifneq (,$(findstring macosx,$(ALICE_TARGET)))
PACKLDFLAGS:=$(LDFLAGS) $(@PACKAGE@LIBSINIT:%=-Wl,-u,_G__cpp_setupG__%)
#EDEFINE+= -DUSE_EB
-EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
+EINCLUDE+= TPC ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
DHDR:= MDCLinkDef.h
#EDEFINE+= -DUSE_EB
-EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
+EINCLUDE+= TPC ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
DHDR:= MDCFilterLinkDef.h
EHDRS:=$(shell root-config --incdir)/TH1F.h
-EINCLUDE+=TPC CONTAINERS ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
+EINCLUDE+= TPC ITS RAW HLT/src HLT/hough HLT/comp HLT/ITS
DHDR:= RAWLinkDef.h
EINCLUDE:=$(ALICE)/geant3/TGeant3 RAW
#ifeq (macosx,$(ALICE_TARGET))
-EINCLUDE+=TPC CONTAINERS
+EINCLUDE+= TPC
#endif
EXPORT:=$(SRCS:.cxx=.h) AliConst.h AliCallf77.h
#include "TError.h"
#include "AliSegmentID.h"
#include "AliH2F.h"
-#include "AliArrayI.h"
-#include "AliArrayS.h"
+#include <TArrayI.h>
+#include <TArrayS.h>
#include "AliDigits.h"
//copy constructor
fNrows = digits.fNrows;
fNcols = digits.fNcols;
- fElements = new AliArrayS(*(digits.fElements));
- fIndex = new AliArrayI(*(digits.fIndex));
+ fElements = new TArrayS(*(digits.fElements));
+ fIndex = new TArrayI(*(digits.fIndex));
fBufType = digits.fBufType;
fThreshold = digits.fThreshold;
fNelems = digits.fNelems;
fNrows = digits.fNrows;
fNcols = digits.fNcols;
if (fElements) delete fElements;
- fElements = new AliArrayS(*(digits.fElements));
+ fElements = new TArrayS(*(digits.fElements));
if (fIndex) delete fIndex;
- fIndex = new AliArrayI(*(digits.fIndex));
+ fIndex = new TArrayI(*(digits.fIndex));
fBufType = digits.fBufType;
fThreshold = digits.fThreshold;
fNelems = digits.fNelems;
//
//set default (invalid parameters)
if (fIndex != 0) delete fIndex;
- fIndex = new AliArrayI;
+ fIndex = new TArrayI;
if (fElements!= 0) delete fElements;
- fElements = new AliArrayS;
+ fElements = new TArrayS;
fNrows = fNcols =fNelems= -1;
fElements->Set(0);
//
//compres buffer according algorithm 1
//
- AliArrayS buf; //lets have the nearly the "worst case"
+ TArrayS buf; //lets have the nearly the "worst case"
buf.Set(fNelems);
- AliArrayI index;
+ TArrayI index;
index.Set(fNcols);
Int_t icurrent=-1;
Int_t izero;
if (izero>0) {
//if we have currently izero count under threshold
icurrent++;
- if (icurrent>=buf.fN) buf.Expand(icurrent*2);
+ if (icurrent>=buf.fN) buf.Set(icurrent*2);
buf[icurrent]= -izero; //write how many under zero
izero = 0;
} //end of reseting izero
icurrent++;
- if (icurrent>=buf.fN) buf.Expand(icurrent*2);
+ if (icurrent>=buf.fN) buf.Set(icurrent*2);
//buf[icurrent] = GetDigitFast(row,col);
buf[icurrent] = *cbuff;
}//if signal bigger then threshold
} //end of loop over rows
if (izero>0) {
icurrent++;
- if (icurrent>=buf.fN) buf.Expand(icurrent*2);
+ if (icurrent>=buf.fN) buf.Set(icurrent*2);
buf[icurrent]= -izero; //write how many under zero
}
}//end of lopping over digits
- buf.Expand(icurrent+1);
+ buf.Set(icurrent+1);
(*fElements)=buf;
fNelems = fElements->fN;
fBufType = 1;
// segment is for example one pad row in TPC //
////////////////////////////////////////////////
-#include "AliArrayI.h"
-#include "AliArrayS.h"
+#include <TArrayI.h>
+#include <TArrayS.h>
#include "AliSegmentID.h"
class AliH2F;
Int_t fNrows; //number of rows in Segment
Int_t fNcols; //number of collumns in Segment
private:
- AliArrayS *fElements; //buffer of 2 bytes integers for digits
- AliArrayI *fIndex; //index position of column
+ TArrayS *fElements; //buffer of 2 bytes integers for digits
+ TArrayI *fIndex; //index position of column
Int_t fBufType; //type of the buffer - define compression algorithm
Int_t fThreshold; //treshold for zero suppresion
Int_t fNelems; //total number of elements
Int_t fCurrentCol; //!current column iteration
Int_t fCurrentIndex; //!current index in field
- ClassDef(AliDigits,1)
+ ClassDef(AliDigits,2)
};
#include "TClonesArray.h"
#include "TDirectory.h"
-#include "AliArrayI.h"
+#include <TArrayI.h>
#include "TError.h"
#include "TClass.h"
#include "TFile.h"
//
if (size<1) return kFALSE;
if (fTreeIndex) delete fTreeIndex;
- fTreeIndex = new AliArrayI();
+ fTreeIndex = new TArrayI();
fTreeIndex->Set(size);
AliSegmentID * psegment = NewSegment(); //MI change
for (Int_t i = 0; i<nevent; i++){
brindix->GetEvent(i);
Int_t treeIndex=psegment->GetID();
- if (fTreeIndex->fN<treeIndex) fTreeIndex->Expand(Int_t(Float_t(treeIndex)*1.5)+1);
+ if (fTreeIndex->fN<treeIndex) fTreeIndex->Set(Int_t(Float_t(treeIndex)*1.5)+1);
// Int_t index = segment.GetID();
(*fTreeIndex)[treeIndex]=i+1; //
}
class TTree;
class TBranch;
class TFile;
-class AliArrayI;
+class TArrayI;
class AliSegmentID;
class AliSegmentArray: public TNamed{
AliSegmentArray(const AliSegmentArray &segment); //copy constructor
AliSegmentArray &operator = (const AliSegmentArray & segment); //assignment operator
TObjArray * fSegment; //!pointer to array of pointers to segment
- AliArrayI * fTreeIndex; //!pointers(index) table in tree
+ TArrayI * fTreeIndex; //!pointers(index) table in tree
Int_t fNSegment; //number of alocated segments
TTree * fTree; //!tree with segment objects
Bool_t fTreeOwner;// flag determing the ownership of the fTree
TBranch * fBranch; //!total branch
private:
TClass * fClass; //!class type of included objects
- ClassDef(AliSegmentArray,2)
+ ClassDef(AliSegmentArray,3)
};
#include "TError.h"
#include "AliSegmentID.h"
#include "AliH2F.h"
-#include "AliArrayI.h"
-#include "AliArrayS.h"
+#include "TArrayI.h"
#include "AliDigits.h"
#include "AliSimDigits.h"
#include "AliTPCdigit.h"
//
//set default (invalid parameters)
if ( fTracks != 0) delete fTracks;
- fTracks = new AliArrayI;
+ fTracks = new TArrayI;
if ( fTrIndex != 0) delete fTrIndex;
- fTrIndex = new AliArrayI;
+ fTrIndex = new TArrayI;
for (Int_t i = 0; i<3; i++){
fTracks->Set(0);
Int_t all = fNrows*fNcols; //total number of digits
Int_t elems = all*fNlevel; //length of the buffer
- AliArrayI * buf = new AliArrayI;
+ TArrayI * buf = new TArrayI;
buf->Set(elems);
fTrIndex->Set(0);
//
//
fTrBufType = 1;
- AliArrayI * buf = new AliArrayI; //create new buffer
+ TArrayI * buf = new TArrayI; //create new buffer
buf->Set(fNrows*fNcols*fNlevel); //lets have the nearly the "worst case"
- AliArrayI * index = new AliArrayI;
+ TArrayI * index = new TArrayI;
index->Set(fNcols*fNlevel);
// Int_t * pindex =
if (id <= 0) {
if ( inum> 0 ) { //if we have some tracks in buffer
icurrent++;
- if ((icurrent+1)>=buf->fN) buf->Expand(icurrent*2+1); //MI change - allocate +1
+ if ((icurrent+1)>=buf->fN) buf->Set(icurrent*2+1); //MI change - allocate +1
(*buf)[icurrent] = inum;
icurrent++;
(*buf)[icurrent] = lastID;
if ( izero > 0 ) {
//if we have currently izero count of non tracks digits
icurrent++;
- if (icurrent>=buf->fN) buf->Expand(icurrent*2+1);
+ if (icurrent>=buf->fN) buf->Set(icurrent*2+1);
(*buf)[icurrent]= -izero; //write how many under zero
inum++;
izero = 0;
else{
//if we change track id from another track id
icurrent++;
- if ((icurrent+1)>=buf->fN) buf->Expand(icurrent*2+1);
+ if ((icurrent+1)>=buf->fN) buf->Set(icurrent*2+1);
(*buf)[icurrent] = inum;
icurrent++;
(*buf)[icurrent] = lastID;
if ( izero > 0 ) {
//if we have currently izero count of non tracks digits
icurrent++;
- if (icurrent>=buf->fN) buf->Expand(icurrent*2);
+ if (icurrent>=buf->fN) buf->Set(icurrent*2);
(*buf)[icurrent]= -izero; //write how many under zero
}
if ( inum> 0 ) { //if we have some tracks in buffer
icurrent++;
- if ((icurrent+1)>=buf->fN) buf->Expand(icurrent*2);
+ if ((icurrent+1)>=buf->fN) buf->Set(icurrent*2);
(*buf)[icurrent] = inum;
icurrent++;
(*buf)[icurrent] = id;
}
}//end of loop over columns
}//end of loop over differnet track level
- buf->Expand(icurrent+1);
+ buf->Set(icurrent+1);
delete fTracks;
fTracks = buf;
delete fTrIndex;
// Manager class generaol Alice segment digits
// segment is for example one pad row in TPC //
////////////////////////////////////////////////
-#include "TError.h"
-#include "AliArrayI.h"
-#include "AliArrayS.h"
-#include "AliDigits.h"
+#include <TError.h>
+#include <TArrayI.h>
#include <TClonesArray.h>
+#include "AliDigits.h"
class AliH2F;
void ExpandTrackBuffer2(); //comress track according algorithm 2 (track ID comression according digit compression)
void CompresTrackBuffer2(); //comress track according algorithm 2 (track ID comression according digit compression)
- AliArrayI * fTracks; //buffer of track index
- AliArrayI * fTrIndex; //index position of column
+ TArrayI * fTracks; //buffer of track index
+ TArrayI * fTrIndex; //index position of column
Int_t fNlevel; //number of tracks etries for one digit
Int_t fTrBufType; //buffer type of the tracks
// Bool_t ClassError( ); //signalize class error
- ClassDef(AliSimDigits,1)
+ ClassDef(AliSimDigits,2)
};
#include <TF2.h>
#include <TStopwatch.h>
-#include "AliArrayBranch.h"
#include "AliDigits.h"
#include "AliMagF.h"
#include "AliPoints.h"
#include "AliSegmentID.h"
#include "AliSegmentArray.h"
-#include "AliArrayI.h"
-#include "AliArrayS.h"
-
-
#include "AliDigits.h"
#include "AliSimDigits.h"
#include "AliDigitsArray.h"
#include "AliCTypes.h"
#include "TArrayOfArray.h"
-class AliArrayS;
class AliTPChit;
class AliTPCTempHitInfo;
class AliTPCCurrentHit;
#include "TObject.h"
class TClonesArray;
-class AliArrayS;
class AliTPChit;
class AliTPCTempHitInfoV2;
class AliTPCCurrentHitV2;
#pragma link off all classes;
#pragma link off all functions;
+#pragma link C++ class AliSegmentID+;
+#pragma link C++ class AliSegmentArray-;
+#pragma link C++ class AliDigits+;
+
+#pragma link C++ class AliH2F+;
+
#pragma link C++ class AliTPCLoader+;
#pragma link C++ class AliTPCRF1D-;
-SRCS:= AliTPCLoader.cxx \
- AliTPCPRF2D.cxx AliTPCRF1D.cxx \
+SRCS:= AliSegmentID.cxx AliSegmentArray.cxx AliDigits.cxx AliH2F.cxx \
+ AliTPCLoader.cxx AliTPCPRF2D.cxx AliTPCRF1D.cxx \
AliDetectorParam.cxx AliTPCParam.cxx \
AliTPCParamSR.cxx AliTPCParamCR.cxx \
AliTPCdigit.cxx \
DHDR:= TPCbaseLinkDef.h
-EINCLUDE:= CONTAINERS RAW
+EINCLUDE:= RAW
DHDR:= TPCfastLinkDef.h
-EINCLUDE:= CONTAINERS RAW
+EINCLUDE:= RAW
DHDR:= TPCrecLinkDef.h
-EINCLUDE:= CONTAINERS RAW
+EINCLUDE:= RAW
DHDR:= TPCsimLinkDef.h
-EINCLUDE:= CONTAINERS RAW
+EINCLUDE:= RAW
DHDR:=VZERObaseLinkDef.h
-EINCLUDE:= $(ALICE)/geant3/TGeant3 STRUCT STEER CONTAINERS RAW
+EINCLUDE:= $(ALICE)/geant3/TGeant3 STRUCT STEER RAW
DHDR:=VZEROrecLinkDef.h
-EINCLUDE:= $(ALICE)/geant3/TGeant3 STRUCT STEER CONTAINERS RAW
+EINCLUDE:= $(ALICE)/geant3/TGeant3 STRUCT STEER RAW
DHDR:=VZEROsimLinkDef.h
-EINCLUDE:= $(ALICE)/geant3/TGeant3 STRUCT STEER CONTAINERS RAW
+EINCLUDE:= $(ALICE)/geant3/TGeant3 STRUCT STEER RAW
specified with the ELIBS variable. *DO NOT* specify the -l flag, just
write the library like
-ELIBS:= CONTAINERS
+ELIBS:= TPC
-this will be translated into -lCONTAINERS
+this will be translated into -lTPC
Extra library directories can be specified with ELIBSDIR
ALIFAST/module.mk: ALIFAST/libALIFAST.pkg
ALIROOT/module.mk: ALIROOT/binaliroot.pkg
ANALYSIS/module.mk: ANALYSIS/libANALYSIS.pkg
-CONTAINERS/module.mk: CONTAINERS/libCONTAINERS.pkg
CRT/module.mk: CRT/libCRT.pkg
DISPLAY/module.mk: DISPLAY/libDISPLAY.pkg
EMCAL/module.mk: EMCAL/libEMCAL.pkg
gSystem->Load("libVZEROsim");
gSystem->Load("libVZEROrec");
gSystem->Load("libEMCAL");
- gSystem->Load("libCONTAINERS");
// The following lines have to be commented on Darwin
// for the moment due to cross dependencies