/*
$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
#include <TRint.h>
#include <TFile.h>
#include <AliRun.h>
+#include <AliConfig.h>
#if defined __linux
//On linux Fortran wants this, so we give to it!
// 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);
#ifdef __linux
#include <fpu_control.h>
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
/*
$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
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;
//
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)
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
//
private:
void * fCont; //!data buffer
- ClassDef(AliMemArray,0)
+ //ClassDef(AliMemArray,0)
+ ClassDef(AliMemArray,1)
};
void * AliMemArray::Unchecked1DAt(UInt_t i) const
private:
AliClassInfo *fClassInfo; //pointer to containg class info
//
- ClassDef(AliObjectArray,0)
+ //ClassDef(AliObjectArray,0)
+ ClassDef(AliObjectArray,1)
};
/*
$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
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);
}
#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+;
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
# 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
{
// add a real digit - as coming from data
+ // printf("AddDigit\n");
TClonesArray &ldigits = *fDigits;
new(ldigits[fNdigits++]) AliFMDdigit(digits);
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)
}
//---------------------------------------------------------------------
-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;
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();
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("");
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();
cout<<" FILE =0 "<<endl;}
cout<<"After CONFIG_SPLIT_FILE "<<file<<endl;
- gAlice->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
delete sdigits ;
sdigits = 0;
}
+
if(file)
file->Close() ;
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]);
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 {
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());
}
//-------------------------------------------------------------------
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]);
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 {
{
// 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());
}
//-------------------------------------------------------------------
* $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
*
C.
#include "geant321/gcbank.inc"
#include "geant321/gcunit.inc"
+#include "geant321/gcflag.inc"
*
DIMENSION CLOW(500),CHIGH(500),CORD(1000),ITYPE(1000),
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
* $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
*
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
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
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
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
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)
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',
* $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
*
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))
/*
$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
Int_t i;
for(i=0;i<kNTYPES;i++) {
- (*fDetTypes)[i]=new AliITSDetType();
+ fDetTypes->AddAt(new AliITSDetType(),i);
fNdtype[i]=0;
fNctype[i]=0;
}
{
// sets the default segmentation, response, digit and raw cluster classes
- printf("SetDefaults\n");
+ if(fDebug) printf("%s: SetDefaults\n",ClassName());
AliITSDetType *iDetType;
}
//_____________________________________________________________________________
-void AliITS::MakeBranch(Option_t* option, char *file)
+void AliITS::MakeBranch(Option_t* option, const char *file)
{
//
// Creates Tree branches for the ITS.
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;
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;
TStopwatch timer;
timer.Start();
- HitsToDigits(0,0,-1," ","All"," ");
+ HitsToDigits(gAlice->GetEvNumber(),0,-1," ","All"," ");
timer.Stop(); timer.Print();
delete sim0;
// 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() {}
{
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];
// 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.
// 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.
**************************************************************************/
/*
$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
#include <iostream.h>
#include "AliITSsegmentationSSD.h"
#include "AliITSgeom.h"
+#include "AliRun.h"
+#include "AliModule.h"
ClassImp(AliITSsegmentationSSD)
AliITSsegmentationSSD::AliITSsegmentationSSD(){
/*
$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
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
gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
} // end if (fEuclidOut)
- cout << "finished with euclid geometrys" << endl;
+ if(fDebug) cout << ClassName() << ": finished with euclid geometrys" << endl;
}
//______________________________________________________________________
"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];
// 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;i<nlayers;i++)for(j=0;j<ndeep;j++)
itsGeomTreeNames[i][j] = ig->StringToInt(names[i][j]);
////////////////////////////////////////////////////////////////////////
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);
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(){
**************************************************************************/
/*
$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.
AliMUON::~AliMUON()
{
// Destructor
- printf("Calling AliMUON destructor !!!\n");
+ if(fDebug) printf("%s: Calling AliMUON destructor !!!\n",ClassName());
Int_t i;
fIshunt = 0;
}
//___________________________________________
-void AliMUON::MakeBranch(Option_t* option, char *file)
+void AliMUON::MakeBranch(Option_t* option, const char *file)
{
//
// Create Tree branches for the MUON.
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) {
for (i=0; i<AliMUONConstants::NCh() ;i++) {
sprintf(branchname,"%sDigits%d",GetName(),i+1);
if (fDchambers && gAlice->TreeD()) {
- 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);
}
}
for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) {
sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
if (fRawClusters && gAlice->TreeR()) {
- 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);
}
}
//
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);
}
//
//
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);
}
}
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();
/*
$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
#include "AliMUONPoints.h"
#include "TParticle.h"
#include "AliMUONTriggerDecision.h"
+#include "AliHeader.h"
#include "AliMUONHit.h"
#include "AliMUONPadHit.h"
/*
$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"
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);
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: ----------------------------------------------------");
+ }
}
}
/*
$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
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,
#include <TClonesArray.h>
#include "AliMUONRecoEvent.h"
#include "AliMUONRecoDisplay.h"
+#include "AliHeader.h"
#include <TROOT.h>
#include <AliPoints.h>
#include <TSlider.h>
/*
$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
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,
#include "AliMUONTrackParam.h"
#include "AliMUONHitForRec.h"
#include "AliMUONTrackHit.h"
+#include "AliHeader.h"
ClassImp(AliMUONRecoTrack)
ClassImp(AliMUONRecoEvent)
/*
$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
// 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
/*
$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
// 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;
/*
$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,
//
// PCB module size in cm
- printf("\n Initialise Segmentation SlatModuleN \n");
+ // printf("\n Initialise Segmentation SlatModuleN \n");
fDxPCB=40;
/*
$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
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;
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;
fChamber=&(pMUON->Chamber(chamber));
fId=chamber;
- cout << "---------------------------------------------------- \n";
+ if(pMUON->GetDebug()) cout << ClassName() << ": ---------------------------------------------------- \n";
}
/*
$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
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
/*
$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.
#include "TRandom.h"
#include "TArc.h"
#include "AliMUONChamber.h"
+#include "AliMUON.h"
+#include "AliRun.h"
#include <iostream.h>
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
/*
$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.
// 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;
/*
$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.
// 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)
/*
$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.
// concentric circles as shown below
//
- printf("\n Initialise Segmentation V05 \n");
+ //printf("\n Initialise Segmentation V05 \n");
// PCB module size in cm
/*
$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.
// 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; i<AliMUONConstants::NCh(); i++) {
( (AliMUONChamber*) (*fChambers)[i])->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; i<AliMUONConstants::NTriggerCircuit(); i++) {
( (AliMUONTriggerCircuit*) (*fTriggerCircuits)[i])->Init(i);
}
- printf(" Finished Init for Trigger Circuits\n\n\n");
+ if(fDebug) printf("%s: Finished Init for Trigger Circuits\n",ClassName());
//cp
}
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");
+ }
}
}
//___________________________________________________________________________
-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
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);
}
}
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
}
//___________________________________________________________________________
-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
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);
}
}
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
/*
$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
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
sprintf(branchname,"%sRecPoints",GetName());
if (fRecPoints && gAlice->TreeR()) {
- gAlice->MakeBranchInTree(gAlice->TreeR(),
- branchname, &fRecPoints, kBufferSize, file) ;
+ MakeBranchInTree(gAlice->TreeR(),
+ branchname, &fRecPoints, kBufferSize, file);
}
}
}
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();
**************************************************************************/
/*
$Log$
+Revision 1.12 2001/05/14 14:01:04 morsch
+AliPMDv0 coarse geometry and AliPMDv1 detailed simulation, completely revised versions by Tapan Nayak.
+
*/
//
///////////////////////////////////////////////////////////////////////////////
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);
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];
--- /dev/null
+/***************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+/*
+$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
+/*
+<img src="picts/AliPMDv3Class.gif">
+*/
+//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
+ /*
+ <img src="picts/AliPMDv3.gif">
+ */
+ //End_Html
+ //Begin_Html
+ /*
+ <img src="picts/AliPMDv3Tree.gif">
+ */
+ //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.;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
$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).
}
//___________________________________________
-void AliRICH::MakeBranch(Option_t* option, char *file)
+void AliRICH::MakeBranch(Option_t* option, const char *file)
{
// Create Tree branches for the RICH.
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());
}
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());
}
for (i=0; i<kNCH ;i++) {
sprintf(branchname,"%sDigits%d",GetName(),i+1);
if (fDchambers && gAlice->TreeD()) {
- //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);
}
for (i=0; i<kNCH ;i++) {
sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
if (fRawClusters && gAlice->TreeR()) {
- //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);
}
}
for (i=0; i<kNCH ;i++) {
sprintf(branchname,"%sRecHits1D%d",GetName(),i+1);
if (fRecHits1D && gAlice->TreeR()) {
- //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; i<kNCH ;i++) {
sprintf(branchname,"%sRecHits3D%d",GetName(),i+1);
if (fRecHits3D && gAlice->TreeR()) {
- //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);
}
}
//
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();
/*
$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.
#include "AliRICHConst.h"
#include "AliRICHDisplay.h"
#include "AliRICHPoints.h"
+#include "AliHeader.h"
#include "AliRICHHit.h"
#include "AliRICHCerenkov.h"
/*
$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.
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;
/*
$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.
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;
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());
+ }
}
/*
$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.
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;
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());
+ }
}
/*
$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).
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;
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());
+ }
}
/*
$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
// 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
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);
}
*/
}
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:
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");
// 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);
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++++++++++"<<endl;
+ if(fDebug) cout<<ClassName()<<": ++++++++++++++Medium set++++++++++"<<endl;
// geant3->Gsckov(idtmed[2105], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
//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());
}
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+#include "TString.h"
+
+#include "AliConfig.h"
+#include "AliDetector.h"
+
+#include <iostream.h>
+
+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;
+
+}
+
+
--- /dev/null
+#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 <TFolder.h>
+#include <TList.h>
+#include <TInterpreter.h>
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TDatabasePDG.h>
+
+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
/*
$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
///////////////////////////////////////////////////////////////////////////////
#include <assert.h>
+#include <iostream.h>
#include <TTree.h>
#include <TBrowser.h>
#include <TFile.h>
+#include <TROOT.h>
+#include <TFolder.h>
+#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;
fPoints = 0;
fBufferSize = 16000;
fDigitsFile = 0;
+
+ AliConfig::Instance()->Add(this);
}
//_____________________________________________________________________________
}
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)
{
}
//_____________________________________________________________________________
-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
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");
#include <AliModule.h>
class AliHit;
class TTree;
+class TBranch;
class AliDetector : public AliModule {
{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();
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:
/*
$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
#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;
/*
$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.
//_____________________________________________________________________________
+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.;
}
/* $Id$ */
#include <TNamed.h>
-#include <TDatime.h>
// Event header base class for generator.
// Stores as a minimum the date, run number, event number, number of particles produced
{
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
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+#include <iostream.h>
+
+#include "AliGenKine.h"
+#include "AliMCProcess.h"
+#include "AliMC.h"
+#include "AliRun.h"
+#include "AliStack.h"
+
+#include <TROOT.h>
+#include <TTree.h>
+#include <TDirectory.h>
+#include <TDatabasePDG.h>
+#include <TFile.h>
+#include <TH1.h>
+#include <TArrayI.h>
+#include <TClonesArray.h>
+#include <TObjArray.h>
+#include <TParticle.h>
+#include <stdlib.h>
+
+ 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
+
+}
+
+
+
+
+
+
+
+
--- /dev/null
+#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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
$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
#include "AliGenerator.h"
#include "TGenerator.h"
#include "AliRun.h"
+#include "AliConfig.h"
ClassImp(AliGenerator)
fVMax[0]=fVMax[1]=fVMax[2]=10000;
SetNumberParticles(npart);
+
+ AliConfig::Instance()->Add(this);
}
//____________________________________________________________
/*
$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
fNprimary=0;
fNtrack=0;
fEvent=0;
+ fStack=0;
+ fGenHeader = 0;
}
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)
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<fNtrack; i++)
- printf(" %d th entry: %d \n",i,fParticleFileMap[i]);
- }
+
+}
+
+inline AliStack* AliHeader::Stack() const
+{
+// Return pointer to stack
+ return fStack;
+}
+
+inline void AliHeader::SetStack(AliStack* stack)
+{
+// Set pointer to stack
+ fStack = stack;
+}
+
+inline void AliHeader::SetGenEventHeader(AliGenEventHeader* header)
+{
+// Set pointer to header for generated event
+ fGenHeader = header;
+}
+
+inline AliGenEventHeader* AliHeader::GenEventHeader() const
+{
+// Get pointer to header for generated event
+ return fGenHeader;
}
#include <TObject.h>
#include <TArrayI.h>
+class AliStack;
+class AliGenEventHeader;
class AliHeader : public TObject {
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);
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
};
/*
$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
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);
}
/*
$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
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);
}
/*
$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
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);
}
/*
$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
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);
}
/*
$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
#include <stdlib.h>
#include "AliMC.h"
+#include "AliConfig.h"
ClassImp(AliMC)
} else {
fgMC=this;
gMC=this;
+ AliConfig::Instance()->Add(this);
}
}
/*
$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
fType = kUndef;
fFactor = factor;
fMax = fmax;
+ //
+ fDebug = 0;
}
//________________________________________
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
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
};
/*
$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
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());
}
//________________________________________
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;
}
}
} else {
- printf("File %s not found !\n",fTitle.Data());
+ printf("%s: File %s not found !\n",ClassName(),fTitle.Data());
exit(1);
}
}
/*
$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
#include "AliRun.h"
#include "AliMagF.h"
#include "AliMC.h"
+#include "AliConfig.h"
ClassImp(AliModule)
fNodes = 0;
fIdtmed = 0;
fIdmate = 0;
+ fDebug = 0;
}
//_____________________________________________________________________________
// Prepare to find the tracking media range
fLoMedium = 65536;
fHiMedium = 0;
+
+ AliConfig::Instance()->Add(this);
+
SetDebug(gAlice->GetDebug());
}
}
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;
}
}
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;
//*
}
//
// *** 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;
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;
//*
//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() {}
#include <TTree.h>
#include <TGeometry.h>
#include <TROOT.h>
-#include "TBrowser.h"
+#include <TBrowser.h>
+#include <TFolder.h>
#include "TParticle.h"
#include "AliRun.h"
#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;
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.
gAlice = this;
fTreeD = 0;
- fTreeK = 0;
fTreeH = 0;
fTreeE = 0;
fTreeR = 0;
gROOT->GetListOfBrowsables()->Add(this,name);
//
+ // Particle stack
+ fStack = new AliStack(10000);
// create the support list for the various Detectors
fModules = new TObjArray(77);
//
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
//
// 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;
}
delete fGenerator;
delete fLego;
delete fTreeD;
- delete fTreeK;
delete fTreeH;
delete fTreeE;
delete fTreeR;
fModules->Delete();
delete fModules;
}
- if (fParticles) {
- fParticles->Delete();
- delete fParticles;
- }
+ delete fStack;
delete fHitLists;
delete fPDGDB;
delete fMCQA;
+ delete fHeader;
}
//_____________________________________________________________________________
// 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());
}
}
-//_____________________________________________________________________________
-void AliRun::CleanParents()
-{
- //
- // Clean Particles stack.
- // Set parent/daughter relations
- //
- TObjArray &particles = *fParticleMap;
- TParticle *part;
- int i;
- for(i=0; i<fHgwmk+1; i++) {
- part = (TParticle *)particles.At(i);
- if(part) if(!part->TestBit(kDaughtersBit)) {
- part->SetFirstDaughter(-1);
- part->SetLastDaughter(-1);
- }
- }
-}
-
//_____________________________________________________________________________
Int_t AliRun::DistancetoPrimitive(Int_t, Int_t)
{
//
// Dumps particle i in the stack
//
- ((TParticle*) (*fParticleMap)[i])->Print();
+ fStack->DumpPart(i);
}
//_____________________________________________________________________________
//
// Dumps the particle stack
//
- TObjArray &particles = *fParticleMap;
- printf(
- "\n\n=======================================================================\n");
- for (Int_t i=0;i<fNtrack;i++)
- {
- printf("-> %d ",i); ((TParticle*) particles[i])->Print();
- printf("--------------------------------------------------------------\n");
- }
- printf(
- "\n=======================================================================\n\n");
+ fStack->DumpPStack();
}
+//_____________________________________________________________________________
void AliRun::SetField(AliMagF* magField)
{
// Set Magnetic Field Map
// static Int_t count=0;
// const Int_t times=10;
// This primary is finished, purify stack
- PurifyKine();
+ fStack->PurifyKine();
TIter next(fModules);
AliModule *detector;
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();
}
//_____________________________________________________________________________
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; i<fHgwmk+1; ++i) if((part=fParticleMap->At(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;
}
//
if(fLego) fLego->FinishRun();
-
- if(fGenerator) fGenerator->FinishRun();
// Clean detector information
TIter next(fModules);
Write(0,TObject::kOverwrite);
// Clean tree information
- if (fTreeK) {
- delete fTreeK; fTreeK = 0;
- }
+
+ fStack->FinishRun();
+
if (fTreeH) {
delete fTreeH; fTreeH = 0;
}
if (fTreeE) {
delete fTreeE; fTreeE = 0;
}
+ if (fTreeS) {
+ delete fTreeS; fTreeS = 0;
+ }
// Close output file
file->Write();
//_____________________________________________________________________________
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);
}
//_____________________________________________________________________________
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) {
//
// 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
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);
while((detector = (AliModule*)next())) {
detector->SetTreeAddress();
}
-
- fNtrack = Int_t (fTreeK->GetEntries());
- return fNtrack;
+
+ return fStack->GetNtrack();
}
//_____________________________________________________________________________
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);
}
//_____________________________________________________________________________
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
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
// Set energy thresholds
for(kz=0;kz<kncuts;kz++) {
if(cut[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]);
}
// Set transport mechanisms
for(kz=0;kz<knflags;kz++) {
if(flag[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]));
}
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
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
}
//_____________________________________________________________________________
-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 (i<fHeader.GetNprimary())
- entry = i+fHeader.GetNsecondary();
- else
- entry = i-fHeader.GetNprimary();
-
- // only check the algorithmic way and give
- // the fatal error if it is wrong
- if (entry != fParticleFileMap[i]) {
- Fatal("Particle",
- "!!!! The algorithmic way is WRONG: !!!\n entry: %d map: %d",
- entry, fParticleFileMap[i]);
- }
-
- fTreeK->GetEntry(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; i<fNtrack; i++) {
- // Preset map, to be removed later
- if(i<=fHgwmk) map[i]=i ;
- else {
- map[i] = -99;
- // particles.UncheckedAt(i)->ResetBit(kDaughtersBit);
- if((part=(TParticle*) particles.At(i))) part->ResetBit(kDaughtersBit);
- }
- }
- // Invalid daughter information for the parent of the first particle
- // generated. This may or may not be the current primary according to
- // whether decays have been recorded among the primaries
- part = (TParticle *)particles.At(fHgwmk+1);
- particles.At(part->GetFirstMother())->ResetBit(kDaughtersBit);
- // Second pass, build map between old and new numbering
- for(i=fHgwmk+1; i<fNtrack; i++) {
- if(particles.At(i)->TestBit(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; i<nkeep; i++) {
- part = (TParticle *)particles.At(i);
- parent = part->GetFirstMother();
- if(parent>=0) {
- father = (TParticle *)particles.At(parent);
- if(father->TestBit(kDaughtersBit)) {
-
- if(i<father->GetFirstDaughter()) 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; i<nkeep; ++i) {
- fParticleBuffer = (TParticle*) particles.At(i);
- fParticleFileMap[i]=(Int_t) fTreeK->GetEntries();
- fTreeK->Fill();
- particles[i]=0;
- }
-
- for (i=nkeep; i<fNtrack; ++i) particles[i]=0;
-
- fLoadPoint-=toshrink;
- for(i=fLoadPoint; i<fLoadPoint+toshrink; ++i) fParticles->RemoveAt(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) {
}
//
- 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);
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);
}
}
//_____________________________________________________________________________
// Create the Root Tree with one branch per detector
- MakeTree("ESD");
+ MakeTree("ESDR");
if (gSystem->Getenv("CONFIG_SPLIT_FILE")) {
MakeTree("K","Kine.root");
}
//_____________________________________________________________________________
-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; nevent<gAlice->TreeE()->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; nevent<gAlice->TreeE()->GetEntries(); nevent++) {
+ GetEvent(nevent);
+ // MakeTree("D");
+ Hits2SDigits(selected);
+ SDigits2Digits(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);
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());
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();
+ }
}
}
//
// Set current track number
//
- fCurrent = track;
+ fStack->SetCurrentTrack(track);
}
//_____________________________________________________________________________
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);
}
//_____________________________________________________________________________
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);
+
}
//_____________________________________________________________________________
{
//
// 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);
}
//_____________________________________________________________________________
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);
}
}
+
+//___________________________________________________________________________
+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();
+}
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};
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;
virtual void PreTrack();
virtual void PostTrack();
virtual void FinishPrimary();
+ virtual void BeginPrimary();
virtual void FinishEvent();
virtual void FinishRun();
virtual void FlagTrack(Int_t track);
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;
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();
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);}
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");
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
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
};
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$Log$
+*/
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Particles stack class
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include <iostream.h>
+
+#include <TObjArray.h>
+#include <TParticle.h>
+#include <TTree.h>
+#include <TFile.h>
+#include <TFolder.h>
+#include <TROOT.h>
+
+#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; i<fNtrack; i++) {
+ // Preset map, to be removed later
+ if(i<=fHgwmk) map[i]=i ;
+ else {
+ map[i] = -99;
+ // particles.UncheckedAt(i)->ResetBit(kDaughtersBit);
+ if((part=(TParticle*) particles.At(i))) part->ResetBit(kDaughtersBit);
+ }
+ }
+ // Invalid daughter information for the parent of the first particle
+ // generated. This may or may not be the current primary according to
+ // whether decays have been recorded among the primaries
+ part = (TParticle *)particles.At(fHgwmk+1);
+ particles.At(part->GetFirstMother())->ResetBit(kDaughtersBit);
+ // Second pass, build map between old and new numbering
+ for(i=fHgwmk+1; i<fNtrack; i++) {
+ if(particles.At(i)->TestBit(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; i<nkeep; i++) {
+ part = (TParticle *)particles.At(i);
+ parent = part->GetFirstMother();
+ if(parent>=0) {
+ father = (TParticle *)particles.At(parent);
+ if(father->TestBit(kDaughtersBit)) {
+
+ if(i<father->GetFirstDaughter()) 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; i<nkeep; ++i) {
+ fParticleBuffer = (TParticle*) particles.At(i);
+ fParticleFileMap[i]=(Int_t) fTreeK->GetEntries();
+ fTreeK->Fill();
+ particles[i]=0;
+ }
+
+ for (i=nkeep; i<fNtrack; ++i) particles[i]=0;
+
+ fLoadPoint-=toshrink;
+ for(i=fLoadPoint; i<fLoadPoint+toshrink; ++i) fParticles->RemoveAt(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; i<fHgwmk+1; ++i)
+ if((part=fParticleMap->At(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 (i<fNprimary)
+ entry = i+fNtrack-fNprimary;
+ else
+ entry = i-fNprimary;
+ // check whether algorithmic way and
+ // and the fParticleFileMap[i] give the same;
+ // give the fatal error if not
+ if (entry != fParticleFileMap[i]) {
+ Fatal("Particle",
+ "!! The algorithmic way and map are different: !!\n entry: %d map: %d",
+ entry, fParticleFileMap[i]);
+ }
+
+ fTreeK->GetEntry(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<fNtrack;i++)
+ {
+ TParticle* particle = Particle(i);
+ if (particle) {
+ printf("-> %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<fNtrack; i++)
+ printf(" %d th entry: %d \n",i,fParticleFileMap[i]);
+}
+
+
+//_____________________________________________________________________________
+void AliStack::DumpLoadedStack() const
+{
+ //
+ // Dumps the particle in the stack
+ // that are loaded in memory.
+ //
+
+ TObjArray &particles = *fParticleMap;
+ printf(
+ "\n\n=======================================================================\n");
+ for (Int_t i=0;i<fNtrack;i++)
+ {
+ TParticle* particle = (TParticle*) particles[i];
+ if (particle) {
+ printf("-> %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; i<fHgwmk+1; i++) {
+ part = (TParticle *)particles.At(i);
+ if(part) if(!part->TestBit(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);
+}
--- /dev/null
+#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 <TObject.h>
+#include <TArrayI.h>
+#include <TStopwatch.h>
+
+#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
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
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
#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
/*
$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
// 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");
+ }
}
/*
$Log$
+Revision 1.4 1999/09/29 09:24:30 fca
+Introduction of the Copyright and cvs Log
+
*/
///////////////////////////////////////////////////////////////////////////////
//
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");
+ }
}
/*
$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
: 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";
}
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
{
// 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;
// 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());
+ }
}
/*
$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
//
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");
+ }
}
//_____________________________________________________________________________
/*
$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
// 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");
+ }
}
/*
$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.
*/
//End_Html
- printf("Create PIPEvTemp geometry \n");
+ if(fDebug) printf("%s: Create PIPEv0 geometry \n",ClassName());
Int_t *idtmed = fIdtmed->GetArray();
// 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)
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+$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
+/*
+<img src="picts/pipe.gif">
+*/
+//End_Html
+
+
+//Begin_Html
+/*
+<img src="picts/tree_pipe.gif">
+*/
+//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;
+