gSystem->Load("libGeom");
cout << "\t* Loading TFluka..." << endl;
gSystem->Load("libTFluka");
-
+ gSystem->MakeDirectory("peg");
//
// FLUKA MC
//
((TFluka*)gMC)->SetGeneratePemf(kFALSE);
else
((TFluka*)gMC)->SetGeneratePemf(kTRUE);
+ TString neuxsc(gSystem->Which(".", "neuxsc.bin"));
+ if (neusxc->IsNull()) {
+ gSystem->Link("$(FLUPRO)/neuxsc.bin", "neuxsc.bin");
+ }
+ gSystem->CopyFile("$(FLUPRO)/random.dat", "old.seed", kTRUE);
}
break;
}
#pragma link C++ class AliFMDInputHits;
#pragma link C++ class AliFMDInputDigits;
#pragma link C++ class AliFMDInputSDigits;
+#pragma link C++ class AliFMDInputRecPoints;
#else
# error Not for compilation
sim.SetConfigFile("$(ALICE_ROOT)/FMD/Config.C");
// sim.SetMakeSDigits("FMD");
sim.SetMakeDigits("FMD");
- sim.SetWriteRawData("FMD");
+ // sim.SetWriteRawData("FMD");
// sim.SetMakeDigitsFromHits("FMD");
- sim.Run(1);
+ TStopwatch w;
+ w.Start();
+ sim.Run(10);
+ w.Stop();
+ w.Print();
}
//
#include <AliFMDInput.h>
#include <iostream>
#include <TStyle.h>
+#include <TArrayF.h>
class DrawHits : public AliFMDInputHits
{
public:
DrawHits()
{
- fElossVsPMQ = new TH2D("bad", "#Delta E vs. p/(mq^{2})>1GeV",
- 1000, 1, 100, 50, 0.00001, 10);
- fElossVsPMQ->SetXTitle("p/(mq^{2}) [GeV/GeV]");
+ Double_t emax = 1e4;
+ Double_t emin = 1e-5;
+ Int_t n = 901;
+ TArrayF tkine(n);
+ Float_t dp = 1/TMath::Log10(emax/emin)/10;
+ Float_t pmin = TMath::Log10(emin);
+ tkine[0] = emin;
+ for (Int_t i=1; i < tkine.fN; i++) {
+ Float_t el = pmin + i * dp;
+ tkine[i] = TMath::Power(10, el);
+ }
+ Double_t dmin = .1;
+ Double_t dmax = 10;
+ Int_t nd = 1000;
+ TArrayF eloss(nd+1);
+ eloss[0] = dmin;
+ for (Int_t i = 1; i < eloss.fN; i++){
+ eloss[i] = dmin + i * (dmax-dmin)/(eloss.fN-1);
+ }
+ fElossVsPMQ = new TH2D("bad", "#Delta E vs. p/(mq^{2})",
+ tkine.fN-1, tkine.fArray, eloss.fN-1, eloss.fArray);
+ fElossVsPMQ->SetXTitle("p/(mq^{2})");
fElossVsPMQ->SetYTitle("#Delta E [MeV]");
}
Bool_t ProcessHit(AliFMDHit* hit, TParticle*)
std::cout << "No hit" << std::endl;
return kFALSE;
}
- Float_t pmq = 0;
- if (hit->M() != 0 && hit->Q() != 0)
- pmq = hit->P() / hit->M() / TMath::Power(hit->Q()/3, 2);
+ if (TMath::Abs(hit->Pdg()) != 211) return kTRUE;
+ // Float_t pmq = 0;
+ // Float_t q = hit->Q() / 3.;
+ // if (hit->M() != 0 && hit->Q() != 0)
+ // pmq = hit->P() / (hit->M()*q*q);
+ Float_t pmq = hit->P();
fElossVsPMQ->Fill(pmq, hit->Edep());
return kTRUE;
}
Bool_t Finish()
{
gStyle->SetPalette(1);
+ gStyle->SetOptTitle(0);
fElossVsPMQ->SetStats(kFALSE);
fElossVsPMQ->Draw("COLZ");
return kTRUE;
void
-DrawXsection(const char* file="xsec.root",
+DrawXsection(const char* filename="xsec.root",
const char* var="LOSS",
const char* medName="FMD_Si$",
Double_t thick=.03,
const char* pdgName="pi+")
{
- TFile* file = TFile::Open("xsec.root", "READ");
+ TFile* file = TFile::Open(filename, "READ");
TTree* tree = static_cast<TTree*>(file->Get(Form("%s_%s",medName,
pdgName)));
TLeaf* tb = tree->GetLeaf("T");
std::cerr << "Couldn't find particle " << pdgName << std::endl;
return;
}
- Double_t m = pdgP->Mass();
- Double_t q = pdgP->Charge() / 3;
- if (m == 0) {
- std::cerr << "Mass is 0" << std::endl;
- return;
- }
+ // Double_t m = pdgP->Mass();
+ // Double_t q = pdgP->Charge() / 3;
+ // std::cout << q << "\t" << m << std::endl;
+ // if (m == 0) {
+ /// std::cerr << "Mass is 0" << std::endl;
+ // return;
+ // }
TGraph* graph = new TGraph(n);
for (Int_t i = 0; i < n; i++) {
tree->GetEntry(i);
- graph->SetPoint(i, tkine/m/q/q, value*thick);
+ graph->SetPoint(i, tkine, value*thick); // /(m*q*q)
}
- graph->Draw("ALP");
+ graph->Draw("LP same");
}
//____________________________________________________________________
void
MakeXsection()
{
- gROOT->ProcessLine(".x Compile.C(\"$ALICE_ROOT/FMD/scripts/GetSection.C\"");
+ gROOT->ProcessLine(".x Compile.C(\"$(ALICE_ROOT)/FMD/scripts/GetXsection.C\"");
gAlice->InitMC("$(ALICE_ROOT)/FMD/Config.C");
TFile* file = TFile::Open("xsec.root", "RECREATE");
GetXsection("FMD_Si$", "pi+");
+++ /dev/null
-#!/bin/bash
-CURDIR=`pwd`
-cd $ALICE_ROOT
-echo 'Making sure that TFluka is up to date...'
-make all-TFluka
-cd $CURDIR
-
-# Make working directory
-rm -rf fluka
-mkdir -p fluka
-cd fluka
-
-# Make a peg directory
-mkdir -p peg
-
-# Link here some special Fluka files needed
-ln -s $FLUPRO/xnloan.dat .
-ln -s $FLUPRO/sigmapi.bin .
-ln -s $FLUPRO/nuclear.bin .
-ln -s $FLUPRO/neuxsc_72.bin neuxsc.bin
-ln -s $FLUPRO/fluodt.dat .
-ln -s $FLUPRO/elasct.bin .
-
-# Copy the random seed
-cp $FLUPRO/random.dat old.seed
-
-# Give some meaningfull name to the output
-ln -s fluka.out fort.11
-
-# Link the pemf and input file for alice
-# This is wrong:
-# ln -s $ALICE_ROOT/TFluka/input/FlukaVmc.pemf .
-# Maybe
-cp $ALICE_ROOT/TFluka/input/alice.pemf FlukaVmc.pemf
-
-#Link FlukaConfig.C as Config.C
-cp $ALICE_ROOT/FMD/scripts/ConfigInner.C .
-cp $ALICE_ROOT/.rootrc .
-# echo 'Execute: gAlice->Init() OR gAlice->RunMC() at the ROOT prompt'
-# Launch aliroot
-aliroot -l # -b -q ../runIt.C > run.log 2>&1
-
-cd $CURDIR
-# ____________________________________________________________________
-#
-# EOF
-#
+++ /dev/null
-#!/bin/bash
-CURDIR=`pwd`
-cd $ALICE_ROOT
-echo 'Making sure that AliROOT is up to date...'
-make
-cd $CURDIR
-
-# Make working directory
-rm -rf geant321
-mkdir -p geant321
-cd geant321
-
-
-#Link FlukaConfig.C as Config.C
-cp $ALICE_ROOT/FMD/Config.C .
-cp $ALICE_ROOT/.rootrc .
-# echo 'Execute: gAlice->Init() OR gAlice->RunMC() at the ROOT prompt'
-# Launch aliroot
-aliroot -l -b -q ../runIt.C > run.log 2>&1
-
-cd $CURDIR
-# ____________________________________________________________________
-#
-# EOF
-#