From 9e1a0ddb8feb3fb19ca04ee19673f48c265a8fe6 Mon Sep 17 00:00:00 2001 From: alibrary Date: Wed, 16 May 2001 14:57:30 +0000 Subject: [PATCH] New files for folders and Stack --- ALIROOT/aliroot.cxx | 11 +- ALIROOT/dummies.c | 7 +- CASTOR/AliCASTOR.cxx | 25 +- CONTAINERS/AliArrayVT.h | 5 +- CONTAINERS/AliMemArray.h | 3 +- CONTAINERS/AliObjectArray.h | 3 +- EVGEN/AliGenHIJINGpara.cxx | 6 +- EVGEN/EVGENLinkDef.h | 1 - EVGEN/Makefile | 4 +- FMD/AliFMD.cxx | 37 +- FMD/AliFMD.h | 2 +- FMD/AliFMDSDigitizer.cxx | 6 +- FMD/AliFMDv0.cxx | 9 +- FMD/AliFMDv1.cxx | 15 +- GEANT321/ggeom/ggordq.F | 18 +- GEANT321/gphys/gphysi.F | 184 +++-- GEANT321/gtrak/gtreveroot.F | 18 +- ITS/AliITS.cxx | 15 +- ITS/AliITS.h | 2 +- ITS/AliITSClusterFinderSDD.cxx | 2 +- ITS/AliITSgeomSDD.h | 4 +- ITS/AliITSsegmentationSSD.cxx | 5 + ITS/AliITSv5asymm.cxx | 38 +- MUON/AliMUON.cxx | 28 +- MUON/AliMUON.h | 2 +- MUON/AliMUONDisplay.cxx | 5 + MUON/AliMUONFactory.cxx | 27 +- MUON/AliMUONRecoDisplay.cxx | 7 + MUON/AliMUONRecoEvent.cxx | 7 + MUON/AliMUONSegmentationSlat.cxx | 5 +- MUON/AliMUONSegmentationSlatModule.cxx | 5 +- MUON/AliMUONSegmentationSlatModuleN.cxx | 5 +- MUON/AliMUONSegmentationTrigger.cxx | 11 +- MUON/AliMUONSegmentationTriggerX.cxx | 6 +- MUON/AliMUONSegmentationTriggerY.cxx | 8 +- MUON/AliMUONSegmentationV01.cxx | 5 +- MUON/AliMUONSegmentationV04.cxx | 5 +- MUON/AliMUONSegmentationV05.cxx | 5 +- MUON/AliMUONv1.cxx | 12 +- PHOS/AliPHOSv0.cxx | 34 +- PHOS/AliPHOSv4.cxx | 6 +- PHOS/AliPHOSv4.h | 2 +- PHOS/AliPHOSvFast.cxx | 6 +- PHOS/AliPHOSvFast.h | 2 +- PMD/AliPMD.cxx | 9 +- PMD/AliPMD.h | 2 +- PMD/AliPMDv1.cxx | 33 +- PMD/AliPMDv3.cxx | 822 ++++++++++++++++++++++ RICH/AliRICH.cxx | 32 +- RICH/AliRICH.h | 2 +- RICH/AliRICHDisplay.cxx | 4 + RICH/AliRICHMerger.cxx | 12 +- RICH/AliRICHv0.cxx | 46 +- RICH/AliRICHv1.cxx | 49 +- RICH/AliRICHv2.cxx | 50 +- START/AliSTART.cxx | 34 +- START/AliSTART.h | 2 +- START/AliSTARTv1.cxx | 8 +- STEER/AliConfig.cxx | 285 ++++++++ STEER/AliConfig.h | 57 ++ STEER/AliDetector.cxx | 102 ++- STEER/AliDetector.h | 8 +- STEER/AliDisplay.cxx | 4 + {EVGEN => STEER}/AliGenEventHeader.cxx | 18 +- {EVGEN => STEER}/AliGenEventHeader.h | 17 +- STEER/AliGenKine.cxx | 149 ++++ STEER/AliGenKine.h | 60 ++ STEER/AliGenerator.cxx | 6 + STEER/AliHeader.cxx | 40 +- STEER/AliHeader.h | 12 +- STEER/AliLegoGenerator.cxx | 5 +- STEER/AliLegoGeneratorEta.cxx | 5 +- STEER/AliLegoGeneratorPhiZ.cxx | 5 +- STEER/AliLegoGeneratorXYZ.cxx | 5 +- STEER/AliMC.cxx | 5 + STEER/AliMagF.cxx | 8 + STEER/AliMagF.h | 3 + STEER/AliMagFCM.cxx | 18 +- STEER/AliModule.cxx | 17 +- STEER/AliModule.h | 2 +- STEER/AliRun.cxx | 871 ++++++----------------- STEER/AliRun.h | 52 +- STEER/AliStack.cxx | 776 +++++++++++++++++++++ STEER/AliStack.h | 112 +++ STEER/Makefile | 5 +- STEER/STEERLinkDef.h | 3 + STRUCT/AliABSOv0.cxx | 22 +- STRUCT/AliDIPO.cxx | 23 +- STRUCT/AliFRAMEv1.cxx | 34 +- STRUCT/AliHALL.cxx | 23 +- STRUCT/AliMAG.cxx | 23 +- STRUCT/AliPIPEv0.cxx | 8 +- STRUCT/AliPIPEvTemp.cxx | 889 ++++++++++++++++++++++++ STRUCT/AliSHIL.cxx | 23 +- TGeant3/AliGeant3.cxx | 24 + TGeant3/TGeant3.h | 61 +- TOF/AliTOF.cxx | 7 +- TOF/AliTOF.h | 2 +- TOF/AliTOFv0.cxx | 26 +- TOF/AliTOFv1.cxx | 11 +- TOF/AliTOFv2.cxx | 70 +- TOF/AliTOFv3.cxx | 76 +- TOF/AliTOFv4.cxx | 77 +- TPC/AliTPC.cxx | 45 +- TPC/AliTPC.h | 4 +- TPC/AliTPCtracker.cxx | 5 +- TPC/AliTPCv2.cxx | 19 +- TRD/AliTRD.cxx | 52 +- TRD/AliTRD.h | 2 +- TRD/AliTRDdigitizer.h | 1 + TRD/AliTRDdigitsManager.cxx | 18 +- TRD/AliTRDv1.cxx | 16 +- ZDC/AliZDCv1.cxx | 9 +- ZDC/AliZDCv1.h | 2 +- man/man4/alifs.4 | 51 ++ man/man4/alirun.4 | 143 ++++ man/man4/mangen.4 | 52 ++ share/alifs | 126 ++-- share/alirun | 51 +- share/castor.sh | 55 ++ share/makepatch | 20 + share/rfio.sh | 50 ++ 122 files changed, 5091 insertions(+), 1397 deletions(-) create mode 100644 PMD/AliPMDv3.cxx create mode 100644 STEER/AliConfig.cxx create mode 100644 STEER/AliConfig.h rename {EVGEN => STEER}/AliGenEventHeader.cxx (86%) rename {EVGEN => STEER}/AliGenEventHeader.h (56%) create mode 100644 STEER/AliGenKine.cxx create mode 100644 STEER/AliGenKine.h create mode 100644 STEER/AliStack.cxx create mode 100644 STEER/AliStack.h create mode 100644 STRUCT/AliPIPEvTemp.cxx create mode 100644 man/man4/alifs.4 create mode 100644 man/man4/alirun.4 create mode 100644 man/man4/mangen.4 create mode 100644 share/castor.sh create mode 100755 share/makepatch create mode 100644 share/rfio.sh diff --git a/ALIROOT/aliroot.cxx b/ALIROOT/aliroot.cxx index ff1e727897f..55906f90931 100644 --- a/ALIROOT/aliroot.cxx +++ b/ALIROOT/aliroot.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2000/12/20 08:39:37 fca +Support for Cerenkov and process list in Virtual MC + Revision 1.3 1999/09/29 09:24:07 fca Introduction of the Copyright and cvs Log @@ -42,6 +45,7 @@ Introduction of the Copyright and cvs Log #include #include #include +#include #if defined __linux //On linux Fortran wants this, so we give to it! @@ -77,9 +81,12 @@ int main(int argc, char **argv) // in the run is stored in the same file in the tree TreeE, containing the // run and event number, the number of vertices, tracks and primary tracks // in the event. - // - new AliRun("gAlice","The ALICE Off-line Simulation Framework"); + // Create new configuration + new AliConfig ("Folders","Alice data exchange"); + + new AliRun("gAlice","The ALICE Off-line Simulation Framework"); + // Start interactive geant TRint *theApp = new TRint("aliroot", &argc, argv, 0, 0); diff --git a/ALIROOT/dummies.c b/ALIROOT/dummies.c index 5dcbee76b65..8f7f5418bd0 100644 --- a/ALIROOT/dummies.c +++ b/ALIROOT/dummies.c @@ -1,9 +1,10 @@ #ifdef __linux #include void __attribute__ ((constructor)) -trapfpe () { - (void) __setfpucw (_FPU_DEFAULT & - ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM)); + trapfpe () { + fpu_control_t cw = _FPU_DEFAULT & ~(_FPU_MASK_IM | _FPU_MASK_ZM | + _FPU_MASK_OM); + _FPU_SETCW(cw); } void MAIN__() {} #endif diff --git a/CASTOR/AliCASTOR.cxx b/CASTOR/AliCASTOR.cxx index 0502eb6f3c9..428c7b511ab 100644 --- a/CASTOR/AliCASTOR.cxx +++ b/CASTOR/AliCASTOR.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.9 2000/12/04 08:48:15 alibrary +Fixing problems in the HEAD + Revision 1.8 2000/10/02 21:28:05 fca Removal of useless dependecies via forward declarations @@ -227,7 +230,7 @@ void AliCASTORv1::CreateGeometry() const Float_t kDiamCladding = 0.045; Int_t i; - static Int_t debugFlag = 0; + static Int_t debugFlag = fDebug-1; Int_t *idtmed = fIdtmed->GetArray()-1499; @@ -926,15 +929,17 @@ void AliCASTORv1::Init() // Int_t i; // - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" CASTOR_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - // - // Here the ABSO initialisation code (if any!) - for(i=0;i<80;i++) printf("*"); - printf("\n"); + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" CASTOR_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + // + // Here the ABSO initialisation code (if any!) + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } } ClassImp(AliCASTORhit) diff --git a/CONTAINERS/AliArrayVT.h b/CONTAINERS/AliArrayVT.h index 2b45269f129..6461007a518 100644 --- a/CONTAINERS/AliArrayVT.h +++ b/CONTAINERS/AliArrayVT.h @@ -38,9 +38,10 @@ public: void (*streamb)(TBuffer &, const void *,UInt_t); void (*dump)(void*); TString fClassName; //class name of the object - TClass * fClass; //class type of the object + TClass * fClass; //!class type of the object UInt_t fSize; //size of object - ClassDef(AliArrayVT,0) + //ClassDef(AliArrayVT,0) + ClassDef(AliArrayVT,1) }; #endif //ALIARRAYVT diff --git a/CONTAINERS/AliMemArray.h b/CONTAINERS/AliMemArray.h index b005c720877..628ef16ad1d 100644 --- a/CONTAINERS/AliMemArray.h +++ b/CONTAINERS/AliMemArray.h @@ -68,7 +68,8 @@ protected: // private: void * fCont; //!data buffer - ClassDef(AliMemArray,0) + //ClassDef(AliMemArray,0) + ClassDef(AliMemArray,1) }; void * AliMemArray::Unchecked1DAt(UInt_t i) const diff --git a/CONTAINERS/AliObjectArray.h b/CONTAINERS/AliObjectArray.h index 91a08deafdc..c1308e2dd29 100644 --- a/CONTAINERS/AliObjectArray.h +++ b/CONTAINERS/AliObjectArray.h @@ -39,7 +39,8 @@ protected : private: AliClassInfo *fClassInfo; //pointer to containg class info // - ClassDef(AliObjectArray,0) + //ClassDef(AliObjectArray,0) + ClassDef(AliObjectArray,1) }; diff --git a/EVGEN/AliGenHIJINGpara.cxx b/EVGEN/AliGenHIJINGpara.cxx index 9d5cb519d9a..c7044d974dd 100644 --- a/EVGEN/AliGenHIJINGpara.cxx +++ b/EVGEN/AliGenHIJINGpara.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.5 2000/12/21 16:24:06 morsch +Coding convention clean-up + Revision 1.4 2000/11/30 07:12:50 alibrary Introducing new Rndm and QA classes @@ -234,7 +237,8 @@ void AliGenHIJINGpara::Init() Float_t phiFrac = (fPhiMax-fPhiMin)/2/TMath::Pi(); fParentWeight = Float_t(fNpart)/intETASel*ptFrac*phiFrac; - printf("\n The number of particles in the selected kinematic region corresponds to %f percent of a full event\n ", 100.*fParentWeight); + printf("%s: The number of particles in the selected kinematic region corresponds to %f percent of a full event\n ", + ClassName(),100.*fParentWeight); } diff --git a/EVGEN/EVGENLinkDef.h b/EVGEN/EVGENLinkDef.h index 8817eef5e9f..aafb37e2c27 100644 --- a/EVGEN/EVGENLinkDef.h +++ b/EVGEN/EVGENLinkDef.h @@ -33,7 +33,6 @@ #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+; diff --git a/EVGEN/Makefile b/EVGEN/Makefile index f76966efe8d..2765724c752 100644 --- a/EVGEN/Makefile +++ b/EVGEN/Makefile @@ -19,7 +19,7 @@ SRCS = AliGenHIJINGpara.cxx AliGenBox.cxx AliGenFixed.cxx \ AliGenDoubleScan.cxx AliGenCocktailEntry.cxx \ AliGenGSIlib.cxx AliGenPMDlib.cxx\ AliGenHijing.cxx \ - AliGenEventHeader.cxx AliGenHijingEventHeader.cxx \ + AliGenHijingEventHeader.cxx \ AliDecayer.cxx AliDecayerPythia.cxx \ AliGenMevSim.cxx AliMevSimParticle.cxx AliMevSimConfig.cxx # C++ Headers @@ -49,7 +49,7 @@ OBJS = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(SRCS)) $(DICTO) # C++ compilation flags -CXXFLAGS = $(CXXOPTS) -I$(ROOTSYS)/include -I. -I$(ALICE_ROOT)/include/ -I$(ALICE_ROOT)/TMevSim +CXXFLAGS = $(CXXOPTS) -I$(ROOTSYS)/include -I$(ALICE_ROOT)/include/ -I$(ALICE_ROOT)/TMevSim -I. # FORTRAN compilation flags diff --git a/FMD/AliFMD.cxx b/FMD/AliFMD.cxx index d66871e01a1..84ff0b8f7f8 100644 --- a/FMD/AliFMD.cxx +++ b/FMD/AliFMD.cxx @@ -123,6 +123,7 @@ void AliFMD::AddDigit( Int_t *digits) { // add a real digit - as coming from data + // printf("AddDigit\n"); TClonesArray &ldigits = *fDigits; new(ldigits[fNdigits++]) AliFMDdigit(digits); @@ -214,15 +215,17 @@ void AliFMD::Init() Int_t i; AliMC* pMC = AliMC::GetMC(); // - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" FMD_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - // - // Here the FMD initialisation code (if any!) - for(i=0;i<80;i++) printf("*"); - printf("\n"); + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" FMD_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + // + // Here the FMD initialisation code (if any!) + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } // // if (IsVersion()!=0) @@ -232,7 +235,7 @@ void AliFMD::Init() } //--------------------------------------------------------------------- -void AliFMD::MakeBranch(Option_t* option, char *file) +void AliFMD::MakeBranch(Option_t* option, const char *file) { // Create Tree branches for the FMD. const Int_t kBufferSize = 4000; @@ -245,8 +248,8 @@ void AliFMD::MakeBranch(Option_t* option, char *file) if (cD) { - gAlice->MakeBranchInTree(gAlice->TreeD(), - branchname, &fDigits, kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeD(), + branchname, &fDigits, kBufferSize, file); printf("Making Branch %s for digits\n",branchname); gAlice->TreeD()->Print(); @@ -311,17 +314,15 @@ void AliFMD::Eta2Radius(Float_t eta, Float_t zDisk, Float_t *radius) Float_t rad=zDisk*(TMath::Tan(theta)); *radius=rad; - printf(" eta %f radius %f\n", eta, rad); + if(fDebug) printf("%s: eta %f radius %f\n", ClassName(), eta, rad); } //--------------------------------------------------------------------- void AliFMD::Hits2SDigits(){ -#ifdef DEBUG - cout<<"ALiFMD::Hits2SDigits> start...\n"; -#endif - char * fileSDigits = 0 ; - char * fileHeader=0 ; + if(fDebug) cout << ClassName() << ": ALiFMD::Hits2SDigits> start...\n"; + // char * fileSDigits = 0 ; + // char * fileHeader=0 ; AliFMDSDigitizer * sd = new AliFMDSDigitizer("mgalice.root","FMD.SDigit.root") ; sd->Exec("") ; sd->Print(""); diff --git a/FMD/AliFMD.h b/FMD/AliFMD.h index 9de06580ddb..9b0bff13974 100644 --- a/FMD/AliFMD.h +++ b/FMD/AliFMD.h @@ -26,7 +26,7 @@ public: virtual Int_t DistanceToPrimitive(Int_t px, Int_t py); virtual Int_t IsVersion() const =0; virtual void Init(); - virtual void MakeBranch(Option_t *opt=" ",char *file=0); + virtual void MakeBranch(Option_t *opt=" ",const char *file=0); virtual void SetTreeAddress(); virtual void ResetHits(); virtual void ResetDigits(); diff --git a/FMD/AliFMDSDigitizer.cxx b/FMD/AliFMDSDigitizer.cxx index 9f9b64d1c8d..8fd5e82b5bb 100644 --- a/FMD/AliFMDSDigitizer.cxx +++ b/FMD/AliFMDSDigitizer.cxx @@ -120,12 +120,13 @@ void AliFMDSDigitizer::Exec(Option_t *option) { cout<<" FILE =0 "<MakeBranchInTree(gAlice->TreeS(),branchname,&sdigits,bufferSize,file); + FMD->MakeBranchInTree(gAlice->TreeS(),branchname,&sdigits,bufferSize,file); + /* Int_t splitlevel = 0 ; sprintf(branchname,"AliFMDSDigitizer"); AliFMDSDigitizer * sd = this ; - gAlice->MakeBranchInTree(gAlice->TreeS(),branchname,"AliFMDSDigitizer",&sd, bufferSize, splitlevel,file); + FMD->MakeBranchInTree(gAlice->TreeS(),branchname,"AliFMDSDigitizer",&sd, bufferSize, splitlevel,file); */ //Now made SDigits from hits, for PHOS it is the same @@ -206,6 +207,7 @@ void AliFMDSDigitizer::Exec(Option_t *option) { delete sdigits ; sdigits = 0; } + if(file) file->Close() ; diff --git a/FMD/AliFMDv0.cxx b/FMD/AliFMDv0.cxx index b98cecd04b7..2825c85733c 100644 --- a/FMD/AliFMDv0.cxx +++ b/FMD/AliFMDv0.cxx @@ -108,10 +108,11 @@ void AliFMDv0::CreateGeometry() for (ifmd =0; ifmd < 6; ifmd++){ sprintf(name,"FMD%d",ifmd); - printf(name); + if(fDebug) + printf("%s: %s",ClassName(),name); zfmd=TMath::Abs(z[ifmd]); - printf("zfmd %f z[ifmd] %f",zfmd,z[ifmd]); + if(fDebug) printf("zfmd %f z[ifmd] %f",zfmd,z[ifmd]); AliFMD::Eta2Radius(etain[ifmd],zfmd,&rin[ifmd]); AliFMD::Eta2Radius(etaout[ifmd],zfmd,&rout[ifmd]); @@ -120,7 +121,7 @@ void AliFMDv0::CreateGeometry() par[2]=zFMD/2; gMC->Gsvolu(name,"TUBE", idtmed[3], par, 3); - printf ("rin %f rout %f ZFMD %f\n",par[0],par[1],z[ifmd]); + if(fDebug) printf ("rin %f rout %f ZFMD %f\n",par[0],par[1],z[ifmd]); if (z[ifmd] < 0){ gMC->Gspos(name,1,"ALIC",0,0,z[ifmd],0, "ONLY");} else { @@ -217,7 +218,7 @@ void AliFMDv0::Init() AliMC* gMC=AliMC::GetMC(); AliFMD::Init(); fIdSens1=gMC->VolId("GFSI"); -printf("*** FMD version 0 initialized ***\n"); +if(fDebug) printf("%s: *** FMD version 0 initialized ***\n",ClassName()); } //------------------------------------------------------------------- diff --git a/FMD/AliFMDv1.cxx b/FMD/AliFMDv1.cxx index 82e90efdca1..3639c314ba4 100644 --- a/FMD/AliFMDv1.cxx +++ b/FMD/AliFMDv1.cxx @@ -112,10 +112,11 @@ void AliFMDv1::CreateGeometry() for (ifmd =0; ifmd < 4; ifmd++){ sprintf(name,"FMD%d",ifmd); - printf(name); + if(fDebug) + printf("%s: %s",ClassName(),name); zfmd=TMath::Abs(z[ifmd]); - printf("zfmd %f z[ifmd] %f",zfmd,z[ifmd]); + if(fDebug) printf("zfmd %f z[ifmd] %f",zfmd,z[ifmd]); AliFMD::Eta2Radius(etain[ifmd],zfmd,&rin[ifmd]); AliFMD::Eta2Radius(etaout[ifmd],zfmd,&rout[ifmd]); @@ -124,7 +125,7 @@ void AliFMDv1::CreateGeometry() par[2]=zFMD/2; gMC->Gsvolu(name,"TUBE", idtmed[3], par, 3); - printf ("rin %f rout %f ZFMD %f\n",par[0],par[1],z[ifmd]); + if(fDebug) printf ("rin %f rout %f ZFMD %f\n",par[0],par[1],z[ifmd]); if (z[ifmd] < 0){ gMC->Gspos(name,1,"ALIC",0,0,z[ifmd],0, "ONLY");} else { @@ -227,10 +228,10 @@ void AliFMDv1::Init() { // Initialises version 0 of the Forward Multiplicity Detector // -AliMC* gMC=AliMC::GetMC(); -AliFMD::Init(); -fIdSens1=gMC->VolId("GRIN"); -printf("*** FMD version 1 initialized ***\n"); + AliMC* gMC=AliMC::GetMC(); + AliFMD::Init(); + fIdSens1=gMC->VolId("GRIN"); + if(fDebug) printf("%s: *** FMD version 1 initialized ***\n",ClassName()); } //------------------------------------------------------------------- diff --git a/GEANT321/ggeom/ggordq.F b/GEANT321/ggeom/ggordq.F index 9f304d4366a..7ed54d9abf4 100644 --- a/GEANT321/ggeom/ggordq.F +++ b/GEANT321/ggeom/ggordq.F @@ -2,6 +2,9 @@ * $Id$ * * $Log$ +* Revision 1.1.1.1 1999/05/18 15:55:17 fca +* AliRoot sources +* * Revision 1.1.1.1 1995/10/24 10:20:49 cernlib * Geant * @@ -32,6 +35,7 @@ C. ***************************************************************** C. #include "geant321/gcbank.inc" #include "geant321/gcunit.inc" +#include "geant321/gcflag.inc" * DIMENSION CLOW(500),CHIGH(500),CORD(1000),ITYPE(1000), @@ -183,17 +187,21 @@ C. ------------------------------------------------------------------ IF(IAXNOW.GT.0)THEN - WRITE (CHMAIL,1002) NAME,NIN,IAXOPT,NDIVB,RBEST,IAXNOW - CALL GMAIL (0, 0) + IF(IDEBUG.NE.0) THEN + WRITE (CHMAIL,1002) NAME,NIN,IAXOPT,NDIVB,RBEST,IAXNOW + CALL GMAIL (0, 0) 1002 FORMAT(' GGORDQ : Volume ',A4,2X,'NIN=',I4,' IAX=',I2,2X, + 'NDIV=',I3,2X,'NVOL/DIV=',F5.1,2X,'IAX wanted by user:',I2) + ENDIF ELSE - - WRITE (CHMAIL,1003) NAME,NIN,IAXOPT,NDIVB,RBEST - CALL GMAIL (0, 0) + + IF(IDEBUG.NE.0) THEN + WRITE (CHMAIL,1003) NAME,NIN,IAXOPT,NDIVB,RBEST + CALL GMAIL (0, 0) 1003 FORMAT(' GGORDQ : Volume ',A4,2X,'NIN=',I4,' IAX=',I2,2X, + 'NDIV=',I3,2X,'NVOL/DIV=',F5.1) + ENDIF ENDIF diff --git a/GEANT321/gphys/gphysi.F b/GEANT321/gphys/gphysi.F index dfd3412ca1a..e1d040daeb9 100644 --- a/GEANT321/gphys/gphysi.F +++ b/GEANT321/gphys/gphysi.F @@ -2,6 +2,9 @@ * $Id$ * * $Log$ +* Revision 1.1.1.1 1999/05/18 15:55:20 fca +* AliRoot sources +* * Revision 1.2 1996/09/30 13:28:58 ravndal * Medium name length checked * @@ -52,22 +55,22 @@ C CALL GMAIL(0,0) WRITE(CHMAIL,10100) CALL GMAIL(0,0) - WRITE(CHMAIL,10200)GVERSN,IGDATE,IGTIME - CALL GMAIL(0,0) - WRITE(CHMAIL,10100) - CALL GMAIL(0,0) - WRITE(CHMAIL,10300)IDRUN - CALL GMAIL(0,0) - WRITE(CHMAIL,10100) - CALL GMAIL(0,0) - WRITE(CHMAIL,10400) + WRITE(CHMAIL,10200)GVERSN,IGDATE,IGTIME,IDRUN CALL GMAIL(0,0) +* WRITE(CHMAIL,10100) +* CALL GMAIL(0,0) +* WRITE(CHMAIL,10300)IDRUN +* CALL GMAIL(0,0) +* WRITE(CHMAIL,10100) +* CALL GMAIL(0,0) +* WRITE(CHMAIL,10400) +* CALL GMAIL(0,0) WRITE(CHMAIL,10100) CALL GMAIL(0,0) WRITE(CHMAIL,10500) CALL GMAIL(0,0) - WRITE(CHMAIL,10600) - CALL GMAIL(0,0) +* WRITE(CHMAIL,10600) +* CALL GMAIL(0,0) WRITE(CHMAIL,10100) CALL GMAIL(0,0) C @@ -89,26 +92,26 @@ C WRITE(CHMAIL,10700) DNAME,IQ(JRUNG+11),IQ(JRUNG+12), Q(JRUNG+ + 21), Q(JRUNG+22) CALL GMAIL(0,0) - WRITE(CHMAIL,10100) - CALL GMAIL(0,0) +* WRITE(CHMAIL,10100) +* CALL GMAIL(0,0) DNAME='KINE' WRITE(CHMAIL,10700) DNAME,IQ(JRUNG+13),IQ(JRUNG+14), Q(JRUNG+ + 23), Q(JRUNG+24) CALL GMAIL(0,0) - WRITE(CHMAIL,10100) - CALL GMAIL(0,0) +* WRITE(CHMAIL,10100) +* CALL GMAIL(0,0) DNAME='HITS' WRITE(CHMAIL,10700) DNAME,IQ(JRUNG+15),IQ(JRUNG+16), Q(JRUNG+ + 25), Q(JRUNG+26) CALL GMAIL(0,0) - WRITE(CHMAIL,10100) - CALL GMAIL(0,0) +* WRITE(CHMAIL,10100) +* CALL GMAIL(0,0) DNAME='DIGI' WRITE(CHMAIL,10700) DNAME,IQ(JRUNG+17),IQ(JRUNG+18), Q(JRUNG+ + 27), Q(JRUNG+28) CALL GMAIL(0,0) - WRITE(CHMAIL,10100) - CALL GMAIL(0,0) +* WRITE(CHMAIL,10100) +* CALL GMAIL(0,0) IF(NRNDM(1).EQ.0.AND.NRNDM(2).EQ.0) THEN * * The random number sequence has not been explicitely @@ -121,10 +124,10 @@ C ENDIF ENDIF CALL GRNDMQ(IQ(JRUNG+19), IQ(JRUNG+20), 0, 'G') - WRITE(CHMAIL,10900) IQ(JRUNG+19), IQ(JRUNG+20) - CALL GMAIL(0,0) - WRITE(CHMAIL,11000) - CALL GMAIL(0,0) +* WRITE(CHMAIL,10900) IQ(JRUNG+19), IQ(JRUNG+20) +* CALL GMAIL(0,0) +* WRITE(CHMAIL,11000) +* CALL GMAIL(0,0) WRITE(CHMAIL,10100) CALL GMAIL(0,0) ENDIF @@ -192,42 +195,42 @@ C C DO 20 K=1,10 20 CALL GEVKEV(Q(JTMED+K),UCUT(K),KCUT(K)) - WRITE(CHMAIL,10800) - CALL GMAIL(0,0) +* WRITE(CHMAIL,10800) +* CALL GMAIL(0,0) WRITE(CHMAIL,10100) CALL GMAIL(0,0) WRITE(CHMAIL,11100) CALL GMAIL(0,0) - WRITE(CHMAIL,11200) - CALL GMAIL(0,0) +* WRITE(CHMAIL,11200) +* CALL GMAIL(0,0) WRITE(CHMAIL,10100) CALL GMAIL(0,0) - WRITE(CHMAIL,11300) (UCUT(K),KCUT(K),K=1,3) - CALL GMAIL(0,0) - WRITE(CHMAIL,11400) (UCUT(K),KCUT(K),K=4,5) - CALL GMAIL(0,0) - WRITE(CHMAIL,11500) (UCUT(K),KCUT(K),K=6,7) + WRITE(CHMAIL,11300) (UCUT(K),KCUT(K),K=1,5) CALL GMAIL(0,0) - WRITE(CHMAIL,11600) (UCUT(K),KCUT(K),K=8,10) - CALL GMAIL(0,0) - WRITE(CHMAIL,11700) (Q(JTMED+K),K=11,13) - CALL GMAIL(0,0) - WRITE(CHMAIL,11800) (Q(JTMED+K),K=14,16) +* WRITE(CHMAIL,11400) (UCUT(K),KCUT(K),K=4,5) +* CALL GMAIL(0,0) + WRITE(CHMAIL,11500) (UCUT(K),KCUT(K),K=6,10) CALL GMAIL(0,0) +* WRITE(CHMAIL,11600) (UCUT(K),KCUT(K),K=8,10) +* CALL GMAIL(0,0) IF(Q(JTMED+18).EQ.3.) THEN NUCRIN = .TRUE. Q(JTMED+18)=1. ELSE NUCRIN = .FALSE. ENDIF - WRITE(CHMAIL,11900) (Q(JTMED+K),K=17,19) - CALL GMAIL(0,0) - WRITE(CHMAIL,12000) (Q(JTMED+K),K=20,22) - CALL GMAIL(0,0) - WRITE(CHMAIL,12100) Q(JTMED+23),Q(JTMED+31),Q(JTMED+32) + WRITE(CHMAIL,11700) (Q(JTMED+K),K=11,18) CALL GMAIL(0,0) - WRITE(CHMAIL,12110) Q(JTMED+33) +* WRITE(CHMAIL,11800) (Q(JTMED+K),K=14,16) +* CALL GMAIL(0,0) + WRITE(CHMAIL,11900) (Q(JTMED+K),K=19,23),(Q(JTMED+L),L=31,33) CALL GMAIL(0,0) +* WRITE(CHMAIL,12000) (Q(JTMED+K),K=20,22) +* CALL GMAIL(0,0) +* WRITE(CHMAIL,12100) Q(JTMED+23),Q(JTMED+31),Q(JTMED+32) +* CALL GMAIL(0,0) +* WRITE(CHMAIL,12110) Q(JTMED+33) +* CALL GMAIL(0,0) WRITE(CHMAIL,10100) CALL GMAIL(0,0) IF(NUCRIN) THEN @@ -377,36 +380,36 @@ C CALL GMAIL(0,0) WRITE(CHMAIL,12300)ITM,CHTITL CALL GMAIL(0,0) - WRITE(CHMAIL,12400) +* WRITE(CHMAIL,12400) +* CALL GMAIL(0,0) + WRITE(CHMAIL,11300) (UCUT(K),KCUT(K),K=1,5) CALL GMAIL(0,0) - WRITE(CHMAIL,11300) (UCUT(K),KCUT(K),K=1,3) - CALL GMAIL(0,0) - WRITE(CHMAIL,11400) (UCUT(K),KCUT(K),K=4,5) - CALL GMAIL(0,0) - WRITE(CHMAIL,11500) (UCUT(K),KCUT(K),K=6,7) - CALL GMAIL(0,0) - WRITE(CHMAIL,11600) (UCUT(K),KCUT(K),K=8,10) - CALL GMAIL(0,0) - WRITE(CHMAIL,11700) (Q(JTP+K),K=11,13) - CALL GMAIL(0,0) - WRITE(CHMAIL,11800) (Q(JTP+K),K=14,16) +* WRITE(CHMAIL,11400) (UCUT(K),KCUT(K),K=4,5) +* CALL GMAIL(0,0) + WRITE(CHMAIL,11500) (UCUT(K),KCUT(K),K=6,10) CALL GMAIL(0,0) +* WRITE(CHMAIL,11600) (UCUT(K),KCUT(K),K=8,10) +* CALL GMAIL(0,0) IF(Q(JTP+18).EQ.3.) THEN NUCRIN = .TRUE. Q(JTP+18)=1. ELSE NUCRIN = .FALSE. ENDIF - WRITE(CHMAIL,11900) (Q(JTP+K),K=17,19) + WRITE(CHMAIL,11700) (Q(JTP+K),K=11,18) CALL GMAIL(0,0) - WRITE(CHMAIL,12000) (Q(JTP+K),K=20,22) - CALL GMAIL(0,0) - WRITE(CHMAIL,12100) Q(JTP+23),Q(JTP+31),Q(JTP+32) - CALL GMAIL(0,0) - WRITE(CHMAIL,12110) Q(JTP+33) - CALL GMAIL(0,0) - WRITE(CHMAIL,10100) +* WRITE(CHMAIL,11800) (Q(JTP+K),K=14,16) +* CALL GMAIL(0,0) + WRITE(CHMAIL,11900) (Q(JTP+K),K=19,23),(Q(JTP+L),L=31,33) CALL GMAIL(0,0) +* WRITE(CHMAIL,12000) (Q(JTP+K),K=20,22) +* CALL GMAIL(0,0) +* WRITE(CHMAIL,12100) Q(JTP+23),Q(JTP+31),Q(JTP+32) +* CALL GMAIL(0,0) +* WRITE(CHMAIL,12110) Q(JTP+33) +* CALL GMAIL(0,0) +* WRITE(CHMAIL,10100) +* CALL GMAIL(0,0) IF(NUCRIN) THEN WRITE(CHMAIL,10100) CALL GMAIL(0,0) @@ -634,58 +637,49 @@ C WRITE(CHMAIL,10400) CALL GMAIL(0,2) C -10000 FORMAT( - +'1************************************************************') -10100 FORMAT( - +' * *') +10000 FORMAT('1',99('*')) +10100 FORMAT(' *',97X,'*') 10200 FORMAT( +' * G E A N T Version',F7.4,' DATE/TIME',I7,'/', - + I4,2X,'*') -10300 FORMAT( - +' * R U N ',I5,10X,' *') -10400 FORMAT( - +' ************************************************************') + + I4,10X,'R U N ',I5,19X,'*') +*10300 FORMAT( +* +' * R U N ',I5,49X,' *') +10400 FORMAT(' ',99('*')) 10500 FORMAT( - +' * Data structure Date Time GVERSN ZVERSN *') + +' * Data structure Date Time GVERSN ZVERSN', + +43X,'*') 10600 FORMAT( +' * -------------- ---- ---- ------ ------ *') -10700 FORMAT(' *',11X,A,6X,I7,2X,I4,3X,F7.4,2X,F7.2,5X,'*') +10700 FORMAT(' *',11X,A,6X,I7,2X,I4,3X,F7.4,2X,F7.2,44X,'*') 10800 FORMAT( +' *----------------------------------------------------------*') -10900 FORMAT(' * Random number seeds: ',3X,I10,3X,I10,6X,'*') +10900 FORMAT(' * Random number seeds: ',3X,I10,3X,I10,45X,'*') 11000 FORMAT( +' * -------------------- *') 11100 FORMAT( - +' * Standard TPAR for this run are *') + +' * Standard TPAR for this run are ', + +39X,'*') 11200 FORMAT( +' * ------------------------------ *') 11300 FORMAT( - +' * CUTGAM=',F6.2,A4,' CUTELE=',F6.2,A4,' CUTNEU=',F6.2,A4,1X, - + '*') -11400 FORMAT( - +' * CUTHAD=',F6.2,A4,' CUTMUO=',F6.2,A4,20X,'*') + +' * CUTGAM=',F6.2,A4,' CUTELE=',F6.2,A4,' CUTNEU=',F6.2,A4, + +' CUTHAD=',F6.2,A4,' CUTMUO=',F6.2,A4,2X,'*') 11500 FORMAT( - +' * BCUTE =',F6.2,A4,' BCUTM =',F6.2,A4,20X,'*') -11600 FORMAT( - +' * DCUTE =',F6.2,A4,' DCUTM =',F6.2,A4,' PPCUTM=',F6.2,A4,1X, - + '*') + +' * BCUTE =',F6.2,A4,' BCUTM =',F6.2,A4,' DCUTE =',F6.2,A4, + +' DCUTM =',F6.2,A4,' PPCUTM=',F6.2,A4,2X,'*') 11700 FORMAT( - +' * IPAIR =',F10.0,' ICOMP =',F10.0,' IPHOT =',F10.0,1X,'*') -11800 FORMAT( - +' * IPFIS =',F10.0,' IDRAY =',F10.0,' IANNI =',F10.0,1X,'*') + +' * IPAIR=',F4.0,' ICOMP=',F4.0,' IPHOT=',F4.0,' IPFIS=', + +F4.0,' IDRAY=',F4.0,' IANNI=',F4.0,' IBREM=',F4.0,' IHADR=', + +F4.0,1X,'*') 11900 FORMAT( - +' * IBREM =',F10.0,' IHADR =',F10.0,' IMUNU =',F10.0,1X,'*') -12000 FORMAT( - +' * IDCAY =',F10.0,' ILOSS =',F10.0,' IMULS =',F10.0,1X,'*') -12100 FORMAT( - +' * IRAYL =',F10.0,' ILABS =',F10.0,' ISYNC =',F10.0,1X,'*') -12110 FORMAT( - +' * ISTRA =',F10.0, 39X, '*') + +' * IMUNU=',F4.0,' IDCAY=',F4.0,' ILOSS=',F4.0,' IMULS=', + +F4.0,' IRAYL=',F4.0,' ILABS=',F4.0,' ISYNC=',F4.0,' ISTRA=', + +F4.0,1X,'*') 12200 FORMAT(' ***** GPHYSI error, Material Nr=',I3, + ' referenced by Medium Nr=',I3) 12300 FORMAT( - +' * Special TPAR for TMED',I4,3X,A,5X,'*') + +' * Special TPAR for TMED',I4,3X,A,44X,'*') 12400 FORMAT( +' * ------------------------- *') 12500 FORMAT(' ***** GPHYSI error, CUTS must be', diff --git a/GEANT321/gtrak/gtreveroot.F b/GEANT321/gtrak/gtreveroot.F index 9b27229de0d..07268c09d70 100644 --- a/GEANT321/gtrak/gtreveroot.F +++ b/GEANT321/gtrak/gtreveroot.F @@ -2,6 +2,9 @@ * $Id$ * * $Log$ +* Revision 1.1 2000/07/11 18:24:56 fca +* Coding convention corrections + few minor bug fixes +* * Revision 1.2 1999/07/01 14:45:34 fca * Modifications to allow Cherenkov transport * @@ -70,16 +73,19 @@ C. ------------------------------------------------------------------ MPRIMA=MTRACK ENDIF IF(MTRACK.LE.MPRIMA) THEN - IF(ISWIT(4).GT.0.AND.MTRACK.GT.0) THEN - IF(ISWIT(4).EQ.1.OR.MOD(MTRACK,ISWIT(4)).EQ.0) THEN - WRITE(CHMAIL,10200) MTRACK - CALL GMAIL(0,0) - ENDIF - ENDIF IF(MTROLD.GT.0) THEN C --- Output root hits tree only for each primary MTRACK CALL RXOUTH ENDIF + IF(MTRACK.GT.0) THEN + CALL RXINH + IF(ISWIT(4).GT.0) THEN + IF(ISWIT(4).EQ.1.OR.MOD(MTRACK,ISWIT(4)).EQ.0) THEN + WRITE(CHMAIL,10200) MTRACK + CALL GMAIL(0,0) + ENDIF + ENDIF + ENDIF ENDIF IF(MTRACK.LE.0) GOTO 999 ITRTYP = NINT(Q(LQ(JPART-IPART)+6)) diff --git a/ITS/AliITS.cxx b/ITS/AliITS.cxx index 974c9c8fe76..2fddab339bf 100644 --- a/ITS/AliITS.cxx +++ b/ITS/AliITS.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.50 2001/05/11 09:15:21 barbera +Corrected to make fast point creation working with PPR geometry + Revision 1.49 2001/05/11 07:37:49 hristov Legacy lines commented @@ -327,7 +330,7 @@ AliITS::AliITS(const char *name, const char *title):AliDetector(name,title){ Int_t i; for(i=0;iAddAt(new AliITSDetType(),i); fNdtype[i]=0; fNctype[i]=0; } @@ -657,7 +660,7 @@ void AliITS::SetDefaults() { // sets the default segmentation, response, digit and raw cluster classes - printf("SetDefaults\n"); + if(fDebug) printf("%s: SetDefaults\n",ClassName()); AliITSDetType *iDetType; @@ -805,7 +808,7 @@ void AliITS::GetTreeC(Int_t event) } //_____________________________________________________________________________ -void AliITS::MakeBranch(Option_t* option, char *file) +void AliITS::MakeBranch(Option_t* option, const char *file) { // // Creates Tree branches for the ITS. @@ -842,7 +845,7 @@ void AliITS::MakeBranch(Option_t* option, char *file) if (kNTYPES==3) sprintf(branchname,"%sDigits%s",GetName(),det[i]); else sprintf(branchname,"%sDigits%d",GetName(),i+1); if (fDtype && gAlice->TreeD()) { - gAlice->MakeBranchInTree(gAlice->TreeD(), + MakeBranchInTree(gAlice->TreeD(), branchname, &((*fDtype)[i]), buffersize, file); // cout << "Making Branch " << branchname; // cout << " for digits of type "<< i+1 << endl; @@ -859,7 +862,7 @@ void AliITS::MakeBranch(Option_t* option, char *file) if(!fRecPoints) fRecPoints=new TClonesArray("AliITSRecPoint",10000); if (fRecPoints && gAlice->TreeR()) { - gAlice->MakeBranchInTree(gAlice->TreeR(), + MakeBranchInTree(gAlice->TreeR(), branchname, &fRecPoints, buffersize, file) ; // cout << "Making Branch " << branchname; // cout << " for reconstructed space points" << endl; @@ -1117,7 +1120,7 @@ void AliITS::SDigits2Digits() TStopwatch timer; timer.Start(); - HitsToDigits(0,0,-1," ","All"," "); + HitsToDigits(gAlice->GetEvNumber(),0,-1," ","All"," "); timer.Stop(); timer.Print(); delete sim0; diff --git a/ITS/AliITS.h b/ITS/AliITS.h index bda97c56dbc..476ed0b8511 100644 --- a/ITS/AliITS.h +++ b/ITS/AliITS.h @@ -71,7 +71,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=" ", char *file=0); + virtual void MakeBranch(Option_t *opt=" ", const char *file=0); void SetTreeAddress(); virtual void SetEUCLID(Bool_t euclid=1) {fEuclidOut = euclid;} virtual void StepManager() {} diff --git a/ITS/AliITSClusterFinderSDD.cxx b/ITS/AliITSClusterFinderSDD.cxx index abea911c7c5..f0085137fb9 100644 --- a/ITS/AliITSClusterFinderSDD.cxx +++ b/ITS/AliITSClusterFinderSDD.cxx @@ -443,7 +443,7 @@ Int_t AliITSClusterFinderSDD::SearchPeak( Float_t *spect, Int_t xdim, Int_t zdim { if( i==j) continue; if( Flag[j] > 0 ) continue; - if( peakAmp[i] == peakAmp[j] && abs(peakX[i]-peakX[j])<=1 && abs(peakZ[i]-peakZ[j])<=1 ) + if( peakAmp[i] == peakAmp[j] && TMath::Abs(peakX[i]-peakX[j])<=1 && TMath::Abs(peakZ[i]-peakZ[j])<=1 ) { if( Flag[i] == 0) Flag[i] = i+1; Flag[j] = Flag[i]; diff --git a/ITS/AliITSgeomSDD.h b/ITS/AliITSgeomSDD.h index 67c6bb280dc..034173f9a7b 100644 --- a/ITS/AliITSgeomSDD.h +++ b/ITS/AliITSgeomSDD.h @@ -97,7 +97,7 @@ class AliITSgeomSDD256 : public AliITSgeomSDD { // file. This is good since there are no longer any data members to this // class. It is only designed to make it easer to define this standard // SDD detector geometry. - ClassDef(AliITSgeomSDD256,0) // ITS SDD detector geometry class for 256 anodes per side + ClassDef(AliITSgeomSDD256,1) // ITS SDD detector geometry class for 256 anodes per side }; // Input and output function for standard C++ input/output. @@ -126,7 +126,7 @@ class AliITSgeomSDD300 : public AliITSgeomSDD { // file. This is good since there are no longer any data members to this // class. It is only designed to make it easer to define this standard // SDD detector geometry. - ClassDef(AliITSgeomSDD300,0) // ITS SDD detector geometry class for 300 anodes per side + ClassDef(AliITSgeomSDD300,1) // ITS SDD detector geometry class for 300 anodes per side }; // Input and output function for standard C++ input/output. diff --git a/ITS/AliITSsegmentationSSD.cxx b/ITS/AliITSsegmentationSSD.cxx index 84f768e016a..c608b4aa626 100644 --- a/ITS/AliITSsegmentationSSD.cxx +++ b/ITS/AliITSsegmentationSSD.cxx @@ -14,6 +14,9 @@ **************************************************************************/ /* $Log$ +Revision 1.14 2001/05/14 06:21:49 barbera +Some unuseful printout commented + Revision 1.13 2001/05/14 05:44:11 barbera Version 1.11 reput in place to avoid problem with reconstruction @@ -34,6 +37,8 @@ Remove dead and/or unused code and printout lines. i.e. cleaned it up a bit. #include #include "AliITSsegmentationSSD.h" #include "AliITSgeom.h" +#include "AliRun.h" +#include "AliModule.h" ClassImp(AliITSsegmentationSSD) AliITSsegmentationSSD::AliITSsegmentationSSD(){ diff --git a/ITS/AliITSv5asymm.cxx b/ITS/AliITSv5asymm.cxx index 03602aca12a..66361f48e9c 100644 --- a/ITS/AliITSv5asymm.cxx +++ b/ITS/AliITSv5asymm.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.13 2001/05/09 01:00:19 nilsen +Fixed up a typo in the cout of Init(). Now properly indecates which version +of code is being used. + Revision 1.12 2001/04/18 12:06:02 barbera Number of modules in layer 5 and 6 re-set to 23 and 26 @@ -591,14 +595,13 @@ void AliITSv5asymm::CreateGeometry(){ delete [] filtmp; if(file) { fclose(file); - cout << "Ready to read Euclid geometry file" << endl; + if(fDebug) cout << ClassName() << ": Ready to read Euclid geometry file" << endl; ReadEuclid(fEuclidGeometry.Data(),topvol); - cout << "Read in euclid geometries" << endl; - } else { - Error("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !", + if(fDebug) cout << ClassName() << ": Read in euclid geometries" << endl; + } else + Fatal("CreateGeometry"," THE GEOM FILE %s DOES NOT EXIST !", fEuclidGeometry.Data()); - exit(1); - } // end if(file) + // end if(file) // // Place the ITS ghost volume ITSV in its mother volume (ALIC) and make it // invisible @@ -611,7 +614,7 @@ void AliITSv5asymm::CreateGeometry(){ gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5); } // end if (fEuclidOut) - cout << "finished with euclid geometrys" << endl; + if(fDebug) cout << ClassName() << ": finished with euclid geometrys" << endl; } //______________________________________________________________________ @@ -655,7 +658,8 @@ void AliITSv5asymm::InitAliITSgeom(){ "Wrong Monte Carlo. InitAliITSgeom uses TGeant3 calls"); return; } // end if - cout << "Reading Geometry transformation directly from Geant 3." << endl; + if(fDebug) cout << ClassName() + << ": Reading Geometry transformation directly from Geant 3." << endl; const Int_t nlayers = 6; const Int_t ndeep = 7; Int_t itsGeomTreeNames[nlayers][ndeep],lnam[20],lnum[20]; @@ -682,7 +686,8 @@ void AliITSv5asymm::InitAliITSgeom(){ // Sorry, but this is not very pritty code. It should be replaced // at some point with a version that can search through the geometry // tree its self. - cout << "Reading Geometry informaton from Geant3 common blocks" << endl; + if(fDebug) cout << ClassName() + << ": Reading Geometry informaton from Geant3 common blocks" << endl; for(i=0;i<20;i++) lnam[i] = lnum[i] = 0; for(i=0;iStringToInt(names[i][j]); @@ -762,9 +767,11 @@ void AliITSv5asymm::Init(){ //////////////////////////////////////////////////////////////////////// Int_t i; - cout << endl; - for(i=0;i<28;i++) cout << "*";cout << " ITSv5asymm_Init "; - for(i=0;i<27;i++) cout << "*";cout << endl; + if(fDebug) { + cout << endl << ClassName() << ": "; + for(i=0;i<28;i++) cout << "*";cout << " ITSv5_Init "; + for(i=0;i<27;i++) cout << "*";cout << endl; + } // if(fRead[0]=='\0') strncpy(fRead,fEuclidGeomDet,60); if(fWrite[0]=='\0') strncpy(fWrite,fEuclidGeomDet,60); @@ -777,8 +784,11 @@ void AliITSv5asymm::Init(){ if(fGeomDetOut) fITSgeom->WriteNewFile(fWrite); AliITS::Init(); // - for(i=0;i<72;i++) cout << "*"; - cout << endl; + if(fDebug) { + cout << ClassName() << ": "; + for(i=0;i<72;i++) cout << "*"; + cout << endl; + } } //_____________________________________________________________________________ void AliITSv5asymm::StepManager(){ diff --git a/MUON/AliMUON.cxx b/MUON/AliMUON.cxx index cc39541f2f9..f65d518c944 100644 --- a/MUON/AliMUON.cxx +++ b/MUON/AliMUON.cxx @@ -14,6 +14,9 @@ **************************************************************************/ /* $Log$ +Revision 1.49 2001/03/12 17:45:48 hristov +Changes needed on Sun with CC 5.0 + Revision 1.48 2001/03/06 00:01:36 morsch Add Digits2Reco() and FindClusters() Adapt call of cluster finder to new STEER. @@ -396,7 +399,7 @@ AliMUON::AliMUON(const AliMUON& rMUON) AliMUON::~AliMUON() { // Destructor - printf("Calling AliMUON destructor !!!\n"); + if(fDebug) printf("%s: Calling AliMUON destructor !!!\n",ClassName()); Int_t i; fIshunt = 0; @@ -542,7 +545,7 @@ Int_t AliMUON::DistancetoPrimitive(Int_t , Int_t ) } //___________________________________________ -void AliMUON::MakeBranch(Option_t* option, char *file) +void AliMUON::MakeBranch(Option_t* option, const char *file) { // // Create Tree branches for the MUON. @@ -558,9 +561,8 @@ void AliMUON::MakeBranch(Option_t* option, char *file) const 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); + MakeBranchInTree(gAlice->TreeH(), + branchname, &fPadHits, kBufferSize, file); } if (cD) { @@ -572,8 +574,8 @@ void AliMUON::MakeBranch(Option_t* option, char *file) for (i=0; iTreeD()) { - gAlice->MakeBranchInTree(gAlice->TreeD(), - branchname, &((*fDchambers)[i]), kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeD(), + branchname, &((*fDchambers)[i]), kBufferSize, file); printf("Making Branch %s for digits in chamber %d\n",branchname,i+1); } } @@ -590,8 +592,8 @@ void AliMUON::MakeBranch(Option_t* option, char *file) for (i=0; iTreeR()) { - gAlice->MakeBranchInTree(gAlice->TreeR(), - branchname, &((*fRawClusters)[i]), kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeR(), + branchname, &((*fRawClusters)[i]), kBufferSize, file); printf("Making Branch %s for raw clusters in chamber %d\n",branchname,i+1); } } @@ -600,8 +602,8 @@ void AliMUON::MakeBranch(Option_t* option, char *file) // sprintf(branchname,"%sGlobalTrigger",GetName()); if (fGlobalTrigger && gAlice->TreeR()) { - gAlice->MakeBranchInTree(gAlice->TreeR(), - branchname, &fGlobalTrigger, kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeR(), + branchname, &fGlobalTrigger, kBufferSize, file); printf("Making Branch %s for Global Trigger\n",branchname); } // @@ -609,8 +611,8 @@ void AliMUON::MakeBranch(Option_t* option, char *file) // sprintf(branchname,"%sLocalTrigger",GetName()); if (fLocalTrigger && gAlice->TreeR()) { - gAlice->MakeBranchInTree(gAlice->TreeR(), - branchname, &fLocalTrigger, kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeR(), + branchname, &fLocalTrigger, kBufferSize, file); printf("Making Branch %s for Local Trigger\n",branchname); } } diff --git a/MUON/AliMUON.h b/MUON/AliMUON.h index de6374927b3..1b5323b53a4 100644 --- a/MUON/AliMUON.h +++ b/MUON/AliMUON.h @@ -53,7 +53,7 @@ class AliMUON : public AliDetector { TClonesArray *PadHits() {return fPadHits;} TClonesArray *LocalTrigger() {return fLocalTrigger;} TClonesArray *GlobalTrigger() {return fGlobalTrigger;} - virtual void MakeBranch(Option_t *opt=" ", char *file=0); + virtual void MakeBranch(Option_t *opt=" ", const char *file=0); void SetTreeAddress(); virtual void ResetHits(); virtual void ResetDigits(); diff --git a/MUON/AliMUONDisplay.cxx b/MUON/AliMUONDisplay.cxx index eb8d99cadc6..a1a8592ff61 100644 --- a/MUON/AliMUONDisplay.cxx +++ b/MUON/AliMUONDisplay.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.14 2001/04/05 08:30:48 gosset +Cleaning: suppression of Cpoints and (R2points + CoG2) +Correction: TreeR->GetEvent(0) for raw clusters + Revision 1.13 2001/03/30 13:01:50 gosset Centroid of raw clusters displayed for each cathode plane @@ -155,6 +159,7 @@ it is now really the Z position of the chambers. #include "AliMUONPoints.h" #include "TParticle.h" #include "AliMUONTriggerDecision.h" +#include "AliHeader.h" #include "AliMUONHit.h" #include "AliMUONPadHit.h" diff --git a/MUON/AliMUONFactory.cxx b/MUON/AliMUONFactory.cxx index da65ceb31de..e200c17ee2d 100644 --- a/MUON/AliMUONFactory.cxx +++ b/MUON/AliMUONFactory.cxx @@ -19,6 +19,10 @@ /* $Log$ +Revision 1.1 2001/04/06 11:24:43 morsch +Dependency on implementations of AliSegmentation and AliMUONResponse moved to AliMUONFactory class. +Static method Build() builds the MUON system out of chambers, segmentation and response. + */ #include "AliMUONFactory.h" #include "AliMUON.h" @@ -49,12 +53,13 @@ void AliMUONFactory::Build(AliMUON* where, const char* what) strcpy(tmp, what); if (strcmp(tmp, "default")==0) { - - printf("\n--------AliMUONFactory------------------------------"); - printf("\n Non default version of MUON selected "); - printf("\n You have to construct yourself the MUON elements !!"); - printf("\n----------------------------------------------------"); - + if(pMUON->GetDebug()) { + + printf("\nAliMUONFactory: --------AliMUONFactory------------------------------"); + printf("\nAliMUONFactory: Non default version of MUON selected "); + printf("\nAliMUONFactory: You have to construct yourself the MUON elements !!"); + printf("\nAliMUONFactory: ----------------------------------------------------"); + } pMUON->SetIshunt(0); pMUON->SetMaxStepGas(0.1); pMUON->SetMaxStepAlu(0.1); @@ -487,10 +492,12 @@ void AliMUONFactory::Build(AliMUON* where, const char* what) pMUON->SetResponseModel(chamber-1, responseTrigger0); pMUON->Chamber(chamber-1).SetChargeCorrel(0); // same charge on cathodes } else { - printf("\n--------AliMUONFactory------------------------------"); - printf("\n Non default version of MUON selected "); - printf("\n You have to construct yourself the MUON elements !!"); - printf("\n----------------------------------------------------"); + if(pMUON->GetDebug()) { + printf("\nAliMUONFactory: --------AliMUONFactory------------------------------"); + printf("\nAliMUONFactory: Non default version of MUON selected "); + printf("\nAliMUONFactory: You have to construct yourself the MUON elements !!"); + printf("\nAliMUONFactory: ----------------------------------------------------"); + } } } diff --git a/MUON/AliMUONRecoDisplay.cxx b/MUON/AliMUONRecoDisplay.cxx index 3d897be8501..aed97ca6549 100644 --- a/MUON/AliMUONRecoDisplay.cxx +++ b/MUON/AliMUONRecoDisplay.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.6 2001/01/26 21:50:43 morsch +Use access functions to AliMUONHit member data. + Revision 1.5 2001/01/26 20:00:53 hristov Major upgrade of AliRoot code @@ -27,6 +30,9 @@ RN3 violations corrected Revision 1.2 2000/11/23 10:09:39 gosset Bug correction in AliMUONRecoDisplay. Copyright, $Log$ +Copyright, Revision 1.6 2001/01/26 21:50:43 morsch +Copyright, Use access functions to AliMUONHit member data. +Copyright, Copyright, Revision 1.5 2001/01/26 20:00:53 hristov Copyright, Major upgrade of AliRoot code Copyright, @@ -74,6 +80,7 @@ in AliMUONRecoEvent and AliMUONRecoDisplay #include #include "AliMUONRecoEvent.h" #include "AliMUONRecoDisplay.h" +#include "AliHeader.h" #include #include #include diff --git a/MUON/AliMUONRecoEvent.cxx b/MUON/AliMUONRecoEvent.cxx index cf360a43eeb..5d4ca71d555 100644 --- a/MUON/AliMUONRecoEvent.cxx +++ b/MUON/AliMUONRecoEvent.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.5 2001/05/11 07:59:03 hristov +Index corrected + Revision 1.4 2001/01/26 20:00:53 hristov Major upgrade of AliRoot code @@ -24,6 +27,9 @@ RN3 violations corrected Revision 1.2 2000/11/23 10:09:38 gosset Bug correction in AliMUONRecoDisplay. Copyright, $Log$ +Copyright, Revision 1.5 2001/05/11 07:59:03 hristov +Copyright, Index corrected +Copyright, Copyright, Revision 1.4 2001/01/26 20:00:53 hristov Copyright, Major upgrade of AliRoot code Copyright, @@ -76,6 +82,7 @@ in AliMUONRecoEvent and AliMUONRecoDisplay #include "AliMUONTrackParam.h" #include "AliMUONHitForRec.h" #include "AliMUONTrackHit.h" +#include "AliHeader.h" ClassImp(AliMUONRecoTrack) ClassImp(AliMUONRecoEvent) diff --git a/MUON/AliMUONSegmentationSlat.cxx b/MUON/AliMUONSegmentationSlat.cxx index 33fa34189e4..5c45ee39fa3 100644 --- a/MUON/AliMUONSegmentationSlat.cxx +++ b/MUON/AliMUONSegmentationSlat.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.11 2001/01/26 21:25:48 morsch +Empty default constructors and. + Revision 1.10 2001/01/23 18:58:19 hristov Initialisation of some pointers @@ -468,7 +471,7 @@ void AliMUONSegmentationSlat::Init(Int_t chamber) // Initialize slat modules of quadrant +/+ // The other three quadrants are handled through symmetry transformations // - printf("\n Initialise Segmentation Slat \n"); + //printf("\n Initialise Segmentation Slat \n"); // // Initialize Slat modules diff --git a/MUON/AliMUONSegmentationSlatModule.cxx b/MUON/AliMUONSegmentationSlatModule.cxx index d8540e4f6a9..c3cf7605ea1 100644 --- a/MUON/AliMUONSegmentationSlatModule.cxx +++ b/MUON/AliMUONSegmentationSlatModule.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.9 2001/01/26 21:25:48 morsch +Empty default constructors and. + Revision 1.8 2001/01/17 20:53:40 hristov Destructors corrected to avoid memory leaks @@ -375,7 +378,7 @@ void AliMUONSegmentationSlatModule::Init(Int_t chamber) // concentric circles as shown below // // PCB module size in cm - printf("\n Initialise Segmentation SlatModule \n"); + // printf("\n Initialise Segmentation SlatModule \n"); fDxPCB=40; fDyPCB=40; diff --git a/MUON/AliMUONSegmentationSlatModuleN.cxx b/MUON/AliMUONSegmentationSlatModuleN.cxx index 080c253152f..9e7dd1e67c8 100644 --- a/MUON/AliMUONSegmentationSlatModuleN.cxx +++ b/MUON/AliMUONSegmentationSlatModuleN.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.7 2001/01/26 21:25:48 morsch +Empty default constructors and. + Revision 1.6 2000/12/21 22:12:41 morsch Clean-up of coding rule violations, @@ -237,7 +240,7 @@ void AliMUONSegmentationSlatModuleN::Init(Int_t chamber) // // PCB module size in cm - printf("\n Initialise Segmentation SlatModuleN \n"); + // printf("\n Initialise Segmentation SlatModuleN \n"); fDxPCB=40; diff --git a/MUON/AliMUONSegmentationTrigger.cxx b/MUON/AliMUONSegmentationTrigger.cxx index 49f78bf2ab9..731803daefd 100644 --- a/MUON/AliMUONSegmentationTrigger.cxx +++ b/MUON/AliMUONSegmentationTrigger.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.6 2000/11/12 17:17:03 pcrochet +BuildGeometry of AliMUON for trigger chambers delegated to AliMUONSegmentationTriggerX (same strategy as for tracking chambers) + Revision 1.5 2000/10/02 16:58:29 egangler Cleaning of the code : -> coding conventions @@ -70,11 +73,11 @@ ClassImp(AliMUONSegmentationTrigger) void AliMUONSegmentationTrigger::Init(Int_t chamber) { // initialize Module geometry - cout << "Initialize Trigger Chamber Module Geometry " << "\n"; - AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); AliMUONChamber* iChamber=&(pMUON->Chamber(chamber)); + if(pMUON->GetDebug()) cout << ClassName() << ": Initialize Trigger Chamber Module Geometry " << "\n"; + Float_t zPos=iChamber->Z(); Float_t z1Pos=1603.5; fZscale = zPos/z1Pos; @@ -89,7 +92,7 @@ void AliMUONSegmentationTrigger::Init(Int_t chamber) Float_t z1pm=z1PosPlus/z1PosMinus; Float_t z1mp=z1PosMinus/z1PosPlus; - cout << " fZscale = " << fZscale << "\n"; + if(pMUON->GetDebug()) cout << ClassName() << ": fZscale = " << fZscale << "\n"; // calculate yCmin and fYcmax Int_t i; @@ -192,7 +195,7 @@ void AliMUONSegmentationTrigger::Init(Int_t chamber) fChamber=&(pMUON->Chamber(chamber)); fId=chamber; - cout << "---------------------------------------------------- \n"; + if(pMUON->GetDebug()) cout << ClassName() << ": ---------------------------------------------------- \n"; } diff --git a/MUON/AliMUONSegmentationTriggerX.cxx b/MUON/AliMUONSegmentationTriggerX.cxx index 0929cf54e7a..5db25ae940a 100644 --- a/MUON/AliMUONSegmentationTriggerX.cxx +++ b/MUON/AliMUONSegmentationTriggerX.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.10 2000/12/21 22:12:41 morsch +Clean-up of coding rule violations, + Revision 1.9 2000/11/20 21:44:17 pcrochet some modifications to account for the new class AliMUONResponseTriggerV1 @@ -89,7 +92,8 @@ ClassImp(AliMUONSegmentationTriggerX) void AliMUONSegmentationTriggerX::Init(Int_t chamber) { // intialize X segmentation - cout << "Initialize Trigger Chamber Geometry X " << "\n"; + AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); + if(pMUON->GetDebug()) cout << ClassName() << ": Initialize Trigger Chamber Geometry X " << "\n"; AliMUONSegmentationTrigger::Init(chamber); // calculate x & y position of X strips diff --git a/MUON/AliMUONSegmentationTriggerY.cxx b/MUON/AliMUONSegmentationTriggerY.cxx index f09d5a05ce7..dd914cbf4c8 100644 --- a/MUON/AliMUONSegmentationTriggerY.cxx +++ b/MUON/AliMUONSegmentationTriggerY.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.8 2000/11/20 21:44:17 pcrochet +some modifications to account for the new class AliMUONResponseTriggerV1 + Revision 1.7 2000/10/03 21:48:07 morsch Adopt to const declaration of some of the methods in AliSegmentation. @@ -68,6 +71,8 @@ Draft version from P. Crochet #include "TRandom.h" #include "TArc.h" #include "AliMUONChamber.h" +#include "AliMUON.h" +#include "AliRun.h" #include ClassImp(AliMUONSegmentationTriggerY) @@ -75,7 +80,8 @@ ClassImp(AliMUONSegmentationTriggerY) void AliMUONSegmentationTriggerY::Init(Int_t chamber) { // intialize Y segmentation - cout << "Initialize Trigger Chamber Geometry Y " << "\n"; + AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); + if(pMUON->GetDebug()) cout << ClassName() <<": Initialize Trigger Chamber Geometry Y " << "\n"; AliMUONSegmentationTrigger::Init(chamber); // calculate x & y position of Y strips diff --git a/MUON/AliMUONSegmentationV01.cxx b/MUON/AliMUONSegmentationV01.cxx index 089657ae4cd..4989bac3fcc 100644 --- a/MUON/AliMUONSegmentationV01.cxx +++ b/MUON/AliMUONSegmentationV01.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.18 2001/04/11 12:33:56 morsch +Bug in GetPadC in case of staggered planes corrected. (Thanks to J.P. Cussonneau) + Revision 1.17 2001/01/30 12:17:04 morsch Remove obolete print-statement. @@ -197,7 +200,7 @@ void AliMUONSegmentationV01::Init(Int_t chamber) // This version approximates concentric segmentation zones // Int_t isec; - printf("\n Initialise Segmentation V01\n"); + //printf("\n Initialise Segmentation V01\n"); fNpy=Int_t((*fRSec)[fNsec-1]/fDpy)+1; diff --git a/MUON/AliMUONSegmentationV04.cxx b/MUON/AliMUONSegmentationV04.cxx index 60844264662..647240b8c56 100644 --- a/MUON/AliMUONSegmentationV04.cxx +++ b/MUON/AliMUONSegmentationV04.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.7 2000/12/21 22:12:41 morsch +Clean-up of coding rule violations, + Revision 1.6 2000/10/18 11:42:06 morsch - AliMUONRawCluster contains z-position. - Some clean-up of useless print statements during initialisations. @@ -67,7 +70,7 @@ void AliMUONSegmentationV04::Init(Int_t chamber) // concentric circles as shown below // // PCB module size in cm - printf("\n Initialise Segmentation V04 \n"); + //printf("\n Initialise Segmentation V04 \n"); const Float_t kDxPCB=40, kDyPCB=40; // PCB distribution (7 rows with 1+3 segmentation regions) diff --git a/MUON/AliMUONSegmentationV05.cxx b/MUON/AliMUONSegmentationV05.cxx index a576c934557..44fb90a7677 100644 --- a/MUON/AliMUONSegmentationV05.cxx +++ b/MUON/AliMUONSegmentationV05.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.6 2000/12/21 22:12:41 morsch +Clean-up of coding rule violations, + Revision 1.5 2000/10/18 11:42:06 morsch - AliMUONRawCluster contains z-position. - Some clean-up of useless print statements during initialisations. @@ -62,7 +65,7 @@ void AliMUONSegmentationV05::Init(Int_t chamber) // concentric circles as shown below // - printf("\n Initialise Segmentation V05 \n"); + //printf("\n Initialise Segmentation V05 \n"); // PCB module size in cm diff --git a/MUON/AliMUONv1.cxx b/MUON/AliMUONv1.cxx index ebc827800c6..3dc5e01d2f2 100644 --- a/MUON/AliMUONv1.cxx +++ b/MUON/AliMUONv1.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.27 2001/04/06 11:24:43 morsch +Dependency on implementations of AliSegmentation and AliMUONResponse moved to AliMUONFactory class. +Static method Build() builds the MUON system out of chambers, segmentation and response. + Revision 1.26 2001/03/17 10:07:20 morsch Correct inconsistent variable name / method name / comments. @@ -1971,7 +1975,7 @@ void AliMUONv1::Init() // Initialize Tracking Chambers // - printf("\n\n\n Start Init for version 1 - CPC chamber type\n\n\n"); + if(fDebug) printf("\n%s: Start Init for version 1 - CPC chamber type\n\n",ClassName()); Int_t i; for (i=0; iInit(); @@ -2000,14 +2004,14 @@ void AliMUONv1::Init() ((AliMUONChamber*)(*fChambers)[12])->SetGid(gMC->VolId("CG3A")); ((AliMUONChamber*)(*fChambers)[13])->SetGid(gMC->VolId("CG4A")); - printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n"); + if(fDebug) printf("\n%s: Finished Init for version 1 - CPC chamber type\n",ClassName()); //cp - printf("\n\n\n Start Init for Trigger Circuits\n\n\n"); + if(fDebug) printf("\n%s: Start Init for Trigger Circuits\n",ClassName()); for (i=0; iInit(i); } - printf(" Finished Init for Trigger Circuits\n\n\n"); + if(fDebug) printf("%s: Finished Init for Trigger Circuits\n",ClassName()); //cp } diff --git a/PHOS/AliPHOSv0.cxx b/PHOS/AliPHOSv0.cxx index 97af9321530..51f86b5cf14 100644 --- a/PHOS/AliPHOSv0.cxx +++ b/PHOS/AliPHOSv0.cxx @@ -1468,21 +1468,23 @@ void AliPHOSv0::Init(void) Int_t i; - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" PHOS_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - - // Here the PHOS initialisation code (if any!) - - if (fGeom!=0) - cout << "AliPHOS" << Version() << " : PHOS geometry intialized for " << fGeom->GetName() << endl ; - else - cout << "AliPHOS" << Version() << " : PHOS geometry initialization failed !" << endl ; - - for(i=0;i<80;i++) printf("*"); - printf("\n"); - + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" PHOS_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + + + // Here the PHOS initialisation code (if any!) + + if (fGeom!=0) + cout << "AliPHOS" << Version() << " : PHOS geometry intialized for " << fGeom->GetName() << endl ; + else + cout << "AliPHOS" << Version() << " : PHOS geometry initialization failed !" << endl ; + + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } } diff --git a/PHOS/AliPHOSv4.cxx b/PHOS/AliPHOSv4.cxx index b1370a294a4..a3370656155 100644 --- a/PHOS/AliPHOSv4.cxx +++ b/PHOS/AliPHOSv4.cxx @@ -240,7 +240,7 @@ Float_t AliPHOSv4::GetBigBox(Int_t index) } //___________________________________________________________________________ -void AliPHOSv4::MakeBranch(Option_t* opt, char *file) +void AliPHOSv4::MakeBranch(Option_t* opt, const char *file) { // Create new branch in the current reconstructed Root Tree @@ -251,8 +251,8 @@ void AliPHOSv4::MakeBranch(Option_t* opt, char *file) const char *cd = strstr(opt,"R"); if (fFastRecParticles && gAlice->TreeR() && cd) { - gAlice->MakeBranchInTree(gAlice->TreeR(), - branchname, &fFastRecParticles, fBufferSize, file) ; + MakeBranchInTree(gAlice->TreeR(), + branchname, &fFastRecParticles, fBufferSize, file); } } diff --git a/PHOS/AliPHOSv4.h b/PHOS/AliPHOSv4.h index 68ff21c7aef..657d2063899 100644 --- a/PHOS/AliPHOSv4.h +++ b/PHOS/AliPHOSv4.h @@ -60,7 +60,7 @@ public: return 4 ; } - void MakeBranch(Option_t* opt, char *file=0) ; + void MakeBranch(Option_t* opt, const 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 c7cb322084d..2e3202476ac 100644 --- a/PHOS/AliPHOSvFast.cxx +++ b/PHOS/AliPHOSvFast.cxx @@ -248,7 +248,7 @@ Float_t AliPHOSvFast::GetBigBox(Int_t index) } //___________________________________________________________________________ -void AliPHOSvFast::MakeBranch(Option_t* opt, char *file) +void AliPHOSvFast::MakeBranch(Option_t* opt, const char *file) { // Create new branch in the current reconstructed Root Tree @@ -259,8 +259,8 @@ void AliPHOSvFast::MakeBranch(Option_t* opt, char *file) char *cd = strstr(opt,"R"); if (fFastRecParticles && gAlice->TreeR() && cd) { - gAlice->MakeBranchInTree(gAlice->TreeR(), - branchname, &fFastRecParticles, fBufferSize, file); + MakeBranchInTree(gAlice->TreeR(), + branchname, &fFastRecParticles, fBufferSize, file); } } diff --git a/PHOS/AliPHOSvFast.h b/PHOS/AliPHOSvFast.h index 0833762cd3a..144cd1471eb 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, char *file=0) ; + void MakeBranch(Option_t* opt, const 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/PMD/AliPMD.cxx b/PMD/AliPMD.cxx index b1d0ff657db..cc65039b7fa 100644 --- a/PMD/AliPMD.cxx +++ b/PMD/AliPMD.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.14 2001/03/12 17:46:22 hristov +Changes needed on Sun with CC 5.0 + Revision 1.13 2001/01/26 20:02:43 hristov Major upgrade of AliRoot code @@ -265,7 +268,7 @@ void AliPMD::AddRecPoint(const AliPMDRecPoint &p) new(lrecpoints[fNRecPoints++]) AliPMDRecPoint(p); } -void AliPMD::MakeBranch(Option_t* option, char *file) +void AliPMD::MakeBranch(Option_t* option, const char *file) { // Create Tree branches for the PMD @@ -281,8 +284,8 @@ void AliPMD::MakeBranch(Option_t* option, char *file) sprintf(branchname,"%sRecPoints",GetName()); if (fRecPoints && gAlice->TreeR()) { - gAlice->MakeBranchInTree(gAlice->TreeR(), - branchname, &fRecPoints, kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeR(), + branchname, &fRecPoints, kBufferSize, file); } } } diff --git a/PMD/AliPMD.h b/PMD/AliPMD.h index e9564f49386..198c86ec708 100644 --- a/PMD/AliPMD.h +++ b/PMD/AliPMD.h @@ -40,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, char *file=0); + virtual void MakeBranch(Option_t* option, const char *file=0); virtual void SetTreeAddress(); virtual void ResetHits(); diff --git a/PMD/AliPMDv1.cxx b/PMD/AliPMDv1.cxx index b9167fdeaaf..7e26e74ab4d 100644 --- a/PMD/AliPMDv1.cxx +++ b/PMD/AliPMDv1.cxx @@ -14,6 +14,9 @@ **************************************************************************/ /* $Log$ +Revision 1.12 2001/05/14 14:01:04 morsch +AliPMDv0 coarse geometry and AliPMDv1 detailed simulation, completely revised versions by Tapan Nayak. + */ // /////////////////////////////////////////////////////////////////////////////// @@ -718,11 +721,13 @@ void AliPMDv1::CreatePMD() xpos[i]=xmod[j] + xsup[i]*TMath::Cos(theta[j]) - ysup[i]*TMath::Sin(theta[j]); ypos[i]=ymod[j] + xsup[i]*TMath::Sin(theta[j]) + ysup[i]*TMath::Cos(theta[j]); - printf("%f %f \n", xpos[i], ypos[i]); + if(fDebug) + printf("%s: %f %f \n", ClassName(), xpos[i], ypos[i]); num_mod = num_mod+1; - printf("\nNum_mod %d\n",num_mod); + if(fDebug) + printf("\n%s: Num_mod %d\n",ClassName(),num_mod); gMC->Gsposp("EMM1", num_mod + 6, "EPMD", xpos[i],ypos[i], 0., irotate[j], "ONLY", dpara_emm1, 6); @@ -920,17 +925,19 @@ void AliPMDv1::Init() Int_t i; kdet=1; // - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" PMD_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - printf(" PMD simulation package (v1) initialised\n"); - printf(" parameters of pmd\n"); - printf("%10.2f %10.2f %10.2f %10.2f\n", cell_radius,cell_wall,cell_depth,zdist1 ); - - for(i=0;i<80;i++) printf("*"); - printf("\n"); + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" PMD_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + printf(" PMD simulation package (v1) initialised\n"); + printf("%s: parameters of pmd\n",ClassName()); + printf("%s: %10.2f %10.2f %10.2f %10.2f\n",ClassName(),cell_radius,cell_wall,cell_depth,zdist1 ); + printf("%s: ",ClassName()); + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } Int_t *idtmed = fIdtmed->GetArray()-599; fMedSens=idtmed[605-1]; diff --git a/PMD/AliPMDv3.cxx b/PMD/AliPMDv3.cxx new file mode 100644 index 00000000000..5c952924966 --- /dev/null +++ b/PMD/AliPMDv3.cxx @@ -0,0 +1,822 @@ +/*************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ +/* +$Log$ +Revision 1.2 2001/05/14 13:47:34 morsch +Obsolete versions removed. + +Revision 1.1 2001/04/06 14:09:29 morsch +Version 3 of the PMD. (Tapan K. Nayak) + +Revision March 2001 new geometry for relocated PMD : Viyogi + +Revision 1.8 2000/06/09 10:31:36 hristov +sqrt changed to TMath::Sqrt + +Revision 1.7 1999/11/03 18:01:40 fca +Remove non orthogonal unused matrix + +Revision 1.6 1999/09/29 09:24:28 fca +Introduction of the Copyright and cvs Log + +*/ +// +/////////////////////////////////////////////////////////////////////////////// +// // +// Photon Multiplicity Detector Version 1 // +// // +//Begin_Html +/* + +*/ +//End_Html +// // +/////////////////////////////////////////////////////////////////////////////// +//// + +#include "AliPMDv3.h" +#include "AliRun.h" +#include "AliMagF.h" +#include "AliMC.h" +#include "AliConst.h" +#include "iostream.h" + +static Int_t kdet, ncell_sm, ncell_hole; +static Float_t zdist, zdist1; +static Float_t sm_length, sm_thick, cell_radius, cell_wall, cell_depth; +static Float_t boundary, th_base, th_air, th_pcb; +static Float_t th_lead, th_steel; + +ClassImp(AliPMDv3) + + //_____________________________________________________________________________ + AliPMDv3::AliPMDv3() +{ + // + // Default constructor + // + fMedSens=0; +} + +//_____________________________________________________________________________ +AliPMDv3::AliPMDv3(const char *name, const char *title) + : AliPMD(name,title) +{ + // + // Standard constructor + // + fMedSens=0; +} + +//_____________________________________________________________________________ +void AliPMDv3::CreateGeometry() +{ + // + // Create geometry for Photon Multiplicity Detector Version 3 : + // April 2, 2001 + // + //Begin_Html + /* + + */ + //End_Html + //Begin_Html + /* + + */ + //End_Html + GetParameters(); + CreateSupermodule(); + CreatePMD(); +} + +//_____________________________________________________________________________ +void AliPMDv3::CreateSupermodule() +{ + // + // Creates the geometry of the cells, places them in supermodule which + // is a rhombus object. + + // *** DEFINITION OF THE GEOMETRY OF THE PMD *** + // *** HEXAGONAL CELLS WITH 10 MM SQUARE EQUIVALENT + // -- Author : S. Chattopadhyay, 02/04/1999. + + // Basic unit is ECAR, a hexagonal cell made of Ar+CO2, which is placed inside another + // hexagonal cell made of Cu (ECCU) with larger radius, compared to ECAR. The difference + // in radius gives the dimension of half width of each cell wall. + // These cells are placed as 72 x 72 array in a + // rhombus shaped supermodule (EHC1). The rhombus shaped modules are designed + // to have closed packed structure. + // + // Each supermodule (ESM1 or ESM2), made of G10 is filled with following components + // EAIR --> Air gap between gas hexagonal cells and G10 backing. + // EHC1 --> Rhombus shaped parallelopiped containing the hexagonal cells + // EAIR --> Air gap between gas hexagonal cells and G10 backing. + // + // ESM1 is placed in EMM1 along with EMPB (Pb converter) and EMFE (iron support) + // EMM1 made of + // ESM1 --> Normal supermodule + // EMPB --> Pb converter + // EMFE --> Fe backing + // + // ESM2 is placed in EMM2 along with EMPB (Pb converter) and EMFE (iron support) + // EMM2 made of + // ESM2 --> Special supermodule containing the cut for the hole + // EMPB --> Pb converter + // EMFE --> Fe backing + + // + // EPMD + // | + // | + // ------------------------------------------------------------------- + // | | | | + // EHOL EMM1 EMM2 EALM + // | | + // ---------------------- ------------------------ + // | | | | | | | | + // ESM1 EMPB EMFE ESM1 ESM2 EMPB EMFE ESM2 + // | | + // ------------ ------------- + // | | | | | | + // EAIR EHC1 EAIR EAIR EHC2 EAIR + // | | + // ECCU ECCU + // | | + // ECAR ECAR + + + Int_t i, j; + Float_t xb, yb, zb; + Int_t number; + Int_t ihrotm,irotdm; + const Float_t root3_2 = TMath::Sqrt(3.) /2.; + Int_t *idtmed = fIdtmed->GetArray()-599; + + AliMatrix(ihrotm, 90., 30., 90., 120., 0., 0.); + AliMatrix(irotdm, 90., 180., 90., 270., 180., 0.); + + zdist = TMath::Abs(zdist1); + + + //Subhasis, dimensional parameters of rhombus (dpara) as given to gsvolu + // rhombus to accomodate 72 x 72 hexagons, and with total 1.2cm extension + //(1mm tolerance on both side and 5mm thick G10 wall) + // + + // **** CELL SIZE 20mm^2 EQUIVALENT + + // Inner hexagon filled with gas (Ar+CO2) + + Float_t hexd2[10] = {0.,360.,6,2,-0.25,0.,0.23,0.25,0.,0.23}; + + hexd2[4]= - cell_depth/2.; + hexd2[7]= cell_depth/2.; + hexd2[6]= cell_radius - cell_wall; + hexd2[9]= cell_radius - cell_wall; + + gMC->Gsvolu("ECAR", "PGON", idtmed[604], hexd2,10); + gMC->Gsatt("ECAR", "SEEN", 0); + + // Outer hexagon made of Copper + + Float_t hexd1[10] = {0.,360.,6,2,-0.25,0.,0.25,0.25,0.,0.25}; + //total wall thickness=0.2*2 + + hexd1[4]= - cell_depth/2.; + hexd1[7]= cell_depth/2.; + hexd1[6]= cell_radius; + hexd1[9]= cell_radius; + + gMC->Gsvolu("ECCU", "PGON", idtmed[614], hexd1,10); + gMC->Gsatt("ECCU", "SEEN", 1); + + +// Rhombus shaped supermodules (defined by PARA) + +// volume for SUPERMODULE + + Float_t dpara_sm[6] = {12.5,12.5,0.8,30.,0.,0.}; + dpara_sm[0]=(ncell_sm+0.25)*hexd1[6] ; + dpara_sm[1] = dpara_sm[0] *root3_2; + dpara_sm[2] = sm_thick/2.; + +// G10 inner part of supermodule, these will be 9 in all, one being special + + Float_t dpara_g10[6] = {12.5,12.5,8.,30.,0.,0.}; + dpara_g10[0]= dpara_sm[0]; + dpara_g10[1]= dpara_sm[1]; + dpara_g10[2]= dpara_sm[2]; + +// + gMC->Gsvolu("ESM1","PARA", idtmed[607], dpara_g10, 6); + gMC->Gsatt("ESM1", "SEEN", 0); + // + gMC->Gsvolu("ESM2","PARA", idtmed[607], dpara_g10, 6); + gMC->Gsatt("ESM2", "SEEN", 0); + + // Air residing between the PCB and the base + + Float_t dpara_air[6] = {12.5,12.5,8.,30.,0.,0.}; + dpara_air[0]= dpara_sm[0]; + dpara_air[1]= dpara_sm[1]; + dpara_air[2]= th_air/2.; + + gMC->Gsvolu("EAIR","PARA", idtmed[698], dpara_air, 6); + gMC->Gsatt("EAIR", "SEEN", 0); + + // volume for honeycomb chamber (EHC1 and EHC2) + + Float_t dpara[6] = {12.5,12.5,0.4,30.,0.,0.}; + dpara[0] = dpara_sm[0]; + dpara[1] = dpara_sm[1]; + dpara[2] = cell_depth/2.; + + gMC->Gsvolu("EHC1","PARA", idtmed[698], dpara, 6); + gMC->Gsatt("EHC1", "SEEN", 1); + + gMC->Gsvolu("EHC2","PARA", idtmed[698], dpara, 6); + gMC->Gsatt("EHC2", "SEEN", 1); + + // --- place inner hex inside outer hex + + gMC->Gsposp("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY", hexd2, 10); + + // Place outer hex ECCU cells inside EHC1 (72 X 72) + + Int_t xrow=1; + + yb = -dpara[1] + (1./root3_2)*hexd1[6]; + zb = 0.; + + for (j = 1; j <= ncell_sm; ++j) { + xb =-(dpara[0] + dpara[1]*0.577) + 2*hexd1[6]; //0.577=tan(30deg) + if(xrow >= 2){ + xb = xb+(xrow-1)*hexd1[6]; + } + for (i = 1; i <= ncell_sm; ++i) { + number = i+(j-1)*ncell_sm; + gMC->Gsposp("ECCU", number, "EHC1", xb,yb,zb, ihrotm, "ONLY", hexd1,10); + xb += (hexd1[6]*2.); + } + xrow = xrow+1; + yb += (hexd1[6]*TMath::Sqrt(3.)); + } + + + // Place outer hex ECCU inside EHC2 + // skip cells which go into the hole in top left corner. + + xrow=1; + yb = -dpara[1] + (1./root3_2)*hexd1[6]; + zb = 0.; + for (j = 1; j <= ncell_sm; ++j) { + xb =-(dpara[0] + dpara[1]*0.577) + 2*hexd1[6]; + if(xrow >= 2){ + xb = xb+(xrow-1)*hexd1[6]; + } + for (i = 1; i <= ncell_sm; ++i) { + number = i+(j-1)*ncell_sm; + if(i > ncell_hole || j <= (ncell_sm - ncell_hole)) + { + gMC->Gsposp("ECCU", number, "EHC2", xb,yb,zb, ihrotm, "ONLY", hexd1,10); + } + xb += (hexd1[6]*2.); + } + xrow = xrow+1; + yb += (hexd1[6]*TMath::Sqrt(3.)); + } + + // Place EHC1 and EAIR into ESM1; EHC2 and EAIR into ESM2 + + Float_t z_air1,z_air2,z_gas; + + z_air1= -dpara_g10[2] + th_base + dpara_air[2]; + gMC->Gspos("EAIR", 1, "ESM1", 0., 0., z_air1, 0, "ONLY"); + z_gas=z_air1+dpara_air[2]+ th_pcb + dpara[2]; + gMC->Gspos("EHC1", 1, "ESM1", 0., 0., z_gas, 0, "ONLY"); + z_air2=z_gas+dpara[2]+ th_pcb + dpara_air[2]; + gMC->Gspos("EAIR", 2, "ESM1", 0., 0., z_air2, 0, "ONLY"); + + z_air1= -dpara_g10[2] + th_base + dpara_air[2]; + gMC->Gspos("EAIR", 1, "ESM2", 0., 0., z_air1, 0, "ONLY"); + z_gas=z_air1+dpara_air[2]+ th_pcb + dpara[2]; + gMC->Gspos("EHC2", 1, "ESM2", 0., 0., z_gas, 0, "ONLY"); + z_air2=z_gas+dpara[2]+ th_pcb + dpara_air[2]; + gMC->Gspos("EAIR", 2, "ESM2", 0., 0., z_air2, 0, "ONLY"); + +} + +//_____________________________________________________________________________ + +void AliPMDv3::CreatePMD() +{ + // + // Create final detector from supermodules + // + // -- Author : Y.P. VIYOGI, 07/05/1996. + // -- Modified: P.V.K.S.Baba(JU), 15-12-97. + // -- Modified: For New Geometry YPV, March 2001. + + + // Gaspmd, the dimension of TUBE mother volume of PMD, + + Float_t gaspmd[3] = { 0.,150.,10.}; + + const Float_t root3_2 = TMath::Sqrt(3.)/2.; + const Float_t pi = 3.14159; + Int_t i,j; + + Float_t xp, yp, zp; + + Int_t num_mod; + Int_t jhrot12,jhrot13, irotdm; + + Int_t *idtmed = fIdtmed->GetArray()-599; + + // VOLUMES Names : begining with D for all PMD volumes, + // The names of SIZE variables begin with S and have more meaningful + // characters as shown below. + + // VOLUME SIZE MEDIUM : REMARKS + // ------ ----- ------ : --------------------------- + + // EPMD GASPMD AIR : INSIDE PMD and its SIZE + + // *** Define the EPMD Volume and fill with air *** + + gMC->Gsvolu("EPMD", "TUBE", idtmed[698], gaspmd, 3); + gMC->Gsatt("EPMD", "SEEN", 0); + + AliMatrix(irotdm, 90., 0., 90., 90., 180., 0.); + + AliMatrix(jhrot12, 90., 120., 90., 210., 0., 0.); + AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.); + + // dpara_emm1 array contains parameters of the imaginary volume EMM1, + // this is just a little more than the side of a supermodule. + + Float_t dm_thick = 2. * sm_thick + th_lead + th_steel; + + Float_t dpara_emm1[6] = {12.5,12.5,0.8,30.,0.,0.}; + dpara_emm1[0] = sm_length/2.; + dpara_emm1[1] = dpara_emm1[0] *root3_2; + dpara_emm1[2] = dm_thick/2.; + + // EMM1 : normal volume as in old cases + gMC->Gsvolu("EMM1","PARA", idtmed[698], dpara_emm1, 6); + gMC->Gsatt("EMM1", "SEEN", 1); + + // EMM2 : special volume containing special supermodule + gMC->Gsvolu("EMM2","PARA", idtmed[698], dpara_emm1, 6); + gMC->Gsatt("EMM2", "SEEN", 1); + + // + // --- DEFINE MODules, iron, and lead voLUMES + + //place ESM1 into EMM1 and ESM2 into EMM2 along with EMPB and EMFE + + Float_t dx = sm_length; + Float_t dy = dx * root3_2; + + Float_t xsup[9] = {-dx/2., dx/2., 3.*dx/2., + -dx, 0., dx, + -3.*dx/2., -dx/2., dx/2.}; + + Float_t ysup[9] = {dy, dy, dy, + 0., 0., 0., + -dy, -dy, -dy}; + + // + + // volume for SUPERMODULE + + // Pb Convertor + Float_t dpara_pb[6] = {12.5,12.5,8.,30.,0.,0.}; + dpara_pb[0] = sm_length/2.; + dpara_pb[1] = dpara_pb[0] * root3_2; + dpara_pb[2] = th_lead/2.; + + gMC->Gsvolu("EMPB","PARA", idtmed[600], dpara_pb, 6); + gMC->Gsatt ("EMPB", "SEEN", 0); + + // Fe Support + Float_t dpara_fe[6] = {12.5,12.5,8.,30.,0.,0.}; + dpara_fe[0] = dpara_pb[0]; + dpara_fe[1] = dpara_pb[1]; + dpara_fe[2] = th_steel/2.; + + gMC->Gsvolu("EMFE","PARA", idtmed[618], dpara_fe, 6); + gMC->Gsatt ("EMFE", "SEEN", 0); + + // position supermodule ESM1 inside EMM1 + + Float_t z_ps,z_pb,z_fe,z_cv; + + z_ps = - dpara_emm1[2] + sm_thick/2.; + gMC->Gspos("ESM1", 2, "EMM1", 0., 0., z_ps, irotdm, "ONLY"); + z_pb=z_ps+sm_thick/2.+dpara_pb[2]; + gMC->Gspos("EMPB", 1, "EMM1", 0., 0., z_pb, 0, "ONLY"); + z_fe=z_pb+dpara_pb[2]+dpara_fe[2]; + gMC->Gspos("EMFE", 1, "EMM1", 0., 0., z_fe, 0, "ONLY"); + z_cv=z_fe+dpara_fe[2]+sm_thick/2.; + gMC->Gspos("ESM1", 1, "EMM1", 0., 0., z_cv, 0, "ONLY"); + + // position supermodule ESM2 inside EMM2 + + z_ps = - dpara_emm1[2] + sm_thick/2.; + gMC->Gspos("ESM2", 2, "EMM2", 0., 0., z_ps, irotdm, "ONLY"); + z_pb = z_ps + sm_thick/2.+dpara_pb[2]; + gMC->Gspos("EMPB", 1, "EMM2", 0., 0., z_pb, 0, "ONLY"); + z_fe = z_pb + dpara_pb[2]+dpara_fe[2]; + gMC->Gspos("EMFE", 1, "EMM2", 0., 0., z_fe, 0, "ONLY"); + z_cv = z_fe + dpara_fe[2]+sm_thick/2.; + gMC->Gspos("ESM2", 1, "EMM2", 0., 0., z_cv, 0, "ONLY"); + // + + // EHOL is a tube structure made of air + + Float_t d_hole[3]; + d_hole[0] = 0.; + d_hole[1] = ncell_hole * cell_radius *2. * root3_2 + boundary; + d_hole[2] = dm_thick/2.; + + gMC->Gsvolu("EHOL", "TUBE", idtmed[698], d_hole, 3); + gMC->Gsatt("EHOL", "SEEN", 1); + + //Al-rod as boundary of the supermodules + + Float_t Al_rod[3] ; + Al_rod[0] = sm_length * 3/2.; + Al_rod[1] = boundary; + Al_rod[2] = dm_thick/2.; + + gMC->Gsvolu("EALM","BOX ", idtmed[698], Al_rod, 3); + gMC->Gsatt ("EALM", "SEEN", 1); + Float_t xalm[3]; + xalm[0]=Al_rod[0]; + xalm[1]=-xalm[0]/2.; + xalm[2]=xalm[1]; + + Float_t yalm[3]; + yalm[0]=0.; + yalm[1]=xalm[0]*root3_2; + yalm[2]=-yalm[1]; + + // delx = full side of the supermodule + Float_t delx=sm_length * 3.; + Float_t x1= delx*root3_2 /2.; + Float_t x4=delx/4.; + + // xpos and ypos are the x & y coordinates of the centres of EMM1 volumes + + Float_t xoff = boundary * TMath::Tan(pi/6.); + Float_t xmod[3]={x4 + xoff , x4 + xoff, -2.*x4-boundary/root3_2}; + Float_t ymod[3] = {-x1 - boundary, x1 + boundary, 0.}; + Float_t xpos[9], ypos[9]; + Float_t theta[3] = {0., 2.*pi/3., 4.*pi/3.}; + Int_t irotate[3] = {0, jhrot12, jhrot13}; + + for (j=0; j<3; ++j) + { + gMC->Gsposp("EALM", j+1, "EPMD", xalm[j],yalm[j], 0., irotate[j], "ONLY", Al_rod, 3); + for (i=0; i<9; ++i) + { + xpos[i]=xmod[j] + xsup[i]*TMath::Cos(theta[j]) - ysup[i]*TMath::Sin(theta[j]); + ypos[i]=ymod[j] + xsup[i]*TMath::Sin(theta[j]) + ysup[i]*TMath::Cos(theta[j]); + + if(fDebug) printf("%s: %f %f \n", ClassName(), xpos[i], ypos[i]); + + num_mod = i + 1 + j*9; + + printf("\n%s: Num_mod %d\n",ClassName(),num_mod); + + if(i==0){ + gMC->Gsposp("EMM2", num_mod, "EPMD", xpos[i],ypos[i], 0., irotate[j], "ONLY", dpara_emm1, 6); + } + else { + gMC->Gsposp("EMM1", num_mod, "EPMD", xpos[i],ypos[i], 0., irotate[j], "ONLY", dpara_emm1, 6); + } + } + } + + + // place EHOL in the centre of EPMD + gMC->Gspos("EHOL", 1, "EPMD", 0.,0.,0., 0, "ONLY"); + + // --- Place the EPMD in ALICE + xp = 0.; + yp = 0.; + zp = zdist1; + + gMC->Gspos("EPMD", 1, "ALIC", xp,yp,zp, 0, "ONLY"); + +} + + +//_____________________________________________________________________________ +void AliPMDv3::DrawModule() +{ + // + // Draw a shaded view of the Photon Multiplicity Detector + // + + gMC->Gsatt("*", "seen", -1); + gMC->Gsatt("alic", "seen", 0); + // + // Set the visibility of the components + // + gMC->Gsatt("ECAR","seen",0); + gMC->Gsatt("ECCU","seen",1); + gMC->Gsatt("EHC1","seen",1); + gMC->Gsatt("EHC1","seen",1); + gMC->Gsatt("EHC2","seen",1); + gMC->Gsatt("EMM1","seen",1); + gMC->Gsatt("EHOL","seen",1); + gMC->Gsatt("EPMD","seen",0); + // + gMC->Gdopt("hide", "on"); + gMC->Gdopt("shad", "on"); + gMC->Gsatt("*", "fill", 7); + gMC->SetClipBox("."); + gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000); + gMC->DefaultRange(); + gMC->Gdraw("alic", 40, 30, 0, 22, 20.5, .02, .02); + gMC->Gdhead(1111, "Photon Multiplicity Detector Version 1"); + + //gMC->Gdman(17, 5, "MAN"); + gMC->Gdopt("hide", "off"); +} + +//_____________________________________________________________________________ +void AliPMDv3::CreateMaterials() +{ + // + // Create materials for the PMD + // + // ORIGIN : Y. P. VIYOGI + // + + // --- The Argon- CO2 mixture --- + Float_t ag[2] = { 39.95 }; + Float_t zg[2] = { 18. }; + Float_t wg[2] = { .8,.2 }; + Float_t dar = .001782; // --- Ar density in g/cm3 --- + // --- CO2 --- + Float_t ac[2] = { 12.,16. }; + Float_t zc[2] = { 6.,8. }; + Float_t wc[2] = { 1.,2. }; + Float_t dc = .001977; + Float_t dco = .002; // --- CO2 density in g/cm3 --- + + Float_t absl, radl, a, d, z; + Float_t dg; + Float_t x0ar; + //Float_t x0xe=2.4; + //Float_t dxe=0.005858; + Float_t buf[1]; + Int_t nbuf; + Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 }; + Float_t zsteel[4] = { 26.,24.,28.,14. }; + Float_t wsteel[4] = { .715,.18,.1,.005 }; + + Int_t *idtmed = fIdtmed->GetArray()-599; + Int_t isxfld = gAlice->Field()->Integ(); + Float_t sxmgmx = gAlice->Field()->Max(); + + // --- Define the various materials for GEANT --- + AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5); + x0ar = 19.55 / dar; + AliMaterial(2, "Argon$", 39.95, 18., dar, x0ar, 6.5e4); + AliMixture(3, "CO2 $", ac, zc, dc, -2, wc); + AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5); + AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5); + AliMaterial(7, "W $", 183.85, 74., 19.3, .35, 10.3); + AliMaterial(8, "G10 $", 20., 10., 1.7, 19.4, 999.); + AliMaterial(9, "SILIC$", 28.09, 14., 2.33, 9.36, 45.); + AliMaterial(10, "Be $", 9.01, 4., 1.848, 35.3, 36.7); + AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.); + AliMaterial(16, "C $", 12.01, 6., 2.265, 18.8, 49.9); + AliMaterial(17, "POLYCARBONATE $", 20., 10., 1.2, 34.6, 999.); + AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel); + // AliMaterial(31, "Xenon$", 131.3, 54., dxe, x0xe, 6.5e4); + + AliMaterial(96, "MYLAR$", 8.73, 4.55, 1.39, 28.7, 62.); + AliMaterial(97, "CONCR$", 20., 10., 2.5, 10.7, 40.); + AliMaterial(98, "Vacum$", 1e-9, 1e-9, 1e-9, 1e16, 1e16); + AliMaterial(99, "Air $", 14.61, 7.3, .0012, 30420., 67500.); + + // define gas-mixtures + + char namate[21]; + gMC->Gfmate((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf); + ag[1] = a; + zg[1] = z; + dg = (dar * 4 + dco) / 5; + AliMixture(5, "ArCO2$", ag, zg, dg, 2, wg); + + // Define tracking media + AliMedium(1, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1); + AliMedium(7, "W conv.$", 7, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1); + AliMedium(8, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1); + AliMedium(4, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1); + AliMedium(6, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1); + AliMedium(5, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1); + AliMedium(9, "SILICON $", 9, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1); + AliMedium(10, "Be $", 10, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1); + AliMedium(98, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .1, 10); + AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .1, .1); + AliMedium(15, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1); + AliMedium(16, "C $", 16, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1); + AliMedium(17, "PLOYCARB$", 17, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1); + AliMedium(19, " S steel$", 19, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1); + // AliMedium(31, "Xenon $", 31, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1); + + // --- Generate explicitly delta rays in the iron, aluminium and lead --- + gMC->Gstpar(idtmed[600], "LOSS", 3.); + gMC->Gstpar(idtmed[600], "DRAY", 1.); + + gMC->Gstpar(idtmed[603], "LOSS", 3.); + gMC->Gstpar(idtmed[603], "DRAY", 1.); + + gMC->Gstpar(idtmed[604], "LOSS", 3.); + gMC->Gstpar(idtmed[604], "DRAY", 1.); + + gMC->Gstpar(idtmed[605], "LOSS", 3.); + gMC->Gstpar(idtmed[605], "DRAY", 1.); + + gMC->Gstpar(idtmed[606], "LOSS", 3.); + gMC->Gstpar(idtmed[606], "DRAY", 1.); + + gMC->Gstpar(idtmed[607], "LOSS", 3.); + gMC->Gstpar(idtmed[607], "DRAY", 1.); + + // --- Energy cut-offs in the Pb and Al to gain time in tracking --- + // --- without affecting the hit patterns --- + gMC->Gstpar(idtmed[600], "CUTGAM", 1e-4); + gMC->Gstpar(idtmed[600], "CUTELE", 1e-4); + gMC->Gstpar(idtmed[600], "CUTNEU", 1e-4); + gMC->Gstpar(idtmed[600], "CUTHAD", 1e-4); + gMC->Gstpar(idtmed[605], "CUTGAM", 1e-4); + gMC->Gstpar(idtmed[605], "CUTELE", 1e-4); + gMC->Gstpar(idtmed[605], "CUTNEU", 1e-4); + gMC->Gstpar(idtmed[605], "CUTHAD", 1e-4); + gMC->Gstpar(idtmed[606], "CUTGAM", 1e-4); + gMC->Gstpar(idtmed[606], "CUTELE", 1e-4); + gMC->Gstpar(idtmed[606], "CUTNEU", 1e-4); + gMC->Gstpar(idtmed[606], "CUTHAD", 1e-4); + gMC->Gstpar(idtmed[603], "CUTGAM", 1e-4); + gMC->Gstpar(idtmed[603], "CUTELE", 1e-4); + gMC->Gstpar(idtmed[603], "CUTNEU", 1e-4); + gMC->Gstpar(idtmed[603], "CUTHAD", 1e-4); + gMC->Gstpar(idtmed[609], "CUTGAM", 1e-4); + gMC->Gstpar(idtmed[609], "CUTELE", 1e-4); + gMC->Gstpar(idtmed[609], "CUTNEU", 1e-4); + gMC->Gstpar(idtmed[609], "CUTHAD", 1e-4); + + // --- Prevent particles stopping in the gas due to energy cut-off --- + gMC->Gstpar(idtmed[604], "CUTGAM", 1e-5); + gMC->Gstpar(idtmed[604], "CUTELE", 1e-5); + gMC->Gstpar(idtmed[604], "CUTNEU", 1e-5); + gMC->Gstpar(idtmed[604], "CUTHAD", 1e-5); + gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5); +} + +//_____________________________________________________________________________ +void AliPMDv3::Init() +{ + // + // Initialises PMD detector after it has been built + // + Int_t i; + kdet=1; + // + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" PMD_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n"); + printf("%s: PMD simulation package (v3) initialised\n", + ClassName()); + printf("%s: parameters of pmd\n",ClassName()); + printf("%s: %10.2f %10.2f %10.2f %10.2f\n",ClassName(), + cell_radius,cell_wall,cell_depth,zdist1 ); + printf("%s: ",ClassName()); + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } + + Int_t *idtmed = fIdtmed->GetArray()-599; + fMedSens=idtmed[605-1]; +} + +//_____________________________________________________________________________ +void AliPMDv3::StepManager() +{ + // + // Called at each step in the PMD + // + Int_t copy; + Float_t hits[4], destep; + Float_t center[3] = {0,0,0}; + Int_t vol[5]; + //char *namep; + + if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) { + + gMC->CurrentVolID(copy); + + //namep=gMC->CurrentVolName(); + //printf("Current vol is %s \n",namep); + + vol[0]=copy; + gMC->CurrentVolOffID(1,copy); + + //namep=gMC->CurrentVolOffName(1); + //printf("Current vol 11 is %s \n",namep); + + vol[1]=copy; + gMC->CurrentVolOffID(2,copy); + + //namep=gMC->CurrentVolOffName(2); + //printf("Current vol 22 is %s \n",namep); + + vol[2]=copy; + + // if(strncmp(namep,"EHC1",4))vol[2]=1; + + gMC->CurrentVolOffID(3,copy); + + //namep=gMC->CurrentVolOffName(3); + //printf("Current vol 33 is %s \n",namep); + + vol[3]=copy; + gMC->CurrentVolOffID(4,copy); + + //namep=gMC->CurrentVolOffName(4); + //printf("Current vol 44 is %s \n",namep); + + vol[4]=copy; + //printf("volume number %d,%d,%d,%d,%d,%f \n",vol[0],vol[1],vol[2],vol[3],vol[4],destep*1000000); + + gMC->Gdtom(center,hits,1); + hits[3] = destep*1e9; //Number in eV + AddHit(gAlice->CurrentTrack(), vol, hits); + } +} + + +//------------------------------------------------------------------------ +// Get parameters + +void AliPMDv3::GetParameters() +{ + Int_t ncell_um, num_um; + ncell_um=24; + num_um=3; + ncell_hole=12; + cell_radius=0.25; + cell_wall=0.02; + cell_depth=0.25 * 2.; + // + boundary=0.7; + ncell_sm=ncell_um * num_um; //no. of cells in a row in one supermodule + sm_length= ((ncell_sm + 0.25 ) * cell_radius) * 2.; + // + th_base=0.3; + th_air=0.1; + th_pcb=0.16; + // + sm_thick = th_base + th_air + th_pcb + cell_depth + th_pcb + th_air + th_pcb; + // + th_lead=1.5; + th_steel=0.5; + // + zdist1 = -370.; +} + + + + + + + + + + + + + diff --git a/RICH/AliRICH.cxx b/RICH/AliRICH.cxx index 6af9b104763..b0b6764f94b 100644 --- a/RICH/AliRICH.cxx +++ b/RICH/AliRICH.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.51 2001/05/14 10:18:55 hristov + Default arguments declared once + Revision 1.50 2001/05/10 14:44:16 jbarbosa Corrected some overlaps (thanks I. Hrivnacovna). @@ -1821,7 +1824,7 @@ Int_t AliRICH::DistancetoPrimitive(Int_t , Int_t ) } //___________________________________________ -void AliRICH::MakeBranch(Option_t* option, char *file) +void AliRICH::MakeBranch(Option_t* option, const char *file) { // Create Tree branches for the RICH. @@ -1839,14 +1842,14 @@ void AliRICH::MakeBranch(Option_t* option, char *file) if (cH) { sprintf(branchname,"%sCerenkov",GetName()); if (fCerenkovs && gAlice->TreeH()) { - //TBranch* branch = gAlice->MakeBranchInTree(gAlice->TreeH(),branchname, &fCerenkovs, kBufferSize, file) ; - gAlice->MakeBranchInTree(gAlice->TreeH(),branchname, &fCerenkovs, kBufferSize, file) ; + //TBranch* branch = MakeBranchInTree(gAlice->TreeH(),branchname, &fCerenkovs, kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeH(),branchname, &fCerenkovs, kBufferSize, file) ; //branch->SetAutoDelete(kFALSE); } sprintf(branchname,"%sSDigits",GetName()); if (fSDigits && gAlice->TreeH()) { - //TBranch* branch = gAlice->MakeBranchInTree(gAlice->TreeH(),branchname, &fSDigits, kBufferSize, file) ; - gAlice->MakeBranchInTree(gAlice->TreeH(),branchname, &fSDigits, kBufferSize, file) ; + //TBranch* branch = MakeBranchInTree(gAlice->TreeH(),branchname, &fSDigits, kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeH(),branchname, &fSDigits, kBufferSize, file) ; //branch->SetAutoDelete(kFALSE); //printf("Making branch %sSDigits in TreeH\n",GetName()); } @@ -1855,8 +1858,8 @@ void AliRICH::MakeBranch(Option_t* option, char *file) if (cS) { sprintf(branchname,"%sSDigits",GetName()); if (fSDigits && gAlice->TreeS()) { - //TBranch* branch = gAlice->MakeBranchInTree(gAlice->TreeS(),branchname, &fSDigits, kBufferSize, file) ; - gAlice->MakeBranchInTree(gAlice->TreeS(),branchname, &fSDigits, kBufferSize, file) ; + //TBranch* branch = MakeBranchInTree(gAlice->TreeS(),branchname, &fSDigits, kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeS(),branchname, &fSDigits, kBufferSize, file) ; //branch->SetAutoDelete(kFALSE); //printf("Making branch %sSDigits in TreeS\n",GetName()); } @@ -1871,8 +1874,8 @@ void AliRICH::MakeBranch(Option_t* option, char *file) for (i=0; iTreeD()) { - //TBranch* branch = gAlice->MakeBranchInTree(gAlice->TreeD(),branchname, &((*fDchambers)[i]), kBufferSize, file) ; - gAlice->MakeBranchInTree(gAlice->TreeD(),branchname, &((*fDchambers)[i]), kBufferSize, file) ; + //TBranch* branch = MakeBranchInTree(gAlice->TreeD(),branchname, &((*fDchambers)[i]), kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeD(),branchname, &((*fDchambers)[i]), kBufferSize, file) ; //branch->SetAutoDelete(kFALSE); //printf("Making Branch %sDigits%d\n",GetName(),i+1); } @@ -1891,8 +1894,8 @@ void AliRICH::MakeBranch(Option_t* option, char *file) for (i=0; iTreeR()) { - //TBranch* branch = gAlice->MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRawClusters)[i]), kBufferSize, file) ; - gAlice->MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRawClusters)[i]), kBufferSize, file) ; + //TBranch* branch = MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRawClusters)[i]), kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRawClusters)[i]), kBufferSize, file) ; //branch->SetAutoDelete(kFALSE); } } @@ -1902,16 +1905,15 @@ void AliRICH::MakeBranch(Option_t* option, char *file) for (i=0; iTreeR()) { - //TBranch* branch = gAlice->MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRecHits1D)[i]), kBufferSize, file) ; - gAlice->MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRecHits1D)[i]), kBufferSize, file) ; + //TBranch* branch = MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRecHits1D)[i]), kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRecHits1D)[i]), kBufferSize, file) ; //branch->SetAutoDelete(kFALSE); } } for (i=0; iTreeR()) { - //TBranch* branch = gAlice->MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRecHits3D)[i]), kBufferSize, file) ; - gAlice->MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRecHits3D)[i]), kBufferSize, file) ; + MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRecHits3D)[i]), kBufferSize, file) ; //branch->SetAutoDelete(kFALSE); } } diff --git a/RICH/AliRICH.h b/RICH/AliRICH.h index 712d2b4b3c8..bf5bcdc8624 100644 --- a/RICH/AliRICH.h +++ b/RICH/AliRICH.h @@ -58,7 +58,7 @@ class AliRICH : public AliDetector { // TClonesArray *SDigits() {return fSDigits;} TClonesArray *Cerenkovs() {return fCerenkovs;} - virtual void MakeBranch(Option_t *opt=" ", char *file=0); + virtual void MakeBranch(Option_t *opt=" ", const char *file=0); void SetTreeAddress(); virtual void ResetHits(); virtual void ResetDigits(); diff --git a/RICH/AliRICHDisplay.cxx b/RICH/AliRICHDisplay.cxx index 1183241f70d..bfa76cd61e0 100644 --- a/RICH/AliRICHDisplay.cxx +++ b/RICH/AliRICHDisplay.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.13 2001/05/10 12:35:16 jbarbosa + Removed hit display, added rec. ring properties. + Revision 1.12 2001/03/14 18:15:03 jbarbosa Changes to adapt to new IO. Removed verbose output. @@ -95,6 +98,7 @@ #include "AliRICHConst.h" #include "AliRICHDisplay.h" #include "AliRICHPoints.h" +#include "AliHeader.h" #include "AliRICHHit.h" #include "AliRICHCerenkov.h" diff --git a/RICH/AliRICHMerger.cxx b/RICH/AliRICHMerger.cxx index b67179c990c..8f62c9b81b4 100644 --- a/RICH/AliRICHMerger.cxx +++ b/RICH/AliRICHMerger.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.2 2001/03/14 18:16:08 jbarbosa +Corrected bug (more to correct). +File "points.dat" is no longer created. + Revision 1.1 2001/02/27 22:13:34 jbarbosa Implementing merger class. @@ -531,10 +535,10 @@ void AliRICHMerger::Digitise(Int_t nev, Int_t flag) printf ("Chamber %d digits %d \n",k,ndigit); } pRICH->ResetDigits(); - char hname[30]; - sprintf(hname,"TreeD%d",nev); - gAlice->TreeD()->Write(hname); - + // char hname[30]; + // sprintf(hname,"TreeD%d",nev); + // gAlice->TreeD()->Write(hname); + gAlice->TreeD()->Write(0,TObject::kOverwrite); // reset tree // gAlice->TreeD()->Reset(); delete list; diff --git a/RICH/AliRICHv0.cxx b/RICH/AliRICHv0.cxx index d991d33008d..4fbe63fe375 100644 --- a/RICH/AliRICHv0.cxx +++ b/RICH/AliRICHv0.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.21 2001/05/10 12:28:15 jbarbosa + Repositioned the RICH modules. + Revision 1.20 2001/02/23 17:25:57 jbarbosa Setters for wire sag effect and voltage values. @@ -175,10 +178,12 @@ AliRICHv0::AliRICHv0(const char *name, const char *title) void AliRICHv0::Init() { - printf("*********************************** RICH_INIT ***********************************\n"); - printf("* *\n"); - printf("* AliRICHv0 Default version started *\n"); - printf("* *\n"); + if(fDebug) { + printf("%s: *********************************** RICH_INIT ***********************************\n",ClassName()); + printf("%s: * *\n",ClassName()); + printf("%s: * AliRICHv0 Default version started *\n",ClassName()); + printf("%s: * *\n",ClassName()); + } AliSegmentation* segmentation; @@ -233,16 +238,27 @@ void AliRICHv0::Init() Chamber(5).SetChamberTransform(pos6[0],pos6[1],pos6[2],new TRotMatrix("rot998","rot998",90., 0. , 90 + deltaphi , 90. , deltaphi, 90. )); Chamber(6).SetChamberTransform(pos7[0],pos7[1],pos7[2],new TRotMatrix("rot999","rot999",90., deltatheta , 108.2 , 90.+ deltatheta ,18.2 , 90 + deltatheta)); - printf("* Pads : %3dx%3d *\n",segmentation->Npx(),segmentation->Npy()); - printf("* Pad size : %5.2f x%5.2f mm2 *\n",segmentation->Dpx(),segmentation->Dpy()); - printf("* Gap Thickness : %5.1f cm *\n",geometry->GetGapThickness()); - printf("* Radiator Width : %5.1f cm *\n",geometry->GetQuartzWidth()); - printf("* Radiator Length : %5.1f cm *\n",geometry->GetQuartzLength()); - printf("* Freon Thickness : %5.1f cm *\n",geometry->GetFreonThickness()); - printf("* Charge Slope : %5.1f ADC *\n",response->ChargeSlope()); - printf("* Feedback Prob. : %5.2f %% *\n",response->AlphaFeedback()*100); - printf("* *\n"); - printf("*********************************************************************************\n"); - + if(fDebug) { + printf("%s: * Pads : %3dx%3d *\n", + ClassName(),segmentation->Npx(),segmentation->Npy()); + printf("%s: * Pad size : %5.2f x%5.2f mm2 *\n", + ClassName(),segmentation->Dpx(),segmentation->Dpy()); + printf("%s: * Gap Thickness : %5.1f cm *\n", + ClassName(),geometry->GetGapThickness()); + printf("%s: * Radiator Width : %5.1f cm *\n", + ClassName(),geometry->GetQuartzWidth()); + printf("%s: * Radiator Length : %5.1f cm *\n", + ClassName(),geometry->GetQuartzLength()); + printf("%s: * Freon Thickness : %5.1f cm *\n", + ClassName(),geometry->GetFreonThickness()); + printf("%s: * Charge Slope : %5.1f ADC *\n", + ClassName(),response->ChargeSlope()); + printf("%s: * Feedback Prob. : %5.2f %% *\n", + ClassName(),response->AlphaFeedback()*100); + printf("%s: * *\n", + ClassName()); + printf("%s: *********************************************************************************\n", + ClassName()); + } } diff --git a/RICH/AliRICHv1.cxx b/RICH/AliRICHv1.cxx index 6eb6686c88f..11c968fd79c 100644 --- a/RICH/AliRICHv1.cxx +++ b/RICH/AliRICHv1.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.13 2001/05/10 12:28:04 jbarbosa + Repositioned the RICH modules. + Revision 1.12 2001/02/23 17:26:12 jbarbosa Setters for wire sag effect and voltage values. @@ -181,10 +184,12 @@ AliRICHv1::AliRICHv1(const char *name, const char *title) void AliRICHv1::Init() { - printf("*********************************** RICH_INIT ***********************************\n"); - printf("* *\n"); - printf("* AliRICHv1 Full version started *\n"); - printf("* *\n"); + if(fDebug) { + printf("%s: *********************************** RICH_INIT ***********************************\n",ClassName()); + printf("%s: * *\n",ClassName()); + printf("%s: * AliRICHv1 Full version started *\n",ClassName()); + printf("%s: * *\n",ClassName()); + } AliSegmentation* segmentation; @@ -239,18 +244,30 @@ void AliRICHv1::Init() Chamber(5).SetChamberTransform(pos6[0],pos6[1],pos6[2],new TRotMatrix("rot998","rot998",90., 0. , 90 + deltaphi , 90. , deltaphi, 90. )); Chamber(6).SetChamberTransform(pos7[0],pos7[1],pos7[2],new TRotMatrix("rot999","rot999",90., deltatheta , 108.2 , 90.+ deltatheta ,18.2 , 90 + deltatheta)); - printf("* Pads : %3dx%3d *\n",segmentation->Npx(),segmentation->Npy()); - printf("* Pad size : %5.2f x%5.2f mm2 *\n",segmentation->Dpx(),segmentation->Dpy()); - printf("* Gap Thickness : %5.1f cm *\n",geometry->GetGapThickness()); - printf("* Radiator Width : %5.1f cm *\n",geometry->GetQuartzWidth()); - printf("* Radiator Length : %5.1f cm *\n",geometry->GetQuartzLength()); - printf("* Freon Thickness : %5.1f cm *\n",geometry->GetFreonThickness()); - printf("* Charge Slope : %5.1f ADC *\n",response->ChargeSlope()); - printf("* Feedback Prob. : %5.2f %% *\n",response->AlphaFeedback()*100); - printf("* Debug Level : %3d *\n",GetDebugLevel()); - printf("* *\n"); - printf("*********************************************************************************\n"); - + if(fDebug) { + printf("%s: * Pads : %3dx%3d *\n", + ClassName(),segmentation->Npx(),segmentation->Npy()); + printf("%s: * Pad size : %5.2f x%5.2f mm2 *\n", + ClassName(),segmentation->Dpx(),segmentation->Dpy()); + printf("%s: * Gap Thickness : %5.1f cm *\n", + ClassName(),geometry->GetGapThickness()); + printf("%s: * Radiator Width : %5.1f cm *\n", + ClassName(),geometry->GetQuartzWidth()); + printf("%s: * Radiator Length : %5.1f cm *\n", + ClassName(),geometry->GetQuartzLength()); + printf("%s: * Freon Thickness : %5.1f cm *\n", + ClassName(),geometry->GetFreonThickness()); + printf("%s: * Charge Slope : %5.1f ADC *\n", + ClassName(),response->ChargeSlope()); + printf("%s: * Feedback Prob. : %5.2f %% *\n", + ClassName(),response->AlphaFeedback()*100); + printf("%s: * Debug Level : %3d *\n", + ClassName(),GetDebugLevel()); + printf("%s: * *\n", + ClassName()); + printf("%s: *********************************************************************************\n", + ClassName()); + } } diff --git a/RICH/AliRICHv2.cxx b/RICH/AliRICHv2.cxx index 89c48c2dde1..5a27621f655 100644 --- a/RICH/AliRICHv2.cxx +++ b/RICH/AliRICHv2.cxx @@ -15,6 +15,9 @@ /* $Log$ + Revision 1.7 2001/05/10 12:28:26 jbarbosa + Repositioned the RICH modules. + Revision 1.6 2001/02/13 20:10:45 jbarbosa Removed call to SetNSec() (obsolete). Fixed bug in chamber initialisation (not all chambers were initialised). @@ -118,10 +121,12 @@ AliRICHv2::AliRICHv2(const char *name, const char *title) void AliRICHv2::Init() { - printf("*********************************** RICH_INIT ***********************************\n"); - printf("* *\n"); - printf("* AliRICHv2 Configurable version started *\n"); - printf("* *\n"); + if(fDebug) { + printf("%s: *********************************** RICH_INIT ***********************************\n",ClassName()); + printf("%s: * *\n",ClassName()); + printf("%s: * AliRICHv2 Configurable version started *\n",ClassName()); + printf("%s: * *\n",ClassName()); + } AliSegmentation* segmentation; @@ -176,18 +181,29 @@ void AliRICHv2::Init() Chamber(5).SetChamberTransform(pos6[0],pos6[1],pos6[2],new TRotMatrix("rot998","rot998",90., 0. , 90 + deltaphi , 90. , deltaphi, 90. )); Chamber(6).SetChamberTransform(pos7[0],pos7[1],pos7[2],new TRotMatrix("rot999","rot999",90., deltatheta , 108.2 , 90.+ deltatheta ,18.2 , 90 + deltatheta)); - - printf("* Pads : %3dx%3d *\n",segmentation->Npx(),segmentation->Npy()); - printf("* Pad size : %5.2f x%5.2f mm2 *\n",segmentation->Dpx(),segmentation->Dpy()); - printf("* Gap Thickness : %5.1f cm *\n",geometry->GetGapThickness()); - printf("* Radiator Width : %5.1f cm *\n",geometry->GetQuartzWidth()); - printf("* Radiator Length : %5.1f cm *\n",geometry->GetQuartzLength()); - printf("* Freon Thickness : %5.1f cm *\n",geometry->GetFreonThickness()); - printf("* Charge Slope : %5.1f ADC *\n",response->ChargeSlope()); - printf("* Feedback Prob. : %5.2f %% *\n",response->AlphaFeedback()*100); - printf("* Debug Level : %3d *\n",GetDebugLevel()); - printf("* *\n"); - printf("*********************************************************************************\n"); - + if(fDebug) { + printf("%s: * Pads : %3dx%3d *\n", + ClassName(),segmentation->Npx(),segmentation->Npy()); + printf("%s: * Pad size : %5.2f x%5.2f mm2 *\n", + ClassName(),segmentation->Dpx(),segmentation->Dpy()); + printf("%s: * Gap Thickness : %5.1f cm *\n", + ClassName(),geometry->GetGapThickness()); + printf("%s: * Radiator Width : %5.1f cm *\n", + ClassName(),geometry->GetQuartzWidth()); + printf("%s: * Radiator Length : %5.1f cm *\n", + ClassName(),geometry->GetQuartzLength()); + printf("%s: * Freon Thickness : %5.1f cm *\n", + ClassName(),geometry->GetFreonThickness()); + printf("%s: * Charge Slope : %5.1f ADC *\n", + ClassName(),response->ChargeSlope()); + printf("%s: * Feedback Prob. : %5.2f %% *\n", + ClassName(),response->AlphaFeedback()*100); + printf("%s: * Debug Level : %3d *\n", + ClassName(),GetDebugLevel()); + printf("%s: * *\n", + ClassName()); + printf("%s: *********************************************************************************\n", + ClassName()); + } } diff --git a/START/AliSTART.cxx b/START/AliSTART.cxx index eadcd85a4a1..9c0091d9f27 100755 --- a/START/AliSTART.cxx +++ b/START/AliSTART.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.19 2001/04/04 12:10:18 alla +changes according Coding Convension + Revision 1.18 2001/03/12 17:46:43 hristov Changes needed on Sun with CC 5.0 @@ -207,20 +210,21 @@ void AliSTART::Init() // Initialis the START after it has been built Int_t i; // - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" START_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - // - // Here the START initialisation code (if any!) - for(i=0;i<80;i++) printf("*"); - printf("\n"); - + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" START_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + // + // Here the START initialisation code (if any!) + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } } //--------------------------------------------------------------------------- -void AliSTART::MakeBranch(Option_t* option, char *file) +void AliSTART::MakeBranch(Option_t* option, const char *file) { // // Specific START branches @@ -236,15 +240,15 @@ void AliSTART::MakeBranch(Option_t* option, char *file) if (cD) { digits = new AliSTARTdigit(); - gAlice->MakeBranchInTree(gAlice->TreeD(), - branchname, "AliSTARTdigit", digits, buffersize, 1, file) ; + MakeBranchInTree(gAlice->TreeD(), + branchname, "AliSTARTdigit", digits, buffersize, 1, file); } /* char *cR = strstr(option,"R"); if (cR) { - gAlice->MakeBranchInTree(gAlice->TreeR(), - branchname, "Int_t", &fZposit, buffersize, 1, file) ; + MakeBranchInTree(gAlice->TreeR(), + branchname, "Int_t", &fZposit, buffersize, 1, file); } */ } diff --git a/START/AliSTART.h b/START/AliSTART.h index f39ce438070..398fa4915e4 100755 --- a/START/AliSTART.h +++ b/START/AliSTART.h @@ -35,7 +35,7 @@ public: virtual void Init(); void Hit2digit(Int_t iEventNum); void Hit2digit(){return;} - virtual void MakeBranch(Option_t *opt=" ", char *file=0); + virtual void MakeBranch(Option_t *opt=" ", const char *file=0); virtual void StepManager(){} protected: diff --git a/START/AliSTARTv1.cxx b/START/AliSTARTv1.cxx index 2784ebf13aa..ce4a626e5a1 100755 --- a/START/AliSTARTv1.cxx +++ b/START/AliSTARTv1.cxx @@ -130,7 +130,7 @@ void AliSTARTv1::CreateGeometry() x=0; y=0; z=-pinstart[2]+ppmt[2]; - printf(" is %d, z Divider %f\n",is,z); + if(fDebug) printf("%s: is %d, z Divider %f\n",ClassName(),is,z); gMC->Gspos("0PMT",1,"0INS",x,y,z,0,"ONLY"); z=pinstart[2]-pdivider[2]; gMC->Gspos("0DIV",1,"0INS",x,y,z,0,"ONLY"); @@ -159,7 +159,7 @@ void AliSTARTv1::CreateGeometry() // Bottom glass gMC->Gsvolu("0BOT","TUBE",idtmed[6],pbot,3); z=ppmt[2]-pbot[2]; - printf("Z bottom %f\n",z); + if(fDebug) printf("%s: Z bottom %f\n",ClassName(),z); gMC->Gspos("0BOT",1,"0PMT",0,0,z,0,"ONLY"); // Side cylinder glass gMC->Gsvolu("0OUT","TUBE",idtmed[6],pglass,3); @@ -298,7 +298,7 @@ void AliSTARTv1::CreateMaterials() AliMedium(8, "Steel$", 0, 0, isxfld, sxmgmx, 1., .001, 1., .001, .001); AliMedium(9, "Ribber $", 7, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003); AliMedium(11, "Brass $", 6, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003); - cout<<"++++++++++++++Medium set++++++++++"<Gsckov(idtmed[2105], 14, ppckov, absco_quarz, effic_all,rindex_quarz); @@ -337,7 +337,7 @@ void AliSTARTv1::Init() //Int_t *idtmed = gAlice->Idtmed(); AliSTART::Init(); fIdSens1=gMC->VolId("0TOP"); - printf("*** START version 0 initialized ***\n"); + if(fDebug) printf("%s: *** START version 0 initialized ***\n",ClassName()); } diff --git a/STEER/AliConfig.cxx b/STEER/AliConfig.cxx new file mode 100644 index 00000000000..6b7ab54f274 --- /dev/null +++ b/STEER/AliConfig.cxx @@ -0,0 +1,285 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/* +$Log$ +*/ + +#include "TString.h" + +#include "AliConfig.h" +#include "AliDetector.h" + +#include + +ClassImp(AliConfig) + + +static char* gPDGFolder= + "Constants/DatabasePDG"; + +static char* gGeneratorFolder = + "RunMC/Configuration/Generators"; + +static char* gMCFolder = + "RunMC/Configuration/VirtualMC"; + +static char* gModuleFolder = + "Run/Configuration/Modules"; + +static char* gDetectorFolder[] = { + "Run/Conditions/Calibration", + "Run/Event/Data", + "Run/Event/RecData", + "RunMC/Event/Data",0}; + +AliConfig* AliConfig::fInstance = 0; + +AliConfig* AliConfig::Instance () +{ + // + // Instance method for singleton class + // + if(fInstance == 0) { + fInstance = new AliConfig (); + } + return fInstance; +} + + +AliConfig::AliConfig(const char *name, const char *title) +{ + // + // Default constructor + // + // + fInstance=this; + + fTopFolder = gROOT->GetRootFolder ()->AddFolder (name,title); + + gROOT->GetListOfBrowsables ()->Add (fTopFolder, name); + + TFolder *subfolder; + + TFolder *constants = + fTopFolder->AddFolder ("Constants", "Detector constants"); + + subfolder = + constants->AddFolder ("DatabasePDG", "PDG database"); + + TFolder *run = + fTopFolder->AddFolder ("Run", "Run dependent folders"); + + TFolder *conditions = + run->AddFolder ("Conditions", "Run conditions"); + + subfolder = + conditions->AddFolder ("Calibration","Detector calibration data"); + + subfolder = + conditions->AddFolder ("Aligment", "Detector aligment"); + + TFolder *configuration = + run->AddFolder ("Configuration", "Run configuration"); + + subfolder = + configuration->AddFolder ("Modules", "Detector objects"); + + subfolder = + configuration->AddFolder ("Field", "Magnetic field maps"); + + TFolder *event = + run->AddFolder ("Event", "Event folders"); + + subfolder = + event->AddFolder ("Data", "Detector raw data"); + + subfolder = + event->AddFolder ("RecData", "Detectors reconstucted data"); + + TFolder *run_mc = + fTopFolder->AddFolder ("RunMC", "MonteCarlo run dependent folders"); + + TFolder *configuration_mc = + run_mc->AddFolder ("Configuration","MonteCarlo run configuration"); + + subfolder = + configuration_mc->AddFolder ("Generators","list of generator objects"); + + subfolder = + configuration_mc->AddFolder ("VirtualMC", "the Virtual MC"); + + TFolder *event_mc = + run_mc->AddFolder ("Event", "MonteCarlo event folders"); + + subfolder = + event_mc->AddFolder ("Header", "MonteCarlo event header"); + +// subfolder = +// event_mc->AddFolder ("Kinematics", "MonteCarlo generated particles"); + + subfolder = + event_mc->AddFolder ("Data", "MonteCarlo data"); + +} + +AliConfig::~AliConfig() +{ +} + +void AliConfig::AddInFolder (char *dir, TObject *obj) +{ + TFolder *folder = + (TFolder *) fTopFolder->FindObject (dir); + if (folder) + folder->Add ((TObject *)obj); +} + +void AliConfig::AddSubFolder(char *dir[], TObject *obj) +{ + int iDir = 0; + + while (dir[iDir]) + { + TFolder * folder = (TFolder *) fTopFolder->FindObject (dir[iDir++]); + if (folder) { + TFolder * subfolder = (TFolder *) folder->FindObject (obj->GetName()); + if (!subfolder) + subfolder = folder->AddFolder (obj->GetName(),obj->GetTitle()); + } + } + +} + +TObject* AliConfig::FindInFolder (char *dir, const char *name) +{ + if(!name) return(fTopFolder->FindObject(name)); + TFolder * folder = (TFolder *) fTopFolder->FindObject (dir); + if (!folder) return (NULL); + return(folder->FindObject(name)); +} + +void AliConfig::Add (AliGenerator * obj) +{ + AddInFolder(gGeneratorFolder, (TObject *) obj); +} + +void AliConfig::Add (AliMC * obj) +{ + AddInFolder(gMCFolder, (TObject *) obj); +} + +void AliConfig::Add (TDatabasePDG * obj) +{ + AddInFolder(gPDGFolder, (TObject *) obj); +} + +void AliConfig::Add (AliModule* obj) +{ + AddInFolder(gModuleFolder, (TObject *) obj); +} + +void AliConfig::Add (AliDetector * obj) +{ + AddSubFolder(gDetectorFolder, (TObject *) obj); +} + + +void AliConfig::Add (const char *list) +{ + char *path; + + const char *conf_path = gSystem->Getenv ("ALICE_CONFIG_PATH"); + if (conf_path) { + path = new char[strlen (conf_path)]; + strcpy (path, conf_path); + } else { + const char *alice = gSystem->Getenv ("ALICE_ROOT"); + path = new char[strlen (alice) + 32]; + + strcpy (path, ".:"); + if (alice) { + strcat (path, alice); + } + strcat (path, "/macros/config"); + } + + char *token = strtok (path, ":"); + + TList *dirlist = new TList; + + while (token != NULL) + { + dirlist->Add ((TObject *) token); + token = strtok (NULL, ":"); + } + + token = strtok ((char *)list, " "); + + while (token != NULL) + { + cout << "Configuring " << token << ": "; + + TObject *obj; + TIter next (dirlist); + TString found = "\0"; + + while ((obj = next ())) + { + TString dir = (char *) obj; + TString path = dir + "/" + token; + TString macro = path + ".C"; + if (!gSystem->AccessPathName (macro.Data())) { + gInterpreter->ExecuteMacro (macro.Data()); + found = "(" + macro + ")"; + if (macro.Contains("/")) { + TString dirname = gSystem->DirName(macro.Data()); + TString macroConfigure = dirname + "/Configure.C"; + if (!gSystem->AccessPathName (macroConfigure.Data())) { + gInterpreter->ExecuteMacro (macroConfigure.Data()); + found += " => Configured"; + } + } + break; + } else { + TString macroDefault = path + "/Default.C"; + if (!gSystem->AccessPathName (macroDefault.Data())) { + gInterpreter->ExecuteMacro (macroDefault.Data()); + found = "(" + macro + ")"; + TString macroConfigure = path + "/Configure.C"; + if (!gSystem->AccessPathName (macroConfigure.Data())) { + gInterpreter->ExecuteMacro (macroConfigure.Data()); + found += " => Configured"; + } + break; + } + } + } + + if (strlen(found.Data())) { + cout << found << " => OK" << endl; + } else { + cout << " => FAILED." << endl; + exit(1); + } + + token = strtok (NULL, " "); + } + + if (dirlist) delete dirlist; + +} + + diff --git a/STEER/AliConfig.h b/STEER/AliConfig.h new file mode 100644 index 00000000000..a6dd5001ec7 --- /dev/null +++ b/STEER/AliConfig.h @@ -0,0 +1,57 @@ +#ifndef ALICONFIG_H +#define ALICONFIG_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ +/* + * $Log$ + */ + +#include +#include +#include +#include +#include +#include + +class AliGenerator; +class AliModule; +class AliDetector; +class AliMC; +class AliConfig; +class AliTasks; + +class AliConfig : public TNamed { + + public: + + AliConfig(const char *name="gAlice", + const char *title = "Alice simulation and reconstruction framework"); + virtual ~ AliConfig (); + + void Add (AliGenerator *generator); + void Add (AliMC *mc); + void Add (TDatabasePDG *pdg); + void Add (AliModule *module); + void Add (AliDetector *detector); + + void Add (const char *list); + + static AliConfig* Instance(); + + private: + void AddInFolder (char *dir, TObject *obj); + void AddSubFolder(char *dir[], TObject *obj); + TObject* FindInFolder (char *dir, const char *name); + + TFolder *fTopFolder; + AliTasks *fTasks; + + static AliConfig* fInstance; + + ClassDef(AliConfig,1) + +}; // end class AliConfig + +#endif diff --git a/STEER/AliDetector.cxx b/STEER/AliDetector.cxx index acadffe5562..11d097e5607 100644 --- a/STEER/AliDetector.cxx +++ b/STEER/AliDetector.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.12 2001/03/12 17:47:03 hristov +Changes needed on Sun with CC 5.0 + Revision 1.11 2001/01/26 19:58:46 hristov Major upgrade of AliRoot code @@ -57,15 +60,20 @@ Introduction of the Copyright and cvs Log /////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include +#include +#include +#include "AliConfig.h" #include "AliDetector.h" #include "AliRun.h" #include "AliHit.h" #include "AliPoints.h" + // Static variables for the hit iterator routines static Int_t sMaxIterHit=0; static Int_t sCurIterHit=0; @@ -106,6 +114,8 @@ AliDetector::AliDetector(const char* name,const char *title):AliModule(name,titl fPoints = 0; fBufferSize = 16000; fDigitsFile = 0; + + AliConfig::Instance()->Add(this); } //_____________________________________________________________________________ @@ -131,7 +141,91 @@ AliDetector::~AliDetector() } if (fDigitsFile) delete [] fDigitsFile; } - + +//_____________________________________________________________________________ +void AliDetector::Publish(const char *dir, void *address, const char *name) +{ + // + // Register pointer to detector objects. + // + TFolder *topFolder = (TFolder *)gROOT->FindObjectAny("/Folders"); + TFolder *folder = (TFolder *)topFolder->FindObjectAny(dir); + // TFolder *folder = (TFolder *)gROOT->FindObjectAny(dir); + if (!folder) { + cerr << "Cannot register: Missing folder: " << dir << endl; + } else { + TFolder *subfolder = (TFolder *) folder->FindObjectAny(this->GetName()); + + if(!subfolder) + subfolder = folder->AddFolder(this->GetName(),this->GetTitle()); + if (address) { + TObject **obj = (TObject **) address; + if ((*obj)->InheritsFrom(TCollection::Class())) { + TCollection *collection = (TCollection *) (*obj); + if (name) + collection->SetName(name); + } + subfolder->Add(*obj); + } + } +} + +//_____________________________________________________________________________ +TBranch* AliDetector::MakeBranchInTree(TTree *tree, const char* name, void* address, Int_t size,const char *file) +{ + return(MakeBranchInTree(tree,name,0,address,size,1,file)); +} + +//_____________________________________________________________________________ +TBranch* AliDetector::MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address,Int_t size, Int_t splitlevel, const char *file) +{ + // + // Makes branch in given tree and diverts them to a separate file + // + if (GetDebug()>1) + printf("* MakeBranch * Making Branch %s \n",name); + + TDirectory *cwd = gDirectory; + TBranch *branch = 0; + + if (classname) { + branch = tree->Branch(name,classname,address,size,splitlevel); + } else { + branch = tree->Branch(name,address,size); + } + + if (file) { + char * outFile = new char[strlen(gAlice->GetBaseFile())+strlen(file)+2]; + sprintf(outFile,"%s/%s",gAlice->GetBaseFile(),file); + branch->SetFile(outFile); + TIter next( branch->GetListOfBranches()); + while ((branch=(TBranch*)next())) { + branch->SetFile(outFile); + } + delete outFile; + + cwd->cd(); + + if (GetDebug()>1) + printf("* MakeBranch * Diverting Branch %s to file %s\n",name,file); + } + char *folder = 0; + + if (!strncmp(tree->GetName(),"TreeE",5)) folder = "RunMC/Event/Data"; + if (!strncmp(tree->GetName(),"TreeK",5)) folder = "RunMC/Event/Data"; + if (!strncmp(tree->GetName(),"TreeH",5)) folder = "RunMC/Event/Data"; + if (!strncmp(tree->GetName(),"TreeD",5)) folder = "Run/Event/Data"; + if (!strncmp(tree->GetName(),"TreeS",5)) folder = "Run/Event/Data"; + if (!strncmp(tree->GetName(),"TreeR",5)) folder = "Run/Event/RecData"; + + if (folder) { + if (GetDebug()) + printf("%15s: Publishing %s to %s\n",ClassName(),name,folder); + Publish(folder,address,name); + } + return branch; +} + //_____________________________________________________________________________ void AliDetector::Browse(TBrowser *b) { @@ -277,7 +371,7 @@ void AliDetector::LoadPoints(Int_t) } //_____________________________________________________________________________ -void AliDetector::MakeBranch(Option_t *option, char *file) +void AliDetector::MakeBranch(Option_t *option, const char *file) { // // Create a new branch in the current Root Tree @@ -291,8 +385,8 @@ void AliDetector::MakeBranch(Option_t *option, char *file) const char *cH = strstr(option,"H"); // if (fHits && gAlice->TreeH() && cH) { - gAlice->MakeBranchInTree(gAlice->TreeH(), - branchname, &fHits, fBufferSize, file) ; + MakeBranchInTree(gAlice->TreeH(), + branchname, &fHits, fBufferSize, file) ; } const char *cD = strstr(option,"D"); diff --git a/STEER/AliDetector.h b/STEER/AliDetector.h index 91db735830b..6908eb26359 100644 --- a/STEER/AliDetector.h +++ b/STEER/AliDetector.h @@ -8,6 +8,7 @@ #include class AliHit; class TTree; +class TBranch; class AliDetector : public AliModule { @@ -32,10 +33,11 @@ public: {det.Copy(*this); return (*this);} // Other methods + virtual void Publish(const char *dir, void *c, const char *name=0); virtual void Browse(TBrowser *b); virtual void FinishRun(); virtual void LoadPoints(Int_t track); - virtual void MakeBranch(Option_t *opt=" ", char *file=0 ); + virtual void MakeBranch(Option_t *opt=" ", const char *file=0 ); virtual void ResetDigits(); virtual void ResetHits(); virtual void ResetPoints(); @@ -47,7 +49,9 @@ public: virtual AliHit* FirstHit(Int_t track); virtual AliHit* NextHit(); virtual void SetBufferSize(Int_t bufsize=8000) {fBufferSize = bufsize;} - + virtual TBranch* MakeBranchInTree(TTree *tree, const char* cname, void* address, Int_t size=32000, const char *file=0); + virtual TBranch* MakeBranchInTree(TTree *tree, const char* cname, const char* name, void* address, Int_t size=32000, Int_t splitlevel=1, const char *file=0); + // Data members protected: diff --git a/STEER/AliDisplay.cxx b/STEER/AliDisplay.cxx index cbd2c9dc0f4..25eef559e02 100644 --- a/STEER/AliDisplay.cxx +++ b/STEER/AliDisplay.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.14 2001/01/26 19:58:48 hristov +Major upgrade of AliRoot code + Revision 1.13 2000/12/21 15:30:18 fca Correcting coding convention violations @@ -73,6 +76,7 @@ Introduction of the Copyright and cvs Log #include "AliPoints.h" #include "TParticle.h" #include "TGeometry.h" +#include "AliHeader.h" static const Float_t kptcutmax = 2; static const Float_t ketacutmax = 1.5; diff --git a/EVGEN/AliGenEventHeader.cxx b/STEER/AliGenEventHeader.cxx similarity index 86% rename from EVGEN/AliGenEventHeader.cxx rename to STEER/AliGenEventHeader.cxx index 8f126effaef..2cf0d21c1b5 100644 --- a/EVGEN/AliGenEventHeader.cxx +++ b/STEER/AliGenEventHeader.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.2 2000/12/21 16:24:06 morsch +Coding convention clean-up + Revision 1.1 2000/06/15 15:47:48 morsch Proposal for an event header class for generated events. @@ -32,15 +35,20 @@ ClassImp(AliGenEventHeader) //_____________________________________________________________________________ +AliGenEventHeader::AliGenEventHeader() +{ +// Constructor + fNProduced = -1; + fImpactParameter= -1.; +} + + AliGenEventHeader::AliGenEventHeader(const char * name) :TNamed(name, "Event Header") { // Constructor -// fDate=new TDatime; - fRunNumber=-1; - fEventNumber=-1; - fNProduced=-1; - fImpactParameter=-1.; + fNProduced = -1; + fImpactParameter= -1.; } diff --git a/EVGEN/AliGenEventHeader.h b/STEER/AliGenEventHeader.h similarity index 56% rename from EVGEN/AliGenEventHeader.h rename to STEER/AliGenEventHeader.h index ad1dc220bea..11856a19157 100644 --- a/EVGEN/AliGenEventHeader.h +++ b/STEER/AliGenEventHeader.h @@ -7,7 +7,6 @@ /* $Id$ */ #include -#include // Event header base class for generator. // Stores as a minimum the date, run number, event number, number of particles produced @@ -18,25 +17,17 @@ class AliGenEventHeader : public TNamed { public: - AliGenEventHeader(const char* name="Undefined"); + AliGenEventHeader(const char* name); + AliGenEventHeader(); virtual ~AliGenEventHeader() {} // Getters - virtual TDatime Date() {return fDate;} - virtual Int_t RunNumber() {return fRunNumber;} - virtual Int_t EventNumber() {return fEventNumber;} - virtual Int_t NProduced() {return fNProduced;} - virtual Float_t ImpactParameter() {return fImpactParameter;} + virtual Int_t NProduced() {return fNProduced;} + virtual Float_t ImpactParameter() {return fImpactParameter;} // Setters - virtual void SetDate(TDatime date) {fDate=date;} - virtual void SetRunNumber(Int_t run) {fRunNumber=run;} - virtual void SetEventNumber(Int_t event) {fEventNumber=event;} virtual void SetNProduced(Int_t nprod) {fNProduced=nprod;} virtual void SetImpactParameter(Float_t b) {fImpactParameter=b;} protected: - TDatime fDate; // Date - Int_t fRunNumber; // Run Number - Int_t fEventNumber; // Event Number Int_t fNProduced; // Number stable or undecayed particles Float_t fImpactParameter; // Impact Parameter diff --git a/STEER/AliGenKine.cxx b/STEER/AliGenKine.cxx new file mode 100644 index 00000000000..7df75c0d45d --- /dev/null +++ b/STEER/AliGenKine.cxx @@ -0,0 +1,149 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/* +$Log$ +*/ + +#include + +#include "AliGenKine.h" +#include "AliMCProcess.h" +#include "AliMC.h" +#include "AliRun.h" +#include "AliStack.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + ClassImp(AliGenKine) + AliGenKine::AliGenKine() + :AliGenerator(-1) +{ +// Constructor + fName = "Kine"; + fTitle = "Primaries from ext. File"; + fFileName = NULL; + fStack = 0; + fNcurrent = 0; +// +// Read all particles + fNpart = -1; + fFile = 0; + fBaseFile = 0; +} + +AliGenKine::AliGenKine(Int_t npart) + :AliGenerator(npart) +{ +// Constructor + fName = "Kine"; + fTitle = "Primaries from ext. File"; + fFileName = NULL; + fStack = 0; + fNcurrent = 0; + fFile = 0; + fBaseFile = 0; +} + +//____________________________________________________________ +AliGenKine::~AliGenKine() +{ +// Destructor + +} + +//____________________________________________________________ + +//____________________________________________________________ +void AliGenKine::Generate() +{ + Float_t polar[3], vpos[3], pmom[3]; +// +// Connect file and get next event +// + if (!fBaseFile) { + TTree *ali = gAlice->TreeE(); + if (ali) fBaseFile = ali->GetCurrentFile(); + } + + if (!fFile) { + fFile = new TFile(fFileName); + } + +// cd to file with old kine tree + if (fStack) delete fStack; + fStack = new AliStack(1000); + fFile->cd(); +// Connect treeE + TTree* treeE = (TTree*)gDirectory->Get("TE"); + treeE->SetBranchAddress("Stack", &fStack); +// Get next event + treeE->GetEntry(fNcurrent); + fStack->GetEvent(fNcurrent); +// cd back to base file + fBaseFile->cd(); +// +// Read Particles +// + Int_t ntr; + + for (Int_t i = 0; i < fStack->GetNtrack(); i++) + { + TParticle* part = fStack->Particle(i); + + + Int_t pdg = part->GetPdgCode(); +// if (pdg == -1) continue; + + Int_t parent = part->GetFirstMother(); + Float_t tof = part->T(); + + vpos[0] = part->Vx(); + vpos[1] = part->Vy(); + vpos[2] = part->Vz(); + + pmom[0] = part->Px(); + pmom[1] = part->Py(); + pmom[2] = part->Pz(); + + printf("\n %d %d %d %f", i, fStack->GetNtrack(), part->GetPdgCode(), pmom[2]); + gAlice->SetTrack(fTrackIt, parent, pdg, pmom, vpos, polar, + tof, kPPrimary, ntr); + gAlice->KeepTrack(ntr); + } + gAlice->SetHighWaterMark(ntr); + fNcurrent++; + +// cd back to output file + +} + + + + + + + + diff --git a/STEER/AliGenKine.h b/STEER/AliGenKine.h new file mode 100644 index 00000000000..72b9127e674 --- /dev/null +++ b/STEER/AliGenKine.h @@ -0,0 +1,60 @@ +#ifndef ALIGENKINE_H +#define ALIGENKINE_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + + + +#include "AliGenerator.h" +#include "AliHeader.h" +#include "TTree.h" +#include "TFile.h" +#include "TArrayI.h" +#include "TParticle.h" + +class TParticle; +class AliStack; +class TClonesArray; + +// Read background particles from a FLUKA boundary source file + +class AliGenKine : public AliGenerator +{ + public: + AliGenKine(); + AliGenKine(Int_t npart); + virtual ~AliGenKine(); + // Initialise + virtual void Init() {} + // set file name for data file + virtual void SetFileName (const Text_t *filname) {fFileName = filname;} + // generate event + virtual void Generate(); +protected: + const Text_t *fFileName; //! Choose the file + Int_t fNcurrent; // points to the next entry + Int_t fNp; // number of particles + TFile *fFile; // ! pointer to file + TFile *fBaseFile; // ! pointer to base file + AliStack *fStack; // ! Particle stack + +// + ClassDef(AliGenKine,1) // Generate particles from external file +}; +#endif + + + + + + + + + + + + + + diff --git a/STEER/AliGenerator.cxx b/STEER/AliGenerator.cxx index 3be52170749..8892df5ec2b 100644 --- a/STEER/AliGenerator.cxx +++ b/STEER/AliGenerator.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.12 2001/02/02 11:12:50 morsch +Add Vertex() method that allows to get vertex from merging manager, if needed. + Revision 1.11 2001/01/26 19:58:48 hristov Major upgrade of AliRoot code @@ -64,6 +67,7 @@ Introduction of the Copyright and cvs Log #include "AliGenerator.h" #include "TGenerator.h" #include "AliRun.h" +#include "AliConfig.h" ClassImp(AliGenerator) @@ -132,6 +136,8 @@ AliGenerator::AliGenerator(Int_t npart) fVMax[0]=fVMax[1]=fVMax[2]=10000; SetNumberParticles(npart); + + AliConfig::Instance()->Add(this); } //____________________________________________________________ diff --git a/STEER/AliHeader.cxx b/STEER/AliHeader.cxx index 0ed2b78ecc9..45989c0a41b 100644 --- a/STEER/AliHeader.cxx +++ b/STEER/AliHeader.cxx @@ -15,9 +15,6 @@ /* $Log$ -Revision 1.5 2001/03/21 18:22:30 hristov -fParticleFileMap fix (I.Hrivnacova) - Revision 1.4 2000/10/02 21:28:14 fca Removal of useless dependecies via forward declarations @@ -44,6 +41,8 @@ AliHeader::AliHeader() fNprimary=0; fNtrack=0; fEvent=0; + fStack=0; + fGenHeader = 0; } AliHeader::AliHeader(Int_t run, Int_t event) @@ -56,6 +55,8 @@ AliHeader::AliHeader(Int_t run, Int_t event) fNprimary=0; fNtrack=0; fEvent=event; + fStack=0; + fGenHeader = 0; } void AliHeader::Reset(Int_t run, Int_t event) @@ -84,12 +85,29 @@ void AliHeader::Print(const char* option) printf( "=========== Header for run %d Event %d = end ============================================\n\n", fRun,fEvent); - - // print particle file map - const char* oMap = strstr(option,"Map"); - if (oMap) { - printf("\nParticle file map: \n"); - for (Int_t i=0; i #include +class AliStack; +class AliGenEventHeader; class AliHeader : public TObject { public: @@ -31,8 +33,11 @@ public: virtual void SetEvent(Int_t event) {fEvent = event;} virtual Int_t GetEvent() const {return fEvent;} + virtual AliStack* Stack() const; + virtual void SetStack(AliStack* stack); - virtual TArrayI& GetParticleFileMap(){return fParticleFileMap;} + virtual void SetGenEventHeader(AliGenEventHeader* header); + virtual AliGenEventHeader* GenEventHeader() const; virtual void Print(const char *opt=0); @@ -42,8 +47,9 @@ protected: Int_t fNprimary; //Number of primary tracks Int_t fNtrack; //Number of tracks Int_t fEvent; //Event number - TArrayI fParticleFileMap; //Map of particles in the file - + AliStack *fStack; //Pointer to stack + AliGenEventHeader* fGenHeader; //Event Header for Generator + ClassDef(AliHeader,1) //Alice event header }; diff --git a/STEER/AliLegoGenerator.cxx b/STEER/AliLegoGenerator.cxx index bfda2539c5d..e5faf63ea0e 100644 --- a/STEER/AliLegoGenerator.cxx +++ b/STEER/AliLegoGenerator.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2000/11/30 07:12:49 alibrary +Introducing new Rndm and QA classes + Revision 1.3 2000/10/26 14:15:54 morsch - Base class now - Change from theta, phi to general coordinates Coor1, Coor2 @@ -140,7 +143,7 @@ void AliLegoGenerator::Generate() Float_t polar[3]={0.,0.,0.}; Int_t ntr; - gAlice->SetTrack(1, 0, kMpart, pmom, orig, polar, 0, kPPrimary, ntr); + gAlice->SetTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr); } diff --git a/STEER/AliLegoGeneratorEta.cxx b/STEER/AliLegoGeneratorEta.cxx index ecb200dc76b..859f0717f0b 100644 --- a/STEER/AliLegoGeneratorEta.cxx +++ b/STEER/AliLegoGeneratorEta.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.3 2000/12/15 10:33:59 morsch +Invert coordinates to make meaningful zylindrical plots. + Revision 1.2 2000/11/30 07:12:49 alibrary Introducing new Rndm and QA classes @@ -84,6 +87,6 @@ void AliLegoGeneratorEta::Generate() Float_t polar[3]={0.,0.,0.}; Int_t ntr; - gAlice->SetTrack(1, 0, kMpart, pmom, orig, polar, 0, kPPrimary, ntr); + gAlice->SetTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr); } diff --git a/STEER/AliLegoGeneratorPhiZ.cxx b/STEER/AliLegoGeneratorPhiZ.cxx index 68d1bac8275..44f50f58dd4 100644 --- a/STEER/AliLegoGeneratorPhiZ.cxx +++ b/STEER/AliLegoGeneratorPhiZ.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 2001/01/12 09:23:17 morsch +Correct order of phi and z. + Revision 1.3 2000/11/30 07:12:49 alibrary Introducing new Rndm and QA classes @@ -83,6 +86,6 @@ void AliLegoGeneratorPhiZ::Generate() Float_t polar[3]={0.,0.,0.}; Int_t ntr; - gAlice->SetTrack(1, 0, kMpart, pmom, orig, polar, 0, kPPrimary, ntr); + gAlice->SetTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr); } diff --git a/STEER/AliLegoGeneratorXYZ.cxx b/STEER/AliLegoGeneratorXYZ.cxx index d278e47df21..3f407fea606 100644 --- a/STEER/AliLegoGeneratorXYZ.cxx +++ b/STEER/AliLegoGeneratorXYZ.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.2 2000/11/30 07:12:49 alibrary +Introducing new Rndm and QA classes + Revision 1.1 2000/10/26 14:18:05 morsch Add new AliLegoGenerator classes: AliLegoGeneratorXYZ: carthesian binning @@ -128,7 +131,7 @@ void AliLegoGeneratorXYZ::Generate() Float_t polar[3]={0.,0.,0.}; Int_t ntr; - gAlice->SetTrack(1, 0, kMpart, pmom, orig, polar, 0, kPPrimary, ntr); + gAlice->SetTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr); } diff --git a/STEER/AliMC.cxx b/STEER/AliMC.cxx index 6deb98b0511..b7f9d476b65 100644 --- a/STEER/AliMC.cxx +++ b/STEER/AliMC.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.7 2000/11/30 07:12:49 alibrary +Introducing new Rndm and QA classes + Revision 1.6 2000/07/13 16:19:09 fca Mainly coding conventions + some small bug fixes @@ -34,6 +37,7 @@ Introduction of the Copyright and cvs Log #include #include "AliMC.h" +#include "AliConfig.h" ClassImp(AliMC) @@ -52,6 +56,7 @@ AliMC::AliMC(const char *name, const char *title) : TNamed(name,title) } else { fgMC=this; gMC=this; + AliConfig::Instance()->Add(this); } } diff --git a/STEER/AliMagF.cxx b/STEER/AliMagF.cxx index e755d69798c..8927ae66b8a 100644 --- a/STEER/AliMagF.cxx +++ b/STEER/AliMagF.cxx @@ -15,6 +15,12 @@ /* $Log$ +Revision 1.8 2000/12/18 10:44:01 morsch +Possibility to set field map by passing pointer to objet of type AliMagF via +SetField(). +Example: +gAlice->SetField(new AliMagFCM("Map2", "$(ALICE_ROOT)/data/field01.dat",2,1.,10.)); + Revision 1.7 2000/10/02 21:28:14 fca Removal of useless dependecies via forward declarations @@ -62,6 +68,8 @@ AliMagF::AliMagF(const char *name, const char *title, const Int_t integ, fType = kUndef; fFactor = factor; fMax = fmax; + // + fDebug = 0; } //________________________________________ diff --git a/STEER/AliMagF.h b/STEER/AliMagF.h index 2a0c9f08185..ab44a096e6e 100644 --- a/STEER/AliMagF.h +++ b/STEER/AliMagF.h @@ -23,6 +23,8 @@ public: virtual Int_t Integ() const {return fInteg;} virtual Float_t Factor() const {return fFactor;} virtual void ReadField() {} + virtual void SetDebug(Int_t level=0) {fDebug=level;} + virtual Int_t GetDebug() const {return fDebug;} protected: Int_t fMap; // Field Map identifier @@ -30,6 +32,7 @@ protected: Int_t fInteg; // Integration method as indicated in Geant Float_t fFactor; // Multiplicative factor Float_t fMax; // Max Field as indicated in Geant + Int_t fDebug; // Debug flag ClassDef(AliMagF,1) //Base class for all Alice MagField }; diff --git a/STEER/AliMagFCM.cxx b/STEER/AliMagFCM.cxx index 3810a0b0808..c38b02941d0 100644 --- a/STEER/AliMagFCM.cxx +++ b/STEER/AliMagFCM.cxx @@ -15,6 +15,12 @@ /* $Log$ +Revision 1.6 2000/12/18 10:44:01 morsch +Possibility to set field map by passing pointer to objet of type AliMagF via +SetField(). +Example: +gAlice->SetField(new AliMagFCM("Map2", "$(ALICE_ROOT)/data/field01.dat",2,1.,10.)); + Revision 1.5 2000/12/01 11:20:27 alibrary Corrector dipole removed from ZDC @@ -49,8 +55,8 @@ AliMagFCM::AliMagFCM(const char *name, const char *title, const Int_t integ, fType = kConMesh; fMap = 2; - printf("Constant Mesh Field %s created: map= %d, factor= %f, file= %s\n", - fName.Data(), fMap, factor,fTitle.Data()); + if(fDebug>-1) printf("%s: Constant Mesh Field %s created: map= %d, factor= %f, file= %s\n", + ClassName(),fName.Data(), fMap, factor,fTitle.Data()); } //________________________________________ @@ -201,15 +207,15 @@ void AliMagFCM::ReadField() Int_t ix, iy, iz, ipx, ipy, ipz; Float_t bx, by, bz; char *fname; - printf("Reading Magnetic Field %s from file %s\n",fName.Data(),fTitle.Data()); + if(fDebug) printf("%s: Reading Magnetic Field %s from file %s\n",ClassName(),fName.Data(),fTitle.Data()); fname = gSystem->ExpandPathName(fTitle.Data()); magfile=fopen(fname,"r"); delete [] fname; if (magfile) { fscanf(magfile,"%d %d %d %f %f %f %f %f %f", &fXn, &fYn, &fZn, &fXdel, &fYdel, &fZdel, &fXbeg, &fYbeg, &fZbeg); - printf("fXn %d, fYn %d, fZn %d, fXdel %f, fYdel %f, fZdel %f, fXbeg %f, fYbeg %f, fZbeg %f\n", - fXn, fYn, fZn, fXdel, fYdel, fZdel, fXbeg, fYbeg, fZbeg); + if(fDebug>1) printf("%s: fXn %d, fYn %d, fZn %d, fXdel %f, fYdel %f, fZdel %f, fXbeg %f, fYbeg %f, fZbeg %f\n", + ClassName(),fXn, fYn, fZn, fXdel, fYdel, fZdel, fXbeg, fYbeg, fZbeg); fXdeli=1./fXdel; fYdeli=1./fYdel; fZdeli=1./fZdel; @@ -228,7 +234,7 @@ void AliMagFCM::ReadField() } } } else { - printf("File %s not found !\n",fTitle.Data()); + printf("%s: File %s not found !\n",ClassName(),fTitle.Data()); exit(1); } } diff --git a/STEER/AliModule.cxx b/STEER/AliModule.cxx index 0aba0a506f3..05528ee8660 100644 --- a/STEER/AliModule.cxx +++ b/STEER/AliModule.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.15 2001/03/20 06:36:28 alibrary +100 parameters now allowed for geant shapes + Revision 1.14 2001/01/26 19:58:48 hristov Major upgrade of AliRoot code @@ -66,6 +69,7 @@ Introduction of the Copyright and cvs Log #include "AliRun.h" #include "AliMagF.h" #include "AliMC.h" +#include "AliConfig.h" ClassImp(AliModule) @@ -79,6 +83,7 @@ AliModule::AliModule() fNodes = 0; fIdtmed = 0; fIdmate = 0; + fDebug = 0; } //_____________________________________________________________________________ @@ -118,6 +123,9 @@ AliModule::AliModule(const char* name,const char *title):TNamed(name,title) // Prepare to find the tracking media range fLoMedium = 65536; fHiMedium = 0; + + AliConfig::Instance()->Add(this); + SetDebug(gAlice->GetDebug()); } @@ -525,7 +533,7 @@ void AliModule::ReadEuclid(const char* filnam, char* topvol) } if (istop[i] && !flag) { strcpy(topvol,volst[i]); - printf(" *** GREUCL *** volume %s taken as a top volume\n",topvol); + if(fDebug) printf("%s::ReadEuclid: volume %s taken as a top volume\n",ClassName(),topvol); flag=1; } } @@ -535,7 +543,7 @@ void AliModule::ReadEuclid(const char* filnam, char* topvol) fclose (lun); //* //* commented out only for the not cernlib version - printf(" *** GREUCL *** file: %s is now read in\n",filnam); + if(fDebug) printf("%s::ReadEuclid: file: %s is now read in\n",ClassName(),filnam); // return; //* @@ -573,7 +581,7 @@ void AliModule::ReadEuclidMedia(const char* filnam) } // // *** The input filnam name will be with extension '.euc' - printf("The file name is %s\n",filnam); //Debug + if(fDebug) printf("%s::ReadEuclid: The file name is %s\n",ClassName(),filnam); //Debug filtmp=gSystem->ExpandPathName(filnam); lun=fopen(filtmp,"r"); delete [] filtmp; @@ -628,7 +636,8 @@ void AliModule::ReadEuclidMedia(const char* filnam) fclose (lun); //* //* commented out only for the not cernlib version - Warning("ReadEuclidMedia","file: %s is now read in\n",filnam); + if(fDebug) printf("%s::ReadEuclidMedia: file %s is now read in\n", + ClassName(),filnam); //* return; //* diff --git a/STEER/AliModule.h b/STEER/AliModule.h index cbc8bfb89c6..37381d2c5eb 100644 --- a/STEER/AliModule.h +++ b/STEER/AliModule.h @@ -93,7 +93,7 @@ public: //virtual void Hits2Digits() {} virtual void Init() {} virtual void LoadPoints(Int_t ) {} - virtual void MakeBranch(Option_t *, char *file=0 ) {} + virtual void MakeBranch(Option_t *, const char *file=0 ) {} virtual void Paint(Option_t *) {} virtual void ResetDigits() {} virtual void ResetSDigits() {} diff --git a/STEER/AliRun.cxx b/STEER/AliRun.cxx index 39b670fcf1f..7e9c6b53e0b 100644 --- a/STEER/AliRun.cxx +++ b/STEER/AliRun.cxx @@ -192,7 +192,8 @@ Introduction of the Copyright and cvs Log #include #include #include -#include "TBrowser.h" +#include +#include #include "TParticle.h" #include "AliRun.h" @@ -207,39 +208,38 @@ Introduction of the Copyright and cvs Log #include "AliMCQA.h" #include "AliGenerator.h" #include "AliLegoGenerator.h" +#include "AliConfig.h" +#include "AliStack.h" +#include "AliGenEventHeader.h" +#include "AliHeader.h" #include "AliDetector.h" AliRun *gAlice; -static AliHeader *gAliHeader; - ClassImp(AliRun) //_____________________________________________________________________________ AliRun::AliRun() - : fParticleFileMap(fHeader.GetParticleFileMap()) { // // Default constructor for AliRun // - gAliHeader=&fHeader; + fHeader = 0; fRun = 0; fEvent = 0; - fCurrent = -1; - fModules = 0; + fStack = 0; + fModules = 0; fGenerator = 0; fTreeD = 0; - fTreeK = 0; fTreeH = 0; fTreeE = 0; fTreeR = 0; fTreeS = 0; - fParticles = 0; fGeometry = 0; fDisplay = 0; fField = 0; - fMC = 0; + fMC = 0; fNdets = 0; fImedia = 0; fTrRmax = 1.e10; @@ -253,15 +253,12 @@ AliRun::AliRun() fMCQA = 0; fTransParName = "\0"; fBaseFileName = ".\0"; - fParticleBuffer = 0; - fParticleMap = new TObjArray(10000); + fDebug = 0; } //_____________________________________________________________________________ AliRun::AliRun(const char *name, const char *title) - : TNamed(name,title), - fParticleFileMap(fHeader.GetParticleFileMap()) - + : TNamed(name,title) { // // Constructor for the main processor. @@ -273,7 +270,6 @@ AliRun::AliRun(const char *name, const char *title) gAlice = this; fTreeD = 0; - fTreeK = 0; fTreeH = 0; fTreeE = 0; fTreeR = 0; @@ -295,6 +291,8 @@ AliRun::AliRun(const char *name, const char *title) gROOT->GetListOfBrowsables()->Add(this,name); // + // Particle stack + fStack = new AliStack(10000); // create the support list for the various Detectors fModules = new TObjArray(77); // @@ -302,17 +300,10 @@ AliRun::AliRun(const char *name, const char *title) BuildSimpleGeometry(); - - fNtrack=0; - fHgwmk=0; - fCurrent=-1; - gAliHeader=&fHeader; + fHeader = new AliHeader(); fRun = 0; fEvent = 0; // - // Create the particle stack - fParticles = new TClonesArray("TParticle",1000); - fDisplay = 0; // // Create default mag field @@ -326,14 +317,16 @@ AliRun::AliRun(const char *name, const char *title) // // Make particles fPDGDB = TDatabasePDG::Instance(); //Particle factory object! + + AliConfig::Instance()->Add(fPDGDB); // // Create HitLists list fHitLists = new TList(); // SetTransPar(); fBaseFileName = ".\0"; - fParticleBuffer = 0; - fParticleMap = new TObjArray(10000); + // + fDebug = 0; } @@ -351,7 +344,6 @@ AliRun::~AliRun() delete fGenerator; delete fLego; delete fTreeD; - delete fTreeK; delete fTreeH; delete fTreeE; delete fTreeR; @@ -360,13 +352,11 @@ AliRun::~AliRun() fModules->Delete(); delete fModules; } - if (fParticles) { - fParticles->Delete(); - delete fParticles; - } + delete fStack; delete fHitLists; delete fPDGDB; delete fMCQA; + delete fHeader; } //_____________________________________________________________________________ @@ -397,7 +387,10 @@ void AliRun::Browse(TBrowser *b) // of the Root browser. // It displays the Root Trees and all detectors. // - if (fTreeK) b->Add(fTreeK,fTreeK->GetName()); + if(!fStack) fStack=fHeader->Stack(); + TTree* pTreeK = fStack->TreeK(); + + if (pTreeK) b->Add(pTreeK,pTreeK->GetName()); if (fTreeH) b->Add(fTreeH,fTreeH->GetName()); if (fTreeD) b->Add(fTreeD,fTreeD->GetName()); if (fTreeE) b->Add(fTreeE,fTreeE->GetName()); @@ -449,25 +442,6 @@ void AliRun::CleanDetectors() } } -//_____________________________________________________________________________ -void AliRun::CleanParents() -{ - // - // Clean Particles stack. - // Set parent/daughter relations - // - TObjArray &particles = *fParticleMap; - TParticle *part; - int i; - for(i=0; iTestBit(kDaughtersBit)) { - part->SetFirstDaughter(-1); - part->SetLastDaughter(-1); - } - } -} - //_____________________________________________________________________________ Int_t AliRun::DistancetoPrimitive(Int_t, Int_t) { @@ -484,7 +458,7 @@ void AliRun::DumpPart (Int_t i) const // // Dumps particle i in the stack // - ((TParticle*) (*fParticleMap)[i])->Print(); + fStack->DumpPart(i); } //_____________________________________________________________________________ @@ -493,18 +467,10 @@ void AliRun::DumpPStack () const // // Dumps the particle stack // - TObjArray &particles = *fParticleMap; - printf( - "\n\n=======================================================================\n"); - for (Int_t i=0;i %d ",i); ((TParticle*) particles[i])->Print(); - printf("--------------------------------------------------------------\n"); - } - printf( - "\n=======================================================================\n\n"); + fStack->DumpPStack(); } +//_____________________________________________________________________________ void AliRun::SetField(AliMagF* magField) { // Set Magnetic Field Map @@ -573,7 +539,7 @@ void AliRun::FinishPrimary() // static Int_t count=0; // const Int_t times=10; // This primary is finished, purify stack - PurifyKine(); + fStack->PurifyKine(); TIter next(fModules); AliModule *detector; @@ -586,11 +552,20 @@ void AliRun::FinishPrimary() gAlice->TreeH()->Fill(); } + // + // if(++count%times==1) gObjectTable->Print(); +} + +//_____________________________________________________________________________ +void AliRun::BeginPrimary() +{ + // + // Called at the beginning of each primary track + // + // Reset Hits info gAlice->ResetHits(); - // - // if(++count%times==1) gObjectTable->Print(); } //_____________________________________________________________________________ @@ -609,73 +584,29 @@ void AliRun::FinishEvent() fSummEnergy[i]+=fEventEnergy[i]; fSum2Energy[i]+=fEventEnergy[i]*fEventEnergy[i]; } - fEventEnergy.Reset(); + + - // Clean detector information - CleanDetectors(); + // Update Header information + + fHeader->SetNprimary(fStack->GetNprimary()); + fHeader->SetNtrack(fStack->GetNtrack()); + // Write out the kinematics - if (fTreeK) { - CleanParents(); - if(fTreeK->GetEntries() ==0) { - // set the fParticleFileMap size for the first time - if (fHgwmk+1 > fParticleFileMap.GetSize()) - fParticleFileMap.Set(fHgwmk+1); - } - // fTreeK->Fill(); - Bool_t allFilled = kFALSE; - TObject *part; - for(i=0; iAt(i))) { - fParticleBuffer = (TParticle*) part; - fParticleFileMap[i]= (Int_t) fTreeK->GetEntries(); - fTreeK->Fill(); - (*fParticleMap)[i]=0; - - // When all primaries were filled no particle!=0 - // should be left => to be removed later. - if (allFilled) printf("Why != 0 part # %d?\n",i); - } - else { - // // printf("Why = 0 part # %d?\n",i); => We know. - // break; - // we don't break now in order to be sure there is no - // particle !=0 left. - // To be removed later and replaced with break. - if(!allFilled) allFilled = kTRUE; - } - } + fStack->FinishEvent(); - // Set number of tracks to event header - fHeader.SetNtrack(fNtrack); - - // Write out the digits - if (fTreeD) { - fTreeD->Fill(); - ResetDigits(); - } - - if (fTreeS) { - fTreeS->Fill(); - ResetSDigits(); - } - - // Write out reconstructed clusters - if (fTreeR) { - fTreeR->Fill(); - } - // Write out the event Header information - if (fTreeE) fTreeE->Fill(); + if (fTreeE) { + fHeader->SetStack(fStack); + fTreeE->Fill(); + } - // Reset stack info - ResetStack(); // Write Tree headers - if (fTreeK) fTreeK->Write(0,TObject::kOverwrite); + TTree* pTreeK = fStack->TreeK(); + if (pTreeK) pTreeK->Write(0,TObject::kOverwrite); if (fTreeH) fTreeH->Write(0,TObject::kOverwrite); - if (fTreeD) fTreeD->Write(0,TObject::kOverwrite); - if (fTreeR) fTreeR->Write(0,TObject::kOverwrite); - if (fTreeS) fTreeS->Write(0,TObject::kOverwrite); ++fEvent; } @@ -689,8 +620,6 @@ void AliRun::FinishRun() // if(fLego) fLego->FinishRun(); - - if(fGenerator) fGenerator->FinishRun(); // Clean detector information TIter next(fModules); @@ -712,9 +641,9 @@ void AliRun::FinishRun() Write(0,TObject::kOverwrite); // Clean tree information - if (fTreeK) { - delete fTreeK; fTreeK = 0; - } + + fStack->FinishRun(); + if (fTreeH) { delete fTreeH; fTreeH = 0; } @@ -727,6 +656,9 @@ void AliRun::FinishRun() if (fTreeE) { delete fTreeE; fTreeE = 0; } + if (fTreeS) { + delete fTreeS; fTreeS = 0; + } // Close output file file->Write(); @@ -735,25 +667,9 @@ void AliRun::FinishRun() //_____________________________________________________________________________ void AliRun::FlagTrack(Int_t track) { + // Delegate to stack // - // Flags a track and all its family tree to be kept - // - int curr; - TParticle *particle; - - curr=track; - while(1) { - particle=(TParticle*)fParticleMap->At(curr); - - // If the particle is flagged the three from here upward is saved already - if(particle->TestBit(kKeepBit)) return; - - // Save this particle - particle->SetBit(kKeepBit); - - // Move to father if any - if((curr=particle->GetFirstMother())==-1) return; - } + fStack->FlagTrack(track); } //_____________________________________________________________________________ @@ -768,7 +684,7 @@ void AliRun::EnergySummary() Float_t ed, ed2; Int_t kn, i, left, j, id; const Float_t kzero=0; - Int_t ievent=fHeader.GetEvent()+1; + Int_t ievent=fHeader->GetEvent()+1; // // Energy loss information if(ievent) { @@ -861,45 +777,35 @@ Int_t AliRun::GetEvent(Int_t event) // // Reset existing structures - // 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; + // Create the particle stack + if (fHeader) delete fHeader; + fHeader = 0; + // Get header from file - if(fTreeE) fTreeE->GetEntry(event); - else Error("GetEvent","Cannot file Header Tree\n"); + if(fTreeE) { + fTreeE->SetBranchAddress("Header", &fHeader); + fTreeE->GetEntry(event); + } + else + Error("GetEvent","Cannot find Header Tree (TE)\n"); + + // Get the stack from the header + if (fStack) delete fStack; + fStack = fHeader->Stack(); + fStack->GetEvent(event); + // 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", &fParticleBuffer); - else Error("GetEvent","cannot find Kine Tree for event:%d\n",event); - // Create the particle stack - - if(fParticles) - fParticles->Clear(); - else - 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 @@ -909,8 +815,6 @@ 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); @@ -944,9 +848,8 @@ Int_t AliRun::GetEvent(Int_t event) while((detector = (AliModule*)next())) { detector->SetTreeAddress(); } - - fNtrack = Int_t (fTreeK->GetEntries()); - return fNtrack; + + return fStack->GetNtrack(); } //_____________________________________________________________________________ @@ -983,65 +886,18 @@ void AliRun::GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom, Float_t &e, Float_t *vpos, Float_t *polar, Float_t &tof) { + // Delegate to stack // - // Return next track from stack of particles - // - TVector3 pol; - fCurrent=-1; - TParticle *track; - for(Int_t i=fNtrack-1; i>=0; i--) { - track=(TParticle*) fParticleMap->At(i); - if(track) if(!track->TestBit(kDoneBit)) { - // - // The track exists and has not yet been processed - fCurrent=i; - ipart=track->GetPdgCode(); - pmom[0]=track->Px(); - pmom[1]=track->Py(); - pmom[2]=track->Pz(); - e =track->Energy(); - vpos[0]=track->Vx(); - vpos[1]=track->Vy(); - vpos[2]=track->Vz(); - track->GetPolarisation(pol); - polar[0]=pol.X(); - polar[1]=pol.Y(); - polar[2]=pol.Z(); - tof=track->T(); - track->SetBit(kDoneBit); - break; - } - } - mtrack=fCurrent; - // - // stop and start timer when we start a primary track - Int_t nprimaries = fHeader.GetNprimary(); - if (fCurrent >= nprimaries) return; - if (fCurrent < nprimaries-1) { - fTimer.Stop(); - track=(TParticle*) fParticleMap->At(fCurrent+1); - // track->SetProcessTime(fTimer.CpuTime()); - } - fTimer.Start(); + fStack->GetNextTrack(mtrack, ipart, pmom, e, vpos, polar, tof); } //_____________________________________________________________________________ -Int_t AliRun::GetPrimary(Int_t track) +Int_t AliRun::GetPrimary(Int_t track) const { // // return number of primary that has generated track // - int current, parent; - TParticle *part; - // - parent=track; - while (1) { - current=parent; - part = (TParticle *)fParticleMap->At(current); - if(!part) part = Particle(current); - parent=part->GetFirstMother(); - if(parent<0) return current; - } + return fStack->GetPrimary(track); } //_____________________________________________________________________________ @@ -1237,10 +1093,12 @@ void AliRun::ReadTransPar() return; } // - printf(" "); for(i=0;i<60;i++) printf("*"); printf("\n"); - printf(" *%59s\n","*"); - printf(" * Please check carefully what you are doing!%10s\n","*"); - printf(" *%59s\n","*"); + if(fDebug) { + printf(" "); for(i=0;i<60;i++) printf("*"); printf("\n"); + printf(" *%59s\n","*"); + printf(" * Please check carefully what you are doing!%10s\n","*"); + printf(" *%59s\n","*"); + } // while(1) { // Initialise cuts and flags @@ -1253,8 +1111,10 @@ void AliRun::ReadTransPar() if(iret<0) { //End of file fclose(lun); - printf(" *%59s\n","*"); - printf(" "); for(i=0;i<60;i++) printf("*"); printf("\n"); + if(fDebug){ + printf(" *%59s\n","*"); + printf(" "); for(i=0;i<60;i++) printf("*"); printf("\n"); + } return; } // Read the end of line @@ -1287,7 +1147,7 @@ void AliRun::ReadTransPar() // Set energy thresholds for(kz=0;kz=0) { - printf(" * %-6s set to %10.3E for tracking medium code %4d for %s\n", + if(fDebug) printf(" * %-6s set to %10.3E for tracking medium code %4d for %s\n", kpars[kz],cut[kz],itmed,mod->GetName()); gMC->Gstpar(ktmed,kpars[kz],cut[kz]); } @@ -1295,7 +1155,7 @@ void AliRun::ReadTransPar() // Set transport mechanisms for(kz=0;kz=0) { - printf(" * %-6s set to %10d for tracking medium code %4d for %s\n", + if(fDebug) printf(" * %-6s set to %10d for tracking medium code %4d for %s\n", kpars[kncuts+kz],flag[kz],itmed,mod->GetName()); gMC->Gstpar(ktmed,kpars[kncuts+kz],Float_t(flag[kz])); } @@ -1305,69 +1165,15 @@ void AliRun::ReadTransPar() continue; } } else { - Warning("ReadTransPar","Module %s not present\n",detName); + if(fDebug) printf("%s::ReadTransParModule: %s not present\n",ClassName(),detName); continue; } } } -//_____________________________________________________________________________ -TBranch* AliRun::MakeBranchInTree(TTree *tree, const char* name, void* address, Int_t size, char *file) -{ - // - // Makes branch in given tree and diverts them to a separate file - // - if (GetDebug()>1) - printf("* MakeBranch * Making Branch %s \n",name); - - TBranch *branch = tree->Branch(name,address,size); - - if (file) { - char * outFile = new char[strlen(gAlice->GetBaseFile())+strlen(file)+2]; - sprintf(outFile,"%s/%s",gAlice->GetBaseFile(),file); - TDirectory *cwd = gDirectory; - branch->SetFile(outFile); - TIter next( branch->GetListOfBranches()); - while ((branch=(TBranch*)next())) { - branch->SetFile(outFile); - } - if (GetDebug()>1) - printf("* MakeBranch * Diverting Branch %s to file %s\n",name,file); - cwd->cd(); - delete outFile; - } - - return branch; -} //_____________________________________________________________________________ -TBranch* AliRun::MakeBranchInTree(TTree *tree, const char* name, const char *classname, void* address, Int_t size, Int_t splitlevel, char *file) -{ - // - // Makes branch in given tree and diverts them to a separate 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) { - char * outFile = new char[strlen(gAlice->GetBaseFile())+strlen(file)+2]; - sprintf(outFile,"%s/%s",gAlice->GetBaseFile(),file); - branch->SetFile(outFile); - TIter next( branch->GetListOfBranches()); - while ((branch=(TBranch*)next())) { - branch->SetFile(outFile); - } - if (GetDebug()>1) - printf("* MakeBranch * Diverting Branch %s to file %s\n",name,file); - cwd->cd(); - delete outFile; - } - return branch; -} -//_____________________________________________________________________________ -void AliRun::MakeTree(Option_t *option, char *file) +void AliRun::MakeTree(Option_t *option, const char *file) { // // Create the ROOT trees @@ -1384,45 +1190,61 @@ void AliRun::MakeTree(Option_t *option, char *file) const char *oR = strstr(option,"R"); const char *oS = strstr(option,"S"); // + + TDirectory *cwd = gDirectory; + + TBranch *branch = 0; - if (oK && !fTreeK) { - sprintf(hname,"TreeK%d",fEvent); - fTreeK = new TTree(hname,"Kinematics"); - // Create a branch for particles - MakeBranchInTree(fTreeK, - "Particles", "TParticle", &fParticleBuffer, 4000, 1, file) ; - fTreeK->Write(); + if (oK) fStack->MakeTree(fEvent, file); + + if (oE && !fTreeE) { + fTreeE = new TTree("TE","Header"); + branch = fTreeE->Branch("Header", "AliHeader", &fHeader, 4000, 0); + branch->SetAutoDelete(kFALSE); + TFolder *folder = (TFolder *)gROOT->FindObjectAny("/Folders/RunMC/Event/Header"); + if (folder) folder->Add(fHeader); +// branch = fTreeE->Branch("Stack","AliStack", &fStack, 4000, 0); +// branch->SetAutoDelete(kFALSE); +// if (folder) folder->Add(fStack); + fTreeE->Write(0,TObject::kOverwrite); } + + if (file && branch) { + char * outFile = new char[strlen(gAlice->GetBaseFile())+strlen(file)+2]; + sprintf(outFile,"%s/%s",GetBaseFile(),file); + branch->SetFile(outFile); + TIter next( branch->GetListOfBranches()); + while ((branch=(TBranch*)next())) { + branch->SetFile(outFile); + } + if (GetDebug()>1) + printf("* MakeBranch * Diverting Branch %s to file %s\n", branch->GetName(),file); + cwd->cd(); + delete outFile; + } + if (oH && !fTreeH) { sprintf(hname,"TreeH%d",fEvent); fTreeH = new TTree(hname,"Hits"); fTreeH->SetAutoSave(1000000000); //no autosave - fTreeH->Write(); + fTreeH->Write(0,TObject::kOverwrite); } if (oD && !fTreeD) { sprintf(hname,"TreeD%d",fEvent); fTreeD = new TTree(hname,"Digits"); - fTreeD->Write(); + fTreeD->Write(0,TObject::kOverwrite); } if (oS && !fTreeS) { sprintf(hname,"TreeS%d",fEvent); fTreeS = new TTree(hname,"SDigits"); - fTreeS->Write(); + fTreeS->Write(0,TObject::kOverwrite); } if (oR && !fTreeR) { sprintf(hname,"TreeR%d",fEvent); fTreeR = new TTree(hname,"Reconstruction"); - fTreeR->Write(); + fTreeR->Write(0,TObject::kOverwrite); } - if (oE && !fTreeE) { - fTreeE = new TTree("TE","Header"); - TBranch* branch - = MakeBranchInTree(fTreeE, - "Header", "AliHeader", &gAliHeader, 4000, 0, file) ; - branch->SetAutoDelete(kFALSE); - fTreeE->Write(); - } - + // // Create a branch for hits/digits for each detector // Each branch is a TClonesArray. Each data member of the Hits classes @@ -1435,173 +1257,32 @@ void AliRun::MakeTree(Option_t *option, char *file) } //_____________________________________________________________________________ -Int_t AliRun::PurifyKine(Int_t lastSavedTrack, Int_t nofTracks) -{ - // - // PurifyKine with external parameters - // - fHgwmk = lastSavedTrack; - fNtrack = nofTracks; - PurifyKine(); - return fHgwmk; -} - -//_____________________________________________________________________________ -TParticle* AliRun::Particle(Int_t i) +inline TParticle* AliRun::Particle(Int_t i) { - if(!(*fParticleMap)[i]) { - Int_t nentries = fParticles->GetEntries(); - - // algorithmic way of getting entry index - // (primary particles are filled after secondaries) - Int_t entry; - if (iGetEntry(fParticleFileMap[i]); - //fTreeK->GetEntry(entry); - new ((*fParticles)[nentries]) TParticle(*fParticleBuffer); - fParticleMap->AddAt((*fParticles)[nentries],i); - } - return (TParticle *) (*fParticleMap)[i]; -} - -//_____________________________________________________________________________ -void AliRun::PurifyKine() -{ - // - // Compress kinematic tree keeping only flagged particles - // and renaming the particle id's in all the hits - // - // TClonesArray &particles = *fParticles; - TObjArray &particles = *fParticleMap; - int nkeep=fHgwmk+1, parent, i; - 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((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)) { - - // This particle has to be kept - map[i]=nkeep; - // 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=part->GetFirstMother())>fHgwmk) - if(map[parent]==-99) Fatal("PurifyKine","map[%d] = -99!\n",parent); - else part->SetFirstMother(map[parent]); - - nkeep++; - } - } - - // Fix daughters information - for (i=fHgwmk+1; iGetFirstMother(); - if(parent>=0) { - father = (TParticle *)particles.At(parent); - if(father->TestBit(kDaughtersBit)) { - - if(iGetFirstDaughter()) father->SetFirstDaughter(i); - if(i>father->GetLastDaughter()) father->SetLastDaughter(i); - } else { - // Initialise daughters info for first pass - father->SetFirstDaughter(i); - father->SetLastDaughter(i); - father->SetBit(kDaughtersBit); - } - } - } - - // Now loop on all registered hit lists - TIter next(fHitLists); - TCollection *hitList; - while((hitList = (TCollection*)next())) { - TIter nexthit(hitList); - AliHit *hit; - while((hit = (AliHit*)nexthit())) { - hit->SetTrack(map[hit->GetTrack()]); - } - } - - // - // This for detectors which have a special mapping mechanism - // for hits, such as TPC and TRD - // - - TIter nextmod(fModules); - AliModule *detector; - while((detector = (AliModule*)nextmod())) { - 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)); - - - for (i=fHgwmk+1; iGetEntries(); - fTreeK->Fill(); - particles[i]=0; - } - - for (i=nkeep; iRemoveAt(i); - - fNtrack=nkeep; - fHgwmk=nkeep-1; - // delete [] map; + return fStack->Particle(i); } //_____________________________________________________________________________ void AliRun::BeginEvent() { + // Clean-up previous event + // Energy scores + fEventEnergy.Reset(); + // Clean detector information + CleanDetectors(); + // Reset stack info + fStack->Reset(); + + // // Reset all Detectors & kinematics & trees // char hname[30]; // + // Initialise event header + fHeader->Reset(fRun,fEvent); + // + fStack->BeginEvent(fEvent); // if(fLego) { @@ -1610,19 +1291,12 @@ void AliRun::BeginEvent() } // - ResetStack(); + ResetHits(); ResetDigits(); ResetSDigits(); - // Initialise event header - fHeader.Reset(fRun,fEvent); - if(fTreeK) { - fTreeK->Reset(); - sprintf(hname,"TreeK%d",fEvent); - fTreeK->SetName(hname); - } if(fTreeH) { fTreeH->Reset(); sprintf(hname,"TreeH%d",fEvent); @@ -1632,16 +1306,19 @@ void AliRun::BeginEvent() fTreeD->Reset(); sprintf(hname,"TreeD%d",fEvent); fTreeD->SetName(hname); + fTreeD->Write(0,TObject::kOverwrite); } if(fTreeS) { fTreeS->Reset(); sprintf(hname,"TreeS%d",fEvent); fTreeS->SetName(hname); + fTreeS->Write(0,TObject::kOverwrite); } if(fTreeR) { fTreeR->Reset(); sprintf(hname,"TreeR%d",fEvent); fTreeR->SetName(hname); + fTreeR->Write(0,TObject::kOverwrite); } } //_____________________________________________________________________________ @@ -1712,7 +1389,7 @@ void AliRun::RunMC(Int_t nevent, const char *setup) // Create the Root Tree with one branch per detector - MakeTree("ESD"); + MakeTree("ESDR"); if (gSystem->Getenv("CONFIG_SPLIT_FILE")) { MakeTree("K","Kine.root"); @@ -1728,24 +1405,31 @@ void AliRun::RunMC(Int_t nevent, const char *setup) } //_____________________________________________________________________________ -void AliRun::RunReco(const char *detector) +void AliRun::RunReco(const char *selected) { // // Main function to be called to reconstruct Alice event - // - - MakeTree("R"); - Digits2Reco(detector); + // + for (Int_t nevent=0; neventTreeE()->GetEntries(); nevent++) { + GetEvent(nevent); + // MakeTree("R"); + Digits2Reco(selected); + } } //_____________________________________________________________________________ void AliRun::Hits2Digits(const char *selected) { + // Convert Hits to sumable digits // - Hits2SDigits(selected); - SDigits2Digits(selected); + for (Int_t nevent=0; neventTreeE()->GetEntries(); nevent++) { + GetEvent(nevent); + // MakeTree("D"); + Hits2SDigits(selected); + SDigits2Digits(selected); + } } @@ -1769,9 +1453,7 @@ void AliRun::Tree2Tree(Option_t *option, const char *selected) const char *oD = strstr(option,"D"); const char *oR = strstr(option,"R"); - gAlice->GetEvent(0); - - TObjArray *detectors = gAlice->Detectors(); + TObjArray *detectors = Detectors(); TIter next(detectors); @@ -1785,8 +1467,6 @@ void AliRun::Tree2Tree(Option_t *option, const char *selected) if (selected) if (strcmp(detector->GetName(),selected)) continue; if (detector->IsActive()){ - if (GetDebug()>0) - cout << "Processing " << detector->GetName() << "..." << endl; if (gSystem->Getenv("CONFIG_SPLIT_FILE")) { if (oS) { sprintf(outFile,"SDigits.%s.root",detector->GetName()); @@ -1806,16 +1486,21 @@ void AliRun::Tree2Tree(Option_t *option, const char *selected) cwd->cd(); - if (oS) + if (oS) { + cout << "Hits2SDigits: Processing " << detector->GetName() << "..." << endl; detector->Hits2SDigits(); - if (oD) - detector->SDigits2Digits(); - if (oR) + } + if (oD) { + cout << "SDigits2Digits: Processing " << detector->GetName() << "..." << endl; + detector->SDigits2Digits(); + } + if (oR) { + cout << "Digits2Reco: Processing " << detector->GetName() << "..." << endl; detector->Digits2Reco(); - - cwd->cd(); + } - } + cwd->cd(); + } } } @@ -1916,7 +1601,7 @@ void AliRun::SetCurrentTrack(Int_t track) // // Set current track number // - fCurrent = track; + fStack->SetCurrentTrack(track); } //_____________________________________________________________________________ @@ -1924,85 +1609,10 @@ void AliRun::SetTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom, Float_t *vpos, Float_t *polar, Float_t tof, AliMCProcess mech, Int_t &ntr, Float_t weight) { - // - // Load a track on the stack - // - // done 0 if the track has to be transported - // 1 if not - // parent identifier of the parent track. -1 for a primary - // pdg particle code - // pmom momentum GeV/c - // vpos position - // polar polarisation - // tof time of flight in seconds - // mecha production mechanism - // ntr on output the number of the track stored - // - TClonesArray &particles = *fParticles; - TParticle *particle; - Float_t mass; - const Int_t kfirstdaughter=-1; - const Int_t klastdaughter=-1; - const Int_t kS=0; - // const Float_t tlife=0; - - // - // Here we get the static mass - // For MC is ok, but a more sophisticated method could be necessary - // if the calculated mass is required - // also, this method is potentially dangerous if the mass - // used in the MC is not the same of the PDG database - // - mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass(); - Float_t e=TMath::Sqrt(mass*mass+pmom[0]*pmom[0]+ - pmom[1]*pmom[1]+pmom[2]*pmom[2]); - - //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[fLoadPoint++]) TParticle(pdg,kS,parent,-1,kfirstdaughter, - klastdaughter,pmom[0],pmom[1],pmom[2], - e,vpos[0],vpos[1],vpos[2],tof); - 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 - particle->SetBit(kDaughtersBit); - // Add the particle to the stack - fParticleMap->AddAtAndExpand(particle,fNtrack); - - if(parent>=0) { - particle=(TParticle*) fParticleMap->At(parent); - particle->SetLastDaughter(fNtrack); - if(particle->GetFirstDaughter()<0) particle->SetFirstDaughter(fNtrack); - } else { - // - // This is a primary track. Set high water mark for this event - fHgwmk=fNtrack; - // - // Set also number if primary tracks - fHeader.SetNprimary(fHgwmk+1); - fHeader.SetNtrack(fHgwmk+1); - } - ntr = fNtrack++; - -/* - // - // Here we get the static mass - // For MC is ok, but a more sophisticated method could be necessary - // if the calculated mass is required - // also, this method is potentially dangerous if the mass - // used in the MC is not the same of the PDG database - // - Float_t mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass(); - Float_t e=TMath::Sqrt(mass*mass+pmom[0]*pmom[0]+ - pmom[1]*pmom[1]+pmom[2]*pmom[2]); - - SetTrack(done, parent, pdg, pmom[0], pmom[1], pmom[2], e, - vpos[0], vpos[1], vpos[2], tof, polar[0],polar[1],polar[2], - mech, ntr, weight); -*/ +// Delegate to stack +// + fStack->SetTrack(done, parent, pdg, pmom, vpos, polar, tof, + mech, ntr, weight); } //_____________________________________________________________________________ @@ -2012,63 +1622,11 @@ void AliRun::SetTrack(Int_t done, Int_t parent, Int_t pdg, Double_t polx, Double_t poly, Double_t polz, AliMCProcess mech, Int_t &ntr, Float_t weight) { + // Delegate to stack // - // Load a track on the stack - // - // done 0 if the track has to be transported - // 1 if not - // parent identifier of the parent track. -1 for a primary - // pdg particle code - // kS generation status code - // px, py, pz momentum GeV/c - // vx, vy, vz position - // polar polarisation - // tof time of flight in seconds - // mech production mechanism - // ntr on output the number of the track stored - // - // New method interface: - // arguments were changed to be in correspondence with TParticle - // constructor. - // Note: the energy is not calculated from the static mass but - // it is passed by argument e. - - TClonesArray &particles = *fParticles; - - const Int_t kS=0; - const Int_t kFirstDaughter=-1; - const Int_t kLastDaughter=-1; - - TParticle* particle - = new(particles[fLoadPoint++]) TParticle(pdg, kS, parent, -1, - kFirstDaughter, kLastDaughter, - px, py, pz, e, vx, vy, vz, tof); - - particle->SetPolarisation(polx, poly, polz); - particle->SetWeight(weight); - particle->SetUniqueID(mech); - - if(!done) particle->SetBit(kDoneBit); - - // 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*) fParticleMap->At(parent); - particle->SetLastDaughter(fNtrack); - if(particle->GetFirstDaughter()<0) particle->SetFirstDaughter(fNtrack); - } else { - // - // This is a primary track. Set high water mark for this event - fHgwmk=fNtrack; - // - // Set also number if primary tracks - fHeader.SetNprimary(fHgwmk+1); - fHeader.SetNtrack(fHgwmk+1); - } - ntr = fNtrack++; + fStack->SetTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof, + polx, poly, polz, mech, ntr, weight); + } //_____________________________________________________________________________ @@ -2076,20 +1634,16 @@ void AliRun::SetHighWaterMark(const Int_t nt) { // // Set high water mark for last track in event - fHgwmk=fNtrack-1; - // - // Set also number if primary tracks - fHeader.SetNprimary(fHgwmk+1); - fHeader.SetNtrack(fHgwmk+1); + fStack->SetHighWaterMark(nt); } //_____________________________________________________________________________ void AliRun::KeepTrack(const Int_t track) { // - // flags a track to be kept + // Delegate to stack // - fParticleMap->At(track)->SetBit(kKeepBit); + fStack->KeepTrack(track); } //_____________________________________________________________________________ @@ -2130,7 +1684,10 @@ void AliRun::Streamer(TBuffer &R__b) gROOT->GetListOfBrowsables()->Add(this,"Run"); fTreeE = (TTree*)gDirectory->Get("TE"); - if (fTreeE) fTreeE->SetBranchAddress("Header", &gAliHeader); + if (fTreeE) { + fTreeE->SetBranchAddress("Header", &fHeader); + } + else Error("Streamer","cannot find Header Tree\n"); fTreeE->GetEntry(0); @@ -2140,3 +1697,35 @@ void AliRun::Streamer(TBuffer &R__b) } } + +//___________________________________________________________________________ +Int_t AliRun::CurrentTrack() const { + // + // Returns current track + // + return fStack->CurrentTrack(); +} + +//___________________________________________________________________________ +Int_t AliRun::GetNtrack() const { + // + // Returns number of tracks in stack + // + return fStack->GetNtrack(); +} + +//___________________________________________________________________________ +TObjArray* AliRun::Particles() { + // + // Returns pointer to Particles array + // + return fStack->Particles(); +} + +//___________________________________________________________________________ +TTree* AliRun::TreeK() { + // + // Returns pointer to the TreeK array + // + return fStack->TreeK(); +} diff --git a/STEER/AliRun.h b/STEER/AliRun.h index e3807990b3a..c38c9bd11f5 100644 --- a/STEER/AliRun.h +++ b/STEER/AliRun.h @@ -26,11 +26,13 @@ class AliMC; class AliLego; class AliDisplay; class AliLegoGenerator; -#include "AliHeader.h" +class AliHeader; class AliGenerator; class AliLegoGenerator; #include "AliMCProcess.h" class AliMCQA; +class AliStack; + enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4}; @@ -49,10 +51,9 @@ public: virtual void Build(); virtual void BuildSimpleGeometry(); virtual void CleanDetectors(); - virtual void CleanParents(); TObjArray *Detectors() const {return fModules;} TObjArray *Modules() const {return fModules;} - Int_t CurrentTrack() const {return fCurrent;} + Int_t CurrentTrack() const; AliDisplay *Display() { return fDisplay;} virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); virtual void DumpPart (Int_t i) const; @@ -61,6 +62,7 @@ public: virtual void PreTrack(); virtual void PostTrack(); virtual void FinishPrimary(); + virtual void BeginPrimary(); virtual void FinishEvent(); virtual void FinishRun(); virtual void FlagTrack(Int_t track); @@ -71,6 +73,7 @@ public: void SetRunNumber(Int_t run) {fRun=run;} Int_t GetDebug() const {return fDebug;} AliModule *GetModule(const char *name) const; + TList* GetHitLists() const {return fHitLists ;} AliDetector *GetDetector(const char *name) const; AliMCQA *GetMCQA() const {return fMCQA;} Int_t GetModuleID(const char *name) const; @@ -82,29 +85,24 @@ public: virtual const char *GetConfigFunction() const {return fConfigFunction.Data();} TGeometry *GetGeometry(); - AliHeader *GetHeader() {return &fHeader;} + AliHeader* GetHeader() {return fHeader;} virtual void GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom, Float_t &e, Float_t *vpos, Float_t *polar, Float_t &tof); - Int_t GetNtrack() const {return fNtrack;} - virtual Int_t GetPrimary(Int_t track); + Int_t GetNtrack() const; + virtual Int_t GetPrimary(Int_t track) const; virtual void Hits2Digits(const char *detector=0); virtual void Hits2SDigits(const char *detector=0) {Tree2Tree("S",detector);} virtual void SDigits2Digits(const char *detector=0) {Tree2Tree("D",detector);} virtual void Digits2Reco(const char *detector=0) {Tree2Tree("R",detector);} - virtual void Tree2Tree(Option_t *option, 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", char *file = 0); - virtual TBranch* MakeBranchInTree(TTree *tree, const char* cname, void* address, Int_t size=32000, char *file=0); - virtual TBranch* MakeBranchInTree(TTree *tree, const char* cname, const char* name, void* address, Int_t size=32000, Int_t splitlevel=1, char *file=0); + virtual void MakeTree(Option_t *option="KH", const char *file = 0); - TObjArray *Particles() {return fParticleMap;}; + TObjArray *Particles(); 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(); @@ -113,7 +111,6 @@ public: virtual void SetTransPar(char *filename="$(ALICE_ROOT)/data/galice.cuts"); virtual void SetBaseFile(char *filename="galice.root"); virtual void ReadTransPar(); - 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);} @@ -123,7 +120,7 @@ public: virtual Bool_t IsLegoRun() const {return (fLego!=0);} virtual void RunReco(const char *detector=0); virtual void SetCurrentTrack(Int_t track); - virtual void SetDebug(const Int_t level=1) {fDebug = level;} + virtual void SetDebug(const Int_t level=0) {fDebug = level;} virtual void SetDisplay(AliDisplay *display) {fDisplay = display;} virtual void StepManager(Int_t id); virtual void SetField(Int_t type=2, Int_t version=1, Float_t scale=1, Float_t maxField=10, char*filename="$(ALICE_ROOT)/data/field01.dat"); @@ -156,26 +153,24 @@ public: TTree *TreeS() {return fTreeS;} TTree *TreeE() {return fTreeE;} TTree *TreeH() {return fTreeH;} - TTree *TreeK() {return fTreeK;} + TTree *TreeK() ; TTree *TreeR() {return fTreeR;} + AliStack *Stack() {return fStack;} + protected: + virtual void Tree2Tree(Option_t *option, const char *detector=0); + 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 + 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 @@ -198,17 +193,12 @@ protected: 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 - + AliStack* fStack; // ! Particle Stack private: AliRun(const AliRun &right) - : fParticleFileMap(right.fParticleFileMap) {} - AliRun& operator = (const AliRun &right) - { fParticleFileMap= right.fParticleFileMap; return *this; } - + {} + AliRun& operator = (const AliRun &) {return *this;} ClassDef(AliRun,4) //Supervisor class for all Alice detectors }; diff --git a/STEER/AliStack.cxx b/STEER/AliStack.cxx new file mode 100644 index 00000000000..fbe212a04d9 --- /dev/null +++ b/STEER/AliStack.cxx @@ -0,0 +1,776 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/* +$Log$ +*/ + +/////////////////////////////////////////////////////////////////////////////// +// // +// Particles stack class +// // +/////////////////////////////////////////////////////////////////////////////// + +#include + +#include +#include +#include +#include +#include +#include + +#include "AliStack.h" +#include "AliRun.h" +#include "AliModule.h" +#include "AliHit.h" +//#include "ETrackBits.h" + +ClassImp(AliStack) + +//_____________________________________________________________________________ +AliStack::AliStack(Int_t size) +{ + // + // Constructor + // + + // Create the particles arrays + fParticles = new TClonesArray("TParticle",1000); + fParticleMap = new TObjArray(size); + fParticleBuffer = new TParticle(); + fNtrack = 0; + fNprimary = 0; + fCurrent = -1; + fCurrentPrimary = -1; + fTreeK = 0; +} + + +//_____________________________________________________________________________ +AliStack::AliStack() +{ + // + // Default constructor + // + + // Create the particles arrays + fParticles = new TClonesArray("TParticle",1000); + fParticleMap = new TObjArray(10000); + fParticleBuffer = new TParticle(); + fNtrack = 0; + fCurrent = -1; + fNprimary = 0; + fCurrentPrimary = -1; + fTreeK = 0; +} + + +//_____________________________________________________________________________ +AliStack::~AliStack() +{ + // + // Destructor + // + + if (fParticles) { + fParticles->Delete(); + delete fParticles; + } + delete fParticleMap; + delete fParticleBuffer; + delete fTreeK; +} + +// +// public methods +// + +//_____________________________________________________________________________ +void AliStack::SetTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom, + Float_t *vpos, Float_t *polar, Float_t tof, + AliMCProcess mech, Int_t &ntr, Float_t weight) +{ + // + // Load a track on the stack + // + // done 0 if the track has to be transported + // 1 if not + // parent identifier of the parent track. -1 for a primary + // pdg particle code + // pmom momentum GeV/c + // vpos position + // polar polarisation + // tof time of flight in seconds + // mecha production mechanism + // ntr on output the number of the track stored + // + + Float_t mass; + const Int_t kfirstdaughter=-1; + const Int_t klastdaughter=-1; + const Int_t kS=0; + // const Float_t tlife=0; + + // + // Here we get the static mass + // For MC is ok, but a more sophisticated method could be necessary + // if the calculated mass is required + // also, this method is potentially dangerous if the mass + // used in the MC is not the same of the PDG database + // + mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass(); + Float_t e=TMath::Sqrt(mass*mass+pmom[0]*pmom[0]+ + pmom[1]*pmom[1]+pmom[2]*pmom[2]); + +// printf("Loading mass %f ene %f No %d ip %d parent %d done %d pos %f %f %f mom %f %f %f kS %d m \n", +// mass,e,fNtrack,pdg,parent,done,vpos[0],vpos[1],vpos[2],pmom[0],pmom[1],pmom[2],kS); + + TClonesArray &particles = *fParticles; + TParticle* 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); + 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 + particle->SetBit(kDaughtersBit); + // Add the particle to the stack + fParticleMap->AddAtAndExpand(particle, fNtrack); + + if(parent>=0) { + particle = (TParticle*) fParticleMap->At(parent); + particle->SetLastDaughter(fNtrack); + if(particle->GetFirstDaughter()<0) particle->SetFirstDaughter(fNtrack); + } + else { + // + // This is a primary track. Set high water mark for this event + fHgwmk = fNtrack; + // + // Set also number if primary tracks + fNprimary = fHgwmk+1; + fCurrentPrimary++; + } + ntr = fNtrack++; +} + +//_____________________________________________________________________________ +void AliStack::SetTrack(Int_t done, Int_t parent, Int_t pdg, + Double_t px, Double_t py, Double_t pz, Double_t e, + Double_t vx, Double_t vy, Double_t vz, Double_t tof, + Double_t polx, Double_t poly, Double_t polz, + AliMCProcess mech, Int_t &ntr, Float_t weight) +{ + // + // Load a track on the stack + // + // done 0 if the track has to be transported + // 1 if not + // parent identifier of the parent track. -1 for a primary + // pdg particle code + // kS generation status code + // px, py, pz momentum GeV/c + // vx, vy, vz position + // polar polarisation + // tof time of flight in seconds + // mech production mechanism + // ntr on output the number of the track stored + // + // New method interface: + // arguments were changed to be in correspondence with TParticle + // constructor. + // Note: the energy is not calculated from the static mass but + // it is passed by argument e. + + + const Int_t kS=0; + const Int_t kFirstDaughter=-1; + const Int_t kLastDaughter=-1; + + TClonesArray &particles = *fParticles; + TParticle* particle + = new(particles[fLoadPoint++]) + TParticle(pdg, kS, parent, -1, kFirstDaughter, kLastDaughter, + px, py, pz, e, vx, vy, vz, tof); + + particle->SetPolarisation(polx, poly, polz); + particle->SetWeight(weight); + particle->SetUniqueID(mech); + + if(!done) particle->SetBit(kDoneBit); + + // Declare that the daughter information is valid + particle->SetBit(kDaughtersBit); + // Add the particle to the stack + fParticleMap->AddAtAndExpand(particle, fNtrack);//CHECK!! + + if(parent>=0) { + particle = (TParticle*) fParticleMap->At(parent); + particle->SetLastDaughter(fNtrack); + if(particle->GetFirstDaughter()<0) particle->SetFirstDaughter(fNtrack); + } + else { + // + // This is a primary track. Set high water mark for this event + fHgwmk = fNtrack; + // + // Set also number if primary tracks + fNprimary = fHgwmk+1; + fCurrentPrimary++; + } + ntr = fNtrack++; +} + +//_____________________________________________________________________________ +void AliStack::GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom, + Float_t &e, Float_t *vpos, Float_t *polar, + Float_t &tof) +{ + // + // Return next track from stack of particles + // + + + TParticle* track = GetNextParticle(); +// cout << "GetNextTrack():" << fCurrent << fNprimary << endl; + + if(track) { + mtrack=fCurrent; + ipart=track->GetPdgCode(); + pmom[0]=track->Px(); + pmom[1]=track->Py(); + pmom[2]=track->Pz(); + e =track->Energy(); + vpos[0]=track->Vx(); + vpos[1]=track->Vy(); + vpos[2]=track->Vz(); + TVector3 pol; + track->GetPolarisation(pol); + polar[0]=pol.X(); + polar[1]=pol.Y(); + polar[2]=pol.Z(); + tof=track->T(); + track->SetBit(kDoneBit); + //cout << "Filled params" << endl; + } + else + mtrack=-1; + + // + // stop and start timer when we start a primary track + Int_t nprimaries = fNprimary; + if (fCurrent >= nprimaries) return; + if (fCurrent < nprimaries-1) { + fTimer.Stop(); + track=(TParticle*) fParticleMap->At(fCurrent+1); + // track->SetProcessTime(fTimer.CpuTime()); + } + fTimer.Start(); +} + + +//_____________________________________________________________________________ +void AliStack::PurifyKine() +{ + // + // Compress kinematic tree keeping only flagged particles + // and renaming the particle id's in all the hits + // + + TObjArray &particles = *fParticleMap; + int nkeep=fHgwmk+1, parent, i; + TParticle *part, *father; + TArrayI map(particles.GetLast()+1); + + // Save in Header total number of tracks before compression + + // 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((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)) { + + // This particle has to be kept + map[i]=nkeep; + // 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=part->GetFirstMother())>fHgwmk) + if(map[parent]==-99) Fatal("PurifyKine","map[%d] = -99!\n",parent); + else part->SetFirstMother(map[parent]); + + nkeep++; + } + } + + // Fix daughters information + for (i=fHgwmk+1; iGetFirstMother(); + if(parent>=0) { + father = (TParticle *)particles.At(parent); + if(father->TestBit(kDaughtersBit)) { + + if(iGetFirstDaughter()) father->SetFirstDaughter(i); + if(i>father->GetLastDaughter()) father->SetLastDaughter(i); + } else { + // Initialise daughters info for first pass + father->SetFirstDaughter(i); + father->SetLastDaughter(i); + father->SetBit(kDaughtersBit); + } + } + } + + // Now loop on all registered hit lists + TList* hitLists = gAlice->GetHitLists(); + TIter next(hitLists); + TCollection *hitList; + while((hitList = (TCollection*)next())) { + TIter nexthit(hitList); + AliHit *hit; + while((hit = (AliHit*)nexthit())) { + hit->SetTrack(map[hit->GetTrack()]); + } + } + + // + // This for detectors which have a special mapping mechanism + // for hits, such as TPC and TRD + // + + TObjArray* modules = gAlice->Modules(); + TIter nextmod(modules); + AliModule *detector; + while((detector = (AliModule*)nextmod())) { + 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)); + + for (i=fHgwmk+1; iGetEntries(); + fTreeK->Fill(); + particles[i]=0; + } + + for (i=nkeep; iRemoveAt(i); + + fNtrack=nkeep; + fHgwmk=nkeep-1; + // delete [] map; +} + +//_____________________________________________________________________________ +void AliStack::FinishEvent() +{ + // + // Write out the kinematics that was not yet filled + // + + // Update event header + + + if (!fTreeK) { +// Fatal("FinishEvent", "No kinematics tree is defined."); +// Don't panic this is a probably a lego run + return; + + } + + CleanParents(); + if(fTreeK->GetEntries() ==0) { + // set the fParticleFileMap size for the first time + fParticleFileMap.Set(fHgwmk+1); + } + + Bool_t allFilled = kFALSE; + TObject *part; + for(Int_t i=0; iAt(i))) { + fParticleBuffer = (TParticle*) part; + fParticleFileMap[i]= (Int_t) fTreeK->GetEntries(); + fTreeK->Fill(); + (*fParticleMap)[i]=0; + + // When all primaries were filled no particle!=0 + // should be left => to be removed later. + if (allFilled) printf("Why != 0 part # %d?\n",i); + } + else { + // // printf("Why = 0 part # %d?\n",i); => We know. + // break; + // we don't break now in order to be sure there is no + // particle !=0 left. + // To be removed later and replaced with break. + if(!allFilled) allFilled = kTRUE; + } + //cout << "Nof particles: " << fNtrack << endl; + //Reset(); +} + +//_____________________________________________________________________________ +void AliStack::FlagTrack(Int_t track) +{ + // + // Flags a track and all its family tree to be kept + // + + TParticle *particle; + + Int_t curr=track; + while(1) { + particle=(TParticle*)fParticleMap->At(curr); + + // If the particle is flagged the three from here upward is saved already + if(particle->TestBit(kKeepBit)) return; + + // Save this particle + particle->SetBit(kKeepBit); + + // Move to father if any + if((curr=particle->GetFirstMother())==-1) return; + } +} + +//_____________________________________________________________________________ +void AliStack::KeepTrack(const Int_t track) +{ + // + // Flags a track to be kept + // + + fParticleMap->At(track)->SetBit(kKeepBit); +} + +//_____________________________________________________________________________ +void AliStack::Reset(Int_t size) +{ + // + // Resets stack + // + + fNtrack=0; + fNprimary=0; + fHgwmk=0; + fLoadPoint=0; + fCurrent = -1; + ResetArrays(size); +} + +//_____________________________________________________________________________ +void AliStack::ResetArrays(Int_t size) +{ + // + // Resets stack arrays + // + + fParticles->Clear(); + fParticleMap->Clear(); + if (size>0) fParticleMap->Expand(size); +} + +//_____________________________________________________________________________ +void AliStack::SetHighWaterMark(const Int_t nt) +{ + // + // Set high water mark for last track in event + // + + fHgwmk = fNtrack-1; + fCurrentPrimary=fHgwmk; + + // Set also number of primary tracks + fNprimary = fHgwmk+1; + fNtrack = fHgwmk+1; +} + +//_____________________________________________________________________________ +TParticle* AliStack::Particle(Int_t i) +{ + // + // Return particle with specified ID + + if(!(*fParticleMap)[i]) { + Int_t nentries = fParticles->GetEntries(); + // algorithmic way of getting entry index + // (primary particles are filled after secondaries) + Int_t entry; + if (iGetEntry(entry); + new ((*fParticles)[nentries]) TParticle(*fParticleBuffer); + fParticleMap->AddAt((*fParticles)[nentries],i); + } + return (TParticle *) (*fParticleMap)[i]; +} + +//_____________________________________________________________________________ +Int_t AliStack::GetPrimary(Int_t id) const +{ + // + // Return number of primary that has generated track + // + + int current, parent; + TParticle *part; + // + parent=id; + while (1) { + current=parent; + part = (TParticle *)fParticleMap->At(current); + parent=part->GetFirstMother(); + if(parent<0) return current; + } +} + +//_____________________________________________________________________________ +void AliStack::DumpPart (Int_t i) const +{ + // + // Dumps particle i in the stack + // + + ((TParticle*) (*fParticleMap)[i])->Print(); +} + +//_____________________________________________________________________________ +void AliStack::DumpPStack () +{ + // + // Dumps the particle stack + // + + printf( + "\n\n=======================================================================\n"); + for (Int_t i=0;i %d ",i); particle->Print(); + printf("--------------------------------------------------------------\n"); + } + else + Warning("DumpPStack", "No particle with id %d.", i); + } + + printf( + "\n=======================================================================\n\n"); + + // print particle file map + printf("\nParticle file map: \n"); + for (Int_t i=0; i %d ",i); particle->Print(); + printf("--------------------------------------------------------------\n"); + } + else { + printf("-> %d Particle not loaded.\n",i); + printf("--------------------------------------------------------------\n"); + } + } + printf( + "\n=======================================================================\n\n"); +} + +// +// protected methods +// + +//_____________________________________________________________________________ +void AliStack::CleanParents() +{ + // + // Clean particles stack + // Set parent/daughter relations + // + + TObjArray &particles = *fParticleMap; + TParticle *part; + int i; + for(i=0; iTestBit(kDaughtersBit)) { + part->SetFirstDaughter(-1); + part->SetLastDaughter(-1); + } + } +} + +//_____________________________________________________________________________ +TParticle* AliStack::GetNextParticle() +{ + // + // Return next particle from stack of particles + // + + TParticle* particle = 0; + + // search secondaries + //for(Int_t i=fNtrack-1; i>=0; i--) { + for(Int_t i=fNtrack-1; i>fHgwmk; i--) { + particle = (TParticle*) fParticleMap->At(i); + if ((particle) && (!particle->TestBit(kDoneBit))) { + fCurrent=i; + //cout << "GetNextParticle() - secondary " + // << fNtrack << " " << fHgwmk << " " << fCurrent << endl; + return particle; + } + } + + // take next primary if all secondaries were done + while (fCurrentPrimary>=0) { + fCurrent = fCurrentPrimary; + particle = (TParticle*) fParticleMap->At(fCurrentPrimary--); + if ((particle) && (!particle->TestBit(kDoneBit))) { + //cout << "GetNextParticle() - primary " + // << fNtrack << " " << fHgwmk << " " << fCurrent << endl; + return particle; + } + } + + // nothing to be tracked + fCurrent = -1; + //cout << "GetNextParticle() - none " + // << fNtrack << " " << fHgwmk << " " << fCurrent << endl; + return particle; +} + +//__________________________________________________________________________________________ +void AliStack::MakeTree(Int_t event, const char *file) +{ +// +// Make Kine tree and creates branch for writing particles +// + TBranch *branch=0; + // Make Kinematics Tree + char hname[30]; + // printf("\n MakeTree called %d", event); + if (!fTreeK) { + sprintf(hname,"TreeK%d",event); + fTreeK = new TTree(hname,"Kinematics"); + // Create a branch for particles + branch = fTreeK->Branch("Particles", "TParticle", &fParticleBuffer, 4000, 1); + fTreeK->Write(0,TObject::kOverwrite); + } +} + +void AliStack::BeginEvent(Int_t event) +{ +// start a new event +// +// + fNprimary = 0; + fNtrack = 0; + + char hname[30]; + if(fTreeK) { + fTreeK->Reset(); + sprintf(hname,"TreeK%d",event); + fTreeK->SetName(hname); + } +} + +void AliStack::FinishRun() +{ +// Clean TreeK information + if (fTreeK) { + delete fTreeK; fTreeK = 0; + } +} + +void AliStack::GetEvent(Int_t event) +{ +// +// Get new event from TreeK + // Reset/Create the particle stack + if (fTreeK) delete fTreeK; + + // Get Kine Tree from file + char treeName[20]; + sprintf(treeName,"TreeK%d",event); + fTreeK = (TTree*)gDirectory->Get(treeName); + + if (fTreeK) fTreeK->SetBranchAddress("Particles", &fParticleBuffer); + + else + Error("GetEvent","cannot find Kine Tree for event:%d\n",event); +// +// printf("\n primaries %d", fNprimary); +// printf("\n tracks %d", fNtrack); +// + Int_t size = (Int_t)fTreeK->GetEntries(); + ResetArrays(size); +} diff --git a/STEER/AliStack.h b/STEER/AliStack.h new file mode 100644 index 00000000000..094288bb748 --- /dev/null +++ b/STEER/AliStack.h @@ -0,0 +1,112 @@ +#ifndef ALI_STACK_H +#define ALI_STACK_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +#include +#include +#include + +#include "AliMCProcess.h" + +class TObjArray; +class TClonesArray; +class TParticle; +class AliHeader; +class TFile; +class TTree; + + + +class AliStack : public TObject +{ + public: + // creators, destructors + AliStack(Int_t size); + AliStack(); + virtual ~AliStack(); + + // methods + void MakeTree(Int_t event, const char *file); + void BeginEvent(Int_t event); + void FinishRun(); + void GetEvent(Int_t nevent); + void SetTrack(Int_t done, Int_t parent, Int_t pdg, + Float_t *pmom, Float_t *vpos, Float_t *polar, + Float_t tof, AliMCProcess mech, Int_t &ntr, + Float_t weight=1); + void SetTrack(Int_t done, Int_t parent, Int_t pdg, + Double_t px, Double_t py, Double_t pz, Double_t e, + Double_t vx, Double_t vy, Double_t vz, Double_t tof, + Double_t polx, Double_t poly, Double_t polz, + AliMCProcess mech, Int_t &ntr, Float_t weight=1); + void GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom, + Float_t &e, Float_t *vpos, Float_t *polar, Float_t &tof); + void PurifyKine(); + void FinishEvent(); + void FlagTrack(Int_t track); + void KeepTrack(Int_t itrack); + void Reset(Int_t size = 0); + void DumpPart(Int_t i) const; + void DumpPStack (); + void DumpLoadedStack () const; + + // set methods + void SetNtrack(Int_t ntrack); + void SetCurrentTrack(Int_t track); + void SetHighWaterMark(Int_t hgwmk); + // get methods + Int_t GetNtrack() const; + Int_t GetNprimary() const; + Int_t CurrentTrack() const; + TObjArray* Particles() const; + TParticle* Particle(Int_t id); + Int_t GetPrimary(Int_t id) const; + TTree* TreeK() const {return fTreeK;} + + protected: + // methods + void CleanParents(); + void ResetArrays(Int_t size); + TParticle* GetNextParticle(); + + private: + // data members + TClonesArray *fParticles; //! Pointer to list of particles + TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray + TArrayI fParticleFileMap; // Map for particle ids + TParticle *fParticleBuffer; //! Pointer to current particle for writing + TTree *fTreeK; //! Particle stack + Int_t fNtrack; // Number of tracks + Int_t fNprimary; // Number of primaries + Int_t fCurrent; //! Last track returned from the stack + Int_t fCurrentPrimary; //! Last primary track returned from the stack + Int_t fHgwmk; //! Last track purified + Int_t fLoadPoint; //! Next free position in the particle buffer + TStopwatch fTimer; //! Timer object + ClassDef(AliStack,1) //Particles stack +}; + +// inline + +inline void AliStack::SetNtrack(Int_t ntrack) +{ fNtrack = ntrack; } + +inline void AliStack::SetCurrentTrack(Int_t track) +{ fCurrent = track; } + +inline Int_t AliStack::GetNtrack() const +{ return fNtrack; } + +inline Int_t AliStack::GetNprimary() const +{ return fNprimary; } + +inline Int_t AliStack::CurrentTrack() const +{ return fCurrent; } + +inline TObjArray* AliStack::Particles() const +{ return fParticleMap; } + +#endif //ALI_STACK_H diff --git a/STEER/Makefile b/STEER/Makefile index e628d2d3883..833ca7aa63b 100644 --- a/STEER/Makefile +++ b/STEER/Makefile @@ -19,7 +19,8 @@ SRCS = AliDetector.cxx AliHeader.cxx AliMagF.cxx \ AliLegoGeneratorPhiZ.cxx AliLegoGeneratorEta.cxx \ AliRndm.cxx \ AliKalmanTrack.cxx AliCluster.cxx AliTracker.cxx\ - AliMCQA.cxx AliPDG.cxx AliDebugVolume.cxx + AliMCQA.cxx AliPDG.cxx AliDebugVolume.cxx \ + AliGenEventHeader.cxx AliStack.cxx AliConfig.cxx # C++ Headers @@ -67,7 +68,7 @@ $(DICT): $(HDRS) depend: $(SRCS) -HEADERS = $(SRCS:.cxx=.h) AliPDG.h AliConst.h AliCallf77.h AliMCProcess.h +HEADERS = $(SRCS:.cxx=.h) AliPDG.h AliConst.h AliCallf77.h AliMCProcess.h AliConfig.h AliGenEventHeader.h TOCLEAN = $(OBJS) *Cint.cxx *Cint.h diff --git a/STEER/STEERLinkDef.h b/STEER/STEERLinkDef.h index e0ddf24caec..e28e3b3a69a 100644 --- a/STEER/STEERLinkDef.h +++ b/STEER/STEERLinkDef.h @@ -45,6 +45,9 @@ #pragma link C++ class AliMCQA+; #pragma link C++ class AliPDG+; #pragma link C++ class AliDebugVolume+; +#pragma link C++ class AliStack+; +#pragma link C++ class AliConfig+; +#pragma link C++ class AliGenEventHeader+; #endif diff --git a/STRUCT/AliABSOv0.cxx b/STRUCT/AliABSOv0.cxx index 0f30c55ea4a..39e90313e16 100644 --- a/STRUCT/AliABSOv0.cxx +++ b/STRUCT/AliABSOv0.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.8 2001/01/12 13:16:09 morsch +Store absorber composition information in fMLayers and fZLayers +Rear 25 cm Fe + 35 cm Cu + Revision 1.7 2000/10/02 21:28:15 fca Removal of useless dependecies via forward declarations @@ -461,14 +465,16 @@ void AliABSOv0::Init() // Initialisation of the muon absorber after it has been built Int_t i; // - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" ABSOv0_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - // - for(i=0;i<80;i++) printf("*"); - printf("\n"); + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" ABSOv0_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + // + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } } diff --git a/STRUCT/AliDIPO.cxx b/STRUCT/AliDIPO.cxx index 46cabf1c5ea..a509be2ee98 100644 --- a/STRUCT/AliDIPO.cxx +++ b/STRUCT/AliDIPO.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.4 1999/09/29 09:24:30 fca +Introduction of the Copyright and cvs Log + */ /////////////////////////////////////////////////////////////////////////////// @@ -72,14 +75,16 @@ void AliDIPO::Init() // Int_t i; // - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" DIPO_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - // - // Here the ABSO initialisation code (if any!) - for(i=0;i<80;i++) printf("*"); - printf("\n"); + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" DIPO_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + // + // Here the ABSO initialisation code (if any!) + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } } diff --git a/STRUCT/AliFRAMEv1.cxx b/STRUCT/AliFRAMEv1.cxx index 1b4b68aa93c..61cb2f19c95 100644 --- a/STRUCT/AliFRAMEv1.cxx +++ b/STRUCT/AliFRAMEv1.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.10 2000/10/02 21:28:15 fca +Removal of useless dependecies via forward declarations + Revision 1.9 2000/06/11 12:35:02 morsch Coding rule violations corrected @@ -52,7 +55,7 @@ AliFRAMEv1::AliFRAMEv1(const char *name, const char *title) : AliFRAME(name,title) { // Constructor - printf("Create FRAMEv1 object\n"); + if(fDebug>1) printf("%s: Create FRAMEv1 object\n",ClassName()); fEuclidGeometry="$(ALICE_ROOT)/Euclid/frame1099i.euc"; fEuclidMaterial="$(ALICE_ROOT)/Euclid/frame.tme"; } @@ -84,13 +87,11 @@ void AliFRAMEv1::CreateGeometry() delete [] filetmp; if(file) { fclose(file); - printf(" Reading FRAME geometry\n"); + if(fDebug) printf("%s: Reading FRAME geometry\n",ClassName()); ReadEuclid(fEuclidGeometry.Data(),topvol); - } else { - Warning("CreateGeometry","The Euclid file %s does not exist!\n", - fEuclidGeometry.Data()); - exit(1); - } + } else + Fatal("CreateGeometry","The Euclid file %s does not exist!\n", + fEuclidGeometry.Data()); // // --- Place the FRAME ghost volume (B010) in its mother volume (ALIC) // and make it invisible @@ -108,7 +109,7 @@ void AliFRAMEv1::CreateMaterials() { // Create materials and media (from Euclid file) char *filetmp; - printf("Create FRAMEv1 materials\n"); + if(fDebug) printf("%s: Create FRAMEv1 materials\n",ClassName()); filetmp = gSystem->ExpandPathName(fEuclidMaterial.Data()); FILE *file = fopen(filetmp,"r"); delete [] filetmp; @@ -129,12 +130,13 @@ void AliFRAMEv1::Init() // Initialise the module after the geometry has been defined // - printf("**************************************" - " FRAME " - "**************************************\n"); - printf("\n Version 1 of FRAME initialised, symmetric FRAME\n\n"); - printf("**************************************" - " FRAME " - "**************************************\n"); - + if(fDebug) { + printf("%s: **************************************" + " FRAME " + "**************************************\n",ClassName()); + printf("\n%s: Version 1 of FRAME initialised, symmetric FRAME\n\n",ClassName()); + printf("%s: **************************************" + " FRAME " + "**************************************\n",ClassName()); + } } diff --git a/STRUCT/AliHALL.cxx b/STRUCT/AliHALL.cxx index 01de526a888..5c8dc9cd1b3 100644 --- a/STRUCT/AliHALL.cxx +++ b/STRUCT/AliHALL.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.10 2000/10/02 21:28:15 fca +Removal of useless dependecies via forward declarations + Revision 1.9 2000/06/13 14:55:26 morsch Unused variables removed @@ -358,15 +361,17 @@ void AliHALL::Init() // Int_t i; // - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" HALL_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - // - // Here the HALL initialisation code (if any!) - for(i=0;i<80;i++) printf("*"); - printf("\n"); + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" HALL_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + // + // Here the HALL initialisation code (if any!) + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } } //_____________________________________________________________________________ diff --git a/STRUCT/AliMAG.cxx b/STRUCT/AliMAG.cxx index 596528c4509..c888431ee6b 100644 --- a/STRUCT/AliMAG.cxx +++ b/STRUCT/AliMAG.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.8 2000/10/02 21:28:15 fca +Removal of useless dependecies via forward declarations + Revision 1.7 2000/06/11 12:35:56 morsch Coding rule violations corrected @@ -270,14 +273,16 @@ void AliMAG::Init() // Initialise L3 magnet after it has been built Int_t i; // - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" MAG_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - // - // Here the MAG initialisation code (if any!) - for(i=0;i<80;i++) printf("*"); - printf("\n"); + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" MAG_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + // + // Here the MAG initialisation code (if any!) + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } } diff --git a/STRUCT/AliPIPEv0.cxx b/STRUCT/AliPIPEv0.cxx index f38f2811eda..c2f190eefad 100644 --- a/STRUCT/AliPIPEv0.cxx +++ b/STRUCT/AliPIPEv0.cxx @@ -15,6 +15,10 @@ /* $Log$ +Revision 1.15 2001/05/02 11:50:18 morsch +New layout of the non-absorber side provided by Y. Viyogi. Not the final design +but the prsent most realistic. + Revision 1.14 2001/01/20 16:56:33 morsch Put air in connecting tubes and flanges of vacuum pump. @@ -93,7 +97,7 @@ void AliPIPEv0::CreateGeometry() */ //End_Html - printf("Create PIPEvTemp geometry \n"); + if(fDebug) printf("%s: Create PIPEv0 geometry \n",ClassName()); Int_t *idtmed = fIdtmed->GetArray(); @@ -767,7 +771,7 @@ void AliPIPEv0::CreateMaterials() // Define materials for beam pipe // - printf("Create PIPEvTemp materials \n"); + if(fDebug) printf("%s: Create PIPEv0 materials \n",ClassName()); Int_t isxfld = gAlice->Field()->Integ(); Float_t sxmgmx = gAlice->Field()->Max(); // Steel (Inox) diff --git a/STRUCT/AliPIPEvTemp.cxx b/STRUCT/AliPIPEvTemp.cxx new file mode 100644 index 00000000000..4ff3aaaf9a4 --- /dev/null +++ b/STRUCT/AliPIPEvTemp.cxx @@ -0,0 +1,889 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/* +$Log$ +Revision 1.2 2001/05/02 12:01:33 morsch +Obsolete version removed. + +Revision 1.1 2001/03/28 08:43:19 morsch +Temporary solution for beam-pipe until ITS geometry will have been updated. + +*/ + +//////////////////////////////////////////////// +// Beam pipe class / +//////////////////////////////////////////////// + +#include "AliPIPEvTemp.h" +#include "AliRun.h" +#include "AliConst.h" +#include "AliMagF.h" +#include "AliMC.h" +#include "TSystem.h" + +ClassImp(AliPIPEvTemp) + +//_____________________________________________________________________________ +AliPIPEvTemp::AliPIPEvTemp() +{ +// Constructor +} + +//_____________________________________________________________________________ +AliPIPEvTemp::AliPIPEvTemp(const char *name, const char *title) + : AliPIPE(name,title) +{ +// Constructor +} + + +//___________________________________________ +void AliPIPEvTemp::CreateGeometry() +{ +//Begin_Html +/* + +*/ +//End_Html + + +//Begin_Html +/* + +*/ +//End_Html + + if(fDebug) printf("%s: Create PIPEvTemp geometry \n",ClassName()); + + + Int_t *idtmed = fIdtmed->GetArray(); + Float_t ppcon[36], ptube[3], pbox[3]; + Int_t i=0; + + enum {kC=6, kAlu=9, kInox=19, kGetter=20, kBe=5, kVac=16, kAir=15, kAlBe=21}; + + Int_t idrotm[2099]; + AliMatrix(idrotm[2001],90.,240., 0., 0., 90.,150.); + AliMatrix(idrotm[2002],90., 0., 0., 0., 90.,270.); + AliMatrix(idrotm[2003],90.,120., 0., 0., 90., 30.); + AliMatrix(idrotm[2004],90.,315., 90., 45., 0., 0.); + AliMatrix(idrotm[2005],90.,270., 90., 0., 0., 0.); + AliMatrix(idrotm[2006],90.,225., 90.,315., 0., 0.); + AliMatrix(idrotm[2007],90.,180., 90.,270., 0., 0.); + AliMatrix(idrotm[2008],90.,135., 90.,225., 0., 0.); + AliMatrix(idrotm[2009],90., 90., 90.,180., 0., 0.); + AliMatrix(idrotm[2010],90., 45., 90.,135., 0., 0.); + idrotm[2011] = 0; + AliMatrix(idrotm[2012],90.,180., 90., 90.,180., 0.); + AliMatrix(idrotm[2013],90., 0., 90., 90.,180., 0.); + + + +// +// The peam pipe up to the Front Absorber +// +// Mother Volume QBPM + const Float_t dbe1 = 15.; + const Float_t dbe2 = 15.; + ppcon[0] = 0; + ppcon[1] = 360; + ppcon[2] = 11; +// 1: + ppcon[3] = - 90; + ppcon[4] = 0; + ppcon[5] = 5.8; +// 2 + ppcon[6] = - 81.0; + ppcon[7] = 0.; + ppcon[8] = 5.8; +// 3 + ppcon[9] = - 81.; + ppcon[10] = 0.; + ppcon[11] = 4.22; +// 4 + ppcon[12] = - 28.00-dbe2; + ppcon[13] = 0; + ppcon[14] = 4.22; +// 5 + ppcon[15] = - 28.00-dbe2; + ppcon[16] = 0; + ppcon[17] = 3.2; +// 6 + ppcon[18] = 0; + ppcon[19] = 0; + ppcon[20] = 3.2; +// 7 + ppcon[21] = 28.+dbe1; + ppcon[22] = 0; + ppcon[23] = 3.2; +// 8 + ppcon[24] = 28.+dbe1; + ppcon[25] = 0; + ppcon[26] = 4.22; +// 9 + ppcon[27] = 250; + ppcon[28] = 0; + ppcon[29] = 4.22; +// 10 + ppcon[30] = 250; + ppcon[31] = 0; + ppcon[32] = 5; +// 11 + ppcon[33] = 800; + ppcon[34] = 0; + ppcon[35] = 5; + + gMC->Gsvolu("QBPM", "PCON", idtmed[kAir], ppcon, 36); + +// +// The Vacuum + ptube[0] = 0.0; + ptube[1] = 2.9; + ptube[2] = 445.0; + + gMC->Gsvolu("QBVA","TUBE", idtmed[kVac], ptube, 3); + gMC->Gspos("QBVA", 1, "QBPM", 0., 0., 355., 0, "ONLY"); +// +// Be Pipe in central Alice + ptube[0] = 2.90; + ptube[1] = 3.00; + ptube[2] = 28.25+(dbe1+dbe2)/2.; + + gMC->Gsvolu("QBBE","TUBE", idtmed[kBe], ptube, 3); + gMC->Gspos("QBBE", 1, "QBPM", 0., 0., (dbe1-dbe2)/2., 0, "ONLY"); + +// +// Metal-Metal Transitions +// +// Be-Inox +// Mother Volume + ptube[0] = 2.900; + ptube[1] = 4.200; + ptube[2] = 2.750; + gMC->Gsvolu("QBT1","TUBE", idtmed[kAir], ptube, 3); + gMC->Gspos("QBT1", 1, "QBPM", 0., 0., 28.25+dbe1+ptube[2], 0, "ONLY"); + + ptube[0] = 2.900; + ptube[1] = 3.150; + ptube[2] = 0.375; + // + // Be-part + gMC->Gsvolu("QB01","TUBE", idtmed[kInox], ptube, 3); + + ptube[1] = 3.000; + gMC->Gsvolu("QBA1","TUBE", idtmed[kBe], ptube, 3); + + gMC->Gspos("QBA1", 1, "QB01", 0., 0., 0, 0, "ONLY"); + gMC->Gspos("QB01", 1, "QBT1", 0., 0.,-2.75+ptube[2], 0, "ONLY"); + + // Inox-part + // + ptube[0] = 2.900; + ptube[1] = 3.150; + ptube[2] = 2.375; + + gMC->Gsvolu("QB03","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB03", 1, "QBT1", 0., 0.,-2.+ptube[2], 0, "ONLY"); + + + ptube[0] = 3.15; + ptube[1] = 3.50; + ptube[2] = 0.10; + + gMC->Gsvolu("QB05","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB05", 1, "QBT1", 0., 0., 2.55+ptube[2], 0, "ONLY"); + + + // Fixations + ptube[0] = 0.0; + ptube[1] = 0.1; + ptube[2] = 0.5; + + gMC->Gsvolu("QB08","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB08", 1 ,"QBT1", 0.000, 3.650, -1.25, idrotm[2002], "ONLY"); + gMC->Gspos("QB08", 2 ,"QBT1", 3.161, -1.825, -1.25, idrotm[2001], "ONLY"); + gMC->Gspos("QB08", 3 ,"QBT1", -3.161, -1.825, -1.25, idrotm[2003], "ONLY"); + + // Carbon ring + ptube[0] = 3.15; + ptube[1] = 4.10; + ptube[2] = 0.55; + + gMC->Gsvolu("QB07","TUBE", idtmed[kC], ptube, 3); + + ptube[0] = 3.15; + ptube[1] = 3.50; + ptube[2] = 0.10; + gMC->Gsvolu("QBA7","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QBA7", 1, "QB07", 0.0, 0.0, 0.55-0.2, 0, "ONLY"); + gMC->Gspos("QB07", 1, "QBT1", 0.0, 0.0, 2., 0, "ONLY"); + +// +// Be-Alu +// Mother Volume + ptube[0] = 2.900; + ptube[1] = 4.200; + ptube[2] = 2.750; + gMC->Gsvolu("QBT2","TUBE", idtmed[kAir], ptube, 3); + gMC->Gspos("QBT2", 1, "QBPM", 0., 0., -28.25-dbe2-ptube[2], idrotm[2012], "ONLY"); + + ptube[0] = 2.900; + ptube[1] = 3.150; + ptube[2] = 0.375; + // + // Be-part + gMC->Gsvolu("QB02","TUBE", idtmed[kAlu], ptube, 3); + + ptube[1] = 3.000; + gMC->Gsvolu("QBA2","TUBE", idtmed[kBe], ptube, 3); + + gMC->Gspos("QBA2", 1, "QB01", 0., 0., 0, 0, "ONLY"); + gMC->Gspos("QB02", 1, "QBT2", 0., 0.,-2.75+ptube[2], 0, "ONLY"); + + // Alu part + ptube[0] = 2.900; + ptube[1] = 3.150; + ptube[2] = 2.375; + + gMC->Gsvolu("QB04","TUBE", idtmed[kAlu], ptube, 3); + gMC->Gspos("QB04", 1, "QBT2", 0., 0.,-2.+ptube[2], 0, "ONLY"); + + + ptube[0] = 3.15; + ptube[1] = 3.50; + ptube[2] = 0.10; + + gMC->Gsvolu("QB06","TUBE", idtmed[kAlu], ptube, 3); + gMC->Gspos("QB06", 1, "QBT2", 0., 0., 2.55+ptube[2], 0, "ONLY"); + + + // Fixation + ptube[0] = 0.0; + ptube[1] = 0.1; + ptube[2] = 0.5; + + gMC->Gsvolu("QBA8","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QBA8", 1 ,"QBT2", 0.000, 3.650, -1.25, idrotm[2002], "ONLY"); + gMC->Gspos("QBA8", 2 ,"QBT2", 3.161, -1.825, -1.25, idrotm[2001], "ONLY"); + gMC->Gspos("QBA8", 3 ,"QBT2", -3.161, -1.825, -1.25, idrotm[2003], "ONLY"); + + // Carbon ring + ptube[0] = 3.15; + ptube[1] = 4.10; + ptube[2] = 0.55; + + gMC->Gsvolu("QB77","TUBE", idtmed[kC], ptube, 3); + + ptube[0] = 3.15; + ptube[1] = 3.50; + ptube[2] = 0.10; + gMC->Gsvolu("QBB7","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QBB7", 1, "QB77", 0.0, 0.0, 0.55-0.2, 0, "ONLY"); + gMC->Gspos("QB77", 1, "QBT2", 0.0, 0.0, 2., 0, "ONLY"); + + + +// +// 1st section Alu non-absorber side + ptube[0] = 2.9; + ptube[1] = 3.0; + ptube[2] = 85.175-dbe1/2.; + + gMC->Gsvolu("QB10","TUBE", idtmed[kAlu], ptube, 3); + gMC->Gspos("QB10", 1, "QBPM", 0.0, 0.0, 118.925+dbe1/2., 0, "ONLY"); +// +// Support rollers: non absorber side +// +// Mother volume + ptube[0] = 3.2; + ptube[1] = 4.8; + ptube[2] = 3.0; + gMC->Gsvolu("QBRM","TUBE", idtmed[kAir], ptube, 3); + gMC->Gspos("QBRM", 1, "QBPM", 0., 0., 654.8, 0, "ONLY"); + gMC->Gspos("QBRM", 2, "QBPM", 0., 0., 254.8, 0, "ONLY"); + + ptube[0] = 0.0; + ptube[1] = 0.7; + ptube[2] = 3.0; + + gMC->Gsvolu("QB30","TUBE", idtmed[kInox], ptube, 3); + + for (i=0; i<8; i++) { + Float_t phi = 45.+i*45.*kDegrad; + Float_t xpos = 4.*TMath::Sin(phi); + Float_t ypos = 4.*TMath::Cos(phi); + gMC->Gspos("QB30", i+1, "QBRM", xpos, ypos, 0, idrotm[2004+i], "ONLY"); + } + +// +// Flanges: non absorber side + ptube[0] = 3.0; + ptube[1] = 4.9; + ptube[2] = 2.2; + + gMC->Gsvolu("QB29","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB29", 2, "QBPM", 0.0, 0.0, 654.8, 0, "ONLY"); + gMC->Gspos("QB29", 1, "QBPM", 0.0, 0.0, 254.8, 0, "ONLY"); +// +// Inox beam pipe: non absorber side + + ptube[0] = 2.90; + ptube[1] = 2.98; +// ptube[2] = 275.05; // without undulated beampipe + ptube[2] = 42.55; + + gMC->Gsvolu("QB28","TUBE", idtmed[kInox], ptube, 3); +// gMC->Gspos("QB28", 1, "QBPM", 0.0, 0.0, 524.95, 0, "ONLY"); // without undulated beam pipe + gMC->Gspos("QB28", 1, "QBPM", 0.0, 0.0, 249.9+ptube[2], 0, "ONLY"); + +// +// Undulated beam pipe +// +/* + Float_t pitch=0.25; + Float_t thick=0.015; + Float_t zundul=171; + Float_t rundul=3.0; + char cn48[][5]={"QN21","QN22","QN23","QN24","QN25","QN26","QN27","QN28"}; + + Undulation("QUND",pitch,thick,zundul,rundul,cn48); + gMC->Gspos("QUND", 1, "QBPM", 0., 0., 335.+zundul, 0, "ONLY"); +*/ + +// Al-Be (40-60 wgt%, rho=2.7 g/cm**3) beam pipe +// + ptube[0] = 2.90; + ptube[1] = 3.05; + ptube[2] = 171.0; + + gMC->Gsvolu("QBAB","TUBE", idtmed[kAlBe], ptube, 3); + gMC->Gspos("QBAB", 1, "QBPM", 0.0, 0.0, 335.+ptube[2], 0, "ONLY"); + + +// +// missing pieces of inox pipe +// + ptube[0] = 2.90; + ptube[1] = 2.98; + ptube[2] = 61.55; + + gMC->Gsvolu("QB48","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB48", 1, "QBPM", 0.0, 0.0, 800.-ptube[2], 0, "ONLY"); +/* + ptube[0] = 2.90; + ptube[1] = 2.98; + ptube[2] = 1.0; + + gMC->Gsvolu("QB27","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB27", 1, "QBPM", 0.0, 0.0, 208.1, 0, "ONLY"); +*/ +// +// + ptube[0] = 3.0; + ptube[1] = 3.15; + ptube[2] = 2.75; + + gMC->Gsvolu("QB25","TUBE", idtmed[kAlu], ptube, 3); + gMC->Gspos("QB25", 1, "QBPM", 0.0, 0.0, 201.35, 0, "ONLY"); + + +// distance between bellows +// const Float_t dzbb = 18.; + const Float_t dzbb = 8.; +// size of bellow + const Float_t dzb = 11.4; +// + ptube[0] = 2.90; + ptube[1] = 3.15; + ptube[2] = 2.5 +(18.-dzbb)/2.; + Float_t dz = 249.9-(2.*dzb+dzbb)-ptube[2]; + + gMC->Gsvolu("QB26","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB26", 1, "QBPM", 0.0, 0.0, dz, 0, "ONLY"); + +// +// Bellows +// +// Mother Volume + ptube[0] = 2.90; + ptube[1] = 3.75; + ptube[2] = (2.*dzb+dzbb)/2.; + gMC->Gsvolu("QBE0","TUBE", idtmed[kAir], ptube, 3); + dz = (249.9-ptube[2]); + gMC->Gspos("QBE0", 2 ,"QBPM", 0.0, 0.0, dz, 0, "ONLY"); + dz = (81.7-ptube[2]); + + gMC->Gspos("QBE0", 1 ,"QBPM", 0.0, 0.0, -dz, 0, "ONLY"); + + ptube[2] = dzb/2.; + + gMC->Gsvolu("QBEM","TUBE", idtmed[kAir], ptube, 3); + dz = (dzb+dzbb)/2.; + gMC->Gspos("QBEM", 2 ,"QBE0", 0.0, 0.0, -dz, 0 , "ONLY"); + gMC->Gspos("QBEM", 1 ,"QBE0", 0.0, 0.0, dz, idrotm[2012], "ONLY"); + + ptube[0] = 2.90; + ptube[1] = 3.25; + ptube[2] = 3.70; + + gMC->Gsvolu("QB19","TUBE", idtmed[kVac], ptube, 3); + gMC->Gspos("QB19", 1 ,"QBEM", 0.0, 0.0, 0.5, 0 , "ONLY"); + + ptube[0] = 3.25; + ptube[1] = 3.74; + ptube[2] = 0.095; + + gMC->Gsvolu("QB18","TUBE", idtmed[kVac], ptube, 3); + for (i=0; i<15; i++) { + gMC->Gspos("QB18", i+1, "QBEM", 0.0, 0.0, 3.3-i*0.4, 0, "ONLY"); + } + + ptube[0] = 2.90; + ptube[1] = 3.00; + ptube[2] = 1.20; + + gMC->Gsvolu("QB21","TUBE", idtmed[kVac], ptube, 3); + gMC->Gspos("QB21", 1 ,"QBEM", 0.0, 0.0, -4.5, 0 , "ONLY"); + + ptube[0] = 3.250; + ptube[1] = 3.750; + ptube[2] = 0.005; + + gMC->Gsvolu("QB15","TUBE", idtmed[kInox], ptube, 3); + for (i=0; i<30; i++) { + gMC->Gspos("QB15", i+1, "QBEM", 0.0, 0.0, 3.4-i*0.2, 0, "ONLY"); + } + + ptube[0] = 3.740; + ptube[1] = 3.750; + ptube[2] = 0.095; + + gMC->Gsvolu("QB16","TUBE", idtmed[kInox], ptube, 3); + for (i=0; i<15; i++) { + gMC->Gspos("QB16", i+1, "QBEM", 0.0, 0.0, 3.3-i*0.4, 0, "ONLY"); + } + + ptube[0] = 3.250; + ptube[1] = 3.260; + ptube[2] = 0.095; + + gMC->Gsvolu("QB17","TUBE", idtmed[kInox], ptube, 3); + for (i=0; i<14; i++) { + gMC->Gspos("QB17", i+1, "QBEM", 0.0, 0.0, 3.1-i*0.4, 0, "ONLY"); + } + + ptube[0] = 3.250; + ptube[1] = 3.260; + ptube[2] = 0.3975; + + gMC->Gsvolu("QB14","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB14", 2 ,"QBEM", 0.0, 0.0, -2.8025, 0 , "ONLY"); + gMC->Gspos("QB14", 1 ,"QBEM", 0.0, 0.0, 3.8025, 0 , "ONLY"); + + ptube[0] = 2.900; + ptube[1] = 3.260; + ptube[2] = 0.050; + + gMC->Gsvolu("QB13","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB13", 2 ,"QBEM", 0.0, 0.0, -3.25, 0 , "ONLY"); + gMC->Gspos("QB13", 1 ,"QBEM", 0.0, 0.0, 4.25, 0 , "ONLY"); + + ptube[0] = 2.900; + ptube[1] = 3.000; + ptube[2] = 0.700; + + gMC->Gsvolu("QB12","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB12", 1 ,"QBEM", 0.0, 0.0, 5.0, 0, "ONLY"); + + +// +// pipe between Bellows + ptube[0] = 2.9; + ptube[1] = 3.0; + ptube[2] = dzbb/2.; + gMC->Gsvolu("QB23","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB23", 1 ,"QBE0", 0.0, 0.0, 0.0, 0, "ONLY"); + +// +// End Bellow + +// Absorber side +// +// beam pipe between metal-metal transition and bellows + ptube[0] = 2.9; + ptube[1] = 3.0; +// ptube[2] = 3.575; + ptube[2] = (81.7-(2.*dzb+dzbb)-(28.25+dbe2+5.5))/2.; + + gMC->Gsvolu("QB24","TUBE", idtmed[kInox], ptube, 3); + dz = (28.25+dbe2+5.5)+ptube[2]; + gMC->Gspos("QB24", 1 ,"QBPM", 0.0, 0.0, -dz, 0, "ONLY"); +// +// beam pipe between flange and bellows + ptube[0] = 2.90; + ptube[1] = 3.00; + ptube[2] = 0.45; + + gMC->Gsvolu("QB22","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB22", 1 ,"QBPM", 0.0, 0.0, -82.15, 0, "ONLY"); + +// +// Flange +// +// Mother Volume + ptube[0] = 2.900; + ptube[1] = 4.300; + ptube[2] = 1.400; + + gMC->Gsvolu("QFA0","TUBE", idtmed[kAlu], ptube, 3); + gMC->Gspos("QFA0", 1 ,"QBPM", 0.0, 0.0, -84.0, 0, "ONLY"); +// +// inner Inox piece + ptube[0] = 2.900; + ptube[1] = 3.500; + ptube[2] = 0.450; + gMC->Gsvolu("QFA1","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QFA1", 1 ,"QFA0", 0.0, 0.0, 0.225, 0, "ONLY"); +// +// 8 x M5 Inox + ptube[0] = 0.000; + ptube[1] = 0.250; + ptube[2] = 1.400; + gMC->Gsvolu("QFA2","TUBE", idtmed[kInox], ptube, 3); + for (i=0; i<8; i++) { + Float_t phi = i*45.*kDegrad; + Float_t xpos = 3.9*TMath::Sin(phi); + Float_t ypos = 3.9*TMath::Cos(phi); + gMC->Gspos("QFA2", i+1, "QFA0", xpos, ypos, 0., 0, "ONLY"); + } + + + ptube[0] = 2.900; + ptube[1] = 3.000; + ptube[2] = 2.300; + + gMC->Gsvolu("QB32","TUBE", idtmed[kInox], ptube, 3); + gMC->Gspos("QB32", 1 ,"QBPM", 0.0, 0.0, -90.+2.3, 0, "ONLY"); + +// +// The Ion Pump +// --- Place the PIPE ghost volume (QBPM) in its mother volume (ALIC) +// and make it invisible +// + + + gMC->Gspos("QBPM",1,"ALIC",0,0,0,idrotm[2013], "ONLY"); + +// +// Ion Pump +// + ptube[0] = 5.; + ptube[1] = 55.; + ptube[2] = 20.; + gMC->Gsvolu("QIPM","TUBE", idtmed[kAir], ptube, 3); + // + // Getters -> + pbox[0] = 6.50; + pbox[1] = 6.75; + pbox[2] = 15.60; + gMC->Gsvolu("QI32","BOX", idtmed[kInox], pbox, 3); + + pbox[0] = 5.90; + pbox[1] = 6.15; + pbox[2] = 15.00; + gMC->Gsvolu("QI42","BOX", idtmed[kGetter], pbox, 3); + gMC->Gspos("QI42", 1, "QI32", 0.0, 0.0, 0.0, 0, "ONLY"); +// <- + + ptube[0] = 0.0; + ptube[1] = 19.0; + ptube[2] = 2.5; + gMC->Gsvolu("QI33","TUBE", idtmed[kInox], ptube, 3); + + + ptube[0] = 0.0; + ptube[1] = 15.0; + ptube[2] = 2.5; + gMC->Gsvolu("QI43","TUBE", idtmed[kAir], ptube, 3); + gMC->Gspos("QI43", 1, "QI33", 0.0, 0.0, 0.0, 0, "ONLY"); +// +// Connecting tube -> + ptube[0] = 0.0; + ptube[1] = 5.4; + ptube[2] = 13.7; + gMC->Gsvolu("QI34","TUBE", idtmed[kInox], ptube, 3); + + ptube[0] = 0.0; + ptube[1] = 4.8; + ptube[2] = 13.7; + gMC->Gsvolu("QI44","TUBE", idtmed[kAir], ptube, 3); + gMC->Gspos("QI44", 1, "QI34", 0.0, 0.0, 0.0, 0, "ONLY"); +// <- + + // + // Flange -> + ptube[0] = 0.00; + ptube[1] = 7.30; + ptube[2] = 2.15; + gMC->Gsvolu("QI35","TUBE", idtmed[kInox], ptube, 3); + + ptube[0] = 0.00; + ptube[1] = 4.80; + ptube[2] = 2.15; + gMC->Gsvolu("QI45","TUBE", idtmed[kAir], ptube, 3); + gMC->Gspos("QI45", 1, "QI35", 0.0, 0.0, 0.0, 0, "ONLY"); +// <- + + gMC->Gspos("QI32", 1, "QIPM", 0.0, -44.25, 0.0, 0, "ONLY"); + gMC->Gspos("QI33", 1, "QIPM", 0.0, -35.00, 0.0,idrotm[2002], "ONLY"); + gMC->Gspos("QI34", 1, "QIPM", 0.0, -18.80, 0.0,idrotm[2002], "ONLY"); + gMC->Gspos("QI35", 1, "QIPM", 0.0, -24.35, 0.0,idrotm[2002], "ONLY"); +// +// PLACE ION PUMP (QIPM) AT Z=-385. +// + gMC->Gspos("QIPM",1,"ALIC",0,0,-385,idrotm[2013], "ONLY"); + + + gMC->Gsatt("QIPM", "SEEN", 0); + gMC->Gsatt("QBPM", "SEEN", 0); + gMC->Gsatt("QBEM", "SEEN", 0); +} + + +//___________________________________________ +void AliPIPEvTemp::DrawModule() +{ +// Set drawing options + ; +} + +//___________________________________________ +void AliPIPEvTemp::CreateMaterials() +{ + // + // Define materials for beam pipe + // + + if(fDebug) printf("%s: Create PIPEvTemp materials \n",ClassName()); + Int_t isxfld = gAlice->Field()->Integ(); + Float_t sxmgmx = gAlice->Field()->Max(); + // Steel (Inox) + Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 }; + Float_t zsteel[4] = { 26.,24.,28.,14. }; + Float_t wsteel[4] = { .715,.18,.1,.005 }; + // AlBe - alloy + Float_t aAlBe[2] = { 26.98, 9.01}; + Float_t zAlBe[2] = { 13.00, 4.00}; + Float_t wAlBe[2] = { 0.4, 0.6}; + + // + // Berillium + AliMaterial(5, "BERILLIUM$", 9.01, 4., 1.848, 35.3, 36.7); + // + // Carbon + AliMaterial(6, "CARBON$ ", 12.01, 6., 2.265, 18.8, 49.9); + // + // Aluminum + AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2); + // + // Air + AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.); + // + // Vacuum + AliMaterial(16, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16); + // + // stainless Steel + AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel); + // + // reduced density steel to approximate pump getter material + AliMixture(20, "GETTER$", asteel, zsteel, 1.00, 4, wsteel); + // Al-Be alloy + // + AliMixture(21, "AlBe$", aAlBe, zAlBe, 2.07, 2, wAlBe); + // + // **************** + // Defines tracking media parameters. + // + Float_t epsil = .001; // Tracking precision, + Float_t stemax = -0.01; // Maximum displacement for multiple scat + Float_t tmaxfd = -20.; // Maximum angle due to field deflection + Float_t deemax = -.3; // Maximum fractional energy loss, DLS + Float_t stmin = -.8; + // *************** + // + // Beryllium + + AliMedium(5, "BE", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + + // Carbon + AliMedium(6, "C", 6, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + // + // Aluminum + AliMedium(9, "ALU", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + // + // Air + AliMedium(15, "AIR", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + // + // Vacuum + AliMedium(16, "VACUUM", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + // + // Steel + AliMedium(19, "INOX", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + // + // Getter + AliMedium(20, "GETTER", 20, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + // + // AlBe - Aloy + AliMedium(21, "AlBe" , 21, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); + +} + + +void AliPIPEvTemp::Undulation(char *undul, Float_t pitch, Float_t thick, + Float_t zundul, Float_t rundul, char (*cone)[5]) +{ + // + // RUNDUL : Internal radius of the undulated chamber + // THICK : material thickness + // PITCH : one-QUARTER wave of undulation (cm) + // ZUNDUL : half length (cm) + // + // The undulated structure is desgned as a superposition of eight CONES + // of suitable sizes, where the inner/outer radius of the cone increases, + // then decreases, each half of the wave is assumed to be a semicircle, + // which allows to calculate the thickness and the radii of the cone, by + // dividing the semicircle into 4 parts of equal arc length. + // Thus apear the constants 0.293 and 0.707. + // + + const Float_t kConst1 = .293; + const Float_t kConst2 = .707; + + // Local variables + Int_t j, nwave; + Float_t dcone1[5], dcone2[5], dcone3[5], dcone4[5], dcone5[5], + dcone6[5], dcone7[5], dcone8[5]; + Float_t xc, yc, zc, dundul[3]; + Int_t *idtmed = fIdtmed->GetArray()-1999; + + // Function Body + + dcone1[0] = kConst1 * pitch / 2; + dcone1[1] = rundul; + dcone1[2] = dcone1[1] + thick; + dcone1[3] = dcone1[1] + kConst2 * pitch; + dcone1[4] = dcone1[3] + thick; + + dcone2[0] = kConst2 * pitch / 2; + dcone2[1] = dcone1[3]; + dcone2[2] = dcone1[4]; + dcone2[3] = dcone2[1] + kConst1 * pitch; + dcone2[4] = dcone2[3] + thick; + + dcone3[0] = dcone2[0]; + dcone3[1] = dcone2[3]; + dcone3[2] = dcone2[4]; + dcone3[3] = dcone2[1]; + dcone3[4] = dcone2[2]; + + dcone4[0] = dcone1[0]; + dcone4[1] = dcone1[3]; + dcone4[2] = dcone1[4]; + dcone4[3] = dcone1[1]; + dcone4[4] = dcone1[2]; + + dcone5[0] = dcone1[0]; + dcone5[1] = dcone1[1] - thick; + dcone5[2] = dcone1[1]; + dcone5[3] = dcone5[1] - kConst2 * pitch; + dcone5[4] = dcone5[3] + thick; + + dcone6[0] = dcone2[0]; + dcone6[1] = dcone5[3]; + dcone6[2] = dcone5[4]; + dcone6[3] = dcone6[1] - kConst1 * pitch; + dcone6[4] = dcone6[3] + thick; + dcone7[0] = dcone6[0]; + dcone7[1] = dcone6[3]; + dcone7[2] = dcone6[4]; + dcone7[3] = dcone5[3]; + dcone7[4] = dcone5[4]; + + dcone8[0] = dcone5[0]; + dcone8[1] = dcone7[3]; + dcone8[2] = dcone7[4]; + dcone8[3] = dcone5[1]; + dcone8[4] = dcone5[2]; + + gMC->Gsvolu(cone[0], "CONE", idtmed[2018], dcone1, 5); + gMC->Gsvolu(cone[1], "CONE", idtmed[2018], dcone2, 5); + gMC->Gsvolu(cone[2], "CONE", idtmed[2018], dcone3, 5); + gMC->Gsvolu(cone[3], "CONE", idtmed[2018], dcone4, 5); + gMC->Gsvolu(cone[4], "CONE", idtmed[2018], dcone5, 5); + gMC->Gsvolu(cone[5], "CONE", idtmed[2018], dcone6, 5); + gMC->Gsvolu(cone[6], "CONE", idtmed[2018], dcone7, 5); + gMC->Gsvolu(cone[7], "CONE", idtmed[2018], dcone8, 5); + gMC->Gsatt(cone[0], "SEEN", 0); + gMC->Gsatt(cone[1], "SEEN", 0); + gMC->Gsatt(cone[2], "SEEN", 0); + gMC->Gsatt(cone[3], "SEEN", 0); + gMC->Gsatt(cone[4], "SEEN", 0); + gMC->Gsatt(cone[5], "SEEN", 0); + gMC->Gsatt(cone[6], "SEEN", 0); + gMC->Gsatt(cone[7], "SEEN", 0); + + // DEFINE AN IMAGINARY TUBE VOLUME FOR UNDULATED CHAMBER, FILL WITH VACUUM + + nwave = Int_t (zundul / (pitch * 2) + .1); + dundul[2] = pitch * 2 * nwave; + dundul[1] = rundul + pitch + thick * 2; + // + dundul[0] = 2.9; + gMC->Gsvolu(undul, "TUBE", idtmed[2015], dundul, 3); + + xc = 0; + yc = 0; + zc = -dundul[2] + dcone1[0]; + for (j = 1; j <= nwave; ++j) { + gMC->Gspos(cone[0], j, undul, xc, yc, zc, 0, "ONLY"); + zc = zc + dcone1[0] + dcone2[0]; + gMC->Gspos(cone[1], j, undul, xc, yc, zc, 0, "ONLY"); + zc = zc + dcone2[0] + dcone3[0]; + gMC->Gspos(cone[2], j, undul, xc, yc, zc, 0, "ONLY"); + zc = zc + dcone3[0] + dcone4[0]; + gMC->Gspos(cone[3], j, undul, xc, yc, zc, 0, "ONLY"); + zc = zc + dcone4[0] + dcone5[0]; + gMC->Gspos(cone[4], j, undul, xc, yc, zc, 0, "ONLY"); + zc = zc + dcone5[0] + dcone6[0]; + gMC->Gspos(cone[5], j, undul, xc, yc, zc, 0, "ONLY"); + zc = zc + dcone6[0] + dcone7[0]; + gMC->Gspos(cone[6], j, undul, xc, yc, zc, 0, "ONLY"); + zc = zc + dcone7[0] + dcone8[0]; + gMC->Gspos(cone[7], j, undul, xc, yc, zc, 0, "ONLY"); + zc = zc + dcone8[0] + dcone1[0]; + } +} + + + + + + + + + + + diff --git a/STRUCT/AliSHIL.cxx b/STRUCT/AliSHIL.cxx index 5dcec5265cd..013521b4c48 100644 --- a/STRUCT/AliSHIL.cxx +++ b/STRUCT/AliSHIL.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.10 2000/10/02 21:28:15 fca +Removal of useless dependecies via forward declarations + Revision 1.9 2000/06/11 12:38:40 morsch Coding rule violations corrected @@ -268,15 +271,17 @@ void AliSHIL::Init() // Int_t i; // - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" SHIL_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - // - // Here the SHIL initialisation code (if any!) - for(i=0;i<80;i++) printf("*"); - printf("\n"); + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" SHIL_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + // + // Here the SHIL initialisation code (if any!) + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } } diff --git a/TGeant3/AliGeant3.cxx b/TGeant3/AliGeant3.cxx index a9fb97214ab..5b1e3daa18c 100644 --- a/TGeant3/AliGeant3.cxx +++ b/TGeant3/AliGeant3.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.15 2001/03/20 06:28:49 alibrary +New detector loop split in 2 + Revision 1.14 2000/12/20 08:39:39 fca Support for Cerenkov and process list in Virtual MC @@ -65,6 +68,7 @@ ReadEuclid moved from AliRun to AliModule #include #include +#include #include "AliDecayer.h" #include "AliGeant3.h" @@ -79,10 +83,12 @@ ReadEuclid moved from AliRun to AliModule # define rxgtrak rxgtrak_ # define rxouth rxouth_ +# define rxinh rxinh_ #else # define rxgtrak RXGTRAK # define rxouth RXOUTH +# define rxinh RXINH #endif ClassImp(AliGeant3) @@ -107,22 +113,31 @@ void AliGeant3::Init() // //=================Create Materials and geometry // + TStopwatch stw; TObjArray *modules = gAlice->Modules(); TIter next(modules); AliModule *detector; + printf("Geometry creation:\n"); while((detector = (AliModule*)next())) { + stw.Start(); // Initialise detector materials and geometry detector->CreateMaterials(); detector->CreateGeometry(); + printf("%10s R:%.2fs C:%.2fs\n", + detector->GetName(),stw.RealTime(),stw.CpuTime()); } //Terminate building of geometry FinishGeometry(); + printf("Initialisation:\n"); next.Reset(); while((detector = (AliModule*)next())) { + stw.Start(); // Initialise detector and display geometry detector->Init(); detector->BuildGeometry(); + printf("%10s R:%.2fs C:%.2fs\n", + detector->GetName(),stw.RealTime(),stw.CpuTime()); } } @@ -225,6 +240,15 @@ extern "C" void type_of_call rxouth () gAlice->FinishPrimary(); } +//_____________________________________________________________________________ +extern "C" void type_of_call rxinh () +{ + // + // Called by Gtreve at the beginning of each primary track + // + gAlice->BeginPrimary(); +} + #ifndef WIN32 # define gudigi gudigi_ # define guhadr guhadr_ diff --git a/TGeant3/TGeant3.h b/TGeant3/TGeant3.h index ddc8c79cac2..fd466ffdb13 100644 --- a/TGeant3/TGeant3.h +++ b/TGeant3/TGeant3.h @@ -838,39 +838,38 @@ protected: Int_t fNextVol; // Iterator for GeomIter //--------------Declarations for ZEBRA--------------------- - Int_t *fZiq; // Good Old IQ of Zebra - Int_t *fZlq; // Good Old LQ of Zebra - Float_t *fZq; // Good Old Q of Zebra - - Quest_t *fQuest; // QUEST common structure - Gcbank_t *fGcbank; // GCBANK common structure - Gclink_t *fGclink; // GCLINK common structure - Gccuts_t *fGccuts; // GCCUTS common structure - Gcmulo_t *fGcmulo; // GCMULO common structure - Gcmate_t *fGcmate; // GCMATE common structure - Gctpol_t *fGctpol; // GCTPOL common structure - Gcnum_t *fGcnum; // GCNUM common structure - Gcsets_t *fGcsets; // GCSETS common structure - Gcopti_t *fGcopti; // GCOPTI common structure - Gctlit_t *fGctlit; // GCTLIT common structure - Gcvdma_t *fGcvdma; // GCVDMA common structure - Gcvolu_t *fGcvolu; // GCVOLU common structure - Gckine_t *fGckine; // GCKINE common structure - Gcflag_t *fGcflag; // GCFLAG common structure - Gctmed_t *fGctmed; // GCTMED common structure - Gcphys_t *fGcphys; // GCPHYS common structure - Gcphlt_t *fGcphlt; // GCPHLT common structure - Gcking_t *fGcking; // GCKING common structure - Gckin2_t *fGckin2; // GCKIN2 common structure - Gckin3_t *fGckin3; // GCKIN3 common structure - Gctrak_t *fGctrak; // GCTRAK common structure - + Int_t *fZiq; //! Good Old IQ of Zebra + Int_t *fZlq; //! Good Old LQ of Zebra + Float_t *fZq; //! Good Old Q of Zebra + + Quest_t *fQuest; //! QUEST common structure + Gcbank_t *fGcbank; //! GCBANK common structure + Gclink_t *fGclink; //! GCLINK common structure + Gccuts_t *fGccuts; //! GCCUTS common structure + Gcmulo_t *fGcmulo; //! GCMULO common structure + Gcmate_t *fGcmate; //! GCMATE common structure + Gctpol_t *fGctpol; //! GCTPOL common structure + Gcnum_t *fGcnum; //! GCNUM common structure + Gcsets_t *fGcsets; //! GCSETS common structure + Gcopti_t *fGcopti; //! GCOPTI common structure + Gctlit_t *fGctlit; //! GCTLIT common structure + Gcvdma_t *fGcvdma; //! GCVDMA common structure + Gcvolu_t *fGcvolu; //! GCVOLU common structure + Gckine_t *fGckine; //! GCKINE common structure + Gcflag_t *fGcflag; //! GCFLAG common structure + Gctmed_t *fGctmed; //! GCTMED common structure + Gcphys_t *fGcphys; //! GCPHYS common structure + Gcphlt_t *fGcphlt; //! GCPHLT common structure + Gcking_t *fGcking; //! GCKING common structure + Gckin2_t *fGckin2; //! GCKIN2 common structure + Gckin3_t *fGckin3; //! GCKIN3 common structure + Gctrak_t *fGctrak; //! GCTRAK common structure // commons for GEANE - Ertrio_t *fErtrio; // ERTRIO common structure - Eropts_t *fEropts; // EROPTS common structure - Eroptc_t *fEroptc; // EROPTC common structure - Erwork_t *fErwork; // ERWORK common structure + Ertrio_t *fErtrio; //! ERTRIO common structure + Eropts_t *fEropts; //! EROPTS common structure + Eroptc_t *fEroptc; //! EROPTC common structure + Erwork_t *fErwork; //! ERWORK common structure //Put here all volume names diff --git a/TOF/AliTOF.cxx b/TOF/AliTOF.cxx index deb4478db01..9d4225213e3 100644 --- a/TOF/AliTOF.cxx +++ b/TOF/AliTOF.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.20 2001/05/04 10:09:47 vicinanz +Major upgrades to the strip structure + Revision 1.19 2001/03/12 17:47:25 hristov Changes needed on Sun with CC 5.0 @@ -406,7 +409,7 @@ void AliTOF::Init() } //____________________________________________________________________________ -void AliTOF::MakeBranch(Option_t* option, char *file) +void AliTOF::MakeBranch(Option_t* option, const char *file) { // // Initializes the Branches of the TOF inside the @@ -425,7 +428,7 @@ void AliTOF::MakeBranch(Option_t* option, char *file) const char *D = strstr(option,"D"); if (fDigits && gAlice->TreeD() && D){ - gAlice->MakeBranchInTree(gAlice->TreeD(), + MakeBranchInTree(gAlice->TreeD(), branchname, &fDigits,buffersize, file) ; } } diff --git a/TOF/AliTOF.h b/TOF/AliTOF.h index 1b1d7bdf643..74df76bcc49 100644 --- a/TOF/AliTOF.h +++ b/TOF/AliTOF.h @@ -42,7 +42,7 @@ public: virtual void CreateGeometry(); virtual void CreateMaterials(); virtual void Init(); - virtual void MakeBranch(Option_t* option, char *file=0); + virtual void MakeBranch(Option_t*, const char *file=0); virtual void FinishEvent(); virtual Int_t IsVersion() const =0; Int_t DistancetoPrimitive(Int_t px, Int_t py); diff --git a/TOF/AliTOFv0.cxx b/TOF/AliTOFv0.cxx index 7a9bf8ee580..c3ae03d3aa9 100644 --- a/TOF/AliTOFv0.cxx +++ b/TOF/AliTOFv0.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.19 2001/05/04 10:09:48 vicinanz +Major upgrades to the strip structure + Revision 1.18 2000/12/04 08:48:20 alibrary Fixing problems in the HEAD @@ -317,7 +320,8 @@ void AliTOFv0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, par[0] = xFLT*0.5; par[1] = yFLT*0.5; - cout <<"************************* TOF geometry **************************"<Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon @@ -732,11 +736,13 @@ void AliTOFv0::Init() // // Initialise the detector after the geometry has been defined // - printf("**************************************" - " TOF " - "**************************************\n"); - printf("\n Version 0 of TOF initialing, " - "symmetric TOF\n"); + if(fDebug) { + printf("%s: **************************************" + " TOF " + "**************************************\n",ClassName()); + printf("\n%s: Version 0 of TOF initialing, " + "symmetric TOF\n",ClassName()); + } AliTOF::Init(); @@ -747,9 +753,11 @@ void AliTOFv0::Init() fIdFLTB = gMC->VolId("FLTB"); fIdFLTC = gMC->VolId("FLTC"); - printf("**************************************" - " TOF " - "**************************************\n"); + if(fDebug) { + printf("%s: **************************************" + " TOF " + "**************************************\n",ClassName()); + } } //_____________________________________________________________________________ diff --git a/TOF/AliTOFv1.cxx b/TOF/AliTOFv1.cxx index c3e7fce75b7..f4d20724fc4 100644 --- a/TOF/AliTOFv1.cxx +++ b/TOF/AliTOFv1.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.20 2001/05/04 10:09:48 vicinanz +Major upgrades to the strip structure + Revision 1.19 2000/12/04 08:48:20 alibrary Fixing problems in the HEAD @@ -328,9 +331,11 @@ void AliTOFv1::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, // Large not sensitive volumes with Insensitive Freon par[0] = xFLT*0.5; par[1] = yFLT*0.5; - - cout <<"************************* TOF geometry **************************"<Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY"); diff --git a/TOF/AliTOFv2.cxx b/TOF/AliTOFv2.cxx index ea91cd4594b..fc49b17aa88 100644 --- a/TOF/AliTOFv2.cxx +++ b/TOF/AliTOFv2.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.19 2001/05/04 10:09:48 vicinanz +Major upgrades to the strip structure + Revision 1.18 2000/12/04 08:48:20 alibrary Fixing problems in the HEAD @@ -324,7 +327,10 @@ void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, par[0] = xFLT*0.5; par[1] = yFLT*0.5; - cout <<"************************* TOF geometry **************************"<Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon @@ -479,8 +485,10 @@ void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.); gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); - printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); + printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); + } zcoor -= zSenStrip; j++; @@ -497,8 +505,10 @@ void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); - printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); + printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); + } j += 2; upDown*= -1; // Alternate strips @@ -527,8 +537,10 @@ void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); - printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); + printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); + } ycoor = -hTof/2.+ kspace;//2 cm over front plate @@ -553,8 +565,10 @@ void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); - printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); + printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); + } i++; upDown*=-1; @@ -572,8 +586,10 @@ void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); - printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); + printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); + } upDown*=-1; i++; @@ -591,8 +607,10 @@ void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, zcoor = zpos+(zFLTB/2+zFLTA/2+db); gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); zpos = zpos - zSenStrip/TMath::Cos(ang); - printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); + printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); + } i++; } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db); @@ -618,8 +636,10 @@ void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2); gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); - printf("%f, St. %2i, Pl.5 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i); + printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); + } zpos = zpos - zSenStrip/TMath::Cos(ang); } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t); @@ -766,11 +786,13 @@ void AliTOFv2::Init() // // Initialise the detector after the geometry has been defined // - printf("**************************************" - " TOF " - "**************************************\n"); - printf("\n Version 2 of TOF initialing, " - "TOF with holes for PHOS and RICH \n"); + if(fDebug) { + printf("%s: **************************************" + " TOF " + "**************************************\n",ClassName()); + printf("\n%s: Version 2 of TOF initialing, " + "TOF with holes for PHOS and RICH \n",ClassName()); + } AliTOF::Init(); @@ -781,9 +803,11 @@ void AliTOFv2::Init() fIdFLTB = gMC->VolId("FLTB"); fIdFLTC = gMC->VolId("FLTC"); - printf("**************************************" - " TOF " - "**************************************\n"); + if(fDebug) { + printf("%s: **************************************" + " TOF " + "**************************************\n",ClassName()); + } } //_____________________________________________________________________________ diff --git a/TOF/AliTOFv3.cxx b/TOF/AliTOFv3.cxx index 9622d3856fd..86a861fda14 100644 --- a/TOF/AliTOFv3.cxx +++ b/TOF/AliTOFv3.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.19 2001/05/04 10:09:48 vicinanz +Major upgrades to the strip structure + Revision 1.18 2000/12/04 08:48:20 alibrary Fixing problems in the HEAD @@ -324,8 +327,9 @@ void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, // Large not sensitive volumes with Insensitive Freon par[0] = xFLT*0.5; par[1] = yFLT*0.5; - - cout <<"************************* TOF geometry **************************"<Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon @@ -479,10 +483,10 @@ void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.); gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); - - printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + } zcoor -= zSenStrip; j++; Int_t upDown = -1; // upDown=-1 -> Upper strip @@ -497,10 +501,10 @@ void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ycoor += (1-(upDown+1)/2)*gap; gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); - - printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + if(fDebug) { + printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); + printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + } j += 2; upDown*= -1; // Alternate strips zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)- @@ -527,10 +531,10 @@ void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ycoor += (1-(upDown+1)/2)*gap; gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); - - printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + } ycoor = -hTof/2.+ kspace;//2 cm over front plate // Plate B @@ -553,10 +557,10 @@ void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ycoor += (1-(upDown+1)/2)*gap; zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); - - printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + } i++; upDown*=-1; @@ -572,10 +576,10 @@ void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ycoor += (1-(upDown+1)/2)*gap; zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); - - printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + if(fDebug) { + printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); + printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + } upDown*=-1; i++; } while (TMath::Abs(ang*kRaddeg)<22.5); @@ -592,8 +596,10 @@ void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, zcoor = zpos+(zFLTB/2+zFLTA/2+db); gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); zpos = zpos - zSenStrip/TMath::Cos(ang); - printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); + printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + } i++; } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db); @@ -618,10 +624,10 @@ void AliTOFv3::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ang /= kRaddeg; zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2); gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); - - printf("%f, St. %2i, Pl.5 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + if(fDebug) { + printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i); + printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + } zpos = zpos - zSenStrip/TMath::Cos(ang); } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t); @@ -767,11 +773,13 @@ void AliTOFv3::Init() // // Initialise the detector after the geometry has been defined // - printf("**************************************" - " TOF " - "**************************************\n"); - printf("\n Version 3 of TOF initialing, " - "TOF with holes for RICH detector\n"); + if(fDebug) { + printf("%s: **************************************" + " TOF " + "**************************************\n",ClassName()); + printf("\n%s Version 3 of TOF initialing, " + "TOF with holes for RICH detector\n",ClassName()); + } AliTOF::Init(); @@ -782,9 +790,11 @@ void AliTOFv3::Init() fIdFLTB = gMC->VolId("FLTB"); fIdFLTC = gMC->VolId("FLTC"); - printf("**************************************" - " TOF " - "**************************************\n"); + if(fDebug) { + printf("%s: **************************************" + " TOF " + "**************************************\n",ClassName()); + } } //_____________________________________________________________________________ diff --git a/TOF/AliTOFv4.cxx b/TOF/AliTOFv4.cxx index 777a6aaf449..eda3a46f9df 100644 --- a/TOF/AliTOFv4.cxx +++ b/TOF/AliTOFv4.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.9 2001/05/04 10:09:48 vicinanz +Major upgrades to the strip structure + Revision 1.8 2000/12/04 08:48:20 alibrary Fixing problems in the HEAD @@ -323,7 +326,8 @@ void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, par[0] = xFLT*0.5; par[1] = yFLT*0.5; - cout <<"************************* TOF geometry **************************"<Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon @@ -477,10 +481,10 @@ void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.); gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); - - printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + } zcoor -= zSenStrip; j++; Int_t upDown = -1; // upDown=-1 -> Upper strip @@ -495,10 +499,10 @@ void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ycoor += (1-(upDown+1)/2)*gap; gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); - - printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + if(fDebug) { + printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); + printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + } j += 2; upDown*= -1; // Alternate strips zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)- @@ -525,10 +529,10 @@ void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ycoor += (1-(upDown+1)/2)*gap; gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); - - printf("%f, St. %2i, Pl.3 ",ang*kRaddeg,i); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + } ycoor = -hTof/2.+ kspace;//2 cm over front plate // Plate B @@ -551,10 +555,10 @@ void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ycoor += (1-(upDown+1)/2)*gap; zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); - - printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + } i++; upDown*=-1; @@ -570,10 +574,10 @@ void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ycoor += (1-(upDown+1)/2)*gap; zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); - - printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + if(fDebug) { + printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); + printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + } upDown*=-1; i++; } while (TMath::Abs(ang*kRaddeg)<22.5); @@ -590,8 +594,10 @@ void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, zcoor = zpos+(zFLTB/2+zFLTA/2+db); gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); zpos = zpos - zSenStrip/TMath::Cos(ang); - printf("%f, St. %2i, Pl.4 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + if(fDebug) { + printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); + printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + } i++; } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db); @@ -616,10 +622,10 @@ void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, ang /= kRaddeg; zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2); gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); - - printf("%f, St. %2i, Pl.5 ",ang*kRaddeg,i); - printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); - + if(fDebug) { + printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i); + printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); + } zpos = zpos - zSenStrip/TMath::Cos(ang); } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t); @@ -765,12 +771,13 @@ void AliTOFv4::Init() // // Initialise the detector after the geometry has been defined // - printf("**************************************" - " TOF " - "**************************************\n"); - printf("\n Version 4 of TOF initialing, " - "symmetric TOF - Full Coverage version\n"); - + if(fDebug) { + printf("%s: **************************************" + " TOF " + "**************************************\n",ClassName()); + printf("\n%s: Version 4 of TOF initialing, " + "symmetric TOF - Full Coverage version\n",ClassName()); + } AliTOF::Init(); fIdFTOA = gMC->VolId("FTOA"); @@ -779,10 +786,12 @@ void AliTOFv4::Init() fIdFLTA = gMC->VolId("FLTA"); fIdFLTB = gMC->VolId("FLTB"); fIdFLTC = gMC->VolId("FLTC"); - - printf("**************************************" - " TOF " - "**************************************\n"); + + if(fDebug) { + printf("%s: **************************************" + " TOF " + "**************************************\n",ClassName()); + } } //_____________________________________________________________________________ diff --git a/TPC/AliTPC.cxx b/TPC/AliTPC.cxx index 5fd321951cd..541166a4209 100644 --- a/TPC/AliTPC.cxx +++ b/TPC/AliTPC.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.35 2001/05/08 16:02:22 kowal2 +Updated material specifications + Revision 1.34 2001/05/08 15:00:15 hristov Corrections for tracking in arbitrary magnenetic field. Changes towards a concept of global Alice track. Back propagation of reconstructed tracks (Yu.Belikov) @@ -1264,13 +1267,13 @@ void AliTPC::Hits2DigitsSector(Int_t isec) for (i=0;iCreateRow(isec,i); + AliDigits * dig = fDigitsArray->CreateRow(isec,i); DigitizeRow(i,isec,row); fDigitsArray->StoreRow(isec,i); - Int_t ndig = dig->GetDigitSize(); + Int_t ndig = dig->GetDigitSize(); //printf("*** Sector, row, compressed digits %d %d %d ***\n",isec,i,ndig); @@ -1776,18 +1779,20 @@ void AliTPC::Init() // Int_t i; // - printf("\n"); - for(i=0;i<35;i++) printf("*"); - printf(" TPC_INIT "); - for(i=0;i<35;i++) printf("*"); - printf("\n"); - // - for(i=0;i<80;i++) printf("*"); - printf("\n"); + if(fDebug) { + printf("\n%s: ",ClassName()); + for(i=0;i<35;i++) printf("*"); + printf(" TPC_INIT "); + for(i=0;i<35;i++) printf("*"); + printf("\n%s: ",ClassName()); + // + for(i=0;i<80;i++) printf("*"); + printf("\n"); + } } //_____________________________________________________________________________ -void AliTPC::MakeBranch(Option_t* option, char *file) +void AliTPC::MakeBranch(Option_t* option, const char *file) { // // Create Tree branches for the TPC. @@ -1801,8 +1806,8 @@ void AliTPC::MakeBranch(Option_t* option, char *file) const char *d = strstr(option,"D"); if (fDigits && gAlice->TreeD() && d) { - gAlice->MakeBranchInTree(gAlice->TreeD(), - branchname, &fDigits, buffersize, file) ; + MakeBranchInTree(gAlice->TreeD(), + branchname, &fDigits, buffersize, file); } if (fHitType&2) MakeBranch2(option,file); // MI change 14.09.2000 @@ -2010,7 +2015,7 @@ AliHit(shunt,track) //________________________________________________________________________ // Additional code because of the AliTPCTrackHits -void AliTPC::MakeBranch2(Option_t *option,char *file) +void AliTPC::MakeBranch2(Option_t *option,const char *file) { // // Create a new branch in the current Root Tree @@ -2027,17 +2032,23 @@ void AliTPC::MakeBranch2(Option_t *option,char *file) 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 (GetDebug()>1) + printf("* AliDetector::MakeBranch * Making Branch %s for trackhits\n",branchname); + const char folder [] = "RunMC/Event/Data"; + if (GetDebug()) + printf("%15s: Publishing %s to %s\n",ClassName(),branchname,folder); + Publish(folder,&fTrackHits,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); + b->SetFile(file); } wd->cd(); - cout << "Diverting branch " << branchname << " to file " << file << endl; + if (GetDebug()>1) + cout << "Diverting branch " << branchname << " to file " << file << endl; } } } diff --git a/TPC/AliTPC.h b/TPC/AliTPC.h index 6e261907bf7..0cba85567b3 100644 --- a/TPC/AliTPC.h +++ b/TPC/AliTPC.h @@ -66,7 +66,7 @@ public: virtual void Clusters2Tracks(TFile *of); Int_t GetNsectors() {return fNsectors;} - virtual void MakeBranch(Option_t *opt=" ", char *file=0 ); + virtual void MakeBranch(Option_t *opt=" ", const char *file=0 ); virtual void ResetDigits(); virtual void SetSecAL(Int_t sec); virtual void SetSecAU(Int_t sec); @@ -90,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=" ", char *file=0); // + virtual void MakeBranch2(Option_t *opt=" ", const 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/AliTPCtracker.cxx b/TPC/AliTPCtracker.cxx index b5684523a0e..6406ec290a7 100644 --- a/TPC/AliTPCtracker.cxx +++ b/TPC/AliTPCtracker.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.9 2001/05/11 07:16:56 hristov +Fix needed on Sun and Alpha + Revision 1.8 2001/05/08 15:00:15 hristov Corrections for tracking in arbitrary magnenetic field. Changes towards a concept of global Alice track. Back propagation of reconstructed tracks (Yu.Belikov) @@ -801,7 +804,7 @@ AliCluster *AliTPCtracker::GetCluster(Int_t index) const { Int_t row=(index&0x00ff0000)>>16; Int_t ncl=(index&0x0000ffff)>>00; - AliTPCClustersRow *clrow=((AliTPCtracker*)this)->fClustersArray.GetRow(sec,row);; + AliTPCClustersRow *clrow=((AliTPCtracker *) this)->fClustersArray.GetRow(sec,row); return (AliCluster*)(*clrow)[ncl]; } diff --git a/TPC/AliTPCv2.cxx b/TPC/AliTPCv2.cxx index a27f0d86ec6..0f8deafee0c 100644 --- a/TPC/AliTPCv2.cxx +++ b/TPC/AliTPCv2.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.38 2001/05/08 16:03:06 kowal2 +Geometry update according to the latest technical spec. + Revision 1.37 2001/04/27 15:23:07 kowal2 Correct materian in the central part of the inner containment vessel @@ -213,18 +216,18 @@ void AliTPCv2::CreateGeometry() for (i = 0; i < 6; ++i) { if (fSecLows[i] >= 0 && fSecLows[i] < 2*nInnerSector) { ifl1 = 1; - printf("*** SECTOR %d selected\n",fSecLows[i]); + printf("%s: *** SECTOR %d selected\n",ClassName(),fSecLows[i]); } } } else { - printf("*** ALL LOWER SECTORS SELECTED ***\n"); + printf("%s: *** ALL LOWER SECTORS SELECTED ***\n",ClassName()); ifl1 = 1; } if (ifl1 == 0) { - printf("*** ERROR: AT LEAST ONE LOWER SECTOR MUST BE SPECIFIED ***\n"); - printf("!!! PROGRAM STOPPED !!!\n"); + printf("%s: *** ERROR: AT LEAST ONE LOWER SECTOR MUST BE SPECIFIED ***\n",ClassName()); + printf("%s: !!! PROGRAM STOPPED !!!\n",ClassName()); exit(1); } @@ -233,12 +236,12 @@ void AliTPCv2::CreateGeometry() for (i = 0; i < 12; ++i) { if (fSecUps[i] > 2*nInnerSector-1 && fSecUps[i] < 2*(nInnerSector+nOuterSector)) { - printf("*** SECTOR %d selected\n",fSecUps[i]); + printf("%s: *** SECTOR %d selected\n",ClassName(),fSecUps[i]); } } } else { - printf("*** ALL UPPER SECTORS SELECTED ***\n"); + printf("%s: *** ALL UPPER SECTORS SELECTED ***\n",ClassName()); } @@ -1908,8 +1911,8 @@ void AliTPCv2::Init() gMC->Gstpar(idtmed[2],"LOSS",5); // specific energy loss - printf("*** TPC version 2 initialized ***\n"); - printf("Maximum number of steps = %d\n",gMC->GetMaxNStep()); + printf("%s: *** TPC version 2 initialized ***\n",ClassName()); + printf("%s: Maximum number of steps = %d\n",ClassName(),gMC->GetMaxNStep()); // diff --git a/TRD/AliTRD.cxx b/TRD/AliTRD.cxx index 7d18364749e..a12f71ff256 100644 --- a/TRD/AliTRD.cxx +++ b/TRD/AliTRD.cxx @@ -314,7 +314,7 @@ void AliTRD::Hits2Digits() // Set the parameter digitizer->SetDiffusion(); digitizer->SetExB(); - + digitizer->SetEvent(gAlice->GetEvNumber()); // Initialization //digitizer->InitDetector(); @@ -349,6 +349,7 @@ void AliTRD::Hits2SDigits() // Set the parameter digitizer->SetDiffusion(); digitizer->SetExB(); + digitizer->SetEvent(gAlice->GetEvNumber()); // Initialization //digitizer->InitDetector(); @@ -413,8 +414,6 @@ void AliTRD::BuildGeometry() Float_t rmin, rmax; Float_t zmax1, zmax2; - - Int_t iPlan; const Int_t kColorTRD = 46; @@ -455,7 +454,7 @@ void AliTRD::BuildGeometry() zmax2 = AliTRDgeometry::Zmax2() + slope * thickness; zmax1 = zmax2 + slope * AliTRDgeometry::DrThick(); - for (iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) { + for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) { sprintf(name,"S_TR1%d",iPlan); pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4); @@ -482,7 +481,7 @@ void AliTRD::BuildGeometry() zmax2 = AliTRDgeometry::Zmax2() + slope * thickness; zmax1 = zmax2 + slope * AliTRDgeometry::AmThick(); - for (iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) { + for (Int_t iPlan = 0; iPlan < AliTRDgeometry::Nplan(); iPlan++) { sprintf(name,"S_TR2%d",iPlan); pgon = new TPGON(name,"TRD","void",0,360,AliTRDgeometry::Nsect(),4); @@ -790,29 +789,29 @@ void AliTRD::Init() Int_t i; - printf("\n"); - for (i = 0; i < 35; i++) printf("*"); - printf(" TRD_INIT "); - for (i = 0; i < 35; i++) printf("*"); - printf("\n"); - printf("\n"); + if(fDebug) { + printf("\n%s: ",ClassName()); + for (i = 0; i < 35; i++) printf("*"); + printf(" TRD_INIT "); + for (i = 0; i < 35; i++) printf("*"); + printf("\n"); + } if (fGeometry->IsVersion() == 0) { - printf(" Geometry for spaceframe with holes initialized.\n\n"); + printf("%s: Geometry for spaceframe with holes initialized\n",ClassName()); } else if (fGeometry->IsVersion() == 1) { - printf(" Geometry for spaceframe without holes initialized.\n"); + printf("%s: Geometry for spaceframe without holes initialized\n",ClassName()); if (fGeometry->GetPHOShole()) - printf(" Leave space in front of PHOS free.\n"); + printf("%s: Leave space in front of PHOS free\n",ClassName()); if (fGeometry->GetRICHhole()) - printf(" Leave space in front of RICH free.\n"); - printf("\n"); + printf("%s: Leave space in front of RICH free\n",ClassName()); } - + if (fGasMix == 1) - printf(" Gas Mixture: 90%% Xe + 10%% CO2\n\n"); + printf("%s: Gas Mixture: 90%% Xe + 10%% CO2\n",ClassName()); else - printf(" Gas Mixture: 97%% Xe + 3%% Isobutane\n\n"); + printf("%s: Gas Mixture: 97%% Xe + 3%% Isobutane\n",ClassName()); } @@ -953,7 +952,7 @@ void AliTRD::LoadPoints(Int_t track) } //_____________________________________________________________________________ -void AliTRD::MakeBranch(Option_t* option, char *file) +void AliTRD::MakeBranch(Option_t* option, const char *file) { // // Create Tree branches for the TRD digits and cluster. @@ -967,19 +966,18 @@ void AliTRD::MakeBranch(Option_t* option, char *file) Int_t buffersize = 64000; fDigitsArray = new AliTRDdataArrayI(); - gAlice->MakeBranchInTree(gAlice->TreeD() - ,"TRDdigits", fDigitsArray->IsA()->GetName() - ,&fDigitsArray,buffersize,1,file); + MakeBranchInTree(gAlice->TreeD() + ,"TRDdigits", fDigitsArray->IsA()->GetName() + ,&fDigitsArray,buffersize,1,file); for (Int_t iDict = 0; iDict < AliTRDdigitsManager::NDict(); iDict++) { Char_t branchname[15]; sprintf(branchname,"TRDdictionary%d",iDict); fDictionaryArray[iDict] = new AliTRDdataArrayI(); - gAlice->MakeBranchInTree(gAlice->TreeD() - ,branchname,fDictionaryArray[iDict]->IsA()->GetName() - ,&fDictionaryArray[iDict],buffersize,1,file) ; + MakeBranchInTree(gAlice->TreeD() + ,branchname,fDictionaryArray[iDict]->IsA()->GetName() + ,&fDictionaryArray[iDict],buffersize,1,file); } - } //_____________________________________________________________________________ diff --git a/TRD/AliTRD.h b/TRD/AliTRD.h index 11819ea825d..519cf4361f6 100644 --- a/TRD/AliTRD.h +++ b/TRD/AliTRD.h @@ -47,7 +47,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, char *file=0); + virtual void MakeBranch(Option_t* option, const char *file=0); virtual void ResetDigits(); virtual void ResetRecPoints(); virtual void StepManager() = 0; diff --git a/TRD/AliTRDdigitizer.h b/TRD/AliTRDdigitizer.h index 53bee41d63d..18a8651cef5 100644 --- a/TRD/AliTRDdigitizer.h +++ b/TRD/AliTRDdigitizer.h @@ -62,6 +62,7 @@ class AliTRDdigitizer : public TNamed { virtual void SetCompress(Int_t c = 1) { fCompress = c; }; virtual void SetVerbose(Int_t v = 1) { fVerbose = v; }; virtual void SetSDigits(Int_t v = 1) { fSDigits = v; }; + virtual void SetEvent(Int_t v = 0) { fEvent = v; }; AliTRDdigitsManager *Digits() const { return fDigits; }; diff --git a/TRD/AliTRDdigitsManager.cxx b/TRD/AliTRDdigitsManager.cxx index 6080f5f48c5..08deda4acc1 100644 --- a/TRD/AliTRDdigitsManager.cxx +++ b/TRD/AliTRDdigitsManager.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.11 2001/03/13 09:30:35 cblume +Update of digitization. Moved digit branch definition to AliTRD + Revision 1.10 2001/01/26 19:56:57 hristov Major upgrade of AliRoot code @@ -76,6 +79,7 @@ Add new class AliTRDdigitsManager #include "AliTRDdataArrayI.h" #include "AliTRDdigit.h" #include "AliTRDgeometry.h" +#include "AliTRD.h" ClassImp(AliTRDdigitsManager) @@ -168,6 +172,8 @@ Bool_t AliTRDdigitsManager::MakeBranch(char *file) //TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("TRD.Digits.root"); + AliTRD * TRD = (AliTRD *) gAlice->GetDetector("TRD") ; + if (gAlice->TreeD()) { // Make the branch for the digits @@ -175,9 +181,9 @@ Bool_t AliTRDdigitsManager::MakeBranch(char *file) const AliTRDdataArray *kDigits = (AliTRDdataArray *) fDigits->At(0); if (kDigits) { - gAlice->MakeBranchInTree(gAlice->TreeD(), - "TRDdigits", kDigits->IsA()->GetName(), - &kDigits,buffersize, 1,file) ; + TRD->MakeBranchInTree(gAlice->TreeD(), + "TRDdigits", kDigits->IsA()->GetName(), + &kDigits,buffersize, 1,file); printf("AliTRDdigitsManager::MakeBranch -- "); printf("Making branch TRDdigits\n"); } @@ -197,9 +203,9 @@ Bool_t AliTRDdigitsManager::MakeBranch(char *file) const AliTRDdataArray *kDictionary = (AliTRDdataArray *) fDictionary[iDict]->At(0); if (kDictionary) { - gAlice->MakeBranchInTree(gAlice->TreeD(), - branchname,kDictionary->IsA()->GetName(), - &kDictionary,buffersize, 1,file) ; + TRD->MakeBranchInTree(gAlice->TreeD(), + branchname,kDictionary->IsA()->GetName(), + &kDictionary,buffersize, 1,file); printf("AliTRDdigitsManager::MakeBranch -- "); printf("Making branch %s\n",branchname); } diff --git a/TRD/AliTRDv1.cxx b/TRD/AliTRDv1.cxx index 75132bc8494..b3381f0da4b 100644 --- a/TRD/AliTRDv1.cxx +++ b/TRD/AliTRDv1.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.28 2001/05/07 08:03:22 cblume +Generate also hits in the amplification region + Revision 1.27 2001/03/30 14:40:15 cblume Update of the digitization parameter @@ -371,7 +374,7 @@ void AliTRDv1::Init() AliTRD::Init(); - printf(" Slow simulator\n\n"); + if(fDebug) printf("%s: Slow simulator\n",ClassName()); if (fSensSelect) { if (fSensPlane >= 0) printf(" Only plane %d is sensitive\n",fSensPlane); @@ -386,9 +389,9 @@ void AliTRDv1::Init() } } if (fTR) - printf(" TR simulation on\n"); + printf("%s: TR simulation on\n",ClassName()); else - printf(" TR simulation off\n"); + printf("%s: TR simulation off\n",ClassName()); printf("\n"); // First ionization potential (eV) for the gas mixture (90% Xe + 10% CO2) @@ -410,8 +413,11 @@ void AliTRDv1::Init() fIdChamber2 = gMC->VolId("UCIM"); fIdChamber3 = gMC->VolId("UCII"); - for (Int_t i = 0; i < 80; i++) printf("*"); - printf("\n"); + if(fDebug) { + printf("%s: ",ClassName()); + for (Int_t i = 0; i < 80; i++) printf("*"); + printf("\n"); + } } diff --git a/ZDC/AliZDCv1.cxx b/ZDC/AliZDCv1.cxx index ca0403fbd73..4abe5af13f2 100644 --- a/ZDC/AliZDCv1.cxx +++ b/ZDC/AliZDCv1.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.23 2001/05/14 09:51:50 coppedis +Change in AddHit suggested by J. Chudoba + Revision 1.22 2001/05/05 13:33:19 coppedis Changes in StepManager to speed simulation @@ -1363,7 +1366,7 @@ void AliZDCv1::Hits2Digits(Int_t ntracks) } //_____________________________________________________________________________ - void AliZDCv1::MakeBranch(Option_t *opt, char *file) + void AliZDCv1::MakeBranch(Option_t *opt, const char *file) { // // Create a new branch in the current Root Tree @@ -1383,8 +1386,8 @@ void AliZDCv1::Hits2Digits(Int_t ntracks) else fDigits = new TClonesArray ("AliZDCDigit",1000); char branchname[10]; sprintf(branchname,"%s",GetName()); - gAlice->MakeBranchInTree(gAlice->TreeD(), - branchname, &fDigits, fBufferSize, file) ; + 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 de75ce6a04c..5293cf182aa 100644 --- a/ZDC/AliZDCv1.h +++ b/ZDC/AliZDCv1.h @@ -24,8 +24,8 @@ public: virtual void CreateMaterials(); Int_t Digitize(Int_t Det, Int_t Quad, Int_t Light); virtual void SDigits2Digits(); + virtual void MakeBranch(Option_t* opt, const char *file=0); virtual void Hits2Digits(Int_t ntracks = 0); - 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/man/man4/alifs.4 b/man/man4/alifs.4 new file mode 100644 index 00000000000..cb3acd9c6bb --- /dev/null +++ b/man/man4/alifs.4 @@ -0,0 +1,51 @@ +.TH alifs 4 "" "ALICE Reference Manual" +.ad b +.SH NAME +alifs - a front-end shell for CASTOR and SHIFT +.SH SYNOPSIS +alifs [flags] + +File System implementation: + ls [-cdilRu] path + mv oldname newname... + rm [-f] [-i] [-r] dirname... + mkdir [-m absolute_mode] [-p] dirname... + cp f1 f2 + cp f1 + +CASTOR implementation: + ls [-cdilRTu] [--class] [--comment] path + mv oldname newname... + rm [-f] [-i] [-r] dirname... + mkdir [-m absolute_mode] [-p] dirname... + cp [-s maxsize] f1 f2 + cp f1 + +.SH DESCRIPTION +This is an interface script to underlying mass storage manager. At present it supports CASTOR on RH6.1 and offers some basic Unix like commands: + +o) list directory + alifs ls [-cdilRTu] [--class] [--comment] path + +o) move (rename) file or directory + alifs mv oldname newname... + +o) remove file or directory + alifs rm [-f] [-i] [-r] dirname... + +o) create directory + alifs mkdir [-m absolute_mode] [-p] dirname... + +o) copy files + alifs cp [-s maxsize] f1 f2 + alifs cp f1 + + CASTOR file system is accessible via RFIO (root must be configured configured with --enable-rfio switch and linked with appropriate libshift.a library). It provides experiment topl level directory (/castor/cern.ch/alice) and user directories following the AFS naming scheeme (like /castor/cern.ch/user/b/buncic). +For more info on CASTOR commands, see related man pages (nsls, nsrename, nsrm, nsmkdir,rfcp,rfstat). + + +.SH AUTHOR +Predrag Buncic, e-mail: Predrag.Buncic@cern.ch + +.SH CREATION DATE +15-Feb-2001 diff --git a/man/man4/alirun.4 b/man/man4/alirun.4 new file mode 100644 index 00000000000..1678ce25231 --- /dev/null +++ b/man/man4/alirun.4 @@ -0,0 +1,143 @@ +.TH alirun 4 "" "ALICE Reference Manual" +.ad b +.SH NAME +alirun - a shell script to run AliRoot +.SH DESCRIPTION +$Log$ + +Revision 1.5 2001/02/23 17:33:40 buncic +Added alifs wrapper for CASTOR and alirun modified accordingly. + +Revision 1.4 2001/02/08 18:55:43 buncic +Support for writing to remote file systems (shift/castor). + +Revision 1.3 2001/02/01 18:00:23 buncic +Use bash in place of sh for compatibility + +Revision 1.2 2001/02/01 17:46:26 buncic +Fixed mktemp on HP and Sun + +Revision 1.1 2001/01/26 21:22:02 hristov +Major upgrade of AliRoot code + + +.SH SYNOPSIS +alirun [[-d |-all]] + [-f ] + [-o ] + [-split] + [-C ] + [-p ] + [-seed ] + [-n ] + <-c > + +.SH DESCRIPTION +This script is a wrapper for AliRoot and provides a command line interface suitable for running in batch mode. + +.SH CONFIGURATION OPTIONS +The following options are used to configure AliRoot session. + +-c + This option must be the last one on alirun command line and specifies the sequence of alirun commands to be executed. At present, the following commands are supported: + + - Hits ................ simulation + - Digits .............. digitisation + - SDigits ............. creation of sumable digits + - SDigits2Digits ...... conversion SDigits->Digits + - Reco ................ reconstruction + +-d | -d all | -all + Selects detector for which will be run. If none of these options was specified, an internal loop in AliRoot over all active detectors is assumed. Otherwise, for each detector, input file(s) are re-opened in update mode, command (or macro) is executed and the file is closed. Option -all is equivalent to MUON+RICH+TOF+ITS+TPC+PHOS+PMD+CASTOR+TRD. Detectors are processed in order as they appear on the command line. + +-f + Name of the top level Root file where Root trees will be stored (branches may reside in the same file or be diverted to separate files (see -split option). By default, file is named galice.root. + +-o + A directory where output file(s) will be stored. If does not exist, it will be created. If not specified, current directory is used. One can prefix the directory name with a string indicting file transport protocols (as supported by ROOT). In addition, some file transport protocols are selected by name signatures. At present the following methods are available: + + o) if file name begins with rfio:, shift:, castor:, hpss:, /shift, /castor, /hpss => rfio (remote file i/o) protocol (requires rfiod on server side) + o) if file name begins with root:, roots: => root and secure root protocol (requires rootd on server side) + o) if file name begins with http: => HTTP protocol (requires modified apache server on server side) + +-split + If specified, this option will tell AliRoot to divert branches of Root trees into separate files. + + The layout of output directory is the following: + + + |-- Digits..root + |-- SDigits..root + |-- Hits.root + |-- Kine.root + |-- Reco.root + `-- galice.root + +-C + An alternative to Config.C macro which contains AliRoot configuration. + +-p + Number of primary particles to be generated by selected event generator. Required for Hits command, Ignored by Digits command (digitisation is performed for all particles found in input file). Default value is 50. + +-seed + Seed for random number generator (used to initialise TRandom3(n)). + +-n + Number of events to generate (not yet implemented). + +.SH RUN OPTIONS +These options define run time appearance of the AliRoot session. + +-help + Display usage. + +-verbose + Switch verbose screen output on. + +-quiet + Switch verbose output off. Output is redirected to a file which is shown on standard output only if returns non zero status. + +-fork + Forks all digitisation processes in background, using LSF if available, in order to speed up execution. It cannot be used in present design where only tree branches are diverted to separate files as top level Root file must be kept open in update mode. + +-trace + Show trace of execution of shell commands. + +-debug + Execute AliRoot under gdb. + +-debugger + Execute AliRoot under debugger other than gdb. + +-debuglevel + Set AliRoot debug flag to . + +-break + Execute AliRoot under gdb and set . + +-makeman + Create man page for alirun. + +.SH EXAMPLES + Run sumulation for 1 event, 100 particles and store output in file galice.root in /tmp/event.1 directory: + + alirun -o /tmp/event.1 -p 100 -c Hits + + Run sumulation for 1 event, 100 particles and store output in file test.root in /tmp/event.2 directory. In adition, divert branches of TreeD,TreeR and TreeK into separate files: + + alirun -o /tmp/event.2 -f test.root -split -p 100 -c Hits + + Use output from first step and create TOF and RICH digits. Output is in the same direcory and in file test.root + + alirun -d TOF+RICH -o /tmp/event.1 -c Digits + + Use output from second step and create digits for all detectors. Output is in the same direcory and branches are diverted to separate files: + + alirun -d all -o /tmp/event.2 -f test.root -split -c Digits + +.SH AUTHOR + Predrag Buncic, e-mail: Predrag.Buncic@cern.ch + +.SH CREATION DATE + 06-Nov-2000 + diff --git a/man/man4/mangen.4 b/man/man4/mangen.4 new file mode 100644 index 00000000000..40ac54c3dc4 --- /dev/null +++ b/man/man4/mangen.4 @@ -0,0 +1,52 @@ +.TH mangen 4 "" "ALICE Reference Manual" +.ad b +.SH NAME +mangen - generate manual entries for library +.SH SYNOPSIS +mangen [-d] [-n] [-l] chapter file + +.SH DESCRIPTION +generates: . (manual entry for module) +and if "-l": . (manual entries for each routine) + +where is the "root" of the "tail" of the specified file +(i.e. if file="/usr/dave/gronk.c", then name="gronk"); +and is the single digit chapter number +(i.e. just the specified chapter number if one was given, +or the number from the table below if a chapter name was given). + + can be any digit or any of the following chapter abbreviations: + + # abbr name what + = ==== =========== ==================================== + 0 con* + over* conventions - conventions and overview material + 1 lib* libraries - subroutine library summaries + 2 routines - individual library routines + 3 task* + tsk* + dr* drivers - tasks and drivers + 4 tool* tools - Unix development/maintenence tools + +.SH NOTE +Specifying the chapter as "lib" automatically selects the -l option. + +"-l" flag causes a special library module style manual entry to be created. +The manual entry for a library has a specially constructed synopsis section +that contains the titles and calling sequence of each routine in the library. +Also a seperate manual entry is generated for each of the routines in the +library. These routine manual entries will be put in a file named libxxx.2. + +"-d" flag causes the intermediate nroff source files to NOT be deleted. +These are called "mg.out" and "mgr.out" for the module manual entry +and individual routine entries (only if -l option specified), respectively. +This option is useful for debugging manual entries that don't look the +way you expected. + +"-n" flag causes nroff sources not to be deleted, and not to be nroffed +either. In this case, "mg.out" (and "mgr.out") will be the ONLY output +from mangen. + +.SH EXAMPLE + % mangen lib /usr/vw/lib/lstlib.c +will create "lstlib.1" and "liblst.2" in the current directory. diff --git a/share/alifs b/share/alifs index 700623448ac..06ba0180b83 100755 --- a/share/alifs +++ b/share/alifs @@ -5,9 +5,28 @@ # # modification history # $Log$ +# Revision 1.1 2001/02/23 17:33:40 buncic +# Added alifs wrapper for CASTOR and alirun modified accordingly. +# # # SYNOPSIS -# alifs +# alifs [flags] +# +# File System implementation: +# ls [-cdilRu] path +# mv oldname newname... +# rm [-f] [-i] [-r] dirname... +# mkdir [-m absolute_mode] [-p] dirname... +# cp f1 f2 +# cp f1 +# +# CASTOR implementation: +# ls [-cdilRTu] [--class] [--comment] path +# mv oldname newname... +# rm [-f] [-i] [-r] dirname... +# mkdir [-m absolute_mode] [-p] dirname... +# cp [-s maxsize] f1 f2 +# cp f1 # # DESCRIPTION # This is an interface script to underlying mass storage manager. At present it supports CASTOR on RH6.1 and offers some basic Unix like commands: @@ -23,9 +42,13 @@ # # o) create directory # alifs mkdir [-m absolute_mode] [-p] dirname... + +# o) copy files +# alifs cp [-s maxsize] f1 f2 +# alifs cp f1 # # CASTOR file system is accessible via RFIO (root must be configured configured with --enable-rfio switch and linked with appropriate libshift.a library). It provides experiment topl level directory (/castor/cern.ch/alice) and user directories following the AFS naming scheeme (like /castor/cern.ch/user/b/buncic). -#For more info on CASTOR commands, see related man pages (nsls, nsrename, nsrm, nsmkdir). +#For more info on CASTOR commands, see related man pages (nsls, nsrename, nsrm, nsmkdir,rfcp,rfstat). # # # AUTHOR: @@ -35,30 +58,32 @@ # 15-Feb-2001 #C< ########################################################################### +ALIFSDIR=`dirname $0`; export ALIFSDIR +########################################################################### Configure() { - if [ "$CASTOR_USER_POOL" = "" ] - then - CASTOR_USER_POOL=$STAGE_POOL - fi - - if [ "$CASTOR_BIN" = "" ] - then - case `uname` in - Linux) - CASTOR_BIN=/afs/cern.ch/asis/packages/CASTOR/castor-1.3.1.1/i386_redhat61/usr.local/bin - EXEC_SHELL=/bin/sh - ;; - *) - ;; - esac - fi - - if [ ! -d $CASTOR_BIN ] - then - printf "CASTOR is not supported on this platform.\n" - exit 255 - fi + case "$ALICE_MSS" in + CASTOR) + if [ -f $ALIFSDIR/castor.sh ] + then + . $ALIFSDIR/castor.sh + else + printf "Cannot find %s file. Terminating..." $ALIFSDIR/castor.sh + exit 1 + fi + ;; + HPSS|RFIO) + if [ -f $ALIFSDIR/rfio.sh ] + then + . $ALIFSDIR/rfio.sh + else + printf "Cannot find %s file. Terminating...\n" $ALIFSDIR/rfio.sh + exit 1 + fi + ;; + *) + ;; + esac if [ "$EXEC_SHELL" = "" ] then @@ -79,13 +104,20 @@ Configure() fi } ########################################################################### -ALIFS::Usage() +ALIFS_Usage() { - printf "Usage: alifs \n" - exit + printf "\nFile System Implementation:\n\n" + printf "Usage: alifs [-help][-p ] \n" + printf " [-cdilRu] path \n" + printf " mv oldname newname... \n" + printf " rm [-f] [-i] [-r] dirname... \n" + printf " mkdir [-m absolute_mode] [-p] dirname...\n" + printf " cp f1 f2 \n" + printf " cp f1 \n" + exit } ########################################################################### -ALIFS::Makeman() +ALIFS_Makeman() ########################################################################### { mandir=../man/man4 @@ -98,24 +130,29 @@ ALIFS::Makeman() fi } ########################################################################### -ALIFS::ls() +ALIFS_ls() +{ + ls $* +} +########################################################################### +ALIFS_mkdir() { - $CASTOR_BIN/nsls $* + mkdir $* } ########################################################################### -ALIFS::mkdir() +ALIFS_mv() { - $CASTOR_BIN/nsmkdir $* + mv $* } ########################################################################### -ALIFS::mv() +ALIFS_rm() { - $CASTOR_BIN/nsrename $* + rm $* } ########################################################################### -ALIFS::rm() +ALIFS_cp() { - $CASTOR_BIN/nsrm $* + cp $* } ########################################################################### Configure $* @@ -124,18 +161,19 @@ ALIFS() { cmd=$1; shift 1 - case `type -t ALIFS::$cmd` in + case `type -t ALIFS_$cmd` in function) - ALIFS::$cmd $* + ALIFS_$cmd $* ;; *) - ALIFS::Usage; + ALIFS_Usage; ;; esac exit } ########################################################################### + ########################################################################### for param in $* @@ -151,7 +189,10 @@ do ;; -makeman) shift 1 - ALIFS::Makeman + ALIFS_Makeman + ;; + -help) + ALIFS_Usage ;; -p) shift 1 @@ -163,4 +204,9 @@ do esac done +########################################################################### +ALIFS_Usage +########################################################################### + + diff --git a/share/alirun b/share/alirun index fd5dbdd626f..20f904643f5 100755 --- a/share/alirun +++ b/share/alirun @@ -4,7 +4,12 @@ ############################################################################# # # modification history +# # $Log$ +# +# Revision 1.5 2001/02/23 17:33:40 buncic +# Added alifs wrapper for CASTOR and alirun modified accordingly. +# # Revision 1.4 2001/02/08 18:55:43 buncic # Support for writing to remote file systems (shift/castor). # @@ -106,6 +111,9 @@ # -debugger # Execute AliRoot under debugger other than gdb. # +# -debuglevel +# Set AliRoot debug flag to . +# # -break # Execute AliRoot under gdb and set . # @@ -330,7 +338,9 @@ void Simulate() gAlice->Init(gSystem->Getenv("CONFIG")); - gAlice->Run(1); + $DEBUG_LEVEL; + + gAlice->RunMC($NEVENTS); } //////////////////////////////////////////////////////////////////////////// @@ -364,6 +374,8 @@ void $mode() AliRun *gAlice = (AliRun*)file->Get("gAlice"); + $DEBUG_LEVEL; + gAlice->$mode(gSystem->Getenv("CONFIG_DETECTOR")); } //////////////////////////////////////////////////////////////////////////// @@ -401,12 +413,12 @@ AliRunHits() } ########################################################################### -AliRunDigits() +AliRunSplitCmd() ########################################################################### { if [ "$DETECTORS" = "" ] then - AliRoot Digits + AliRoot $1 else for det in $DETECTORS do @@ -415,18 +427,32 @@ AliRunDigits() then if [ "$LSF_FORK" = "TRUE" ] then - lsrun AliRoot Digits $CONFIG_DETECTOR + lsrun AliRoot $1 $CONFIG_DETECTOR else - AliRoot Digits $CONFIG_DETECTOR & + AliRoot $1 $CONFIG_DETECTOR & fi else - AliRoot Digits $CONFIG_DETECTOR + AliRoot $1 $CONFIG_DETECTOR fi done wait fi } +########################################################################### +AliRunDigits() +########################################################################### +{ + AliRunSplitCmd Digits +} + +########################################################################### +AliRunReco() +########################################################################### +{ + AliRunSplitCmd Reco +} + ########################################################################### ALL="MUON RICH TOF ITS TPC PHOS PMD CASTOR ZDC TRD"; @@ -442,13 +468,15 @@ ALIRUN_TMPDIR=`Mktemp`; export ALIRUN_TMPDIR ALIRUN_DEBUGGER=gdb DEBUG="FALSE" +DEBUG_LEVEL="" BREAK="" VERBOSE="TRUE" OUTPUT=. -CMDLIST="Usage" +CMDLIST="" FORK="FALSE" FORK_LSF="FALSE" ECHO="" +NEVENTS=1 USE_CACHE="file->UseCache()" if [ -x /usr/local/lsf/bin/lsrun ] @@ -476,6 +504,10 @@ do shift 1 ALIRUN_DEBUGGER=$1 ;; + -debuglevel) + shift 1 + DEBUG_LEVEL="gAlice->SetDebug($1)" + ;; -break) shift 1 DEBUG="TRUE" @@ -569,6 +601,11 @@ do esac done +if [ "$CMDLIST" = "" ] +then + AliRun +fi + if [ `dirname $OUTPUT` = "." ] then CONFIG_OUTDIR=`pwd`/$OUTPUT diff --git a/share/castor.sh b/share/castor.sh new file mode 100644 index 00000000000..b19a6a96958 --- /dev/null +++ b/share/castor.sh @@ -0,0 +1,55 @@ +if [ "$CASTOR_USER_POOL" = "" ] + then + CASTOR_USER_POOL=$STAGE_POOL +fi + +if [ "$CASTOR_BIN" = "" ] +then + nsls=`which nsls` + CASTOR_BIN=`dirname $nsls` +fi + +if [ ! -d $CASTOR_BIN ] +then + printf "CASTOR is not supported on this platform.\n" + exit 255 +fi + +########################################################################### +ALIFS_Usage() +{ + printf "CASTOR Implementation:\n\n" + printf "Usage: alifs [-help][-p ] \n" + printf " ls [-cdilRTu] [--class] [--comment] path\n" + printf " mv oldname newname... \n" + printf " rm [-f] [-i] [-r] dirname... \n" + printf " mkdir [-m absolute_mode] [-p] dirname...\n" + printf " cp [-s maxsize] f1 f2 \n" + printf " cp f1 \n" + exit +} +########################################################################### +ALIFS_ls() +{ + $CASTOR_BIN/nsls $* +} +########################################################################### +ALIFS_mkdir() +{ + $CASTOR_BIN/nsmkdir $* +} +########################################################################### +ALIFS_mv() +{ + $CASTOR_BIN/nsrename $* +} +########################################################################### +ALIFS_rm() +{ + $CASTOR_BIN/nsrm $* +} +########################################################################### +ALIFS_cp() +{ + $CASTOR_BIN/rfcp $* +} diff --git a/share/makepatch b/share/makepatch new file mode 100755 index 00000000000..215be3e76e1 --- /dev/null +++ b/share/makepatch @@ -0,0 +1,20 @@ +#!/bin/sh +outdir=${2:-"./"} +tm=`date "+%Y-%m-%d-%H-%M-%S"` +list=/tmp/$tm +tar=$outdir/$tm.tar.gz +cvs -z3 -qn update -Ad | grep -v conf/MachineDef | grep -v quickExecution > $list +if [ `cat $list | grep -c -e "^C " -e "U "` -gt 0 ] +then + cat $list | grep -e "^C " -e "^U " +else + files=$outdir/$tm + cat $list | grep -e "^M " -e "^?" | awk '{print $2}' > $outdir/$tm + cvs -z3 diff `cat $files` > $outdir/$tm.diffs + if [ "$1" = "touch" ] ; then + touch `cat $files` + fi + tar zcvf $tar `cat $files` man share/alirun share/mangen share/makepatch + rm $list +fi + diff --git a/share/rfio.sh b/share/rfio.sh new file mode 100644 index 00000000000..19b9df1e642 --- /dev/null +++ b/share/rfio.sh @@ -0,0 +1,50 @@ +if [ "$RFIO_BIN" = "" ] +then + rfdir=`which rfdir` + RFIO_BIN=`dirname $rfdir` +fi + +if [ ! -d $RFIO_BIN ] +then + printf "HPSS/RFIO is not supported on this platform.\n" + exit 255 +fi + +########################################################################### +ALIFS_Usage() +{ + printf "HPSS/RFIO Implementation:\n\n" + printf "Usage: alifs [-help][-p ] \n" + printf " ls [-R] path \n" + printf " mv oldname newname... \n" + printf " rm [-r] pathname... \n" + printf " mkdir [-m absolute_mode] [-p] dirname...\n" + printf " cp [-s maxsize] f1 f2 \n" + printf " cp f1 \n" + exit +} +########################################################################### +ALIFS_ls() +{ + $RFIO_BIN/rfdir $* +} +########################################################################### +ALIFS_mkdir() +{ + $RFIO_BIN/rfmkdir $* +} +########################################################################### +ALIFS_mv() +{ + $RFIO_BIN/rfrename $* +} +########################################################################### +ALIFS_rm() +{ + $RFIO_BIN/rfrm $* +} +########################################################################### +ALIFS_cp() +{ + $RFIO_BIN/rfcp $* +} -- 2.39.3