Commit 33924ff1 authored by Cornelius Feier-Riesen's avatar Cornelius Feier-Riesen Committed by Volker Friese
Browse files

Update lmvm

parent 30ae7a91
...@@ -294,7 +294,9 @@ CbmAnaDielectronTask::CbmAnaDielectronTask() ...@@ -294,7 +294,9 @@ CbmAnaDielectronTask::CbmAnaDielectronTask()
, fh_piprim_plus_rapidity_mc(NULL) , fh_piprim_plus_rapidity_mc(NULL)
, fh_piprim_minus_rapidity_mc(NULL) , fh_piprim_minus_rapidity_mc(NULL)
, fh_pi0prim_rapidity_mc(NULL) , fh_pi0prim_rapidity_mc(NULL)
, fh_etaprim_rapidity_mc(NULL) { , fh_etaprim_rapidity_mc(NULL)
, fh_mom_likelihood_El(NULL)
, fh_mom_likelihood_Pi(NULL) {
// weight for rho0 = 0.001081; omega_ee = 0.0026866; omega_dalitz = 0.02242; phi = 0.00039552; pi0 = 4.38 ------ Au + Au, for 25 GeV central collision // weight for rho0 = 0.001081; omega_ee = 0.0026866; omega_dalitz = 0.02242; phi = 0.00039552; pi0 = 4.38 ------ Au + Au, for 25 GeV central collision
fWeight = 0.0; fWeight = 0.0;
fUseRich = true; fUseRich = true;
...@@ -306,8 +308,10 @@ CbmAnaDielectronTask::CbmAnaDielectronTask() ...@@ -306,8 +308,10 @@ CbmAnaDielectronTask::CbmAnaDielectronTask()
fCuts.SetDefaultCuts(); fCuts.SetDefaultCuts();
} }
CbmAnaDielectronTask::~CbmAnaDielectronTask() {} CbmAnaDielectronTask::~CbmAnaDielectronTask() {}
void CbmAnaDielectronTask::InitHists() { void CbmAnaDielectronTask::InitHists() {
fHistoList.clear(); fHistoList.clear();
...@@ -1016,6 +1020,29 @@ void CbmAnaDielectronTask::InitHists() { ...@@ -1016,6 +1020,29 @@ void CbmAnaDielectronTask::InitHists() {
-0.5, -0.5,
2.5); 2.5);
fHistoList.push_back(fh_nof_rec_pi0); fHistoList.push_back(fh_nof_rec_pi0);
//Occurency vs Likelihood and Momentum
fh_mom_likelihood_El =
new TH2D("fh_mom_likelihood_El",
"fh_mom_likelihood_El;p [GeV/c]; likelihood electron; counter",
100,
0.,
6.,
100,
0.,
1.);
fh_mom_likelihood_Pi =
new TH2D("fh_mom_likelihood_Pi",
"fh_mom_likelihood_Pi;p [GeV/c]; likelihood pion; counter",
100,
0.,
6.,
100,
0.,
1.);
fHistoList.push_back(fh_mom_likelihood_El);
fHistoList.push_back(fh_mom_likelihood_Pi);
} }
InitStatus CbmAnaDielectronTask::Init() { InitStatus CbmAnaDielectronTask::Init() {
...@@ -1193,9 +1220,46 @@ void CbmAnaDielectronTask::Exec(Option_t*) { ...@@ -1193,9 +1220,46 @@ void CbmAnaDielectronTask::Exec(Option_t*) {
SignalAndBgReco(); SignalAndBgReco();
FillElPiMomHist(); FillElPiMomHist();
FillNofChargedParticlesPerEvent(); FillNofChargedParticlesPerEvent();
FillMomLikeHist();
} }
} // Exec } // Exec
void CbmAnaDielectronTask::FillMomLikeHist() {
Int_t ngTracks = fGlobalTracks->GetEntriesFast();
for (int i = 0; i < ngTracks; i++) {
CbmGlobalTrack* gTrack = (CbmGlobalTrack*) fGlobalTracks->At(i);
if (NULL == gTrack) continue;
// getting TRD index and likelihood value
int trdInd = gTrack->GetTrdTrackIndex();
if (trdInd < 0) continue;
CbmTrdTrack* trdTrack = (CbmTrdTrack*) fTrdTracks->At(trdInd);
if (NULL == trdTrack) continue;
double_t likelihoodEl = trdTrack->GetPidLikeEL();
double_t likelihoodPi = trdTrack->GetPidLikePI();
// getting momentum via matching STS track with corresponding MC track
int stsInd = gTrack->GetStsTrackIndex();
if (stsInd < 0) continue;
CbmStsTrack* stsTrack = (CbmStsTrack*) fStsTracks->At(stsInd);
if (stsTrack == NULL) continue;
CbmTrackMatchNew* stsMatch =
(CbmTrackMatchNew*) fStsTrackMatches->At(stsInd);
if (stsMatch == NULL) continue;
if (stsMatch->GetNofLinks() == 0) continue; // what is this for?
int stsMcTrackId = stsMatch->GetMatchedLink().GetIndex();
if (stsMcTrackId < 0) continue;
CbmMCTrack* mcTrack1 = (CbmMCTrack*) fMCTracks->At(stsMcTrackId);
if (mcTrack1 == NULL) continue;
double momentum = mcTrack1->GetP(); // momentum of MC track
fh_mom_likelihood_El->Fill(momentum, likelihoodEl);
fh_mom_likelihood_Pi->Fill(momentum, likelihoodPi);
}
}
void CbmAnaDielectronTask::FillRichRingNofHits() { void CbmAnaDielectronTask::FillRichRingNofHits() {
fNofHitsInRingMap.clear(); fNofHitsInRingMap.clear();
Int_t nofRichHits = fRichHits->GetEntriesFast(); Int_t nofRichHits = fRichHits->GetEntriesFast();
...@@ -1342,7 +1406,7 @@ void CbmAnaDielectronTask::FillNofChargedParticlesPerEvent() { ...@@ -1342,7 +1406,7 @@ void CbmAnaDielectronTask::FillNofChargedParticlesPerEvent() {
for (Int_t i = 0; i < nofMcTracks; i++) { for (Int_t i = 0; i < nofMcTracks; i++) {
CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTracks->At(i); CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTracks->At(i);
Bool_t isMcTrackCharged = false; Bool_t isMcTrackCharged = false;
if (mcTrack->GetCharge() != 0) isMcTrackCharged = true; //if (mcTrack->GetCharge() != 0) isMcTrackCharged = true; // FIXME: TODO: uncomment when bug is fixed; issue https://lxcbmredmine01.gsi.de/issues/1826;
Bool_t isMcSignalElectron = CbmLmvmUtils::IsMcSignalElectron(mcTrack); Bool_t isMcSignalElectron = CbmLmvmUtils::IsMcSignalElectron(mcTrack);
Bool_t isMcTrackAccepted = false; Bool_t isMcTrackAccepted = false;
if (mcTrack->GetNPoints(ECbmModuleId::kSts) >= 4) isMcTrackAccepted = true; if (mcTrack->GetNPoints(ECbmModuleId::kSts) >= 4) isMcTrackAccepted = true;
......
...@@ -239,6 +239,9 @@ public: ...@@ -239,6 +239,9 @@ public:
void MvdCutMcDistance(); void MvdCutMcDistance();
// Likelihood vs Momentum
void FillMomLikeHist();
virtual void Finish(); virtual void Finish();
void FillElPiMomHist(); void FillElPiMomHist();
...@@ -470,6 +473,10 @@ private: ...@@ -470,6 +473,10 @@ private:
TH1D* fh_pi0prim_rapidity_mc; TH1D* fh_pi0prim_rapidity_mc;
TH1D* fh_etaprim_rapidity_mc; TH1D* fh_etaprim_rapidity_mc;
// Likelihood vs Momentum
TH2D* fh_mom_likelihood_El;
TH2D* fh_mom_likelihood_Pi;
public: public:
void SetUseMvd(Bool_t use) { fUseMvd = use; }; void SetUseMvd(Bool_t use) { fUseMvd = use; };
void SetUseRich(Bool_t use) { fUseRich = use; }; void SetUseRich(Bool_t use) { fUseRich = use; };
......
...@@ -62,8 +62,8 @@ void CbmAnaDielectronTaskDraw::DrawHistFromFile(const string& fileName, ...@@ -62,8 +62,8 @@ void CbmAnaDielectronTaskDraw::DrawHistFromFile(const string& fileName,
fHM = new CbmHistManager(); fHM = new CbmHistManager();
TFile* file = new TFile(fileName.c_str()); TFile* file = new TFile(fileName.c_str());
fHM->ReadFromFile(file); fHM->ReadFromFile(file);
fNofEvents = (Int_t) H1("fh_event_number")->GetEntries(); fNofEvents = (Int_t) H1("fh_event_number")->GetEntries();
//fNofEvents = 10000;
cout << "File name = " << fileName << endl; cout << "File name = " << fileName << endl;
cout << "Number of events = " << fNofEvents << endl; cout << "Number of events = " << fNofEvents << endl;
...@@ -92,10 +92,21 @@ void CbmAnaDielectronTaskDraw::DrawHistFromFile(const string& fileName, ...@@ -92,10 +92,21 @@ void CbmAnaDielectronTaskDraw::DrawHistFromFile(const string& fileName,
DrawMvdAndStsHist(); DrawMvdAndStsHist();
DrawElPiMomHis(); DrawElPiMomHis();
DrawPmtXY(); DrawPmtXY();
DrawMomLikeHist();
SaveCanvasToImage(); SaveCanvasToImage();
} }
void CbmAnaDielectronTaskDraw::DrawMomLikeHist() {
TCanvas* c =
fHM->CreateCanvas("lmvm_mom_likelihood", "lmvm_mom_likelihood", 1000, 500);
c->Divide(2, 1);
c->cd(1);
DrawH2(H2("fh_mom_likelihood_El"));
c->cd(2);
DrawH2(H2("fh_mom_likelihood_Pi"));
}
void CbmAnaDielectronTaskDraw::RebinMinvHist() { void CbmAnaDielectronTaskDraw::RebinMinvHist() {
int nRebin = 10; int nRebin = 10;
for (int i = 0; i < CbmLmvmHist::fNofAnaSteps; i++) { for (int i = 0; i < CbmLmvmHist::fNofAnaSteps; i++) {
...@@ -462,11 +473,12 @@ void CbmAnaDielectronTaskDraw::Draw1DCut(const string& hName, ...@@ -462,11 +473,12 @@ void CbmAnaDielectronTaskDraw::Draw1DCut(const string& hName,
} }
void CbmAnaDielectronTaskDraw::DrawCutDistributions() { void CbmAnaDielectronTaskDraw::DrawCutDistributions() {
Draw1DCut("fh_richann", //Draw1DCut("fh_richann", "left", CbmLitGlobalElectronId::GetInstance().GetRichAnnCut());
"left", //Draw1DCut("fh_trdann", "left", CbmLitGlobalElectronId::GetInstance().GetTrdAnnCut());
CbmLitGlobalElectronId::GetInstance().GetRichAnnCut());
Draw1DCut( Draw1DCut("fh_richann", "left", -0.4);
"fh_trdann", "left", CbmLitGlobalElectronId::GetInstance().GetTrdAnnCut()); Draw1DCut("fh_trdann", "left", 0.85);
Draw2DCut("fh_tofm2"); Draw2DCut("fh_tofm2");
Draw1DCut("fh_chi2prim", "right", fCuts.fChiPrimCut); Draw1DCut("fh_chi2prim", "right", fCuts.fChiPrimCut);
......
...@@ -249,6 +249,9 @@ private: ...@@ -249,6 +249,9 @@ private:
void DrawPmtXY(); void DrawPmtXY();
// Draw Likelihood vs Momentum
void DrawMomLikeHist();
CbmAnaDielectronTaskDraw(const CbmAnaDielectronTaskDraw&); CbmAnaDielectronTaskDraw(const CbmAnaDielectronTaskDraw&);
CbmAnaDielectronTaskDraw& operator=(const CbmAnaDielectronTaskDraw&); CbmAnaDielectronTaskDraw& operator=(const CbmAnaDielectronTaskDraw&);
......
...@@ -461,9 +461,8 @@ void CbmAnaDielectronTaskDrawAll::DrawMinvPt(CbmLmvmAnalysisSteps step) { ...@@ -461,9 +461,8 @@ void CbmAnaDielectronTaskDrawAll::DrawMinvPt(CbmLmvmAnalysisSteps step) {
TH2D* sPhi = TH2D* sPhi =
(TH2D*) H2(kPhi, "fh_signal_minv_pt_" + CbmLmvmHist::fAnaSteps[step]) (TH2D*) H2(kPhi, "fh_signal_minv_pt_" + CbmLmvmHist::fAnaSteps[step])
->Clone(); ->Clone();
TH2D* sEta = fh_mean_eta_minv_pt[step]; TH2D* sEta = fh_mean_eta_minv_pt[step];
TH2D* sPi0 = fh_mean_pi0_minv_pt[step]; TH2D* sPi0 = fh_mean_pi0_minv_pt[step];
TH2D* coctail = (TH2D*) sInmed->Clone(); TH2D* coctail = (TH2D*) sInmed->Clone();
if (fDrawQgp) coctail->Add(sQgp); if (fDrawQgp) coctail->Add(sQgp);
coctail->Add(sOmega); coctail->Add(sOmega);
...@@ -471,7 +470,6 @@ void CbmAnaDielectronTaskDrawAll::DrawMinvPt(CbmLmvmAnalysisSteps step) { ...@@ -471,7 +470,6 @@ void CbmAnaDielectronTaskDrawAll::DrawMinvPt(CbmLmvmAnalysisSteps step) {
coctail->Add(sOmegaDalitz); coctail->Add(sOmegaDalitz);
coctail->Add(sEta); coctail->Add(sEta);
coctail->Add(sPi0); coctail->Add(sPi0);
DrawH2(coctail); DrawH2(coctail);
} }
......
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os # operating system interfaces
import sys import sys # provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter
import shutil import shutil # offers a number of high-level operations on files and collections of files
def main(): def main():
dataDir = sys.argv[1] dataDir = sys.argv[1]
geoSetup = sys.argv[2] geoSetup = sys.argv[2]
plutoParticle = sys.argv[3] plutoParticle = sys.argv[3]
cbmrootConfigPath = "/lustre/nyx/cbm/users/slebedev/cbm/trunk/build/config.sh" cbmrootConfigPath = "/lustre/nyx/cbm/users/criesen/build/config.sh"
macroDir = "/lustre/nyx/cbm/users/slebedev/cbm/trunk/cbmroot/macro/analysis/dielectron/" macroDir = "/lustre/nyx/cbm/users/criesen/cbmroot/macro/analysis/dielectron/"
nofEvents = 1000 nofEvents = 1000
taskId = os.environ.get('SLURM_ARRAY_TASK_ID') taskId = os.environ.get('SLURM_ARRAY_TASK_ID')
jobId = os.environ.get('SLURM_ARRAY_JOB_ID')
jobId = os.environ.get('SLURM_ARRAY_JOB_ID')
colEnergy = "8gev"
colSystem = "auau"
print("dataDir:" + dataDir) print("dataDir:" + dataDir)
os.system(("source {}").format(cbmrootConfigPath)) os.system(("source {}").format(cbmrootConfigPath))
...@@ -22,12 +25,15 @@ def main(): ...@@ -22,12 +25,15 @@ def main():
workDir = dataDir + "/workdir/" + jobId + "_" + taskId + "/" workDir = dataDir + "/workdir/" + jobId + "_" + taskId + "/"
if os.path.exists(workDir): if os.path.exists(workDir):
shutil.rmtree(workDir) shutil.rmtree(workDir)
os.makedirs(workDir) os.makedirs(workDir)
os.chdir(workDir) os.chdir(workDir)
plutoFile = getPlutoPath("auau", "8gev", plutoParticle, taskId) plutoFile = getPlutoPath(colSystem, colEnergy, plutoParticle, taskId)
urqmdFile = "/lustre/nyx/cbm/prod/gen/urqmd/auau/8gev/centr/urqmd.auau.8gev.centr.00001.root" #plutoFile = getPlutoPath("auau", "8gev", plutoParticle, taskId)
plutoFile = "/lustre/nyx/cbm/prod/gen/pluto/erik/cktA/8gev/omega/epem/pluto.auau.8gev.omega.epem.0001.root"
urqmdFile = "/lustre/nyx/cbm/prod/gen/urqmd/auau/"+colEnergy+"/centr/urqmd.auau.8gev.centr." + str(taskId).zfill(5) + ".root"
#urqmdFile = "/lustre/nyx/cbm/prod/gen/urqmd/auau/8gev/centr/urqmd.auau.8gev.centr.00001.root"
mcFile = dataDir + "/mc." + taskId + ".root" mcFile = dataDir + "/mc." + taskId + ".root"
parFile = dataDir + "/param." + taskId + ".root" parFile = dataDir + "/param." + taskId + ".root"
digiFile = dataDir + "/digi." + taskId + ".root" digiFile = dataDir + "/digi." + taskId + ".root"
...@@ -35,31 +41,33 @@ def main(): ...@@ -35,31 +41,33 @@ def main():
litQaFile = dataDir + "/litqa." + taskId + ".root" litQaFile = dataDir + "/litqa." + taskId + ".root"
analysisFile = dataDir + "/analysis." + taskId + ".root" analysisFile = dataDir + "/analysis." + taskId + ".root"
geoSimFile = dataDir + "/geosim." + taskId + ".root" geoSimFile = dataDir + "/geosim." + taskId + ".root"
os.system(('root -l -b -q {}/run/run_sim.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{},{},\\"{}\\",\\"{}\\",{}\)').format( os.system(('root -l -b -q {}/run_sim.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(
macroDir, urqmdFile, mcFile, parFile, geoSimFile, nofElectrons, nofPositrons, plutoFile, geoSetup, nofEvents)) macroDir, urqmdFile, plutoFile, mcFile, parFile, geoSimFile, geoSetup, nofEvents))
os.system(('root -l -b -q {}/run/run_digi.C\(\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format( os.system(('root -l -b -q {}/run_digi.C\(\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(
macroDir, mcFile, parFile, digiFile, nofEvents)) macroDir, mcFile, parFile, digiFile, nofEvents))
os.system(('root -l -b -q {}/run/run_reco.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format( os.system(('root -l -b -q {}/run_reco.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(
macroDir, mcFile, parFile, digiFile, recoFile, geoSetup, resultDir, nofEvents)) macroDir, mcFile, parFile, digiFile, recoFile, geoSetup, nofEvents))
os.system(('root -l -b -q {}/run/run_qa.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format( os.system(('root -l -b -q {}/run_litqa.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(
macroDir, mcFile, parFile, digiFile, recoFile, qaFile, geoSetup, resultDir, nofEvents)) macroDir, mcFile, parFile, digiFile, recoFile, litQaFile, geoSetup, nofEvents))
os.system(('root -l -b -q {}/run_analysis.C\(\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",\\"{}\\",{}\)').format(
macroDir, mcFile, parFile, digiFile, recoFile, analysisFile, plutoParticle, colSystem, colEnergy, geoSetup, nofEvents))
def getPlutoPath(colSystem, colEnergy, plutoParticle, index): def getPlutoPath(colSystem, colEnergy, plutoParticle, taskId):
if plutoParticle == "rho0": if plutoParticle == "rho0":
return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/${collEnergy}/rho0/epem/pluto.auau.${collEnergy}.rho0.epem.${XXXX}.root" return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/"+colEnergy+"/rho0/epem/pluto.auau."+colEnergy+".rho0.epem." + str(taskId).zfill(4) + ".root"
elif plutoParticle == "omegaepem": elif plutoParticle == "omegaepem":
return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/${collEnergy}/omega/epem/pluto.auau.${collEnergy}.omega.epem.${XXXX}.root" return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/"+colEnergy+"/omega/epem/pluto.auau."+colEnergy+".omega.epem." + str(taskId).zfill(4) + ".root"
elif plutoParticle == "omegadalitz": elif plutoParticle == "omegadalitz":
return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/${collEnergy}/omega/pi0epem/pluto.auau.${collEnergy}.omega.pi0epem.${XXXX}.root" return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/"+colEnergy+"/omega/pi0epem/pluto.auau."+colEnergy+".omega.pi0epem." + str(taskId).zfill(4) + ".root"
elif plutoParticle == "phi": elif plutoParticle == "phi":
return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/${collEnergy}/phi/epem/pluto.auau.${collEnergy}.phi.epem.${XXXX}.root" return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/"+colEnergy+"/phi/epem/pluto.auau."+colEnergy+".phi.epem." + str(taskId).zfill(4) + ".root"
elif plutoParticle == "pi0": elif plutoParticle == "pi0":
return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/${collEnergy}/pi0/gepem/pluto.auau.${collEnergy}.pi0.gepem.${XXXX}.root" return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktA/"+colEnergy+"/pi0/gepem/pluto.auau."+colEnergy+".pi0.gepem." + str(taskId).zfill(4) + ".root"
elif plutoParticle == "inmed": elif plutoParticle == "inmed":
return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktRapp/${collEnergy}/rapp.inmed/epem/pluto.auau.${collEnergy}.rapp.inmed.epem.${XXXX}.root" return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktRapp/"+colEnergy+"/rapp.inmed/epem/pluto.auau."+colEnergy+".rapp.inmed.epem." + str(taskId).zfill(4) + ".root"
elif plutoParticle == "qgp": elif plutoParticle == "qgp":
return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktRapp/${collEnergy}/rapp.qgp/epem/pluto.auau.${collEnergy}.rapp.qgp.epem.${XXXX}.root" return "/lustre/nyx/cbm/prod/gen/pluto/auau/cktRapp/"+colEnergy+"/rapp.qgp/epem/pluto.auau."+colEnergy+".rapp.qgp.epem." + str(taskId).zfill(4) + ".root"
elif plutoParticle == "urqmd": elif plutoParticle == "urqmd":
return "" return ""
......
...@@ -3,35 +3,52 @@ ...@@ -3,35 +3,52 @@
import os import os
import shutil import shutil
nofJobs = 648 def main():
timeLimit="08:00:00" nofJobs = 10
mirrorRotation=15 timeLimit="08:00:00"
#All data in data dir will be removed geoSetup="sis100_electron"
removeData = False plutoParticles = ["inmed", "omegadalitz", "phi", "omegaepem", "qgp"];
dataDir = "/lustre/nyx/cbm/users/slebedev/cbm/data/geoopt_m" + str(mirrorRotation) + "/"
logFile = dataDir + "/log/log_slurm-%A_%a.out" #ADDED
errorFile = dataDir + "/error/error_slurm-%A_%a.out" mirrorRotation=15
jobName = "RICH" + str(mirrorRotation) dataDir = "/lustre/nyx/cbm/users/criesen/cbm/data/lmvm/"
jobName = "RICH" + str(mirrorRotation)
if removeData:
print("All data in dataDir will be removed. Dir:" + dataDir) #All data in data dir will be removed
print("Removing...") removeData = False
if os.path.exists(dataDir): #jobName = "LMVM"
shutil.rmtree(dataDir) if removeData:
os.makedirs(dataDir) print("All data in dataDir will be removed. Dir:" + dataDir)
print("Removing...")
if os.path.exists(os.path.dirname(logFile)): if os.path.exists(dataDir):
shutil.rmtree(os.path.dirname(logFile)) shutil.rmtree(dataDir)
os.makedirs(os.path.dirname(logFile)) os.makedirs(dataDir,exist_ok=True)
if os.path.exists(os.path.dirname(errorFile)): for plutoParticle in plutoParticles:
shutil.rmtree(os.path.dirname(errorFile)) dataDirPluto = dataDir + plutoParticle
os.makedirs(os.path.dirname(errorFile)) logFile = dataDirPluto + "/log/log_slurm-%A_%a.out"
errorFile = dataDirPluto + "/error/error_slurm-%A_%a.out"
#-p debug workDir = dataDirPluto + "/workdir/"
commandStr=('sbatch --job-name={} --time={} --output={} --error={} --array=1-{} batch_job.py {} {}').format(jobName, timeLimit, logFile, errorFile, nofJobs, dataDir, mirrorRotation) makeLogErrorDirs(logFile, errorFile, workDir)
#-p debug
#print(commandStr) commandStr=('sbatch --job-name={} --time={} --output={} --error={} --array=1-{} batch_job.py {} {} {}').format(jobName, timeLimit, logFile, errorFile, nofJobs, dataDirPluto, geoSetup, plutoParticle)
os.system(commandStr)
os.system(commandStr)
def makeLogErrorDirs(logFile, errorFile, workDir):
if os.path.exists(os.path.dirname(logFile)):
shutil.rmtree(os.path.dirname(logFile))
os.makedirs(os.path.dirname(logFile),exist_ok=True)
if os.path.exists(os.path.dirname(errorFile)):
shutil.rmtree(os.path.dirname(errorFile))
os.makedirs(os.path.dirname(errorFile),exist_ok=True)
if os.path.exists(os.path.dirname(workDir)):
shutil.rmtree(os.path.dirname(workDir))
os.makedirs(os.path.dirname(workDir),exist_ok=True)
if __name__ == '__main__':
main()
#!/usr/bin/env python3
import os, shutil
def main():
plutoParticles = ["inmed", "phi", "omegaepem", "omegadalitz", "qgp"]
dataDir = "/lustre/nyx/cbm/users/criesen/cbm/data/lmvm/"
dataDirHistos = dataDir + "histograms/"
macroDir = "/lustre/cbm/users/criesen/cbmroot/macro/analysis/dielectron"
if os.path.exists(dataDirHistos):
shutil.rmtree(dataDirHistos)
os.mkdir(dataDirHistos)
for plutoParticle in plutoParticles:
outFile = dataDirHistos + plutoParticle
inFilesAna = dataDir + plutoParticle + "/analysis.all.root"
uMvd = False
drawSig = True
os.system(('root -l -b -q {}/draw_analysis.C\(\\"{}\\",\\"{}\\"\)').format(macroDir, inFilesAna, outFile, uMvd, drawSig))
inFilesLitqa = dataDir + plutoParticle + "/litqa.all.root"
os.system(('root -l -b -q {}/draw_litqa.C\(\\"{}\\",\\"{}\\"\)').format(macroDir, inFilesLitqa, outFile))
print("======================================================================================= DRAW ALL ==================================================================================")
os.system(('root -l -b -q {}/draw_analysis_all.C').format(macroDir)) # default values of macro will be taken (see there)
if __name__ == '__main__':
main()
/** draw_analysis.C //#include <experimental/filesystem>
* @author Elena Lebedeva <e.lebedeva@gsi.de>
* @since 2010
* @version 2.0
**/
void draw_analysis() { void draw_analysis(
const string& histRootFile =
"/lustre/nyx/cbm/users/criesen/cbm/data/lmvm/inmed/analysis.all.root",
const string& resultDir =
"/lustre/nyx/cbm/users/criesen/cbm/data/lmvm/histograms/inmed/",
Bool_t useMvd = false,
Bool_t drawSignificance = true)
Bool_t useMvd = false; {
Bool_t drawSignificance = true; string outputDir = resultDir + "lmvm_results/";
std::string dir = //std::filesystem::remove(outputDir);
"/Users/slebedev/Development/cbm/data/lmvm/agagtest/3.5gev/omegaepem/"; gSystem->mkdir(outputDir.c_str(), true);
std::string fileName = dir + "analysis.auau.3.5gev.centr.all.root";
std::string script = std::string(TString(gSystem->Getenv("SCRIPT")).Data());
if (script == "yes") {
dir = std::string(TString(gSystem->Getenv("LMVM_MAIN_DIR")).Data());
fileName =
dir + std::string(TString(gSystem->Getenv("LMVM_ANA_FILE_NAME")).Data());
}
std::string outputDir = dir + "lmvm_results/";
CbmAnaDielectronTaskDraw* draw = new CbmAnaDielectronTaskDraw(); CbmAnaDielectronTaskDraw* draw = new CbmAnaDielectronTaskDraw();
draw->DrawHistFromFile(fileName, outputDir, useMvd); //, drawSignificance); draw->DrawHistFromFile(histRootFile, outputDir, useMvd, drawSignificance);
} }
/** draw_analysis.C void draw_analysis_all(
* @author Elena Lebedeva <e.lebedeva@gsi.de> const string& fileInmed =
* @since 2011 "/lustre/nyx/cbm/users/criesen/cbm/data/lmvm/inmed/analysis.all.root",
* @version 3.0 const string& fileQgp =
**/ "/lustre/nyx/cbm/users/criesen/cbm/data/lmvm/qgp/analysis.all.root",
const string& fileOmega =
void draw_analysis_all() {