void TFluka::InitPhysics()
{
-// Last material number taken from the "corealice.inp" file, presently 31
-// !!! it should be available from Flugg !!!
Int_t i, j, k;
Double_t fCut;
FGeometryInit* geominit = FGeometryInit::GetInstance();
y = GetYsco();
z = GetZsco();
}
- else if (caller == 4) { // mgdraw
- x = TRACKR.xtrack[TRACKR.ntrack];
- y = TRACKR.ytrack[TRACKR.ntrack];
- z = TRACKR.ztrack[TRACKR.ntrack];
- }
- else if (caller == 5) { // sodraw
+ else if (caller == 4 || caller == 5) { // mgdraw, sodraw
x = TRACKR.xtrack[TRACKR.ntrack];
y = TRACKR.ytrack[TRACKR.ntrack];
z = TRACKR.ztrack[TRACKR.ntrack];
{
// TRACKR.cmtrck = cumulative curved path since particle birth
Int_t caller = GetCaller();
- if (caller == 111 || caller==12 || caller == 3 || caller == 4 || caller == 6) //bxdraw,endraw,mgdraw,usdraw
+ if (caller == 11 || caller==12 || caller == 3 || caller == 4 || caller == 6) //bxdraw,endraw,mgdraw,usdraw
return TRACKR.cmtrck;
else
return -1.0;
Bool_t TFluka::IsNewTrack() const
{
// Return true for the first call of Stepping()
-/*
-// True if the track has positive cummulative length
- Int_t caller = GetCaller();
- if (caller != 2) { // not eedraw
- if (TRACKR.cmtrck > 0.0)
- return 1;
- else
- return 0;
- }
- else
- return 0;
-*/
return fTrackIsNew;
}
position.SetY(fYsco);
position.SetZ(fZsco);
position.SetT(TRACKR.atrack);
-// position.SetT(TRACKR.atrack+FINUC.agesec[isec]); //not yet implem.
momentum.SetPx(FINUC.plr[isec]*FINUC.cxr[isec]);
momentum.SetPy(FINUC.plr[isec]*FINUC.cyr[isec]);
momentum.SetPz(FINUC.plr[isec]*FINUC.czr[isec]);
position.SetY(fYsco);
position.SetZ(fZsco);
position.SetT(TRACKR.atrack);
-// position.SetT(TRACKR.atrack+FHEAVY.agheav[jsec]); //not yet implem.
momentum.SetPx(FHEAVY.pheavy[jsec]*FHEAVY.cxheav[jsec]);
momentum.SetPy(FHEAVY.pheavy[jsec]*FHEAVY.cyheav[jsec]);
momentum.SetPz(FHEAVY.pheavy[jsec]*FHEAVY.czheav[jsec]);
}
// ===============================================================
-void TFluka::FutoTest()
-{
- Int_t icode, mreg, newreg, particleId;
- Double_t rull, xsco, ysco, zsco;
- TLorentzVector position, momentum;
- icode = GetIcode();
- if (icode == 0) {
- if (fVerbosityLevel >=3)
- cout << " icode=" << icode << endl;
- } else if (icode > 0 && icode <= 5) {
-// mgdraw
- mreg = GetMreg();
- if (fVerbosityLevel >=3)
- cout << " icode=" << icode
- << " mreg=" << mreg
- << endl;
- TrackPosition(position);
- TrackMomentum(momentum);
- if (fVerbosityLevel >=3) {
- cout << "TLorentzVector positionX=" << position.X()
- << "positionY=" << position.Y()
- << "positionZ=" << position.Z()
- << "timeT=" << position.T() << endl;
- cout << "TLorentzVector momentumX=" << momentum.X()
- << "momentumY=" << momentum.Y()
- << "momentumZ=" << momentum.Z()
- << "energyE=" << momentum.E() << endl;
- cout << "TrackStep=" << TrackStep() << endl;
- cout << "TrackLength=" << TrackLength() << endl;
- cout << "TrackTime=" << TrackTime() << endl;
- cout << "Edep=" << Edep() << endl;
- cout << "TrackPid=" << TrackPid() << endl;
- cout << "TrackCharge=" << TrackCharge() << endl;
- cout << "TrackMass=" << TrackMass() << endl;
- cout << "Etot=" << Etot() << endl;
- cout << "IsNewTrack=" << IsNewTrack() << endl;
- cout << "IsTrackInside=" << IsTrackInside() << endl;
- cout << "IsTrackEntering=" << IsTrackEntering() << endl;
- cout << "IsTrackExiting=" << IsTrackExiting() << endl;
- cout << "IsTrackOut=" << IsTrackOut() << endl;
- cout << "IsTrackDisappeared=" << IsTrackDisappeared() << endl;
- cout << "IsTrackAlive=" << IsTrackAlive() << endl;
- }
-
- Float_t x = position.X();
- Float_t y = position.Y();
- Float_t z = position.Z();
- Float_t xm[3];
- Float_t xd[3];
- xm[0] = x; xm[1] = y; xm[2] = z;
- if (fVerbosityLevel >= 3)
- printf("Global trackPosition: %f %f %f \n", x, y, z);
- Gmtod(xm, xd, 1);
- if (fVerbosityLevel >= 3)
- printf("Local trackPosition: %f %f %f \n", xd[0], xd[1], xd[2]);
- Gdtom(xd, xm, 1);
- if (fVerbosityLevel >= 3)
- printf("New trackPosition: %f %f %f \n", xm[0], xm[1], xm[2]);
- } else if((icode >= 10 && icode <= 15) ||
- (icode >= 20 && icode <= 24) ||
- (icode >= 30 && icode <= 33) ||
- (icode >= 40 && icode <= 41) ||
- (icode >= 50 && icode <= 52)) {
-// endraw
- mreg = GetMreg();
- rull = GetRull();
- xsco = GetXsco();
- ysco = GetYsco();
- zsco = GetZsco();
-
- if (fVerbosityLevel >=3) {
- cout << " icode=" << icode
- << " mreg=" << mreg
- << " rull=" << rull
- << " xsco=" << xsco
- << " ysco=" << ysco
- << " zsco=" << zsco << endl;
- }
- TrackPosition(position);
- TrackMomentum(momentum);
- if (fVerbosityLevel >=3) {
- cout << "Edep=" << Edep() << endl;
- cout << "Etot=" << Etot() << endl;
- cout << "TrackPid=" << TrackPid() << endl;
- cout << "TrackCharge=" << TrackCharge() << endl;
- cout << "TrackMass=" << TrackMass() << endl;
- cout << "IsTrackOut=" << IsTrackOut() << endl;
- cout << "IsTrackDisappeared=" << IsTrackDisappeared() << endl;
- cout << "IsTrackStop=" << IsTrackStop() << endl;
- cout << "IsTrackAlive=" << IsTrackAlive() << endl;
- }
- } else if((icode >= 100 && icode <= 105) ||
- (icode == 208) ||
- (icode == 210) ||
- (icode == 212) ||
- (icode >= 214 && icode <= 215) ||
- (icode == 217) ||
- (icode == 219) ||
- (icode == 221) ||
- (icode == 225) ||
- (icode == 300) ||
- (icode == 400)) {
-// usdraw
- mreg = GetMreg();
- xsco = GetXsco();
- ysco = GetYsco();
- zsco = GetZsco();
-
- if (fVerbosityLevel >=3) {
- cout << " icode=" << icode
- << " mreg=" << mreg
- << " xsco=" << xsco
- << " ysco=" << ysco
- << " zsco=" << zsco << endl;
- cout << "TrackPid=" << TrackPid() << endl;
- cout << "NSecondaries=" << NSecondaries() << endl;
- }
-
- for (Int_t isec=0; isec< NSecondaries(); isec++) {
- TFluka::GetSecondary(isec, particleId, position, momentum);
- if (fVerbosityLevel >=3) {
- cout << "TLorentzVector positionX=" << position.X()
- << "positionY=" << position.Y()
- << "positionZ=" << position.Z()
- << "timeT=" << position.T() << endl;
- cout << "TLorentzVector momentumX=" << momentum.X()
- << "momentumY=" << momentum.Y()
- << "momentumZ=" << momentum.Z()
- << "energyE=" << momentum.E() << endl;
- cout << "TrackPid=" << particleId << endl;
- }
- }
- } else if((icode == 19) ||
- (icode == 29) ||
- (icode == 39) ||
- (icode == 49) ||
- (icode == 59)) {
- mreg = GetMreg();
- newreg = GetNewreg();
- xsco = GetXsco();
- ysco = GetYsco();
- zsco = GetZsco();
- if (fVerbosityLevel >=3) {
- cout << " icode=" << icode
- << " mreg=" << mreg
- << " newreg=" << newreg
- << " xsco=" << xsco
- << " ysco=" << ysco
- << " zsco=" << zsco << endl;
- }
- }
-} // end of FutoTest
-
void SetTrackIsExiting() {fTrackIsExiting = kTRUE; fTrackIsEntering = kFALSE;}
void SetTrackIsInside() {fTrackIsExiting = kFALSE; fTrackIsEntering = kFALSE;}
void SetTrackIsNew(Bool_t flag=kTRUE) {fTrackIsNew = flag;}
- //
- // test
- // ------------------------------------------------
- //
- virtual void FutoTest() ;
private:
TFluka(const TFluka &mc): TVirtualMC(mc) {;}
TFluka & operator=(const TFluka &) {return (*this);}
-
+
protected:
Int_t fVerbosityLevel; //Verbosity level (0 lowest - 3 highest)
-
+
TString sInputFileName; //Name of the real input file (e.g. alice.inp)
TString sCoreInputFileName; //Name of the input file (e.g. corealice.inp)
-
+
Int_t fCaller; //Parameter to indicate who is the caller of the Fluka Draw
- Int_t fIcode; //Fluka Draw procedures formal parameter
+ Int_t fIcode; //Fluka Draw procedures formal parameter
Int_t iNewreg; //Fluka Draw procedures formal parameter
Double_t fRull; //Fluka Draw procedures formal parameter
Double_t fXsco; //Fluka Draw procedures formal parameter
Double_t fYsco; //Fluka Draw procedures formal parameter
Double_t fZsco; //Fluka Draw procedures formal parameter
Bool_t fTrackIsEntering; // Flag for track entering
- Bool_t fTrackIsExiting; // Flag for track exiting
+ Bool_t fTrackIsExiting; // Flag for track exiting
Bool_t fTrackIsNew; // Flag for new track
+
//variables for SetProcess and SetCut
Int_t iNbOfProc;
Int_t iProcessValue[100];
Int_t iNbOfCut;
Double_t fCutValue[100];
Char_t sCutFlag[100][7];
-
-
+
//Geometry through Geant4 for the time being!!!
- TG4GeometryManager* fGeometryManager; //Geometry manager
- TG4DetConstruction* fDetector; //Detector
-
- TClonesArray* fVolumeMediaMap; //!Transient list of volumes
Int_t fNVolumes; //!Current number of volumes
- Int_t* fMediaByRegion; //!Media by Fluka region
-
-
- Int_t fCurrentFlukaRegion; //Index of fluka region at each step
+ Int_t fCurrentFlukaRegion; //Index of fluka region at each step TFlukaMCGeometry *fGeom; // TGeo-FLUKA interface
+
ClassDef(TFluka,1) //C++ interface to Fluka montecarlo
};
//______________________________________________________________________________
void TFluka::InitPhysics()
{
-// Last material number taken from the "corealice.inp" file, presently 31
-// !!! it should be available from Flugg !!!
Int_t i, j, k;
Double_t fCut;
Float_t fLastMaterial = fGeom->GetLastMaterialIndex();
y = GetYsco();
z = GetZsco();
}
- else if (caller == 4) { // mgdraw
- x = TRACKR.xtrack[TRACKR.ntrack];
- y = TRACKR.ytrack[TRACKR.ntrack];
- z = TRACKR.ztrack[TRACKR.ntrack];
- }
- else if (caller == 5) { // sodraw
+ else if (caller == 4 || caller == 5) { // mgdraw, sodraw
x = TRACKR.xtrack[TRACKR.ntrack];
y = TRACKR.ytrack[TRACKR.ntrack];
z = TRACKR.ztrack[TRACKR.ntrack];
Bool_t TFluka::IsNewTrack() const
{
// Return true for the first call of Stepping()
-/*
-// True if the track has positive cummulative length
- Int_t caller = GetCaller();
- if (caller != 2) { // not eedraw
- if (TRACKR.cmtrck > 0.0)
- return 1;
- else
- return 0;
- }
- else
- return 0;
-*/
return fTrackIsNew;
}
position.SetY(fYsco);
position.SetZ(fZsco);
position.SetT(TRACKR.atrack);
-// position.SetT(TRACKR.atrack+FINUC.agesec[isec]); //not yet implem.
momentum.SetPx(FINUC.plr[isec]*FINUC.cxr[isec]);
momentum.SetPy(FINUC.plr[isec]*FINUC.cyr[isec]);
momentum.SetPz(FINUC.plr[isec]*FINUC.czr[isec]);
position.SetY(fYsco);
position.SetZ(fZsco);
position.SetT(TRACKR.atrack);
-// position.SetT(TRACKR.atrack+FHEAVY.agheav[jsec]); //not yet implem.
momentum.SetPx(FHEAVY.pheavy[jsec]*FHEAVY.cxheav[jsec]);
momentum.SetPy(FHEAVY.pheavy[jsec]*FHEAVY.cyheav[jsec]);
momentum.SetPz(FHEAVY.pheavy[jsec]*FHEAVY.czheav[jsec]);
fGeom->SetMreg(l);
}
-// ===============================================================
-void TFluka::FutoTest()
-{
- Int_t icode, mreg, newreg, particleId;
- Double_t rull, xsco, ysco, zsco;
- TLorentzVector position, momentum;
- icode = GetIcode();
- if (icode == 0) {
- if (fVerbosityLevel >=3)
- cout << " icode=" << icode << endl;
- } else if (icode > 0 && icode <= 5) {
-// mgdraw
- mreg = GetMreg();
- if (fVerbosityLevel >=3)
- cout << " icode=" << icode
- << " mreg=" << mreg
- << endl;
- TrackPosition(position);
- TrackMomentum(momentum);
- if (fVerbosityLevel >=3) {
- cout << "TLorentzVector positionX=" << position.X()
- << "positionY=" << position.Y()
- << "positionZ=" << position.Z()
- << "timeT=" << position.T() << endl;
- cout << "TLorentzVector momentumX=" << momentum.X()
- << "momentumY=" << momentum.Y()
- << "momentumZ=" << momentum.Z()
- << "energyE=" << momentum.E() << endl;
- cout << "TrackStep=" << TrackStep() << endl;
- cout << "TrackLength=" << TrackLength() << endl;
- cout << "TrackTime=" << TrackTime() << endl;
- cout << "Edep=" << Edep() << endl;
- cout << "TrackPid=" << TrackPid() << endl;
- cout << "TrackCharge=" << TrackCharge() << endl;
- cout << "TrackMass=" << TrackMass() << endl;
- cout << "Etot=" << Etot() << endl;
- cout << "IsNewTrack=" << IsNewTrack() << endl;
- cout << "IsTrackInside=" << IsTrackInside() << endl;
- cout << "IsTrackEntering=" << IsTrackEntering() << endl;
- cout << "IsTrackExiting=" << IsTrackExiting() << endl;
- cout << "IsTrackOut=" << IsTrackOut() << endl;
- cout << "IsTrackDisappeared=" << IsTrackDisappeared() << endl;
- cout << "IsTrackAlive=" << IsTrackAlive() << endl;
- }
-
- Float_t x = position.X();
- Float_t y = position.Y();
- Float_t z = position.Z();
- Float_t xm[3];
- Float_t xd[3];
- xm[0] = x; xm[1] = y; xm[2] = z;
- if (fVerbosityLevel >= 3)
- printf("Global trackPosition: %f %f %f \n", x, y, z);
- Gmtod(xm, xd, 1);
- if (fVerbosityLevel >= 3)
- printf("Local trackPosition: %f %f %f \n", xd[0], xd[1], xd[2]);
- Gdtom(xd, xm, 1);
- if (fVerbosityLevel >= 3)
- printf("New trackPosition: %f %f %f \n", xm[0], xm[1], xm[2]);
- } else if((icode >= 10 && icode <= 15) ||
- (icode >= 20 && icode <= 24) ||
- (icode >= 30 && icode <= 33) ||
- (icode >= 40 && icode <= 41) ||
- (icode >= 50 && icode <= 52)) {
-// endraw
- mreg = GetMreg();
- rull = GetRull();
- xsco = GetXsco();
- ysco = GetYsco();
- zsco = GetZsco();
-
- if (fVerbosityLevel >=3) {
- cout << " icode=" << icode
- << " mreg=" << mreg
- << " rull=" << rull
- << " xsco=" << xsco
- << " ysco=" << ysco
- << " zsco=" << zsco << endl;
- }
- TrackPosition(position);
- TrackMomentum(momentum);
- if (fVerbosityLevel >=3) {
- cout << "Edep=" << Edep() << endl;
- cout << "Etot=" << Etot() << endl;
- cout << "TrackPid=" << TrackPid() << endl;
- cout << "TrackCharge=" << TrackCharge() << endl;
- cout << "TrackMass=" << TrackMass() << endl;
- cout << "IsTrackOut=" << IsTrackOut() << endl;
- cout << "IsTrackDisappeared=" << IsTrackDisappeared() << endl;
- cout << "IsTrackStop=" << IsTrackStop() << endl;
- cout << "IsTrackAlive=" << IsTrackAlive() << endl;
- }
- } else if((icode >= 100 && icode <= 105) ||
- (icode == 208) ||
- (icode == 210) ||
- (icode == 212) ||
- (icode >= 214 && icode <= 215) ||
- (icode == 217) ||
- (icode == 219) ||
- (icode == 221) ||
- (icode == 225) ||
- (icode == 300) ||
- (icode == 400)) {
-// usdraw
- mreg = GetMreg();
- xsco = GetXsco();
- ysco = GetYsco();
- zsco = GetZsco();
-
- if (fVerbosityLevel >=3) {
- cout << " icode=" << icode
- << " mreg=" << mreg
- << " xsco=" << xsco
- << " ysco=" << ysco
- << " zsco=" << zsco << endl;
- cout << "TrackPid=" << TrackPid() << endl;
- cout << "NSecondaries=" << NSecondaries() << endl;
- }
-
- for (Int_t isec=0; isec< NSecondaries(); isec++) {
- TFluka::GetSecondary(isec, particleId, position, momentum);
- if (fVerbosityLevel >=3) {
- cout << "TLorentzVector positionX=" << position.X()
- << "positionY=" << position.Y()
- << "positionZ=" << position.Z()
- << "timeT=" << position.T() << endl;
- cout << "TLorentzVector momentumX=" << momentum.X()
- << "momentumY=" << momentum.Y()
- << "momentumZ=" << momentum.Z()
- << "energyE=" << momentum.E() << endl;
- cout << "TrackPid=" << particleId << endl;
- }
- }
- } else if((icode == 19) ||
- (icode == 29) ||
- (icode == 39) ||
- (icode == 49) ||
- (icode == 59)) {
- mreg = GetMreg();
- newreg = GetNewreg();
- xsco = GetXsco();
- ysco = GetYsco();
- zsco = GetZsco();
- if (fVerbosityLevel >=3) {
- cout << " icode=" << icode
- << " mreg=" << mreg
- << " newreg=" << newreg
- << " xsco=" << xsco
- << " ysco=" << ysco
- << " zsco=" << zsco << endl;
- }
- }
-} // end of FutoTest
-
void SetTrackIsInside() {fTrackIsExiting = kFALSE; fTrackIsEntering = kFALSE;}
void SetTrackIsNew(Bool_t flag=kTRUE) {fTrackIsNew = flag;}
- //
- // test
- // ------------------------------------------------
- //
- virtual void FutoTest() ;
private:
TFluka(const TFluka &mc): TVirtualMC(mc) {;}