From 2ab0c72500f5baaae8a0a5299ab6566b50c278b4 Mon Sep 17 00:00:00 2001 From: hristov Date: Fri, 26 Jan 2001 20:04:59 +0000 Subject: [PATCH] Major upgrade of AliRoot code --- EVGEN/AliGenCocktail.cxx | 5 +- EVGEN/AliGenPythia.cxx | 6 +- EVGEN/EVGENLinkDef.h | 48 +- FMD/FMDLinkDef.h | 8 +- GEODB/GEODBLinkDef.h | 20 +- ITS/AliITS.cxx | 146 +++++- ITS/AliITS.h | 6 +- ITS/AliITSHits2Digits.C | 1 - ITS/AliITSgeom.h | 6 +- ITS/AliITShit.cxx | 6 +- ITS/AliITSvPPRsymm.cxx | 10 +- MUON/AliMUON.cxx | 136 +++-- MUON/AliMUON.h | 3 +- MUON/AliMUONEventReconstructor.cxx | 12 +- MUON/AliMUONRecoDisplay.cxx | 9 +- MUON/AliMUONRecoEvent.cxx | 21 +- MUON/AliMUONRecoEvent.h | 2 +- MUON/AliMUONTrackReconstructor.cxx | 30 +- MUON/AliMUONproto.cxx | 5 +- MUON/MUONLinkDef.h | 98 ++-- PHOS/AliPHOS.cxx | 1 + PHOS/AliPHOSAnalyze.cxx | 49 +- PHOS/AliPHOSCPVModule.cxx | 9 +- PHOS/AliPHOSCPVModule.h | 2 +- PHOS/AliPHOSv0.h | 2 + PHOS/AliPHOSv1.cxx | 7 +- PHOS/AliPHOSv1.h | 6 +- PHOS/AliPHOSv4.cxx | 8 +- PHOS/AliPHOSv4.h | 4 +- PHOS/AliPHOSvFast.cxx | 7 +- PHOS/AliPHOSvFast.h | 2 +- PHOS/PHOSLinkDef.h | 68 +-- PMD/AliPMD.cxx | 32 +- PMD/AliPMD.h | 3 +- PMD/PMDLinkDef.h | 12 +- RALICE/RALICELinkDef.h | 36 +- RICH/AliRICH.cxx | 258 +++------ RICH/AliRICH.h | 6 +- RICH/AliRICHClusterFinder.cxx | 43 +- RICH/AliRICHPoints.cxx | 12 +- RICH/AliRICHTresholdMap.h | 2 +- RICH/RICHLinkDef.h | 54 +- START/AliSTART.cxx | 32 +- START/AliSTART.h | 4 +- START/STARTLinkDef.h | 12 +- STEER/AliDetector.cxx | 62 +-- STEER/AliDetector.h | 12 +- STEER/AliDisplay.cxx | 8 +- STEER/AliGenerator.cxx | 9 +- STEER/AliHit.cxx | 6 +- STEER/AliKalmanTrack.cxx | 60 --- STEER/AliMCQA.cxx | 53 +- STEER/AliModule.cxx | 35 +- STEER/AliModule.h | 20 +- STEER/AliPoints.cxx | 9 +- STEER/AliRun.cxx | 548 +++++++++++++------- STEER/AliRun.h | 97 ++-- STEER/STEERLinkDef.h | 56 +- STRUCT/STRUCTLinkDef.h | 36 +- TGeant3/TGeant3LinkDef.h | 56 +- TGeant4/TGeant4LinkDef.h | 12 +- THijing/THijingLinkDef.h | 2 +- TOF/AliTOF.cxx | 27 +- TOF/AliTOF.h | 7 +- TOF/TOFLinkDef.h | 22 +- TPC/AliTPC.cxx | 127 +++-- TPC/AliTPC.h | 13 +- TPC/AliTPCClusterFinder.cxx | 14 +- TPC/AliTPCFindClusters.C | 6 +- TPC/AliTPCParamCR.cxx | 16 +- TPC/AliTPCParamCR.h | 6 +- TPC/AliTPCRF1D.cxx | 67 +-- TPC/AliTPCRF1D.h | 2 +- TPC/AliTPCtest.C | 1 + TPC/TPCLinkDef.h | 56 +- TRD/AliTRD.cxx | 47 +- TRD/AliTRD.h | 6 +- TRD/AliTRDdigit.cxx | 27 +- TRD/AliTRDdigitizer.cxx | 5 +- TRD/AliTRDdigitsManager.cxx | 28 +- TRD/AliTRDdigitsManager.h | 4 +- TRD/AliTRDhit.cxx | 25 +- TRD/AliTRDsegmentArrayBase.cxx | 7 +- TRD/AliTRDsegmentArrayBase.h | 2 +- TRD/AliTRDsim.cxx | 59 +-- TRD/TRDLinkDef.h | 60 +-- ZDC/AliZDC.cxx | 10 +- ZDC/AliZDCv1.cxx | 41 +- ZDC/AliZDCv1.h | 4 +- ZDC/ZDCLinkDef.h | 10 +- macros/Config.C | 806 ++++++++++++++++++++--------- 91 files changed, 2179 insertions(+), 1656 deletions(-) diff --git a/EVGEN/AliGenCocktail.cxx b/EVGEN/AliGenCocktail.cxx index beaba665772..f90dae26dc8 100644 --- a/EVGEN/AliGenCocktail.cxx +++ b/EVGEN/AliGenCocktail.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.9 2000/12/21 16:24:06 morsch +Coding convention clean-up + Revision 1.8 2000/10/27 13:53:29 morsch AddGenerator: check testbit before setting the pT and momentum range (D.Y. Peressounko) @@ -117,7 +120,7 @@ AddGenerator(AliGenerator *Generator, char* Name, Float_t RateExp) AliGenCocktailEntry *entry; AliGenCocktailEntry *e1; AliGenCocktailEntry *e2; - TClonesArray *partArray = gAlice->Particles(); + TObjArray *partArray = gAlice->Particles(); // // Loop over generators and generate events Int_t igen=0; diff --git a/EVGEN/AliGenPythia.cxx b/EVGEN/AliGenPythia.cxx index d20692d4890..cc2d81e7490 100644 --- a/EVGEN/AliGenPythia.cxx +++ b/EVGEN/AliGenPythia.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.31 2001/01/17 10:54:31 hristov +Better protection against FPE + Revision 1.30 2000/12/18 08:55:35 morsch Make AliPythia dependent generartors work with new scheme of random number generation @@ -471,11 +474,10 @@ void AliGenPythia::AdjustWeights() { // Adjust the weights after generation of all events // - TClonesArray *partArray = gAlice->Particles(); TParticle *part; Int_t ntrack=gAlice->GetNtrack(); for (Int_t i=0; iUncheckedAt(i); + part= gAlice->Particle(i); part->SetWeight(part->GetWeight()*fKineBias); } } diff --git a/EVGEN/EVGENLinkDef.h b/EVGEN/EVGENLinkDef.h index 115f942d333..4087d408470 100644 --- a/EVGEN/EVGENLinkDef.h +++ b/EVGEN/EVGENLinkDef.h @@ -14,31 +14,33 @@ #pragma link C++ enum Param_t; #pragma link C++ enum Weighting_t; -#pragma link C++ class AliGenHIJINGpara; -#pragma link C++ class AliGenFixed; -#pragma link C++ class AliGenBox; -#pragma link C++ class AliGenParam; +#pragma link C++ class AliGenHIJINGpara+; +#pragma link C++ class AliGenFixed+; +#pragma link C++ class AliGenBox+; +#pragma link C++ class AliGenParam+; #pragma link C++ class AliGenPythia-; -#pragma link C++ class AliGenCocktail; -#pragma link C++ class AliGenCocktailEntry; -#pragma link C++ class AliGenExtFile; -#pragma link C++ class AliGenScan; -#pragma link C++ class AliGenDoubleScan; -#pragma link C++ class AliPythia; -#pragma link C++ class AliGenLib; -#pragma link C++ class AliGenMUONlib; -#pragma link C++ class AliGenFLUKAsource; -#pragma link C++ class AliGenHalo; -#pragma link C++ class AliGenHaloProtvino; -#pragma link C++ class AliDimuCombinator; -#pragma link C++ class AliGenPHOSlib; -#pragma link C++ class AliGenGSIlib; -#pragma link C++ class AliGenPMDlib; -#pragma link C++ class AliGenEventHeader; -#pragma link C++ class AliGenHijingEventHeader; -#pragma link C++ class AliGenHijing; -#pragma link C++ class AliDecayer; +#pragma link C++ class AliGenCocktail+; +#pragma link C++ class AliGenCocktailEntry+; +#pragma link C++ class AliGenExtFile+; +#pragma link C++ class AliGenExtFileCH+; +#pragma link C++ class AliGenScan+; +#pragma link C++ class AliGenDoubleScan+; +#pragma link C++ class AliPythia+; +#pragma link C++ class AliGenLib+; +#pragma link C++ class AliGenMUONlib+; +#pragma link C++ class AliGenFLUKAsource+; +#pragma link C++ class AliGenHalo+; +#pragma link C++ class AliGenHaloProtvino+; +#pragma link C++ class AliDimuCombinator+; +#pragma link C++ class AliGenPHOSlib+; +#pragma link C++ class AliGenGSIlib+; +#pragma link C++ class AliGenPMDlib+; +#pragma link C++ class AliGenEventHeader+; +#pragma link C++ class AliGenHijingEventHeader+; +#pragma link C++ class AliGenHijing+; +#pragma link C++ class AliDecayer+; #pragma link C++ class AliDecayerPythia-; +#pragma link C++ class AliGenMuonHits+; #endif diff --git a/FMD/FMDLinkDef.h b/FMD/FMDLinkDef.h index d94bded1f84..f776d4b0e4f 100644 --- a/FMD/FMDLinkDef.h +++ b/FMD/FMDLinkDef.h @@ -8,9 +8,9 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class AliFMD; -#pragma link C++ class AliFMDv0; -#pragma link C++ class AliFMDv1; -#pragma link C++ class AliFMDhit; +#pragma link C++ class AliFMD+; +#pragma link C++ class AliFMDv0+; +#pragma link C++ class AliFMDv1+; +#pragma link C++ class AliFMDhit+; #endif diff --git a/GEODB/GEODBLinkDef.h b/GEODB/GEODBLinkDef.h index 53cd0f525f6..978ac0e12e0 100644 --- a/GEODB/GEODBLinkDef.h +++ b/GEODB/GEODBLinkDef.h @@ -10,20 +10,20 @@ #pragma link C++ global gAlice; -#pragma link C++ class AliGShape; -#pragma link C++ class AliGBox; +#pragma link C++ class AliGShape+; +#pragma link C++ class AliGBox+; #pragma link C++ class AliGSphere-; -#pragma link C++ class AliGTransform; +#pragma link C++ class AliGTransform+; #pragma link C++ class AliGMaterial-; -#pragma link C++ class AliGSuperShape; -#pragma link C++ class AliGConfig; -#pragma link C++ class AliGNode; -#pragma link C++ class AliGCone; +#pragma link C++ class AliGSuperShape+; +#pragma link C++ class AliGConfig+; +#pragma link C++ class AliGNode+; +#pragma link C++ class AliGCone+; #pragma link C++ class AliGTube-; #pragma link C++ class AliGPCone-; -#pragma link C++ class AliGTRD1; -#pragma link C++ class AliGeometry; +#pragma link C++ class AliGTRD1+; +#pragma link C++ class AliGeometry+; -#pragma link C++ class AliGEODB; +#pragma link C++ class AliGEODB+; #endif diff --git a/ITS/AliITS.cxx b/ITS/AliITS.cxx index e2b001a195b..1b73c2df678 100644 --- a/ITS/AliITS.cxx +++ b/ITS/AliITS.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.28 2000/12/18 14:02:00 barbera +new version of the ITS tracking to take into account the new TPC track parametrization + Revision 1.27 2000/12/08 13:49:27 barbera Hidden declaration in a for loop removed to be compliant with HP-UX compiler @@ -727,21 +730,25 @@ void AliITS::GetTreeC(Int_t event) } //_____________________________________________________________________________ -void AliITS::MakeBranch(Option_t* option){ +void AliITS::MakeBranch(Option_t* option, char *file) +{ // // Creates Tree branches for the ITS. // - - + // Int_t buffersize = 4000; char branchname[30]; sprintf(branchname,"%s",GetName()); - AliDetector::MakeBranch(option); + AliDetector::MakeBranch(option,file); + char *cD = strstr(option,"D"); + char *cR = strstr(option,"R"); -// one branch for digits per type of detector - + if (cD) { + // + // one branch for digits per type of detector + // char *det[3] = {"SPD","SDD","SSD"}; char digclass[40]; @@ -758,30 +765,33 @@ void AliITS::MakeBranch(Option_t* option){ (*fCtype)[i] = new TClonesArray(clclass,10000); } - - for (i=0; iTreeD()) { - gAlice->TreeD()->Branch(branchname,&((*fDtype)[i]), buffersize); - cout << "Making Branch " << branchname; - cout << " for digits of type "<< i+1 << endl; + else sprintf(branchname,"%sDigits%d",GetName(),i+1); + if (fDtype && gAlice->TreeD()) { + gAlice->MakeBranchInTree(gAlice->TreeD(), + branchname, &((*fDtype)[i]), buffersize, file) ; + cout << "Making Branch " << branchname; + cout << " for digits of type "<< i+1 << endl; } + } } + if (cR) { + // // only one branch for rec points for all detector types - sprintf(branchname,"%sRecPoints",GetName()); - - fRecPoints=new TClonesArray("AliITSRecPoint",10000); + // + sprintf(branchname,"%sRecPoints",GetName()); + + fRecPoints=new TClonesArray("AliITSRecPoint",10000); - if (fRecPoints && gAlice->TreeR()) { - gAlice->TreeR()->Branch(branchname,&fRecPoints, buffersize); - cout << "Making Branch " << branchname; - cout << " for reconstructed space points" << endl; + if (fRecPoints && gAlice->TreeR()) { + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, &fRecPoints, buffersize, file) ; + cout << "Making Branch " << branchname; + cout << " for reconstructed space points" << endl; + } } - - } //___________________________________________ @@ -912,8 +922,8 @@ void AliITS::FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,Option_t *option, //printf("background - ntracks1 - %d\n",ntracks1); } - Int_t npart = gAlice->GetEvent(evnt); - if(npart<=0) return; + //Int_t npart = gAlice->GetEvent(evnt); + //if(npart<=0) return; TClonesArray *itsHits = this->Hits(); Int_t lay,lad,det,index; AliITShit *itsHit=0; @@ -980,6 +990,86 @@ void AliITS::FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules,Option_t *option, } +//____________________________________________________________________________ + +void AliITS::SDigits2Digits() +{ + + AliITSgeom *geom = GetITSgeom(); + + // SPD + AliITSDetType *iDetType; + iDetType=DetType(0); + AliITSsegmentationSPD *seg0=(AliITSsegmentationSPD*)iDetType->GetSegmentationModel(); + AliITSresponseSPD *res0 = (AliITSresponseSPD*)iDetType->GetResponseModel(); + AliITSsimulationSPD *sim0=new AliITSsimulationSPD(seg0,res0); + SetSimulationModel(0,sim0); + // test + // printf("SPD dimensions %f %f \n",seg0->Dx(),seg0->Dz()); + // printf("SPD npixels %d %d \n",seg0->Npz(),seg0->Npx()); + // printf("SPD pitches %d %d \n",seg0->Dpz(0),seg0->Dpx(0)); + // end test + // + // SDD + //Set response functions + Float_t baseline = 10.; + Float_t noise = 1.75; + + // SDD compression param: 2 fDecrease, 2fTmin, 2fTmax or disable, 2 fTolerance + + iDetType=DetType(1); + AliITSresponseSDD *res1 = (AliITSresponseSDD*)iDetType->GetResponseModel(); + if (!res1) { + res1=new AliITSresponseSDD(); + SetResponseModel(1,res1); + } + res1->SetMagicValue(900.); + Float_t maxadc = res1->MaxAdc(); + Float_t topValue = res1->MagicValue(); + Float_t norm = maxadc/topValue; + + Float_t fCutAmp = baseline + 2.*noise; + fCutAmp *= norm; + Int_t cp[8]={0,0,(int)fCutAmp,(int)fCutAmp,0,0,0,0}; //1D + + //res1->SetZeroSupp("2D"); + res1->SetZeroSupp("1D"); + res1->SetNoiseParam(noise,baseline); + res1->SetDo10to8(kTRUE); + res1->SetCompressParam(cp); + res1->SetMinVal(4); + res1->SetDiffCoeff(3.6,40.); + //res1->SetMagicValue(96.95); + AliITSsegmentationSDD *seg1=(AliITSsegmentationSDD*)iDetType->GetSegmentationModel(); + if (!seg1) { + seg1 = new AliITSsegmentationSDD(geom,res1); + SetSegmentationModel(1,seg1); + } + AliITSsimulationSDD *sim1=new AliITSsimulationSDD(seg1,res1); + sim1->SetDoFFT(1); + sim1->SetCheckNoise(kFALSE); + SetSimulationModel(1,sim1); + + // SSD + iDetType=DetType(2); + AliITSsegmentationSSD *seg2=(AliITSsegmentationSSD*)iDetType->GetSegmentationModel(); + AliITSresponseSSD *res2 = (AliITSresponseSSD*)iDetType->GetResponseModel(); + res2->SetSigmaSpread(3.,2.); + AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2); + SetSimulationModel(2,sim2); + + cerr<<"Digitizing ITS...\n"; + + TStopwatch timer; + timer.Start(); + HitsToDigits(0,0,-1," ","All"," "); + timer.Stop(); timer.Print(); + + delete sim0; + delete sim1; + delete sim2; +} + //____________________________________________________________________________ void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size, Option_t *option, Option_t *opt,Text_t *filename) @@ -1041,7 +1131,7 @@ void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size, Option_t *optio char hname[30]; sprintf(hname,"TreeD%d",evNumber); - gAlice->TreeD()->Write(hname); + gAlice->TreeD()->Write(hname,TObject::kOverwrite); // reset tree gAlice->TreeD()->Reset(); @@ -1118,7 +1208,7 @@ void AliITS::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt) char hname[30]; sprintf(hname,"TreeR%d",evNumber); - gAlice->TreeR()->Write(hname); + gAlice->TreeR()->Write(hname,TObject::kOverwrite); // reset tree gAlice->TreeR()->Reset(); @@ -1191,7 +1281,7 @@ Option_t *option,Option_t *opt,Text_t *filename) char hname[30]; sprintf(hname,"TreeR%d",evNumber); - gAlice->TreeR()->Write(hname); + gAlice->TreeR()->Write(hname,TObject::kOverwrite); // reset tree gAlice->TreeR()->Reset(); diff --git a/ITS/AliITS.h b/ITS/AliITS.h index bae6046c7a1..faa47c82bf5 100644 --- a/ITS/AliITS.h +++ b/ITS/AliITS.h @@ -12,6 +12,9 @@ #include // used in inline function GetModule. #include "AliDetector.h" +#include "AliITSsimulationSPD.h" +#include "AliITSsimulationSDD.h" +#include "AliITSsimulationSSD.h" class TString; class TTree; @@ -67,7 +70,7 @@ class AliITS : public AliDetector { // create separate tree for clusters - declustering refining virtual void MakeTreeC(Option_t *option="C"); void GetTreeC(Int_t event); - virtual void MakeBranch(Option_t *opt=" "); + virtual void MakeBranch(Option_t *opt=" ", char *file=0); void SetTreeAddress(); virtual void SetEUCLID(Bool_t euclid=1) {fEuclidOut = euclid;} virtual void StepManager() {} @@ -77,6 +80,7 @@ class AliITS : public AliDetector { Int_t nmodules,Option_t *opt,Text_t *filename); virtual void ClearModules(); // Digitisation + virtual void SDigits2Digits(); void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size, Option_t *add, Option_t *det, Text_t *filename); // Reconstruct hits diff --git a/ITS/AliITSHits2Digits.C b/ITS/AliITSHits2Digits.C index 2994c0584a3..80b6e031cf7 100644 --- a/ITS/AliITSHits2Digits.C +++ b/ITS/AliITSHits2Digits.C @@ -93,7 +93,6 @@ Int_t AliITSHits2Digits() AliITSsimulationSSD *sim2=new AliITSsimulationSSD(seg2,res2); ITS->SetSimulationModel(2,sim2); - cerr<<"Digitizing ITS...\n"; TStopwatch timer; diff --git a/ITS/AliITSgeom.h b/ITS/AliITSgeom.h index 7cd4bd638b4..6bb2495d05b 100644 --- a/ITS/AliITSgeom.h +++ b/ITS/AliITSgeom.h @@ -645,11 +645,11 @@ class AliITSgeom : public TObject { private: Int_t fTrans; //Flag to keep track of which transformation Int_t fNlayers; //The number of layers. - Int_t *fNlad; //Array of the number of ladders/layer(layer) - Int_t *fNdet; //Array of the number of detectors/ladder(layer) + Int_t fNmodules;//The total number of modules + Int_t *fNlad; //!Array of the number of ladders/layer(layer) + Int_t *fNdet; //!Array of the number of detectors/ladder(layer) AliITSgeomMatrix **fGm; //[fNmodules] Structure of trans. and rotation. TObjArray *fShape; //Array of shapes and detector information. - Int_t fNmodules;//The total number of modules ClassDef(AliITSgeom,2) // ITS geometry class }; diff --git a/ITS/AliITShit.cxx b/ITS/AliITShit.cxx index 768a1bee02f..b3bb4e8f4a1 100644 --- a/ITS/AliITShit.cxx +++ b/ITS/AliITShit.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.9 2000/10/02 16:32:51 barbera +Automatic streamer used and forward declarations added + Revision 1.3.4.7 2000/10/02 15:54:49 barbera Automatic streamer used and forward declarations added @@ -459,8 +462,7 @@ TParticle * AliITShit::GetParticle(){ // this hit. From the TParticle all kinds of information about this // particle can be found. See the TParticle class. //////////////////////////////////////////////////////////////////////// - TClonesArray *parts = gAlice->Particles(); - return ((TParticle*)parts->UncheckedAt(this->GetTrack())); + return gAlice->Particle(GetTrack()); } /* //___________________________________________________________________________ diff --git a/ITS/AliITSvPPRsymm.cxx b/ITS/AliITSvPPRsymm.cxx index 0006f5ffecd..cb8853804cd 100644 --- a/ITS/AliITSvPPRsymm.cxx +++ b/ITS/AliITSvPPRsymm.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.1.2.1 2001/01/15 13:38:32 barbera +New ITS detailed geometry to be used for the PPR + Revision 1.12 2000/12/10 16:00:44 barbera Added last definition of special media like end-ladder boxes and cones @@ -238,20 +241,21 @@ void AliITSvPPRsymm::CreateGeometry(){ //////////////////////////////////////////////////////////////////////// //INNER RADII OF THE SILICON LAYERS - Float_t rl[6] = { 3.8095,7.,15.,24.,38.1,43.5765 }; + // Float_t rl[6] = { 3.8095,7.,15.,24.,38.1,43.5765 }; //THICKNESSES OF LAYERS (in % radiation length) Float_t drl[6] = { 1.03,1.03,0.94,0.95,0.91,0.87 }; //HALF LENGTHS OF LAYERS + /* Float_t dzl[6] = { 14.35,14.35,25.1,32.1,49.405,55.27 }; //LENGTHS OF END-LADDER BOXES (ALL INCLUDED) Float_t dzb[6] = { 12.4,12.4,13.5,15.,7.5,7.5 }; //THICKNESSES OF END-LADDER BOXES (ALL INCLUDED) Float_t drb[6] = { rl[1]-rl[0],0.2,5.,5.,4.,4. }; + */ Float_t dits[50], rlim, zmax; - Float_t zpos; - Float_t pcits[50], xltpc; + Float_t xltpc; Int_t idrotm[999], i; Float_t dgh[50]; diff --git a/MUON/AliMUON.cxx b/MUON/AliMUON.cxx index 9c9731b29ef..848711232b3 100644 --- a/MUON/AliMUON.cxx +++ b/MUON/AliMUON.cxx @@ -14,6 +14,9 @@ **************************************************************************/ /* $Log$ +Revision 1.44 2001/01/25 17:39:09 morsch +Pass size of fNdch and fNrawch to CINT. + Revision 1.43 2001/01/23 18:58:19 hristov Initialisation of some pointers @@ -276,10 +279,6 @@ AliMUON::AliMUON(const char *name, const char *title) */ //End_Html - fHits2 = 0; - fPadHits2 = 0; - fFileName = 0; - fTrH1 = 0; fHits = new TClonesArray("AliMUONHit",1000); gAlice->AddHitList(fHits); @@ -531,57 +530,78 @@ Int_t AliMUON::DistancetoPrimitive(Int_t , Int_t ) } //___________________________________________ -void AliMUON::MakeBranch(Option_t* option) +void AliMUON::MakeBranch(Option_t* option, char *file) { + // // Create Tree branches for the MUON. + // const Int_t kBufferSize = 4000; char branchname[30]; sprintf(branchname,"%sCluster",GetName()); - AliDetector::MakeBranch(option); - - if (fPadHits && gAlice->TreeH()) { - gAlice->TreeH()->Branch(branchname,&fPadHits, kBufferSize); - printf("Making Branch %s for clusters\n",branchname); - } - -// one branch for digits per chamber - Int_t i; + AliDetector::MakeBranch(option,file); - for (i=0; iTreeD()) { - gAlice->TreeD()->Branch(branchname,&((*fDchambers)[i]), kBufferSize); - printf("Making Branch %s for digits in chamber %d\n",branchname,i+1); - } + char *cD = strstr(option,"D"); + char *cR = strstr(option,"R"); + char *cH = strstr(option,"H"); + + if (fPadHits && gAlice->TreeH() && cH) { + gAlice->MakeBranchInTree(gAlice->TreeH(), + branchname, &fPadHits, kBufferSize, file) ; + printf("Making Branch %s for clusters\n",branchname); } - printf("Make Branch - TreeR address %p\n",gAlice->TreeR()); + if (cD) { + // + // one branch for digits per chamber + // + Int_t i; -// one branch for raw clusters per chamber - for (i=0; iTreeR()) { - gAlice->TreeR()->Branch(branchname,&((*fRawClusters)[i]), kBufferSize); - printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1); - } - } - -// one branch for global trigger - sprintf(branchname,"%sGlobalTrigger",GetName()); - if (fGlobalTrigger && gAlice->TreeR()) { - gAlice->TreeR()->Branch(branchname,&fGlobalTrigger,kBufferSize); - printf("Making Branch %s for Global Trigger\n",branchname); - } -// one branch for local trigger - sprintf(branchname,"%sLocalTrigger",GetName()); - if (fLocalTrigger && gAlice->TreeR()) { - gAlice->TreeR()->Branch(branchname,&fLocalTrigger,kBufferSize); - printf("Making Branch %s for Local Trigger\n",branchname); + for (i=0; iTreeD()) { + gAlice->MakeBranchInTree(gAlice->TreeD(), + branchname, &((*fDchambers)[i]), kBufferSize, file) ; + printf("Making Branch %s for digits in chamber %d\n",branchname,i+1); + } + } } + if (cR) { + // + // one branch for raw clusters per chamber + // + printf("Make Branch - TreeR address %p\n",gAlice->TreeR()); + + Int_t i; + + for (i=0; iTreeR()) { + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, &((*fRawClusters)[i]), kBufferSize, file) ; + printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1); + } + } + // + // one branch for global trigger + // + sprintf(branchname,"%sGlobalTrigger",GetName()); + if (fGlobalTrigger && gAlice->TreeR()) { + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, &fGlobalTrigger, kBufferSize, file) ; + printf("Making Branch %s for Global Trigger\n",branchname); + } + // + // one branch for local trigger + // + sprintf(branchname,"%sLocalTrigger",GetName()); + if (fLocalTrigger && gAlice->TreeR()) { + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, &fLocalTrigger, kBufferSize, file) ; + printf("Making Branch %s for Local Trigger\n",branchname); + } + } } //___________________________________________ @@ -813,11 +833,29 @@ void AliMUON::SetNsec(Int_t id, Int_t nsec) ((AliMUONChamber*) (*fChambers)[id])->SetNsec(nsec); } - //___________________________________________ +void AliMUON::SDigits2Digits() +{ + Int_t evNumber2=0, ibg=0, bgr=0; + Int_t nbgr_ev= 0, nev=0; + Int_t nparticles = gAlice->GetNtrack(); + cout << "nev " <TreeD()->Write(hname); + gAlice->TreeD()->Write(hname,TObject::kOverwrite); // reset tree gAlice->TreeD()->Reset(); delete list; @@ -1396,7 +1434,7 @@ void AliMUON::Trigger(Int_t nev){ ResetTrigger(); char hname[30]; sprintf(hname,"TreeR%d",nev); - gAlice->TreeR()->Write(hname); + gAlice->TreeR()->Write(hname,TObject::kOverwrite); gAlice->TreeR()->Reset(); printf("\n End of trigger for event %d", nev); } @@ -1457,7 +1495,7 @@ void AliMUON::FindClusters(Int_t nev,Int_t lastEntry) ResetRawClusters(); char hname[30]; sprintf(hname,"TreeR%d",nev); - gAlice->TreeR()->Write(hname); + gAlice->TreeR()->Write(hname,TObject::kOverwrite); gAlice->TreeR()->Reset(); printf("\n End of cluster finding for event %d", nev); @@ -1466,7 +1504,7 @@ void AliMUON::FindClusters(Int_t nev,Int_t lastEntry) //gObjectTable->Print(); } - +#ifdef never void AliMUON::Streamer(TBuffer &R__b) { // Stream an object of class AliMUON. @@ -1577,6 +1615,8 @@ void AliMUON::Streamer(TBuffer &R__b) } } } +#endif + AliMUONPadHit* AliMUON::FirstPad(AliMUONHit* hit, TClonesArray *clusters) { // diff --git a/MUON/AliMUON.h b/MUON/AliMUON.h index 8dece9cfad0..6ff188ada33 100644 --- a/MUON/AliMUON.h +++ b/MUON/AliMUON.h @@ -50,7 +50,7 @@ class AliMUON : public AliDetector { TClonesArray *PadHits() {return fPadHits;} TClonesArray *LocalTrigger() {return fLocalTrigger;} TClonesArray *GlobalTrigger() {return fGlobalTrigger;} - virtual void MakeBranch(Option_t *opt=" "); + virtual void MakeBranch(Option_t *opt=" ", char *file=0); void SetTreeAddress(); virtual void ResetHits(); virtual void ResetDigits(); @@ -59,6 +59,7 @@ class AliMUON : public AliDetector { // Cluster Finding virtual void FindClusters(Int_t event ,Int_t lastEntry); // Digitisation + virtual void SDigits2Digits(); virtual void Digitise(Int_t nev,Int_t bgrEvent, Option_t *opt1=" ", Option_t *opt2=" ",Text_t *name=" "); virtual void SortTracks(Int_t *tracks,Int_t *charges, Int_t ntr); diff --git a/MUON/AliMUONEventReconstructor.cxx b/MUON/AliMUONEventReconstructor.cxx index bee00a0c67f..831373aaada 100644 --- a/MUON/AliMUONEventReconstructor.cxx +++ b/MUON/AliMUONEventReconstructor.cxx @@ -187,12 +187,6 @@ ClassImp(AliMUONEventReconstructor) // Class implementation in ROOT context //__________________________________________________________________________ AliMUONEventReconstructor::AliMUONEventReconstructor(void) { - fBkgGeantFile = 0; - fBkgGeantTK = 0; - fBkgGeantParticles = 0; - fBkgGeantTH = 0; - fBkgGeantHits = 0; - // Constructor for class AliMUONEventReconstructor SetReconstructionParametersToDefaults(); // Memory allocation for the TClonesArray of hits for reconstruction @@ -1414,7 +1408,6 @@ void AliMUONEventReconstructor::EventDump(void) AliMUONTrack *track; AliMUONTrackParam *trackParam, *trackParam1; - TClonesArray *particles; // pointer to the particle list TParticle *p; Double_t bendingSlope, nonBendingSlope, pYZ; Double_t pX, pY, pZ, x, y, z, c; @@ -1468,12 +1461,11 @@ void AliMUONEventReconstructor::EventDump(void) z, x, y, pX, pY, pZ, c); } // informations about generated particles - particles = gAlice->Particles(); - np = particles->GetEntriesFast(); + np = gAlice->GetNtrack(); printf(" **** number of generated particles: %d \n", np); for (Int_t iPart = 0; iPart < np; iPart++) { - p = (TParticle*) particles->UncheckedAt(iPart); + p = gAlice->Particle(iPart); printf(" particle %d: type= %d px= %f py= %f pz= %f pdg= %d\n", iPart, p->GetPdgCode(), p->Px(), p->Py(), p->Pz(), p->GetPdgCode()); } diff --git a/MUON/AliMUONRecoDisplay.cxx b/MUON/AliMUONRecoDisplay.cxx index 6d13a8fa4ec..76f7ab51906 100644 --- a/MUON/AliMUONRecoDisplay.cxx +++ b/MUON/AliMUONRecoDisplay.cxx @@ -15,12 +15,18 @@ /* $Log$ +Revision 1.4 2000/12/21 22:14:38 morsch +Clean-up of coding rule violations. + Revision 1.3 2000/12/21 17:51:54 morsch RN3 violations corrected Revision 1.2 2000/11/23 10:09:39 gosset Bug correction in AliMUONRecoDisplay. Copyright, $Log$ +Copyright, Revision 1.4 2000/12/21 22:14:38 morsch +Copyright, Clean-up of coding rule violations. +Copyright, Copyright, Revision 1.3 2000/12/21 17:51:54 morsch Copyright, RN3 violations corrected Copyright,, $Id$, comments at the right place for automatic documentation, @@ -172,7 +178,6 @@ void AliMUONRecoDisplay::MapEvent(Int_t nevent) if (fEvGen) fEvGen->Clear(); fEvGen->SetNoEvent(nevent); // get list of particles - TClonesArray *particles = gAlice->Particles(); // connect MUON module AliDetector *pMUON = gAlice->GetDetector("MUON"); if (!pMUON) { @@ -190,7 +195,7 @@ void AliMUONRecoDisplay::MapEvent(Int_t nevent) for (Int_t track=0; trackFirstHit(track); if (!hit) continue; - particle = (TParticle *) particles->UncheckedAt(hit->Track()); + particle = gAlice->Particle(hit->Track()); if (IsReconstructible(track) && TMath::Abs(particle->GetPdgCode())==13) { gtrack = fEvGen->AddEmptyTrack(); gtrack->SetSign(TMath::Sign((Int_t)1, -particle->GetPdgCode())); diff --git a/MUON/AliMUONRecoEvent.cxx b/MUON/AliMUONRecoEvent.cxx index c069be4e4ff..790b507c3e3 100644 --- a/MUON/AliMUONRecoEvent.cxx +++ b/MUON/AliMUONRecoEvent.cxx @@ -15,9 +15,15 @@ /* $Log$ +Revision 1.3 2000/12/21 17:51:54 morsch +RN3 violations corrected + Revision 1.2 2000/11/23 10:09:38 gosset Bug correction in AliMUONRecoDisplay. -Copyright, $Log$, $Id$, comments at the right place for automatic documentation, +Copyright, $Log$ +Copyright, Revision 1.3 2000/12/21 17:51:54 morsch +Copyright, RN3 violations corrected +Copyright,, $Id$, comments at the right place for automatic documentation, in AliMUONRecoEvent and AliMUONRecoDisplay */ @@ -58,6 +64,7 @@ in AliMUONRecoEvent and AliMUONRecoDisplay #include #include #include +#include #include "AliMUONRecoEvent.h" #include "AliMUONTrack.h" #include "AliMUONTrackParam.h" @@ -204,19 +211,11 @@ void AliMUONRecoEvent::Streamer(TBuffer &R__b) { // Streams an object of class AliMUONRecoEvent if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - TObject::Streamer(R__b); - R__b >> fNevr; - R__b >> fNtracks; fTracks->Clear(); - fTracks->Streamer(R__b); + AliMUONRecoEvent::Class()->ReadBuffer(R__b, this); } else { cout << "...writing event to file...\n"; - R__b.WriteVersion(AliMUONRecoEvent::IsA()); - TObject::Streamer(R__b); - R__b << fNevr; - R__b << fNtracks; - fTracks->Streamer(R__b); + AliMUONRecoEvent::Class()->WriteBuffer(R__b, this); } } diff --git a/MUON/AliMUONRecoEvent.h b/MUON/AliMUONRecoEvent.h index c61f2206f09..3674d8f1eba 100644 --- a/MUON/AliMUONRecoEvent.h +++ b/MUON/AliMUONRecoEvent.h @@ -35,7 +35,7 @@ class AliMUONRecoEvent:public TObject { private: Int_t fNevr; // event number Int_t fNtracks; // number of tracks - TClonesArray *fTracks; // list of AliMUONRecoTracks + TClonesArray *fTracks; //-> list of AliMUONRecoTracks public: AliMUONRecoEvent(Int_t eventNo = 0); diff --git a/MUON/AliMUONTrackReconstructor.cxx b/MUON/AliMUONTrackReconstructor.cxx index 438e6b1a9e3..b92c61c6e16 100644 --- a/MUON/AliMUONTrackReconstructor.cxx +++ b/MUON/AliMUONTrackReconstructor.cxx @@ -178,7 +178,6 @@ AliMUONTrackReconstructor::AliMUONTrackReconstructor() fSSigmaCut = 4.0; fSXPrec = 0.01; fSYPrec = 0.144; - fFileName = 0; } //_____________________________________________________________________________ @@ -273,11 +272,11 @@ void AliMUONTrackReconstructor::Init(Double_t &seff, Double_t &sb0, Double_t &sb //__________________________________________ void AliMUONTrackReconstructor::FinishEvent() { -// Finish - TTree *treeK = gAlice->TreeK(); - TFile *file1 = 0; - if (treeK) file1 = treeK->GetCurrentFile(); - file1->cd(); + // Finish + // TTree *treeK = gAlice->TreeK(); + // TFile *file1 = 0; + // if (treeK) file1 = treeK->GetCurrentFile(); + // file1->cd(); } //_____________________________________ @@ -749,9 +748,8 @@ void trackf_read_fit(Int_t &ievr, Int_t &nev, Int_t &nhittot1, Int_t *izch, Doub mHit=(AliMUONHit*)pMUON->NextHit()) { if (mHit->fChamber > 10) continue; - TClonesArray *fPartArray = gAlice->Particles(); Int_t ftrack = mHit->Track(); - Int_t id = ((TParticle*) fPartArray->UncheckedAt(ftrack))->GetPdgCode(); + Int_t id = gAlice->Particle(ftrack)->GetPdgCode(); if (id==kMuonPlus||id==kMuonMinus) { xgeant[nhittot1] = mHit->Y(); @@ -805,10 +803,9 @@ void trackf_read_geant(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t *p if (maxidg<=20000) { if (mHit->fChamber > 10) continue; - TClonesArray *fPartArray = gAlice->Particles(); TParticle *particle; Int_t ftrack = mHit->Track(); - Int_t id = ((TParticle*) fPartArray->UncheckedAt(ftrack))->GetPdgCode(); + Int_t id = gAlice->Particle(ftrack)->GetPdgCode(); // if (id==kMuonPlus||id==kMuonMinus) { @@ -836,7 +833,7 @@ void trackf_read_geant(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t *p ptotg[maxidg] = mHit->fPTot; // P of hit - particle = (TParticle*) fPartArray->UncheckedAt(ftrack); + particle = gAlice->Particle(ftrack); Float_t thet = particle->Theta(); thet = thet*180./3.1416; @@ -846,7 +843,7 @@ void trackf_read_geant(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t *p if (iparent >= 0) { Int_t ip; while(1) { - ip=((TParticle*) fPartArray->UncheckedAt(iparent))->GetFirstMother(); + ip=gAlice->Particle(iparent)->GetFirstMother(); if (ip < 0) { break; } else { @@ -857,7 +854,7 @@ void trackf_read_geant(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t *p //printf("iparent - %d\n",iparent); Int_t id1 = ftrack; // numero de la particule generee au vertex Int_t idum = track+1; - Int_t id2 = ((TParticle*) fPartArray->UncheckedAt(iparent))->GetPdgCode(); + Int_t id2 = gAlice->Particle(iparent)->GetPdgCode(); if (id2==443) id2=114; else id2=116; @@ -1009,7 +1006,6 @@ void trackf_read_spoint(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t * itypg[mpoi]=0; ihit = ihit-1; if (ihit >=0 && itrack >=0) { - TClonesArray *fPartArray = gAlice->Particles(); gAlice->ResetHits(); gAlice->TreeH()->GetEvent(itrack); TClonesArray *pMUONhits = pMUON->Hits(); @@ -1021,10 +1017,8 @@ void trackf_read_spoint(Int_t *itypg, Double_t *xtrg, Double_t *ytrg, Double_t * if (id == kMuonPlus) itypg[mpoi]=5; if (id == kMuonMinus) itypg[mpoi]=6; TParticle *particle; - particle = (TParticle*) - (fPartArray->UncheckedAt(mHit->Track())); - TParticle* particleM=(TParticle*) - (fPartArray->UncheckedAt(particle->GetFirstMother())); + particle = gAlice->Particle(mHit->Track()); + TParticle* particleM=gAlice->Particle(particle->GetFirstMother()); Int_t iparent=particleM->GetPdgCode(); printf("\n Particle Id:%d %d \n", id, iparent); if (iparent == 443) id2=114; diff --git a/MUON/AliMUONproto.cxx b/MUON/AliMUONproto.cxx index dff5832c7fb..a115b656622 100644 --- a/MUON/AliMUONproto.cxx +++ b/MUON/AliMUONproto.cxx @@ -14,6 +14,9 @@ **************************************************************************/ /* $Log$ +Revision 1.3 2000/10/11 09:19:12 egangler +Corrected some bugs - it should compile now + Revision 1.2 2000/06/15 07:58:49 morsch Code from MUON-dev joined @@ -199,7 +202,7 @@ void AliMUONproto::GetRawDigits(Int_t evnb, Int_t *lptr, Int_t ilen) { char hname[30]; sprintf(hname, "TreeD%d", evnb); - gAlice->TreeD()->Write(hname); + gAlice->TreeD()->Write(hname,TObject::kOverwrite); // reset tree gAlice->TreeD()->Reset(); diff --git a/MUON/MUONLinkDef.h b/MUON/MUONLinkDef.h index c75e103a859..73a932f6f65 100644 --- a/MUON/MUONLinkDef.h +++ b/MUON/MUONLinkDef.h @@ -2,56 +2,56 @@ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class AliMUON-; -#pragma link C++ class AliMUONv0; -#pragma link C++ class AliMUONv1; -#pragma link C++ class AliMUONHit; -#pragma link C++ class AliMUONPadHit; -#pragma link C++ class AliMUONDigit; -#pragma link C++ class AliMUONTransientDigit; -#pragma link C++ class AliMUONReconstHit; -#pragma link C++ class AliMUONRawCluster; -#pragma link C++ class AliMUONGlobalTrigger; -#pragma link C++ class AliMUONLocalTrigger; -#pragma link C++ class AliMUONResponse; -#pragma link C++ class AliMUONSegmentationV0; -#pragma link C++ class AliMUONResponseV0; -#pragma link C++ class AliMUONResponseTrigger; -#pragma link C++ class AliMUONResponseTriggerV1; -#pragma link C++ class AliMUONSegmentationV01; -#pragma link C++ class AliMUONSegmentationV02; -#pragma link C++ class AliMUONSegmentationV04; -#pragma link C++ class AliMUONSegmentationV05; -#pragma link C++ class AliMUONSegmentationV1; -#pragma link C++ class AliMUONSegmentationTrigger; -#pragma link C++ class AliMUONSegmentationTriggerX; -#pragma link C++ class AliMUONSegmentationTriggerY; -#pragma link C++ class AliMUONChamber; -#pragma link C++ class AliMUONChamberTrigger; -#pragma link C++ class AliMUONPoints; -#pragma link C++ class AliMUONDisplay; -#pragma link C++ class AliMUONClusterFinderVS; -#pragma link C++ class AliMUONHitMapA1; -#pragma link C++ class AliMUONTrackReconstructor; -#pragma link C++ class AliMUONTriggerCircuit; -#pragma link C++ class AliMUONTriggerLut; -#pragma link C++ class AliMUONTriggerDecision; -#pragma link C++ class AliMUONEventReconstructor; -#pragma link C++ class AliMUONHitForRec; -#pragma link C++ class AliMUONSegment; -#pragma link C++ class AliMUONTrack; -#pragma link C++ class AliMUONTrackHit; -#pragma link C++ class AliMUONTrackParam; -#pragma link C++ class AliMUONTriggerConstants; -#pragma link C++ class AliMUONSegmentationSlatModule; -#pragma link C++ class AliMUONSegmentationSlatModuleN; -#pragma link C++ class AliMUONSegmentationSlat; -#pragma link C++ class AliMUONSegmentationSlatN; -#pragma link C++ class AliMUONConstants; -#pragma link C++ class AliMUONClusterInput; +#pragma link C++ class AliMUON+; +#pragma link C++ class AliMUONv0+; +#pragma link C++ class AliMUONv1+; +#pragma link C++ class AliMUONHit+; +#pragma link C++ class AliMUONPadHit+; +#pragma link C++ class AliMUONDigit+; +#pragma link C++ class AliMUONTransientDigit+; +#pragma link C++ class AliMUONReconstHit+; +#pragma link C++ class AliMUONRawCluster+; +#pragma link C++ class AliMUONGlobalTrigger+; +#pragma link C++ class AliMUONLocalTrigger+; +#pragma link C++ class AliMUONResponse+; +#pragma link C++ class AliMUONSegmentationV0+; +#pragma link C++ class AliMUONResponseV0+; +#pragma link C++ class AliMUONResponseTrigger+; +#pragma link C++ class AliMUONResponseTriggerV1+; +#pragma link C++ class AliMUONSegmentationV01+; +#pragma link C++ class AliMUONSegmentationV02+; +#pragma link C++ class AliMUONSegmentationV04+; +#pragma link C++ class AliMUONSegmentationV05+; +#pragma link C++ class AliMUONSegmentationV1+; +#pragma link C++ class AliMUONSegmentationTrigger+; +#pragma link C++ class AliMUONSegmentationTriggerX+; +#pragma link C++ class AliMUONSegmentationTriggerY+; +#pragma link C++ class AliMUONChamber+; +#pragma link C++ class AliMUONChamberTrigger+; +#pragma link C++ class AliMUONPoints+; +#pragma link C++ class AliMUONDisplay+; +#pragma link C++ class AliMUONClusterFinderVS+; +#pragma link C++ class AliMUONHitMapA1+; +#pragma link C++ class AliMUONTrackReconstructor+; +#pragma link C++ class AliMUONTriggerCircuit+; +#pragma link C++ class AliMUONTriggerLut+; +#pragma link C++ class AliMUONTriggerDecision+; +#pragma link C++ class AliMUONEventReconstructor+; +#pragma link C++ class AliMUONHitForRec+; +#pragma link C++ class AliMUONSegment+; +#pragma link C++ class AliMUONTrack+; +#pragma link C++ class AliMUONTrackHit+; +#pragma link C++ class AliMUONTrackParam+; +#pragma link C++ class AliMUONTriggerConstants+; +#pragma link C++ class AliMUONSegmentationSlatModule+; +#pragma link C++ class AliMUONSegmentationSlatModuleN+; +#pragma link C++ class AliMUONSegmentationSlat+; +#pragma link C++ class AliMUONSegmentationSlatN+; +#pragma link C++ class AliMUONConstants+; +#pragma link C++ class AliMUONClusterInput+; #pragma link C++ class AliMUONRecoEvent-; -#pragma link C++ class AliMUONRecoTrack; -#pragma link C++ class AliMUONRecoDisplay; +#pragma link C++ class AliMUONRecoTrack+; +#pragma link C++ class AliMUONRecoDisplay+; #endif diff --git a/PHOS/AliPHOS.cxx b/PHOS/AliPHOS.cxx index bd11428e942..0c180e494a2 100644 --- a/PHOS/AliPHOS.cxx +++ b/PHOS/AliPHOS.cxx @@ -27,6 +27,7 @@ ////////////////////////////////////////////////////////////////////////////// // --- ROOT system --- +class TFile; #include "TTree.h" // --- Standard library --- diff --git a/PHOS/AliPHOSAnalyze.cxx b/PHOS/AliPHOSAnalyze.cxx index 826aaa74ea0..ab1c91b15fc 100644 --- a/PHOS/AliPHOSAnalyze.cxx +++ b/PHOS/AliPHOSAnalyze.cxx @@ -150,13 +150,11 @@ void AliPHOSAnalyze::DrawRecon(Int_t Nevent,Int_t Nmod){ gAlice->GetEvent(Nevent); - TClonesArray * primaryList = gAlice->Particles(); - TParticle * primary ; Int_t iPrimary ; - for ( iPrimary = 0 ; iPrimary < primaryList->GetEntries() ; iPrimary++) + for ( iPrimary = 0 ; iPrimary < gAlice->GetNtrack() ; iPrimary++) { - primary = (TParticle*)primaryList->At(iPrimary) ; + primary = gAlice->Particle(iPrimary) ; Int_t primaryType = primary->GetPdgCode() ; if( (primaryType == 211)||(primaryType == -211)||(primaryType == 2212)||(primaryType == -2212) ) { Int_t moduleNumber ; @@ -256,7 +254,7 @@ void AliPHOSAnalyze::DrawRecon(Int_t Nevent,Int_t Nmod){ Double_t distance = minDistance ; for ( index = 0 ; index < numberofprimaries ; index++){ - primary = (TParticle*)primaryList->At(listofprimaries[index]) ; + primary = gAlice->Particle(listofprimaries[index]) ; Int_t moduleNumber ; Double_t primX, primZ ; fGeom->ImpactOnEmc(primary->Theta(), primary->Phi(), moduleNumber, primX, primZ) ; @@ -271,7 +269,7 @@ void AliPHOSAnalyze::DrawRecon(Int_t Nevent,Int_t Nmod){ if(closestPrimary >=0 ){ - Int_t primaryType = ((TParticle *)primaryList->At(closestPrimary))->GetPdgCode() ; + Int_t primaryType = gAlice->Particle(closestPrimary)->GetPdgCode() ; if(primaryType==22) recPhot->Fill(recZ,recX,recParticle->Energy()) ; @@ -1015,13 +1013,12 @@ void AliPHOSAnalyze::AnalyzeCPV(Int_t Nevents) gAlice->TreeK()->GetEvent(0) ; //=========== Gets the list of Primari Particles - TClonesArray * primaryList = gAlice->Particles(); TParticle * primary ; Int_t iPrimary ; - for ( iPrimary = 0 ; iPrimary < primaryList->GetEntries() ; iPrimary++) + for ( iPrimary = 0 ; iPrimary < gAlice->GetNtrack() ; iPrimary++) { - primary = (TParticle*)primaryList->UncheckedAt(iPrimary) ; + primary = gAlice->Particle(iPrimary) ; Int_t primaryType = primary->GetPdgCode() ; if( primaryType == 22 ) { Int_t moduleNumber ; @@ -1065,7 +1062,7 @@ void AliPHOSAnalyze::AnalyzeCPV(Int_t Nevents) Double_t dXmin = 0.; Double_t dZmin = 0. ; for ( index = 0 ; index < numberofprimaries ; index++){ - primary = (TParticle*)primaryList->UncheckedAt(listofprimaries[index]) ; + primary = gAlice->Particle(listofprimaries[index]) ; Int_t moduleNumber ; Double_t primX, primZ ; fGeom->ImpactOnEmc(primary->Theta(), primary->Phi(), moduleNumber, primX, primZ) ; @@ -1086,8 +1083,8 @@ void AliPHOSAnalyze::AnalyzeCPV(Int_t Nevents) if(closestPrimary >=0 ){ totalRPwithPrim++; - Int_t primaryType = ((TParticle *)primaryList->At(closestPrimary))->GetPdgCode() ; -// TParticlePDG* pDGparticle = ((TParticle *)primaryList->At(closestPrimary))->GetPDG(); + Int_t primaryType = gAlice->Particle(closestPrimary)->GetPdgCode() ; +// TParticlePDG* pDGparticle = gAlice->ParticleAt(closestPrimary)->GetPDG(); // Double_t charge = PDGparticle->Charge() ; // if(charge) // cout <<"Primary " <At(closestPrimary))->Energy() << endl ; @@ -1096,8 +1093,8 @@ void AliPHOSAnalyze::AnalyzeCPV(Int_t Nevents) { case 22: primaryCode = 0; //Photon - fhAllEnergy ->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy()) ; - fhAllPosition ->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), minDistance) ; + fhAllEnergy ->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy()) ; + fhAllPosition ->Fill(gAlice->Particle(closestPrimary)->Energy(), minDistance) ; fhAllPositionX->Fill(dXmin); fhAllPositionZ->Fill(dZmin); break; @@ -1140,13 +1137,13 @@ void AliPHOSAnalyze::AnalyzeCPV(Int_t Nevents) { case AliPHOSFastRecParticle::kGAMMA: if(primaryType == 22){ - fhPhotEnergy->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy() ) ; - fhEMEnergy->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy() ) ; - fhPPSDEnergy->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy() ) ; + fhPhotEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy() ) ; + fhEMEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy() ) ; + fhPPSDEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy() ) ; - fhPhotPosition->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(),minDistance) ; - fhEMPosition->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(),minDistance) ; - fhPPSDPosition->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(),minDistance) ; + fhPhotPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance) ; + fhEMPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance) ; + fhPPSDPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance) ; fhPhotReg->Fill(CorrectEnergy(recParticle->Energy()) ) ; fhPhotEM->Fill(CorrectEnergy(recParticle->Energy()) ) ; @@ -1183,8 +1180,8 @@ void AliPHOSAnalyze::AnalyzeCPV(Int_t Nevents) case AliPHOSFastRecParticle::kELECTRON: if(primaryType == 22){ fhPhotElec->Fill(CorrectEnergy(recParticle->Energy()) ) ; - fhEMEnergy->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy() ) ; - fhEMPosition->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(),minDistance) ; + fhEMEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy() ) ; + fhEMPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance) ; fhPhotEM->Fill(CorrectEnergy(recParticle->Energy()) ) ; fhPhotPPSD->Fill(CorrectEnergy(recParticle->Energy()) ) ; } @@ -1218,8 +1215,8 @@ void AliPHOSAnalyze::AnalyzeCPV(Int_t Nevents) break ; case AliPHOSFastRecParticle::kNEUTRALEM: if(primaryType == 22){ - fhEMEnergy->Fill(((TParticle *)primaryList->At(closestPrimary))->Energy(),recParticle->Energy() ) ; - fhEMPosition->Fill(((TParticle *)primaryList->At(closestPrimary))->Energy(),minDistance ) ; + fhEMEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(),recParticle->Energy() ) ; + fhEMPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance ) ; fhPhotNuEM->Fill(CorrectEnergy(recParticle->Energy()) ) ; fhPhotEM->Fill(CorrectEnergy(recParticle->Energy()) ) ; @@ -1248,8 +1245,8 @@ void AliPHOSAnalyze::AnalyzeCPV(Int_t Nevents) case AliPHOSFastRecParticle::kGAMMAHA: if(primaryType == 22){ //photon fhPhotGaHa->Fill(CorrectEnergy(recParticle->Energy()) ) ; - fhPPSDEnergy->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(), recParticle->Energy() ) ; - fhPPSDPosition->Fill(((TParticle *) primaryList->At(closestPrimary))->Energy(),minDistance) ; + fhPPSDEnergy->Fill(gAlice->Particle(closestPrimary)->Energy(), recParticle->Energy() ) ; + fhPPSDPosition->Fill(gAlice->Particle(closestPrimary)->Energy(),minDistance) ; fhPhotPPSD->Fill(CorrectEnergy(recParticle->Energy()) ) ; } if(primaryType == 2112){ //neutron diff --git a/PHOS/AliPHOSCPVModule.cxx b/PHOS/AliPHOSCPVModule.cxx index 23df88efd3e..ccaa5a9cda0 100644 --- a/PHOS/AliPHOSCPVModule.cxx +++ b/PHOS/AliPHOSCPVModule.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.5 2000/11/30 11:58:21 schutz + make it compile with Federico modifications + Revision 1.4 2000/11/20 09:50:03 schutz AliPHOSCPVHit inherits from AliHit @@ -39,6 +42,7 @@ // --- ROOT system --- #include +#include // --- Standard library --- #include @@ -147,7 +151,7 @@ void AliPHOSCPVModule::Print(Option_t *opt) //______________________________________________________________________________ -void AliPHOSCPVModule::MakeBranch(char *title,Int_t i) +void AliPHOSCPVModule::MakeBranch(char *title,Int_t i,char *file) { // // Create a new branch for a EMC or CPV module #i in the current Root Tree @@ -155,7 +159,8 @@ void AliPHOSCPVModule::MakeBranch(char *title,Int_t i) char branchname[10]; sprintf(branchname,"%s%d",title,i); - gAlice->TreeH()->Branch(branchname,&fHits, 1000); + gAlice->MakeBranchInTree(gAlice->TreeH(), + branchname, &fHits, 1000, file) ; } //_____________________________________________________________________________ diff --git a/PHOS/AliPHOSCPVModule.h b/PHOS/AliPHOSCPVModule.h index a1506d5ad68..52dc3c575f9 100644 --- a/PHOS/AliPHOSCPVModule.h +++ b/PHOS/AliPHOSCPVModule.h @@ -35,7 +35,7 @@ public: void Clear(Option_t *opt=""); void Print(Option_t *opt=""); void AddHit(Int_t shunt, Int_t track, TLorentzVector p, Float_t *xy, Int_t ipart); - void MakeBranch (char *title, Int_t i); + void MakeBranch (char *title, Int_t i, char *file=0); void SetTreeAddress(char *title, Int_t i); TClonesArray *Hits (void) {return fHits;} diff --git a/PHOS/AliPHOSv0.h b/PHOS/AliPHOSv0.h index 0ff4936baea..c2c463bbb6d 100644 --- a/PHOS/AliPHOSv0.h +++ b/PHOS/AliPHOSv0.h @@ -13,6 +13,8 @@ // --- ROOT system --- #include "TClonesArray.h" +class TFile; + // --- AliRoot header files --- #include "AliPHOS.h" #include "AliPHOSGeometry.h" diff --git a/PHOS/AliPHOSv1.cxx b/PHOS/AliPHOSv1.cxx index 5bcd6757bb0..30a4bdf9781 100644 --- a/PHOS/AliPHOSv1.cxx +++ b/PHOS/AliPHOSv1.cxx @@ -356,20 +356,21 @@ void AliPHOSv1::Hit2Digit(Int_t ntracks){ gAlice->TreeD()->Write(0,TObject::kOverwrite) ; } + //___________________________________________________________________________ -void AliPHOSv1::MakeBranch(Option_t* opt) +void AliPHOSv1::MakeBranch(Option_t* opt, char *file) { // Create new branche in the current Root Tree in the digit Tree AliDetector::MakeBranch(opt) ; // Create new branches EMC for hits in EMC modules - for( Int_t i=0; iGetNModules(); i++ ) GetEMCModule(i).MakeBranch("EMC",i+1); + for( Int_t i=0; iGetNModules(); i++ ) GetEMCModule(i).MakeBranch("EMC",i+1,file); // Create new branches CPV for hits in CPV modules for IHEP geometry if ( strcmp(fGeom->GetName(),"IHEP") == 0 || strcmp(fGeom->GetName(),"MIXT") == 0 ) { - for( Int_t i=0; iGetNCPVModules(); i++ ) GetCPVModule(i).MakeBranch("CPV",i+1); + for( Int_t i=0; iGetNCPVModules(); i++ ) GetCPVModule(i).MakeBranch("CPV",i+1,file); } } diff --git a/PHOS/AliPHOSv1.h b/PHOS/AliPHOSv1.h index 31cc7790aac..c5191285496 100644 --- a/PHOS/AliPHOSv1.h +++ b/PHOS/AliPHOSv1.h @@ -13,6 +13,8 @@ // --- ROOT system --- #include "TClonesArray.h" +class TFile; + // --- AliRoot header files --- #include "AliPHOSv0.h" #include "AliPHOSGeometry.h" @@ -44,7 +46,7 @@ public: // Gives the version number return 1 ; } - virtual void MakeBranch(Option_t* opt) ; + virtual void MakeBranch(Option_t* opt, char *file=0 ) ; void Reconstruction(AliPHOSReconstructioner * Reconstructioner) ; void ResetClusters(){} ; virtual void ResetHits() ; @@ -67,6 +69,8 @@ public: return *this ; } + // IHEP's CPV specific functions + AliPHOSCPVModule &GetEMCModule(int n) { return *(AliPHOSCPVModule*)fEMCModules->operator[](n); } AliPHOSCPVModule &GetCPVModule(int n) { return *(AliPHOSCPVModule*)fCPVModules->operator[](n); } diff --git a/PHOS/AliPHOSv4.cxx b/PHOS/AliPHOSv4.cxx index d70252e9c04..7892b9ecf8b 100644 --- a/PHOS/AliPHOSv4.cxx +++ b/PHOS/AliPHOSv4.cxx @@ -31,6 +31,7 @@ #include "TParticle.h" #include "TTree.h" #include "TGeometry.h" +#include "TFile.h" // --- Standard library --- @@ -238,18 +239,19 @@ Float_t AliPHOSv4::GetBigBox(Int_t index) } //___________________________________________________________________________ -void AliPHOSv4::MakeBranch(Option_t* opt) +void AliPHOSv4::MakeBranch(Option_t* opt, char *file) { // Create new branch in the current reconstructed Root Tree - AliDetector::MakeBranch(opt) ; + AliDetector::MakeBranch(opt,file) ; char branchname[10]; sprintf(branchname,"%s",GetName()); char *cd = strstr(opt,"R"); if (fFastRecParticles && gAlice->TreeR() && cd) { - gAlice->TreeR()->Branch(branchname, &fFastRecParticles, fBufferSize); + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, &fFastRecParticles, fBufferSize, file) ; } } diff --git a/PHOS/AliPHOSv4.h b/PHOS/AliPHOSv4.h index 6c0980b66d6..1a9c8ad9cc8 100644 --- a/PHOS/AliPHOSv4.h +++ b/PHOS/AliPHOSv4.h @@ -18,6 +18,8 @@ #include "TClonesArray.h" #include "TRandom.h" +class TFile; + // --- AliRoot header files --- #include "AliPHOS.h" #include "AliPHOSGeometry.h" @@ -58,7 +60,7 @@ public: return 4 ; } - void MakeBranch(Option_t* opt) ; + void MakeBranch(Option_t* opt, char *file=0) ; Double_t MakeEnergy(const Double_t energy) ; // makes the detected energy TVector3 MakePosition(const Double_t energy, const TVector3 pos, const Double_t th, const Double_t ph) ; // makes the detected position diff --git a/PHOS/AliPHOSvFast.cxx b/PHOS/AliPHOSvFast.cxx index b34e6d9de61..c7cb322084d 100644 --- a/PHOS/AliPHOSvFast.cxx +++ b/PHOS/AliPHOSvFast.cxx @@ -248,18 +248,19 @@ Float_t AliPHOSvFast::GetBigBox(Int_t index) } //___________________________________________________________________________ -void AliPHOSvFast::MakeBranch(Option_t* opt) +void AliPHOSvFast::MakeBranch(Option_t* opt, char *file) { // Create new branch in the current reconstructed Root Tree - AliDetector::MakeBranch(opt) ; + AliDetector::MakeBranch(opt,file) ; char branchname[10]; sprintf(branchname,"%s",GetName()); char *cd = strstr(opt,"R"); if (fFastRecParticles && gAlice->TreeR() && cd) { - gAlice->TreeR()->Branch(branchname, &fFastRecParticles, fBufferSize); + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, &fFastRecParticles, fBufferSize, file); } } diff --git a/PHOS/AliPHOSvFast.h b/PHOS/AliPHOSvFast.h index da7a6a56345..a7842720242 100644 --- a/PHOS/AliPHOSvFast.h +++ b/PHOS/AliPHOSvFast.h @@ -44,7 +44,7 @@ public: virtual AliPHOSGeometry * GetGeometry() { return fGeom ; } virtual void Init(void) ; // does nothing Int_t IsVersion(void) const { return -1 ; } - void MakeBranch(Option_t* opt) ; + void MakeBranch(Option_t* opt, char *file=0) ; Double_t MakeEnergy(const Double_t energy) ; // makes the detected energy TVector3 MakePosition(const Double_t energy, const TVector3 pos, const Double_t th, const Double_t ph) ; // makes the detected position diff --git a/PHOS/PHOSLinkDef.h b/PHOS/PHOSLinkDef.h index cb26848b662..a04cd8f6d2e 100644 --- a/PHOS/PHOSLinkDef.h +++ b/PHOS/PHOSLinkDef.h @@ -4,39 +4,39 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class AliPHOS ; -#pragma link C++ class AliPHOSClusterizer ; -#pragma link C++ class AliPHOSClusterizerv1 ; -#pragma link C++ class AliPHOSCpvRecPoint ; -#pragma link C++ class AliPHOSDigit ; -#pragma link C++ class AliPHOSEmcRecPoint ; -#pragma link C++ class AliPHOSFastRecParticle ; -#pragma link C++ class AliPHOSGeometry ; -#pragma link C++ class AliPHOSHit ; -#pragma link C++ class AliPHOSIndexToObject ; -#pragma link C++ class AliPHOSLink ; -#pragma link C++ class AliPHOSPpsdRecPoint ; -#pragma link C++ class AliPHOSReconstructioner ; -#pragma link C++ class AliPHOSRecPoint ; -#pragma link C++ class AliPHOSv0 ; -#pragma link C++ class AliPHOSv1 ; -#pragma link C++ class AliPHOSv2 ; -#pragma link C++ class AliPHOSv3 ; -#pragma link C++ class AliPHOSv4 ; -#pragma link C++ class AliPHOSTrackSegment ; -#pragma link C++ class AliPHOSTrackSegmentMaker ; -#pragma link C++ class AliPHOSTrackSegmentMakerv1 ; -#pragma link C++ class AliPHOSRecParticle ; -#pragma link C++ class AliPHOSPID ; -#pragma link C++ class AliPHOSPIDv1 ; -#pragma link C++ class AliPHOSAnalyze ; -#pragma link C++ class AliPHOSEMCAGeometry ; -#pragma link C++ class AliPHOSCPVBaseGeometry ; -#pragma link C++ class AliPHOSCPVGeometry ; -#pragma link C++ class AliPHOSPPSDGeometry ; -#pragma link C++ class AliPHOSSupportGeometry ; -#pragma link C++ class AliPHOSCPVModule ; -#pragma link C++ class AliPHOSCPVHit ; -#pragma link C++ class AliPHOSCPVDigit ; +#pragma link C++ class AliPHOS+; +#pragma link C++ class AliPHOSClusterizer+; +#pragma link C++ class AliPHOSClusterizerv1+; +#pragma link C++ class AliPHOSCpvRecPoint+; +#pragma link C++ class AliPHOSDigit+; +#pragma link C++ class AliPHOSEmcRecPoint+; +#pragma link C++ class AliPHOSFastRecParticle+; +#pragma link C++ class AliPHOSGeometry+; +#pragma link C++ class AliPHOSHit+; +#pragma link C++ class AliPHOSIndexToObject+; +#pragma link C++ class AliPHOSLink+; +#pragma link C++ class AliPHOSPpsdRecPoint+; +#pragma link C++ class AliPHOSReconstructioner+; +#pragma link C++ class AliPHOSRecPoint+; +#pragma link C++ class AliPHOSv0+; +#pragma link C++ class AliPHOSv1+; +#pragma link C++ class AliPHOSv2+; +#pragma link C++ class AliPHOSv3+; +#pragma link C++ class AliPHOSv4+; +#pragma link C++ class AliPHOSTrackSegment+; +#pragma link C++ class AliPHOSTrackSegmentMaker+; +#pragma link C++ class AliPHOSTrackSegmentMakerv1+; +#pragma link C++ class AliPHOSRecParticle+; +#pragma link C++ class AliPHOSPID+; +#pragma link C++ class AliPHOSPIDv1+; +#pragma link C++ class AliPHOSAnalyze+; +#pragma link C++ class AliPHOSEMCAGeometry+; +#pragma link C++ class AliPHOSCPVBaseGeometry+; +#pragma link C++ class AliPHOSCPVGeometry+; +#pragma link C++ class AliPHOSPPSDGeometry+; +#pragma link C++ class AliPHOSSupportGeometry+; +#pragma link C++ class AliPHOSCPVModule+; +#pragma link C++ class AliPHOSCPVHit+; +#pragma link C++ class AliPHOSCPVDigit+; #endif diff --git a/PMD/AliPMD.cxx b/PMD/AliPMD.cxx index dff2dd76906..c7df92ac56f 100644 --- a/PMD/AliPMD.cxx +++ b/PMD/AliPMD.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.12 2000/12/04 08:48:18 alibrary +Fixing problems in the HEAD + Revision 1.11 2000/11/17 10:15:24 morsch Call to AliDetector::ResetHits() added to method AliPMD::ResetHits() @@ -66,6 +69,7 @@ Introduction of the Copyright and cvs Log #include #include #include +#include #include "AliPMD.h" #include "AliRun.h" @@ -85,6 +89,7 @@ AliPMD::AliPMD() // Always make the TClonesArray, otherwise the automatic streamer gets angry fRecPoints = new TClonesArray("AliPMDRecPoint",10000); + } //_____________________________________________________________________________ @@ -257,21 +262,26 @@ void AliPMD::AddRecPoint(const AliPMDRecPoint &p) new(lrecpoints[fNRecPoints++]) AliPMDRecPoint(p); } -void AliPMD::MakeBranch(Option_t* option) +void AliPMD::MakeBranch(Option_t* option, char *file) { // Create Tree branches for the PMD - printf("Make Branch - TreeR address %p\n",gAlice->TreeR()); - const Int_t kBufferSize = 4000; - char branchname[30]; - - AliDetector::MakeBranch(option); + char *cR = strstr(option,"R"); + + AliDetector::MakeBranch(option,file); - sprintf(branchname,"%sRecPoints",GetName()); - if (fRecPoints && gAlice->TreeR()) { - gAlice->TreeR()->Branch(branchname, &fRecPoints, kBufferSize); - printf("Making Branch %s for reconstructed hits\n",branchname); - } + if (cR) { + printf("Make Branch - TreeR address %p\n",gAlice->TreeR()); + + const Int_t kBufferSize = 4000; + char branchname[30]; + + sprintf(branchname,"%sRecPoints",GetName()); + if (fRecPoints && gAlice->TreeR()) { + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, &fRecPoints, kBufferSize, file) ; + } + } } diff --git a/PMD/AliPMD.h b/PMD/AliPMD.h index 5a7540704be..e9564f49386 100644 --- a/PMD/AliPMD.h +++ b/PMD/AliPMD.h @@ -13,6 +13,7 @@ #include "AliHit.h" class TClonesArray; +class TFile; class AliPMDRecPoint; class AliPMD : public AliDetector { @@ -39,7 +40,7 @@ public: virtual void SetPadSize(Float_t, Float_t, Float_t, Float_t); virtual void StepManager(); virtual void AddRecPoint(const AliPMDRecPoint &p); - virtual void MakeBranch(Option_t* option); + virtual void MakeBranch(Option_t* option, char *file=0); virtual void SetTreeAddress(); virtual void ResetHits(); diff --git a/PMD/PMDLinkDef.h b/PMD/PMDLinkDef.h index 50137bf46c5..fafbe9bdf90 100644 --- a/PMD/PMDLinkDef.h +++ b/PMD/PMDLinkDef.h @@ -8,10 +8,10 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class AliPMD; -#pragma link C++ class AliPMDv0; -#pragma link C++ class AliPMDv1; -#pragma link C++ class AliPMDv2; -#pragma link C++ class AliPMDhit; -#pragma link C++ class AliPMDRecPoint; +#pragma link C++ class AliPMD+; +#pragma link C++ class AliPMDv0+; +#pragma link C++ class AliPMDv1+; +#pragma link C++ class AliPMDv2+; +#pragma link C++ class AliPMDhit+; +#pragma link C++ class AliPMDRecPoint+; #endif diff --git a/RALICE/RALICELinkDef.h b/RALICE/RALICELinkDef.h index 7254cf7bf95..096905f1659 100644 --- a/RALICE/RALICELinkDef.h +++ b/RALICE/RALICELinkDef.h @@ -14,23 +14,23 @@ #pragma link off all classes; #pragma link off all functions; - #pragma link C++ class AliMath; - #pragma link C++ class AliSample; - #pragma link C++ class AliRandom; - #pragma link C++ class Ali3Vector; - #pragma link C++ class Ali3VectorObj; - #pragma link C++ class Ali4Vector; - #pragma link C++ class Ali4VectorObj; - #pragma link C++ class AliBoost; - #pragma link C++ class AliPosition; - #pragma link C++ class AliPositionObj; - #pragma link C++ class AliSignal; - #pragma link C++ class AliCalorimeter; - #pragma link C++ class AliCalmodule; - #pragma link C++ class AliCalcluster; - #pragma link C++ class AliTrack; - #pragma link C++ class AliJet; - #pragma link C++ class AliVertex; - #pragma link C++ class AliInvmass; + #pragma link C++ class AliMath+; + #pragma link C++ class AliSample+; + #pragma link C++ class AliRandom+; + #pragma link C++ class Ali3Vector+; + #pragma link C++ class Ali3VectorObj+; + #pragma link C++ class Ali4Vector+; + #pragma link C++ class Ali4VectorObj+; + #pragma link C++ class AliBoost+; + #pragma link C++ class AliPosition+; + #pragma link C++ class AliPositionObj+; + #pragma link C++ class AliSignal+; + #pragma link C++ class AliCalorimeter+; + #pragma link C++ class AliCalmodule+; + #pragma link C++ class AliCalcluster+; + #pragma link C++ class AliTrack+; + #pragma link C++ class AliJet+; + #pragma link C++ class AliVertex+; + #pragma link C++ class AliInvmass+; #endif diff --git a/RICH/AliRICH.cxx b/RICH/AliRICH.cxx index 2b2c5df64ba..a8960152bf3 100644 --- a/RICH/AliRICH.cxx +++ b/RICH/AliRICH.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.40 2001/01/24 20:58:03 jbarbosa + Enhanced BuildGeometry. Now the photocathodes are drawn. + Revision 1.39 2001/01/22 21:40:24 jbarbosa Removing magic numbers @@ -300,6 +303,26 @@ void AliRICH::AddCerenkov(Int_t track, Int_t *vol, Float_t *cerenkovs) //printf ("Done for Cerenkov %d\n\n\n\n",fNcerenkovs); } //___________________________________________ +void AliRICH::SDigits2Digits() +{ + +// +// Gennerate digits +// + AliRICHChamber* iChamber; + + printf("Generating tresholds...\n"); + + for(Int_t i=0;i<7;i++) { + iChamber = &(Chamber(i)); + iChamber->GenerateTresholds(); + } + + int nparticles = gAlice->GetNtrack(); + cout << "RICH: Particles :" < 0) Digitise(0,0); +} +//___________________________________________ void AliRICH::AddPadHit(Int_t *clhits) { @@ -1607,67 +1630,78 @@ Int_t AliRICH::DistancetoPrimitive(Int_t , Int_t ) } //___________________________________________ -void AliRICH::MakeBranch(Option_t* option) +void AliRICH::MakeBranch(Option_t* option, char *file) { // Create Tree branches for the RICH. const Int_t kBufferSize = 4000; char branchname[20]; - - - AliDetector::MakeBranch(option); - sprintf(branchname,"%sCerenkov",GetName()); - if (fCerenkovs && gAlice->TreeH()) { - gAlice->TreeH()->Branch(branchname,&fCerenkovs, kBufferSize); - printf("Making Branch %s for Cerenkov Hits\n",branchname); - } - - sprintf(branchname,"%sPadHits",GetName()); - if (fPadHits && gAlice->TreeH()) { - gAlice->TreeH()->Branch(branchname,&fPadHits, kBufferSize); - printf("Making Branch %s for PadHits\n",branchname); + + AliDetector::MakeBranch(option,file); + + char *cH = strstr(option,"H"); + char *cD = strstr(option,"D"); + char *cR = strstr(option,"R"); + + if (cH) { + sprintf(branchname,"%sCerenkov",GetName()); + if (fCerenkovs && gAlice->TreeH()) { + gAlice->MakeBranchInTree(gAlice->TreeH(), + branchname, &fCerenkovs, kBufferSize, file) ; + } + sprintf(branchname,"%sPadHits",GetName()); + if (fPadHits && gAlice->TreeH()) { + gAlice->MakeBranchInTree(gAlice->TreeH(), + branchname, &fPadHits, kBufferSize, file) ; + } } -// one branch for digits per chamber - Int_t i; - - for (i=0; iTreeD()) { - gAlice->TreeD()->Branch(branchname,&((*fDchambers)[i]), kBufferSize); - printf("Making Branch %s for digits in chamber %d\n",branchname,i+1); - } + if (cD) { + // + // one branch for digits per chamber + // + Int_t i; + + for (i=0; iTreeD()) { + gAlice->MakeBranchInTree(gAlice->TreeD(), + branchname, &((*fDchambers)[i]), kBufferSize, file) ; + } + } } -// one branch for raw clusters per chamber - for (i=0; iTreeR()) { - gAlice->TreeR()->Branch(branchname,&((*fRawClusters)[i]), kBufferSize); - printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1); + if (cR) { + // + // one branch for raw clusters per chamber + // + Int_t i; + + for (i=0; iTreeR()) { + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, &((*fRawClusters)[i]), kBufferSize, file) ; + } + } + // + // one branch for rec hits per chamber + // + for (i=0; iTreeR()) { + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, &((*fRecHits1D)[i]), kBufferSize, file) ; + } + } + for (i=0; iTreeR()) { + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, &((*fRecHits3D)[i]), kBufferSize, file) ; } - } - - // one branch for rec hits per chamber - for (i=0; iTreeR()) { - gAlice->TreeR()->Branch(branchname,&((*fRecHits1D)[i]), kBufferSize); - printf("Making Branch %s for 1D rec. hits in chamber %d\n",branchname,i+1); - } - } - for (i=0; iTreeR()) { - gAlice->TreeR()->Branch(branchname,&((*fRecHits3D)[i]), kBufferSize); - printf("Making Branch %s for 3D rec. hits in chamber %d\n",branchname,i+1); - } - } - + } + } } //___________________________________________ @@ -1750,7 +1784,7 @@ void AliRICH::ResetDigits() // Reset number of digits and the digits array for this detector // for ( int i=0;iClear(); + if (fDchambers && (*fDchambers)[i]) (*fDchambers)[i]->Clear(); if (fNdch) fNdch[i]=0; } } @@ -2389,126 +2423,6 @@ void AliRICH::FindClusters(Int_t nev,Int_t lastEntry) //gObjectTable->Print(); } - -//______________________________________________________________________________ -void AliRICH::Streamer(TBuffer &R__b) -{ - // Stream an object of class AliRICH. - AliRICHChamber *iChamber; - AliSegmentation *segmentation; - AliRICHResponse *response; - TClonesArray *digitsaddress; - TClonesArray *rawcladdress; - TClonesArray *rechitaddress1D; - TClonesArray *rechitaddress3D; - - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - AliDetector::Streamer(R__b); - R__b >> fNPadHits; - R__b >> fPadHits; // diff - R__b >> fNcerenkovs; - R__b >> fCerenkovs; // diff - R__b >> fDchambers; - R__b >> fRawClusters; - R__b >> fRecHits1D; //diff - R__b >> fRecHits3D; //diff - R__b >> fDebugLevel; //diff - R__b.ReadStaticArray(fNdch); - R__b.ReadStaticArray(fNrawch); - R__b.ReadStaticArray(fNrechits1D); - R__b.ReadStaticArray(fNrechits3D); -// - R__b >> fChambers; -// Stream chamber related information - for (Int_t i =0; iStreamer(R__b); - segmentation=iChamber->GetSegmentationModel(); - segmentation->Streamer(R__b); - response=iChamber->GetResponseModel(); - response->Streamer(R__b); - rawcladdress=(TClonesArray*) (*fRawClusters)[i]; - rawcladdress->Streamer(R__b); - rechitaddress1D=(TClonesArray*) (*fRecHits1D)[i]; - rechitaddress1D->Streamer(R__b); - rechitaddress3D=(TClonesArray*) (*fRecHits3D)[i]; - rechitaddress3D->Streamer(R__b); - digitsaddress=(TClonesArray*) (*fDchambers)[i]; - digitsaddress->Streamer(R__b); - } - R__b >> fDebugLevel; - R__b >> fCkovNumber; - R__b >> fCkovQuarz; - R__b >> fCkovGap; - R__b >> fCkovCsi; - R__b >> fLostRfreo; - R__b >> fLostRquar; - R__b >> fLostAfreo; - R__b >> fLostAquarz; - R__b >> fLostAmeta; - R__b >> fLostCsi; - R__b >> fLostWires; - R__b >> fFreonProd; - R__b >> fMipx; - R__b >> fMipy; - R__b >> fFeedbacks; - R__b >> fLostFresnel; - - } else { - R__b.WriteVersion(AliRICH::IsA()); - AliDetector::Streamer(R__b); - R__b << fNPadHits; - R__b << fPadHits; // diff - R__b << fNcerenkovs; - R__b << fCerenkovs; // diff - R__b << fDchambers; - R__b << fRawClusters; - R__b << fRecHits1D; //diff - R__b << fRecHits3D; //diff - R__b << fDebugLevel; //diff - R__b.WriteArray(fNdch, kNCH); - R__b.WriteArray(fNrawch, kNCH); - R__b.WriteArray(fNrechits1D, kNCH); - R__b.WriteArray(fNrechits3D, kNCH); -// - R__b << fChambers; -// Stream chamber related information - for (Int_t i =0; iStreamer(R__b); - segmentation=iChamber->GetSegmentationModel(); - segmentation->Streamer(R__b); - response=iChamber->GetResponseModel(); - response->Streamer(R__b); - rawcladdress=(TClonesArray*) (*fRawClusters)[i]; - rawcladdress->Streamer(R__b); - rechitaddress1D=(TClonesArray*) (*fRecHits1D)[i]; - rechitaddress1D->Streamer(R__b); - rechitaddress3D=(TClonesArray*) (*fRecHits3D)[i]; - rechitaddress3D->Streamer(R__b); - digitsaddress=(TClonesArray*) (*fDchambers)[i]; - digitsaddress->Streamer(R__b); - } - R__b << fDebugLevel; - R__b << fCkovNumber; - R__b << fCkovQuarz; - R__b << fCkovGap; - R__b << fCkovCsi; - R__b << fLostRfreo; - R__b << fLostRquar; - R__b << fLostAfreo; - R__b << fLostAquarz; - R__b << fLostAmeta; - R__b << fLostCsi; - R__b << fLostWires; - R__b << fFreonProd; - R__b << fMipx; - R__b << fMipy; - R__b << fFeedbacks; - R__b << fLostFresnel; - } -} AliRICHPadHit* AliRICH::FirstPad(AliRICHHit* hit,TClonesArray *clusters ) { // diff --git a/RICH/AliRICH.h b/RICH/AliRICH.h index 4e131840098..fe9cc32f991 100644 --- a/RICH/AliRICH.h +++ b/RICH/AliRICH.h @@ -15,6 +15,7 @@ #include "AliRICHChamber.h" static const int kNCH=7; +class TFile; class AliRICHHit; class AliRICHPadHit; @@ -56,7 +57,7 @@ class AliRICH : public AliDetector { // TClonesArray *PadHits() {return fPadHits;} TClonesArray *Cerenkovs() {return fCerenkovs;} - virtual void MakeBranch(Option_t *opt=" "); + virtual void MakeBranch(Option_t *opt=" ", char *file=0); void SetTreeAddress(); virtual void ResetHits(); virtual void ResetDigits(); @@ -65,6 +66,7 @@ class AliRICH : public AliDetector { virtual void ResetRecHits3D(); virtual void FindClusters(Int_t nev,Int_t lastEntry); virtual void Digitise(Int_t nev,Int_t flag,Option_t *opt=" ",Text_t *name=" "); + virtual void SDigits2Digits(); // // Configuration Methods (per station id) // @@ -114,7 +116,7 @@ class AliRICH : public AliDetector { TObjArray *fDchambers; // List of digits TClonesArray *fCerenkovs; // List of cerenkovs Int_t fNdch[kNCH]; // Number of digits - Text_t *fFileName; // Filename for event mixing + Text_t *fFileName; //! Filename for event mixing TObjArray *fRawClusters; // List of raw clusters TObjArray *fRecHits1D; // List of rec. hits TObjArray *fRecHits3D; // List of rec. hits diff --git a/RICH/AliRICHClusterFinder.cxx b/RICH/AliRICHClusterFinder.cxx index 6694f57fb78..1ef73c7581e 100644 --- a/RICH/AliRICHClusterFinder.cxx +++ b/RICH/AliRICHClusterFinder.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.8 2000/11/02 09:11:12 jbarbosa + Removed AliRICHRecHit.h from include. + Revision 1.7 2000/10/03 21:44:09 morsch Use AliSegmentation and AliHit abstract base classes. @@ -1137,43 +1140,3 @@ AliRICHClusterFinder& AliRICHClusterFinder::operator=(const AliRICHClusterFinder return *this; } - -//______________________________________________________________________________ -void AliRICHClusterFinder::Streamer(TBuffer &R__b) -{ - // Stream an object of class AliRICHClusterFinder. - - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - TObject::Streamer(R__b); - R__b >> fSegmentation; - R__b >> fResponse; - R__b >> fRawClusters; - R__b >> fHitMap; - R__b >> fCogCorr; - R__b >> fDigits; - R__b >> fNdigits; - R__b >> fChamber; - R__b >> fNRawClusters; - R__b >> fNperMax; - R__b >> fDeclusterFlag; - R__b >> fClusterSize; - R__b >> fNPeaks; - } else { - R__b.WriteVersion(AliRICHClusterFinder::IsA()); - TObject::Streamer(R__b); - R__b << fSegmentation; - R__b << fResponse; - R__b << fRawClusters; - R__b << fHitMap; - R__b << fCogCorr; - R__b << fDigits; - R__b << fNdigits; - R__b << fChamber; - R__b << fNRawClusters; - R__b << fNperMax; - R__b << fDeclusterFlag; - R__b << fClusterSize; - R__b << fNPeaks; - } -} diff --git a/RICH/AliRICHPoints.cxx b/RICH/AliRICHPoints.cxx index 53740bfce57..90cbd45e3f2 100644 --- a/RICH/AliRICHPoints.cxx +++ b/RICH/AliRICHPoints.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.7 2000/11/02 09:10:57 jbarbosa + Removed AliRICHRecHit.h from include. + Revision 1.6 2000/10/03 21:44:09 morsch Use AliSegmentation and AliHit abstract base classes. @@ -162,10 +165,8 @@ TParticle *AliRICHPoints::GetParticle() const // // Returns pointer to particle index in AliRun::fParticles // - TClonesArray *particles = gAlice->Particles(); - Int_t nparticles = particles->GetEntriesFast(); - if (fIndex < 0 || fIndex >= nparticles) return 0; - return (TParticle*)particles->UncheckedAt(fIndex); + if (fIndex < 0 || fIndex >= gAlice->GetNtrack()) return 0; + return gAlice->Particle(fIndex); } //_____________________________________________________________________________ @@ -276,8 +277,7 @@ void AliRICHPoints::ShowRing(Int_t highlight) { if (marker) marker->Draw(); } - TClonesArray *particles=gAlice->Particles(); - TParticle *p = (TParticle*)particles->UncheckedAt(fIndex); + TParticle *p = gAlice->Particle(fIndex); printf("\nTrack index %d\n",fTrackIndex); printf("Particle ID %d\n",p->GetPdgCode()); printf("Parent %d\n",p->GetFirstMother()); diff --git a/RICH/AliRICHTresholdMap.h b/RICH/AliRICHTresholdMap.h index c82e964b637..3e6610f860b 100644 --- a/RICH/AliRICHTresholdMap.h +++ b/RICH/AliRICHTresholdMap.h @@ -21,7 +21,7 @@ class AliRICHTresholdMap : public AliHitMap public: AliRICHTresholdMap(AliSegmentation *seg); - //AliRICHTresholdMap() {} + AliRICHTresholdMap() {fSegmentation = 0; fHitMap=0;} virtual ~AliRICHTresholdMap(); virtual void FillHits(); virtual void Clear(const char *opt = ""); diff --git a/RICH/RICHLinkDef.h b/RICH/RICHLinkDef.h index 301eb6f99c7..bf40a6bae20 100644 --- a/RICH/RICHLinkDef.h +++ b/RICH/RICHLinkDef.h @@ -3,33 +3,33 @@ #pragma link off all classes; #pragma link off all functions; //#pragma link C++ enum Response_t; -#pragma link C++ class AliRICH-; -#pragma link C++ class AliRICHv0; -#pragma link C++ class AliRICHv1; -#pragma link C++ class AliRICHv2; -#pragma link C++ class AliRICHHit; -//#pragma link C++ class AliRICHPadHit; -#pragma link C++ class AliRICHDigit; -#pragma link C++ class AliRICHPadHit; -#pragma link C++ class AliRICHTransientDigit; -#pragma link C++ class AliRICHRawCluster; -#pragma link C++ class AliRICHRecHit1D; -#pragma link C++ class AliRICHRecHit3D; -#pragma link C++ class AliRICHCerenkov; -#pragma link C++ class AliRICHSegmentationV0; -#pragma link C++ class AliRICHSegmentationV1; -#pragma link C++ class AliRICHResponse; -#pragma link C++ class AliRICHResponseV0; -#pragma link C++ class AliRICHGeometry; -#pragma link C++ class AliRICHChamber; -#pragma link C++ class AliRICHPoints; -#pragma link C++ class AliRICHDisplay; -#pragma link C++ class AliRICHEllipse; -#pragma link C++ class AliRICHDetect; -#pragma link C++ class AliRICHHitMapA1; -#pragma link C++ class AliRICHTresholdMap; -#pragma link C++ class AliRICHClusterFinder-; -#pragma link C++ class AliRICHPatRec; +#pragma link C++ class AliRICH+; +#pragma link C++ class AliRICHv0+; +#pragma link C++ class AliRICHv1+; +#pragma link C++ class AliRICHv2+; +#pragma link C++ class AliRICHHit+; +//#pragma link C++ class AliRICHPadHit+; +#pragma link C++ class AliRICHDigit+; +#pragma link C++ class AliRICHPadHit+; +#pragma link C++ class AliRICHTransientDigit+; +#pragma link C++ class AliRICHRawCluster+; +#pragma link C++ class AliRICHRecHit1D+; +#pragma link C++ class AliRICHRecHit3D+; +#pragma link C++ class AliRICHCerenkov+; +#pragma link C++ class AliRICHSegmentationV0+; +#pragma link C++ class AliRICHSegmentationV1+; +#pragma link C++ class AliRICHResponse+; +#pragma link C++ class AliRICHResponseV0+; +#pragma link C++ class AliRICHGeometry+; +#pragma link C++ class AliRICHChamber+; +#pragma link C++ class AliRICHPoints+; +#pragma link C++ class AliRICHDisplay+; +#pragma link C++ class AliRICHEllipse+; +#pragma link C++ class AliRICHDetect+; +#pragma link C++ class AliRICHHitMapA1+; +#pragma link C++ class AliRICHTresholdMap+; +#pragma link C++ class AliRICHClusterFinder+; +#pragma link C++ class AliRICHPatRec+; #endif diff --git a/START/AliSTART.cxx b/START/AliSTART.cxx index 12f6a4bd335..bf36571d0bf 100755 --- a/START/AliSTART.cxx +++ b/START/AliSTART.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.16 2001/01/17 10:56:08 hristov +Corrections to destructors + Revision 1.15 2001/01/01 13:10:42 hristov Local definition of digits removed @@ -83,7 +86,9 @@ Introduction of the Copyright and cvs Log #include "TNode.h" #include "TRandom.h" #include "TGeometry.h" +#include "TFile.h" #include "TParticle.h" + #include "AliRun.h" #include "AliSTART.h" #include "AliSTARTdigit.h" @@ -213,7 +218,7 @@ void AliSTART::Init() } //--------------------------------------------------------------------------- -void AliSTART::MakeBranch(Option_t* option) +void AliSTART::MakeBranch(Option_t* option, char *file) { // // Specific START branches @@ -223,16 +228,22 @@ void AliSTART::MakeBranch(Option_t* option) char branchname[10]; sprintf(branchname,"%s",GetName()); - AliDetector::MakeBranch(option); + AliDetector::MakeBranch(option,file); - TTree *td = gAlice->TreeD(); - digits = new AliSTARTdigit(); - td->Branch(branchname,"AliSTARTdigit",&digits, buffersize); - printf("Making Branch %s for digits\n",branchname); - + char *cD = strstr(option,"D"); + + if (cD) { + digits = new AliSTARTdigit(); + gAlice->MakeBranchInTree(gAlice->TreeD(), + branchname, "AliSTARTdigit", digits, buffersize, 1, file) ; + } /* - gAlice->TreeR()->Branch(branchname,"Int_t",&fZposit, buffersize); - printf("Making Branch %s for vertex position %d\n",branchname); + char *cR = strstr(option,"R"); + + if (cR) { + gAlice->MakeBranchInTree(gAlice->TreeR(), + branchname, "Int_t", &fZposit, buffersize, 1, file) ; + } */ } @@ -278,7 +289,6 @@ void AliSTART::Hit2digit(Int_t evnum) if (nparticles <= 0) return; printf("\n nparticles %d\n",nparticles); - TClonesArray *particles = gAlice->Particles(); sprintf(nameTH,"TreeH%d",evnum); printf("%s\n",nameTH); @@ -289,7 +299,7 @@ void AliSTART::Hit2digit(Int_t evnum) for (Int_t track=0; trackResetHits(); nbytes += th->GetEvent(track); - particle=(TParticle*)particles->UncheckedAt(track); + particle=gAlice->Particle(track); nhits =fHits->GetEntriesFast(); for (hit=0;hit #include -#include "TBrowser.h" +#include +#include #include "AliDetector.h" #include "AliRun.h" @@ -78,6 +82,7 @@ AliDetector::AliDetector() fDigits = 0; fTimeGate = 200.e-9; fBufferSize = 16000; + fDigitsFile = 0; } //_____________________________________________________________________________ @@ -97,6 +102,7 @@ AliDetector::AliDetector(const char* name,const char *title):AliModule(name,titl fNdigits = 0; fPoints = 0; fBufferSize = 16000; + fDigitsFile = 0; } //_____________________________________________________________________________ @@ -120,6 +126,7 @@ AliDetector::~AliDetector() delete fDigits; fDigits = 0; } + if (fDigitsFile) delete [] fDigitsFile; } //_____________________________________________________________________________ @@ -267,22 +274,32 @@ void AliDetector::LoadPoints(Int_t) } //_____________________________________________________________________________ -void AliDetector::MakeBranch(Option_t *option) +void AliDetector::MakeBranch(Option_t *option, char *file) { // // Create a new branch in the current Root Tree // The branch of fHits is automatically split // + char branchname[10]; sprintf(branchname,"%s",GetName()); // // Get the pointer to the header char *cH = strstr(option,"H"); // - if (fHits && gAlice->TreeH() && cH) { - gAlice->TreeH()->Branch(branchname,&fHits, fBufferSize); - printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname); + if (fHits && gAlice->TreeH() && cH) { + gAlice->MakeBranchInTree(gAlice->TreeH(), + branchname, &fHits, fBufferSize, file) ; } + + char *cD = strstr(option,"D"); + + if (cD) { + if (file) { + fDigitsFile = new char[strlen (file)]; + strcpy(fDigitsFile,file); + } + } } //_____________________________________________________________________________ @@ -343,39 +360,4 @@ void AliDetector::SetTreeAddress() } } -//_____________________________________________________________________________ -void AliDetector::Streamer(TBuffer &R__b) -{ - // - // Stream an object of class Detector. - // - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - TNamed::Streamer(R__b); - TAttLine::Streamer(R__b); - TAttMarker::Streamer(R__b); - AliModule::Streamer(R__b); - R__b >> fTimeGate; - R__b >> fIshunt; - //R__b >> fNhits; - // - // Stream the pointers but not the TClonesArrays - R__b >> fHits; // diff - R__b >> fDigits; // diff - - } else { - R__b.WriteVersion(AliDetector::IsA()); - TNamed::Streamer(R__b); - TAttLine::Streamer(R__b); - TAttMarker::Streamer(R__b); - AliModule::Streamer(R__b); - R__b << fTimeGate; - R__b << fIshunt; - //R__b << fNhits; - // - // Stream the pointers but not the TClonesArrays - R__b << fHits; // diff - R__b << fDigits; // diff - } -} diff --git a/STEER/AliDetector.h b/STEER/AliDetector.h index 114a320bed2..91db735830b 100644 --- a/STEER/AliDetector.h +++ b/STEER/AliDetector.h @@ -7,6 +7,7 @@ #include class AliHit; +class TTree; class AliDetector : public AliModule { @@ -34,7 +35,7 @@ public: virtual void Browse(TBrowser *b); virtual void FinishRun(); virtual void LoadPoints(Int_t track); - virtual void MakeBranch(Option_t *opt=" "); + virtual void MakeBranch(Option_t *opt=" ", char *file=0 ); virtual void ResetDigits(); virtual void ResetHits(); virtual void ResetPoints(); @@ -53,12 +54,13 @@ protected: Float_t fTimeGate; //Time gate in seconds Int_t fIshunt; //1 if the hit is attached to the primary - Int_t fNhits; //Number of hits - Int_t fNdigits; //Number of digits - Int_t fBufferSize; //buffer size for Tree detector branches + Int_t fNhits; //!Number of hits + Int_t fNdigits; //!Number of digits + Int_t fBufferSize; //!buffer size for Tree detector branches TClonesArray *fHits; //List of hits for one track only TClonesArray *fDigits; //List of digits for this detector - TObjArray *fPoints; //Array of points for each track (all tracks in memory) + char *fDigitsFile; //!File to store branches of digits tree for detector + TObjArray *fPoints; //!Array of points for each track (all tracks in memory) ClassDef(AliDetector,1) //Base class for ALICE detectors }; diff --git a/STEER/AliDisplay.cxx b/STEER/AliDisplay.cxx index 411c51818b4..cbd2c9dc0f4 100644 --- a/STEER/AliDisplay.cxx +++ b/STEER/AliDisplay.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.13 2000/12/21 15:30:18 fca +Correcting coding convention violations + Revision 1.12 2000/12/12 13:18:59 hristov Protection against FPE @@ -322,8 +325,9 @@ void AliDisplay::ShowTrack(Int_t idx) pm->Draw("same"); // fPad->Update(); // fPad->Modified(); - TClonesArray *particles=gAlice->Particles(); - TParticle *p = (TParticle*)particles->UncheckedAt(idx); + // TClonesArray *particles=gAlice->Particles(); + // TParticle *p = (TParticle*)particles->UncheckedAt(idx); + TParticle *p = gAlice->Particle(idx); printf("\nTrack index %d\n",idx); printf("Particle ID %d\n",p->GetPdgCode()); printf("Parent %d\n",p->GetFirstMother()); diff --git a/STEER/AliGenerator.cxx b/STEER/AliGenerator.cxx index 250d3d0d2b5..3d90df50f8d 100644 --- a/STEER/AliGenerator.cxx +++ b/STEER/AliGenerator.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.10 2000/12/21 15:30:18 fca +Correcting coding convention violations + Revision 1.9 2000/10/04 10:08:01 fca Correction of minor typing mistakes @@ -69,7 +72,8 @@ AliGenerator::AliGenerator() // // Default constructor // - printf("\n AliGenerator Default Constructor\n\n"); + if (gAlice->GetDebug()>0) + printf("\n AliGenerator Default Constructor\n\n"); gAlice->SetGenerator(this); SetThetaRange(); ResetBit(kThetaRange); @@ -97,7 +101,8 @@ AliGenerator::AliGenerator(Int_t npart) // // Standard constructor // - printf("\n AliGenerator Constructor initializing number of particles \n\n"); + if (gAlice->GetDebug()>0) + printf("\n AliGenerator Constructor initializing number of particles \n\n"); gAlice->SetGenerator(this); SetThetaRange(); ResetBit(kThetaRange); SetPhiRange(); ResetBit(kPhiRange); diff --git a/STEER/AliHit.cxx b/STEER/AliHit.cxx index d3db3b9cb63..3878070772c 100644 --- a/STEER/AliHit.cxx +++ b/STEER/AliHit.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.5 2000/07/12 08:56:25 fca +Coding convention correction and warning removal + Revision 1.4 2000/07/11 18:24:59 fca Coding convention corrections + few minor bug fixes @@ -42,10 +45,9 @@ AliHit::AliHit(Int_t shunt, Int_t track) // // Standard constructor // - TClonesArray &particles = *(gAlice->Particles()); if(shunt) { int primary = gAlice->GetPrimary(track); - ((TParticle *)particles[primary])->SetBit(kKeepBit); + gAlice->Particle(primary)->SetBit(kKeepBit); fTrack=primary; } else { fTrack=track; diff --git a/STEER/AliKalmanTrack.cxx b/STEER/AliKalmanTrack.cxx index 6bdc95e6d97..ee4400de1b1 100644 --- a/STEER/AliKalmanTrack.cxx +++ b/STEER/AliKalmanTrack.cxx @@ -89,65 +89,5 @@ void AliKalmanTrack::GetCovariance(Double_t cc[15]) const { cc[10]=fC40; cc[11]=fC41; cc[12]=fC42; cc[13]=fC43; cc[14]=fC44; } -//____________________________________________________________________________ -void AliKalmanTrack::Streamer(TBuffer &R__b) -{ - //----------------------------------------------------- - // This is AliKalmanTrack streamer. - //----------------------------------------------------- - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - TObject::Streamer(R__b); - R__b >> fLab; - R__b >> fP0; - R__b >> fP1; - R__b >> fP2; - R__b >> fP3; - R__b >> fP4; - R__b >> fC00; - R__b >> fC10; - R__b >> fC11; - R__b >> fC20; - R__b >> fC21; - R__b >> fC22; - R__b >> fC30; - R__b >> fC31; - R__b >> fC32; - R__b >> fC33; - R__b >> fC40; - R__b >> fC41; - R__b >> fC42; - R__b >> fC43; - R__b >> fC44; - R__b >> fChi2; - R__b >> fN; - } else { - R__b.WriteVersion(AliKalmanTrack::IsA()); - TObject::Streamer(R__b); - R__b << fLab; - R__b << fP0; - R__b << fP1; - R__b << fP2; - R__b << fP3; - R__b << fP4; - R__b << fC00; - R__b << fC10; - R__b << fC11; - R__b << fC20; - R__b << fC21; - R__b << fC22; - R__b << fC30; - R__b << fC31; - R__b << fC32; - R__b << fC33; - R__b << fC40; - R__b << fC41; - R__b << fC42; - R__b << fC43; - R__b << fC44; - R__b << fChi2; - R__b << fN; - } -} diff --git a/STEER/AliMCQA.cxx b/STEER/AliMCQA.cxx index bc19013e456..3a45753b743 100644 --- a/STEER/AliMCQA.cxx +++ b/STEER/AliMCQA.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2001/01/17 10:50:50 hristov +Corrections to destructors + Revision 1.3 2000/12/18 14:16:31 alibrary HP compatibility fix @@ -223,19 +226,55 @@ void AliMCQA::StepManager(Int_t id) // // Fill Global histograms first // - hist = (TH1F*) fQAHist->FindObject("hMCVcalls"); - hist->Fill(gMC->CurrentVolID(copy)); - hist = (TH1F*) fQAHist->FindObject("hMCMcalls"); - hist->Fill(id); + + + static TH1F* mcvcalls = (TH1F*) fQAHist->FindObject("hMCVcalls"); + mcvcalls->Fill(gMC->CurrentVolID(copy)); + static TH1F* mcmcalls = (TH1F*) fQAHist->FindObject("hMCMcalls"); + mcmcalls->Fill(id); + // // Now the step manager histograms // if(fOldId != id) { - TLorentzVector p, x; + static Double_t mpi0=0; + static Double_t mpip=0; + static Double_t mpim=0; + static Double_t mep=0; + static Double_t mem=0; + Double_t mass=0; + Int_t num = gMC->TrackPid(); + + switch (num) { + case 111: + if (mpi0==0) mpi0=gAlice->PDGDB()->GetParticle(num)->Mass(); + mass=mpi0; + break; + case 211: + if (mpip==0) mpip=gAlice->PDGDB()->GetParticle(num)->Mass(); + mass=mpip; + break; + case -211: + if (mpim==0) mpim=gAlice->PDGDB()->GetParticle(num)->Mass(); + mass=mpim; + break; + case 11: + if (mep==0) mep=gAlice->PDGDB()->GetParticle(num)->Mass(); + mass=mep; + break; + case -11: + if (mem==0) mem=gAlice->PDGDB()->GetParticle(num)->Mass(); + mass=mem; + break; + default: + mass =gAlice->PDGDB()->GetParticle(num)->Mass(); + break; + } + + static TLorentzVector p, x; gMC->TrackMomentum(p); gMC->TrackPosition(x); - Double_t energy = TMath::Max( - p[3]-gAlice->PDGDB()->GetParticle(gMC->TrackPid())->Mass(),1.e-12); + Double_t energy = TMath::Max(p[3]-mass,1.e-12); if(fOldId > -1) { if(!fDetDone[fOldId] && !gMC->IsNewTrack()) { TList *histold = (TList*) (*fQAList)[fOldId]; diff --git a/STEER/AliModule.cxx b/STEER/AliModule.cxx index e09477e3624..d1032410cec 100644 --- a/STEER/AliModule.cxx +++ b/STEER/AliModule.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.13 2000/11/30 07:12:49 alibrary +Introducing new Rndm and QA classes + Revision 1.12 2000/10/02 21:28:14 fca Removal of useless dependecies via forward declarations @@ -630,36 +633,4 @@ void AliModule::ReadEuclidMedia(const char* filnam) Warning("ReadEuclidMedia","reading error or premature end of file\n"); } -//_____________________________________________________________________________ -void AliModule::Streamer(TBuffer &R__b) -{ - // - // Stream an object of class Module. - // - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - TNamed::Streamer(R__b); - TAttLine::Streamer(R__b); - TAttMarker::Streamer(R__b); - fEuclidMaterial.Streamer(R__b); - fEuclidGeometry.Streamer(R__b); - R__b >> fActive; - R__b >> fHistograms; - // - // Stream the pointers but not the TClonesArrays - R__b >> fNodes; // diff - } else { - R__b.WriteVersion(AliModule::IsA()); - TNamed::Streamer(R__b); - TAttLine::Streamer(R__b); - TAttMarker::Streamer(R__b); - fEuclidMaterial.Streamer(R__b); - fEuclidGeometry.Streamer(R__b); - R__b << fActive; - R__b << fHistograms; - // - // Stream the pointers but not the TClonesArrays - R__b << fNodes; // diff - } -} diff --git a/STEER/AliModule.h b/STEER/AliModule.h index a66e53d95b4..71a40d64a3b 100644 --- a/STEER/AliModule.h +++ b/STEER/AliModule.h @@ -14,6 +14,7 @@ class TClonesArray; class TBrowser; class TArrayI; +class TFile; class AliModule : public TNamed , public TAttLine, public TAttMarker, public AliRndm { @@ -71,6 +72,10 @@ public: Error("AddDigit","Digits cannot be added to module %s\n",fName.Data());} virtual void AddHit(Int_t, Int_t*, Float_t *) { Error("AddDigit","Hits cannot be added to module %s\n",fName.Data());} + virtual void Hits2SDigits() {} + virtual void SDigits2Digits() {} + virtual void Digits2Raw() {} + virtual void Raw2Digits() {} virtual void Browse(TBrowser *) {} virtual void CreateGeometry() {} virtual void CreateMaterials() {} @@ -87,9 +92,10 @@ public: //virtual void Hits2Digits() {} virtual void Init() {} virtual void LoadPoints(Int_t ) {} - virtual void MakeBranch(Option_t *) {} + virtual void MakeBranch(Option_t *, char *file=0 ) {} virtual void Paint(Option_t *) {} virtual void ResetDigits() {} + virtual void ResetSDigits() {} virtual void ResetHits() {} virtual void ResetPoints() {} virtual void SetTreeAddress() {} @@ -108,13 +114,13 @@ public: protected: // Data members - TString fEuclidMaterial; //Name of the Euclid file for materials (if any) - TString fEuclidGeometry; //Name of the Euclid file for geometry (if any) + TString fEuclidMaterial; //!Name of the Euclid file for materials (if any) + TString fEuclidGeometry; //!Name of the Euclid file for geometry (if any) - TArrayI *fIdtmed; //List of tracking medium numbers - TArrayI *fIdmate; //List of material numbers - Int_t fLoMedium; //Minimum tracking medium ID for this Module - Int_t fHiMedium; //Maximum tracking medium ID for this Module + TArrayI *fIdtmed; //!List of tracking medium numbers + TArrayI *fIdmate; //!List of material numbers + Int_t fLoMedium; //!Minimum tracking medium ID for this Module + Int_t fHiMedium; //!Maximum tracking medium ID for this Module Bool_t fActive; //Detector activity flag TList *fHistograms; //List of histograms diff --git a/STEER/AliPoints.cxx b/STEER/AliPoints.cxx index 4b97767cc8b..54838004f61 100644 --- a/STEER/AliPoints.cxx +++ b/STEER/AliPoints.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.6 2000/10/02 21:28:14 fca +Removal of useless dependecies via forward declarations + Revision 1.5 2000/07/11 18:24:59 fca Coding convention corrections + few minor bug fixes @@ -181,10 +184,8 @@ TParticle *AliPoints::GetParticle() const // // Returns pointer to particle index in AliRun::fParticles // - TClonesArray *particles = gAlice->Particles(); - Int_t nparticles = particles->GetEntriesFast(); - if (fIndex < 0 || fIndex >= nparticles) return 0; - return (TParticle*)particles->UncheckedAt(fIndex); + if (fIndex < 0 || fIndex >= gAlice->GetNtrack()) return 0; + else return gAlice->Particle(fIndex); } //_____________________________________________________________________________ diff --git a/STEER/AliRun.cxx b/STEER/AliRun.cxx index 3ad03baf5fe..e2ed42ae582 100644 --- a/STEER/AliRun.cxx +++ b/STEER/AliRun.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.48 2001/01/17 10:50:50 hristov +Corrections to destructors + Revision 1.47 2000/12/18 10:44:01 morsch Possibility to set field map by passing pointer to objet of type AliMagF via SetField(). @@ -134,6 +137,7 @@ Introduction of the Copyright and cvs Log #include #include #include +#include #include #include @@ -186,6 +190,7 @@ AliRun::AliRun() fTreeH = 0; fTreeE = 0; fTreeR = 0; + fTreeS = 0; fParticles = 0; fGeometry = 0; fDisplay = 0; @@ -203,6 +208,9 @@ AliRun::AliRun() fRandom = 0; fMCQA = 0; fTransParName = "\0"; + fBaseFileName = "\0"; + fParticleBuffer = 0; + fParticleMap = new TObjArray(10000); } //_____________________________________________________________________________ @@ -223,6 +231,7 @@ AliRun::AliRun(const char *name, const char *title) fTreeH = 0; fTreeE = 0; fTreeR = 0; + fTreeS = 0; fTrRmax = 1.e10; fTrZmax = 1.e10; fGenerator = 0; @@ -233,6 +242,10 @@ AliRun::AliRun(const char *name, const char *title) // Set random number generator gRandom = fRandom = new TRandom3(); + + if (gSystem->Getenv("CONFIG_SEED")) { + gRandom->SetSeed((UInt_t)atoi(gSystem->Getenv("CONFIG_SEED"))); + } gROOT->GetListOfBrowsables()->Add(this,name); // @@ -252,7 +265,7 @@ AliRun::AliRun(const char *name, const char *title) fEvent = 0; // // Create the particle stack - fParticles = new TClonesArray("TParticle",100); + fParticles = new TClonesArray("TParticle",1000); fDisplay = 0; // @@ -272,6 +285,9 @@ AliRun::AliRun(const char *name, const char *title) fHitLists = new TList(); // SetTransPar(); + fBaseFileName = "\0"; + fParticleBuffer = 0; + fParticleMap = new TObjArray(10000); } @@ -279,7 +295,7 @@ AliRun::AliRun(const char *name, const char *title) AliRun::~AliRun() { // - // Defaullt AliRun destructor + // Default AliRun destructor // delete fImedia; delete fField; @@ -293,6 +309,7 @@ AliRun::~AliRun() delete fTreeH; delete fTreeE; delete fTreeR; + delete fTreeS; if (fModules) { fModules->Delete(); delete fModules; @@ -339,6 +356,7 @@ void AliRun::Browse(TBrowser *b) if (fTreeD) b->Add(fTreeD,fTreeD->GetName()); if (fTreeE) b->Add(fTreeE,fTreeE->GetName()); if (fTreeR) b->Add(fTreeR,fTreeR->GetName()); + if (fTreeS) b->Add(fTreeS,fTreeS->GetName()); TIter next(fModules); AliModule *detector; @@ -392,12 +410,12 @@ void AliRun::CleanParents() // Clean Particles stack. // Set parent/daughter relations // - TClonesArray &particles = *(gAlice->Particles()); + TObjArray &particles = *fParticleMap; TParticle *part; int i; - for(i=0; iTestBit(kDaughtersBit)) { + for(i=0; iTestBit(kDaughtersBit)) { part->SetFirstDaughter(-1); part->SetLastDaughter(-1); } @@ -420,8 +438,7 @@ void AliRun::DumpPart (Int_t i) const // // Dumps particle i in the stack // - TClonesArray &particles = *fParticles; - ((TParticle*) particles[i])->Print(); + ((TParticle*) (*fParticleMap)[i])->Print(); } //_____________________________________________________________________________ @@ -430,7 +447,7 @@ void AliRun::DumpPStack () const // // Dumps the particle stack // - TClonesArray &particles = *fParticles; + TObjArray &particles = *fParticleMap; printf( "\n\n=======================================================================\n"); for (Int_t i=0;iFill(); - if (fTreeH) fTreeH->Fill(); - if (fTreeD) fTreeD->Fill(); - if (fTreeR) fTreeR->Fill(); -} //_____________________________________________________________________________ void AliRun::PreTrack() @@ -566,7 +571,14 @@ void AliRun::FinishEvent() // Write out the kinematics if (fTreeK) { CleanParents(); - fTreeK->Fill(); + // fTreeK->Fill(); + TObject *part; + for(i=0; iAt(i))) { + fParticleBuffer = (TParticle*) part; + fParticleFileMap[i]= (Int_t) fTreeK->GetEntries(); + fTreeK->Fill(); + (*fParticleMap)[i]=0; + } else printf("Why = 0 part # %d?\n",i); } // Write out the digits @@ -574,7 +586,12 @@ void AliRun::FinishEvent() fTreeD->Fill(); ResetDigits(); } - + + if (fTreeS) { + fTreeS->Fill(); + ResetSDigits(); + } + // Write out reconstructed clusters if (fTreeR) { fTreeR->Fill(); @@ -587,17 +604,12 @@ void AliRun::FinishEvent() ResetStack(); // Write Tree headers - // Int_t ievent = fHeader.GetEvent(); - // char hname[30]; - // sprintf(hname,"TreeK%d",ievent); if (fTreeK) fTreeK->Write(0,TObject::kOverwrite); - // sprintf(hname,"TreeH%d",ievent); if (fTreeH) fTreeH->Write(0,TObject::kOverwrite); - // sprintf(hname,"TreeD%d",ievent); if (fTreeD) fTreeD->Write(0,TObject::kOverwrite); - // sprintf(hname,"TreeR%d",ievent); if (fTreeR) fTreeR->Write(0,TObject::kOverwrite); - + if (fTreeS) fTreeS->Write(0,TObject::kOverwrite); + ++fEvent; } @@ -620,20 +632,16 @@ void AliRun::FinishRun() //Output energy summary tables EnergySummary(); - - // file is retrieved from whatever tree - TFile *file = 0; - if (fTreeK) file = fTreeK->GetCurrentFile(); - if ((!file) && (fTreeH)) file = fTreeH->GetCurrentFile(); - if ((!file) && (fTreeD)) file = fTreeD->GetCurrentFile(); - if ((!file) && (fTreeE)) file = fTreeE->GetCurrentFile(); - if( NULL==file ) { - Error("FinishRun","There isn't root file!"); - exit(1); - } + + TFile *file = fTreeE->GetCurrentFile(); + file->cd(); + fTreeE->Write(0,TObject::kOverwrite); + // Write AliRun info and all detectors parameters + Write(); + // Clean tree information if (fTreeK) { delete fTreeK; fTreeK = 0; @@ -650,10 +658,7 @@ void AliRun::FinishRun() if (fTreeE) { delete fTreeE; fTreeE = 0; } - - // Write AliRun info and all detectors parameters - Write(); - + // Close output file file->Write(); } @@ -669,7 +674,7 @@ void AliRun::FlagTrack(Int_t track) curr=track; while(1) { - particle=(TParticle*)fParticles->UncheckedAt(curr); + particle=(TParticle*)fParticleMap->At(curr); // If the particle is flagged the three from here upward is saved already if(particle->TestBit(kKeepBit)) return; @@ -787,27 +792,42 @@ Int_t AliRun::GetEvent(Int_t event) // // Reset existing structures - ResetStack(); + // ResetStack(); ResetHits(); ResetDigits(); + ResetSDigits(); // Delete Trees already connected if (fTreeK) delete fTreeK; if (fTreeH) delete fTreeH; if (fTreeD) delete fTreeD; if (fTreeR) delete fTreeR; + if (fTreeS) delete fTreeS; // Get header from file if(fTreeE) fTreeE->GetEntry(event); else Error("GetEvent","Cannot file Header Tree\n"); + TFile *file = fTreeE->GetCurrentFile(); + + file->cd(); // Get Kine Tree from file char treeName[20]; sprintf(treeName,"TreeK%d",event); fTreeK = (TTree*)gDirectory->Get(treeName); - if (fTreeK) fTreeK->SetBranchAddress("Particles", &fParticles); + if (fTreeK) fTreeK->SetBranchAddress("Particles", &fParticleBuffer); else Error("GetEvent","cannot find Kine Tree for event:%d\n",event); + // Create the particle stack + if(!fParticles) fParticles = new TClonesArray("TParticle",1000); + // Build the pointer list + if(fParticleMap) { + fParticleMap->Clear(); + fParticleMap->Expand(fTreeK->GetEntries()); + } else + fParticleMap = new TObjArray(fTreeK->GetEntries()); + file->cd(); + // Get Hits Tree header from file sprintf(treeName,"TreeH%d",event); fTreeH = (TTree*)gDirectory->Get(treeName); @@ -815,13 +835,16 @@ Int_t AliRun::GetEvent(Int_t event) Error("GetEvent","cannot find Hits Tree for event:%d\n",event); } + file->cd(); + // Get Digits Tree header from file sprintf(treeName,"TreeD%d",event); fTreeD = (TTree*)gDirectory->Get(treeName); if (!fTreeD) { - Warning("GetEvent","cannot find Digits Tree for event:%d\n",event); + // Warning("GetEvent","cannot find Digits Tree for event:%d\n",event); } + file->cd(); // Get Reconstruct Tree header from file sprintf(treeName,"TreeR%d",event); @@ -829,6 +852,8 @@ Int_t AliRun::GetEvent(Int_t event) if (!fTreeR) { // printf("WARNING: cannot find Reconstructed Tree for event:%d\n",event); } + + file->cd(); // Set Trees branch addresses TIter next(fModules); @@ -837,8 +862,7 @@ Int_t AliRun::GetEvent(Int_t event) detector->SetTreeAddress(); } - if (fTreeK) fTreeK->GetEvent(0); - fNtrack = Int_t (fParticles->GetEntries()); + fNtrack = Int_t (fTreeK->GetEntries()); return fNtrack; } @@ -884,10 +908,10 @@ void AliRun::GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom, fCurrent=-1; TParticle *track; for(Int_t i=fNtrack-1; i>=0; i--) { - track=(TParticle*) fParticles->UncheckedAt(i); - if(!track->TestBit(kDoneBit)) { + track=(TParticle*) fParticleMap->At(i); + if(track) if(!track->TestBit(kDoneBit)) { // - // The track has not yet been processed + // The track exists and has not yet been processed fCurrent=i; ipart=track->GetPdgCode(); pmom[0]=track->Px(); @@ -913,7 +937,7 @@ void AliRun::GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom, if (fCurrent >= nprimaries) return; if (fCurrent < nprimaries-1) { fTimer.Stop(); - track=(TParticle*) fParticles->UncheckedAt(fCurrent+1); + track=(TParticle*) fParticleMap->At(fCurrent+1); // track->SetProcessTime(fTimer.CpuTime()); } fTimer.Start(); @@ -931,7 +955,7 @@ Int_t AliRun::GetPrimary(Int_t track) const parent=track; while (1) { current=parent; - part = (TParticle *)fParticles->UncheckedAt(current); + part = (TParticle *)fParticleMap->At(current); parent=part->GetFirstMother(); if(parent<0) return current; } @@ -948,10 +972,13 @@ void AliRun::InitMC(const char *setup) Warning("Init","Cannot initialise AliRun twice!\n"); return; } - + + OpenBaseFile("recreate"); + gROOT->LoadMacro(setup); gInterpreter->ProcessLine(fConfigFunction.Data()); + gMC->DefineParticles(); //Create standard MC particles TObject *objfirst, *objlast; @@ -1091,6 +1118,27 @@ void AliRun::SetTransPar(char *filename) fTransParName = filename; } +//____________________________________________________________________________ +void AliRun::SetBaseFile(char *filename) +{ + fBaseFileName = *filename; +} + +//____________________________________________________________________________ +void AliRun::OpenBaseFile(const char *option) +{ + if(!strlen(fBaseFileName.Data())) { + const char *filename; + if ((filename=gSystem->Getenv("CONFIG_FILE"))) { + fBaseFileName=filename; + } else { + fBaseFileName="galice.root"; + } + } + TFile *rootfile = new TFile(fBaseFileName.Data(),option); + rootfile->SetCompressionLevel(2); +} + //____________________________________________________________________________ void AliRun::ReadTransPar() { @@ -1198,7 +1246,46 @@ void AliRun::ReadTransPar() } //_____________________________________________________________________________ -void AliRun::MakeTree(Option_t *option) +void AliRun::MakeBranchInTree(TTree *tree, const char* name, void* address, Int_t size, char *file) +{ + if (GetDebug()>1) + printf("* MakeBranch * Making Branch %s \n",name); + + TBranch *branch = tree->Branch(name,address,size); + + if (file) { + TDirectory *cwd = gDirectory; + branch->SetFile(file); + TIter next( branch->GetListOfBranches()); + while ((branch=(TBranch*)next())) { + branch->SetFile(file); + } + if (GetDebug()>1) + printf("* MakeBranch * Diverting Branch %s to file %s\n",name,file); + cwd->cd(); + } +} + +//_____________________________________________________________________________ +void AliRun::MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address, Int_t size, Int_t splitlevel, char *file) +{ + TDirectory *cwd = gDirectory; + TBranch *branch = tree->Branch(name,classname,address,size,splitlevel); + if (GetDebug()>1) + printf("* MakeBranch * Making Branch %s \n",name); + if (file) { + branch->SetFile(file); + TIter next( branch->GetListOfBranches()); + while ((branch=(TBranch*)next())) { + branch->SetFile(file); + } + if (GetDebug()>1) + printf("* MakeBranch * Diverting Branch %s to file %s\n",name,file); + cwd->cd(); + } +} +//_____________________________________________________________________________ +void AliRun::MakeTree(Option_t *option, char *file) { // // Create the ROOT trees @@ -1213,12 +1300,15 @@ void AliRun::MakeTree(Option_t *option) char *oE = strstr(option,"E"); char *oD = strstr(option,"D"); char *oR = strstr(option,"R"); + char *oS = strstr(option,"S"); // + if (oK && !fTreeK) { sprintf(hname,"TreeK%d",fEvent); fTreeK = new TTree(hname,"Kinematics"); // Create a branch for particles - fTreeK->Branch("Particles",&fParticles,4000); + MakeBranchInTree(fTreeK, + "Particles", "TParticle", &fParticleBuffer, 4000, 1, file) ; fTreeK->Write(); } if (oH && !fTreeH) { @@ -1232,6 +1322,11 @@ void AliRun::MakeTree(Option_t *option) fTreeD = new TTree(hname,"Digits"); fTreeD->Write(); } + if (oS && !fTreeS) { + sprintf(hname,"TreeS%d",fEvent); + fTreeS = new TTree(hname,"SDigits"); + fTreeS->Write(); + } if (oR && !fTreeR) { sprintf(hname,"TreeR%d",fEvent); fTreeR = new TTree(hname,"Reconstruction"); @@ -1240,9 +1335,11 @@ void AliRun::MakeTree(Option_t *option) if (oE && !fTreeE) { fTreeE = new TTree("TE","Header"); // Create a branch for Header - fTreeE->Branch("Header","AliHeader",&gAliHeader,4000); + MakeBranchInTree(fTreeE, + "Header", "AliHeader", &gAliHeader, 4000, 1, file) ; fTreeE->Write(); } + // // Create a branch for hits/digits for each detector // Each branch is a TClonesArray. Each data member of the Hits classes @@ -1250,7 +1347,7 @@ void AliRun::MakeTree(Option_t *option) TIter next(fModules); AliModule *detector; while((detector = (AliModule*)next())) { - if (oH || oD || oR) detector->MakeBranch(option); + if (oH || oR) detector->MakeBranch(option,file); } } @@ -1266,6 +1363,18 @@ Int_t AliRun::PurifyKine(Int_t lastSavedTrack, Int_t nofTracks) return fHgwmk; } +//_____________________________________________________________________________ +TParticle* AliRun::Particle(Int_t i) +{ + if(!(*fParticleMap)[i]) { + Int_t nentries = fParticles->GetEntries(); + fTreeK->GetEntry(fParticleFileMap[i]); + new ((*fParticles)[nentries]) TParticle(*fParticleBuffer); + fParticleMap->AddAt((*fParticles)[nentries],i); + } + return (TParticle *) (*fParticleMap)[i]; +} + //_____________________________________________________________________________ void AliRun::PurifyKine() { @@ -1273,59 +1382,67 @@ void AliRun::PurifyKine() // Compress kinematic tree keeping only flagged particles // and renaming the particle id's in all the hits // - TClonesArray &particles = *fParticles; + // TClonesArray &particles = *fParticles; + TObjArray &particles = *fParticleMap; int nkeep=fHgwmk+1, parent, i; - TParticle *part, *partnew, *father; - int *map = new int[particles.GetEntries()]; + TParticle *part, *father; + TArrayI map(particles.GetLast()+1); // Save in Header total number of tracks before compression fHeader.SetNtrack(fHeader.GetNtrack()+fNtrack-fHgwmk); + // If no tracks generated return now + if(fHgwmk+1 == fNtrack) return; + + Int_t toshrink = fNtrack-fHgwmk-1; + // First pass, invalid Daughter information for(i=0; iResetBit(kDaughtersBit); + if(i<=fHgwmk) map[i]=i ; + else { + map[i] = -99; + // particles.UncheckedAt(i)->ResetBit(kDaughtersBit); + if((part=(TParticle*) particles.At(i))) part->ResetBit(kDaughtersBit); + } } + // Invalid daughter information for the parent of the first particle + // generated. This may or may not be the current primary according to + // whether decays have been recorded among the primaries + part = (TParticle *)particles.At(fHgwmk+1); + particles.At(part->GetFirstMother())->ResetBit(kDaughtersBit); // Second pass, build map between old and new numbering for(i=fHgwmk+1; iTestBit(kKeepBit)) { + if(particles.At(i)->TestBit(kKeepBit)) { // This particle has to be kept map[i]=nkeep; - if(i!=nkeep) { - - // Old and new are different, have to copy - partnew = (TParticle *)particles.UncheckedAt(nkeep); - // Change due to a bug in the HP compiler - // *partnew = *part; - memcpy(partnew,part,sizeof(TParticle)); - } else partnew = part; + // If old and new are different, have to move the pointer + if(i!=nkeep) particles[nkeep]=particles.At(i); + part = (TParticle*) particles.At(nkeep); // as the parent is always *before*, it must be already // in place. This is what we are checking anyway! - if((parent=partnew->GetFirstMother())>fHgwmk) { - if(map[parent]==-99) printf("map[%d] = -99!\n",parent); - partnew->SetFirstMother(map[parent]); - } + if((parent=part->GetFirstMother())>fHgwmk) + if(map[parent]==-99) Fatal("PurifyKine","map[%d] = -99!\n",parent); + else part->SetFirstMother(map[parent]); + nkeep++; } } - fNtrack=nkeep; // Fix daughters information - for (i=0; iGetFirstMother(); if(parent>=0) { - father = (TParticle *)particles.UncheckedAt(parent); + father = (TParticle *)particles.At(parent); if(father->TestBit(kDaughtersBit)) { if(iGetFirstDaughter()) father->SetFirstDaughter(i); if(i>father->GetLastDaughter()) father->SetLastDaughter(i); } else { - // Iitialise daughters info for first pass + // Initialise daughters info for first pass father->SetFirstDaughter(i); father->SetLastDaughter(i); father->SetBit(kDaughtersBit); @@ -1333,24 +1450,6 @@ void AliRun::PurifyKine() } } -#ifdef old - // Now loop on all detectors and reset the hits - AliHit *OneHit; - TIter next(fModules); - AliModule *detector; - while((detector = (AliModule*)next())) { - if (!detector->Hits()) continue; - TClonesArray &vHits=*(detector->Hits()); - if(vHits.GetEntries() != detector->GetNhits()) - printf("vHits.GetEntries()!=detector->GetNhits(): %d != %d\n", - vHits.GetEntries(),detector->GetNhits()); - for (i=0; iGetNhits(); i++) { - OneHit = (AliHit *)vHits.UncheckedAt(i); - OneHit->SetTrack(map[OneHit->GetTrack()]); - } - } -#else - // Now loop on all registered hit lists TIter next(fHitLists); TCollection *hitList; @@ -1361,7 +1460,6 @@ void AliRun::PurifyKine() hit->SetTrack(map[hit->GetTrack()]); } } -#endif // // This for detectors which have a special mapping mechanism @@ -1371,13 +1469,28 @@ void AliRun::PurifyKine() TIter nextmod(fModules); AliModule *detector; while((detector = (AliModule*)nextmod())) { - detector->RemapTrackHitIDs(map); + detector->RemapTrackHitIDs(map.GetArray()); } + // Now the output bit, from fHgwmk to nkeep we write everything and we erase + if(nkeep>fParticleFileMap.GetSize()) fParticleFileMap.Set(Int_t (nkeep*1.5)); + - fHgwmk=nkeep-1; - particles.SetLast(fHgwmk); - delete [] map; + for (i=fHgwmk+1; iGetEntries(); + fTreeK->Fill(); + particles[i]=0; + } + + for (i=nkeep; iRemoveAt(i); + + fNtrack=nkeep; + fHgwmk=nkeep-1; + // delete [] map; } //_____________________________________________________________________________ @@ -1399,6 +1512,7 @@ void AliRun::BeginEvent() ResetStack(); ResetHits(); ResetDigits(); + ResetSDigits(); // Initialise event header fHeader.Reset(fRun,fEvent); @@ -1418,13 +1532,17 @@ void AliRun::BeginEvent() sprintf(hname,"TreeD%d",fEvent); fTreeD->SetName(hname); } + if(fTreeS) { + fTreeS->Reset(); + sprintf(hname,"TreeS%d",fEvent); + fTreeS->SetName(hname); + } if(fTreeR) { fTreeR->Reset(); sprintf(hname,"TreeR%d",fEvent); fTreeR->SetName(hname); } } - //_____________________________________________________________________________ void AliRun::ResetDigits() { @@ -1438,6 +1556,19 @@ void AliRun::ResetDigits() } } +//_____________________________________________________________________________ +void AliRun::ResetSDigits() +{ + // + // Reset all Detectors digits + // + TIter next(fModules); + AliModule *detector; + while((detector = (AliModule*)next())) { + detector->ResetSDigits(); + } +} + //_____________________________________________________________________________ void AliRun::ResetHits() { @@ -1479,7 +1610,15 @@ void AliRun::RunMC(Int_t nevent, const char *setup) if (!fInitDone) InitMC(setup); // Create the Root Tree with one branch per detector - MakeTree("KHDER"); + + if (gSystem->Getenv("CONFIG_SPLIT_FILE")) { + MakeTree("E"); + MakeTree("K","Kine.root"); + MakeTree("H","Hits.root"); + MakeTree("R","Reco.root"); + } else { + MakeTree("EKHR"); + } gMC->ProcessRun(nevent); @@ -1487,6 +1626,94 @@ void AliRun::RunMC(Int_t nevent, const char *setup) if(nevent>0) FinishRun(); } +//_____________________________________________________________________________ + +void AliRun::Hits2Digits(const char *selected) +{ + Hits2SDigits(selected); + SDigits2Digits(selected); +} + +//_____________________________________________________________________________ + +void AliRun::Hits2SDigits(const char *selected) +{ + // + // Main function to be called to convert hits to digits. + + gAlice->GetEvent(0); + + TObjArray *detectors = gAlice->Detectors(); + + TIter next(detectors); + + AliDetector *detector; + + TDirectory *cwd = gDirectory; + + MakeTree("S"); + + while((detector = (AliDetector*)next())) { + if (selected) { + if (strcmp(detector->GetName(),selected)) continue; + } + if (detector->IsActive()){ + if (gSystem->Getenv("CONFIG_SPLIT_FILE")) { + if (GetDebug()>0) + cout << "Processing " << detector->GetName() << "..." << endl; + char * outFile = new char[strlen (detector->GetName())+18]; + sprintf(outFile,"SDigits.%s.root",detector->GetName()); + detector->MakeBranch("S",outFile); + delete outFile; + } else { + detector->MakeBranch("S"); + } + cwd->cd(); + detector->Hits2SDigits(); + } + } +} + +//_____________________________________________________________________________ + +void AliRun::SDigits2Digits(const char *selected) +{ + // + // Main function to be called to convert hits to digits. + + gAlice->GetEvent(0); + + TObjArray *detectors = gAlice->Detectors(); + + TIter next(detectors); + + AliDetector *detector; + + TDirectory *cwd = gDirectory; + + MakeTree("D"); + + while((detector = (AliDetector*)next())) { + if (selected) { + if (strcmp(detector->GetName(),selected)) continue; + } + if (detector->IsActive()){ + if (gSystem->Getenv("CONFIG_SPLIT_FILE")) { + if (GetDebug()>0) + cout << "Processing " << detector->GetName() << "..." << endl; + char * outFile = new char[strlen (detector->GetName())+16]; + sprintf(outFile,"Digits.%s.root",detector->GetName()); + detector->MakeBranch("D",outFile); + delete outFile; + } else { + detector->MakeBranch("D"); + } + cwd->cd(); + detector->SDigits2Digits(); + } + } +} + //_____________________________________________________________________________ void AliRun::RunLego(const char *setup, Int_t nc1, Float_t c1min, Float_t c1max,Int_t nc2,Float_t c2min,Float_t c2max, @@ -1626,19 +1853,21 @@ void AliRun::SetTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom, //printf("Loading particle %s mass %f ene %f No %d ip %d pos %f %f %f mom %f %f %f kS %d m %s\n", //pname,mass,e,fNtrack,pdg,vpos[0],vpos[1],vpos[2],pmom[0],pmom[1],pmom[2],kS,mecha); - - particle=new(particles[fNtrack]) TParticle(pdg,kS,parent,-1,kfirstdaughter, + + particle=new(particles[fLoadPoint++]) TParticle(pdg,kS,parent,-1,kfirstdaughter, klastdaughter,pmom[0],pmom[1],pmom[2], e,vpos[0],vpos[1],vpos[2],tof); - ((TParticle*)particles[fNtrack])->SetPolarisation(TVector3(polar[0],polar[1],polar[2])); - ((TParticle*)particles[fNtrack])->SetWeight(weight); + particle->SetPolarisation(TVector3(polar[0],polar[1],polar[2])); + particle->SetWeight(weight); particle->SetUniqueID(mech); if(!done) particle->SetBit(kDoneBit); - //Declare that the daughter information is valid - ((TParticle*)particles[fNtrack])->SetBit(kDaughtersBit); - + // Declare that the daughter information is valid + particle->SetBit(kDaughtersBit); + // Add the particle to the stack + fParticleMap->AddAtAndExpand(particle,fNtrack); + if(parent>=0) { - particle=(TParticle*) fParticles->UncheckedAt(parent); + particle=(TParticle*) fParticleMap->At(parent); particle->SetLastDaughter(fNtrack); if(particle->GetFirstDaughter()<0) particle->SetFirstDaughter(fNtrack); } else { @@ -1659,8 +1888,7 @@ void AliRun::KeepTrack(const Int_t track) // // flags a track to be kept // - TClonesArray &particles = *fParticles; - ((TParticle*)particles[track])->SetBit(kKeepBit); + fParticleMap->At(track)->SetBit(kKeepBit); } //_____________________________________________________________________________ @@ -1691,67 +1919,23 @@ void AliRun::StepManager(Int_t id) //_____________________________________________________________________________ void AliRun::Streamer(TBuffer &R__b) { - // - // Stream an object of class AliRun. - // - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - TNamed::Streamer(R__b); - if (!gAlice) gAlice = this; - gROOT->GetListOfBrowsables()->Add(this,"Run"); - fTreeE = (TTree*)gDirectory->Get("TE"); - if (fTreeE) fTreeE->SetBranchAddress("Header", &gAliHeader); - else Error("Streamer","cannot find Header Tree\n"); - R__b >> fNtrack; - R__b >> fHgwmk; - R__b >> fDebug; - fHeader.Streamer(R__b); - R__b >> fModules; - R__b >> fParticles; - R__b >> fField; - // R__b >> fMC; - R__b >> fNdets; - R__b >> fTrRmax; - R__b >> fTrZmax; - R__b >> fGenerator; - if(R__v>1) { - R__b >> fPDGDB; //Particle factory object! + // Stream an object of class AliRun. + + if (R__b.IsReading()) { + if (!gAlice) gAlice = this; + + AliRun::Class()->ReadBuffer(R__b, this); + // + gROOT->GetListOfBrowsables()->Add(this,"Run"); + + fTreeE = (TTree*)gDirectory->Get("TE"); + if (fTreeE) fTreeE->SetBranchAddress("Header", &gAliHeader); + else Error("Streamer","cannot find Header Tree\n"); fTreeE->GetEntry(0); - } else { - fHeader.SetEvent(0); - fPDGDB = TDatabasePDG::Instance(); //Particle factory object! - } - if(R__v>2) { - fConfigFunction.Streamer(R__b); - } else { - fConfigFunction="Config();"; - } - if(R__v>3) { - R__b >> fRandom; + gRandom = fRandom; - R__b >> fMCQA; - } else { - fRandom = gRandom = new TRandom3(); - fMCQA = new AliMCQA(); - } - } else { - R__b.WriteVersion(AliRun::IsA()); - TNamed::Streamer(R__b); - R__b << fNtrack; - R__b << fHgwmk; - R__b << fDebug; - fHeader.Streamer(R__b); - R__b << fModules; - R__b << fParticles; - R__b << fField; - // R__b << fMC; - R__b << fNdets; - R__b << fTrRmax; - R__b << fTrZmax; - R__b << fGenerator; - R__b << fPDGDB; //Particle factory object! - fConfigFunction.Streamer(R__b); - R__b << fRandom; - R__b << fMCQA; - } -} + } else { + AliRun::Class()->WriteBuffer(R__b, this); + } +} + diff --git a/STEER/AliRun.h b/STEER/AliRun.h index f24cbbfe40b..69b22581782 100644 --- a/STEER/AliRun.h +++ b/STEER/AliRun.h @@ -11,7 +11,7 @@ class TTree; class TGeometry; class TDatabasePDG; class TRandom; -class AliMCQA; +class TParticle; #include #include "TClonesArray.h" #include @@ -29,6 +29,7 @@ class AliLegoGenerator; class AliGenerator; class AliLegoGenerator; #include "AliMCProcess.h" +class AliMCQA; enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4}; @@ -56,7 +57,6 @@ public: virtual void DumpPart (Int_t i) const; virtual void DumpPStack () const; virtual AliMagF *Field() const {return fField;} - virtual void FillTree(); virtual void PreTrack(); virtual void PostTrack(); virtual void FinishPrimary(); @@ -85,21 +85,31 @@ public: Float_t &tof); Int_t GetNtrack() const {return fNtrack;} virtual Int_t GetPrimary(Int_t track) const; + virtual void Hits2Digits(const char *detector=0); + virtual void Hits2SDigits(const char *detector=0); + virtual void SDigits2Digits(const char *detector=0); virtual void InitMC(const char *setup="Config.C"); virtual void Init(const char *setup="Config.C") {InitMC(setup);} Bool_t IsFolder() const {return kTRUE;} virtual AliLego* Lego() const {return fLego;} - virtual void MakeTree(Option_t *option="KH"); - TClonesArray *Particles() {return fParticles;}; + virtual void MakeTree(Option_t *option="KH", char *file = 0); + virtual void MakeBranchInTree(TTree *tree, const char* cname, void* address, Int_t size=32000, char *file=0); + virtual void MakeBranchInTree(TTree *tree, const char* cname, const char* name, void* address, Int_t size=32000, Int_t splitlevel=1, char *file=0); + + TObjArray *Particles() {return fParticleMap;}; + TParticle *Particle(Int_t i); virtual void PurifyKine(); virtual Int_t PurifyKine(Int_t lastSavedTrack, Int_t nofTracks); virtual void BeginEvent(); virtual void ResetDigits(); + virtual void ResetSDigits(); virtual void ResetHits(); virtual void ResetPoints(); virtual void SetTransPar(char *filename="$(ALICE_ROOT)/data/galice.cuts"); + virtual void SetBaseFile(char *filename="galice.root"); + virtual void OpenBaseFile(const char *option); virtual void ReadTransPar(); - virtual void ResetStack() {fCurrent=-1;fHgwmk=0;fNtrack=0;fParticles->Clear();} + virtual void ResetStack() {fCurrent=-1;fHgwmk=fNtrack=fLoadPoint=0;fParticles->Clear();} virtual void RunMC(Int_t nevent=1, const char *setup="Config.C"); virtual void Run(Int_t nevent=1, const char *setup="Config.C") {RunMC(nevent,setup);} @@ -131,47 +141,54 @@ public: TTree *TreeD() {return fTreeD;} + TTree *TreeS() {return fTreeS;} TTree *TreeE() {return fTreeE;} TTree *TreeH() {return fTreeH;} TTree *TreeK() {return fTreeK;} TTree *TreeR() {return fTreeR;} protected: - Int_t fRun; //Current run number - Int_t fEvent; //Current event number (from 1) - Int_t fNtrack; //Number of tracks - Int_t fHgwmk; //Last track purified - Int_t fCurrent; //Last track returned from the stack - Int_t fDebug; //Debug flag - AliHeader fHeader; //Header information - TTree *fTreeD; //Pointer to Tree for Digits - TTree *fTreeK; //Pointer to Tree for Kinematics - TTree *fTreeH; //Pointer to Tree for Hits - TTree *fTreeE; //Pointer to Tree for Header - TTree *fTreeR; //Pointer to Tree for Reconstructed Objects - TObjArray *fModules; //List of Detectors - TClonesArray *fParticles; //Pointer to list of particles - TGeometry *fGeometry; //Pointer to geometry - AliDisplay *fDisplay; //Pointer to event display - TStopwatch fTimer; //Timer object - AliMagF *fField; //Magnetic Field Map - AliMC *fMC; //pointer to MonteCarlo object - TArrayI *fImedia; //Array of correspondence between media and detectors - Int_t fNdets; //Number of detectors - Float_t fTrRmax; //Maximum radius for tracking - Float_t fTrZmax; //Maximu z for tracking - AliGenerator *fGenerator; //Generator used in the MC - Bool_t fInitDone; //true when initialisation done - AliLego *fLego; //pointer to aliLego object if it exists - TDatabasePDG *fPDGDB; //Particle factory object! - TList *fHitLists; //Lists of hits to be remapped by PurifyKine - TArrayF fEventEnergy; //Energy deposit for current event - TArrayF fSummEnergy; //Energy per event in each volume - TArrayF fSum2Energy; //Energy squared per event in each volume - TString fConfigFunction; //Configuration file to be executed - TRandom *fRandom; // Pointer to the random number generator - AliMCQA *fMCQA; //Pointer to MC Quality assurance class - TString fTransParName; // Name of the transport parameters file + Int_t fRun; //! Current run number + Int_t fEvent; //! Current event number (from 1) + Int_t fNtrack; // Number of tracks + Int_t fHgwmk; //! Last track purified + Int_t fLoadPoint; //! Next free position in the particle buffer + Int_t fCurrent; //! Last track returned from the stack + Int_t fDebug; // Debug flag + AliHeader fHeader; // Header information + TTree *fTreeD; //! Pointer to Tree for Digits + TTree *fTreeS; //! Pointer to Tree for SDigits + TTree *fTreeK; //! Pointer to Tree for Kinematics + TTree *fTreeH; //! Pointer to Tree for Hits + TTree *fTreeE; //! Pointer to Tree for Header + TTree *fTreeR; //! Pointer to Tree for Reconstructed Objects + TObjArray *fModules; // List of Detectors + TClonesArray *fParticles; //! Pointer to list of particles + TGeometry *fGeometry; // Pointer to geometry + AliDisplay *fDisplay; //! Pointer to event display + TStopwatch fTimer; // Timer object + AliMagF *fField; // Magnetic Field Map + AliMC *fMC; //! Pointer to MonteCarlo object + TArrayI *fImedia; //! Array of correspondence between media and detectors + Int_t fNdets; // Number of detectors + Float_t fTrRmax; // Maximum radius for tracking + Float_t fTrZmax; // Maximu z for tracking + AliGenerator *fGenerator; // Generator used in the MC + Bool_t fInitDone; //! True when initialisation done + AliLego *fLego; //! Pointer to aliLego object if it exists + TDatabasePDG *fPDGDB; // Particle factory object + TList *fHitLists; //! Lists of hits to be remapped by PurifyKine + TArrayF fEventEnergy; //! Energy deposit for current event + TArrayF fSummEnergy; //! Energy per event in each volume + TArrayF fSum2Energy; //! Energy squared per event in each volume + TString fConfigFunction; // Configuration file to be executed + TRandom *fRandom; // Pointer to the random number generator + AliMCQA *fMCQA; // Pointer to MC Quality assurance class + TString fTransParName; // Name of the transport parameters file + TString fBaseFileName; // Name of the base root file + TParticle *fParticleBuffer; //! Pointer to current particle for writing + TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray + TArrayI fParticleFileMap; // Map of particles in the file private: diff --git a/STEER/STEERLinkDef.h b/STEER/STEERLinkDef.h index 9e1443b1b74..6c95ec30f75 100644 --- a/STEER/STEERLinkDef.h +++ b/STEER/STEERLinkDef.h @@ -14,35 +14,35 @@ #pragma link C++ enum VertexSmear_t; #pragma link C++ enum PDG_t; -#pragma link C++ class AliGenerator; +#pragma link C++ class AliGenerator+; #pragma link C++ class AliRun-; -#pragma link C++ class AliModule-; -#pragma link C++ class AliDetector-; -#pragma link C++ class AliDigit; -#pragma link C++ class AliHit; -#pragma link C++ class AliHeader; -#pragma link C++ class AliDisplay; -#pragma link C++ class AliPoints; -#pragma link C++ class AliMagF; -#pragma link C++ class AliMagFC; -#pragma link C++ class AliMagFCM; -#pragma link C++ class AliMagFDM; -#pragma link C++ class AliMC; -#pragma link C++ class AliLego; -#pragma link C++ class AliLegoGenerator; -#pragma link C++ class AliLegoGeneratorXYZ; -#pragma link C++ class AliLegoGeneratorPhiZ; -#pragma link C++ class AliLegoGeneratorEta; -#pragma link C++ class AliDigitNew; -#pragma link C++ class AliGeometry; -#pragma link C++ class AliRecPoint; -#pragma link C++ class AliSegmentation; -#pragma link C++ class AliHitMap; -#pragma link C++ class AliCluster; -#pragma link C++ class AliKalmanTrack-; -#pragma link C++ class AliRndm; -#pragma link C++ class AliMCQA; -#pragma link C++ class AliPDG; +#pragma link C++ class AliModule+; +#pragma link C++ class AliDetector+; +#pragma link C++ class AliDigit+; +#pragma link C++ class AliHit+; +#pragma link C++ class AliHeader+; +#pragma link C++ class AliDisplay+; +#pragma link C++ class AliPoints+; +#pragma link C++ class AliMagF+; +#pragma link C++ class AliMagFC+; +#pragma link C++ class AliMagFCM+; +#pragma link C++ class AliMagFDM+; +#pragma link C++ class AliMC+; +#pragma link C++ class AliLego+; +#pragma link C++ class AliLegoGenerator+; +#pragma link C++ class AliLegoGeneratorXYZ+; +#pragma link C++ class AliLegoGeneratorPhiZ+; +#pragma link C++ class AliLegoGeneratorEta+; +#pragma link C++ class AliDigitNew+; +#pragma link C++ class AliGeometry+; +#pragma link C++ class AliRecPoint+; +#pragma link C++ class AliSegmentation+; +#pragma link C++ class AliHitMap+; +#pragma link C++ class AliCluster+; +#pragma link C++ class AliKalmanTrack+; +#pragma link C++ class AliRndm+; +#pragma link C++ class AliMCQA+; +#pragma link C++ class AliPDG+; #endif diff --git a/STRUCT/STRUCTLinkDef.h b/STRUCT/STRUCTLinkDef.h index 2bbc9e78bd7..3eaf1a53e56 100644 --- a/STRUCT/STRUCTLinkDef.h +++ b/STRUCT/STRUCTLinkDef.h @@ -8,23 +8,23 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class AliBODY; -#pragma link C++ class AliMAG; -#pragma link C++ class AliABSO; -#pragma link C++ class AliABSOv0; -#pragma link C++ class AliDIPO; -#pragma link C++ class AliDIPOv1; -#pragma link C++ class AliDIPOv2; -#pragma link C++ class AliFRAME; -#pragma link C++ class AliFRAMEv0; -#pragma link C++ class AliFRAMEv1; -#pragma link C++ class AliHALL; -#pragma link C++ class AliPIPE; -#pragma link C++ class AliPIPEv0; -#pragma link C++ class AliPIPEv1; -#pragma link C++ class AliPIPEv3; -#pragma link C++ class AliSHIL; -#pragma link C++ class AliSHILv0; -#pragma link C++ class AliALIFE; +#pragma link C++ class AliBODY+; +#pragma link C++ class AliMAG+; +#pragma link C++ class AliABSO+; +#pragma link C++ class AliABSOv0+; +#pragma link C++ class AliDIPO+; +#pragma link C++ class AliDIPOv1+; +#pragma link C++ class AliDIPOv2+; +#pragma link C++ class AliFRAME+; +#pragma link C++ class AliFRAMEv0+; +#pragma link C++ class AliFRAMEv1+; +#pragma link C++ class AliHALL+; +#pragma link C++ class AliPIPE+; +#pragma link C++ class AliPIPEv0+; +#pragma link C++ class AliPIPEv1+; +#pragma link C++ class AliPIPEv3+; +#pragma link C++ class AliSHIL+; +#pragma link C++ class AliSHILv0+; +#pragma link C++ class AliALIFE+; #endif diff --git a/TGeant3/TGeant3LinkDef.h b/TGeant3/TGeant3LinkDef.h index 6360455867e..26c96f37d2a 100644 --- a/TGeant3/TGeant3LinkDef.h +++ b/TGeant3/TGeant3LinkDef.h @@ -8,10 +8,10 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class AliGeant3; +#pragma link C++ class AliGeant3+; #pragma link C++ class TGeant3-; -#pragma link C++ class THIGZ; -#pragma link C++ class TPaveTree; +#pragma link C++ class THIGZ+; +#pragma link C++ class TPaveTree+; #pragma link C++ class AliGuiGeomMain-; #pragma link C++ class AliDrawVolume-; #pragma link C++ class AliGeant3GeometryGUI-; @@ -19,30 +19,30 @@ #pragma link C++ class AliGUIMedium-; -#pragma link C++ class Quest_t; -#pragma link C++ class Gcbank_t; -#pragma link C++ class Gclink_t; -#pragma link C++ class Gcflag_t; -#pragma link C++ class Gckine_t; -#pragma link C++ class Gcking_t; -#pragma link C++ class Gckin2_t; -#pragma link C++ class Gckin3_t; -#pragma link C++ class Gcmate_t; -#pragma link C++ class Gctmed_t; -#pragma link C++ class Gctrak_t; -#pragma link C++ class Gcvolu_t; -#pragma link C++ class Gcsets_t; -#pragma link C++ class Gcnum_t; -#pragma link C++ class Gccuts_t; -#pragma link C++ class Gcmulo_t; -#pragma link C++ class Gcphys_t; -#pragma link C++ class Gcopti_t; -#pragma link C++ class Gctlit_t; -#pragma link C++ class Gcvdma_t; -#pragma link C++ class Gctpol_t; -#pragma link C++ class Ertrio_t; -#pragma link C++ class Eropts_t; -#pragma link C++ class Eroptc_t; -#pragma link C++ class Erwork_t; +#pragma link C++ class Quest_t+; +#pragma link C++ class Gcbank_t+; +#pragma link C++ class Gclink_t+; +#pragma link C++ class Gcflag_t+; +#pragma link C++ class Gckine_t+; +#pragma link C++ class Gcking_t+; +#pragma link C++ class Gckin2_t+; +#pragma link C++ class Gckin3_t+; +#pragma link C++ class Gcmate_t+; +#pragma link C++ class Gctmed_t+; +#pragma link C++ class Gctrak_t+; +#pragma link C++ class Gcvolu_t+; +#pragma link C++ class Gcsets_t+; +#pragma link C++ class Gcnum_t+; +#pragma link C++ class Gccuts_t+; +#pragma link C++ class Gcmulo_t+; +#pragma link C++ class Gcphys_t+; +#pragma link C++ class Gcopti_t+; +#pragma link C++ class Gctlit_t+; +#pragma link C++ class Gcvdma_t+; +#pragma link C++ class Gctpol_t+; +#pragma link C++ class Ertrio_t+; +#pragma link C++ class Eropts_t+; +#pragma link C++ class Eroptc_t+; +#pragma link C++ class Erwork_t+; #endif diff --git a/TGeant4/TGeant4LinkDef.h b/TGeant4/TGeant4LinkDef.h index 4c0484c8941..c11fd7ca124 100644 --- a/TGeant4/TGeant4LinkDef.h +++ b/TGeant4/TGeant4LinkDef.h @@ -6,11 +6,11 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class TGeant4; -#pragma link C++ class TG4VRunConfiguration; -#pragma link C++ class TG4Editor; -#pragma link C++ class TG4GUI; -#pragma link C++ class TG4GeometryGUI; -#pragma link C++ class TG4GuiVolume; +#pragma link C++ class TGeant4+; +#pragma link C++ class TG4VRunConfiguration+; +#pragma link C++ class TG4Editor+; +#pragma link C++ class TG4GUI+; +#pragma link C++ class TG4GeometryGUI+; +#pragma link C++ class TG4GuiVolume+; #endif diff --git a/THijing/THijingLinkDef.h b/THijing/THijingLinkDef.h index 5b92cd890c1..19c387c79f8 100644 --- a/THijing/THijingLinkDef.h +++ b/THijing/THijingLinkDef.h @@ -4,6 +4,6 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class THijing; +#pragma link C++ class THijing+; #endif diff --git a/TOF/AliTOF.cxx b/TOF/AliTOF.cxx index dc0f673a14d..2fbb2ca6ac6 100644 --- a/TOF/AliTOF.cxx +++ b/TOF/AliTOF.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.17 2000/10/19 09:58:14 vicinanz +Updated Hits2Digit procedure + Revision 1.16 2000/10/02 21:28:17 fca Removal of useless dependecies via forward declarations @@ -78,6 +81,7 @@ Introduction of the Copyright and cvs Log #include "TObject.h" #include "TRandom.h" #include "TTree.h" +#include "TFile.h" #include "AliRun.h" #include "AliMC.h" @@ -378,7 +382,7 @@ void AliTOF::Init() } //____________________________________________________________________________ -void AliTOF::MakeBranch(Option_t* option) +void AliTOF::MakeBranch(Option_t* option, char *file) // // Initializes the Branches of the TOF inside the // trees written for each event. @@ -388,16 +392,17 @@ void AliTOF::MakeBranch(Option_t* option) // { - AliDetector::MakeBranch(option); + AliDetector::MakeBranch(option,file); Int_t buffersize = 4000; Char_t branchname[10]; sprintf(branchname,"%s",GetName()); + char *D = strstr(option,"D"); if (fDigits && gAlice->TreeD() && D){ - gAlice->TreeD()->Branch(branchname,&fDigits,buffersize); - printf("Making Branch %s for digits \n",branchname); + gAlice->MakeBranchInTree(gAlice->TreeD(), + branchname, &fDigits,buffersize, file) ; } } @@ -407,6 +412,18 @@ void AliTOF::FinishEvent() // Hits2Digits(); } +//___________________________________________ +void AliTOF::SDigits2Digits() +{ +// +// Genneratedigits +// + int nparticles = gAlice->GetNtrack(); + cout << "Particles :" < 0 ) { + Hits2Digits(0); + } +} //____________________________________________________________________________ void AliTOF::Hits2Digits(Int_t evNumber) @@ -430,7 +447,7 @@ void AliTOF::Hits2Digits(Int_t evNumber) Float_t digit[2]; TClonesArray* TOFhits=this->Hits(); - Int_t nparticles = gAlice->GetEvent(evNumber); + Int_t nparticles = gAlice->GetNtrack(); if (nparticles <= 0) return; TD = gAlice->TreeD(); diff --git a/TOF/AliTOF.h b/TOF/AliTOF.h index fc94a728648..a20f85ec916 100644 --- a/TOF/AliTOF.h +++ b/TOF/AliTOF.h @@ -8,11 +8,13 @@ //////////////////////////////////////////////// // Manager and hits classes for set: TOF // //////////////////////////////////////////////// +#include "TObject.h" + +class TFile; #include "AliDetector.h" #include "AliHit.h" #include "AliDigit.h" -#include "TObject.h" #include "AliTOFD.h" class AliTOF : public AliDetector { @@ -65,7 +67,7 @@ public: virtual void CreateGeometry(); virtual void CreateMaterials(); virtual void Init(); - virtual void MakeBranch(Option_t*); + virtual void MakeBranch(Option_t*, char *file=0); virtual void FinishEvent(); virtual Int_t IsVersion() const =0; Int_t DistancetoPrimitive(Int_t px, Int_t py); @@ -73,6 +75,7 @@ public: virtual void TOFpc(Float_t, Float_t, Float_t, Float_t, Float_t,Float_t) {} virtual void DrawModule(); + virtual void SDigits2Digits(); void Hits2Digits(Int_t evNumber=0); void Digits2Raw (Int_t evNumber=0); void Raw2Digits (Int_t evNumber=0); diff --git a/TOF/TOFLinkDef.h b/TOF/TOFLinkDef.h index f9189cf29f1..d6cf9ee1135 100644 --- a/TOF/TOFLinkDef.h +++ b/TOF/TOFLinkDef.h @@ -8,18 +8,18 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class AliTOF; -#pragma link C++ class AliTOFv0; -#pragma link C++ class AliTOFv1; -#pragma link C++ class AliTOFv2; -#pragma link C++ class AliTOFv3; -#pragma link C++ class AliTOFv4; +#pragma link C++ class AliTOF+; +#pragma link C++ class AliTOFv0+; +#pragma link C++ class AliTOFv1+; +#pragma link C++ class AliTOFv2+; +#pragma link C++ class AliTOFv3+; +#pragma link C++ class AliTOFv4+; -#pragma link C++ class AliTOFhit; +#pragma link C++ class AliTOFhit+; -#pragma link C++ class AliTOFdigit; -#pragma link C++ class AliTOFRoc; -#pragma link C++ class AliTOFRawSector; -#pragma link C++ class AliTOFRawDigit; +#pragma link C++ class AliTOFdigit+; +#pragma link C++ class AliTOFRoc+; +#pragma link C++ class AliTOFRawSector+; +#pragma link C++ class AliTOFRawDigit+; #endif diff --git a/TPC/AliTPC.cxx b/TPC/AliTPC.cxx index 389b4481012..730d40d2b91 100644 --- a/TPC/AliTPC.cxx +++ b/TPC/AliTPC.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.27 2001/01/13 17:29:33 kowal2 +Sun compiler correction + Revision 1.26 2001/01/10 07:59:43 kowal2 Corrections to load points from the noncompressed hits. @@ -106,6 +109,7 @@ Introduction of the Copyright and cvs Log #include #include "AliRun.h" #include +#include #include #include "AliMC.h" #include "AliMagF.h" @@ -753,7 +757,6 @@ void AliTPC::Hits2Clusters(TFile *of) // TParticle *particle; // pointer to a given particle AliTPChit *tpcHit; // pointer to a sigle TPC hit - TClonesArray *particles; //pointer to the particle list Int_t sector; Int_t ipart; Float_t xyz[5]; @@ -766,7 +769,6 @@ void AliTPC::Hits2Clusters(TFile *of) TTree *tH = gAlice->TreeH(); Stat_t ntracks = tH->GetEntries(); - particles=gAlice->Particles(); //Switch to the output file of->cd(); @@ -828,7 +830,7 @@ void AliTPC::Hits2Clusters(TFile *of) continue; } ipart=tpcHit->Track(); - particle=(TParticle*)particles->UncheckedAt(ipart); + particle=gAlice->Particle(ipart); pl=particle->Pz(); pt=particle->Pt(); if(pt < 1.e-9) pt=1.e-9; @@ -924,7 +926,6 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) // TParticle *particle; // pointer to a given particle AliTPChit *tpcHit; // pointer to a sigle TPC hit - TClonesArray *particles; //pointer to the particle list Int_t sector,nhits; Int_t ipart; const Int_t kcmaxhits=30000; @@ -941,8 +942,7 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) TTree *tH = gAlice->TreeH(); Stat_t ntracks = tH->GetEntries(); - particles=gAlice->Particles(); - Int_t npart = particles->GetEntriesFast(); + Int_t npart = gAlice->GetNtrack(); //------------------------------------------------------------ // Loop over tracks @@ -967,7 +967,7 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) sector=tpcHit->fSector; // sector number if(sector != isec) continue; ipart=tpcHit->Track(); - if (ipartUncheckedAt(ipart); + if (ipartParticle(ipart); //find row number @@ -1064,6 +1064,68 @@ void AliTPC::Hits2ExactClustersSector(Int_t isec) xxxx->Delete(); } +//___________________________________________ +void AliTPC::SDigits2Digits() +{ + AliTPCParamSR *param=(AliTPCParamSR*)gDirectory->Get("75x40_100x60"); + AliTPCPRF2D * prfinner = new AliTPCPRF2D; + AliTPCPRF2D * prfouter = new AliTPCPRF2D; + AliTPCRF1D * rf = new AliTPCRF1D(kTRUE); + + TDirectory *cwd = gDirectory; + rf->SetGauss(param->GetZSigma(),param->GetZWidth(),1.); + rf->SetOffset(3*param->GetZSigma()); + rf->Update(); + TFile *f=TFile::Open("$ALICE_ROOT/TPC/AliTPCprf2d.root"); + if (!f->IsOpen()) { + cerr<<"Can't open $ALICE_ROOT/TPC/AliTPCprf2d.root !\n"; + exit(3); + } + prfinner->Read("prf_07504_Gati_056068_d02"); + prfouter->Read("prf_10006_Gati_047051_d03"); + f->Close(); + cwd->cd(); + + param->SetInnerPRF(prfinner); + param->SetOuterPRF(prfouter); + param->SetTimeRF(rf); + + SetParam(param); + + cerr<<"Digitizing TPC...\n"; + + //setup TPCDigitsArray + AliTPCDigitsArray *arr = new AliTPCDigitsArray; + arr->SetClass("AliSimDigits"); + arr->Setup(param); + SetParam(param); + + arr->MakeTree(fDigitsFile); + + SetDigitsArray(arr); + + Hits2Digits(); + + // Hits2DigitsSector(1); + // Hits2DigitsSector(2); + // Hits2DigitsSector(3); + // Hits2DigitsSector(1+18); + // Hits2DigitsSector(2+18); + // Hits2DigitsSector(3+18); + + // Hits2DigitsSector(36+1); + // Hits2DigitsSector(36+2); + // Hits2DigitsSector(36+3); + // Hits2DigitsSector(36+1+18); + // Hits2DigitsSector(36+2+18); + // Hits2DigitsSector(36+3+18); + + //write results + + char treeName[100]; + sprintf(treeName,"TreeD_%s",param->GetTitle()); + GetDigitsArray()->GetTree()->Write(treeName,TObject::kOverwrite); +} //__________________________________________________________________ void AliTPC::Hits2Digits() @@ -1126,7 +1188,7 @@ void AliTPC::Hits2DigitsSector(Int_t isec) Int_t i; - if (fDigitsArray->GetTree()==0) fDigitsArray->MakeTree(); + if (fDigitsArray->GetTree()==0) fDigitsArray->MakeTree(fDigitsFile); for (i=0;iTreeD() && d) { - gAlice->TreeD()->Branch(branchname,&fDigits, buffersize); - printf("Making Branch %s for digits\n",branchname); + gAlice->MakeBranchInTree(gAlice->TreeD(), + branchname, &fDigits, buffersize, file) ; } - if (fHitType&2) MakeBranch2(option); // MI change 14.09.2000 + if (fHitType&2) MakeBranch2(option,file); // MI change 14.09.2000 } //_____________________________________________________________________________ @@ -1832,28 +1894,6 @@ void AliTPC::TransportElectron(Float_t *xyz, Int_t *index) //add nonisochronity (not implemented yet) } -//_____________________________________________________________________________ -void AliTPC::Streamer(TBuffer &R__b) -{ - // - // Stream an object of class AliTPC. - // - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - AliDetector::Streamer(R__b); - R__b >> fTPCParam; - if (R__v < 2) return; - R__b >> fNsectors; - R__b >> fHitType; - - } else { - R__b.WriteVersion(AliTPC::IsA()); - AliDetector::Streamer(R__b); - R__b << fTPCParam; - R__b << fNsectors; - R__b << fHitType; - } -} ClassImp(AliTPCdigit) @@ -1893,7 +1933,7 @@ AliHit(shunt,track) //________________________________________________________________________ // Additional code because of the AliTPCTrackHits -void AliTPC::MakeBranch2(Option_t *option) +void AliTPC::MakeBranch2(Option_t *option,char *file) { // // Create a new branch in the current Root Tree @@ -1907,11 +1947,21 @@ void AliTPC::MakeBranch2(Option_t *option) char *cH = strstr(option,"H"); // if (fTrackHits && gAlice->TreeH() && cH) { - // gAlice->TreeH()->Branch(branchname,&fTrackHits, fBufferSize); AliObjectBranch * branch = new AliObjectBranch(branchname,"AliTPCTrackHits",&fTrackHits, gAlice->TreeH(),fBufferSize,1); gAlice->TreeH()->GetListOfBranches()->Add(branch); printf("* AliDetector::MakeBranch * Making Branch %s for trackhits\n",branchname); + if (file) { + TBranch *b = gAlice->TreeH()->GetBranch(branchname); + TDirectory *wd = gDirectory; + b->SetFile(file); + TIter next( b->GetListOfBranches()); + while ((b=(TBranch*)next())) { + b->SetFile(file); + } + wd->cd(); + cout << "Diverting branch " << branchname << " to file " << file << endl; + } } } @@ -1948,11 +1998,10 @@ void AliTPC::AddHit2(Int_t track, Int_t *vol, Float_t *hits) { // // add hit to the list - TClonesArray &particles = *(gAlice->Particles()); Int_t rtrack; if (fIshunt) { int primary = gAlice->GetPrimary(track); - ((TParticle *)particles[primary])->SetBit(kKeepBit); + gAlice->Particle(primary)->SetBit(kKeepBit); rtrack=primary; } else { rtrack=track; diff --git a/TPC/AliTPC.h b/TPC/AliTPC.h index 05d35c6e928..6e261907bf7 100644 --- a/TPC/AliTPC.h +++ b/TPC/AliTPC.h @@ -31,10 +31,10 @@ protected: Int_t fSecUps[12]; // List of upper sectors selected Int_t fNsectors; // Number of sectors in TPC //MI changes - AliTPCDigitsArray * fDigitsArray; //detector digit object - AliTPCClustersArray * fClustersArray; //detector cluster object + AliTPCDigitsArray * fDigitsArray; //!detector digit object + AliTPCClustersArray * fClustersArray; //!detector cluster object AliTPCParam *fTPCParam; // pointer to TPC parameters - AliTPCTrackHits *fTrackHits; //hits for given track M.I. + AliTPCTrackHits *fTrackHits; //!hits for given track M.I. Int_t fHitType; // if fNewHit = 1 old data structure if 2 new hits // 3 both types @@ -56,16 +56,17 @@ public: virtual void CreateMaterials(); virtual void Hits2Clusters(TFile *of); virtual void Hits2ExactClustersSector(Int_t isec); // MI change calculate "exact" cluster position + virtual void SDigits2Digits(); virtual void Hits2Digits(); //MI change - virtual void Hits2DigitsSector(Int_t isec); //MI change + virtual void Hits2DigitsSector(Int_t isec); //MI change virtual void Init(); virtual Int_t IsVersion() const =0; virtual void Digits2Clusters(TFile *of); virtual void Clusters2Tracks(TFile *of); Int_t GetNsectors() {return fNsectors;} - virtual void MakeBranch(Option_t *opt=" "); + virtual void MakeBranch(Option_t *opt=" ", char *file=0 ); virtual void ResetDigits(); virtual void SetSecAL(Int_t sec); virtual void SetSecAU(Int_t sec); @@ -89,7 +90,7 @@ public: void SetClustersArray(AliTPCClustersArray *clusters) {fClustersArray = clusters;} //MI change // additional function neccesary for the new hits - virtual void MakeBranch2(Option_t *opt=" "); // + virtual void MakeBranch2(Option_t *opt=" ", char *file=0); // virtual void SetTreeAddress(); virtual void SetTreeAddress2(); virtual void AddHit2(Int_t a1, Int_t *a2, Float_t *a3); // diff --git a/TPC/AliTPCClusterFinder.cxx b/TPC/AliTPCClusterFinder.cxx index a72e9536060..2e91abf9c20 100644 --- a/TPC/AliTPCClusterFinder.cxx +++ b/TPC/AliTPCClusterFinder.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2000/10/05 16:08:15 kowal2 +Changes due to a new class AliComplexCluster. Forward declarations. + Revision 1.3 2000/07/10 20:57:39 hristov Update of TPC code and macros by M.Kowalski @@ -631,17 +634,6 @@ Float_t AliTPCClusterFinder::GetVirtualSignal(Float_t ri, Float_t rj) -void AliTPCClusterFinder::Streamer(TBuffer & R__b) -{ - if (R__b.IsReading()) { - // Version_t R__v = R__b.ReadVersion(); - } else { - R__b.WriteVersion(AliTPCClusterFinder::IsA()); - } -} - - - void AliTPCClusterFinder::SetBlockIndex(Int_t * index) { // diff --git a/TPC/AliTPCFindClusters.C b/TPC/AliTPCFindClusters.C index 9810b22b2c3..dcd13d45956 100644 --- a/TPC/AliTPCFindClusters.C +++ b/TPC/AliTPCFindClusters.C @@ -9,6 +9,8 @@ Int_t AliTPCFindClusters() { return 3; } + TDirectory *cwd = gDirectory; + gAlice->GetEvent(0); AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC"); @@ -25,7 +27,7 @@ Int_t AliTPCFindClusters() { cerr<<"Making clusters...\n"; { AliTPCv1 &tpc=*((AliTPCv1*)TPC); - tpc.SetParam(dig); timer.Start(); tpc.Hits2Clusters(out); + tpc.SetParam(dig); timer.Start(); cwd->cd(); tpc.Hits2Clusters(out); } break; case 2: @@ -33,7 +35,7 @@ Int_t AliTPCFindClusters() { { delete gAlice; gAlice=0; AliTPCv2 tpc; - tpc.SetParam(dig); timer.Start(); tpc.Digits2Clusters(out); + tpc.SetParam(dig); timer.Start(); cwd->cd(); tpc.Digits2Clusters(out); } break; default: diff --git a/TPC/AliTPCParamCR.cxx b/TPC/AliTPCParamCR.cxx index e1f3782253a..055781ad075 100644 --- a/TPC/AliTPCParamCR.cxx +++ b/TPC/AliTPCParamCR.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2000/11/02 07:33:15 kowal2 +Improvements of the code. + Revision 1.3 2000/06/30 12:07:50 kowal2 Updated from the TPC-PreRelease branch @@ -45,7 +48,7 @@ New Detector parameters handling class #include #include -#include +#include #include #include "AliTPCPRF2D.h" #include "AliTPCRF1D.h" @@ -246,15 +249,10 @@ void AliTPCParamCR::Streamer(TBuffer &R__b) // Stream an object of class AliTPC. if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - // TObject::Streamer(R__b); - AliTPCParam::Streamer(R__b); - // if (R__v < 2) return; - Update(); + AliTPCParamCR::Class()->ReadBuffer(R__b, this); + Update(); } else { - R__b.WriteVersion(AliTPCParamCR::IsA()); - //TObject::Streamer(R__b); - AliTPCParam::Streamer(R__b); + AliTPCParamCR::Class()->WriteBuffer(R__b, this); } } diff --git a/TPC/AliTPCParamCR.h b/TPC/AliTPCParamCR.h index 7b7ddfb1ba0..9e72d02094b 100644 --- a/TPC/AliTPCParamCR.h +++ b/TPC/AliTPCParamCR.h @@ -42,9 +42,9 @@ public: AliTPCPRF2D * GetOuterPRF() const {return fOuterPRF;} AliTPCRF1D * GetTimeRF() const {return fTimeRF;} protected: - AliTPCPRF2D * fInnerPRF; //pad response function object for inner sector - AliTPCPRF2D * fOuterPRF; //pad response function object for inner sector - AliTPCRF1D * fTimeRF; //time response function object + AliTPCPRF2D * fInnerPRF; //!pad response function object for inner sector + AliTPCPRF2D * fOuterPRF; //!pad response function object for inner sector + AliTPCRF1D * fTimeRF; //!time response function object Float_t fFacSigma; //factor-how many sigma of response I accept ClassDef(AliTPCParamCR,1) //parameter object for set:TPC }; diff --git a/TPC/AliTPCRF1D.cxx b/TPC/AliTPCRF1D.cxx index 45a4cfe53b8..38d004a089c 100644 --- a/TPC/AliTPCRF1D.cxx +++ b/TPC/AliTPCRF1D.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.6 2000/06/30 12:07:50 kowal2 +Updated from the TPC-PreRelease branch + Revision 1.5.4.3 2000/06/26 07:39:42 kowal2 Changes to obey the coding rules @@ -326,69 +329,17 @@ void AliTPCRF1D::Update() void AliTPCRF1D::Streamer(TBuffer &R__b) { // Stream an object of class AliTPCRF1D. - Float_t dummy; if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - TObject::Streamer(R__b); - //read pad parameters - R__b >> fpadWidth; - //read charge parameters - R__b >> fType[0]; - R__b >> fType[1]; - R__b >> fType[2]; - R__b >> fType[3]; - R__b >> fType[4]; - R__b >> forigsigma; - R__b >> fkNorm; - R__b >> dummy; //dummuy instead fK3X in previous - R__b >> fPadDistance; - R__b >> fInteg; - R__b >> fOffset; + AliTPCRF1D::Class()->ReadBuffer(R__b, this); //read functions - if (fGRF!=0) { - delete [] fGRF; - fGRF=0; - } - if (strncmp(fType,"User",3)==0){ - fGRF= new TF1; - R__b>>fGRF; - } - if (strncmp(fType,"Gauss",3)==0) - fGRF = new TF1("fun",funGauss,-5.,5.,4); - if (strncmp(fType,"Cosh",3)==0) - fGRF = new TF1("fun",funCosh,-5.,5.,4); - if (strncmp(fType,"Gati",3)==0) - fGRF = new TF1("fun",funGati,-5.,5.,4); - R__b >>fDSTEPM1; - R__b >>fNRF; - R__b.ReadFastArray(fcharge,fNRF); - R__b.ReadFastArray(funParam,5); - if (fGRF!=0) fGRF->SetParameters(funParam); + if (strncmp(fType,"Gauss",3)==0) {delete fGRF; fGRF = new TF1("fun",funGauss,-5.,5.,4);} + if (strncmp(fType,"Cosh",3)==0) {delete fGRF; fGRF = new TF1("fun",funCosh,-5.,5.,4);} + if (strncmp(fType,"Gati",3)==0) {delete fGRF; fGRF = new TF1("fun",funGati,-5.,5.,4);} + if (fGRF) fGRF->SetParameters(funParam); } else { - R__b.WriteVersion(AliTPCRF1D::IsA()); - TObject::Streamer(R__b); - //write pad width - R__b << fpadWidth; - //write charge parameters - R__b << fType[0]; - R__b << fType[1]; - R__b << fType[2]; - R__b << fType[3]; - R__b << fType[4]; - R__b << forigsigma; - R__b << fkNorm; - R__b << dummy; //dummuy instead fK3X in previouis - R__b << fPadDistance; - R__b << fInteg; - R__b << fOffset; - //write interpolation parameters - if (strncmp(fType,"User",3)==0) R__b <WriteBuffer(R__b, this); } } diff --git a/TPC/AliTPCRF1D.h b/TPC/AliTPCRF1D.h index 4e777a0536e..821df9093ad 100644 --- a/TPC/AliTPCRF1D.h +++ b/TPC/AliTPCRF1D.h @@ -51,7 +51,7 @@ private: Double_t funParam[5];//parameters of used charge function Int_t fNRF; //number of interpolations point Float_t fDSTEPM1; //element step for point - Float_t* fcharge; // field with RF + Float_t* fcharge; //[fNPRF] field with RF Float_t forigsigma;//sigma of original distribution; Float_t fpadWidth; //width of pad Float_t fkNorm; //normalisation factor of the charge integral diff --git a/TPC/AliTPCtest.C b/TPC/AliTPCtest.C index 7f6d197002c..975625e688a 100644 --- a/TPC/AliTPCtest.C +++ b/TPC/AliTPCtest.C @@ -37,3 +37,4 @@ Int_t AliTPCtest() { return rc; } + diff --git a/TPC/TPCLinkDef.h b/TPC/TPCLinkDef.h index 1ce39107649..d7e139f12bf 100644 --- a/TPC/TPCLinkDef.h +++ b/TPC/TPCLinkDef.h @@ -9,47 +9,47 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class AliTPC-; -#pragma link C++ class AliTPCv0; -#pragma link C++ class AliTPCv1; -#pragma link C++ class AliTPCv2; -#pragma link C++ class AliTPCv3; -#pragma link C++ class AliTPChit; -#pragma link C++ class AliTPCdigit; -#pragma link C++ class AliTPCcluster; -#pragma link C++ class AliTPCtrack; - -#pragma link C++ class AliTPCParam; +#pragma link C++ class AliTPC+; +#pragma link C++ class AliTPCv0+; +#pragma link C++ class AliTPCv1+; +#pragma link C++ class AliTPCv2+; +#pragma link C++ class AliTPCv3+; +#pragma link C++ class AliTPChit+; +#pragma link C++ class AliTPCdigit+; +#pragma link C++ class AliTPCcluster+; +#pragma link C++ class AliTPCtrack+; + +#pragma link C++ class AliTPCParam+; #pragma link C++ class AliTPCParamSR-; #pragma link C++ class AliTPCParamCR-; #pragma link C++ class AliTPCRF1D-; #pragma link C++ class AliTPCPRF2D-; -#pragma link C++ class AliDetectorParam; +#pragma link C++ class AliDetectorParam+; -#pragma link C++ class AliComplexCluster; -#pragma link C++ class AliDigitCluster; -#pragma link C++ class AliDifCluster; -#pragma link C++ class AliClusters; -#pragma link C++ class AliClustersArray; +#pragma link C++ class AliComplexCluster+; +#pragma link C++ class AliDigitCluster+; +#pragma link C++ class AliDifCluster+; +#pragma link C++ class AliClusters+; +#pragma link C++ class AliClustersArray+; -#pragma link C++ class AliTPCClustersRow; -#pragma link C++ class AliTPCClustersArray; +#pragma link C++ class AliTPCClustersRow+; +#pragma link C++ class AliTPCClustersArray+; -#pragma link C++ class AliSimDigits; -#pragma link C++ class AliDigitsArray; -#pragma link C++ class AliTPCDigitsArray; +#pragma link C++ class AliSimDigits+; +#pragma link C++ class AliDigitsArray+; +#pragma link C++ class AliTPCDigitsArray+; -#pragma link C++ class AliTPCClusterFinder-; -#pragma link C++ class AliH2F; +#pragma link C++ class AliTPCClusterFinder+; +#pragma link C++ class AliH2F+; -#pragma link C++ class AliTPCTrackHits; -#pragma link C++ class AliTrackHitsInfo; -#pragma link C++ class AliTrackHitsParam; -#pragma link C++ class AliHitInfo; +#pragma link C++ class AliTPCTrackHits+; +#pragma link C++ class AliTrackHitsInfo+; +#pragma link C++ class AliTrackHitsParam+; +#pragma link C++ class AliHitInfo+; #endif diff --git a/TRD/AliTRD.cxx b/TRD/AliTRD.cxx index ab1425de59d..ec84e956c03 100644 --- a/TRD/AliTRD.cxx +++ b/TRD/AliTRD.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.23 2000/11/01 14:53:20 cblume +Merge with TRD-develop + Revision 1.17.2.6 2000/10/15 23:29:08 cblume Introduced more detailed geometry for the display @@ -99,6 +102,7 @@ Introduction of the Copyright and cvs Log /////////////////////////////////////////////////////////////////////////////// #include +#include #include #include @@ -121,6 +125,7 @@ Introduction of the Copyright and cvs Log #include "AliTRDgeometryHole.h" #include "AliTRDgeometryFull.h" #include "AliTRDrecPoint.h" +#include "AliTRDdigitsManager.h" ClassImp(AliTRD) @@ -252,6 +257,39 @@ void AliTRD::AddRecPoint(Float_t *pos, Int_t *digits, Int_t det, Float_t amp fRecPoints->Add(recPoint); } +//___________________________________________ +void AliTRD::SDigits2Digits() +{ + // + // Create digits + // + AliTRDdigitizer *Digitizer = new AliTRDdigitizer("digitizer","TRD digitizer class"); + + // Set the parameter + Digitizer->SetDiffusion(); + Digitizer->SetVerbose(1); + + //Digitizer->SetExB(); + //Digitizer->SetElAttach(); + //Digitizer->SetAttachProb(); + + Digitizer->InitDetector(); + + // Create the digits + Digitizer->MakeDigits(); + cout<<"After MakeDigits"<Digits()->MakeBranch(fDigitsFile)) + { + Digitizer->WriteDigits(); + cout<<"After write digits"<Write(); + cout<<"After write digitizer"<TreeR() && r) { - // gAlice->TreeR()->Branch(branchname,fRecPoints->IsA()->GetName() - // ,&fRecPoints,buffersize,0); - // printf("* AliTRD::MakeBranch * Making Branch %s for points in TreeR\n",branchname); + // MakeBranchInTree(gAlice->TreeR(), + // branchname, &fRecPoints,buffersize, file) ; //} } diff --git a/TRD/AliTRD.h b/TRD/AliTRD.h index f6917314b17..696a5be5b15 100644 --- a/TRD/AliTRD.h +++ b/TRD/AliTRD.h @@ -11,6 +11,8 @@ #include "AliDetector.h" +class TFile; + class AliRun; class AliDigit; @@ -44,7 +46,7 @@ class AliTRD : public AliDetector { TObjArray *RecPoints() const { return fRecPoints; }; virtual void Init(); virtual Int_t IsVersion() const = 0; - virtual void MakeBranch(Option_t* option); + virtual void MakeBranch(Option_t* option, char *file=0); virtual void ResetRecPoints(); virtual void StepManager() = 0; virtual void SetTreeAddress(); @@ -68,6 +70,8 @@ class AliTRD : public AliDetector { virtual Int_t GetSensSector() const = 0; virtual Int_t GetSensSectorRange() const = 0; + virtual void SDigits2Digits(); + virtual AliTRDsim *CreateTR() = 0; virtual AliTRDsim *GetTR() const = 0; diff --git a/TRD/AliTRDdigit.cxx b/TRD/AliTRDdigit.cxx index 502d47378c0..e051686251c 100644 --- a/TRD/AliTRDdigit.cxx +++ b/TRD/AliTRDdigit.cxx @@ -17,6 +17,9 @@ /* $Log$ +Revision 1.5 2000/11/01 14:53:20 cblume +Merge with TRD-develop + Revision 1.1.2.4 2000/10/17 02:27:34 cblume Get rid of global constants @@ -109,27 +112,3 @@ Int_t AliTRDdigit::DecodeAmp() const return 0; } - -//______________________________________________________________________________ -void AliTRDdigit::Streamer(TBuffer &R__b) -{ - // - // Stream an object of class AliTRDdigit. - // - - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - AliDigitNew::Streamer(R__b); - R__b >> fRow; - R__b >> fCol; - R__b >> fTime; - } - else { - R__b.WriteVersion(AliTRDdigit::IsA()); - AliDigitNew::Streamer(R__b); - R__b << fRow; - R__b << fCol; - R__b << fTime; - } - -} diff --git a/TRD/AliTRDdigitizer.cxx b/TRD/AliTRDdigitizer.cxx index 8f29ef1efd0..1bfa27f8724 100644 --- a/TRD/AliTRDdigitizer.cxx +++ b/TRD/AliTRDdigitizer.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.17 2000/12/08 12:53:27 cblume +Change in Copy() function for HP-compiler + Revision 1.16 2000/12/07 12:20:46 cblume Go back to array compression. Use sampled PRF to speed up digitization @@ -1062,7 +1065,7 @@ Bool_t AliTRDdigitizer::WriteDigits() printf("AliTRDdigitizer::WriteDigits -- "); printf("Write the digits tree %s for event %d.\n" ,treeName,fEvent); - gAlice->TreeD()->Write(treeName,2); + gAlice->TreeD()->Write(treeName,TObject::kOverwrite); return kTRUE; diff --git a/TRD/AliTRDdigitsManager.cxx b/TRD/AliTRDdigitsManager.cxx index b7ea603f08e..f5c28debaa2 100644 --- a/TRD/AliTRDdigitsManager.cxx +++ b/TRD/AliTRDdigitsManager.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.9 2000/11/02 09:25:53 cblume +Change also the dictionary to AliTRDdataArray + Revision 1.8 2000/11/01 15:20:13 cblume Change AliTRDdataArrayI to AliTRDdataArray in MakeBranch() @@ -56,8 +59,11 @@ Add new class AliTRDdigitsManager // AliTRDdataArray objects. // // // /////////////////////////////////////////////////////////////////////////////// +#include +#include #include +#include #include "AliRun.h" @@ -146,7 +152,7 @@ void AliTRDdigitsManager::SetRaw() } //_____________________________________________________________________________ -Bool_t AliTRDdigitsManager::MakeBranch() +Bool_t AliTRDdigitsManager::MakeBranch(char *file) { // // Creates the branches for the digits and the dictionary in the digits tree @@ -156,17 +162,18 @@ Bool_t AliTRDdigitsManager::MakeBranch() Bool_t status = kTRUE; + //TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("TRD.Digits.root"); + if (gAlice->TreeD()) { // Make the branch for the digits if (fDigits) { - //const AliTRDdataArrayI *kDigits = - // (AliTRDdataArrayI *) fDigits->At(0); const AliTRDdataArray *kDigits = (AliTRDdataArray *) fDigits->At(0); if (kDigits) { - gAlice->TreeD()->Branch("TRDdigits",kDigits->IsA()->GetName() - ,&kDigits,buffersize,1); + gAlice->MakeBranchInTree(gAlice->TreeD(), + "TRDdigits", kDigits->IsA()->GetName(), + &kDigits,buffersize, 1,file) ; printf("AliTRDdigitsManager::MakeBranch -- "); printf("Making branch TRDdigits\n"); } @@ -183,19 +190,18 @@ Bool_t AliTRDdigitsManager::MakeBranch() Char_t branchname[15]; sprintf(branchname,"TRDdictionary%d",iDict); if (fDictionary[iDict]) { - //const AliTRDdataArrayI *kDictionary = - // (AliTRDdataArrayI *) fDictionary[iDict]->At(0); const AliTRDdataArray *kDictionary = (AliTRDdataArray *) fDictionary[iDict]->At(0); if (kDictionary) { - gAlice->TreeD()->Branch(branchname,kDictionary->IsA()->GetName() - ,&kDictionary,buffersize,1); + gAlice->MakeBranchInTree(gAlice->TreeD(), + branchname,kDictionary->IsA()->GetName(), + &kDictionary,buffersize, 1,file) ; printf("AliTRDdigitsManager::MakeBranch -- "); printf("Making branch %s\n",branchname); - } + } else { status = kFALSE; - } + } } else { status = kFALSE; diff --git a/TRD/AliTRDdigitsManager.h b/TRD/AliTRDdigitsManager.h index 78fa50ea4ef..33580682413 100644 --- a/TRD/AliTRDdigitsManager.h +++ b/TRD/AliTRDdigitsManager.h @@ -12,6 +12,8 @@ #include +class TFile; + class AliTRDsegmentArray; class AliTRDdataArrayI; class AliTRDdigit; @@ -28,7 +30,7 @@ class AliTRDdigitsManager : public TObject { AliTRDdigitsManager &operator=(const AliTRDdigitsManager &m); virtual void Copy(TObject &m); - virtual Bool_t MakeBranch(); + virtual Bool_t MakeBranch(char *file=0); virtual Bool_t ReadDigits(); virtual Bool_t WriteDigits(); diff --git a/TRD/AliTRDhit.cxx b/TRD/AliTRDhit.cxx index 41ef71a621a..092ab47aa09 100644 --- a/TRD/AliTRDhit.cxx +++ b/TRD/AliTRDhit.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.5 2000/11/01 14:53:21 cblume +Merge with TRD-develop + Revision 1.1.2.2 2000/09/18 13:41:29 cblume Changed fDetector to UShort and fQ to Short_t. Use customized streamer @@ -81,25 +84,3 @@ AliTRDhit::~AliTRDhit() // } - -//_____________________________________________________________________________ -void AliTRDhit::Streamer(TBuffer &R__b) -{ - // - // Stream an object of class AliTRDhit. - // - - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - AliHit::Streamer(R__b); - R__b >> fDetector; - R__b >> fQ; - } - else { - R__b.WriteVersion(AliTRDhit::IsA()); - AliHit::Streamer(R__b); - R__b << fDetector; - R__b << fQ; - } - -} diff --git a/TRD/AliTRDsegmentArrayBase.cxx b/TRD/AliTRDsegmentArrayBase.cxx index 19ceb026c1a..a3339fd9f28 100644 --- a/TRD/AliTRDsegmentArrayBase.cxx +++ b/TRD/AliTRDsegmentArrayBase.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.7 2000/11/20 08:56:07 cblume +Cleanup of data arrays + Revision 1.6 2000/11/01 14:53:21 cblume Merge with TRD-develop @@ -305,7 +308,7 @@ void AliTRDsegmentArrayBase::ClearSegment(Int_t index) } //_____________________________________________________________________________ -void AliTRDsegmentArrayBase::MakeTree() +void AliTRDsegmentArrayBase::MakeTree(char *file) { // // Create a tree for the segment @@ -317,6 +320,8 @@ void AliTRDsegmentArrayBase::MakeTree() fTree = new TTree("Segment Tree","Tree with segments"); fBranch = fTree->Branch("Segment",psegment->IsA()->GetName(),&psegment,64000,1); + if (file) + fBranch->SetFile(file); delete psegment; diff --git a/TRD/AliTRDsegmentArrayBase.h b/TRD/AliTRDsegmentArrayBase.h index 01d1475b15c..f842b0c17dc 100644 --- a/TRD/AliTRDsegmentArrayBase.h +++ b/TRD/AliTRDsegmentArrayBase.h @@ -37,7 +37,7 @@ class AliTRDsegmentArrayBase: public TNamed { virtual Bool_t ConnectTree(const char *treeName); Bool_t MakeArray(Int_t n); virtual AliTRDsegmentID *NewSegment(); - virtual void MakeTree(); + virtual void MakeTree(char *file = 0); virtual AliTRDsegmentID *LoadSegment(Int_t index); virtual AliTRDsegmentID *LoadEntry(Int_t index); virtual void StoreSegment(Int_t index); diff --git a/TRD/AliTRDsim.cxx b/TRD/AliTRDsim.cxx index 9b166cf554f..82b68e25fd7 100644 --- a/TRD/AliTRDsim.cxx +++ b/TRD/AliTRDsim.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.7 2000/12/20 13:00:45 cblume +Modifications for the HP-compiler + Revision 1.6 2000/12/12 10:20:10 cblume Initialize fSepctrum = 0 in ctors @@ -738,59 +741,3 @@ Int_t AliTRDsim::Locate(Double_t *xv, Int_t n, Double_t xval return 0; } - -//_____________________________________________________________________________ -void AliTRDsim::Streamer(TBuffer &R__b) -{ - // - // Stream an object of class AliTRDsim. - // - - if (R__b.IsReading()) { - Version_t R__v = R__b.ReadVersion(); if (R__v) { } - TObject::Streamer(R__b); - R__b >> fNFoils; - R__b >> fFoilThick; - R__b >> fGapThick; - R__b >> fFoilDens; - R__b >> fGapDens; - R__b >> fFoilOmega; - R__b >> fGapOmega; - R__b >> fFoilZ; - R__b >> fGapZ; - R__b >> fFoilA; - R__b >> fGapA; - R__b >> fTemp; - R__b >> fSpNBins; - R__b >> fSpRange; - R__b >> fSpBinWidth; - R__b >> fSpLower; - R__b >> fSpUpper; - R__b.ReadArray(fSigma); - R__b >> fSpectrum; - } - else { - R__b.WriteVersion(AliTRDsim::IsA()); - TObject::Streamer(R__b); - R__b << fNFoils; - R__b << fFoilThick; - R__b << fGapThick; - R__b << fFoilDens; - R__b << fGapDens; - R__b << fFoilOmega; - R__b << fGapOmega; - R__b << fFoilZ; - R__b << fGapZ; - R__b << fFoilA; - R__b << fGapA; - R__b << fTemp; - R__b << fSpNBins; - R__b << fSpRange; - R__b << fSpBinWidth; - R__b << fSpLower; - R__b << fSpUpper; - R__b.WriteArray(fSigma, fSpNBins); - R__b << (TObject*) fSpectrum; - } - -} diff --git a/TRD/TRDLinkDef.h b/TRD/TRDLinkDef.h index 8d45bde8aa2..2197bed6fb2 100644 --- a/TRD/TRDLinkDef.h +++ b/TRD/TRDLinkDef.h @@ -8,37 +8,37 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class AliTRD; -#pragma link C++ class AliTRDv0; -#pragma link C++ class AliTRDv1; -#pragma link C++ class AliTRDhit-; -#pragma link C++ class AliTRDdigit-; -#pragma link C++ class AliTRDdigitsManager; -#pragma link C++ class AliTRDpixel; -#pragma link C++ class AliTRDmatrix; -#pragma link C++ class AliTRDgeometry; -#pragma link C++ class AliTRDgeometryFull; -#pragma link C++ class AliTRDgeometryHole; -#pragma link C++ class AliTRDdigitizer; -#pragma link C++ class AliTRDclusterizer; -#pragma link C++ class AliTRDclusterizerV0; -#pragma link C++ class AliTRDclusterizerV1; -#pragma link C++ class AliTRDrecPoint; -#pragma link C++ class AliTRDsegmentArray; -#pragma link C++ class AliTRDdataArray; -#pragma link C++ class AliTRDdataArrayI; -#pragma link C++ class AliTRDdataArrayF; -#pragma link C++ class AliTRDsim-; -#pragma link C++ class AliTRDpoints; -#pragma link C++ class AliTRDtimeBin; -#pragma link C++ class AliTRDtrackingSector; +#pragma link C++ class AliTRD+; +#pragma link C++ class AliTRDv0+; +#pragma link C++ class AliTRDv1+; +#pragma link C++ class AliTRDhit+; +#pragma link C++ class AliTRDdigit+; +#pragma link C++ class AliTRDdigitsManager+; +#pragma link C++ class AliTRDpixel+; +#pragma link C++ class AliTRDmatrix+; +#pragma link C++ class AliTRDgeometry+; +#pragma link C++ class AliTRDgeometryFull+; +#pragma link C++ class AliTRDgeometryHole+; +#pragma link C++ class AliTRDdigitizer+; +#pragma link C++ class AliTRDclusterizer+; +#pragma link C++ class AliTRDclusterizerV0+; +#pragma link C++ class AliTRDclusterizerV1+; +#pragma link C++ class AliTRDrecPoint+; +#pragma link C++ class AliTRDsegmentArray+; +#pragma link C++ class AliTRDdataArray+; +#pragma link C++ class AliTRDdataArrayI+; +#pragma link C++ class AliTRDdataArrayF+; +#pragma link C++ class AliTRDsim+; +#pragma link C++ class AliTRDpoints+; +#pragma link C++ class AliTRDtimeBin+; +#pragma link C++ class AliTRDtrackingSector+; #pragma link C++ class AliTRDtrack-; -#pragma link C++ class AliTRDtracker; -#pragma link C++ class AliTRDcluster; +#pragma link C++ class AliTRDtracker+; +#pragma link C++ class AliTRDcluster+; -#pragma link C++ class AliTRDsegmentID; -#pragma link C++ class AliTRDsegmentArrayBase; -#pragma link C++ class AliTRDarrayI; -#pragma link C++ class AliTRDarrayF; +#pragma link C++ class AliTRDsegmentID+; +#pragma link C++ class AliTRDsegmentArrayBase+; +#pragma link C++ class AliTRDarrayI+; +#pragma link C++ class AliTRDarrayF+; #endif diff --git a/ZDC/AliZDC.cxx b/ZDC/AliZDC.cxx index 80af78be161..a71a74c9a55 100644 --- a/ZDC/AliZDC.cxx +++ b/ZDC/AliZDC.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.14 2000/12/12 13:17:01 coppedis +Minor corrections suggested by P. Hristov + Revision 1.12 2000/12/01 08:19:01 coppedis Adding a message error if ZDC is constructed without DIPO @@ -51,8 +54,9 @@ Introduction of the Copyright and cvs Log // --- ROOT system #include #include -#include "TGeometry.h" -#include "TTree.h" +#include +#include +#include // --- AliRoot header files #include "AliZDC.h" @@ -77,9 +81,7 @@ AliZDC::AliZDC() fNhits = 0; fNStHits = 0; - fStHits = new TClonesArray("AliZDCHit",1000); - fNPrimaryHits = 0; } diff --git a/ZDC/AliZDCv1.cxx b/ZDC/AliZDCv1.cxx index 7d1b9ec797e..16c34c3e10e 100644 --- a/ZDC/AliZDCv1.cxx +++ b/ZDC/AliZDCv1.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.11 2001/01/16 07:43:33 hristov +Initialisation of ZDC hits + Revision 1.10 2000/12/14 15:20:02 coppedis Hits2Digits method for digitization @@ -1111,20 +1114,22 @@ Int_t AliZDCv1::Digitize(Int_t Det, Int_t Quad, Int_t Light) return ADCch; } -//_____________________________________________________________________________ -void AliZDCv1::Hits2Digits(Int_t ntracks) + +//____________________________________________________________________________ +void AliZDCv1::FinishEvent() { - // Creation of the digits from hits +// Code moved to Hits2SDigits(); +} - if(fDigits!=0) fDigits->Clear(); - else fDigits = new TClonesArray ("AliZDCDigit",1000); +//_____________________________________________________________________________ +void AliZDCv1::SDigits2Digits() +{ + Hits2Digits(gAlice->GetNtrack()); +} - char branchname[10]; - sprintf(branchname,"%s",GetName()); - gAlice->TreeD()->Branch(branchname,&fDigits, fBufferSize); - - gAlice->TreeD()->GetEvent(0); - +//_____________________________________________________________________________ +void AliZDCv1::Hits2Digits(Int_t ntracks) +{ AliZDCDigit *newdigit; AliZDCHit *hit; @@ -1221,7 +1226,7 @@ void AliZDCv1::Hits2Digits(Int_t ntracks) } //_____________________________________________________________________________ - void AliZDCv1::MakeBranch(Option_t *opt) + void AliZDCv1::MakeBranch(Option_t *opt, char *file) { // // Create a new branch in the current Root Tree @@ -1229,12 +1234,20 @@ void AliZDCv1::Hits2Digits(Int_t ntracks) AliDetector::MakeBranch(opt); - char branchname[10]; + Char_t branchname[10]; sprintf(branchname,"%s",GetName()); char *cD = strstr(opt,"D"); if (fDigits && gAlice->TreeD() && cD) { - gAlice->TreeD()->Branch(branchname,&fDigits, fBufferSize); + + // Creation of the digits from hits + + if(fDigits!=0) fDigits->Clear(); + else fDigits = new TClonesArray ("AliZDCDigit",1000); + char branchname[10]; + sprintf(branchname,"%s",GetName()); + gAlice->MakeBranchInTree(gAlice->TreeD(), + branchname, &fDigits, fBufferSize, file) ; printf("* AliZDCv1::MakeBranch * Making Branch %s for digits\n\n",branchname); } } diff --git a/ZDC/AliZDCv1.h b/ZDC/AliZDCv1.h index d7763dd812f..67b8203ee79 100644 --- a/ZDC/AliZDCv1.h +++ b/ZDC/AliZDCv1.h @@ -23,7 +23,9 @@ public: virtual void CreateZDC(); virtual void CreateMaterials(); Int_t Digitize(Int_t Det, Int_t Quad, Int_t Light); - virtual void MakeBranch(Option_t* opt); + virtual void FinishEvent(); + virtual void SDigits2Digits(); + virtual void MakeBranch(Option_t* opt, char *file=0); virtual Int_t IsVersion() const {return 1;} virtual void DrawModule(); virtual void Init(); diff --git a/ZDC/ZDCLinkDef.h b/ZDC/ZDCLinkDef.h index 19c87d08b88..8a5c2180593 100644 --- a/ZDC/ZDCLinkDef.h +++ b/ZDC/ZDCLinkDef.h @@ -8,10 +8,10 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class AliZDC; -#pragma link C++ class AliZDCv1; -#pragma link C++ class AliZDCHit; -#pragma link C++ class AliZDCDigit; -#pragma link C++ class AliGenZDC; +#pragma link C++ class AliZDC+; +#pragma link C++ class AliZDCv1+; +#pragma link C++ class AliZDCHit+; +#pragma link C++ class AliZDCDigit+; +#pragma link C++ class AliGenZDC+; #endif diff --git a/macros/Config.C b/macros/Config.C index 5f7f94e7785..0bb7dcb69d5 100644 --- a/macros/Config.C +++ b/macros/Config.C @@ -1,268 +1,586 @@ void Config() { - -new AliGeant3("C++ Interface to Geant3"); - -//======================================================================= -// Create the output file - -TFile *rootfile = new TFile("galice.root","recreate"); -rootfile->SetCompressionLevel(2); -TGeant3 *geant3 = (TGeant3*)gMC; -// -// Set External decayer - AliDecayer* decayer = new AliDecayerPythia(); - decayer->SetForceDecay(all); - decayer->Init(); - gMC->SetExternalDecayer(decayer); -// -// -//======================================================================= -// ******* GEANT STEERING parameters FOR ALICE SIMULATION ******* -geant3->SetTRIG(1); //Number of events to be processed -geant3->SetSWIT(4,10); -geant3->SetDEBU(0,0,1); -//geant3->SetSWIT(2,2); -geant3->SetDCAY(1); -geant3->SetPAIR(1); -geant3->SetCOMP(1); -geant3->SetPHOT(1); -geant3->SetPFIS(0); -geant3->SetDRAY(0); -geant3->SetANNI(1); -geant3->SetBREM(1); -geant3->SetMUNU(1); -geant3->SetCKOV(1); -geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) -geant3->SetLOSS(2); -geant3->SetMULS(1); -geant3->SetRAYL(1); -geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0) -geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks -geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2) -geant3->SetERAN(5.e-7); - -Float_t cut = 1.e-3; // 1MeV cut by default -Float_t tofmax = 1.e10; -// GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX -geant3->SetCUTS(cut,cut, cut, cut, cut, cut, cut, cut, cut, cut, tofmax); -// -//======================================================================= -// ************* STEERING parameters FOR ALICE SIMULATION ************** -// --- Specify event type to be tracked through the ALICE setup -// --- All positions are in cm, angles in degrees, and P and E in GeV -AliGenHIJINGpara *gener = new AliGenHIJINGpara(50); -gener->SetMomentumRange(0,999); -gener->SetPhiRange(0,360); -gener->SetThetaRange(10,170); -gener->SetOrigin(0,0,0); //vertex position -gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position -gener->Init(); -// -// Activate this line if you want the vertex smearing to happen -// track by track -// -//gener->SetVertexSmear(perTrack); - -gAlice->SetField(-999,2); //Specify maximum magnetic field in Tesla (neg. ==> default field) - -Int_t iMAG=1; -Int_t iITS=1; -Int_t iTPC=1; -Int_t iTOF=1; -Int_t iRICH=1; -Int_t iZDC=0; -Int_t iCASTOR=1; -Int_t iTRD=1; -Int_t iABSO=1; -Int_t iDIPO=1; -Int_t iHALL=1; -Int_t iFRAME=1; -Int_t iSHIL=1; -Int_t iPIPE=1; -Int_t iFMD=1; -Int_t iMUON=1; -Int_t iPHOS=1; -Int_t iPMD=1; -Int_t iSTART=0; - -//=================== Alice BODY parameters ============================= -AliBODY *BODY = new AliBODY("BODY","Alice envelop"); - - -if(iMAG) { -//=================== MAG parameters ============================ -// --- Start with Magnet since detector layouts may be depending --- -// --- on the selected Magnet dimensions --- -AliMAG *MAG = new AliMAG("MAG","Magnet"); -} - - -if(iABSO) { -//=================== ABSO parameters ============================ -AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber"); -} - -if(iDIPO) { -//=================== DIPO parameters ============================ - -AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2"); -} - -if(iHALL) { -//=================== HALL parameters ============================ - -AliHALL *HALL = new AliHALL("HALL","Alice Hall"); -} - - -if(iFRAME) { -//=================== FRAME parameters ============================ - -AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame"); - -} - -if(iSHIL) { -//=================== SHIL parameters ============================ - -AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding"); -} - - -if(iPIPE) { -//=================== PIPE parameters ============================ - -AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe"); -} - - -if(iITS) { -//=================== ITS parameters ============================ -// -// EUCLID is a flag to output (=1) both geometry and media to two ASCII files -// (called by default ITSgeometry.euc and ITSgeometry.tme) in a format -// understandable to the CAD system EUCLID. The default (=0) means that you -// dont want to use this facility. -// -AliITS *ITS = new AliITSv5("ITS","normal ITS"); -ITS->SetEUCLID(0); -} - - -if(iTPC) { -//============================ TPC parameters ================================ -// --- This allows the user to specify sectors for the SLOW (TPC geometry 2) -// --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper) -// --- sectors are specified, any value other than that requires at least one -// --- sector (lower or upper)to be specified! -// --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0) -// --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0) -// --- SecLows - number of lower sectors specified (up to 6) -// --- SecUps - number of upper sectors specified (up to 12) -// --- Sens - sensitive strips for the Slow Simulator !!! -// --- This does NOT work if all S or L-sectors are specified, i.e. -// --- if SecAL or SecAU < 0 -// -// -//----------------------------------------------------------------------------- - - // gROOT->LoadMacro("SetTPCParam.C"); - // AliTPCParam *param = SetTPCParam(); - AliTPC *TPC = new AliTPCv1("TPC","Default"); //v1 is default - // TPC->SetParam(param); // pass the parameter object to the TPC - -// set gas mixture - - //TPC->SetGasMixt(2,20,10,-1,0.9,0.1,0.); - //TPC->SetSecAL(4); - //TPC->SetSecAU(4); - //TPC->SetSecLows(1, 2, 3, 19, 20, 21); - //TPC->SetSecUps(37, 38, 39, 37+18, 38+18, 39+18, -1, -1, -1, -1, -1, -1); - //TPC->SetSens(1); - - //if (TPC->IsVersion()==1) param->Write(param->GetTitle()); -} - -if(iTOF) { -//=================== TOF parameters ============================ -AliTOF *TOF = new AliTOFv1("TOF","normal TOF"); -} - -if(iRICH) { -//=================== RICH parameters =========================== + // 7-DEC-2000 09:00 + // Switch on Transition Radiation simulation. 6/12/00 18:00 + // iZDC=1 7/12/00 09:00 + // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00 + + new AliGeant3("C++ Interface to Geant3"); + + if (!gSystem->Getenv("CONFIG_FILE")) { + TFile *rootfile = new TFile("galice.root","recreate"); + rootfile->SetCompressionLevel(2); + } + + TGeant3 *geant3 = (TGeant3*)gMC; + // + // Set External decayer + AliDecayer* decayer = new AliDecayerPythia(); + decayer->SetForceDecay(all); + decayer->Init(); + gMC->SetExternalDecayer(decayer); + // + // + //======================================================================= + // ******* GEANT STEERING parameters FOR ALICE SIMULATION ******* + geant3->SetTRIG(1); //Number of events to be processed + geant3->SetSWIT(4,10); + geant3->SetDEBU(0,0,1); + //geant3->SetSWIT(2,2); + geant3->SetDCAY(1); + geant3->SetPAIR(1); + geant3->SetCOMP(1); + geant3->SetPHOT(1); + geant3->SetPFIS(0); + geant3->SetDRAY(0); + geant3->SetANNI(1); + geant3->SetBREM(1); + geant3->SetMUNU(1); + geant3->SetCKOV(1); + geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3) + geant3->SetLOSS(2); + geant3->SetMULS(1); + geant3->SetRAYL(1); + geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0) + geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks + geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2) + geant3->SetERAN(5.e-7); + + Float_t cut = 1.e-3; // 1MeV cut by default + Float_t tofmax = 1.e10; + // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX + geant3->SetCUTS(cut,cut, cut, cut, cut, cut, cut, cut, cut, cut, tofmax); + // + //======================================================================= + // ************* STEERING parameters FOR ALICE SIMULATION ************** + // --- Specify event type to be tracked through the ALICE setup + // --- All positions are in cm, angles in degrees, and P and E in GeV + if (gSystem->Getenv("CONFIG_NPARTICLES")) { + int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES")); + } else { + int nParticles = 50; + } + AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles); + + gener->SetMomentumRange(0,999); + gener->SetPhiRange(0,360); + // gener->SetThetaRange(0.28,179.72); + gener->SetThetaRange(0.,180.); + gener->SetOrigin(0,0,0); //vertex position + gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position + gener->Init(); + // + // Activate this line if you want the vertex smearing to happen + // track by track + // + //gener->SetVertexSmear(perTrack); + + gAlice->SetField(-999,2); //Specify maximum magnetic field in Tesla (neg. ==> default field) + + Int_t iABSO=1; + Int_t iCASTOR=1; + Int_t iDIPO=1; + Int_t iFMD=1; + Int_t iFRAME=1; + Int_t iHALL=1; + Int_t iITS=1; + Int_t iMAG=1; + Int_t iMUON=1; + Int_t iPHOS=1; + Int_t iPIPE=1; + Int_t iPMD=1; + Int_t iRICH=1; + Int_t iSHIL=1; + Int_t iSTART=1; + Int_t iTOF=1; + Int_t iTPC=1; + Int_t iTRD=1; + Int_t iZDC=1; + + //=================== Alice BODY parameters ============================= + AliBODY *BODY = new AliBODY("BODY","Alice envelop"); + + + if(iMAG) { + //=================== MAG parameters ============================ + // --- Start with Magnet since detector layouts may be depending --- + // --- on the selected Magnet dimensions --- + AliMAG *MAG = new AliMAG("MAG","Magnet"); + } + + + if(iABSO) { + //=================== ABSO parameters ============================ + AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber"); + } + + if(iDIPO) { + //=================== DIPO parameters ============================ + + AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2"); + } + + if(iHALL) { + //=================== HALL parameters ============================ + + AliHALL *HALL = new AliHALL("HALL","Alice Hall"); + } + + + if(iFRAME) { + //=================== FRAME parameters ============================ + + AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame"); + + } + + if(iSHIL) { + //=================== SHIL parameters ============================ + + AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding"); + } + + + if(iPIPE) { + //=================== PIPE parameters ============================ + + AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe"); + } + + + if(iITS) { + //=================== ITS parameters ============================ + // + // As the innermost detector in ALICE, the Inner Tracking System "impacts" on + // almost all other detectors. This involves the fact that the ITS geometry + // still has several options to be followed in parallel in order to determine + // the best set-up which minimizes the induced background. All the geometries + // available to date are described in the following. Read carefully the comments + // and use the default version (the only one uncommented) unless you are making + // comparisons and you know what you are doing. In this case just uncomment the + // ITS geometry you want to use and run Aliroot. + // + // Detailed geometries: + // ==================== + // + // + //AliITS *ITS = new AliITSv3("ITS","Old ITS detailed version as of the ALICE TP"); + // + //AliITS *ITS = new AliITSv5("ITS","Current ITS detailed version used for the ITS TDR"); + // + //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services"); + // + AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services"); + // + // + // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful for reconstruction !): + // ====================================================================================================================== + // + // + //AliITS *ITS = new AliITSv1("ITS","Old ITS coarse version as of the ALICE TP"); + // + //AliITS *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS coarse version with asymmetric services"); + // + //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS coarse version with symmetric services"); + // + // + // Geant3 <-> EUCLID conversion + // ============================ + // + // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and + // media to two ASCII files (called by default ITSgeometry.euc and + // ITSgeometry.tme) in a format understandable to the CAD system EUCLID. + // The default (=0) means that you dont want to use this facility. + // + ITS->SetEUCLID(0); + } + + + if(iTPC) { + //============================ TPC parameters ================================ + // --- This allows the user to specify sectors for the SLOW (TPC geometry 2) + // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper) + // --- sectors are specified, any value other than that requires at least one + // --- sector (lower or upper)to be specified! + // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0) + // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0) + // --- SecLows - number of lower sectors specified (up to 6) + // --- SecUps - number of upper sectors specified (up to 12) + // --- Sens - sensitive strips for the Slow Simulator !!! + // --- This does NOT work if all S or L-sectors are specified, i.e. + // --- if SecAL or SecAU < 0 + // + // + //----------------------------------------------------------------------------- + + // gROOT->LoadMacro("SetTPCParam.C"); + // AliTPCParam *param = SetTPCParam(); + AliTPC *TPC = new AliTPCv2("TPC","Default"); + // All sectors included + TPC->SetSecAL(-1); + TPC->SetSecAU(-1); + + } + + if(iTOF) { + //=================== TOF parameters ============================ + AliTOF *TOF = new AliTOFv2("TOF","normal TOF"); + } + + if(iRICH) { + //=================== RICH parameters =========================== AliRICH *RICH = new AliRICHv1("RICH","normal RICH"); -} + } -if(iZDC) { -//=================== ZDC parameters ============================ + if(iZDC) { + //=================== ZDC parameters ============================ -AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC"); -} + AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC"); + } -if(iCASTOR) { -//=================== CASTOR parameters ============================ + if(iCASTOR) { + //=================== CASTOR parameters ============================ -AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR"); -} + AliCASTOR *CASTOR = new AliCASTORv1("CASTOR","normal CASTOR"); + } -if(iTRD) { -//=================== TRD parameters ============================ + if(iTRD) { + //=================== TRD parameters ============================ - AliTRD *TRD = new AliTRDv0("TRD","TRD fast simulator"); - //TRD->SetHits(); + AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator"); - //AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator"); - //TRD->SetSensPlane(0); - //TRD->SetSensChamber(2); - //TRD->SetSensSector(17); + // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2) + TRD->SetGasMix(1); - // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2) - TRD->SetGasMix(1); - - // With hole in front of PHOS - TRD->SetPHOShole(); - // With hole in front of RICH - TRD->SetRICHhole(); -} - -if(iFMD) { -//=================== FMD parameters ============================ - -AliFMD *FMD = new AliFMDv1("FMD","normal FMD"); -} - -if(iMUON) { -//=================== MUON parameters =========================== - -AliMUON *MUON = new AliMUONv0("MUON","normal MUON"); + // With hole in front of PHOS + TRD->SetPHOShole(); + // With hole in front of RICH + TRD->SetRICHhole(); + // Switch on TR + AliTRDsim *TRDsim = TRD->CreateTR(); + } + + if(iFMD) { + //=================== FMD parameters ============================ + + AliFMD *FMD = new AliFMDv1("FMD","normal FMD"); + } + + if(iMUON) { + //=================== MUON parameters =========================== + + AliMUON *MUON = new AliMUONv1("MUON","normal MUON"); + MUON->SetIshunt(0); + MUON->SetMaxStepGas(0.1); + MUON->SetMaxStepAlu(0.1); + // + // Version 0 + // + // First define the number of planes that are segmented (1 or 2) by a call + // to SetNsec. + // Then chose for each chamber (chamber plane) the segmentation + // and response model. + // They should be equal for the two chambers of each station. In a future + // version this will be enforced. + // + // + Int_t chamber; + Int_t station; + // Default response + AliMUONResponseV0* response0 = new AliMUONResponseV0; + response0->SetSqrtKx3(0.7131); + response0->SetKx2(1.0107); + response0->SetKx4(0.4036); + response0->SetSqrtKy3(0.7642); + response0->SetKy2(0.9706); + response0->SetKy4(0.3831); + response0->SetPitch(0.25); + response0->SetSigmaIntegration(10.); + response0->SetChargeSlope(50); + response0->SetChargeSpread(0.18, 0.18); + response0->SetMaxAdc(4096); + response0->SetZeroSuppression(6); + //-------------------------------------------------------- + // Configuration for Chamber TC1/2 (Station 1) ---------- + //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + Float_t rseg1[4]={17.5, 55.2, 71.3, 95.5}; + Int_t nseg1[4]={4, 4, 2, 1}; + // + chamber=1; + //^^^^^^^^^ + MUON->SetNsec(chamber-1,2); + // + AliMUONSegmentationV01 *seg11=new AliMUONSegmentationV01; + + seg11->SetSegRadii(rseg1); + seg11->SetPadSize(3, 0.5); + seg11->SetDAnod(3.0/3./4); + seg11->SetPadDivision(nseg1); + + MUON->SetSegmentationModel(chamber-1, 1, seg11); + // + AliMUONSegmentationV02 *seg12=new AliMUONSegmentationV02; + seg12->SetSegRadii(rseg1); + seg12->SetPadSize(0.75, 2.0); + seg12->SetDAnod(3.0/3./4); + seg12->SetPadDivision(nseg1); + + MUON->SetSegmentationModel(chamber-1, 2, seg12); + + MUON->SetResponseModel(chamber-1, response0); + + chamber=2; + //^^^^^^^^^ + // + MUON->SetNsec(chamber-1,2); + // + AliMUONSegmentationV01 *seg21=new AliMUONSegmentationV01; + seg21->SetSegRadii(rseg1); + seg21->SetPadSize(3, 0.5); + seg21->SetDAnod(3.0/3./4); + seg21->SetPadDivision(nseg1); + MUON->SetSegmentationModel(chamber-1, 1, seg21); + // + AliMUONSegmentationV02 *seg22=new AliMUONSegmentationV02; + seg22->SetSegRadii(rseg1); + seg22->SetPadSize(0.75, 2.); + seg22->SetDAnod(3.0/3./4); + seg22->SetPadDivision(nseg1); + MUON->SetSegmentationModel(chamber-1, 2, seg22); + + MUON->SetResponseModel(chamber-1, response0); + // + //-------------------------------------------------------- + // Configuration for Chamber TC3/4 ----------------------- + ///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + // Float_t rseg2[4]={23.5, 87.7, 122.4, 122.5}; + Float_t rseg2[4]={23.5, 47.1, 87.7, 122.5}; + Int_t nseg2[4]={4, 4, 2, 1}; + // + chamber=3; + //^^^^^^^^^ + MUON->SetNsec(chamber-1,2); + // + AliMUONSegmentationV01 *seg31=new AliMUONSegmentationV01; + seg31->SetSegRadii(rseg2); + seg31->SetPadSize(6, 0.5); + seg31->SetDAnod(3.0/3./4); + seg31->SetPadDivision(nseg2); + MUON->SetSegmentationModel(chamber-1, 1, seg31); + // + AliMUONSegmentationV02 *seg32=new AliMUONSegmentationV02; + seg32->SetSegRadii(rseg2); + seg32->SetPadSize(0.75, 4.); + seg32->SetPadDivision(nseg2); + seg32->SetDAnod(3.0/3./4); + + MUON->SetSegmentationModel(chamber-1, 2, seg32); + + MUON->SetResponseModel(chamber-1, response0); + + chamber=4; + //^^^^^^^^^ + // + MUON->SetNsec(chamber-1,2); + // + AliMUONSegmentationV01 *seg41=new AliMUONSegmentationV01; + seg41->SetSegRadii(rseg2); + seg41->SetPadSize(6, 0.5); + seg41->SetDAnod(3.0/3./4); + seg41->SetPadDivision(nseg2); + MUON->SetSegmentationModel(chamber-1, 1, seg41); + // + AliMUONSegmentationV02 *seg42=new AliMUONSegmentationV02; + seg42->SetSegRadii(rseg2); + seg42->SetPadSize(0.75, 4.); + seg42->SetPadDivision(nseg2); + seg42->SetDAnod(3.0/3./4); + + MUON->SetSegmentationModel(chamber-1, 2, seg42); + + MUON->SetResponseModel(chamber-1, response0); + + + //-------------------------------------------------------- + // Configuration for Chamber TC5/6 ----------------------- + //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + seg5 = new AliMUONSegmentationV1; + AliMUONResponseV0* response5 = new AliMUONResponseV0; + // K3 = 0.62 + response5->SetSqrtKx3(0.78740079); + response5->SetKx2(0.95237319); // 0.5 * kPI * (1- 0.5*sqrtky3 ) + response5->SetKx4(0.37480633); // 0.25/TMath::ATan(sqrtkx3) + // K3 = 0.55 + response5->SetSqrtKy3(0.74161985); + response5->SetKy2(0.98832946); + response5->SetKy4(0.39177817); + response5->SetPitch(0.325); + response5->SetSigmaIntegration(10.); + response5->SetChargeSlope(50); + response5->SetChargeSpread(0.4, 0.4); + response5->SetMaxAdc(4096); + response5->SetZeroSuppression(6); + -} + chamber=5; + MUON->SetNsec(chamber-1,1); + MUON->SetSegmentationModel(chamber-1, 1, seg5); + MUON->SetResponseModel(chamber-1, response5); + + chamber=6; + MUON->SetNsec(chamber-1,1); + MUON->SetSegmentationModel(chamber-1, 1, seg5); + MUON->SetResponseModel(chamber-1, response5); + // + // Station 3 + station=3; + MUON->SetPadSize(station, 1, 0.975, 0.55); + + //-------------------------------------------------------- + // Configuration for Chamber TC7/8 (Station 4) ---------- + //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Int_t nseg4[4]={4, 4, 2, 1}; + + chamber=7; + //^^^^^^^^^ + MUON->SetNsec(chamber-1,2); + // + AliMUONSegmentationV04 *seg71=new AliMUONSegmentationV04; + seg71->SetPadSize(10.,0.5); + seg71->SetDAnod(0.25); + seg71->SetPadDivision(nseg4); + MUON->SetSegmentationModel(chamber-1, 1, seg71); + AliMUONSegmentationV05 *seg72=new AliMUONSegmentationV05; + seg72->SetPadSize(1,10); + seg72->SetDAnod(0.25); + seg72->SetPadDivision(nseg4); + MUON->SetSegmentationModel(chamber-1, 2, seg72); + + MUON->SetResponseModel(chamber-1, response0); + + chamber=8; + //^^^^^^^^^ + MUON->SetNsec(chamber-1,2); + AliMUONSegmentationV04 *seg81=new AliMUONSegmentationV04; + seg81->SetPadSize(10., 0.5); + seg81->SetPadDivision(nseg4); + seg81->SetDAnod(0.25); + MUON->SetSegmentationModel(chamber-1, 1, seg81); + + AliMUONSegmentationV05 *seg82=new AliMUONSegmentationV05; + seg82->SetPadSize(1, 10); + seg82->SetPadDivision(nseg4); + seg82->SetDAnod(0.25); + MUON->SetSegmentationModel(chamber-1, 2, seg82); + + MUON->SetResponseModel(chamber-1, response0); + //-------------------------------------------------------- + // Configuration for Chamber TC9/10 (Station 5) --------- + //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + chamber=9; + //^^^^^^^^^ + MUON->SetNsec(chamber-1,2); + // + AliMUONSegmentationV04 *seg91=new AliMUONSegmentationV04; + seg91->SetPadSize(10.,0.5); + seg91->SetDAnod(0.25); + seg91->SetPadDivision(nseg4); + MUON->SetSegmentationModel(chamber-1, 1, seg91); + + AliMUONSegmentationV05 *seg92=new AliMUONSegmentationV05; + seg92->SetPadSize(1,10); + seg92->SetDAnod(0.25); + seg92->SetPadDivision(nseg4); + + MUON->SetSegmentationModel(chamber-1, 2, seg92); + + MUON->SetResponseModel(chamber-1, response0); + + chamber=10; + //^^^^^^^^^ + MUON->SetNsec(chamber-1,2); + AliMUONSegmentationV04 *seg101=new AliMUONSegmentationV04; + seg101->SetPadSize(10., 0.5); + seg101->SetPadDivision(nseg4); + seg101->SetDAnod(0.25); + MUON->SetSegmentationModel(chamber-1, 1, seg101); + + AliMUONSegmentationV05 *seg102=new AliMUONSegmentationV05; + seg102->SetPadSize(1,10); + seg102->SetPadDivision(nseg4); + seg102->SetDAnod(0.25); + MUON->SetSegmentationModel(chamber-1, 2, seg102); + + MUON->SetResponseModel(chamber-1, response0); + + //-------------------------------------------------------- + // Configuration for Trigger staions --------------------- + //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + AliMUONResponseTrigger* responseTrigger0 = new AliMUONResponseTrigger; + + chamber=11; + MUON->SetNsec(chamber-1,2); + AliMUONSegmentationTriggerX *seg111=new AliMUONSegmentationTriggerX; + MUON->SetSegmentationModel(chamber-1, 1, seg111); + AliMUONSegmentationTriggerY *seg112=new AliMUONSegmentationTriggerY; + MUON->SetSegmentationModel(chamber-1, 2, seg112); + + MUON->SetResponseModel(chamber-1, responseTrigger0); + + chamber=12; + MUON->SetNsec(chamber-1,2); + AliMUONSegmentationTriggerX *seg121=new AliMUONSegmentationTriggerX; + MUON->SetSegmentationModel(chamber-1, 1, seg121); + AliMUONSegmentationTriggerY *seg122=new AliMUONSegmentationTriggerY; + MUON->SetSegmentationModel(chamber-1, 2, seg122); + + MUON->SetResponseModel(chamber-1, responseTrigger0); + + chamber=13; + MUON->SetNsec(chamber-1,2); + AliMUONSegmentationTriggerX *seg131=new AliMUONSegmentationTriggerX; + MUON->SetSegmentationModel(chamber-1, 1, seg131); + AliMUONSegmentationTriggerY *seg132=new AliMUONSegmentationTriggerY; + MUON->SetSegmentationModel(chamber-1, 2, seg132); + MUON->SetResponseModel(chamber-1, responseTrigger0); + + chamber=14; + MUON->SetNsec(chamber-1,2); + AliMUONSegmentationTriggerX *seg141=new AliMUONSegmentationTriggerX; + MUON->SetSegmentationModel(chamber-1, 1, seg141); + AliMUONSegmentationTriggerY *seg142=new AliMUONSegmentationTriggerY; + MUON->SetSegmentationModel(chamber-1, 2, seg142); + + MUON->SetResponseModel(chamber-1, responseTrigger0); + } -//=================== PHOS parameters =========================== + //=================== PHOS parameters =========================== -if(iPHOS) { - AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2"); -} + if(iPHOS) { + AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2"); + } -if(iPMD) { -//=================== PMD parameters ============================ + if(iPMD) { + //=================== PMD parameters ============================ -AliPMD *PMD = new AliPMDv0("PMD","normal PMD"); -PMD->SetPAR(1., 1., 0.8, 0.02); -PMD->SetIN(6., 18., -580., 27., 27.); -PMD->SetGEO(0.0, 0.2, 4.); -PMD->SetPadSize(0.8, 1.0, 1.0, 1.5); + AliPMD *PMD = new AliPMDv1("PMD","normal PMD"); + PMD->SetPAR(1., 1., 0.8, 0.02); + PMD->SetIN(6., 18., -580., 27., 27.); + PMD->SetGEO(0.0, 0.2, 4.); + PMD->SetPadSize(0.8, 1.0, 1.0, 1.5); -} + } -if(iSTART) { -//=================== START parameters ============================ -AliSTART *START = new AliSTARTv1("START","START Detector"); -} + if(iSTART) { + //=================== START parameters ============================ + AliSTART *START = new AliSTARTv1("START","START Detector"); + } } + -- 2.43.0